@sanity/ui 2.0.0-alpha.34 → 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 -518
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +413 -534
  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 +7 -11
  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.esm.js CHANGED
@@ -1,4 +1,5 @@
1
- export { COLOR_CONFIG_BASE_KEYS, COLOR_CONFIG_BASE_TONES, COLOR_CONFIG_BLEND_KEYS, COLOR_CONFIG_STATE_KEYS, COLOR_CONFIG_STATE_TONES, THEME_COLOR_BASE_TONES, THEME_COLOR_BLEND_MODES, THEME_COLOR_BUTTON_MODES, THEME_COLOR_STATES, THEME_COLOR_STATE_TONES, buildTheme, createColorTheme, hexToRgb, hslToRgb, isColorBlendModeValue, isColorButtonMode, isColorConfigBaseKey, isColorConfigBaseTone, isColorConfigBlendKey, isColorConfigStateKey, isColorConfigStateTone, isColorHueKey, isColorOpacityValue, isColorTintKey, isColorTokenValue, isColorValue, multiply, parseColor, parseTokenKey, parseTokenValue, rgbToHex, rgbToHsl, rgba, rgbaToRGBA, screen, studioTheme } from '@sanity/ui/theme';
1
+ import { getTheme_v2, getScopedTheme } from '@sanity/ui/theme';
2
+ export { COLOR_CONFIG_BLEND_KEYS, COLOR_CONFIG_CARD_KEYS, COLOR_CONFIG_CARD_TONES, COLOR_CONFIG_STATE_KEYS, COLOR_CONFIG_STATE_TONES, THEME_COLOR_BLEND_MODES, THEME_COLOR_BUTTON_MODES, THEME_COLOR_CARD_TONES, THEME_COLOR_STATES, THEME_COLOR_STATE_TONES, buildTheme, createColorTheme, hexToRgb, hslToRgb, isColorBlendModeValue, isColorButtonMode, isColorConfigBaseKey, isColorConfigBaseTone, isColorConfigBlendKey, isColorConfigStateKey, isColorConfigStateTone, isColorHueKey, isColorOpacityValue, isColorTintKey, isColorTokenValue, isColorValue, multiply, parseColor, parseTokenKey, parseTokenValue, rgbToHex, rgbToHsl, rgba, rgbaToRGBA, screen, defaultTheme as studioTheme } from '@sanity/ui/theme';
2
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
4
  import { useMemo, useState, useRef, useEffect, createContext, useContext, useSyncExternalStore, useLayoutEffect, forwardRef, useId, useCallback, cloneElement, isValidElement, createElement, Component, memo, useReducer, Children, Fragment as Fragment$1, startTransition } from 'react';
4
5
  import ReactIs, { isElement as isElement$1, isFragment, isValidElementType } from 'react-is';
@@ -41,23 +42,26 @@ function _getResponsiveSpace(theme, props) {
41
42
  if (spaceIndexes.length === 0) {
42
43
  return null;
43
44
  }
44
- return _responsive(theme.sanity.media, spaceIndexes, spaceIndex => _fillCSSObject(props, rem(theme.sanity.space[spaceIndex])));
45
+ const {
46
+ media,
47
+ space
48
+ } = getTheme_v2(theme);
49
+ return _responsive(media, spaceIndexes, spaceIndex => _fillCSSObject(props, rem(space[spaceIndex])));
45
50
  }
46
51
  function responsiveFont(fontKey, props) {
47
52
  const {
48
53
  $size,
49
- $weight,
50
- theme
54
+ $weight
51
55
  } = props;
52
56
  const {
53
- fonts,
57
+ font,
54
58
  media
55
- } = theme.sanity;
59
+ } = getTheme_v2(props.theme);
56
60
  const {
57
61
  family,
58
62
  sizes,
59
63
  weights
60
- } = fonts[fontKey];
64
+ } = font[fontKey];
61
65
  const fontWeight = $weight && weights[$weight] || weights.regular;
62
66
  const defaultSize = sizes[2];
