@sanity/ui 2.0.0-alpha.33 → 2.0.0-alpha.35

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.
Files changed (163) hide show
  1. package/dist/index.cjs.mjs +4 -3
  2. package/dist/index.d.ts +29 -22
  3. package/dist/index.esm.js +397 -515
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +413 -531
  6. package/dist/index.js.map +1 -1
  7. package/dist/theme.cjs.mjs +10 -4
  8. package/dist/theme.d.ts +450 -187
  9. package/dist/theme.esm.js +2933 -2750
  10. package/dist/theme.esm.js.map +1 -1
  11. package/dist/theme.js +2942 -2753
  12. package/dist/theme.js.map +1 -1
  13. package/package.json +3 -3
  14. package/src/core/_compat.ts +7 -7
  15. package/src/core/components/dialog/dialog.tsx +5 -5
  16. package/src/core/components/dialog/styles.ts +4 -5
  17. package/src/core/components/hotkeys/hotkeys.tsx +4 -2
  18. package/src/core/components/menu/__workshop__/avatarMenu.tsx +50 -0
  19. package/src/core/components/menu/__workshop__/index.ts +5 -0
  20. package/src/core/components/menu/menuItem.tsx +7 -1
  21. package/src/core/components/skeleton/textSkeleton.tsx +12 -14
  22. package/src/core/components/tree/style.ts +14 -17
  23. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +3 -3
  24. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +2 -3
  25. package/src/core/primitives/_selectable/style.ts +18 -18
  26. package/src/core/primitives/avatar/avatar.tsx +3 -3
  27. package/src/core/primitives/avatar/avatarCounter.tsx +4 -4
  28. package/src/core/primitives/avatar/avatarStack.tsx +2 -2
  29. package/src/core/primitives/avatar/styles.ts +7 -8
  30. package/src/core/primitives/avatar/types.ts +2 -2
  31. package/src/core/primitives/badge/__workshop__/props.tsx +1 -1
  32. package/src/core/primitives/badge/__workshop__/tones.tsx +1 -1
  33. package/src/core/primitives/badge/badge.tsx +1 -1
  34. package/src/core/primitives/badge/styles.ts +5 -6
  35. package/src/core/primitives/button/button.tsx +3 -4
  36. package/src/core/primitives/button/styles.ts +22 -23
  37. package/src/core/primitives/card/__workshop__/selected.tsx +15 -15
  38. package/src/core/primitives/card/card.tsx +1 -1
  39. package/src/core/primitives/card/styles.ts +22 -22
  40. package/src/core/primitives/checkbox/styles.ts +21 -22
  41. package/src/core/primitives/code/styles.ts +4 -1
  42. package/src/core/primitives/container/styles.ts +2 -3
  43. package/src/core/primitives/heading/styles.ts +4 -2
  44. package/src/core/primitives/inline/styles.ts +6 -6
  45. package/src/core/primitives/kbd/kbd.tsx +8 -3
  46. package/src/core/primitives/label/styles.ts +4 -3
  47. package/src/core/primitives/popover/helpers.ts +3 -4
  48. package/src/core/primitives/popover/popover.tsx +8 -4
  49. package/src/core/primitives/popover/types.ts +1 -1
  50. package/src/core/primitives/radio/styles.ts +17 -19
  51. package/src/core/primitives/select/styles.ts +27 -32
  52. package/src/core/primitives/stack/styles.ts +2 -3
  53. package/src/core/primitives/switch/__workshop__/props.tsx +11 -31
  54. package/src/core/primitives/switch/styles.ts +18 -21
  55. package/src/core/primitives/text/__workshop__/colored.tsx +10 -10
  56. package/src/core/primitives/text/styles.ts +9 -4
  57. package/src/core/primitives/tooltip/tooltip.tsx +3 -3
  58. package/src/core/styles/border/borderStyle.ts +6 -11
  59. package/src/core/styles/box/boxStyle.ts +5 -9
  60. package/src/core/styles/card/_cardColorStyle.ts +99 -0
  61. package/src/core/styles/card/index.ts +1 -0
  62. package/src/core/styles/flex/flexItemStyle.ts +2 -3
  63. package/src/core/styles/flex/flexStyle.ts +6 -11
  64. package/src/core/styles/font/responsiveFont.ts +4 -4
  65. package/src/core/styles/font/textAlignStyle.ts +3 -3
  66. package/src/core/styles/grid/gridItemStyle.ts +7 -13
  67. package/src/core/styles/grid/gridStyle.ts +9 -17
  68. package/src/core/styles/helpers.ts +5 -3
  69. package/src/core/styles/input/responsiveInputPaddingStyle.ts +6 -6
  70. package/src/core/styles/input/textInputStyle.ts +36 -40
  71. package/src/core/styles/margin/marginsStyle.test.ts +2 -3
  72. package/src/core/styles/padding/paddingStyle.test.ts +2 -3
  73. package/src/core/styles/radius/radiusStyle.ts +2 -3
  74. package/src/core/styles/shadow/shadowStyle.ts +4 -5
  75. package/src/core/theme/__workshop__/build/Root.tsx +24 -20
  76. package/src/core/theme/__workshop__/build/story.tsx +22 -26
  77. package/src/core/theme/__workshop__/canvas.tsx +21 -40
  78. package/src/core/theme/theme.test.tsx +2 -35
  79. package/src/core/theme/themeColorProvider.tsx +2 -2
  80. package/src/core/theme/themeContext.ts +2 -2
  81. package/src/core/theme/themeProvider.tsx +25 -25
  82. package/src/core/theme/types.ts +3 -2
  83. package/src/core/theme/useRootTheme.ts +1 -9
  84. package/src/core/theme/useTheme.ts +8 -1
  85. package/src/core/types/card.ts +2 -2
  86. package/src/core/utils/arrow/arrow.tsx +3 -3
  87. package/src/core/utils/elementQuery/elementQuery.tsx +3 -3
  88. package/src/core/utils/virtualList/virtualList.tsx +2 -2
  89. package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
  90. package/src/theme/build/buildColorTheme.test.ts +14 -15
  91. package/src/theme/build/buildColorTheme.ts +239 -292
  92. package/src/theme/build/buildTheme.test.ts +9 -7
  93. package/src/theme/build/buildTheme.ts +12 -9
  94. package/src/theme/build/colorToken.ts +3 -1
  95. package/src/theme/build/lib/color-fns/contrastRatio.ts +1 -0
  96. package/src/theme/build/lib/isRecord.ts +3 -0
  97. package/src/theme/build/merge.ts +18 -13
  98. package/src/theme/build/renderColorTheme.ts +205 -213
  99. package/src/theme/build/renderColorValue.ts +15 -8
  100. package/src/theme/build/resolveColorTokens.ts +177 -198
  101. package/src/theme/build/theme.test.ts +27 -0
  102. package/src/theme/config/helpers.ts +16 -8
  103. package/src/theme/config/system.ts +46 -17
  104. package/src/theme/config/tokens/color/types.ts +55 -32
  105. package/src/theme/config/tokens/types.ts +11 -4
  106. package/src/theme/config/types.ts +5 -11
  107. package/src/theme/{build/defaults → defaults}/colorPalette.ts +1 -1
  108. package/src/theme/{build/defaults → defaults}/colorTokens.ts +189 -136
  109. package/src/theme/{build/defaults → defaults}/config.ts +14 -12
  110. package/src/theme/{build/defaults → defaults}/fonts.ts +6 -6
  111. package/src/theme/getScopedTheme.ts +81 -0
  112. package/src/theme/index.ts +9 -1
  113. package/src/theme/system/avatar.ts +1 -1
  114. package/src/theme/system/color/_constants.ts +11 -11
  115. package/src/theme/system/color/_system.ts +10 -71
  116. package/src/theme/system/color/avatar.ts +22 -10
  117. package/src/theme/system/color/badge.ts +18 -7
  118. package/src/theme/system/color/button.ts +17 -23
  119. package/src/theme/system/color/color.ts +34 -0
  120. package/src/theme/system/color/index.ts +3 -10
  121. package/src/theme/system/color/input.ts +13 -11
  122. package/src/theme/system/color/kbd.ts +3 -3
  123. package/src/theme/system/color/selectable.ts +13 -19
  124. package/src/theme/system/color/shadow.ts +7 -0
  125. package/src/theme/system/color/state.ts +37 -0
  126. package/src/theme/system/css.ts +9 -0
  127. package/src/theme/system/focusRing.ts +7 -0
  128. package/src/theme/system/index.ts +5 -1
  129. package/src/theme/system/input.ts +1 -1
  130. package/src/theme/system/layer.ts +1 -2
  131. package/src/theme/system/shadow.ts +1 -0
  132. package/src/theme/system/styles.ts +19 -0
  133. package/src/theme/system/theme.ts +97 -0
  134. package/src/theme/system/{color → v0/color}/_generic.ts +2 -1
  135. package/src/theme/system/v0/color/_system.ts +13 -0
  136. package/src/theme/system/{color → v0/color}/base.ts +2 -0
  137. package/src/theme/system/v0/color/button.ts +42 -0
  138. package/src/theme/system/{color → v0/color}/card.ts +2 -1
  139. package/src/theme/system/v0/color/color.ts +40 -0
  140. package/src/theme/system/v0/color/index.ts +11 -0
  141. package/src/theme/system/v0/color/input.ts +34 -0
  142. package/src/theme/system/{color/_deprecated → v0/color}/muted.ts +1 -1
  143. package/src/theme/system/v0/color/selectable.ts +31 -0
  144. package/src/theme/system/{color/_deprecated → v0/color}/solid.ts +1 -1
  145. package/src/theme/system/v0/color/spot.ts +13 -0
  146. package/src/theme/system/v0/index.ts +1 -0
  147. package/src/theme/versioning/getTheme_v2.ts +35 -0
  148. package/src/theme/versioning/index.ts +5 -0
  149. package/src/theme/versioning/is_v0.ts +6 -0
  150. package/src/theme/versioning/is_v2.ts +6 -0
  151. package/src/theme/versioning/themeColor_v0_v2.ts +217 -0
  152. package/src/theme/versioning/v0_v2.ts +70 -0
  153. package/src/theme/versioning/v2_v0.ts +128 -0
  154. package/src/core/styles/colorVars/colorVarsStyle.ts +0 -43
  155. package/src/core/styles/colorVars/index.ts +0 -1
  156. package/src/core/theme/defaults.ts +0 -7
  157. package/src/theme/system/_system.ts +0 -95
  158. package/src/theme/system/color/_deprecated/spot.ts +0 -13
  159. package/src/theme/themes/studio/config.ts +0 -69
  160. package/src/theme/themes/studio/fonts.ts +0 -219
  161. package/src/theme/themes/studio/index.ts +0 -1
  162. package/src/theme/themes/studio/studioTheme.test.ts +0 -27
  163. 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
- return _responsive(theme.sanity.media, spaceIndexes, spaceIndex => _fillCSSObject(props, rem(theme.sanity.space[spaceIndex])));
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
- fonts,
69
+ font,
67
70
  media
68
- } = theme.sanity;
71
+ } = theme.getTheme_v2(props.theme);
69
72
  const {
70
73
  family,
71
74
  sizes,
72
75
  weights
73
- } = fonts[fontKey];
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
- theme
161
- } = props;
162
- return _responsive(theme.sanity.media, props.$align, textAlign => {
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: themeProp = (parentTheme == null ? void 0 : parentTheme.theme) || null,
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 theme = react.useMemo(() => {
872
- if (!themeProp) return null;
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
- sanity: {
883
- ...restTheme,
884
- color,
885
- layer
886
- }
866
+ version: 0,
867
+ theme: rootTheme,
868
+ scheme,
869
+ tone
887
870
  };
888
- }, [scheme, themeProp, tone]);
889
- const value = react.useMemo(() => themeProp && {
890
- version: 0,
891
- theme: themeProp,
892
- scheme,
893
- tone
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
- } = theme.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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.sanity;
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
- fonts,
1449
+ font,
1561
1450
  media,
1562
- space: spaceScale
1563
- } = theme.sanity;
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 = fonts.text.sizes[_fontSize[i]] || fonts.text.sizes[2];
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 = spaceScale[_padding[i]];
1577
- const s = spaceScale[_space[i]];
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 font = theme.sanity.fonts.text;
1613
- const color = theme.sanity.color.input;
1614
- 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.family, $weight && font.weights[$weight] || font.weights.regular, $scheme, $tone, color.default.enabled.fg, color.default.enabled.placeholder, color.default.enabled.fg, color.default.enabled.placeholder, color.default.disabled.fg, color.default.disabled.placeholder, color.invalid.enabled.fg, color.invalid.enabled.placeholder, color.default.readOnly.fg, color.default.readOnly.placeholder);
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
- theme
1619
- } = props;
1620
- const {
1621
- fonts,
1508
+ font,
1622
1509
  media
1623
- } = theme.sanity;
1510
+ } = theme.getTheme_v2(props.theme);
1624
1511
  return _responsive(media, props.$fontSize, sizeIndex => {
1625
- const size = fonts.text.sizes[sizeIndex] || fonts.text.sizes[2];
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.sanity;
1644
- const {
1645
- focusRing
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.sanity;
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
- shadows
1725
- } = theme.sanity;
1726
- return _responsive(media, props.$shadow, shadow => shadowStyle(shadows[shadow], card.shadow.outline));
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
- fonts
1742
- } = theme.sanity;
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 "]))), fonts.code.family);
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
- focusRing
1840
- } = theme.sanity.avatar;
1713
+ avatar
1714
+ } = theme.getTheme_v2(props.theme);
1841
1715
  return {
1842
- "--avatar-bg-color": ((_b = (_a = theme.sanity.color.avatar) == null ? void 0 : _a[$color]) == null ? void 0 : _b.bg) || theme.sanity.color.spot[$color],
1843
- "--avatar-fg-color": ((_d = (_c = theme.sanity.color.avatar) == null ? void 0 : _c[$color]) == null ? void 0 : _d.fg) || "var(--card-bg-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.sanity;
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 theme = useTheme();
1965
- const avatarSize = theme.sanity.avatar.sizes[size[0]] || theme.sanity.avatar.sizes[0];
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
- weights
2069
- } = theme.sanity.fonts.text;
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 "]))), theme.sanity.fonts.code.family, weights.bold);
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.sanity;
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
- theme
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(theme.sanity.space[2]));
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.sanity;
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": color.bg,
2303
- "--card-fg-color": color.fg,
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 = 2,
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 _colorVarsStyle(base, color) {
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
- // Base
2385
- // @todo: rename to "--base-"?
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
- "--card-focus-ring-color": base.focusRing,
2391
- "--card-icon-color": color.icon,
2392
- // Card
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-bg2-color": color.bg2,
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-muted-fg-color": (_a = color.muted) == null ? void 0 : _a.fg,
2399
- "--card-accent-fg-color": (_b = color.accent) == null ? void 0 : _b.fg,
2400
- "--card-link-fg-color": (_c = color.link) == null ? void 0 : _c.fg,
2401
- "--card-code-bg-color": (_d = color.code) == null ? void 0 : _d.bg,
2402
- "--card-code-fg-color": (_e = color.code) == null ? void 0 : _e.fg,
2403
- "--card-skeleton-color-from": (_f = color.skeleton) == null ? void 0 : _f.from,
2404
- "--card-skeleton-color-to": (_g = color.skeleton) == null ? void 0 : _g.to,
2405
- // @todo: deprecate
2406
- "--card-link-color": (_h = color.link) == null ? void 0 : _h.fg,
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(_ref2) {
2418
- let {
2419
- $width,
2420
- theme
2421
- } = _ref2;
2321
+ function buttonBaseStyles(props) {
2422
2322
  const {
2423
- styles
2424
- } = theme.sanity;
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 "])), styles == null ? void 0 : styles.button, $width === "fill" && styled.css(_a$v || (_a$v = __template$v(["\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n "]))));
2323
+ $width
2324
+ } = props;
2325
+ const {
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, _b2;
2337
+ var _a2;
2435
2338
  const {
2436
- $mode,
2437
- theme
2339
+ $mode
2438
2340
  } = props;
2439
- const buttonTheme = theme.sanity.button;
2341
+ const {
2342
+ button,
2343
+ color: baseColor,
2344
+ style
2345
+ } = theme.getTheme_v2(props.theme);
2440
2346
  const shadow = props.$mode === "ghost";
2441
- const base = theme.sanity.color.base;
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: buttonTheme.border.width,
2350
+ width: button.border.width,
2446
2351
  color: "var(--card-border-color)"
2447
2352
  };
2448
2353
  const defaultBoxShadow = void 0;
2449
- return [_colorVarsStyle(base, color.enabled), {
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"]': _colorVarsStyle(base, color.disabled),
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: base.bg
2366
+ color: baseColor.bg
2462
2367
  },
2463
- focusRing: buttonTheme.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": _colorVarsStyle(base, color.hovered),
2471
- "&:active": _colorVarsStyle(base, color.pressed),
2472
- "&[data-hovered]": _colorVarsStyle(base, color.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]": _colorVarsStyle(base, color.pressed)
2379
+ "&[data-selected]": _cardColorStyle(baseColor, color.pressed)
2475
2380
  }
2476
- }, (_b2 = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.button) == null ? void 0 : _b2.root].filter(Boolean);
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: theme.sanity.button.textWeight,
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 space = theme.sanity.space;
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, _b2;
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
- dark
2612
- } = theme.sanity.color;
2514
+ color,
2515
+ style
2516
+ } = theme.getTheme_v2(props.theme);
2613
2517
  const border = {
2614
- width: 0,
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 "])), dark ? "dark" : "light", _colorVarsStyle(base, card.enabled, $checkered), _colorVarsStyle(base, card.disabled, $checkered), _colorVarsStyle(base, card.pressed, $checkered), _colorVarsStyle(base, card.selected, $checkered), _colorVarsStyle(base, card.hovered, $checkered), _colorVarsStyle(base, card.pressed, $checkered), $focusRing ? focusRingStyle({
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, _colorVarsStyle(base, card.disabled, $checkered), _colorVarsStyle(base, card.pressed, $checkered), _colorVarsStyle(base, card.selected, $checkered), _colorVarsStyle(base, card.hovered, $checkered), _colorVarsStyle(base, card.pressed, $checkered), $focusRing ? focusRingStyle({
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, (_b2 = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.card) == null ? void 0 : _b2.root);
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
- theme
2689
- } = props;
2690
- const color = theme.sanity.color.input;
2691
- const {
2592
+ color,
2692
2593
  input,
2693
2594
  radius
2694
- } = theme.sanity;
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.bg2
2714
- }), color.default.disabled.fg, color.invalid.enabled.bg2, color.default.enabled.bg, focusRingStyle({
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.bg2
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.bg2, color.default.readOnly.bg, focusRingBorderStyle({
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.bg2);
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(_ref3) {
2676
+ function codeSyntaxHighlightingStyle(_ref2) {
2776
2677
  let {
2777
- theme
2778
- } = _ref3;
2779
- const color = theme.sanity.color.syntax;
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.sanity;
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
- 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 "]))), theme.sanity.fonts.code.family);
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
- theme
3054
- } = props;
3055
- return _responsive(theme.sanity.media, props.$space, spaceIndex => {
3056
- const space = rem(theme.sanity.space[spaceIndex]);
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(space, " 0 0 -").concat(space),
2963
+ margin: "-".concat(_space, " 0 0 -").concat(_space),
3059
2964
  "& > div": {
3060
- padding: "".concat(space, " 0 0 ").concat(space)
2965
+ padding: "".concat(_space, " 0 0 ").concat(_space)
3061
2966
  }
3062
2967
  };
3063
2968
  });
@@ -3089,13 +2994,13 @@ var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
3089
2994
  }));