63
67
  const base = {
@@ -144,9 +148,9 @@ function responsiveLabelFont(props) {
144
148
  }
145
149
  function responsiveTextAlignStyle(props) {
146
150
  const {
147
- theme
148
- } = props;
149
- return _responsive(theme.sanity.media, props.$align, textAlign => {
151
+ media
152
+ } = getTheme_v2(props.theme);
153
+ return _responsive(media, props.$align, textAlign => {
150
154
  return {
151
155
  textAlign
152
156
  };
@@ -825,17 +829,6 @@ function useGlobalKeyDown(onKeyDown) {
825
829
  return () => removeEventListener("keydown", onKeyDown);
826
830
  }, [onKeyDown]);
827
831
  }
828
- const DEFAULT_THEME_LAYER = {
829
- dialog: {
830
- zOffset: 600
831
- },
832
- popover: {
833
- zOffset: 400
834
- },
835
- tooltip: {
836
- zOffset: 200
837
- }
838
- };
839
832
  function getGlobalScope() {
840
833
  if (typeof globalThis !== "undefined") return globalThis;
841
834
  if (typeof window !== "undefined") return window;
@@ -852,57 +845,40 @@ function ThemeProvider(props) {
852
845
  const {
853
846
  children,
854
847
  scheme = (parentTheme == null ? void 0 : parentTheme.scheme) || "light",
855
- theme: themeProp = (parentTheme == null ? void 0 : parentTheme.theme) || null,
848
+ theme: rootTheme = (parentTheme == null ? void 0 : parentTheme.theme) || null,
856
849
  tone = (parentTheme == null ? void 0 : parentTheme.tone) || "default"
857
850
  } = props;
858
- const theme = useMemo(() => {
859
- if (!themeProp) return null;
860
- const {
861
- color: rootColor,
862
- layer: rootLayer,
863
- ...restTheme
864
- } = themeProp;
865
- const colorScheme = rootColor[scheme] || rootColor.light;
866
- const color = colorScheme[tone] || colorScheme.default;
867
- const layer = rootLayer || DEFAULT_THEME_LAYER;
851
+ const themeContext = useMemo(() => {
852
+ if (!rootTheme) return null;
868
853
  return {
869
- sanity: {
870
- ...restTheme,
871
- color,
872
- layer
873
- }
854
+ version: 0,
855
+ theme: rootTheme,
856
+ scheme,
857
+ tone
874
858
  };
875
- }, [scheme, themeProp, tone]);
876
- const value = useMemo(() => themeProp && {
877
- version: 0,
878
- theme: themeProp,
879
- scheme,
880
- tone
881
- }, [themeProp, scheme, tone]);
859
+ }, [rootTheme, scheme, tone]);
860
+ const theme = useMemo(() => {
861
+ if (!rootTheme) return null;
862
+ return getScopedTheme(rootTheme, scheme, tone);
863
+ }, [scheme, rootTheme, tone]);
882
864
  if (!theme) {
883
865
  return /* @__PURE__ */jsx("pre", {
884
866
  children: 'ThemeProvider: no "theme" property provided'
885
867
  });
886
868
  }
887
869
  return /* @__PURE__ */jsx(ThemeContext.Provider, {
888
- value,
870
+ value: themeContext,
889
871
  children: /* @__PURE__ */jsx(ThemeProvider$1, {
890
872
  theme,
891
873
  children
892
874
  })
893
875
  });
894
876
  }
895
- function isRecord(value) {
896
- return Boolean(value && typeof value === "object" && !Array.isArray(value));
897
- }
898
877
  function useRootTheme() {
899
878
  const value = useContext(ThemeContext);
900
879
  if (!value) {
901
880
  throw new Error("useRootTheme(): missing context value");
902
881
  }
903
- if (!isRecord(value) || value.version !== 0) {
904
- throw new Error("useRootTheme(): the context value is not compatible");
905
- }
906
882
  return value;
907
883
  }
908
884
  function ThemeColorProvider(props) {
@@ -922,6 +898,9 @@ function ThemeColorProvider(props) {
922
898
  function useTheme() {
923
899
  return useTheme$1();
924
900
  }
901
+ function useTheme_v2() {
902
+ return getTheme_v2(useTheme$1());
903
+ }
925
904
  const MEDIA_STORE_CACHE = /* @__PURE__ */new WeakMap();
926
905
  function _getMediaQuery(media, index) {
927
906
  if (index === 0) {
@@ -983,10 +962,9 @@ function getServerSnapshot$2() {
983
962
  return 0;
984
963
  }
985
964
  function useMediaIndex() {
986
- const theme = useTheme();
987
965
  const {
988
966
  media
989
- } = theme.sanity;
967
+ } = useTheme_v2();
990
968
  let store = MEDIA_STORE_CACHE.get(media);
991
969
  if (!store) {
992
970
  store = _createMediaStore(media);
@@ -1061,13 +1039,10 @@ function responsiveBorderStyle() {
1061
1039
  }
1062
1040
  function border(props) {
1063
1041
  var _a, _b;
1064
- const {
1065
- theme
1066
- } = props;
1067
1042
  const {
1068
1043
  card,
1069
1044
  media
1070
- } = theme.sanity;
1045
+ } = getTheme_v2(props.theme);
1071
1046
  const borderStyle = "".concat((_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1, "px solid var(--card-border-color)");
1072
1047
  return _responsive(media, props.$border, value => value ? {
1073
1048
  "&&": {
@@ -1081,13 +1056,10 @@ function border(props) {
1081
1056
  }
1082
1057
  function borderTop(props) {
1083
1058
  var _a, _b;
1084
- const {
1085
- theme
1086
- } = props;
1087
1059
  const {
1088
1060
  card,
1089
1061
  media
1090
- } = theme.sanity;
1062
+ } = getTheme_v2(props.theme);
1091
1063
  const borderStyle = "".concat((_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1, "px solid var(--card-border-color)");
1092
1064
  return _responsive(media, props.$borderTop, value => value ? {
1093
1065
  "&&": {
@@ -1101,13 +1073,10 @@ function borderTop(props) {
1101
1073
  }
1102
1074
  function borderRight(props) {
1103
1075
  var _a, _b;
1104
- const {
1105
- theme
1106
- } = props;
1107
1076
  const {
1108
1077
  card,
1109
1078
  media
1110
- } = theme.sanity;
1079
+ } = getTheme_v2(props.theme);
1111
1080
  const borderStyle = "".concat((_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1, "px solid var(--card-border-color)");
1112
1081
  return _responsive(media, props.$borderRight, value => value ? {
1113
1082
  "&&": {
@@ -1121,13 +1090,10 @@ function borderRight(props) {
1121
1090
  }
1122
1091
  function borderBottom(props) {
1123
1092
  var _a, _b;
1124
- const {
1125
- theme
1126
- } = props;
1127
1093
  const {
1128
1094
  card,
1129
1095
  media
1130
- } = theme.sanity;
1096
+ } = getTheme_v2(props.theme);
1131
1097
  const borderStyle = "".concat((_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1, "px solid var(--card-border-color)");
1132
1098
  return _responsive(media, props.$borderBottom, value => value ? {
1133
1099
  "&&": {
@@ -1141,13 +1107,10 @@ function borderBottom(props) {
1141
1107
  }
1142
1108
  function borderLeft(props) {
1143
1109
  var _a, _b;
1144
- const {
1145
- theme
1146
- } = props;
1147
1110
  const {
1148
1111
  card,
1149
1112
  media
1150
- } = theme.sanity;
1113
+ } = getTheme_v2(props.theme);
1151
1114
  const borderStyle = "".concat((_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1, "px solid var(--card-border-color)");
1152
1115
  return _responsive(media, props.$borderLeft, value => value ? {
1153
1116
  "&&": {
@@ -1179,12 +1142,9 @@ function responsiveBoxStyle() {
1179
1142
  return [responsiveBoxSizingStyle, responsiveBoxHeightStyle, responsiveBoxOverflowStyle, responsiveBoxDisplayStyle];
1180
1143
  }
1181
1144
  function responsiveBoxDisplayStyle(props) {
1182
- const {
1183
- theme
1184
- } = props;
1185
1145
  const {
1186
1146
  media
1187
- } = theme.sanity;
1147
+ } = getTheme_v2(props.theme);
1188
1148
  return _responsive(media, props.$display, display => ({
1189
1149
  "&:not([hidden])": {
1190
1150
  display
@@ -1192,34 +1152,25 @@ function responsiveBoxDisplayStyle(props) {
1192
1152
  }));
1193
1153
  }
1194
1154
  function responsiveBoxSizingStyle(props) {
1195
- const {
1196
- theme
1197
- } = props;
1198
1155
  const {
1199
1156
  media
1200
- } = theme.sanity;
1157
+ } = getTheme_v2(props.theme);
1201
1158
  return _responsive(media, props.$sizing, sizing => ({
1202
1159
  boxSizing: BOX_SIZING[sizing]
1203
1160
  }));
1204
1161
  }
1205
1162
  function responsiveBoxHeightStyle(props) {
1206
- const {
1207
- theme
1208
- } = props;
1209
1163
  const {
1210
1164
  media
1211
- } = theme.sanity;
1165
+ } = getTheme_v2(props.theme);
1212
1166
  return _responsive(media, props.$height, height => ({
1213
1167
  height: BOX_HEIGHT[height]
1214
1168
  }));
1215
1169
  }
1216
1170
  function responsiveBoxOverflowStyle(props) {
1217
- const {
1218
- theme
1219
- } = props;
1220
1171
  const {
1221
1172
  media
1222
- } = theme.sanity;
1173
+ } = getTheme_v2(props.theme);
1223
1174
  return _responsive(media, props.$overflow, overflow => ({
1224
1175
  overflow
1225
1176
  }));
@@ -1233,12 +1184,9 @@ function responsiveFlexStyle() {
1233
1184
  return [BASE_STYLE$3, responsiveFlexAlignStyle, responsiveFlexGapStyle, responsiveFlexWrapStyle, responsiveFlexJustifyStyle, responsiveFlexDirectionStyle];
1234
1185
  }
1235
1186
  function responsiveFlexAlignStyle(props) {
1236
- const {
1237
- theme
1238
- } = props;
1239
1187
  const {
1240
1188
  media
1241
- } = theme.sanity;
1189
+ } = getTheme_v2(props.theme);
1242
1190
  return _responsive(media, props.$align, align => {
1243
1191
  return {
1244
1192
  alignItems: align
@@ -1246,24 +1194,18 @@ function responsiveFlexAlignStyle(props) {
1246
1194
  });
1247
1195
  }
1248
1196
  function responsiveFlexGapStyle(props) {
1249
- const {
1250
- theme
1251
- } = props;
1252
1197
  const {
1253
1198
  media,
1254
1199
  space
1255
- } = theme.sanity;
1200
+ } = getTheme_v2(props.theme);
1256
1201
  return _responsive(media, props.$gap, gap => ({
1257
1202
  gap: gap ? rem(space[gap]) : void 0
1258
1203
  }));
1259
1204
  }
1260
1205
  function responsiveFlexWrapStyle(props) {
1261
- const {
1262
- theme
1263
- } = props;
1264
1206
  const {
1265
1207
  media
1266
- } = theme.sanity;
1208
+ } = getTheme_v2(props.theme);
1267
1209
  return _responsive(media, props.$wrap, wrap => {
1268
1210
  return {
1269
1211
  flexWrap: wrap
@@ -1271,12 +1213,9 @@ function responsiveFlexWrapStyle(props) {
1271
1213
  });
1272
1214
  }
1273
1215
  function responsiveFlexJustifyStyle(props) {
1274
- const {
1275
- theme
1276
- } = props;
1277
1216
  const {
1278
1217
  media
1279
- } = theme.sanity;
1218
+ } = getTheme_v2(props.theme);
1280
1219
  return _responsive(media, props.$justify, justify => {
1281
1220
  return {
1282
1221
  justifyContent: justify
@@ -1284,12 +1223,9 @@ function responsiveFlexJustifyStyle(props) {
1284
1223
  });
1285
1224
  }
1286
1225
  function responsiveFlexDirectionStyle(props) {
1287
- const {
1288
- theme
1289
- } = props;
1290
1226
  const {
1291
1227
  media
1292
- } = theme.sanity;
1228
+ } = getTheme_v2(props.theme);
1293
1229
  return _responsive(media, props.$direction, direction => {
1294
1230
  return {
1295
1231
  flexDirection: direction
@@ -1304,12 +1240,9 @@ function flexItemStyle() {
1304
1240
  return [BASE_STYLE$2, responsiveFlexItemStyle];
1305
1241
  }
1306
1242
  function responsiveFlexItemStyle(props) {
1307
- const {
1308
- theme
1309
- } = props;
1310
1243
  const {
1311
1244
  media
1312
- } = theme.sanity;
1245
+ } = getTheme_v2(props.theme);
1313
1246
  if (!props.$flex) return EMPTY_ARRAY;
1314
1247
  return _responsive(media, props.$flex, flex => ({
1315
1248
  flex
@@ -1353,92 +1286,68 @@ function responsiveGridStyle() {
1353
1286
  return [GRID_CSS, responsiveGridAutoFlowStyle, responsiveGridAutoRowsStyle, responsiveGridAutoColsStyle, responsiveGridColumnsStyle, responsiveGridRowsStyle, responsiveGridGapStyle, responsiveGridGapXStyle, responsiveGridGapYStyle];
1354
1287
  }
1355
1288
  function responsiveGridAutoFlowStyle(props) {
1356
- const {
1357
- theme
1358
- } = props;
1359
1289
  const {
1360
1290
  media
1361
- } = theme.sanity;
1291
+ } = getTheme_v2(props.theme);
1362
1292
  return _responsive(media, props.$autoFlow, autoFlow => ({
1363
1293
  gridAutoFlow: autoFlow
1364
1294
  }));
1365
1295
  }
1366
1296
  function responsiveGridAutoRowsStyle(props) {
1367
- const {
1368
- theme
1369
- } = props;
1370
1297
  const {
1371
1298
  media
1372
- } = theme.sanity;
1299
+ } = getTheme_v2(props.theme);
1373
1300
  return _responsive(media, props.$autoRows, autoRows => ({
1374
1301
  gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows]
1375
1302
  }));
1376
1303
  }
1377
1304
  function responsiveGridAutoColsStyle(props) {
1378
- const {
1379
- theme
1380
- } = props;
1381
1305
  const {
1382
1306
  media
1383
- } = theme.sanity;
1307
+ } = getTheme_v2(props.theme);
1384
1308
  return _responsive(media, props.$autoCols, autoCols => ({
1385
1309
  gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols]
1386
1310
  }));
1387
1311
  }
1388
1312
  function responsiveGridColumnsStyle(props) {
1389
- const {
1390
- theme
1391
- } = props;
1392
1313
  const {
1393
1314
  media
1394
- } = theme.sanity;
1315
+ } = getTheme_v2(props.theme);
1395
1316
  return _responsive(media, props.$columns, columns => ({
1396
1317
  gridTemplateColumns: columns && "repeat(".concat(columns, ",minmax(0,1fr));")
1397
1318
  }));
1398
1319
  }
1399
1320
  function responsiveGridRowsStyle(props) {
1400
- const {
1401
- theme
1402
- } = props;
1403
1321
  const {
1404
1322
  media
1405
- } = theme.sanity;
1323
+ } = getTheme_v2(props.theme);
1406
1324
  return _responsive(media, props.$rows, rows => ({
1407
1325
  gridTemplateRows: rows && "repeat(".concat(rows, ",minmax(0,1fr));")
1408
1326
  }));
1409
1327
  }
1410
1328
  function responsiveGridGapStyle(props) {
1411
- const {
1412
- theme
1413
- } = props;
1414
1329
  const {
1415
1330
  media,
1416
1331
  space
1417
- } = theme.sanity;
1332
+ } = getTheme_v2(props.theme);
1418
1333
  return _responsive(media, props.$gap, gap => ({
1419
1334
  gridGap: gap ? rem(space[gap]) : void 0
1420
1335
  }));
1421
1336
  }
1422
1337
  function responsiveGridGapXStyle(props) {
1423
- const {
1424
- theme
1425
- } = props;
1426
1338
  const {
1427
1339
  media,
1428
1340
  space
1429
- } = theme.sanity;
1341
+ } = getTheme_v2(props.theme);
1430
1342
  return _responsive(media, props.$gapX, gapX => ({
1431
1343
  columnGap: gapX ? rem(space[gapX]) : void 0
1432
1344
  }));
1433
1345
  }
1434
1346
  function responsiveGridGapYStyle(props) {
1435
- const {
1436
- theme
1437
- } = props;
1438
1347
  const {
1439
1348
  media,
1440
1349
  space
1441
- } = theme.sanity;
1350
+ } = getTheme_v2(props.theme);
1442
1351
  return _responsive(media, props.$gapY, gapY => ({
1443
1352
  rowGap: gapY ? rem(space[gapY]) : void 0
1444
1353
  }));
@@ -1455,12 +1364,9 @@ const GRID_ITEM_COLUMN = {
1455
1364
  full: "1 / -1"
1456
1365
  };
1457
1366
  function responsiveGridItemRowStyle(props) {
1458
- const {
1459
- theme
1460
- } = props;
1461
1367
  const {
1462
1368
  media
1463
- } = theme.sanity;
1369
+ } = getTheme_v2(props.theme);
1464
1370
  return _responsive(media, props.$row, row => {
1465
1371
  if (typeof row === "number") {
1466
1372
  return {
@@ -1473,34 +1379,25 @@ function responsiveGridItemRowStyle(props) {
1473
1379
  });
1474
1380
  }
1475
1381
  function responsiveGridItemRowStartStyle(props) {
1476
- const {
1477
- theme
1478
- } = props;
1479
1382
  const {
1480
1383
  media
1481
- } = theme.sanity;
1384
+ } = getTheme_v2(props.theme);
1482
1385
  return _responsive(media, props.$rowStart, rowStart => ({
1483
1386
  gridRowStart: rowStart
1484
1387
  }));
1485
1388
  }
1486
1389
  function responsiveGridItemRowEndStyle(props) {
1487
- const {
1488
- theme
1489
- } = props;
1490
1390
  const {
1491
1391
  media
1492
- } = theme.sanity;
1392
+ } = getTheme_v2(props.theme);
1493
1393
  return _responsive(media, props.$rowEnd, rowEnd => ({
1494
1394
  gridRowEnd: rowEnd
1495
1395
  }));
1496
1396
  }
1497
1397
  function responsiveGridItemColumnStyle(props) {
1498
- const {
1499
- theme
1500
- } = props;
1501
1398
  const {
1502
1399
  media
1503
- } = theme.sanity;
1400
+ } = getTheme_v2(props.theme);
1504
1401
  return _responsive(media, props.$column, column => {
1505
1402
  if (typeof column === "number") {
1506
1403
  return {
@@ -1513,23 +1410,17 @@ function responsiveGridItemColumnStyle(props) {
1513
1410
  });
1514
1411
  }
1515
1412
  function responsiveGridItemColumnStartStyle(props) {
1516
- const {
1517
- theme
1518
- } = props;
1519
1413
  const {
1520
1414
  media
1521
- } = theme.sanity;
1415
+ } = getTheme_v2(props.theme);
1522
1416
  return _responsive(media, props.$columnStart, columnStart => ({
1523
1417
  gridColumnStart: columnStart
1524
1418
  }));
1525
1419
  }
1526
1420
  function responsiveGridItemColumnEndStyle(props) {
1527
- const {
1528
- theme
1529
- } = props;
1530
1421
  const {
1531
1422
  media
1532
- } = theme.sanity;
1423
+ } = getTheme_v2(props.theme);
1533
1424
  return _responsive(media, props.$columnEnd, columnEnd => ({
1534
1425
  gridColumnEnd: columnEnd
1535
1426
  }));
@@ -1540,14 +1431,13 @@ function responsiveInputPaddingStyle(props) {
1540
1431
  $iconLeft,
1541
1432
  $iconRight,
1542
1433
  $padding,
1543
- $space,
1544
- theme
1434
+ $space
1545
1435
  } = props;
1546
1436
  const {
1547
- fonts,
1437
+ font,
1548
1438
  media,
1549
- space: spaceScale
1550
- } = theme.sanity;
1439
+ space
1440
+ } = getTheme_v2(props.theme);
1551
1441
  const len = Math.max($padding.length, $space.length, $fontSize.length);
1552
1442
  const _padding = [];
1553
1443
  const _space = [];
@@ -1558,10 +1448,10 @@ function responsiveInputPaddingStyle(props) {
1558
1448
  _space[i] = $space[i] === void 0 ? _space[i - 1] : $space[i];
1559
1449
  }
1560
1450
  return _responsive(media, _padding, (_, i) => {
1561
- const size = fonts.text.sizes[_fontSize[i]] || fonts.text.sizes[2];
1451
+ const size = font.text.sizes[_fontSize[i]] || font.text.sizes[2];
1562
1452
  const emSize = size.lineHeight - size.ascenderHeight - size.descenderHeight;
1563
- const p = spaceScale[_padding[i]];
1564
- const s = spaceScale[_space[i]];
1453
+ const p = space[_padding[i]];
1454
+ const s = space[_space[i]];
1565
1455
  const styles = {
1566
1456
  paddingTop: rem(p - size.ascenderHeight),
1567
1457
  paddingRight: rem(p),
@@ -1591,25 +1481,23 @@ function textInputRootStyle() {
1591
1481
  }
1592
1482
  function textInputBaseStyle(props) {
1593
1483
  const {
1594
- theme,
1595
1484
  $scheme,
1596
1485
  $tone,
1597
1486
  $weight
1598
1487
  } = props;
1599
- const font = theme.sanity.fonts.text;
1600
- const color = theme.sanity.color.input;
1601
- return 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);
1488
+ const {
1489
+ color,
1490
+ font
1491
+ } = getTheme_v2(props.theme);
1492
+ return 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);
1602
1493
  }
1603
1494
  function textInputFontSizeStyle(props) {
1604
1495
  const {
1605
- theme
1606
- } = props;
1607
- const {
1608
- fonts,
1496
+ font,
1609
1497
  media
1610
- } = theme.sanity;
1498
+ } = getTheme_v2(props.theme);
1611
1499
  return _responsive(media, props.$fontSize, sizeIndex => {
1612
- const size = fonts.text.sizes[sizeIndex] || fonts.text.sizes[2];
1500
+ const size = font.text.sizes[sizeIndex] || font.text.sizes[2];
1613
1501
  return {
1614
1502
  fontSize: rem(size.fontSize),
1615
1503
  lineHeight: size.lineHeight / size.fontSize
@@ -1622,35 +1510,31 @@ function textInputRepresentationStyle(props) {
1622
1510
  $hasSuffix,
1623
1511
  $scheme,
1624
1512
  $tone,
1625
- $unstableDisableFocusRing,
1626
- theme
1513
+ $unstableDisableFocusRing
1627
1514
  } = props;
1628
1515
  const {
1516
+ color,
1629
1517
  input
1630
- } = theme.sanity;
1631
- const {
1632
- focusRing
1633
- } = input.text;
1634
- const color = theme.sanity.color.input;
1635
- return 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({
1636
- color: color.default.enabled.border,
1518
+ } = getTheme_v2(props.theme);
1519
+ return 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({
1520
+ color: color.input.default.enabled.border,
1637
1521
  width: input.border.width
1638
- }), color.invalid.enabled.bg, color.invalid.enabled.fg, focusRingBorderStyle({
1639
- color: color.invalid.enabled.border,
1522
+ }), color.input.invalid.enabled.bg, color.input.invalid.enabled.fg, focusRingBorderStyle({
1523
+ color: color.input.invalid.enabled.border,
1640
1524
  width: input.border.width
1641
1525
  }), $unstableDisableFocusRing ? void 0 : focusRingStyle({
1642
1526
  border: {
1643
- color: color.default.enabled.border,
1527
+ color: color.input.default.enabled.border,
1644
1528
  width: input.border.width
1645
1529
  },
1646
- focusRing
1530
+ focusRing: input.text.focusRing
1647
1531
  }), $unstableDisableFocusRing ? void 0 : focusRingStyle({
1648
- focusRing
1649
- }), color.default.disabled.bg, color.default.disabled.fg, focusRingBorderStyle({
1650
- color: color.default.disabled.border,
1532
+ focusRing: input.text.focusRing
1533
+ }), color.input.default.disabled.bg, color.input.default.disabled.fg, focusRingBorderStyle({
1534
+ color: color.input.default.disabled.border,
1651
1535
  width: input.border.width
1652
- }), color.default.readOnly.bg, color.default.readOnly.fg, color.default.hovered.bg, color.default.hovered.fg, focusRingBorderStyle({
1653
- color: color.default.hovered.border,
1536
+ }), color.input.default.readOnly.bg, color.input.default.readOnly.fg, color.input.default.hovered.bg, color.input.default.hovered.fg, focusRingBorderStyle({
1537
+ color: color.input.default.hovered.border,
1654
1538
  width: input.border.width
1655
1539
  }));
1656
1540
  }
@@ -1667,13 +1551,10 @@ function responsivePaddingStyle(props) {
1667
1551
  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);
1668
1552
  }
1669
1553
  function responsiveRadiusStyle(props) {
1670
- const {
1671
- theme
1672
- } = props;
1673
1554
  const {
1674
1555
  media,
1675
1556
  radius
1676
- } = theme.sanity;
1557
+ } = getTheme_v2(props.theme);
1677
1558
  return _responsive(media, props.$radius, value => {
1678
1559
  let borderRadius = 0;
1679
1560
  if (typeof value === "number") {
@@ -1702,15 +1583,12 @@ function shadowStyle(shadow) {
1702
1583
  };
1703
1584
  }
1704
1585
  function responsiveShadowStyle(props) {
1705
- const {
1706
- theme
1707
- } = props;
1708
1586
  const {
1709
1587
  card,
1710
1588
  media,
1711
- shadows
1712
- } = theme.sanity;
1713
- return _responsive(media, props.$shadow, shadow => shadowStyle(shadows[shadow], card.shadow.outline));
1589
+ shadow
1590
+ } = getTheme_v2(props.theme);
1591
+ return _responsive(media, props.$shadow, index => shadowStyle(shadow[index], card.shadow.outline));
1714
1592
  }
1715
1593
  var __freeze$C = Object.freeze;
1716
1594
  var __defProp$D = Object.defineProperty;
@@ -1721,13 +1599,12 @@ var _a$C, _b$m, _c$b;
1721
1599
  function labelBaseStyle(props) {
1722
1600
  const {
1723
1601
  $accent,
1724
- $muted,
1725
- theme
1602
+ $muted
1726
1603
  } = props;
1727
1604
  const {
1728
- fonts
1729
- } = theme.sanity;
1730
- return 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 && css(_a$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$m || (_b$m = __template$C(["\n color: var(--card-muted-fg-color);\n "]))), fonts.code.family);
1605
+ font
1606
+ } = getTheme_v2(props.theme);
1607
+ return 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 && css(_a$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$m || (_b$m = __template$C(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family);
1731
1608
  }
1732
1609
  var __freeze$B = Object.freeze;
1733
1610
  var __defProp$C = Object.defineProperty;
@@ -1817,17 +1694,15 @@ function avatarArrowStyle() {
1817
1694
  };
1818
1695
  }
1819
1696
  function avatarRootStyle(props) {
1820
- var _a, _b, _c, _d;
1821
1697
  const {
1822
- $color,
1823
- theme
1698
+ $color
1824
1699
  } = props;
1825
1700
  const {
1826
- focusRing
1827
- } = theme.sanity.avatar;
1701
+ avatar
1702
+ } = getTheme_v2(props.theme);
1828
1703
  return {
1829
- "--avatar-bg-color": ((_b = (_a = theme.sanity.color.avatar) == null ? void 0 : _a[$color]) == null ? void 0 : _b.bg) || theme.sanity.color.spot[$color],
1830
- "--avatar-fg-color": ((_d = (_c = theme.sanity.color.avatar) == null ? void 0 : _c[$color]) == null ? void 0 : _d.fg) || "var(--card-bg-color)",
1704
+ "--avatar-bg-color": "var(--card-avatar-".concat($color, "-bg-color)"),
1705
+ "--avatar-fg-color": "var(--card-avatar-".concat($color, "-fg-color)"),
1831
1706
  backgroundColor: "var(--avatar-bg-color)",
1832
1707
  position: "relative",
1833
1708
  boxSizing: "border-box",
@@ -1855,7 +1730,7 @@ function avatarRootStyle(props) {
1855
1730
  // @ts-expect-error -- TODO wait for CSSObject types to be fixed in `styled-components` itself
1856
1731
  "&:focus": {
1857
1732
  boxShadow: focusRingStyle({
1858
- focusRing
1733
+ focusRing: avatar.focusRing
1859
1734
  })
1860
1735
  },
1861
1736
  "&:focus:not(:focus-visible)": {
@@ -1865,13 +1740,10 @@ function avatarRootStyle(props) {
1865
1740
  };
1866
1741
  }
1867
1742
  function responsiveAvatarSizeStyle(props) {
1868
- const {
1869
- theme
1870
- } = props;
1871
1743
  const {
1872
1744
  avatar,
1873
1745
  media
1874
- } = theme.sanity;
1746
+ } = getTheme_v2(props.theme);
1875
1747
  return _responsive(media, props.$size, size => {
1876
1748
  const avatarSize = avatar.sizes[size] || avatar.sizes[0];
1877
1749
  return {
@@ -1948,8 +1820,10 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
1948
1820
  } = props;
1949
1821
  const as = ReactIs.isValidElementType(asProp) ? asProp : "div";
1950
1822
  const size = useArrayProp(sizeProp);
1951
- const theme = useTheme();
1952
- const avatarSize = theme.sanity.avatar.sizes[size[0]] || theme.sanity.avatar.sizes[0];
1823
+ const {
1824
+ avatar
1825
+ } = useTheme_v2();
1826
+ const avatarSize = avatar.sizes[size[0]] || avatar.sizes[0];
1953
1827
  const _sizeRem = avatarSize.size;
1954
1828
  const _radius = _sizeRem / 2;
1955
1829
  const elementId = useId();
@@ -2048,13 +1922,12 @@ var _a$A, _b$l, _c$a;
2048
1922
  function textBaseStyle(props) {
2049
1923
  const {
2050
1924
  $accent,
2051
- $muted,
2052
- theme
1925
+ $muted
2053
1926
  } = props;
2054
1927
  const {
2055
- weights
2056
- } = theme.sanity.fonts.text;
2057
- return 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 && css(_a$A || (_a$A = __template$A(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$l || (_b$l = __template$A(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family, weights.bold);
1928
+ font
1929
+ } = getTheme_v2(props.theme);
1930
+ return 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 && css(_a$A || (_a$A = __template$A(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$l || (_b$l = __template$A(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family, font.text.weights.bold);
2058
1931
  }
2059
1932
  var __freeze$z = Object.freeze;
2060
1933
  var __defProp$A = Object.defineProperty;
@@ -2102,13 +1975,10 @@ var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
2102
1975
  }));
2103
1976
  var _a$y;
2104
1977
  function _responsiveAvatarCounterSizeStyle(props) {
2105
- const {
2106
- theme
2107
- } = props;
2108
1978
  const {
2109
1979
  avatar,
2110
1980
  media
2111
- } = theme.sanity;
1981
+ } = getTheme_v2(props.theme);
2112
1982
  return _responsive(media, props.$size, size => {
2113
1983
  const avatarSize = avatar.sizes[size];
2114
1984
  if (!avatarSize) return EMPTY_RECORD;
@@ -2121,9 +1991,9 @@ function _responsiveAvatarCounterSizeStyle(props) {
2121
1991
  }
2122
1992
  function _avatarCounterBaseStyle(props) {
2123
1993
  const {
2124
- theme
2125
- } = props;
2126
- return 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]));
1994
+ space
1995
+ } = getTheme_v2(props.theme);
1996
+ return 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]));
2127
1997
  }
2128
1998
  const Root$A = styled.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle);
2129
1999
  const AvatarCounter = forwardRef(function AvatarCounter2(props, ref) {
@@ -2160,13 +2030,10 @@ function avatarStackStyle() {
2160
2030
  return BASE_STYLES;
2161
2031
  }
2162
2032
  function responsiveAvatarStackSizeStyle(props) {
2163
- const {
2164
- theme
2165
- } = props;
2166
2033
  const {
2167
2034
  avatar,
2168
2035
  media
2169
- } = theme.sanity;
2036
+ } = getTheme_v2(props.theme);
2170
2037
  return _responsive(media, props.$size, size => {
2171
2038
  const avatarSize = avatar.sizes[size];
2172
2039
  if (!avatarSize) return EMPTY_RECORD;
@@ -2279,19 +2146,17 @@ const Box = forwardRef(function Box2(props, ref) {
2279
2146
  });
2280
2147
  });
2281
2148
  function badgeStyle(props) {
2282
- var _a;
2283
2149
  const {
2284
- $tone,
2285
- theme
2150
+ $tone
2286
2151
  } = props;
2287
- const color = ((_a = theme.sanity.color.badge) == null ? void 0 : _a[$tone]) || theme.sanity.color.muted[$tone].enabled;
2288
2152
  return {
2289
- "--card-bg-color": color.bg,
2290
- "--card-fg-color": color.fg,
2153
+ "--card-bg-color": "var(--card-badge-".concat($tone, "-bg-color)"),
2154
+ "--card-fg-color": "var(--card-badge-".concat($tone, "-fg-color)"),
2291
2155
  backgroundColor: "var(--card-bg-color)",
2292
2156
  cursor: "default",
2293
2157
  "&:not([hidden])": {
2294
- display: "inline-block"
2158
+ display: "inline-block",
2159
+ verticalAlign: "top"
2295
2160
  }
2296
2161
  };
2297
2162
  }
@@ -2303,7 +2168,7 @@ const Badge = forwardRef(function Badge2(props, ref) {
2303
2168
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2304
2169
  mode: _deprecated_mode,
2305
2170
  padding = 1,
2306
- radius = 2,
2171
+ radius = "full",
2307
2172
  tone = "default",
2308
2173
  ...restProps
2309
2174
  } = props;
@@ -2364,33 +2229,73 @@ const Spinner = forwardRef(function Spinner2(props, ref) {
2364
2229
  children: /* @__PURE__ */jsx(SpinnerIcon, {})
2365
2230
  });
2366
2231
  });
2367
- function _colorVarsStyle(base, color) {
2232
+ function _cardColorStyle(base, color) {
2368
2233
  let checkered = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
2369
- var _a, _b, _c, _d, _e, _f, _g, _h;
2370
2234
  return {
2371
- // Base
2372
- // @todo: rename to "--base-"?
2235
+ // from base
2236
+ "--card-focus-ring-color": base.focusRing,
2373
2237
  "--card-shadow-outline-color": base.shadow.outline,
2374
2238
  "--card-shadow-umbra-color": base.shadow.umbra,
2375
2239
  "--card-shadow-penumbra-color": base.shadow.penumbra,
2376
2240
  "--card-shadow-ambient-color": base.shadow.ambient,
2377
- "--card-focus-ring-color": base.focusRing,
2378
- "--card-icon-color": color.icon,
2379
- // Card
2241
+ // from state
2242
+ "--card-accent-fg-color": color.accent.fg,
2243
+ "--card-avatar-gray-bg-color": color.avatar.gray.bg,
2244
+ "--card-avatar-gray-fg-color": color.avatar.gray.fg,
2245
+ "--card-avatar-blue-bg-color": color.avatar.blue.bg,
2246
+ "--card-avatar-blue-fg-color": color.avatar.blue.fg,
2247
+ "--card-avatar-purple-bg-color": color.avatar.purple.bg,
2248
+ "--card-avatar-purple-fg-color": color.avatar.purple.fg,
2249
+ "--card-avatar-magenta-bg-color": color.avatar.magenta.bg,
2250
+ "--card-avatar-magenta-fg-color": color.avatar.magenta.fg,
2251
+ "--card-avatar-red-bg-color": color.avatar.red.bg,
2252
+ "--card-avatar-red-fg-color": color.avatar.red.fg,
2253
+ "--card-avatar-orange-bg-color": color.avatar.orange.bg,
2254
+ "--card-avatar-orange-fg-color": color.avatar.orange.fg,
2255
+ "--card-avatar-yellow-bg-color": color.avatar.yellow.bg,
2256
+ "--card-avatar-yellow-fg-color": color.avatar.yellow.fg,
2257
+ "--card-avatar-green-bg-color": color.avatar.green.bg,
2258
+ "--card-avatar-green-fg-color": color.avatar.green.fg,
2259
+ "--card-avatar-cyan-bg-color": color.avatar.cyan.bg,
2260
+ "--card-avatar-cyan-fg-color": color.avatar.cyan.fg,
2380
2261
  "--card-bg-color": color.bg,
2381
- "--card-bg2-color": color.bg2,
2382
- "--card-bg-image": checkered ? "repeating-conic-gradient(".concat(color.bg, " 0% 25%, ").concat(color.bg2 || color.bg, " 0% 50%)") : void 0,
2383
- "--card-fg-color": color.fg,
2262
+ "--card-bg-image": checkered ? "repeating-conic-gradient(".concat(color.bg, " 0% 25%, ").concat(color.muted.bg, " 0% 50%)") : void 0,
2384
2263
  "--card-border-color": color.border,
2385
- "--card-muted-fg-color": (_a = color.muted) == null ? void 0 : _a.fg,
2386
- "--card-accent-fg-color": (_b = color.accent) == null ? void 0 : _b.fg,
2387
- "--card-link-fg-color": (_c = color.link) == null ? void 0 : _c.fg,
2388
- "--card-code-bg-color": (_d = color.code) == null ? void 0 : _d.bg,
2389
- "--card-code-fg-color": (_e = color.code) == null ? void 0 : _e.fg,
2390
- "--card-skeleton-color-from": (_f = color.skeleton) == null ? void 0 : _f.from,
2391
- "--card-skeleton-color-to": (_g = color.skeleton) == null ? void 0 : _g.to,
2392
- // @todo: deprecate
2393
- "--card-link-color": (_h = color.link) == null ? void 0 : _h.fg,
2264
+ "--card-badge-default-bg-color": color.badge.default.bg,
2265
+ "--card-badge-default-dot-color": color.badge.default.dot,
2266
+ "--card-badge-default-fg-color": color.badge.default.fg,
2267
+ "--card-badge-default-icon-color": color.badge.default.icon,
2268
+ "--card-badge-primary-bg-color": color.badge.primary.bg,
2269
+ "--card-badge-primary-dot-color": color.badge.primary.dot,
2270
+ "--card-badge-primary-fg-color": color.badge.primary.fg,
2271
+ "--card-badge-primary-icon-color": color.badge.primary.icon,
2272
+ "--card-badge-positive-bg-color": color.badge.positive.bg,
2273
+ "--card-badge-positive-dot-color": color.badge.positive.dot,
2274
+ "--card-badge-positive-fg-color": color.badge.positive.fg,
2275
+ "--card-badge-positive-icon-color": color.badge.positive.icon,
2276
+ "--card-badge-caution-bg-color": color.badge.caution.bg,
2277
+ "--card-badge-caution-dot-color": color.badge.caution.dot,
2278
+ "--card-badge-caution-fg-color": color.badge.caution.fg,
2279
+ "--card-badge-caution-icon-color": color.badge.caution.icon,
2280
+ "--card-badge-critical-bg-color": color.badge.critical.bg,
2281
+ "--card-badge-critical-dot-color": color.badge.critical.dot,
2282
+ "--card-badge-critical-fg-color": color.badge.critical.fg,
2283
+ "--card-badge-critical-icon-color": color.badge.critical.icon,
2284
+ "--card-code-bg-color": color.code.bg,
2285
+ "--card-code-fg-color": color.code.fg,
2286
+ "--card-fg-color": color.fg,
2287
+ "--card-icon-color": color.icon,
2288
+ "--card-kbd-bg-color": color.kbd.bg,
2289
+ "--card-kbd-border-color": color.kbd.border,
2290
+ "--card-kbd-fg-color": color.kbd.fg,
2291
+ "--card-link-fg-color": color.link.fg,
2292
+ "--card-muted-bg-color": color.muted.bg,
2293
+ "--card-muted-fg-color": color.muted.fg,
2294
+ "--card-skeleton-color-from": color.skeleton.from,
2295
+ "--card-skeleton-color-to": color.skeleton.to,
2296
+ // deprecated variables (kept for legacy)
2297
+ "--card-bg2-color": color.muted.bg,
2298
+ "--card-link-color": color.link.fg,
2394
2299
  "--card-hairline-soft-color": color.border,
2395
2300
  "--card-hairline-hard-color": color.border
2396
2301
  };
@@ -2401,15 +2306,14 @@ var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", {
2401
2306
  value: __freeze$v(raw || cooked.slice())
2402
2307
  }));
2403
2308
  var _a$v, _b$j;
2404
- function buttonBaseStyles(_ref2) {
2405
- let {
2406
- $width,
2407
- theme
2408
- } = _ref2;
2309
+ function buttonBaseStyles(props) {
2310
+ const {
2311
+ $width
2312
+ } = props;
2409
2313
  const {
2410
- styles
2411
- } = theme.sanity;
2412
- return 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" && css(_a$v || (_a$v = __template$v(["\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n "]))));
2314
+ style
2315
+ } = getTheme_v2(props.theme);
2316
+ return 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" && css(_a$v || (_a$v = __template$v(["\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n "]))));
2413
2317
  }
2414
2318
  function combineBoxShadow() {
2415
2319
  for (var _len = arguments.length, boxShadows = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -2418,49 +2322,51 @@ function combineBoxShadow() {
2418
2322
  return boxShadows.filter(Boolean).join(",");
2419
2323
  }
2420
2324
  function buttonColorStyles(props) {
2421
- var _a2, _b2;
2325
+ var _a2;
2422
2326
  const {
2423
- $mode,
2424
- theme
2327
+ $mode
2425
2328
  } = props;
2426
- const buttonTheme = theme.sanity.button;
2329
+ const {
2330
+ button,
2331
+ color: baseColor,
2332
+ style
2333
+ } = getTheme_v2(props.theme);
2427
2334
  const shadow = props.$mode === "ghost";
2428
- const base = theme.sanity.color.base;
2429
- const mode = theme.sanity.color.button[$mode] || theme.sanity.color.button.default;
2335
+ const mode = baseColor.button[$mode] || baseColor.button.default;
2430
2336
  const color = mode[props.$tone] || mode.default;
2431
2337
  const border = {
2432
- width: buttonTheme.border.width,
2338
+ width: button.border.width,
2433
2339
  color: "var(--card-border-color)"
2434
2340
  };
2435
2341
  const defaultBoxShadow = void 0;
2436
- return [_colorVarsStyle(base, color.enabled), {
2342
+ return [_cardColorStyle(baseColor, color.enabled), {
2437
2343
  backgroundColor: "var(--card-bg-color)",
2438
2344
  color: "var(--card-fg-color)",
2439
2345
  boxShadow: focusRingBorderStyle(border),
2440
- '&:disabled, &[data-disabled="true"]': _colorVarsStyle(base, color.disabled),
2346
+ '&:disabled, &[data-disabled="true"]': _cardColorStyle(baseColor, color.disabled),
2441
2347
  "&:not([data-disabled='true'])": {
2442
2348
  boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0),
2443
2349
  "&:focus": {
2444
2350
  boxShadow: focusRingStyle({
2445
- base,
2351
+ base: baseColor,
2446
2352
  border: {
2447
2353
  width: 2,
2448
- color: base.bg
2354
+ color: baseColor.bg
2449
2355
  },
2450
- focusRing: buttonTheme.focusRing
2356
+ focusRing: button.focusRing
2451
2357
  })
2452
2358
  },
2453
2359
  "&:focus:not(:focus-visible)": {
2454
2360
  boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0)
2455
2361
  },
2456
2362
  "@media (hover: hover)": {
2457
- "&:hover": _colorVarsStyle(base, color.hovered),
2458
- "&:active": _colorVarsStyle(base, color.pressed),
2459
- "&[data-hovered]": _colorVarsStyle(base, color.hovered)
2363
+ "&:hover": _cardColorStyle(baseColor, color.hovered),
2364
+ "&:active": _cardColorStyle(baseColor, color.pressed),
2365
+ "&[data-hovered]": _cardColorStyle(baseColor, color.hovered)
2460
2366
  },
2461
- "&[data-selected]": _colorVarsStyle(base, color.pressed)
2367
+ "&[data-selected]": _cardColorStyle(baseColor, color.pressed)
2462
2368
  }
2463
- }, (_b2 = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.button) == null ? void 0 : _b2.root].filter(Boolean);
2369
+ }, (_a2 = style == null ? void 0 : style.button) == null ? void 0 : _a2.root].filter(Boolean);
2464
2370
  }
2465
2371
  var __freeze$u = Object.freeze;
2466
2372
  var __defProp$v = Object.defineProperty;
@@ -2498,6 +2404,9 @@ const Button = forwardRef(function Button2(props, ref) {
2498
2404
  width,
2499
2405
  ...restProps
2500
2406
  } = props;
2407
+ const {
2408
+ button
2409
+ } = useTheme_v2();
2501
2410
  const justify = useArrayProp(justifyProp);
2502
2411
  const padding = useArrayProp(paddingProp);
2503
2412
  const paddingX = useArrayProp(paddingXProp);
@@ -2508,7 +2417,6 @@ const Button = forwardRef(function Button2(props, ref) {
2508
2417
  const paddingRight = useArrayProp(paddingRightProp);
2509
2418
  const radius = useArrayProp(radiusProp);
2510
2419
  const space = useArrayProp(spaceProp);
2511
- const theme = useTheme();
2512
2420
  const boxProps = useMemo(() => ({
2513
2421
  // flex: 1,
2514
2422
  padding,
@@ -2550,7 +2458,7 @@ const Button = forwardRef(function Button2(props, ref) {
2550
2458
  align: textAlign,
2551
2459
  size: fontSize,
2552
2460
  textOverflow: "ellipsis",
2553
- weight: theme.sanity.button.textWeight,
2461
+ weight: button.textWeight,
2554
2462
  children: text
2555
2463
  })
2556
2464
  }), iconRight && /* @__PURE__ */jsxs(Text, {
@@ -2576,40 +2484,37 @@ function cardStyle(props) {
2576
2484
  }
2577
2485
  function cardBaseStyle(props) {
2578
2486
  const {
2579
- $checkered,
2580
- theme
2487
+ $checkered
2581
2488
  } = props;
2582
- const space = theme.sanity.space;
2489
+ const {
2490
+ space
2491
+ } = getTheme_v2(props.theme);
2583
2492
  return 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 && 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]));
2584
2493
  }
2585
2494
  function cardColorStyle(props) {
2586
- var _a2, _b2;
2495
+ var _a2;
2587
2496
  const {
2588
2497
  $checkered,
2589
- $focusRing,
2590
- theme
2498
+ $focusRing
2591
2499
  } = props;
2592
2500
  const {
2593
- focusRing
2594
- } = theme.sanity.card;
2595
- const {
2596
- base,
2597
2501
  card,
2598
- dark
2599
- } = theme.sanity.color;
2502
+ color,
2503
+ style
2504
+ } = getTheme_v2(props.theme);
2600
2505
  const border = {
2601
- width: 0,
2506
+ width: card.border.width,
2602
2507
  color: "var(--card-border-color)"
2603
2508
  };
2604
- return 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({
2605
- base,
2509
+ return 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({
2510
+ base: color,
2606
2511
  border,
2607
- focusRing
2608
- }) : 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({
2609
- base,
2512
+ focusRing: card.focusRing
2513
+ }) : 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({
2514
+ base: color,
2610
2515
  border,
2611
- focusRing
2612
- }) : void 0, $focusRing ? focusRingBorderStyle(border) : void 0, (_b2 = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.card) == null ? void 0 : _b2.root);
2516
+ focusRing: card.focusRing
2517
+ }) : void 0, $focusRing ? focusRingBorderStyle(border) : void 0, (_a2 = style == null ? void 0 : style.card) == null ? void 0 : _a2.root);
2613
2518
  }
2614
2519
  const Root$t = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
2615
2520
  const Card = forwardRef(function Card2(props, ref) {
@@ -2672,48 +2577,45 @@ function checkboxBaseStyles() {
2672
2577
  }
2673
2578
  function inputElementStyles(props) {
2674
2579
  const {
2675
- theme
2676
- } = props;
2677
- const color = theme.sanity.color.input;
2678
- const {
2580
+ color,
2679
2581
  input,
2680
2582
  radius
2681
- } = theme.sanity;
2583
+ } = getTheme_v2(props.theme);
2682
2584
  const {
2683
2585
  focusRing
2684
2586
  } = input.checkbox;
2685
2587
  return 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({
2686
- color: color.default.enabled.border,
2588
+ color: color.input.default.enabled.border,
2687
2589
  width: input.border.width
2688
- }), rem(radius[2]), color.default.enabled.bg, color.default.enabled.fg, focusRingBorderStyle({
2689
- color: color.default.enabled.fg,
2590
+ }), rem(radius[2]), color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
2591
+ color: color.input.default.enabled.fg,
2690
2592
  width: input.border.width
2691
- }), color.default.enabled.bg, focusRingStyle({
2593
+ }), color.input.default.enabled.bg, focusRingStyle({
2692
2594
  focusRing
2693
2595
  }), focusRingStyle({
2694
2596
  focusRing: {
2695
2597
  width: 1,
2696
2598
  offset: 1
2697
2599
  }
2698
- }), color.invalid.enabled.border, focusRingBorderStyle({
2600
+ }), color.input.invalid.enabled.border, focusRingBorderStyle({
2699
2601
  width: input.border.width,
2700
- color: color.invalid.enabled.bg2
2701
- }), color.default.disabled.fg, color.invalid.enabled.bg2, color.default.enabled.bg, focusRingStyle({
2602
+ color: color.input.invalid.enabled.muted.bg
2603
+ }), color.input.default.disabled.fg, color.input.invalid.enabled.muted.bg, color.input.default.enabled.bg, focusRingStyle({
2702
2604
  border: {
2703
2605
  width: input.border.width,
2704
- color: color.invalid.readOnly.bg2
2606
+ color: color.input.invalid.readOnly.muted.bg
2705
2607
  },
2706
2608
  focusRing: {
2707
2609
  width: 1,
2708
2610
  offset: 1
2709
2611
  }
2710
- }), color.default.disabled.bg, focusRingBorderStyle({
2612
+ }), color.input.default.disabled.bg, focusRingBorderStyle({
2711
2613
  width: input.border.width,
2712
- color: color.default.disabled.border
2713
- }), color.default.disabled.fg, color.default.disabled.bg2, color.default.readOnly.bg, focusRingBorderStyle({
2614
+ color: color.input.default.disabled.border
2615
+ }), color.input.default.disabled.fg, color.input.default.disabled.muted.bg, color.input.default.readOnly.bg, focusRingBorderStyle({
2714
2616
  width: input.border.width,
2715
- color: color.default.readOnly.border
2716
- }), color.default.readOnly.fg, color.default.readOnly.bg2);
2617
+ color: color.input.default.readOnly.border
2618
+ }), color.input.default.readOnly.fg, color.input.default.readOnly.muted.bg);
2717
2619
  }
2718
2620
  const Root$s = styled.div(checkboxBaseStyles);
2719
2621
  const Input$5 = styled.input(inputElementStyles);
@@ -2759,11 +2661,15 @@ var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", {
2759
2661
  value: __freeze$r(raw || cooked.slice())
2760
2662
  }));
2761
2663
  var _a$r;
2762
- function codeSyntaxHighlightingStyle(_ref3) {
2664
+ function codeSyntaxHighlightingStyle(_ref2) {
2763
2665
  let {
2764
2666
  theme
2765
- } = _ref3;
2766
- const color = theme.sanity.color.syntax;
2667
+ } = _ref2;
2668
+ const {
2669
+ color: {
2670
+ syntax: color
2671
+ }
2672
+ } = getTheme_v2(theme);
2767
2673
  return {
2768
2674
  "&.atrule": {
2769
2675
  color: color.atrule
@@ -2912,13 +2818,10 @@ function containerBaseStyle() {
2912
2818
  return BASE_STYLE$1;
2913
2819
  }
2914
2820
  function responsiveContainerWidthStyle(props) {
2915
- const {
2916
- theme
2917
- } = props;
2918
2821
  const {
2919
2822
  container,
2920
2823
  media
2921
- } = theme.sanity;
2824
+ } = getTheme_v2(props.theme);
2922
2825
  return _responsive(media, props.$width, val => ({
2923
2826
  maxWidth: val === "auto" ? "none" : rem(container[val])
2924
2827
  }));
@@ -2979,10 +2882,12 @@ var _a$q, _b$g, _c$8;
2979
2882
  function headingBaseStyle(props) {
2980
2883
  const {
2981
2884
  $accent,
2982
- $muted,
2983
- theme
2885
+ $muted
2984
2886
  } = props;
2985
- return 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 && css(_a$q || (_a$q = __template$q(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$g || (_b$g = __template$q(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family);
2887
+ const {
2888
+ font
2889
+ } = getTheme_v2(props.theme);
2890
+ return 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 && css(_a$q || (_a$q = __template$q(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$g || (_b$g = __template$q(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family);
2986
2891
  }
2987
2892
  var __freeze$p = Object.freeze;
2988
2893
  var __defProp$q = Object.defineProperty;
@@ -3037,14 +2942,15 @@ function inlineBaseStyle() {
3037
2942
  }
3038
2943
  function inlineSpaceStyle(props) {
3039
2944
  const {
3040
- theme
3041
- } = props;
3042
- return _responsive(theme.sanity.media, props.$space, spaceIndex => {
3043
- const space = rem(theme.sanity.space[spaceIndex]);
2945
+ media,
2946
+ space
2947
+ } = getTheme_v2(props.theme);
2948
+ return _responsive(media, props.$space, spaceIndex => {
2949
+ const _space = rem(spaceIndex === 0.5 ? space[1] / 2 : space[spaceIndex]);
3044
2950
  return {
3045
- margin: "-".concat(space, " 0 0 -").concat(space),
2951
+ margin: "-".concat(_space, " 0 0 -").concat(_space),
3046
2952
  "& > div": {
3047
- padding: "".concat(space, " 0 0 ").concat(space)
2953
+ padding: "".concat(_space, " 0 0 ").concat(_space)
3048
2954
  }
3049
2955
  };
3050
2956
  });
@@ -3075,12 +2981,8 @@ var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
3075
2981
  value: __freeze$o(raw || cooked.slice())
3076
2982
  }));
3077
2983
  var _a$o;
3078
- function kbdStyle(props) {
3079
- const {
3080
- theme
3081
- } = props;
3082
- const color = theme.sanity.color.kbd || theme.sanity.color.base;
3083
- return css(_a$o || (_a$o = __template$o(["\n --card-fg-color: ", ";\n --kbd-box-bg: ", ";\n --kbd-box-shadow: ", ";\n\n box-shadow: inset 0 0 0 1px var(--kbd-box-shadow);\n background: var(--kbd-box-bg);\n font: inherit;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])), color.fg, color.bg, color.border);
2984
+ function kbdStyle() {
2985
+ return 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 "])));
3084
2986
  }
3085
2987
  const Root$m = styled.kbd(responsiveRadiusStyle, kbdStyle);
3086
2988
  const KBD = forwardRef(function KBD2(props, ref) {
@@ -3102,7 +3004,7 @@ const KBD = forwardRef(function KBD2(props, ref) {
3102
3004
  children: /* @__PURE__ */jsx(Text, {
3103
3005
  as: "span",
3104
3006
  size: fontSize,
3105
- weight: "medium",
3007
+ weight: "semibold",
3106
3008
  children
3107
3009
  })
3108
3010
  })
@@ -3168,10 +3070,10 @@ var __template$n = (cooked, raw) => __freeze$n(__defProp$o(cooked, "raw", {
3168
3070
  value: __freeze$n(raw || cooked.slice())
3169
3071
  }));
3170
3072
  var _a$n, _b$f, _c$7;
3171
- const Root$l = styled.div(_ref4 => {
3073
+ const Root$l = styled.div(_ref3 => {
3172
3074
  let {
3173
3075
  $w: w
3174
- } = _ref4;
3076
+ } = _ref3;
3175
3077
  return 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);
3176
3078
  });
3177
3079
  const StrokePath = styled.path(_b$f || (_b$f = __template$n(["\n stroke: var(--card-shadow-outline-color);\n"])));
@@ -3183,8 +3085,10 @@ const Arrow = forwardRef(function Arrow2(props, ref) {
3183
3085
  radius = 0,
3184
3086
  ...restProps
3185
3087
  } = props;
3186
- const theme = useTheme();
3187
- const strokeWidth = theme.sanity.card.shadow.outline;
3088
+ const {
3089
+ card
3090
+ } = useTheme_v2();
3091
+ const strokeWidth = card.shadow.outline;
3188
3092
  const center = w / 2;
3189
3093
  const points = [{
3190
3094
  x: 0,
@@ -3253,6 +3157,9 @@ function BoundaryElementProvider(props) {
3253
3157
  children
3254
3158
  });
3255
3159
  }
3160
+ function isRecord(value) {
3161
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
3162
+ }
3256
3163
  const DEFAULT_VALUE = {
3257
3164
  version: 0,
3258
3165
  element: null
@@ -3285,10 +3192,10 @@ function findMinBreakpoints(media, width) {
3285
3192
  return ret;
3286
3193
  }
3287
3194
  const ElementQuery = forwardRef(function ElementQuery2(props, ref) {
3288
- const theme = useTheme();
3195
+ const theme = useTheme_v2();
3289
3196
  const {
3290
3197
  children,
3291
- media = theme.sanity.media,
3198
+ media = theme.media,
3292
3199
  ...restProps
3293
3200
  } = props;
3294
3201
  const forwardedRef = useForwardedRef(ref);
@@ -3730,7 +3637,7 @@ const VirtualList = forwardRef(function VirtualList2(props, ref) {
3730
3637
  } = props;
3731
3638
  const {
3732
3639
  space
3733
- } = useTheme().sanity;
3640
+ } = useTheme_v2();
3734
3641
  const forwardedRef = useForwardedRef(ref);
3735
3642
  const wrapperRef = useRef(null);
3736
3643
  const [scrollTop, setScrollTop] = useState(0);
@@ -3923,13 +3830,13 @@ function size(options) {
3923
3830
  }
3924
3831
  function calcCurrentWidth(params) {
3925
3832
  const {
3833
+ container,
3926
3834
  mediaIndex,
3927
- theme,
3928
3835
  width
3929
3836
  } = params;
3930
3837
  const w = width[mediaIndex];
3931
3838
  const currentWidth = w === void 0 ? width[width.length - 1] : w;
3932
- return typeof currentWidth === "number" ? theme.sanity.container[currentWidth] : void 0;
3839
+ return typeof currentWidth === "number" ? container[currentWidth] : void 0;
3933
3840
  }
3934
3841
  function calcMaxWidth(params) {
3935
3842
  const {
@@ -4024,8 +3931,11 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
4024
3931
  }));
4025
3932
  PopoverCard.displayName = "PopoverCard";
4026
3933
  const Popover = memo(forwardRef(function Popover2(props, ref) {
4027
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
4028
- const theme = useTheme();
3934
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3935
+ const {
3936
+ container,
3937
+ layer
3938
+ } = useTheme_v2();
4029
3939
  const boundaryElementContext = useBoundaryElement();
4030
3940
  const {
4031
3941
  __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
@@ -4053,11 +3963,11 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
4053
3963
  shadow: shadowProp = 3,
4054
3964
  tone = "inherit",
4055
3965
  width: widthProp = "auto",
4056
- zOffset: zOffsetProp = (_e = theme.sanity.layer) == null ? void 0 : _e.popover.zOffset,
3966
+ zOffset: zOffsetProp = layer.popover.zOffset,
4057
3967
  updateRef,
4058
3968
  ...restProps
4059
3969
  } = props;
4060
- const boundarySize = (_f = useElementSize(boundaryElement)) == null ? void 0 : _f.border;
3970
+ const boundarySize = (_e = useElementSize(boundaryElement)) == null ? void 0 : _e.border;
4061
3971
  const padding = useArrayProp(paddingProp);
4062
3972
  const radius = useArrayProp(radiusProp);
4063
3973
  const shadow = useArrayProp(shadowProp);
@@ -4069,8 +3979,8 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
4069
3979
  const mediaIndex = useMediaIndex();
4070
3980
  const boundaryWidth = constrainSize || preventOverflow ? boundarySize == null ? void 0 : boundarySize.width : void 0;
4071
3981
  const width = calcCurrentWidth({
3982
+ container,
4072
3983
  mediaIndex,
4073
- theme,
4074
3984
  width: widthArrayProp
4075
3985
  });
4076
3986
  const widthRef = useRef(width);
@@ -4116,13 +4026,13 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
4116
4026
  }));
4117
4027
  if (constrainSize || matchReferenceWidth) {
4118
4028
  ret.push(size({
4119
- apply(_ref5) {
4029
+ apply(_ref4) {
4120
4030
  let {
4121
4031
  availableWidth,
4122
4032
  availableHeight,
4123
4033
  elements,
4124
4034
  referenceWidth
4125
- } = _ref5;
4035
+ } = _ref4;
4126
4036
  referenceWidthRef.current = referenceWidth;
4127
4037
  const _currentWidth = widthRef.current;
4128
4038
  const _maxWidth = maxWidthRef.current;
@@ -4176,9 +4086,9 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
4176
4086
  placement: placementProp,
4177
4087
  whileElementsMounted: autoUpdate
4178
4088
  });
4179
- const referenceHidden = (_g = middlewareData.hide) == null ? void 0 : _g.referenceHidden;
4180
- const arrowX = (_h = middlewareData.arrow) == null ? void 0 : _h.x;
4181
- const arrowY = (_i = middlewareData.arrow) == null ? void 0 : _i.y;
4089
+ const referenceHidden = (_f = middlewareData.hide) == null ? void 0 : _f.referenceHidden;
4090
+ const arrowX = (_g = middlewareData.arrow) == null ? void 0 : _g.x;
4091
+ const arrowY = (_h = middlewareData.arrow) == null ? void 0 : _h.y;
4182
4092
  const setArrow = useCallback(arrowEl => {
4183
4093
  arrowRef.current = arrowEl;
4184
4094
  }, []);
@@ -4262,32 +4172,26 @@ function radioBaseStyle() {
4262
4172
  }
4263
4173
  function inputElementStyle(props) {
4264
4174
  const {
4265
- theme
4266
- } = props;
4267
- const {
4175
+ color,
4268
4176
  input
4269
- } = theme.sanity;
4270
- const {
4271
- focusRing
4272
- } = input.radio;
4273
- const color = theme.sanity.color.input;
4177
+ } = getTheme_v2(props.theme);
4274
4178
  const dist = (input.radio.size - input.radio.markSize) / 2;
4275
- return 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({
4276
- color: color.default.enabled.border,
4179
+ return 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({
4180
+ color: color.input.default.enabled.border,
4277
4181
  width: input.border.width
4278
- }), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.fg, focusRingStyle({
4182
+ }), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.input.default.enabled.fg, focusRingStyle({
4279
4183
  border: {
4280
4184
  width: input.border.width,
4281
- color: color.default.enabled.border
4185
+ color: color.input.default.enabled.border
4282
4186
  },
4283
- focusRing
4187
+ focusRing: input.radio.focusRing
4284
4188
  }), focusRingBorderStyle({
4285
- color: color.default.enabled.border,
4189
+ color: color.input.default.enabled.border,
4286
4190
  width: input.border.width
4287
- }), color.invalid.enabled.border, focusRingBorderStyle({
4191
+ }), color.input.invalid.enabled.border, focusRingBorderStyle({
4288
4192
  width: input.border.width,
4289
- color: color.invalid.enabled.bg2
4290
- }), 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);
4193
+ color: color.input.invalid.enabled.muted.bg
4194
+ }), 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);
4291
4195
  }
4292
4196
  const Root$g = styled.div(radioBaseStyle);
4293
4197
  const Input$4 = styled.input(inputElementStyle);
@@ -4328,39 +4232,32 @@ function rootStyle() {
4328
4232
  }
4329
4233
  function inputBaseStyle(props) {
4330
4234
  const {
4331
- theme
4332
- } = props;
4333
- const font = theme.sanity.fonts.text;
4334
- return 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);
4235
+ font
4236
+ } = getTheme_v2(props.theme);
4237
+ return 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);
4335
4238
  }
4336
4239
  function inputColorStyle(props) {
4337
4240
  const {
4338
- theme
4339
- } = props;
4340
- const {
4241
+ color,
4341
4242
  input
4342
- } = theme.sanity;
4343
- const {
4344
- focusRing
4345
- } = input.select;
4346
- const color = theme.sanity.color.input;
4347
- return 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({
4348
- color: color.default.enabled.border,
4243
+ } = getTheme_v2(props.theme);
4244
+ return 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({
4245
+ color: color.input.default.enabled.border,
4349
4246
  width: input.border.width
4350
- }), color.default.hovered.bg, color.default.hovered.fg, focusRingBorderStyle({
4351
- color: color.default.hovered.border,
4247
+ }), color.input.default.hovered.bg, color.input.default.hovered.fg, focusRingBorderStyle({
4248
+ color: color.input.default.hovered.border,
4352
4249
  width: input.border.width
4353
4250
  }), focusRingStyle({
4354
4251
  border: {
4355
4252
  width: input.border.width,
4356
- color: color.default.enabled.border
4253
+ color: color.input.default.enabled.border
4357
4254
  },
4358
- focusRing
4359
- }), color.default.readOnly.bg, color.default.readOnly.fg, focusRingBorderStyle({
4360
- color: color.default.readOnly.border,
4255
+ focusRing: input.select.focusRing
4256
+ }), color.input.default.readOnly.bg, color.input.default.readOnly.fg, focusRingBorderStyle({
4257
+ color: color.input.default.readOnly.border,
4361
4258
  width: input.border.width
4362
- }), color.default.disabled.bg, color.default.disabled.fg, focusRingBorderStyle({
4363
- color: color.default.disabled.border,
4259
+ }), color.input.default.disabled.bg, color.input.default.disabled.fg, focusRingBorderStyle({
4260
+ color: color.input.default.disabled.border,
4364
4261
  width: input.border.width
4365
4262
  }));
4366
4263
  }
@@ -4372,23 +4269,22 @@ function textSize(size) {
4372
4269
  }
4373
4270
  function inputTextSizeStyle(props) {
4374
4271
  const {
4375
- theme,
4376
4272
  $fontSize
4377
4273
  } = props;
4378
4274
  const {
4379
- sizes
4380
- } = theme.sanity.fonts.text;
4381
- return _responsive(theme.sanity.media, $fontSize, sizeIndex => textSize(sizes[sizeIndex] || sizes[2]));
4275
+ font,
4276
+ media
4277
+ } = getTheme_v2(props.theme);
4278
+ return _responsive(media, $fontSize, sizeIndex => textSize(font.text.sizes[sizeIndex] || font.text.sizes[2]));
4382
4279
  }
4383
4280
  function inputStyle() {
4384
4281
  return [responsiveRadiusStyle, inputBaseStyle, inputColorStyle, inputTextSizeStyle, responsiveInputPaddingIconRightStyle];
4385
4282
  }
4386
4283
  function iconBoxStyle(props) {
4387
4284
  const {
4388
- theme
4389
- } = props;
4390
- const color = theme.sanity.color.input;
4391
- return 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);
4285
+ color
4286
+ } = getTheme_v2(props.theme);
4287
+ return 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);
4392
4288
  }
4393
4289
  const selectStyle = {
4394
4290
  root: rootStyle,
@@ -4448,13 +4344,10 @@ function stackBaseStyle() {
4448
4344
  return BASE_STYLE;
4449
4345
  }
4450
4346
  function responsiveStackSpaceStyle(props) {
4451
- const {
4452
- theme
4453
- } = props;
4454
4347
  const {
4455
4348
  media,
4456
4349
  space
4457
- } = theme.sanity;
4350
+ } = getTheme_v2(props.theme);
4458
4351
  return _responsive(media, props.$space, spaceIndex => ({
4459
4352
  gridGap: rem(space[spaceIndex])
4460
4353
  }));
@@ -4489,36 +4382,26 @@ function switchInputStyles() {
4489
4382
  }
4490
4383
  function switchRepresentationStyles(props) {
4491
4384
  const {
4492
- theme
4493
- } = props;
4494
- const {
4385
+ color,
4495
4386
  input
4496
- } = theme.sanity;
4497
- const {
4498
- focusRing
4499
- } = input.switch;
4500
- const color = theme.sanity.color.input;
4501
- return 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({
4502
- focusRing
4503
- }), 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);
4387
+ } = getTheme_v2(props.theme);
4388
+ return 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({
4389
+ focusRing: input.switch.focusRing
4390
+ }), 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);
4504
4391
  }
4505
4392
  function switchTrackStyles(props) {
4506
- const {
4507
- theme
4508
- } = props;
4509
4393
  const {
4510
4394
  input
4511
- } = theme.sanity;
4395
+ } = getTheme_v2(props.theme);
4512
4396
  return 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));
4513
4397
  }
4514
4398
  function switchThumbStyles(props) {
4515
4399
  const {
4516
- $indeterminate,
4517
- theme
4400
+ $indeterminate
4518
4401
  } = props;
4519
4402
  const {
4520
4403
  input
4521
- } = theme.sanity;
4404
+ } = getTheme_v2(props.theme);
4522
4405
  const trackWidth = input.switch.width;
4523
4406
  const trackHeight = input.switch.height;
4524
4407
  const trackPadding = input.switch.padding;
@@ -4812,12 +4695,12 @@ function useDelayedState(initialState) {
4812
4695
  }, []);
4813
4696
  return [state, onStateChange];
4814
4697
  }
4815
- function ConditionalWrapper(_ref6) {
4698
+ function ConditionalWrapper(_ref5) {
4816
4699
  let {
4817
4700
  children,
4818
4701
  condition,
4819
4702
  wrapper
4820
- } = _ref6;
4703
+ } = _ref5;
4821
4704
  if (!condition) {
4822
4705
  return children;
4823
4706
  }
@@ -4878,16 +4761,18 @@ var __template$f = (cooked, raw) => __freeze$f(__defProp$f(cooked, "raw", {
4878
4761
  value: __freeze$f(raw || cooked.slice())
4879
4762
  }));
4880
4763
  var _a$f;
4881
- const Root$a = styled(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), _ref7 => {
4764
+ const Root$a = styled(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), _ref6 => {
4882
4765
  let {
4883
4766
  $maxWidth
4884
- } = _ref7;
4767
+ } = _ref6;
4885
4768
  return $maxWidth;
4886
4769
  });
4887
4770
  const Tooltip = forwardRef(function Tooltip2(props, ref) {
4888
- var _a2, _b, _c, _d, _e, _f;
4771
+ var _a2, _b, _c, _d, _e;
4889
4772
  const boundaryElementContext = useBoundaryElement();
4890
- const theme = useTheme();
4773
+ const {
4774
+ layer
4775
+ } = useTheme_v2();
4891
4776
  const {
4892
4777
  arrow: arrowProp = false,
4893
4778
  boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
@@ -4901,7 +4786,7 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
4901
4786
  radius = 2,
4902
4787
  scheme,
4903
4788
  shadow = 2,
4904
- zOffset = (_c = theme.sanity.layer) == null ? void 0 : _c.tooltip.zOffset,
4789
+ zOffset = layer.tooltip.zOffset,
4905
4790
  delay,
4906
4791
  animate = false,
4907
4792
  ...restProps
@@ -4912,7 +4797,7 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
4912
4797
  const arrowRef = useRef(null);
4913
4798
  const rootBoundary = "viewport";
4914
4799
  const portal = usePortal();
4915
- const portalElement = typeof portalProp === "string" ? ((_d = portal.elements) == null ? void 0 : _d[portalProp]) || null : portal.element;
4800
+ const portalElement = typeof portalProp === "string" ? ((_c = portal.elements) == null ? void 0 : _c[portalProp]) || null : portal.element;
4916
4801
  const tooltipWidth = useMemo(() => {
4917
4802
  const availableWidths = [...(boundaryElement ? [boundaryElement.offsetWidth] : []), (portalElement == null ? void 0 : portalElement.offsetWidth) || document.body.offsetWidth];
4918
4803
  return Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2;
@@ -4952,8 +4837,8 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
4952
4837
  placement: placementProp,
4953
4838
  whileElementsMounted: autoUpdate
4954
4839
  });
4955
- const arrowX = (_e = middlewareData.arrow) == null ? void 0 : _e.x;
4956
- const arrowY = (_f = middlewareData.arrow) == null ? void 0 : _f.y;
4840
+ const arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x;
4841
+ const arrowY = (_e = middlewareData.arrow) == null ? void 0 : _e.y;
4957
4842
  const arrowStyle = useMemo(() => ({
4958
4843
  left: arrowX !== null ? arrowX : void 0,
4959
4844
  top: arrowY !== null ? arrowY : void 0,
@@ -5297,10 +5182,10 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
5297
5182
  query,
5298
5183
  value
5299
5184
  } = state;
5300
- const defaultRenderOption = useCallback(_ref8 => {
5185
+ const defaultRenderOption = useCallback(_ref7 => {
5301
5186
  let {
5302
5187
  value: value2
5303
- } = _ref8;
5188
+ } = _ref7;
5304
5189
  return /* @__PURE__ */jsx(Card, {
5305
5190
  "data-as": "button",
5306
5191
  padding: paddingProp,
@@ -5759,11 +5644,13 @@ var __template$c = (cooked, raw) => __freeze$c(__defProp$c(cooked, "raw", {
5759
5644
  value: __freeze$c(raw || cooked.slice())
5760
5645
  }));
5761
5646
  var _a$c, _b$7;
5762
- function dialogStyle(_ref9) {
5647
+ function dialogStyle(_ref8) {
5763
5648
  let {
5764
5649
  theme
5765
- } = _ref9;
5766
- const color = theme.sanity.color.base;
5650
+ } = _ref8;
5651
+ const {
5652
+ color
5653
+ } = getTheme_v2(theme);
5767
5654
  return {
5768
5655
  "&:not([hidden])": {
5769
5656
  display: "flex"
@@ -5775,16 +5662,13 @@ function dialogStyle(_ref9) {
5775
5662
  alignItems: "center",
5776
5663
  justifyContent: "center",
5777
5664
  outline: "none",
5778
- background: color.shadow.umbra
5665
+ background: color.backdrop
5779
5666
  };
5780
5667
  }
5781
5668
  function responsiveDialogPositionStyle(props) {
5782
- const {
5783
- theme
5784
- } = props;
5785
5669
  const {
5786
5670
  media
5787
- } = theme.sanity;
5671
+ } = getTheme_v2(props.theme);
5788
5672
  return _responsive(media, props.$position, position => ({
5789
5673
  "&&": {
5790
5674
  position
@@ -5936,14 +5820,16 @@ const DialogCard = forwardRef(function DialogCard2(props, ref) {
5936
5820
  });
5937
5821
  });
5938
5822
  const Dialog = forwardRef(function Dialog2(props, ref) {
5939
- var _a2, _b2;
5823
+ var _a2;
5940
5824
  const dialog = useDialog();
5941
- const theme = useTheme();
5825
+ const {
5826
+ layer
5827
+ } = useTheme_v2();
5942
5828
  const {
5943
5829
  __unstable_autoFocus: autoFocus = true,
5944
5830
  __unstable_hideCloseButton: hideCloseButton = false,
5945
- cardRadius: cardRadiusProp = 3,
5946
- cardShadow = 4,
5831
+ cardRadius: cardRadiusProp = 4,
5832
+ cardShadow = 3,
5947
5833
  children,
5948
5834
  contentRef,
5949
5835
  footer,
@@ -5958,12 +5844,12 @@ const Dialog = forwardRef(function Dialog2(props, ref) {
5958
5844
  position: positionProp = dialog.position || "fixed",
5959
5845
  scheme,
5960
5846
  width: widthProp = 0,
5961
- zOffset: zOffsetProp = dialog.zOffset || ((_a2 = theme.sanity.layer) == null ? void 0 : _a2.dialog.zOffset),
5847
+ zOffset: zOffsetProp = dialog.zOffset || layer.dialog.zOffset,
5962
5848
  animate = false,
5963
5849
  ...restProps
5964
5850
  } = props;
5965
5851
  const portal = usePortal();
5966
- const portalElement = portalProp ? ((_b2 = portal.elements) == null ? void 0 : _b2[portalProp]) || null : portal.element;
5852
+ const portalElement = portalProp ? ((_a2 = portal.elements) == null ? void 0 : _a2[portalProp]) || null : portal.element;
5967
5853
  const boundaryElement = useBoundaryElement().element;
5968
5854
  const cardRadius = useArrayProp(cardRadiusProp);
5969
5855
  const padding = useArrayProp(paddingProp);
@@ -6074,7 +5960,7 @@ var __template$a = (cooked, raw) => __freeze$a(__defProp$a(cooked, "raw", {
6074
5960
  value: __freeze$a(raw || cooked.slice())
6075
5961
  }));
6076
5962
  var _a$a, _b$5;
6077
- const Root$6 = styled.kbd(_a$a || (_a$a = __template$a(["\n &:not([hidden]) {\n display: block;\n }\n font: inherit;\n"])));
5963
+ const Root$6 = styled.kbd(_a$a || (_a$a = __template$a(["\n font: inherit;\n padding: 1px;\n\n &:not([hidden]) {\n display: block;\n }\n"])));
6078
5964
  const Key = styled(KBD)(_b$5 || (_b$5 = __template$a(["\n &:not([hidden]) {\n display: block;\n }\n"])));
6079
5965
  const Hotkeys = forwardRef(function Hotkeys2(props, ref) {
6080
5966
  const {
@@ -6082,7 +5968,7 @@ const Hotkeys = forwardRef(function Hotkeys2(props, ref) {
6082
5968
  keys,
6083
5969
  padding,
6084
5970
  radius,
6085
- space: spaceProp = 1,
5971
+ space: spaceProp = 0.5,
6086
5972
  ...restProps
6087
5973
  } = props;
6088
5974
  const space = useArrayProp(spaceProp);
@@ -6552,18 +6438,16 @@ function selectableBaseStyle() {
6552
6438
  return 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 "])));
6553
6439
  }
6554
6440
  function selectableColorStyle(props) {
6555
- var _a2, _b2;
6441
+ var _a2;
6556
6442
  const {
6557
- $tone,
6558
- theme
6443
+ $tone
6559
6444
  } = props;
6560
6445
  const {
6561
- base,
6562
- muted,
6563
- selectable
6564
- } = theme.sanity.color;
6565
- const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
6566
- return 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);
6446
+ color,
6447
+ style
6448
+ } = getTheme_v2(props.theme);
6449
+ const tone = color.selectable[$tone];
6450
+ return 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);
6567
6451
  }
6568
6452
  const Selectable = styled(Box)(responsiveRadiusStyle, selectableBaseStyle, selectableColorStyle);
6569
6453
  function useMenu() {
@@ -6766,6 +6650,7 @@ const MenuItem = forwardRef(function MenuItem2(props, forwardedRef) {
6766
6650
  paddingBottom,
6767
6651
  paddingLeft
6768
6652
  }), [padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft]);
6653
+ const hotkeysFontSize = useArrayProp(fontSize).map(s => s - 1);
6769
6654
  const setRef = useCallback(el => {
6770
6655
  ref.current = el;
6771
6656
  setRootElement(el);
@@ -6807,7 +6692,7 @@ const MenuItem = forwardRef(function MenuItem2(props, forwardedRef) {
6807
6692
  children: text
6808
6693
  })
6809
6694
  }), hotkeys && /* @__PURE__ */jsx(Hotkeys, {
6810
- fontSize,
6695
+ fontSize: hotkeysFontSize,
6811
6696
  keys: hotkeys,
6812
6697
  style: {
6813
6698
  marginTop: -4,
@@ -6832,15 +6717,15 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
6832
6717
  var _a$6, _b$3, _c$1, _d;
6833
6718
  const keyframe = keyframes(_a$6 || (_a$6 = __template$6(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
6834
6719
  const animation = 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);
6835
- const skeletonStyle = 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 => {
6720
+ const skeletonStyle = 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 => {
6836
6721
  let {
6837
6722
  $visible
6838
- } = _ref10;
6723
+ } = _ref9;
6839
6724
  return $visible ? 1 : 0;
6840
- }, _ref11 => {
6725
+ }, _ref10 => {
6841
6726
  let {
6842
6727
  $animated
6843
- } = _ref11;
6728
+ } = _ref10;
6844
6729
  return $animated ? animation : css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
6845
6730
  });
6846
6731
  const Root$4 = styled(Box)(responsiveRadiusStyle, skeletonStyle);
@@ -6871,18 +6756,18 @@ const Skeleton = forwardRef(function Skeleton2(props, ref) {
6871
6756
  ref
6872
6757
  });
6873
6758
  });
6874
- const Root$3 = styled(Skeleton)(_ref12 => {
6875
- let {
6759
+ const Root$3 = styled(Skeleton)(props => {
6760
+ const {
6876
6761
  $size,
6877
- $style,
6878
- theme
6879
- } = _ref12;
6762
+ $style
6763
+ } = props;
6880
6764
  const {
6765
+ font,
6881
6766
  media
6882
- } = theme.sanity;
6883
- const font = theme.sanity.fonts[$style];
6767
+ } = getTheme_v2(props.theme);
6768
+ const fontStyle = font[$style];
6884
6769
  const styles = _responsive(media, $size, sizeIndex => {
6885
- const fontSize = font.sizes[sizeIndex];
6770
+ const fontSize = fontStyle.sizes[sizeIndex];
6886
6771
  const capHeight = fontSize.lineHeight - fontSize.ascenderHeight - fontSize.descenderHeight;
6887
6772
  return {
6888
6773
  height: capHeight
@@ -7225,12 +7110,12 @@ function ToastProvider(props) {
7225
7110
  paddingY,
7226
7111
  children: /* @__PURE__ */jsx(AnimatePresence, {
7227
7112
  initial: false,
7228
- children: state.map(_ref13 => {
7113
+ children: state.map(_ref11 => {
7229
7114
  let {
7230
7115
  dismiss,
7231
7116
  id,
7232
7117
  params
7233
- } = _ref13;
7118
+ } = _ref11;
7234
7119
  return /* @__PURE__ */jsx(motion.div, {
7235
7120
  animate: {
7236
7121
  opacity: 1,
@@ -7524,26 +7409,20 @@ function treeItemRootStyle() {
7524
7409
  return 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 "])));
7525
7410
  }
7526
7411
  function treeItemRootColorStyle(props) {
7527
- const {
7528
- theme
7529
- } = props;
7530
7412
  const $tone = "default";
7531
7413
  const {
7532
- base,
7533
- muted,
7534
- selectable
7535
- } = theme.sanity.color;
7536
- const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
7537
- return 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));
7414
+ color
7415
+ } = getTheme_v2(props.theme);
7416
+ const tone = color.selectable[$tone];
7417
+ return 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));
7538
7418
  }
7539
7419
  function treeItemBoxStyle(props) {
7540
7420
  const {
7541
- $level,
7542
- theme
7421
+ $level
7543
7422
  } = props;
7544
7423
  const {
7545
7424
  space
7546
- } = theme.sanity;
7425
+ } = getTheme_v2(props.theme);
7547
7426
  return css(_c || (_c = __template$1(["\n padding-left: ", ";\n\n &[data-as='a'] {\n text-decoration: none;\n }\n "])), rem(space[2] * $level));
7548
7427
  }
7549
7428
  function useTree() {
@@ -7730,5 +7609,5 @@ const TreeItem = memo(function TreeItem2(props) {
7730
7609
  })]
7731
7610
  });
7732
7611
  });
7733
- export { Arrow, Autocomplete, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Box, Breadcrumbs, Button, Card, Checkbox, Code, CodeSkeleton, Container, Dialog, DialogContext, DialogProvider, ElementQuery, ErrorBoundary, Flex, Grid, Heading, HeadingSkeleton, Hotkeys, Inline, KBD, Label, LabelSkeleton, Layer, LayerProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem, Popover, Portal, PortalProvider, Radio, Select, Skeleton, Spinner, SrOnly, Stack, Switch, Tab, TabList, TabPanel, Text, TextArea, TextInput, TextSkeleton, ThemeColorProvider, ThemeProvider, Toast, ToastProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, Tree, TreeItem, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _hasFocus, _isEnterToClickElement, _isScrollable, _raf, _raf2, _responsive, attemptFocus, containsOrEqualsElement, focusFirstDescendant, focusLastDescendant, isFocusable, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, rem, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, useArrayProp, useBoundaryElement, useClickOutside, useCustomValidity, useDialog, useElementRect, useElementSize, useForwardedRef, useGlobalKeyDown, useLayer, useMediaIndex, usePortal, usePrefersDark, usePrefersReducedMotion, useRootTheme, useTheme, useToast, useTooltipDelayGroup, useTree };
7612
+ export { Arrow, Autocomplete, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Box, Breadcrumbs, Button, Card, Checkbox, Code, CodeSkeleton, Container, Dialog, DialogContext, DialogProvider, ElementQuery, ErrorBoundary, Flex, Grid, Heading, HeadingSkeleton, Hotkeys, Inline, KBD, Label, LabelSkeleton, Layer, LayerProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem, Popover, Portal, PortalProvider, Radio, Select, Skeleton, Spinner, SrOnly, Stack, Switch, Tab, TabList, TabPanel, Text, TextArea, TextInput, TextSkeleton, ThemeColorProvider, ThemeProvider, Toast, ToastProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, Tree, TreeItem, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _hasFocus, _isEnterToClickElement, _isScrollable, _raf, _raf2, _responsive, attemptFocus, containsOrEqualsElement, focusFirstDescendant, focusLastDescendant, isFocusable, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, rem, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, useArrayProp, useBoundaryElement, useClickOutside, useCustomValidity, useDialog, useElementRect, useElementSize, useForwardedRef, useGlobalKeyDown, useLayer, useMediaIndex, usePortal, usePrefersDark, usePrefersReducedMotion, useRootTheme, useTheme, useTheme_v2, useToast, useTooltipDelayGroup, useTree };
7734
7613
  //# sourceMappingURL=index.esm.js.map