3090
2995
  var _a$o;
3091
2996
  function kbdStyle() {
3092
- return styled.css(_a$o || (_a$o = __template$o(["\n background: var(--card-bg2-color);\n font: inherit;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
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 "])));
3093
2998
  }
3094
2999
  const Root$m = styled__default.default.kbd(responsiveRadiusStyle, kbdStyle);
3095
3000
  const KBD = react.forwardRef(function KBD2(props, ref) {
3096
3001
  const {
3097
3002
  children,
3098
- fontSize = 1,
3003
+ fontSize = 0,
3099
3004
  padding = 1,
3100
3005
  radius = 2,
3101
3006
  ...restProps
@@ -3110,9 +3015,8 @@ const KBD = react.forwardRef(function KBD2(props, ref) {
3110
3015
  padding,
3111
3016
  children: /* @__PURE__ */jsxRuntime.jsx(Text, {
3112
3017
  as: "span",
3113
- muted: true,
3114
3018
  size: fontSize,
3115
- weight: "medium",
3019
+ weight: "semibold",
3116
3020
  children
3117
3021
  })
3118
3022
  })
@@ -3178,10 +3082,10 @@ var __template$n = (cooked, raw) => __freeze$n(__defProp$o(cooked, "raw", {
3178
3082
  value: __freeze$n(raw || cooked.slice())
3179
3083
  }));
3180
3084
  var _a$n, _b$f, _c$7;
3181
- const Root$l = styled__default.default.div(_ref4 => {
3085
+ const Root$l = styled__default.default.div(_ref3 => {
3182
3086
  let {
3183
3087
  $w: w
3184
- } = _ref4;
3088
+ } = _ref3;
3185
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);
3186
3090
  });
3187
3091
  const StrokePath = styled__default.default.path(_b$f || (_b$f = __template$n(["\n stroke: var(--card-shadow-outline-color);\n"])));
@@ -3193,8 +3097,10 @@ const Arrow = react.forwardRef(function Arrow2(props, ref) {
3193
3097
  radius = 0,
3194
3098
  ...restProps
3195
3099
  } = props;
3196
- const theme = useTheme();
3197
- const strokeWidth = theme.sanity.card.shadow.outline;
3100
+ const {
3101
+ card
3102
+ } = useTheme_v2();
3103
+ const strokeWidth = card.shadow.outline;
3198
3104
  const center = w / 2;
3199
3105
  const points = [{
3200
3106
  x: 0,
@@ -3263,6 +3169,9 @@ function BoundaryElementProvider(props) {
3263
3169
  children
3264
3170
  });
3265
3171
  }
3172
+ function isRecord(value) {
3173
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
3174
+ }
3266
3175
  const DEFAULT_VALUE = {
3267
3176
  version: 0,
3268
3177
  element: null
@@ -3295,10 +3204,10 @@ function findMinBreakpoints(media, width) {
3295
3204
  return ret;
3296
3205
  }
3297
3206
  const ElementQuery = react.forwardRef(function ElementQuery2(props, ref) {
3298
- const theme = useTheme();
3207
+ const theme = useTheme_v2();
3299
3208
  const {
3300
3209
  children,
3301
- media = theme.sanity.media,
3210
+ media = theme.media,
3302
3211
  ...restProps
3303
3212
  } = props;
3304
3213
  const forwardedRef = useForwardedRef(ref);
@@ -3740,7 +3649,7 @@ const VirtualList = react.forwardRef(function VirtualList2(props, ref) {
3740
3649
  } = props;
3741
3650
  const {
3742
3651
  space
3743
- } = useTheme().sanity;
3652
+ } = useTheme_v2();
3744
3653
  const forwardedRef = useForwardedRef(ref);
3745
3654
  const wrapperRef = react.useRef(null);
3746
3655
  const [scrollTop, setScrollTop] = react.useState(0);
@@ -3933,13 +3842,13 @@ function size(options) {
3933
3842
  }
3934
3843
  function calcCurrentWidth(params) {
3935
3844
  const {
3845
+ container,
3936
3846
  mediaIndex,
3937
- theme,
3938
3847
  width
3939
3848
  } = params;
3940
3849
  const w = width[mediaIndex];
3941
3850
  const currentWidth = w === void 0 ? width[width.length - 1] : w;
3942
- return typeof currentWidth === "number" ? theme.sanity.container[currentWidth] : void 0;
3851
+ return typeof currentWidth === "number" ? container[currentWidth] : void 0;
3943
3852
  }
3944
3853
  function calcMaxWidth(params) {
3945
3854
  const {
@@ -4034,8 +3943,11 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
4034
3943
  }));
4035
3944
  PopoverCard.displayName = "PopoverCard";
4036
3945
  const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
4037
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
4038
- const theme = useTheme();
3946
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3947
+ const {
3948
+ container,
3949
+ layer
3950
+ } = useTheme_v2();
4039
3951
  const boundaryElementContext = useBoundaryElement();
4040
3952
  const {
4041
3953
  __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
@@ -4063,11 +3975,11 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
4063
3975
  shadow: shadowProp = 3,
4064
3976
  tone = "inherit",
4065
3977
  width: widthProp = "auto",
4066
- zOffset: zOffsetProp = (_e = theme.sanity.layer) == null ? void 0 : _e.popover.zOffset,
3978
+ zOffset: zOffsetProp = layer.popover.zOffset,
4067
3979
  updateRef,
4068
3980
  ...restProps
4069
3981
  } = props;
4070
- const boundarySize = (_f = useElementSize(boundaryElement)) == null ? void 0 : _f.border;
3982
+ const boundarySize = (_e = useElementSize(boundaryElement)) == null ? void 0 : _e.border;
4071
3983
  const padding = useArrayProp(paddingProp);
4072
3984
  const radius = useArrayProp(radiusProp);
4073
3985
  const shadow = useArrayProp(shadowProp);
@@ -4079,8 +3991,8 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
4079
3991
  const mediaIndex = useMediaIndex();
4080
3992
  const boundaryWidth = constrainSize || preventOverflow ? boundarySize == null ? void 0 : boundarySize.width : void 0;
4081
3993
  const width = calcCurrentWidth({
3994
+ container,
4082
3995
  mediaIndex,
4083
- theme,
4084
3996
  width: widthArrayProp
4085
3997
  });
4086
3998
  const widthRef = react.useRef(width);
@@ -4126,13 +4038,13 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
4126
4038
  }));
4127
4039
  if (constrainSize || matchReferenceWidth) {
4128
4040
  ret.push(size({
4129
- apply(_ref5) {
4041
+ apply(_ref4) {
4130
4042
  let {
4131
4043
  availableWidth,
4132
4044
  availableHeight,
4133
4045
  elements,
4134
4046
  referenceWidth
4135
- } = _ref5;
4047
+ } = _ref4;
4136
4048
  referenceWidthRef.current = referenceWidth;
4137
4049
  const _currentWidth = widthRef.current;
4138
4050
  const _maxWidth = maxWidthRef.current;
@@ -4186,9 +4098,9 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
4186
4098
  placement: placementProp,
4187
4099
  whileElementsMounted: reactDom$1.autoUpdate
4188
4100
  });
4189
- const referenceHidden = (_g = middlewareData.hide) == null ? void 0 : _g.referenceHidden;
4190
- const arrowX = (_h = middlewareData.arrow) == null ? void 0 : _h.x;
4191
- const arrowY = (_i = middlewareData.arrow) == null ? void 0 : _i.y;
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;
4192
4104
  const setArrow = react.useCallback(arrowEl => {
4193
4105
  arrowRef.current = arrowEl;
4194
4106
  }, []);
@@ -4272,32 +4184,26 @@ function radioBaseStyle() {
4272
4184
  }
4273
4185
  function inputElementStyle(props) {
4274
4186
  const {
4275
- theme
4276
- } = props;
4277
- const {
4187
+ color,
4278
4188
  input
4279
- } = theme.sanity;
4280
- const {
4281
- focusRing
4282
- } = input.radio;
4283
- const color = theme.sanity.color.input;
4189
+ } = theme.getTheme_v2(props.theme);
4284
4190
  const dist = (input.radio.size - input.radio.markSize) / 2;
4285
- 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({
4286
- 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,
4287
4193
  width: input.border.width
4288
- }), 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({
4289
4195
  border: {
4290
4196
  width: input.border.width,
4291
- color: color.default.enabled.border
4197
+ color: color.input.default.enabled.border
4292
4198
  },
4293
- focusRing
4199
+ focusRing: input.radio.focusRing
4294
4200
  }), focusRingBorderStyle({
4295
- color: color.default.enabled.border,
4201
+ color: color.input.default.enabled.border,
4296
4202
  width: input.border.width
4297
- }), color.invalid.enabled.border, focusRingBorderStyle({
4203
+ }), color.input.invalid.enabled.border, focusRingBorderStyle({
4298
4204
  width: input.border.width,
4299
- color: color.invalid.enabled.bg2
4300
- }), color.invalid.enabled.bg2, color.default.readOnly.border, color.default.readOnly.bg, color.default.readOnly.border, color.default.disabled.border, color.default.disabled.bg, color.default.disabled.border);
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);
4301
4207
  }
4302
4208
  const Root$g = styled__default.default.div(radioBaseStyle);
4303
4209
  const Input$4 = styled__default.default.input(inputElementStyle);
@@ -4338,39 +4244,32 @@ function rootStyle() {
4338
4244
  }
4339
4245
  function inputBaseStyle(props) {
4340
4246
  const {
4341
- theme
4342
- } = props;
4343
- const font = theme.sanity.fonts.text;
4344
- 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);
4345
4250
  }
4346
4251
  function inputColorStyle(props) {
4347
4252
  const {
4348
- theme
4349
- } = props;
4350
- const {
4253
+ color,
4351
4254
  input
4352
- } = theme.sanity;
4353
- const {
4354
- focusRing
4355
- } = input.select;
4356
- const color = theme.sanity.color.input;
4357
- 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({
4358
- 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,
4359
4258
  width: input.border.width
4360
- }), color.default.hovered.bg, color.default.hovered.fg, focusRingBorderStyle({
4361
- color: color.default.hovered.border,
4259
+ }), color.input.default.hovered.bg, color.input.default.hovered.fg, focusRingBorderStyle({
4260
+ color: color.input.default.hovered.border,
4362
4261
  width: input.border.width
4363
4262
  }), focusRingStyle({
4364
4263
  border: {
4365
4264
  width: input.border.width,
4366
- color: color.default.enabled.border
4265
+ color: color.input.default.enabled.border
4367
4266
  },
4368
- focusRing
4369
- }), color.default.readOnly.bg, color.default.readOnly.fg, focusRingBorderStyle({
4370
- 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,
4371
4270
  width: input.border.width
4372
- }), color.default.disabled.bg, color.default.disabled.fg, focusRingBorderStyle({
4373
- color: color.default.disabled.border,
4271
+ }), color.input.default.disabled.bg, color.input.default.disabled.fg, focusRingBorderStyle({
4272
+ color: color.input.default.disabled.border,
4374
4273
  width: input.border.width
4375
4274
  }));
4376
4275
  }
@@ -4382,23 +4281,22 @@ function textSize(size) {
4382
4281
  }
4383
4282
  function inputTextSizeStyle(props) {
4384
4283
  const {
4385
- theme,
4386
4284
  $fontSize
4387
4285
  } = props;
4388
4286
  const {
4389
- sizes
4390
- } = theme.sanity.fonts.text;
4391
- return _responsive(theme.sanity.media, $fontSize, sizeIndex => textSize(sizes[sizeIndex] || sizes[2]));
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]));
4392
4291
  }
4393
4292
  function inputStyle() {
4394
4293
  return [responsiveRadiusStyle, inputBaseStyle, inputColorStyle, inputTextSizeStyle, responsiveInputPaddingIconRightStyle];
4395
4294
  }
4396
4295
  function iconBoxStyle(props) {
4397
4296
  const {
4398
- theme
4399
- } = props;
4400
- const color = theme.sanity.color.input;
4401
- 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);
4402
4300
  }
4403
4301
  const selectStyle = {
4404
4302
  root: rootStyle,
@@ -4458,13 +4356,10 @@ function stackBaseStyle() {
4458
4356
  return BASE_STYLE;
4459
4357
  }
4460
4358
  function responsiveStackSpaceStyle(props) {
4461
- const {
4462
- theme
4463
- } = props;
4464
4359
  const {
4465
4360
  media,
4466
4361
  space
4467
- } = theme.sanity;
4362
+ } = theme.getTheme_v2(props.theme);
4468
4363
  return _responsive(media, props.$space, spaceIndex => ({
4469
4364
  gridGap: rem(space[spaceIndex])
4470
4365
  }));
@@ -4499,36 +4394,26 @@ function switchInputStyles() {
4499
4394
  }
4500
4395
  function switchRepresentationStyles(props) {
4501
4396
  const {
4502
- theme
4503
- } = props;
4504
- const {
4397
+ color,
4505
4398
  input
4506
- } = theme.sanity;
4507
- const {
4508
- focusRing
4509
- } = input.switch;
4510
- const color = theme.sanity.color.input;
4511
- 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({
4512
- focusRing
4513
- }), 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);
4514
4403
  }
4515
4404
  function switchTrackStyles(props) {
4516
- const {
4517
- theme
4518
- } = props;
4519
4405
  const {
4520
4406
  input
4521
- } = theme.sanity;
4407
+ } = theme.getTheme_v2(props.theme);
4522
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));
4523
4409
  }
4524
4410
  function switchThumbStyles(props) {
4525
4411
  const {
4526
- $indeterminate,
4527
- theme
4412
+ $indeterminate
4528
4413
  } = props;
4529
4414
  const {
4530
4415
  input
4531
- } = theme.sanity;
4416
+ } = theme.getTheme_v2(props.theme);
4532
4417
  const trackWidth = input.switch.width;
4533
4418
  const trackHeight = input.switch.height;
4534
4419
  const trackPadding = input.switch.padding;
@@ -4822,12 +4707,12 @@ function useDelayedState(initialState) {
4822
4707
  }, []);
4823
4708
  return [state, onStateChange];
4824
4709
  }
4825
- function ConditionalWrapper(_ref6) {
4710
+ function ConditionalWrapper(_ref5) {
4826
4711
  let {
4827
4712
  children,
4828
4713
  condition,
4829
4714
  wrapper
4830
- } = _ref6;
4715
+ } = _ref5;
4831
4716
  if (!condition) {
4832
4717
  return children;
4833
4718
  }
@@ -4888,16 +4773,18 @@ var __template$f = (cooked, raw) => __freeze$f(__defProp$f(cooked, "raw", {
4888
4773
  value: __freeze$f(raw || cooked.slice())
4889
4774
  }));
4890
4775
  var _a$f;
4891
- const Root$a = styled__default.default(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), _ref7 => {
4776
+ const Root$a = styled__default.default(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), _ref6 => {
4892
4777
  let {
4893
4778
  $maxWidth
4894
- } = _ref7;
4779
+ } = _ref6;
4895
4780
  return $maxWidth;
4896
4781
  });
4897
4782
  const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
4898
- var _a2, _b, _c, _d, _e, _f;
4783
+ var _a2, _b, _c, _d, _e;
4899
4784
  const boundaryElementContext = useBoundaryElement();
4900
- const theme = useTheme();
4785
+ const {
4786
+ layer
4787
+ } = useTheme_v2();
4901
4788
  const {
4902
4789
  arrow: arrowProp = false,
4903
4790
  boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
@@ -4911,7 +4798,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
4911
4798
  radius = 2,
4912
4799
  scheme,
4913
4800
  shadow = 2,
4914
- zOffset = (_c = theme.sanity.layer) == null ? void 0 : _c.tooltip.zOffset,
4801
+ zOffset = layer.tooltip.zOffset,
4915
4802
  delay,
4916
4803
  animate = false,
4917
4804
  ...restProps
@@ -4922,7 +4809,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
4922
4809
  const arrowRef = react.useRef(null);
4923
4810
  const rootBoundary = "viewport";
4924
4811
  const portal = usePortal();
4925
- const portalElement = typeof portalProp === "string" ? ((_d = portal.elements) == null ? void 0 : _d[portalProp]) || null : portal.element;
4812
+ const portalElement = typeof portalProp === "string" ? ((_c = portal.elements) == null ? void 0 : _c[portalProp]) || null : portal.element;
4926
4813
  const tooltipWidth = react.useMemo(() => {
4927
4814
  const availableWidths = [...(boundaryElement ? [boundaryElement.offsetWidth] : []), (portalElement == null ? void 0 : portalElement.offsetWidth) || document.body.offsetWidth];
4928
4815
  return Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2;
@@ -4962,8 +4849,8 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
4962
4849
  placement: placementProp,
4963
4850
  whileElementsMounted: reactDom$1.autoUpdate
4964
4851
  });
4965
- const arrowX = (_e = middlewareData.arrow) == null ? void 0 : _e.x;
4966
- const arrowY = (_f = middlewareData.arrow) == null ? void 0 : _f.y;
4852
+ const arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x;
4853
+ const arrowY = (_e = middlewareData.arrow) == null ? void 0 : _e.y;
4967
4854
  const arrowStyle = react.useMemo(() => ({
4968
4855
  left: arrowX !== null ? arrowX : void 0,
4969
4856
  top: arrowY !== null ? arrowY : void 0,
@@ -5307,10 +5194,10 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
5307
5194
  query,
5308
5195
  value
5309
5196
  } = state;
5310
- const defaultRenderOption = react.useCallback(_ref8 => {
5197
+ const defaultRenderOption = react.useCallback(_ref7 => {
5311
5198
  let {
5312
5199
  value: value2
5313
- } = _ref8;
5200
+ } = _ref7;
5314
5201
  return /* @__PURE__ */jsxRuntime.jsx(Card, {
5315
5202
  "data-as": "button",
5316
5203
  padding: paddingProp,
@@ -5769,11 +5656,13 @@ var __template$c = (cooked, raw) => __freeze$c(__defProp$c(cooked, "raw", {
5769
5656
  value: __freeze$c(raw || cooked.slice())
5770
5657
  }));
5771
5658
  var _a$c, _b$7;
5772
- function dialogStyle(_ref9) {
5659
+ function dialogStyle(_ref8) {
5773
5660
  let {
5774
- theme
5775
- } = _ref9;
5776
- const color = theme.sanity.color.base;
5661
+ theme: theme$1
5662
+ } = _ref8;
5663
+ const {
5664
+ color
5665
+ } = theme.getTheme_v2(theme$1);
5777
5666
  return {
5778
5667
  "&:not([hidden])": {
5779
5668
  display: "flex"
@@ -5785,16 +5674,13 @@ function dialogStyle(_ref9) {
5785
5674
  alignItems: "center",
5786
5675
  justifyContent: "center",
5787
5676
  outline: "none",
5788
- background: color.shadow.umbra
5677
+ background: color.backdrop
5789
5678
  };
5790
5679
  }
5791
5680
  function responsiveDialogPositionStyle(props) {
5792
- const {
5793
- theme
5794
- } = props;
5795
5681
  const {
5796
5682
  media
5797
- } = theme.sanity;
5683
+ } = theme.getTheme_v2(props.theme);
5798
5684
  return _responsive(media, props.$position, position => ({
5799
5685
  "&&": {
5800
5686
  position
@@ -5946,14 +5832,16 @@ const DialogCard = react.forwardRef(function DialogCard2(props, ref) {
5946
5832
  });
5947
5833
  });
5948
5834
  const Dialog = react.forwardRef(function Dialog2(props, ref) {
5949
- var _a2, _b2;
5835
+ var _a2;
5950
5836
  const dialog = useDialog();
5951
- const theme = useTheme();
5837
+ const {
5838
+ layer
5839
+ } = useTheme_v2();
5952
5840
  const {
5953
5841
  __unstable_autoFocus: autoFocus = true,
5954
5842
  __unstable_hideCloseButton: hideCloseButton = false,
5955
- cardRadius: cardRadiusProp = 3,
5956
- cardShadow = 4,
5843
+ cardRadius: cardRadiusProp = 4,
5844
+ cardShadow = 3,
5957
5845
  children,
5958
5846
  contentRef,
5959
5847
  footer,
@@ -5968,12 +5856,12 @@ const Dialog = react.forwardRef(function Dialog2(props, ref) {
5968
5856
  position: positionProp = dialog.position || "fixed",
5969
5857
  scheme,
5970
5858
  width: widthProp = 0,
5971
- zOffset: zOffsetProp = dialog.zOffset || ((_a2 = theme.sanity.layer) == null ? void 0 : _a2.dialog.zOffset),
5859
+ zOffset: zOffsetProp = dialog.zOffset || layer.dialog.zOffset,
5972
5860
  animate = false,
5973
5861
  ...restProps
5974
5862
  } = props;
5975
5863
  const portal = usePortal();
5976
- const portalElement = portalProp ? ((_b2 = portal.elements) == null ? void 0 : _b2[portalProp]) || null : portal.element;
5864
+ const portalElement = portalProp ? ((_a2 = portal.elements) == null ? void 0 : _a2[portalProp]) || null : portal.element;
5977
5865
  const boundaryElement = useBoundaryElement().element;
5978
5866
  const cardRadius = useArrayProp(cardRadiusProp);
5979
5867
  const padding = useArrayProp(paddingProp);
@@ -6084,7 +5972,7 @@ var __template$a = (cooked, raw) => __freeze$a(__defProp$a(cooked, "raw", {
6084
5972
  value: __freeze$a(raw || cooked.slice())
6085
5973
  }));
6086
5974
  var _a$a, _b$5;
6087
- const Root$6 = styled__default.default.kbd(_a$a || (_a$a = __template$a(["\n &:not([hidden]) {\n display: block;\n }\n font: inherit;\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"])));
6088
5976
  const Key = styled__default.default(KBD)(_b$5 || (_b$5 = __template$a(["\n &:not([hidden]) {\n display: block;\n }\n"])));
6089
5977
  const Hotkeys = react.forwardRef(function Hotkeys2(props, ref) {
6090
5978
  const {
@@ -6092,7 +5980,7 @@ const Hotkeys = react.forwardRef(function Hotkeys2(props, ref) {
6092
5980
  keys,
6093
5981
  padding,
6094
5982
  radius,
6095
- space: spaceProp = 1,
5983
+ space: spaceProp = 0.5,
6096
5984
  ...restProps
6097
5985
  } = props;
6098
5986
  const space = useArrayProp(spaceProp);
@@ -6562,18 +6450,16 @@ function selectableBaseStyle() {
6562
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 "])));
6563
6451
  }
6564
6452
  function selectableColorStyle(props) {
6565
- var _a2, _b2;
6453
+ var _a2;
6566
6454
  const {
6567
- $tone,
6568
- theme
6455
+ $tone
6569
6456
  } = props;
6570
6457
  const {
6571
- base,
6572
- muted,
6573
- selectable
6574
- } = theme.sanity.color;
6575
- const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
6576
- 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);
6577
6463
  }
6578
6464
  const Selectable = styled__default.default(Box)(responsiveRadiusStyle, selectableBaseStyle, selectableColorStyle);
6579
6465
  function useMenu() {
@@ -6776,6 +6662,7 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
6776
6662
  paddingBottom,
6777
6663
  paddingLeft
6778
6664
  }), [padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft]);
6665
+ const hotkeysFontSize = useArrayProp(fontSize).map(s => s - 1);
6779
6666
  const setRef = react.useCallback(el => {
6780
6667
  ref.current = el;
6781
6668
  setRootElement(el);
@@ -6817,7 +6704,7 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
6817
6704
  children: text
6818
6705
  })
6819
6706
  }), hotkeys && /* @__PURE__ */jsxRuntime.jsx(Hotkeys, {
6820
- fontSize,
6707
+ fontSize: hotkeysFontSize,
6821
6708
  keys: hotkeys,
6822
6709
  style: {
6823
6710
  marginTop: -4,
@@ -6842,15 +6729,15 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
6842
6729
  var _a$6, _b$3, _c$1, _d;
6843
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"])));
6844
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);
6845
- 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"])), _ref10 => {
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 => {
6846
6733
  let {
6847
6734
  $visible
6848
- } = _ref10;
6735
+ } = _ref9;
6849
6736
  return $visible ? 1 : 0;
6850
- }, _ref11 => {
6737
+ }, _ref10 => {
6851
6738
  let {
6852
6739
  $animated
6853
- } = _ref11;
6740
+ } = _ref10;
6854
6741
  return $animated ? animation : styled.css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
6855
6742
  });
6856
6743
  const Root$4 = styled__default.default(Box)(responsiveRadiusStyle, skeletonStyle);
@@ -6881,18 +6768,18 @@ const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
6881
6768
  ref
6882
6769
  });
6883
6770
  });
6884
- const Root$3 = styled__default.default(Skeleton)(_ref12 => {
6885
- let {
6771
+ const Root$3 = styled__default.default(Skeleton)(props => {
6772
+ const {
6886
6773
  $size,
6887
- $style,
6888
- theme
6889
- } = _ref12;
6774
+ $style
6775
+ } = props;
6890
6776
  const {
6777
+ font,
6891
6778
  media
6892
- } = theme.sanity;
6893
- const font = theme.sanity.fonts[$style];
6779
+ } = theme.getTheme_v2(props.theme);
6780
+ const fontStyle = font[$style];
6894
6781
  const styles = _responsive(media, $size, sizeIndex => {
6895
- const fontSize = font.sizes[sizeIndex];
6782
+ const fontSize = fontStyle.sizes[sizeIndex];
6896
6783
  const capHeight = fontSize.lineHeight - fontSize.ascenderHeight - fontSize.descenderHeight;
6897
6784
  return {
6898
6785
  height: capHeight
@@ -7235,12 +7122,12 @@ function ToastProvider(props) {
7235
7122
  paddingY,
7236
7123
  children: /* @__PURE__ */jsxRuntime.jsx(framerMotion.AnimatePresence, {
7237
7124
  initial: false,
7238
- children: state.map(_ref13 => {
7125
+ children: state.map(_ref11 => {
7239
7126
  let {
7240
7127
  dismiss,
7241
7128
  id,
7242
7129
  params
7243
- } = _ref13;
7130
+ } = _ref11;
7244
7131
  return /* @__PURE__ */jsxRuntime.jsx(framerMotion.motion.div, {
7245
7132
  animate: {
7246
7133
  opacity: 1,
@@ -7534,26 +7421,20 @@ function treeItemRootStyle() {
7534
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 "])));
7535
7422
  }
7536
7423
  function treeItemRootColorStyle(props) {
7537
- const {
7538
- theme
7539
- } = props;
7540
7424
  const $tone = "default";
7541
7425
  const {
7542
- base,
7543
- muted,
7544
- selectable
7545
- } = theme.sanity.color;
7546
- const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
7547
- 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));
7548
7430
  }
7549
7431
  function treeItemBoxStyle(props) {
7550
7432
  const {
7551
- $level,
7552
- theme
7433
+ $level
7553
7434
  } = props;
7554
7435
  const {
7555
7436
  space
7556
- } = theme.sanity;
7437
+ } = theme.getTheme_v2(props.theme);
7557
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));
7558
7439
  }
7559
7440
  function useTree() {
@@ -7740,22 +7621,22 @@ const TreeItem = react.memo(function TreeItem2(props) {
7740
7621
  })]
7741
7622
  });
7742
7623
  });
7743
- Object.defineProperty(exports, 'COLOR_CONFIG_BASE_KEYS', {
7624
+ Object.defineProperty(exports, 'COLOR_CONFIG_BLEND_KEYS', {
7744
7625
  enumerable: true,
7745
7626
  get: function () {
7746
- return theme.COLOR_CONFIG_BASE_KEYS;
7627
+ return theme.COLOR_CONFIG_BLEND_KEYS;
7747
7628
  }
7748
7629
  });
7749
- Object.defineProperty(exports, 'COLOR_CONFIG_BASE_TONES', {
7630
+ Object.defineProperty(exports, 'COLOR_CONFIG_CARD_KEYS', {
7750
7631
  enumerable: true,
7751
7632
  get: function () {
7752
- return theme.COLOR_CONFIG_BASE_TONES;
7633
+ return theme.COLOR_CONFIG_CARD_KEYS;
7753
7634
  }
7754
7635
  });
7755
- Object.defineProperty(exports, 'COLOR_CONFIG_BLEND_KEYS', {
7636
+ Object.defineProperty(exports, 'COLOR_CONFIG_CARD_TONES', {
7756
7637
  enumerable: true,
7757
7638
  get: function () {
7758
- return theme.COLOR_CONFIG_BLEND_KEYS;
7639
+ return theme.COLOR_CONFIG_CARD_TONES;
7759
7640
  }
7760
7641
  });
7761
7642
  Object.defineProperty(exports, 'COLOR_CONFIG_STATE_KEYS', {
@@ -7770,12 +7651,6 @@ Object.defineProperty(exports, 'COLOR_CONFIG_STATE_TONES', {
7770
7651
  return theme.COLOR_CONFIG_STATE_TONES;
7771
7652
  }
7772
7653
  });
7773
- Object.defineProperty(exports, 'THEME_COLOR_BASE_TONES', {
7774
- enumerable: true,
7775
- get: function () {
7776
- return theme.THEME_COLOR_BASE_TONES;
7777
- }
7778
- });
7779
7654
  Object.defineProperty(exports, 'THEME_COLOR_BLEND_MODES', {
7780
7655
  enumerable: true,
7781
7656
  get: function () {
@@ -7788,6 +7663,12 @@ Object.defineProperty(exports, 'THEME_COLOR_BUTTON_MODES', {
7788
7663
  return theme.THEME_COLOR_BUTTON_MODES;
7789
7664
  }
7790
7665
  });
7666
+ Object.defineProperty(exports, 'THEME_COLOR_CARD_TONES', {
7667
+ enumerable: true,
7668
+ get: function () {
7669
+ return theme.THEME_COLOR_CARD_TONES;
7670
+ }
7671
+ });
7791
7672
  Object.defineProperty(exports, 'THEME_COLOR_STATES', {
7792
7673
  enumerable: true,
7793
7674
  get: function () {
@@ -7953,7 +7834,7 @@ Object.defineProperty(exports, 'screen', {
7953
7834
  Object.defineProperty(exports, 'studioTheme', {
7954
7835
  enumerable: true,
7955
7836
  get: function () {
7956
- return theme.studioTheme;
7837
+ return theme.defaultTheme;
7957
7838
  }
7958
7839
  });
7959
7840
  exports.Arrow = Arrow;
@@ -8063,6 +7944,7 @@ exports.usePrefersDark = usePrefersDark;
8063
7944
  exports.usePrefersReducedMotion = usePrefersReducedMotion;
8064
7945
  exports.useRootTheme = useRootTheme;
8065
7946
  exports.useTheme = useTheme;
7947
+ exports.useTheme_v2 = useTheme_v2;
8066
7948
  exports.useToast = useToast;
8067
7949
  exports.useTooltipDelayGroup = useTooltipDelayGroup;
8068
7950
  exports.useTree = useTree;