@sanity/ui 2.0.13-alpha.2 → 2.0.13

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 (115) hide show
  1. package/dist/index.d.mts +2 -2
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.esm.js +74 -74
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +202 -202
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +74 -74
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/theme.d.mts +1 -1
  10. package/dist/theme.d.ts +1 -1
  11. package/dist/theme.esm.js +587 -51
  12. package/dist/theme.esm.js.map +1 -1
  13. package/dist/theme.js +560 -22
  14. package/dist/theme.js.map +1 -1
  15. package/dist/theme.mjs +587 -51
  16. package/dist/theme.mjs.map +1 -1
  17. package/package.json +27 -28
  18. package/src/core/components/autocomplete/autocomplete.styles.tsx +1 -1
  19. package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +1 -1
  20. package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
  21. package/src/core/components/dialog/dialog.tsx +1 -1
  22. package/src/core/components/dialog/styles.ts +3 -3
  23. package/src/core/components/hotkeys/hotkeys.tsx +1 -1
  24. package/src/core/components/menu/menu.tsx +1 -1
  25. package/src/core/components/menu/menuDivider.ts +1 -1
  26. package/src/core/components/skeleton/skeleton.tsx +1 -1
  27. package/src/core/components/skeleton/textSkeleton.tsx +3 -3
  28. package/src/core/components/tab/tab.tsx +1 -1
  29. package/src/core/components/tab/tabList.tsx +1 -1
  30. package/src/core/components/toast/toast.tsx +1 -1
  31. package/src/core/components/toast/toastProvider.tsx +1 -1
  32. package/src/core/components/tree/style.ts +3 -2
  33. package/src/core/components/tree/treeItem.tsx +1 -1
  34. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +1 -1
  35. package/src/core/primitives/_selectable/selectable.tsx +1 -1
  36. package/src/core/primitives/_selectable/style.ts +2 -1
  37. package/src/core/primitives/avatar/avatar.tsx +1 -1
  38. package/src/core/primitives/avatar/avatarCounter.tsx +4 -3
  39. package/src/core/primitives/avatar/avatarStack.tsx +3 -2
  40. package/src/core/primitives/avatar/styles.ts +3 -3
  41. package/src/core/primitives/badge/badge.tsx +1 -1
  42. package/src/core/primitives/box/box.tsx +1 -1
  43. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
  44. package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
  45. package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
  46. package/src/core/primitives/button/button.tsx +1 -1
  47. package/src/core/primitives/button/styles.ts +3 -3
  48. package/src/core/primitives/card/__workshop__/selected.tsx +3 -3
  49. package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
  50. package/src/core/primitives/card/card.tsx +1 -1
  51. package/src/core/primitives/card/styles.ts +3 -2
  52. package/src/core/primitives/checkbox/checkbox.tsx +1 -1
  53. package/src/core/primitives/checkbox/styles.ts +2 -1
  54. package/src/core/primitives/code/code.tsx +1 -1
  55. package/src/core/primitives/code/styles.ts +4 -1
  56. package/src/core/primitives/container/container.tsx +1 -1
  57. package/src/core/primitives/container/styles.ts +2 -2
  58. package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
  59. package/src/core/primitives/flex/flex.tsx +1 -1
  60. package/src/core/primitives/grid/grid.tsx +1 -1
  61. package/src/core/primitives/heading/heading.tsx +1 -1
  62. package/src/core/primitives/heading/styles.ts +2 -1
  63. package/src/core/primitives/inline/inline.tsx +1 -1
  64. package/src/core/primitives/inline/styles.ts +2 -2
  65. package/src/core/primitives/kbd/kbd.tsx +1 -1
  66. package/src/core/primitives/label/label.tsx +1 -1
  67. package/src/core/primitives/label/styles.ts +2 -1
  68. package/src/core/primitives/popover/popoverCard.tsx +1 -1
  69. package/src/core/primitives/radio/radio.tsx +1 -1
  70. package/src/core/primitives/radio/styles.ts +2 -1
  71. package/src/core/primitives/select/select.tsx +1 -1
  72. package/src/core/primitives/select/styles.ts +5 -5
  73. package/src/core/primitives/spinner/spinner.tsx +1 -1
  74. package/src/core/primitives/stack/stack.tsx +1 -1
  75. package/src/core/primitives/stack/styles.ts +2 -2
  76. package/src/core/primitives/switch/styles.ts +4 -3
  77. package/src/core/primitives/switch/switch.tsx +1 -1
  78. package/src/core/primitives/text/__workshop__/colored.tsx +3 -3
  79. package/src/core/primitives/text/styles.ts +2 -1
  80. package/src/core/primitives/text/text.tsx +1 -1
  81. package/src/core/primitives/textArea/textArea.tsx +1 -1
  82. package/src/core/primitives/textInput/textInput.tsx +1 -1
  83. package/src/core/primitives/tooltip/tooltip.tsx +1 -1
  84. package/src/core/primitives/tooltip/tooltipCard.tsx +1 -1
  85. package/src/core/styles/border/borderStyle.ts +6 -6
  86. package/src/core/styles/box/boxStyle.ts +5 -5
  87. package/src/core/styles/flex/flexItemStyle.ts +2 -2
  88. package/src/core/styles/flex/flexStyle.ts +6 -6
  89. package/src/core/styles/font/responsiveFont.ts +2 -2
  90. package/src/core/styles/font/textAlignStyle.ts +2 -2
  91. package/src/core/styles/grid/gridItemStyle.ts +7 -7
  92. package/src/core/styles/grid/gridStyle.ts +9 -9
  93. package/src/core/styles/helpers.ts +2 -2
  94. package/src/core/styles/input/responsiveInputPaddingStyle.ts +2 -2
  95. package/src/core/styles/input/textInputStyle.ts +4 -4
  96. package/src/core/styles/margin/marginsStyle.test.ts +1 -1
  97. package/src/core/styles/padding/paddingStyle.test.ts +1 -1
  98. package/src/core/styles/radius/radiusStyle.ts +2 -2
  99. package/src/core/styles/shadow/shadowStyle.ts +2 -2
  100. package/src/core/theme/__workshop__/build/Root.tsx +2 -1
  101. package/src/core/theme/theme.test.tsx +1 -1
  102. package/src/core/theme/themeProvider.tsx +7 -6
  103. package/src/core/theme/useTheme.ts +1 -2
  104. package/src/core/utils/arrow/arrow.tsx +1 -1
  105. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
  106. package/src/core/utils/layer/layer.tsx +1 -1
  107. package/src/core/utils/srOnly/srOnly.tsx +1 -1
  108. package/src/core/utils/virtualList/virtualList.tsx +1 -1
  109. package/src/theme/system/theme.ts +1 -1
  110. package/dist/_chunks-cjs/getScopedTheme.js +0 -547
  111. package/dist/_chunks-cjs/getScopedTheme.js.map +0 -1
  112. package/dist/_chunks-es/getScopedTheme.mjs +0 -548
  113. package/dist/_chunks-es/getScopedTheme.mjs.map +0 -1
  114. package/dist/_legacy/getScopedTheme.esm.js +0 -548
  115. package/dist/_legacy/getScopedTheme.esm.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: !0 });
3
- var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), react = require("react"), ReactIs = require("react-is"), styled = require("styled-components");
4
- require("@sanity/color");
5
- var getScopedTheme = require("./_chunks-cjs/getScopedTheme.js"), icons = require("@sanity/icons"), Refractor = require("react-refractor"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), reactDom = require("react-dom");
3
+ var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), react = require("react"), ReactIs = require("react-is"), styledComponents = require("styled-components"), icons = require("@sanity/icons"), Refractor = require("react-refractor"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), reactDom = require("react-dom");
6
4
  function _interopDefaultCompat(e) {
7
5
  return e && typeof e == "object" && "default" in e ? e : { default: e };
8
6
  }
9
- var ReactIs__default = /* @__PURE__ */ _interopDefaultCompat(ReactIs), styled__default = /* @__PURE__ */ _interopDefaultCompat(styled), Refractor__default = /* @__PURE__ */ _interopDefaultCompat(Refractor);
7
+ var ReactIs__default = /* @__PURE__ */ _interopDefaultCompat(ReactIs), Refractor__default = /* @__PURE__ */ _interopDefaultCompat(Refractor);
10
8
  const createColorTheme = theme.createColorTheme, hexToRgb = theme.hexToRgb, hslToRgb = theme.hslToRgb, multiply = theme.multiply, parseColor = theme.parseColor, rgbToHex = theme.rgbToHex, rgbToHsl = theme.rgbToHsl, rgba = theme.rgba, screen = theme.screen, studioTheme = theme.buildTheme(), EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_CONTENT_OPACITY_PROPERTY = "--motion-content-opacity", POPOVER_MOTION_PROPS = {
11
9
  initial: {
12
10
  opacity: 0.5,
@@ -39,12 +37,12 @@ function _responsive(media, values, callback) {
39
37
  function _getArrayProp(val, defaultVal) {
40
38
  return val === void 0 ? defaultVal || EMPTY_ARRAY : Array.isArray(val) ? val : [val];
41
39
  }
42
- function _getResponsiveSpace(theme2, props, spaceIndexes = EMPTY_ARRAY) {
40
+ function _getResponsiveSpace(theme$1, props, spaceIndexes = EMPTY_ARRAY) {
43
41
  if (!Array.isArray(spaceIndexes))
44
42
  throw new Error("the property must be array of numbers");
45
43
  if (spaceIndexes.length === 0)
46
44
  return null;
47
- const { media, space } = theme2.sanity.v2;
45
+ const { media, space } = theme.getTheme_v2(theme$1);
48
46
  return _responsive(
49
47
  media,
50
48
  spaceIndexes,
@@ -52,7 +50,7 @@ function _getResponsiveSpace(theme2, props, spaceIndexes = EMPTY_ARRAY) {
52
50
  );
53
51
  }
54
52
  function responsiveFont(fontKey, props) {
55
- const { $size, $weight } = props, { font, media } = props.theme.sanity.v2, { family, sizes, weights } = font[fontKey], fontWeight = $weight && weights[$weight] || weights.regular, defaultSize = sizes[2], base = {
53
+ const { $size, $weight } = props, { font, media } = theme.getTheme_v2(props.theme), { family, sizes, weights } = font[fontKey], fontWeight = $weight && weights[$weight] || weights.regular, defaultSize = sizes[2], base = {
56
54
  position: "relative",
57
55
  fontFamily: family,
58
56
  fontWeight,
@@ -113,7 +111,7 @@ function responsiveLabelFont(props) {
113
111
  return responsiveFont("label", props);
114
112
  }
115
113
  function responsiveTextAlignStyle(props) {
116
- const { media } = props.theme.sanity.v2;
114
+ const { media } = theme.getTheme_v2(props.theme);
117
115
  return _responsive(media, props.$align, (textAlign) => ({ textAlign }));
118
116
  }
119
117
  function responsiveTextFont(props) {
@@ -530,8 +528,8 @@ function ThemeProvider(props) {
530
528
  theme: rootTheme,
531
529
  scheme,
532
530
  tone
533
- } : null, [rootTheme, scheme, tone]), theme2 = react.useMemo(() => rootTheme ? getScopedTheme.getScopedTheme(rootTheme, scheme, tone) : null, [scheme, rootTheme, tone]);
534
- return theme2 ? theme2.sanity.v2 ? /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsxRuntime.jsx(styled.ThemeProvider, { theme: theme2, children }) }) : /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme.sanity.v2" property in theme' }) : /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
531
+ } : null, [rootTheme, scheme, tone]), theme$1 = react.useMemo(() => rootTheme ? theme.getScopedTheme(rootTheme, scheme, tone) : null, [scheme, rootTheme, tone]);
532
+ return theme$1 ? /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsxRuntime.jsx(styledComponents.ThemeProvider, { theme: theme$1, children }) }) : /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
535
533
  }
536
534
  function useRootTheme() {
537
535
  const value = react.useContext(ThemeContext);
@@ -544,10 +542,10 @@ function ThemeColorProvider(props) {
544
542
  return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { scheme: scheme || root.scheme, theme: root.theme, tone, children });
545
543
  }
546
544
  function useTheme() {
547
- return styled.useTheme();
545
+ return styledComponents.useTheme();
548
546
  }
549
547
  function useTheme_v2() {
550
- return getScopedTheme.getTheme_v2(styled.useTheme());
548
+ return theme.getTheme_v2(styledComponents.useTheme());
551
549
  }
552
550
  const MEDIA_STORE_CACHE = /* @__PURE__ */ new WeakMap();
553
551
  function _getMediaQuery(media, index) {
@@ -644,7 +642,7 @@ function responsiveBorderStyle() {
644
642
  }
645
643
  function border(props) {
646
644
  var _a, _b;
647
- const { card, media } = props.theme.sanity.v2, borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
645
+ const { card, media } = theme.getTheme_v2(props.theme), borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
648
646
  return _responsive(
649
647
  media,
650
648
  props.$border,
@@ -653,7 +651,7 @@ function border(props) {
653
651
  }
654
652
  function borderTop(props) {
655
653
  var _a, _b;
656
- const { card, media } = props.theme.sanity.v2, borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
654
+ const { card, media } = theme.getTheme_v2(props.theme), borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
657
655
  return _responsive(
658
656
  media,
659
657
  props.$borderTop,
@@ -662,7 +660,7 @@ function borderTop(props) {
662
660
  }
663
661
  function borderRight(props) {
664
662
  var _a, _b;
665
- const { card, media } = props.theme.sanity.v2, borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
663
+ const { card, media } = theme.getTheme_v2(props.theme), borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
666
664
  return _responsive(
667
665
  media,
668
666
  props.$borderRight,
@@ -671,7 +669,7 @@ function borderRight(props) {
671
669
  }
672
670
  function borderBottom(props) {
673
671
  var _a, _b;
674
- const { card, media } = props.theme.sanity.v2, borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
672
+ const { card, media } = theme.getTheme_v2(props.theme), borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
675
673
  return _responsive(
676
674
  media,
677
675
  props.$borderBottom,
@@ -680,7 +678,7 @@ function borderBottom(props) {
680
678
  }
681
679
  function borderLeft(props) {
682
680
  var _a, _b;
683
- const { card, media } = props.theme.sanity.v2, borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
681
+ const { card, media } = theme.getTheme_v2(props.theme), borderStyle = `${(_b = (_a = card.border) == null ? void 0 : _a.width) != null ? _b : 1}px solid var(--card-border-color)`;
684
682
  return _responsive(
685
683
  media,
686
684
  props.$borderLeft,
@@ -710,25 +708,25 @@ function responsiveBoxStyle() {
710
708
  ];
711
709
  }
712
710
  function responsiveBoxDisplayStyle(props) {
713
- const { media } = props.theme.sanity.v2;
711
+ const { media } = theme.getTheme_v2(props.theme);
714
712
  return _responsive(media, props.$display, (display) => ({
715
713
  "&:not([hidden])": { display }
716
714
  }));
717
715
  }
718
716
  function responsiveBoxSizingStyle(props) {
719
- const { media } = props.theme.sanity.v2;
717
+ const { media } = theme.getTheme_v2(props.theme);
720
718
  return _responsive(media, props.$sizing, (sizing) => ({
721
719
  boxSizing: BOX_SIZING[sizing]
722
720
  }));
723
721
  }
724
722
  function responsiveBoxHeightStyle(props) {
725
- const { media } = props.theme.sanity.v2;
723
+ const { media } = theme.getTheme_v2(props.theme);
726
724
  return _responsive(media, props.$height, (height) => ({
727
725
  height: BOX_HEIGHT[height]
728
726
  }));
729
727
  }
730
728
  function responsiveBoxOverflowStyle(props) {
731
- const { media } = props.theme.sanity.v2;
729
+ const { media } = theme.getTheme_v2(props.theme);
732
730
  return _responsive(media, props.$overflow, (overflow) => ({
733
731
  overflow
734
732
  }));
@@ -749,25 +747,25 @@ function responsiveFlexStyle() {
749
747
  ];
750
748
  }
751
749
  function responsiveFlexAlignStyle(props) {
752
- const { media } = props.theme.sanity.v2;
750
+ const { media } = theme.getTheme_v2(props.theme);
753
751
  return _responsive(media, props.$align, (align) => ({ alignItems: align }));
754
752
  }
755
753
  function responsiveFlexGapStyle(props) {
756
- const { media, space } = props.theme.sanity.v2;
754
+ const { media, space } = theme.getTheme_v2(props.theme);
757
755
  return _responsive(media, props.$gap, (gap) => ({
758
756
  gap: gap ? rem(space[gap]) : void 0
759
757
  }));
760
758
  }
761
759
  function responsiveFlexWrapStyle(props) {
762
- const { media } = props.theme.sanity.v2;
760
+ const { media } = theme.getTheme_v2(props.theme);
763
761
  return _responsive(media, props.$wrap, (wrap) => ({ flexWrap: wrap }));
764
762
  }
765
763
  function responsiveFlexJustifyStyle(props) {
766
- const { media } = props.theme.sanity.v2;
764
+ const { media } = theme.getTheme_v2(props.theme);
767
765
  return _responsive(media, props.$justify, (justify) => ({ justifyContent: justify }));
768
766
  }
769
767
  function responsiveFlexDirectionStyle(props) {
770
- const { media } = props.theme.sanity.v2;
768
+ const { media } = theme.getTheme_v2(props.theme);
771
769
  return _responsive(media, props.$direction, (direction) => ({ flexDirection: direction }));
772
770
  }
773
771
  const BASE_STYLE$2 = {
@@ -778,7 +776,7 @@ function flexItemStyle() {
778
776
  return [BASE_STYLE$2, responsiveFlexItemStyle];
779
777
  }
780
778
  function responsiveFlexItemStyle(props) {
781
- const { media } = props.theme.sanity.v2;
779
+ const { media } = theme.getTheme_v2(props.theme);
782
780
  return props.$flex ? _responsive(media, props.$flex, (flex) => ({ flex })) : EMPTY_ARRAY;
783
781
  }
784
782
  function focusRingBorderStyle(border2) {
@@ -825,49 +823,49 @@ function responsiveGridStyle() {
825
823
  ];
826
824
  }
827
825
  function responsiveGridAutoFlowStyle(props) {
828
- const { media } = props.theme.sanity.v2;
826
+ const { media } = theme.getTheme_v2(props.theme);
829
827
  return _responsive(media, props.$autoFlow, (autoFlow) => ({
830
828
  gridAutoFlow: autoFlow
831
829
  }));
832
830
  }
833
831
  function responsiveGridAutoRowsStyle(props) {
834
- const { media } = props.theme.sanity.v2;
832
+ const { media } = theme.getTheme_v2(props.theme);
835
833
  return _responsive(media, props.$autoRows, (autoRows) => ({
836
834
  gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows]
837
835
  }));
838
836
  }
839
837
  function responsiveGridAutoColsStyle(props) {
840
- const { media } = props.theme.sanity.v2;
838
+ const { media } = theme.getTheme_v2(props.theme);
841
839
  return _responsive(media, props.$autoCols, (autoCols) => ({
842
840
  gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols]
843
841
  }));
844
842
  }
845
843
  function responsiveGridColumnsStyle(props) {
846
- const { media } = props.theme.sanity.v2;
844
+ const { media } = theme.getTheme_v2(props.theme);
847
845
  return _responsive(media, props.$columns, (columns) => ({
848
846
  gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));`
849
847
  }));
850
848
  }
851
849
  function responsiveGridRowsStyle(props) {
852
- const { media } = props.theme.sanity.v2;
850
+ const { media } = theme.getTheme_v2(props.theme);
853
851
  return _responsive(media, props.$rows, (rows) => ({
854
852
  gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));`
855
853
  }));
856
854
  }
857
855
  function responsiveGridGapStyle(props) {
858
- const { media, space } = props.theme.sanity.v2;
856
+ const { media, space } = theme.getTheme_v2(props.theme);
859
857
  return _responsive(media, props.$gap, (gap) => ({
860
858
  gridGap: gap ? rem(space[gap]) : void 0
861
859
  }));
862
860
  }
863
861
  function responsiveGridGapXStyle(props) {
864
- const { media, space } = props.theme.sanity.v2;
862
+ const { media, space } = theme.getTheme_v2(props.theme);
865
863
  return _responsive(media, props.$gapX, (gapX) => ({
866
864
  columnGap: gapX ? rem(space[gapX]) : void 0
867
865
  }));
868
866
  }
869
867
  function responsiveGridGapYStyle(props) {
870
- const { media, space } = props.theme.sanity.v2;
868
+ const { media, space } = theme.getTheme_v2(props.theme);
871
869
  return _responsive(media, props.$gapY, (gapY) => ({
872
870
  rowGap: gapY ? rem(space[gapY]) : void 0
873
871
  }));
@@ -890,37 +888,37 @@ const GRID_ITEM_ROW = {
890
888
  full: "1 / -1"
891
889
  };
892
890
  function responsiveGridItemRowStyle(props) {
893
- const { media } = props.theme.sanity.v2;
891
+ const { media } = theme.getTheme_v2(props.theme);
894
892
  return _responsive(media, props.$row, (row) => typeof row == "number" ? { gridRow: `span ${row} / span ${row}` } : { gridRow: GRID_ITEM_ROW[row] });
895
893
  }
896
894
  function responsiveGridItemRowStartStyle(props) {
897
- const { media } = props.theme.sanity.v2;
895
+ const { media } = theme.getTheme_v2(props.theme);
898
896
  return _responsive(media, props.$rowStart, (rowStart) => ({
899
897
  gridRowStart: rowStart
900
898
  }));
901
899
  }
902
900
  function responsiveGridItemRowEndStyle(props) {
903
- const { media } = props.theme.sanity.v2;
901
+ const { media } = theme.getTheme_v2(props.theme);
904
902
  return _responsive(media, props.$rowEnd, (rowEnd) => ({ gridRowEnd: rowEnd }));
905
903
  }
906
904
  function responsiveGridItemColumnStyle(props) {
907
- const { media } = props.theme.sanity.v2;
905
+ const { media } = theme.getTheme_v2(props.theme);
908
906
  return _responsive(media, props.$column, (column) => typeof column == "number" ? { gridColumn: `span ${column} / span ${column}` } : { gridColumn: GRID_ITEM_COLUMN[column] });
909
907
  }
910
908
  function responsiveGridItemColumnStartStyle(props) {
911
- const { media } = props.theme.sanity.v2;
909
+ const { media } = theme.getTheme_v2(props.theme);
912
910
  return _responsive(media, props.$columnStart, (columnStart) => ({
913
911
  gridColumnStart: columnStart
914
912
  }));
915
913
  }
916
914
  function responsiveGridItemColumnEndStyle(props) {
917
- const { media } = props.theme.sanity.v2;
915
+ const { media } = theme.getTheme_v2(props.theme);
918
916
  return _responsive(media, props.$columnEnd, (columnEnd) => ({
919
917
  gridColumnEnd: columnEnd
920
918
  }));
921
919
  }
922
920
  function responsiveInputPaddingStyle(props) {
923
- const { $fontSize, $iconLeft, $iconRight, $padding, $space } = props, { font, media, space } = props.theme.sanity.v2, len = Math.max($padding.length, $space.length, $fontSize.length), _padding = [], _space = [], _fontSize = [];
921
+ const { $fontSize, $iconLeft, $iconRight, $padding, $space } = props, { font, media, space } = theme.getTheme_v2(props.theme), len = Math.max($padding.length, $space.length, $fontSize.length), _padding = [], _space = [], _fontSize = [];
924
922
  for (let i = 0; i < len; i += 1)
925
923
  _fontSize[i] = $fontSize[i] === void 0 ? _fontSize[i - 1] : $fontSize[i], _padding[i] = $padding[i] === void 0 ? _padding[i - 1] : $padding[i], _space[i] = $space[i] === void 0 ? _space[i - 1] : $space[i];
926
924
  return _responsive(media, _padding, (_, i) => {
@@ -936,7 +934,7 @@ function responsiveInputPaddingStyle(props) {
936
934
  function responsiveInputPaddingIconRightStyle(props) {
937
935
  return responsiveInputPaddingStyle({ ...props, $iconRight: !0 });
938
936
  }
939
- const ROOT_STYLE = styled.css`
937
+ const ROOT_STYLE = styledComponents.css`
940
938
  &:not([hidden]) {
941
939
  display: flex;
942
940
  }
@@ -947,8 +945,8 @@ function textInputRootStyle() {
947
945
  return ROOT_STYLE;
948
946
  }
949
947
  function textInputBaseStyle(props) {
950
- const { $scheme, $tone, $weight } = props, { color, font } = props.theme.sanity.v2;
951
- return styled.css`
948
+ const { $scheme, $tone, $weight } = props, { color, font } = theme.getTheme_v2(props.theme);
949
+ return styledComponents.css`
952
950
  appearance: none;
953
951
  background: none;
954
952
  border: 0;
@@ -1015,7 +1013,7 @@ function textInputBaseStyle(props) {
1015
1013
  `;
1016
1014
  }
1017
1015
  function textInputFontSizeStyle(props) {
1018
- const { font, media } = props.theme.sanity.v2;
1016
+ const { font, media } = theme.getTheme_v2(props.theme);
1019
1017
  return _responsive(media, props.$fontSize, (sizeIndex) => {
1020
1018
  const size2 = font.text.sizes[sizeIndex] || font.text.sizes[2];
1021
1019
  return {
@@ -1025,8 +1023,8 @@ function textInputFontSizeStyle(props) {
1025
1023
  });
1026
1024
  }
1027
1025
  function textInputRepresentationStyle(props) {
1028
- const { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props, { color, input } = props.theme.sanity.v2;
1029
- return styled.css`
1026
+ const { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props, { color, input } = theme.getTheme_v2(props.theme);
1027
+ return styledComponents.css`
1030
1028
  --input-box-shadow: none;
1031
1029
 
1032
1030
  position: absolute;
@@ -1177,7 +1175,7 @@ function responsivePaddingStyle(props) {
1177
1175
  ].filter(Boolean);
1178
1176
  }
1179
1177
  function responsiveRadiusStyle(props) {
1180
- const { media, radius } = props.theme.sanity.v2;
1178
+ const { media, radius } = theme.getTheme_v2(props.theme);
1181
1179
  return _responsive(media, props.$radius, (value) => {
1182
1180
  let borderRadius = 0;
1183
1181
  return typeof value == "number" && (borderRadius = rem(radius[value])), value === "full" && (borderRadius = "9999px"), { borderRadius };
@@ -1193,7 +1191,7 @@ function shadowStyle(shadow, outlineWidth = 1) {
1193
1191
  return { boxShadow: `${outline}, ${umbra}, ${penumbra}, ${ambient}` };
1194
1192
  }
1195
1193
  function responsiveShadowStyle(props) {
1196
- const { card, media, shadow } = props.theme.sanity.v2;
1194
+ const { card, media, shadow } = theme.getTheme_v2(props.theme);
1197
1195
  return _responsive(
1198
1196
  media,
1199
1197
  props.$shadow,
@@ -1201,15 +1199,15 @@ function responsiveShadowStyle(props) {
1201
1199
  );
1202
1200
  }
1203
1201
  function labelBaseStyle(props) {
1204
- const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
1205
- return styled.css`
1202
+ const { $accent, $muted } = props, { font } = theme.getTheme_v2(props.theme);
1203
+ return styledComponents.css`
1206
1204
  text-transform: uppercase;
1207
1205
 
1208
- ${$accent && styled.css`
1206
+ ${$accent && styledComponents.css`
1209
1207
  color: var(--card-accent-fg-color);
1210
1208
  `}
1211
1209
 
1212
- ${$muted && styled.css`
1210
+ ${$muted && styledComponents.css`
1213
1211
  color: var(--card-muted-fg-color);
1214
1212
  `}
1215
1213
 
@@ -1234,7 +1232,7 @@ function labelBaseStyle(props) {
1234
1232
  }
1235
1233
  `;
1236
1234
  }
1237
- const Root$C = styled__default.default.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle), SpanWithTextOverflow$2 = styled__default.default.span`
1235
+ const Root$C = styledComponents.styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle), SpanWithTextOverflow$2 = styledComponents.styled.span`
1238
1236
  display: block;
1239
1237
  white-space: nowrap;
1240
1238
  text-overflow: ellipsis;
@@ -1312,7 +1310,7 @@ function avatarArrowStyle() {
1312
1310
  };
1313
1311
  }
1314
1312
  function avatarRootStyle(props) {
1315
- const { $color } = props, { avatar } = props.theme.sanity.v2;
1313
+ const { $color } = props, { avatar } = theme.getTheme_v2(props.theme);
1316
1314
  return {
1317
1315
  "--avatar-bg-color": `var(--card-avatar-${$color}-bg-color)`,
1318
1316
  "--avatar-fg-color": `var(--card-avatar-${$color}-fg-color)`,
@@ -1349,7 +1347,7 @@ function avatarRootStyle(props) {
1349
1347
  };
1350
1348
  }
1351
1349
  function responsiveAvatarSizeStyle(props) {
1352
- const { avatar, media } = props.theme.sanity.v2;
1350
+ const { avatar, media } = theme.getTheme_v2(props.theme);
1353
1351
  return _responsive(media, props.$size, (size2) => {
1354
1352
  const avatarSize = avatar.sizes[size2] || avatar.sizes[0];
1355
1353
  return {
@@ -1400,12 +1398,12 @@ function avatarStrokeStyle() {
1400
1398
  }
1401
1399
  };
1402
1400
  }
1403
- const Root$B = styled__default.default.div(
1401
+ const Root$B = styledComponents.styled.div(
1404
1402
  responsiveAvatarSizeStyle,
1405
1403
  avatarStyle.root
1406
- ), Arrow$1 = styled__default.default.div(avatarStyle.arrow), BgStroke = styled__default.default.ellipse(avatarStyle.bgStroke), Stroke = styled__default.default.ellipse(avatarStyle.stroke), Initials = styled__default.default.div(avatarStyle.initials), InitialsLabel = styled__default.default(Label)({
1404
+ ), Arrow$1 = styledComponents.styled.div(avatarStyle.arrow), BgStroke = styledComponents.styled.ellipse(avatarStyle.bgStroke), Stroke = styledComponents.styled.ellipse(avatarStyle.stroke), Initials = styledComponents.styled.div(avatarStyle.initials), InitialsLabel = styledComponents.styled(Label)({
1407
1405
  color: "inherit"
1408
- }), Image = styled__default.default.svg(avatarStyle.image), Avatar = react.forwardRef(function(props, ref) {
1406
+ }), Image = styledComponents.styled.svg(avatarStyle.image), Avatar = react.forwardRef(function(props, ref) {
1409
1407
  const {
1410
1408
  __unstable_hideInnerStroke,
1411
1409
  as: asProp,
@@ -1496,7 +1494,7 @@ const Root$B = styled__default.default.div(
1496
1494
  );
1497
1495
  });
1498
1496
  function _responsiveAvatarCounterSizeStyle(props) {
1499
- const { avatar, media } = props.theme.sanity.v2;
1497
+ const { avatar, media } = theme.getTheme_v2(props.theme);
1500
1498
  return _responsive(media, props.$size, (size2) => {
1501
1499
  const avatarSize = avatar.sizes[size2];
1502
1500
  return avatarSize ? {
@@ -1507,8 +1505,8 @@ function _responsiveAvatarCounterSizeStyle(props) {
1507
1505
  });
1508
1506
  }
1509
1507
  function _avatarCounterBaseStyle(props) {
1510
- const { space } = props.theme.sanity.v2;
1511
- return styled.css`
1508
+ const { space } = theme.getTheme_v2(props.theme);
1509
+ return styledComponents.css`
1512
1510
  align-items: center;
1513
1511
  justify-content: center;
1514
1512
  box-sizing: border-box;
@@ -1526,7 +1524,7 @@ function _avatarCounterBaseStyle(props) {
1526
1524
  }
1527
1525
  `;
1528
1526
  }
1529
- const Root$A = styled__default.default.div(
1527
+ const Root$A = styledComponents.styled.div(
1530
1528
  _responsiveAvatarCounterSizeStyle,
1531
1529
  _avatarCounterBaseStyle
1532
1530
  ), AvatarCounter = react.forwardRef(function(props, ref) {
@@ -1541,7 +1539,7 @@ function childrenToElementArray(children) {
1541
1539
  (node) => ReactIs.isElement(node) || ReactIs.isFragment(node) || typeof node == "string"
1542
1540
  );
1543
1541
  }
1544
- const BASE_STYLES = styled.css`
1542
+ const BASE_STYLES = styledComponents.css`
1545
1543
  white-space: nowrap;
1546
1544
 
1547
1545
  & > div {
@@ -1556,7 +1554,7 @@ function avatarStackStyle() {
1556
1554
  return BASE_STYLES;
1557
1555
  }
1558
1556
  function responsiveAvatarStackSizeStyle(props) {
1559
- const { avatar, media } = props.theme.sanity.v2;
1557
+ const { avatar, media } = theme.getTheme_v2(props.theme);
1560
1558
  return _responsive(media, props.$size, (size2) => {
1561
1559
  const avatarSize = avatar.sizes[size2];
1562
1560
  return avatarSize ? {
@@ -1566,7 +1564,7 @@ function responsiveAvatarStackSizeStyle(props) {
1566
1564
  } : EMPTY_RECORD;
1567
1565
  });
1568
1566
  }
1569
- const Root$z = styled__default.default.div(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = react.forwardRef(function(props, ref) {
1567
+ const Root$z = styledComponents.styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = react.forwardRef(function(props, ref) {
1570
1568
  const {
1571
1569
  children: childrenProp,
1572
1570
  maxLength: maxLengthProp = 4,
@@ -1580,7 +1578,7 @@ const Root$z = styled__default.default.div(responsiveAvatarStackSizeStyle, avata
1580
1578
  len !== 0 && extraCount > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: extraCount, size: size2 }) }),
1581
1579
  visibleChildren.map((child, childIndex) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: react.cloneElement(child, { size: size2 }) }, String(childIndex)))
1582
1580
  ] });
1583
- }), Root$y = styled__default.default.div(
1581
+ }), Root$y = styledComponents.styled.div(
1584
1582
  boxStyle,
1585
1583
  flexItemStyle,
1586
1584
  responsiveBoxStyle,
@@ -1655,15 +1653,15 @@ const Root$z = styled__default.default.div(responsiveAvatarStackSizeStyle, avata
1655
1653
  );
1656
1654
  });
1657
1655
  function textBaseStyle(props) {
1658
- const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
1659
- return styled.css`
1656
+ const { $accent, $muted } = props, { font } = theme.getTheme_v2(props.theme);
1657
+ return styledComponents.css`
1660
1658
  color: var(--card-fg-color);
1661
1659
 
1662
- ${$accent && styled.css`
1660
+ ${$accent && styledComponents.css`
1663
1661
  color: var(--card-accent-fg-color);
1664
1662
  `}
1665
1663
 
1666
- ${$muted && styled.css`
1664
+ ${$muted && styledComponents.css`
1667
1665
  color: var(--card-muted-fg-color);
1668
1666
  `}
1669
1667
 
@@ -1717,11 +1715,11 @@ function textBaseStyle(props) {
1717
1715
  }
1718
1716
  `;
1719
1717
  }
1720
- const Root$x = styled__default.default.div(
1718
+ const Root$x = styledComponents.styled.div(
1721
1719
  responsiveTextFont,
1722
1720
  responsiveTextAlignStyle,
1723
1721
  textBaseStyle
1724
- ), SpanWithTextOverflow$1 = styled__default.default.span`
1722
+ ), SpanWithTextOverflow$1 = styledComponents.styled.span`
1725
1723
  display: block;
1726
1724
  white-space: nowrap;
1727
1725
  text-overflow: ellipsis;
@@ -1767,7 +1765,7 @@ function badgeStyle(props) {
1767
1765
  }
1768
1766
  };
1769
1767
  }
1770
- const Root$w = styled__default.default(Box)(
1768
+ const Root$w = styledComponents.styled(Box)(
1771
1769
  responsiveRadiusStyle,
1772
1770
  badgeStyle
1773
1771
  ), Badge = react.forwardRef(function(props, ref) {
@@ -1793,7 +1791,7 @@ const Root$w = styled__default.default(Box)(
1793
1791
  children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, children })
1794
1792
  }
1795
1793
  );
1796
- }), Root$v = styled__default.default(Box)(
1794
+ }), Root$v = styledComponents.styled(Box)(
1797
1795
  flexItemStyle,
1798
1796
  responsiveFlexStyle
1799
1797
  ), Flex = react.forwardRef(function(props, ref) {
@@ -1812,7 +1810,7 @@ const Root$w = styled__default.default(Box)(
1812
1810
  ref
1813
1811
  }
1814
1812
  );
1815
- }), rotate$1 = styled.keyframes`
1813
+ }), rotate$1 = styledComponents.keyframes`
1816
1814
  from {
1817
1815
  transform: rotate(0deg);
1818
1816
  }
@@ -1820,7 +1818,7 @@ const Root$w = styled__default.default(Box)(
1820
1818
  to {
1821
1819
  transform: rotate(360deg);
1822
1820
  }
1823
- `, Root$u = styled__default.default(Text)`
1821
+ `, Root$u = styledComponents.styled(Text)`
1824
1822
  & > span > svg {
1825
1823
  animation: ${rotate$1} 500ms linear infinite;
1826
1824
  }
@@ -1899,8 +1897,8 @@ function _cardColorStyle(base, color, checkered = !1) {
1899
1897
  };
1900
1898
  }
1901
1899
  function buttonBaseStyles(props) {
1902
- const { $width } = props, { style } = props.theme.sanity.v2;
1903
- return styled.css`
1900
+ const { $width } = props, { style } = theme.getTheme_v2(props.theme);
1901
+ return styledComponents.css`
1904
1902
  ${style == null ? void 0 : style.button};
1905
1903
 
1906
1904
  -webkit-font-smoothing: inherit;
@@ -1921,7 +1919,7 @@ function buttonBaseStyles(props) {
1921
1919
  position: relative;
1922
1920
  vertical-align: top;
1923
1921
 
1924
- ${$width === "fill" && styled.css`
1922
+ ${$width === "fill" && styledComponents.css`
1925
1923
  width: -moz-available;
1926
1924
  width: -webkit-fill-available;
1927
1925
  width: stretch;
@@ -1945,7 +1943,7 @@ function combineBoxShadow(...boxShadows) {
1945
1943
  }
1946
1944
  function buttonColorStyles(props) {
1947
1945
  var _a;
1948
- const { $mode } = props, { button, color: baseColor, style } = props.theme.sanity.v2, shadow = props.$mode === "ghost", mode = baseColor.button[$mode] || baseColor.button.default, color = mode[props.$tone] || mode.default, border2 = {
1946
+ const { $mode } = props, { button, color: baseColor, style } = theme.getTheme_v2(props.theme), shadow = props.$mode === "ghost", mode = baseColor.button[$mode] || baseColor.button.default, color = mode[props.$tone] || mode.default, border2 = {
1949
1947
  width: button.border.width,
1950
1948
  color: "var(--card-border-color)"
1951
1949
  }, defaultBoxShadow = void 0;
@@ -1985,7 +1983,7 @@ function buttonColorStyles(props) {
1985
1983
  (_a = style == null ? void 0 : style.button) == null ? void 0 : _a.root
1986
1984
  ].filter(Boolean);
1987
1985
  }
1988
- const Root$t = styled__default.default.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles), LoadingBox = styled__default.default.div`
1986
+ const Root$t = styledComponents.styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles), LoadingBox = styledComponents.styled.div`
1989
1987
  position: absolute;
1990
1988
  top: 0;
1991
1989
  left: 0;
@@ -2084,9 +2082,9 @@ function cardStyle(props) {
2084
2082
  return [cardBaseStyle(props), cardColorStyle(props)];
2085
2083
  }
2086
2084
  function cardBaseStyle(props) {
2087
- const { $checkered } = props, { space } = props.theme.sanity.v2;
2088
- return styled.css`
2089
- ${$checkered && styled.css`
2085
+ const { $checkered } = props, { space } = theme.getTheme_v2(props.theme);
2086
+ return styledComponents.css`
2087
+ ${$checkered && styledComponents.css`
2090
2088
  background-size: ${space[3]}px ${space[3]}px;
2091
2089
  background-position: 50% 50%;
2092
2090
  background-image: var(--card-bg-image);
@@ -2118,8 +2116,8 @@ function cardBaseStyle(props) {
2118
2116
  }
2119
2117
  function cardColorStyle(props) {
2120
2118
  var _a;
2121
- const { $checkered, $focusRing } = props, { card, color, style } = props.theme.sanity.v2, border2 = { width: card.border.width, color: "var(--card-border-color)" };
2122
- return styled.css`
2119
+ const { $checkered, $focusRing } = props, { card, color, style } = theme.getTheme_v2(props.theme), border2 = { width: card.border.width, color: "var(--card-border-color)" };
2120
+ return styledComponents.css`
2123
2121
  color-scheme: ${color._dark ? "dark" : "light"};
2124
2122
 
2125
2123
  ${_cardColorStyle(color, color, $checkered)}
@@ -2206,7 +2204,7 @@ function cardColorStyle(props) {
2206
2204
  ${(_a = style == null ? void 0 : style.card) == null ? void 0 : _a.root}
2207
2205
  `;
2208
2206
  }
2209
- const Root$s = styled__default.default(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle), Card = react.forwardRef(function(props, ref) {
2207
+ const Root$s = styledComponents.styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle), Card = react.forwardRef(function(props, ref) {
2210
2208
  const {
2211
2209
  __unstable_checkered: checkered = !1,
2212
2210
  __unstable_focusRing: focusRing = !1,
@@ -2252,14 +2250,14 @@ const Root$s = styled__default.default(Box)(responsiveBorderStyle, responsiveRad
2252
2250
  ) });
2253
2251
  });
2254
2252
  function checkboxBaseStyles() {
2255
- return styled.css`
2253
+ return styledComponents.css`
2256
2254
  position: relative;
2257
2255
  display: inline-block;
2258
2256
  `;
2259
2257
  }
2260
2258
  function inputElementStyles(props) {
2261
- const { color, input, radius } = props.theme.sanity.v2, { focusRing } = input.checkbox;
2262
- return styled.css`
2259
+ const { color, input, radius } = theme.getTheme_v2(props.theme), { focusRing } = input.checkbox;
2260
+ return styledComponents.css`
2263
2261
  position: absolute;
2264
2262
  top: 0;
2265
2263
  left: 0;
@@ -2370,7 +2368,7 @@ function inputElementStyles(props) {
2370
2368
  }
2371
2369
  `;
2372
2370
  }
2373
- const Root$r = styled__default.default.div(checkboxBaseStyles), Input$5 = styled__default.default.input(inputElementStyles), Checkbox = react.forwardRef(function(props, forwardedRef) {
2371
+ const Root$r = styledComponents.styled.div(checkboxBaseStyles), Input$5 = styledComponents.styled.input(inputElementStyles), Checkbox = react.forwardRef(function(props, forwardedRef) {
2374
2372
  const {
2375
2373
  checked,
2376
2374
  className,
@@ -2403,8 +2401,10 @@ const Root$r = styled__default.default.div(checkboxBaseStyles), Input$5 = styled
2403
2401
  ] })
2404
2402
  ] });
2405
2403
  });
2406
- function codeSyntaxHighlightingStyle({ theme: theme2 }) {
2407
- const color = theme2.sanity.v2.color.syntax;
2404
+ function codeSyntaxHighlightingStyle({ theme: theme$1 }) {
2405
+ const {
2406
+ color: { syntax: color }
2407
+ } = theme.getTheme_v2(theme$1);
2408
2408
  return {
2409
2409
  "&.atrule": { color: color.atrule },
2410
2410
  "&.attr-name": { color: color.attrName },
@@ -2445,7 +2445,7 @@ function codeSyntaxHighlightingStyle({ theme: theme2 }) {
2445
2445
  };
2446
2446
  }
2447
2447
  function codeBaseStyle() {
2448
- return styled.css`
2448
+ return styledComponents.css`
2449
2449
  color: var(--card-code-fg-color);
2450
2450
 
2451
2451
  & code {
@@ -2473,7 +2473,7 @@ function codeBaseStyle() {
2473
2473
  }
2474
2474
  `;
2475
2475
  }
2476
- const Root$q = styled__default.default.pre(codeBaseStyle, responsiveCodeFontStyle), Code = react.forwardRef(function(props, ref) {
2476
+ const Root$q = styledComponents.styled.pre(codeBaseStyle, responsiveCodeFontStyle), Code = react.forwardRef(function(props, ref) {
2477
2477
  const { children, language: languageProp, size: size2 = 2, weight, ...restProps } = props, language = typeof languageProp == "string" ? languageProp : void 0, registered = language ? Refractor__default.default.hasLanguage(language) : !1;
2478
2478
  return /* @__PURE__ */ jsxRuntime.jsxs(Root$q, { "data-ui": "Code", ...restProps, $size: useArrayProp(size2), $weight: weight, ref, children: [
2479
2479
  !(language && registered) && /* @__PURE__ */ jsxRuntime.jsx("code", { children }),
@@ -2487,12 +2487,12 @@ function containerBaseStyle() {
2487
2487
  return BASE_STYLE$1;
2488
2488
  }
2489
2489
  function responsiveContainerWidthStyle(props) {
2490
- const { container, media } = props.theme.sanity.v2;
2490
+ const { container, media } = theme.getTheme_v2(props.theme);
2491
2491
  return _responsive(media, props.$width, (val) => ({
2492
2492
  maxWidth: val === "auto" ? "none" : rem(container[val])
2493
2493
  }));
2494
2494
  }
2495
- const Root$p = styled__default.default(Box)(
2495
+ const Root$p = styledComponents.styled(Box)(
2496
2496
  containerBaseStyle,
2497
2497
  responsiveContainerWidthStyle
2498
2498
  ), Container = react.forwardRef(function(props, ref) {
@@ -2507,7 +2507,7 @@ const Root$p = styled__default.default(Box)(
2507
2507
  ref
2508
2508
  }
2509
2509
  );
2510
- }), Root$o = styled__default.default(Box)(responsiveGridStyle), Grid = react.forwardRef(function(props, ref) {
2510
+ }), Root$o = styledComponents.styled(Box)(responsiveGridStyle), Grid = react.forwardRef(function(props, ref) {
2511
2511
  const { as, autoRows, autoCols, autoFlow, columns, gap, gapX, gapY, rows, children, ...restProps } = props;
2512
2512
  return /* @__PURE__ */ jsxRuntime.jsx(
2513
2513
  Root$o,
@@ -2530,13 +2530,13 @@ const Root$p = styled__default.default(Box)(
2530
2530
  );
2531
2531
  });
2532
2532
  function headingBaseStyle(props) {
2533
- const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
2534
- return styled.css`
2535
- ${$accent && styled.css`
2533
+ const { $accent, $muted } = props, { font } = theme.getTheme_v2(props.theme);
2534
+ return styledComponents.css`
2535
+ ${$accent && styledComponents.css`
2536
2536
  color: var(--card-accent-fg-color);
2537
2537
  `}
2538
2538
 
2539
- ${$muted && styled.css`
2539
+ ${$muted && styledComponents.css`
2540
2540
  color: var(--card-muted-fg-color);
2541
2541
  `}
2542
2542
 
@@ -2583,7 +2583,7 @@ function headingBaseStyle(props) {
2583
2583
  }
2584
2584
  `;
2585
2585
  }
2586
- const Root$n = styled__default.default.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont), SpanWithTextOverflow = styled__default.default.span`
2586
+ const Root$n = styledComponents.styled.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont), SpanWithTextOverflow = styledComponents.styled.span`
2587
2587
  display: block;
2588
2588
  white-space: nowrap;
2589
2589
  text-overflow: ellipsis;
@@ -2629,7 +2629,7 @@ function inlineBaseStyle() {
2629
2629
  };
2630
2630
  }
2631
2631
  function inlineSpaceStyle(props) {
2632
- const { media, space } = props.theme.sanity.v2;
2632
+ const { media, space } = theme.getTheme_v2(props.theme);
2633
2633
  return _responsive(media, props.$space, (spaceIndex) => {
2634
2634
  const _space = rem(spaceIndex === 0.5 ? space[1] / 2 : space[spaceIndex]);
2635
2635
  return {
@@ -2638,7 +2638,7 @@ function inlineSpaceStyle(props) {
2638
2638
  };
2639
2639
  });
2640
2640
  }
2641
- const Root$m = styled__default.default(Box)(inlineBaseStyle, inlineSpaceStyle), Inline = react.forwardRef(function(props, ref) {
2641
+ const Root$m = styledComponents.styled(Box)(inlineBaseStyle, inlineSpaceStyle), Inline = react.forwardRef(function(props, ref) {
2642
2642
  const { as, children: childrenProp, space, ...restProps } = props, children = react.useMemo(
2643
2643
  () => childrenToElementArray(childrenProp).filter(Boolean).map((child, idx) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: child }, idx)),
2644
2644
  [childrenProp]
@@ -2656,7 +2656,7 @@ const Root$m = styled__default.default(Box)(inlineBaseStyle, inlineSpaceStyle),
2656
2656
  );
2657
2657
  });
2658
2658
  function kbdStyle() {
2659
- return styled.css`
2659
+ return styledComponents.css`
2660
2660
  --card-bg-color: var(--card-kbd-bg-color);
2661
2661
  --card-border-color: var(--card-kbd-border-color);
2662
2662
  --card-fg-color: var(--card-kbd-fg-color);
@@ -2672,7 +2672,7 @@ function kbdStyle() {
2672
2672
  }
2673
2673
  `;
2674
2674
  }
2675
- const Root$l = styled__default.default.kbd(responsiveRadiusStyle, kbdStyle), KBD = react.forwardRef(function(props, ref) {
2675
+ const Root$l = styledComponents.styled.kbd(responsiveRadiusStyle, kbdStyle), KBD = react.forwardRef(function(props, ref) {
2676
2676
  const { children, fontSize: fontSize2 = 0, padding = 1, radius = 2, ...restProps } = props;
2677
2677
  return /* @__PURE__ */ jsxRuntime.jsx(Root$l, { "data-ui": "KBD", ...restProps, $radius: useArrayProp(radius), ref, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", padding, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { as: "span", size: fontSize2, weight: "semibold", children }) }) });
2678
2678
  }), origin = {
@@ -2733,8 +2733,8 @@ function getRoundedCommands(points) {
2733
2733
  function compileCommands(cmds) {
2734
2734
  return cmds.map((n, idx) => n.type === "point" ? `${idx === 0 ? "M" : "L"} ${n.x} ${n.y}` : n.type === "curve" ? `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}` : "").join(" ");
2735
2735
  }
2736
- const Root$k = styled__default.default.div(
2737
- ({ $w: w }) => styled.css`
2736
+ const Root$k = styledComponents.styled.div(
2737
+ ({ $w: w }) => styledComponents.css`
2738
2738
  position: absolute;
2739
2739
  width: ${w}px;
2740
2740
  height: ${w}px;
@@ -2781,9 +2781,9 @@ const Root$k = styled__default.default.div(
2781
2781
  }
2782
2782
  }
2783
2783
  `
2784
- ), StrokePath = styled__default.default.path`
2784
+ ), StrokePath = styledComponents.styled.path`
2785
2785
  stroke: var(--card-shadow-outline-color);
2786
- `, ShapePath = styled__default.default.path`
2786
+ `, ShapePath = styledComponents.styled.path`
2787
2787
  fill: var(--card-bg-color);
2788
2788
  `, Arrow = react.forwardRef(function(props, ref) {
2789
2789
  const { width: w, height: h, radius = 0, ...restProps } = props, { card } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2, points = [
@@ -3027,7 +3027,7 @@ function LayerProvider(props) {
3027
3027
  );
3028
3028
  return /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children });
3029
3029
  }
3030
- const Root$j = styled__default.default.div({ position: "relative" }), LayerChildren = react.forwardRef(function(props, ref) {
3030
+ const Root$j = styledComponents.styled.div({ position: "relative" }), LayerChildren = react.forwardRef(function(props, ref) {
3031
3031
  const { children, onActivate, onFocus, style = EMPTY_RECORD, ...restProps } = props, { zIndex, isTopLayer } = useLayer(), lastFocusedRef = react.useRef(null), forwardedRef = useForwardedRef(ref), isTopLayerRef = react.useRef(isTopLayer);
3032
3032
  react.useEffect(() => {
3033
3033
  isTopLayerRef.current !== isTopLayer && isTopLayer && (onActivate == null || onActivate({ activeElement: lastFocusedRef.current })), isTopLayerRef.current = isTopLayer;
@@ -3098,7 +3098,7 @@ function PortalProvider(props) {
3098
3098
  }), [boundaryElement, element, elements]);
3099
3099
  return /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value, children });
3100
3100
  }
3101
- const Root$i = styled__default.default.div`
3101
+ const Root$i = styledComponents.styled.div`
3102
3102
  display: block;
3103
3103
  width: 0;
3104
3104
  height: 0;
@@ -3108,9 +3108,9 @@ const Root$i = styled__default.default.div`
3108
3108
  `, SrOnly = react.forwardRef(function(props, ref) {
3109
3109
  const { as, children } = props;
3110
3110
  return /* @__PURE__ */ jsxRuntime.jsx(Root$i, { "aria-hidden": !0, as, "data-ui": "SrOnly", ref, children });
3111
- }), Root$h = styled__default.default.div`
3111
+ }), Root$h = styledComponents.styled.div`
3112
3112
  position: relative;
3113
- `, ItemWrapper = styled__default.default.div`
3113
+ `, ItemWrapper = styledComponents.styled.div`
3114
3114
  position: absolute;
3115
3115
  left: 0;
3116
3116
  right: 0;
@@ -3211,7 +3211,7 @@ function calcMaxWidth(params) {
3211
3211
  (boundaryWidth || 1 / 0) - DEFAULT_POPOVER_PADDING * 2
3212
3212
  );
3213
3213
  }
3214
- const MotionCard$1 = styled__default.default(framerMotion.motion(Card))`
3214
+ const MotionCard$1 = styledComponents.styled(framerMotion.motion(Card))`
3215
3215
  &:not([hidden]) {
3216
3216
  display: flex;
3217
3217
  }
@@ -3485,7 +3485,7 @@ const Popover = react.memo(
3485
3485
  );
3486
3486
  Popover.displayName = "Popover";
3487
3487
  function radioBaseStyle() {
3488
- return styled.css`
3488
+ return styledComponents.css`
3489
3489
  position: relative;
3490
3490
 
3491
3491
  &:not([hidden]) {
@@ -3498,8 +3498,8 @@ function radioBaseStyle() {
3498
3498
  `;
3499
3499
  }
3500
3500
  function inputElementStyle(props) {
3501
- const { color, input } = props.theme.sanity.v2, dist = (input.radio.size - input.radio.markSize) / 2;
3502
- return styled.css`
3501
+ const { color, input } = theme.getTheme_v2(props.theme), dist = (input.radio.size - input.radio.markSize) / 2;
3502
+ return styledComponents.css`
3503
3503
  appearance: none;
3504
3504
  position: absolute;
3505
3505
  top: 0;
@@ -3592,7 +3592,7 @@ function inputElementStyle(props) {
3592
3592
  }
3593
3593
  `;
3594
3594
  }
3595
- const Root$g = styled__default.default.div(radioBaseStyle), Input$4 = styled__default.default.input(inputElementStyle), Radio = react.forwardRef(function(props, forwardedRef) {
3595
+ const Root$g = styledComponents.styled.div(radioBaseStyle), Input$4 = styledComponents.styled.input(inputElementStyle), Radio = react.forwardRef(function(props, forwardedRef) {
3596
3596
  const { className, disabled, style, customValidity, readOnly, ...restProps } = props, ref = useForwardedRef(forwardedRef);
3597
3597
  return useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsxs(Root$g, { className, "data-ui": "Radio", style, children: [
3598
3598
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3611,7 +3611,7 @@ const Root$g = styled__default.default.div(radioBaseStyle), Input$4 = styled__de
3611
3611
  ] });
3612
3612
  });
3613
3613
  function rootStyle() {
3614
- return styled.css`
3614
+ return styledComponents.css`
3615
3615
  position: relative;
3616
3616
  width: -moz-available;
3617
3617
  width: -webkit-fill-available;
@@ -3623,8 +3623,8 @@ function rootStyle() {
3623
3623
  `;
3624
3624
  }
3625
3625
  function inputBaseStyle(props) {
3626
- const { font } = props.theme.sanity.v2;
3627
- return styled.css`
3626
+ const { font } = theme.getTheme_v2(props.theme);
3627
+ return styledComponents.css`
3628
3628
  -webkit-font-smoothing: antialiased;
3629
3629
  appearance: none;
3630
3630
  border: 0;
@@ -3640,8 +3640,8 @@ function inputBaseStyle(props) {
3640
3640
  `;
3641
3641
  }
3642
3642
  function inputColorStyle(props) {
3643
- const { color, input } = props.theme.sanity.v2;
3644
- return styled.css`
3643
+ const { color, input } = theme.getTheme_v2(props.theme);
3644
+ return styledComponents.css`
3645
3645
  /* enabled */
3646
3646
  background-color: ${color.input.default.enabled.bg};
3647
3647
  color: ${color.input.default.enabled.fg};
@@ -3695,7 +3695,7 @@ function textSize(size2) {
3695
3695
  return { fontSize: rem(size2.fontSize), lineHeight: rem(size2.lineHeight) };
3696
3696
  }
3697
3697
  function inputTextSizeStyle(props) {
3698
- const { $fontSize } = props, { font, media } = props.theme.sanity.v2;
3698
+ const { $fontSize } = props, { font, media } = theme.getTheme_v2(props.theme);
3699
3699
  return _responsive(
3700
3700
  media,
3701
3701
  $fontSize,
@@ -3712,8 +3712,8 @@ function inputStyle() {
3712
3712
  ];
3713
3713
  }
3714
3714
  function iconBoxStyle(props) {
3715
- const { color } = props.theme.sanity.v2;
3716
- return styled.css`
3715
+ const { color } = theme.getTheme_v2(props.theme);
3716
+ return styledComponents.css`
3717
3717
  pointer-events: none;
3718
3718
  position: absolute;
3719
3719
  top: 0;
@@ -3744,7 +3744,7 @@ const selectStyle = {
3744
3744
  root: rootStyle,
3745
3745
  input: inputStyle,
3746
3746
  iconBox: iconBoxStyle
3747
- }, Root$f = styled__default.default.div(selectStyle.root), Input$3 = styled__default.default.select(selectStyle.input), IconBox = styled__default.default(Box)(selectStyle.iconBox), Select = react.forwardRef(function(props, forwardedRef) {
3747
+ }, Root$f = styledComponents.styled.div(selectStyle.root), Input$3 = styledComponents.styled.select(selectStyle.input), IconBox = styledComponents.styled(Box)(selectStyle.iconBox), Select = react.forwardRef(function(props, forwardedRef) {
3748
3748
  const {
3749
3749
  children,
3750
3750
  customValidity,
@@ -3788,12 +3788,12 @@ function stackBaseStyle() {
3788
3788
  return BASE_STYLE;
3789
3789
  }
3790
3790
  function responsiveStackSpaceStyle(props) {
3791
- const { media, space } = props.theme.sanity.v2;
3791
+ const { media, space } = theme.getTheme_v2(props.theme);
3792
3792
  return _responsive(media, props.$space, (spaceIndex) => ({
3793
3793
  gridGap: rem(space[spaceIndex])
3794
3794
  }));
3795
3795
  }
3796
- const Root$e = styled__default.default(Box)(stackBaseStyle, responsiveStackSpaceStyle), Stack = react.forwardRef(function(props, ref) {
3796
+ const Root$e = styledComponents.styled(Box)(stackBaseStyle, responsiveStackSpaceStyle), Stack = react.forwardRef(function(props, ref) {
3797
3797
  const { as, space, ...restProps } = props;
3798
3798
  return /* @__PURE__ */ jsxRuntime.jsx(
3799
3799
  Root$e,
@@ -3808,7 +3808,7 @@ const Root$e = styled__default.default(Box)(stackBaseStyle, responsiveStackSpace
3808
3808
  );
3809
3809
  });
3810
3810
  function switchBaseStyles() {
3811
- return styled.css`
3811
+ return styledComponents.css`
3812
3812
  position: relative;
3813
3813
  &:not([hidden]) {
3814
3814
  display: inline-block;
@@ -3816,7 +3816,7 @@ function switchBaseStyles() {
3816
3816
  `;
3817
3817
  }
3818
3818
  function switchInputStyles() {
3819
- return styled.css`
3819
+ return styledComponents.css`
3820
3820
  position: absolute;
3821
3821
  top: 0;
3822
3822
  right: 0;
@@ -3834,8 +3834,8 @@ function switchInputStyles() {
3834
3834
  `;
3835
3835
  }
3836
3836
  function switchRepresentationStyles(props) {
3837
- const { color, input } = props.theme.sanity.v2;
3838
- return styled.css`
3837
+ const { color, input } = theme.getTheme_v2(props.theme);
3838
+ return styledComponents.css`
3839
3839
  --switch-bg-color: ${color.input.default.enabled.border};
3840
3840
  --switch-fg-color: ${color.input.default.enabled.bg};
3841
3841
  --switch-box-shadow: none;
@@ -3907,8 +3907,8 @@ function switchRepresentationStyles(props) {
3907
3907
  `;
3908
3908
  }
3909
3909
  function switchTrackStyles(props) {
3910
- const { input } = props.theme.sanity.v2;
3911
- return styled.css`
3910
+ const { input } = theme.getTheme_v2(props.theme);
3911
+ return styledComponents.css`
3912
3912
  &:not([hidden]) {
3913
3913
  display: block;
3914
3914
  }
@@ -3922,8 +3922,8 @@ function switchTrackStyles(props) {
3922
3922
  `;
3923
3923
  }
3924
3924
  function switchThumbStyles(props) {
3925
- const { $indeterminate } = props, { input } = props.theme.sanity.v2, trackWidth = input.switch.width, trackHeight = input.switch.height, trackPadding = input.switch.padding, size2 = trackHeight - input.switch.padding * 2, checkedOffset = trackWidth - trackPadding * 2 - size2, indeterminateOffset = trackWidth / 2 - size2 / 2 - trackPadding, checked = $indeterminate !== !0 && props.$checked === !0;
3926
- return styled.css`
3925
+ const { $indeterminate } = props, { input } = theme.getTheme_v2(props.theme), trackWidth = input.switch.width, trackHeight = input.switch.height, trackPadding = input.switch.padding, size2 = trackHeight - input.switch.padding * 2, checkedOffset = trackWidth - trackPadding * 2 - size2, indeterminateOffset = trackWidth / 2 - size2 / 2 - trackPadding, checked = $indeterminate !== !0 && props.$checked === !0;
3926
+ return styledComponents.css`
3927
3927
  &:not([hidden]) {
3928
3928
  display: block;
3929
3929
  }
@@ -3940,16 +3940,16 @@ function switchThumbStyles(props) {
3940
3940
  transform: translate3d(0, 0, 0);
3941
3941
  box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);
3942
3942
 
3943
- ${checked && styled.css`
3943
+ ${checked && styledComponents.css`
3944
3944
  transform: translate3d(${checkedOffset}px, 0, 0);
3945
3945
  `}
3946
3946
 
3947
- ${$indeterminate && styled.css`
3947
+ ${$indeterminate && styledComponents.css`
3948
3948
  transform: translate3d(${indeterminateOffset}px, 0, 0);
3949
3949
  `}
3950
3950
  `;
3951
3951
  }
3952
- const Root$d = styled__default.default.span(switchBaseStyles), Input$2 = styled__default.default.input(switchInputStyles), Representation = styled__default.default.span(switchRepresentationStyles), Track = styled__default.default.span(switchTrackStyles), Thumb = styled__default.default.span(switchThumbStyles), Switch = react.forwardRef(function(props, forwardedRef) {
3952
+ const Root$d = styledComponents.styled.span(switchBaseStyles), Input$2 = styledComponents.styled.input(switchInputStyles), Representation = styledComponents.styled.span(switchRepresentationStyles), Track = styledComponents.styled.span(switchTrackStyles), Thumb = styledComponents.styled.span(switchThumbStyles), Switch = react.forwardRef(function(props, forwardedRef) {
3953
3953
  const { checked, className, disabled, indeterminate, readOnly, style, ...restProps } = props, ref = useForwardedRef(forwardedRef);
3954
3954
  return react.useEffect(() => {
3955
3955
  ref.current && (ref.current.indeterminate = indeterminate || !1);
@@ -3970,16 +3970,16 @@ const Root$d = styled__default.default.span(switchBaseStyles), Input$2 = styled_
3970
3970
  /* @__PURE__ */ jsxRuntime.jsx(Thumb, { $checked: checked, $indeterminate: indeterminate })
3971
3971
  ] })
3972
3972
  ] });
3973
- }), Root$c = styled__default.default.span(textInputRootStyle), InputRoot$1 = styled__default.default.span`
3973
+ }), Root$c = styledComponents.styled.span(textInputRootStyle), InputRoot$1 = styledComponents.styled.span`
3974
3974
  flex: 1;
3975
3975
  min-width: 0;
3976
3976
  display: block;
3977
3977
  position: relative;
3978
- `, Input$1 = styled__default.default.textarea(
3978
+ `, Input$1 = styledComponents.styled.textarea(
3979
3979
  responsiveInputPaddingStyle,
3980
3980
  textInputBaseStyle,
3981
3981
  textInputFontSizeStyle
3982
- ), Presentation$1 = styled__default.default.div(
3982
+ ), Presentation$1 = styledComponents.styled.div(
3983
3983
  responsiveRadiusStyle,
3984
3984
  textInputRepresentationStyle
3985
3985
  ), TextArea = react.forwardRef(function(props, forwardedRef) {
@@ -4023,12 +4023,12 @@ const Root$d = styled__default.default.span(switchBaseStyles), Input$2 = styled_
4023
4023
  }
4024
4024
  )
4025
4025
  ] }) });
4026
- }), CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, Root$b = styled__default.default(Card).attrs({ forwardedAs: "span" })(textInputRootStyle), InputRoot = styled__default.default.span`
4026
+ }), CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, Root$b = styledComponents.styled(Card).attrs({ forwardedAs: "span" })(textInputRootStyle), InputRoot = styledComponents.styled.span`
4027
4027
  flex: 1;
4028
4028
  min-width: 0;
4029
4029
  display: block;
4030
4030
  position: relative;
4031
- `, Prefix = styled__default.default(Card).attrs({ forwardedAs: "span" })`
4031
+ `, Prefix = styledComponents.styled(Card).attrs({ forwardedAs: "span" })`
4032
4032
  border-top-right-radius: 0;
4033
4033
  border-bottom-right-radius: 0;
4034
4034
 
@@ -4036,7 +4036,7 @@ const Root$d = styled__default.default.span(switchBaseStyles), Input$2 = styled_
4036
4036
  display: block;
4037
4037
  margin: -1px;
4038
4038
  }
4039
- `, Suffix = styled__default.default(Card).attrs({ forwardedAs: "span" })`
4039
+ `, Suffix = styledComponents.styled(Card).attrs({ forwardedAs: "span" })`
4040
4040
  border-top-left-radius: 0;
4041
4041
  border-bottom-left-radius: 0;
4042
4042
 
@@ -4044,27 +4044,27 @@ const Root$d = styled__default.default.span(switchBaseStyles), Input$2 = styled_
4044
4044
  display: block;
4045
4045
  margin: -1px;
4046
4046
  }
4047
- `, Input = styled__default.default.input(
4047
+ `, Input = styledComponents.styled.input(
4048
4048
  responsiveInputPaddingStyle,
4049
4049
  textInputBaseStyle,
4050
4050
  textInputFontSizeStyle
4051
- ), Presentation = styled__default.default.span(
4051
+ ), Presentation = styledComponents.styled.span(
4052
4052
  responsiveRadiusStyle,
4053
4053
  textInputRepresentationStyle
4054
- ), LeftBox = styled__default.default(Box)`
4054
+ ), LeftBox = styledComponents.styled(Box)`
4055
4055
  position: absolute;
4056
4056
  top: 0;
4057
4057
  left: 0;
4058
- `, RightBox = styled__default.default(Box)`
4058
+ `, RightBox = styledComponents.styled(Box)`
4059
4059
  position: absolute;
4060
4060
  top: 0;
4061
4061
  right: 0;
4062
- `, RightCard = styled__default.default(Card)`
4062
+ `, RightCard = styledComponents.styled(Card)`
4063
4063
  background-color: transparent;
4064
4064
  position: absolute;
4065
4065
  top: 0;
4066
4066
  right: 0;
4067
- `, TextInputClearButton = styled__default.default(Button)({
4067
+ `, TextInputClearButton = styledComponents.styled(Button)({
4068
4068
  "&:not([hidden])": {
4069
4069
  display: "block"
4070
4070
  }
@@ -4244,7 +4244,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
4244
4244
  right: ["right-end", "right-start", "left", "top", "bottom"],
4245
4245
  "right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
4246
4246
  "right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
4247
- }, MotionCard = styled__default.default(framerMotion.motion(Card))`
4247
+ }, MotionCard = styledComponents.styled(framerMotion.motion(Card))`
4248
4248
  & > * {
4249
4249
  opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
4250
4250
  will-change: opacity;
@@ -4336,7 +4336,7 @@ function TooltipDelayGroupProvider(props) {
4336
4336
  );
4337
4337
  return /* @__PURE__ */ jsxRuntime.jsx(TooltipDelayGroupContext.Provider, { value, children });
4338
4338
  }
4339
- const Root$a = styled__default.default(Layer)`
4339
+ const Root$a = styledComponents.styled(Layer)`
4340
4340
  pointer-events: none;
4341
4341
  max-width: ${({ $maxWidth }) => $maxWidth}px;
4342
4342
  `, Tooltip = react.forwardRef(function(props, ref) {
@@ -4544,15 +4544,15 @@ const Root$a = styled__default.default(Layer)`
4544
4544
  ),
4545
4545
  child
4546
4546
  ] });
4547
- }), Root$9 = styled__default.default.div`
4547
+ }), Root$9 = styledComponents.styled.div`
4548
4548
  line-height: 0;
4549
- `, ListBox = styled__default.default(Box)`
4549
+ `, ListBox = styledComponents.styled(Box)`
4550
4550
  & > ul {
4551
4551
  list-style: none;
4552
4552
  padding: 0;
4553
4553
  margin: 0;
4554
4554
  }
4555
- `, rotate = styled.keyframes`
4555
+ `, rotate = styledComponents.keyframes`
4556
4556
  from {
4557
4557
  transform: rotate(0deg);
4558
4558
  }
@@ -4560,7 +4560,7 @@ const Root$a = styled__default.default(Layer)`
4560
4560
  to {
4561
4561
  transform: rotate(360deg);
4562
4562
  }
4563
- `, AnimatedSpinnerIcon = styled__default.default(icons.SpinnerIcon)`
4563
+ `, AnimatedSpinnerIcon = styledComponents.styled(icons.SpinnerIcon)`
4564
4564
  animation: ${rotate} 500ms linear infinite;
4565
4565
  `;
4566
4566
  function AutocompleteOption(props) {
@@ -4943,7 +4943,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
4943
4943
  ]
4944
4944
  }
4945
4945
  );
4946
- }), Autocomplete = InnerAutocomplete, Root$8 = styled__default.default.ol`
4946
+ }), Autocomplete = InnerAutocomplete, Root$8 = styledComponents.styled.ol`
4947
4947
  margin: 0;
4948
4948
  padding: 0;
4949
4949
  display: flex;
@@ -4951,7 +4951,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
4951
4951
  align-items: center;
4952
4952
  white-space: nowrap;
4953
4953
  line-height: 0;
4954
- `, ExpandButton = styled__default.default(Button)`
4954
+ `, ExpandButton = styledComponents.styled(Button)`
4955
4955
  appearance: none;
4956
4956
  margin: -4px;
4957
4957
  `, Breadcrumbs = react.forwardRef(function(props, ref) {
@@ -5000,8 +5000,8 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
5000
5000
  /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "li", children: item })
5001
5001
  ] }, itemIndex)) });
5002
5002
  });
5003
- function dialogStyle({ theme: theme2 }) {
5004
- const { color } = theme2.sanity.v2;
5003
+ function dialogStyle({ theme: theme$1 }) {
5004
+ const { color } = theme.getTheme_v2(theme$1);
5005
5005
  return {
5006
5006
  "&:not([hidden])": {
5007
5007
  display: "flex"
@@ -5017,11 +5017,11 @@ function dialogStyle({ theme: theme2 }) {
5017
5017
  };
5018
5018
  }
5019
5019
  function responsiveDialogPositionStyle(props) {
5020
- const { media } = props.theme.sanity.v2;
5020
+ const { media } = theme.getTheme_v2(props.theme);
5021
5021
  return _responsive(media, props.$position, (position) => ({ "&&": { position } }));
5022
5022
  }
5023
5023
  function animationDialogStyle(props) {
5024
- return props.$animate ? styled.css`
5024
+ return props.$animate ? styledComponents.css`
5025
5025
  @keyframes zoomIn {
5026
5026
  from {
5027
5027
  opacity: 0;
@@ -5046,7 +5046,7 @@ function animationDialogStyle(props) {
5046
5046
  & > [data-ui='DialogCard'] {
5047
5047
  animation: zoomIn 200ms ease-out;
5048
5048
  }
5049
- ` : styled.css``;
5049
+ ` : styledComponents.css``;
5050
5050
  }
5051
5051
  const key$3 = Symbol.for("@sanity/ui/context/dialog");
5052
5052
  globalScope[key$3] = globalScope[key$3] || react.createContext({ version: 0 });
@@ -5057,7 +5057,7 @@ function useDialog() {
5057
5057
  function isTargetWithinScope(boundaryElement, portalElement, target) {
5058
5058
  return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
5059
5059
  }
5060
- const Root$7 = styled__default.default(Layer)(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle, animationDialogStyle), DialogContainer = styled__default.default(Container)`
5060
+ const Root$7 = styledComponents.styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle, animationDialogStyle), DialogContainer = styledComponents.styled(Container)`
5061
5061
  &:not([hidden]) {
5062
5062
  display: flex;
5063
5063
  }
@@ -5066,7 +5066,7 @@ const Root$7 = styled__default.default(Layer)(responsivePaddingStyle, dialogStyl
5066
5066
  flex-direction: column;
5067
5067
  align-items: center;
5068
5068
  justify-content: center;
5069
- `, DialogCardRoot = styled__default.default(Card)`
5069
+ `, DialogCardRoot = styledComponents.styled(Card)`
5070
5070
  &:not([hidden]) {
5071
5071
  display: flex;
5072
5072
  }
@@ -5075,19 +5075,19 @@ const Root$7 = styled__default.default(Layer)(responsivePaddingStyle, dialogStyl
5075
5075
  max-height: 100%;
5076
5076
  overflow: hidden;
5077
5077
  overflow: clip;
5078
- `, DialogLayout = styled__default.default(Flex)`
5078
+ `, DialogLayout = styledComponents.styled(Flex)`
5079
5079
  flex: 1;
5080
5080
  min-height: 0;
5081
5081
  width: 100%;
5082
- `, DialogHeader = styled__default.default(Box)`
5082
+ `, DialogHeader = styledComponents.styled(Box)`
5083
5083
  position: relative;
5084
5084
  z-index: 2;
5085
- `, DialogContent = styled__default.default(Box)`
5085
+ `, DialogContent = styledComponents.styled(Box)`
5086
5086
  position: relative;
5087
5087
  z-index: 1;
5088
5088
  overflow: auto;
5089
5089
  outline: none;
5090
- `, DialogFooter = styled__default.default(Box)`
5090
+ `, DialogFooter = styledComponents.styled(Box)`
5091
5091
  position: relative;
5092
5092
  z-index: 3;
5093
5093
  `, DialogCard = react.forwardRef(function(props, ref) {
@@ -5269,14 +5269,14 @@ function DialogProvider(props) {
5269
5269
  );
5270
5270
  return /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: contextValue, children });
5271
5271
  }
5272
- const Root$6 = styled__default.default.kbd`
5272
+ const Root$6 = styledComponents.styled.kbd`
5273
5273
  font: inherit;
5274
5274
  padding: 1px;
5275
5275
 
5276
5276
  &:not([hidden]) {
5277
5277
  display: block;
5278
5278
  }
5279
- `, Key = styled__default.default(KBD)`
5279
+ `, Key = styledComponents.styled(KBD)`
5280
5280
  &:not([hidden]) {
5281
5281
  display: block;
5282
5282
  }
@@ -5441,7 +5441,7 @@ function useMenuController(props) {
5441
5441
  setRootElement
5442
5442
  };
5443
5443
  }
5444
- const Root$5 = styled__default.default(Box)`
5444
+ const Root$5 = styledComponents.styled(Box)`
5445
5445
  outline: none;
5446
5446
  overflow: auto;
5447
5447
  `, Menu = react.forwardRef(function(props, ref) {
@@ -5665,14 +5665,14 @@ const Root$5 = styled__default.default(Box)`
5665
5665
  ]
5666
5666
  );
5667
5667
  return /* @__PURE__ */ jsxRuntime.jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) });
5668
- }), MenuDivider = styled__default.default.hr`
5668
+ }), MenuDivider = styledComponents.styled.hr`
5669
5669
  height: 1px;
5670
5670
  border: 0;
5671
5671
  background: var(--card-hairline-soft-color);
5672
5672
  margin: 0;
5673
5673
  `;
5674
5674
  function selectableBaseStyle() {
5675
- return styled.css`
5675
+ return styledComponents.css`
5676
5676
  background-color: inherit;
5677
5677
  color: inherit;
5678
5678
 
@@ -5696,8 +5696,8 @@ function selectableBaseStyle() {
5696
5696
  }
5697
5697
  function selectableColorStyle(props) {
5698
5698
  var _a;
5699
- const { $tone } = props, { color, style } = props.theme.sanity.v2, tone = color.selectable[$tone];
5700
- return styled.css`
5699
+ const { $tone } = props, { color, style } = theme.getTheme_v2(props.theme), tone = color.selectable[$tone];
5700
+ return styledComponents.css`
5701
5701
  ${_cardColorStyle(color, tone.enabled)}
5702
5702
 
5703
5703
  background-color: var(--card-bg-color);
@@ -5767,7 +5767,7 @@ function selectableColorStyle(props) {
5767
5767
  ${(_a = style == null ? void 0 : style.card) == null ? void 0 : _a.root}
5768
5768
  `;
5769
5769
  }
5770
- const Selectable = styled__default.default(Box)(
5770
+ const Selectable = styledComponents.styled(Box)(
5771
5771
  responsiveRadiusStyle,
5772
5772
  selectableBaseStyle,
5773
5773
  selectableColorStyle
@@ -5980,14 +5980,14 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5980
5980
  ]
5981
5981
  }
5982
5982
  );
5983
- }), keyframe = styled.keyframes`
5983
+ }), keyframe = styledComponents.keyframes`
5984
5984
  0% {
5985
5985
  background-position: 100%;
5986
5986
  }
5987
5987
  100% {
5988
5988
  background-position: -100%;
5989
5989
  }
5990
- `, animation = styled.css`
5990
+ `, animation = styledComponents.css`
5991
5991
  background-image: linear-gradient(
5992
5992
  to right,
5993
5993
  var(--card-skeleton-color-from),
@@ -6003,12 +6003,12 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
6003
6003
  animation-timing-function: ease-in-out;
6004
6004
  animation-iteration-count: infinite;
6005
6005
  animation-duration: 2000ms;
6006
- `, skeletonStyle = styled.css`
6006
+ `, skeletonStyle = styledComponents.css`
6007
6007
  opacity: ${({ $visible }) => $visible ? 1 : 0};
6008
6008
  transition: opacity 200ms ease-in;
6009
6009
 
6010
6010
  @media screen and (prefers-reduced-motion: no-preference) {
6011
- ${({ $animated }) => $animated ? animation : styled.css`
6011
+ ${({ $animated }) => $animated ? animation : styledComponents.css`
6012
6012
  background-color: var(--card-skeleton-color-from);
6013
6013
  `}
6014
6014
  }
@@ -6016,7 +6016,7 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
6016
6016
  @media screen and (prefers-reduced-motion: reduce) {
6017
6017
  background-color: var(--card-skeleton-color-from);
6018
6018
  }
6019
- `, Root$4 = styled__default.default(Box)(
6019
+ `, Root$4 = styledComponents.styled(Box)(
6020
6020
  responsiveRadiusStyle,
6021
6021
  skeletonStyle
6022
6022
  ), Skeleton = react.forwardRef(function(props, ref) {
@@ -6040,8 +6040,8 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
6040
6040
  ref
6041
6041
  }
6042
6042
  );
6043
- }), Root$3 = styled__default.default(Skeleton)((props) => {
6044
- const { $size, $style } = props, { font, media } = props.theme.sanity.v2, fontStyle = font[$style];
6043
+ }), Root$3 = styledComponents.styled(Skeleton)((props) => {
6044
+ const { $size, $style } = props, { font, media } = theme.getTheme_v2(props.theme), fontStyle = font[$style];
6045
6045
  return _responsive(media, $size, (sizeIndex) => {
6046
6046
  const fontSize2 = fontStyle.sizes[sizeIndex];
6047
6047
  return { height: fontSize2.lineHeight - fontSize2.ascenderHeight - fontSize2.descenderHeight };
@@ -6058,7 +6058,7 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
6058
6058
  }), CodeSkeleton = react.forwardRef(function(props, ref) {
6059
6059
  const { size: size2 = 2, ...restProps } = props, $size = useArrayProp(size2);
6060
6060
  return /* @__PURE__ */ jsxRuntime.jsx(Root$3, { ...restProps, $size, ref, $style: "code" });
6061
- }), CustomButton = styled__default.default(Button)`
6061
+ }), CustomButton = styledComponents.styled(Button)`
6062
6062
  max-width: 100%;
6063
6063
  `, Tab = react.forwardRef(function(props, forwardedRef) {
6064
6064
  const {
@@ -6110,7 +6110,7 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
6110
6110
  function _isReactElement(node) {
6111
6111
  return !!node;
6112
6112
  }
6113
- const CustomInline = styled__default.default(Inline)`
6113
+ const CustomInline = styledComponents.styled(Inline)`
6114
6114
  & > div {
6115
6115
  display: inline-block;
6116
6116
  vertical-align: middle;
@@ -6172,13 +6172,13 @@ const CustomInline = styled__default.default(Inline)`
6172
6172
  warning: "alert",
6173
6173
  success: "alert",
6174
6174
  info: "alert"
6175
- }, Root$2 = styled__default.default(Card)`
6175
+ }, Root$2 = styledComponents.styled(Card)`
6176
6176
  pointer-events: all;
6177
6177
  & > * {
6178
6178
  opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
6179
6179
  will-change: opacity;
6180
6180
  }
6181
- `, TextBox = styled__default.default(Flex)`
6181
+ `, TextBox = styledComponents.styled(Flex)`
6182
6182
  overflow-x: auto;
6183
6183
  `;
6184
6184
  function Toast(props) {
@@ -6224,14 +6224,14 @@ function useMounted() {
6224
6224
  const subscribe = () => () => {
6225
6225
  }, key$1 = Symbol.for("@sanity/ui/context/toast");
6226
6226
  globalScope[key$1] = globalScope[key$1] || react.createContext(null);
6227
- const ToastContext = globalScope[key$1], Root$1 = styled__default.default(Layer)`
6227
+ const ToastContext = globalScope[key$1], Root$1 = styledComponents.styled(Layer)`
6228
6228
  position: fixed;
6229
6229
  top: 0;
6230
6230
  left: 0;
6231
6231
  right: 0;
6232
6232
  bottom: 0;
6233
6233
  pointer-events: none;
6234
- `, ToastContainer = styled__default.default.div`
6234
+ `, ToastContainer = styledComponents.styled.div`
6235
6235
  box-sizing: border-box;
6236
6236
  position: absolute;
6237
6237
  right: 0;
@@ -6508,7 +6508,7 @@ const TreeContext = globalScope[key], Tree = react.memo(
6508
6508
  );
6509
6509
  Tree.displayName = "Tree";
6510
6510
  function treeItemRootStyle() {
6511
- return styled.css`
6511
+ return styledComponents.css`
6512
6512
  &[role='none'] > [role='treeitem'] {
6513
6513
  outline: none;
6514
6514
  cursor: default;
@@ -6540,8 +6540,8 @@ function treeItemRootStyle() {
6540
6540
  `;
6541
6541
  }
6542
6542
  function treeItemRootColorStyle(props) {
6543
- const $tone = "default", { color } = props.theme.sanity.v2, tone = color.selectable[$tone];
6544
- return styled.css`
6543
+ const $tone = "default", { color } = theme.getTheme_v2(props.theme), tone = color.selectable[$tone];
6544
+ return styledComponents.css`
6545
6545
  &[role='none'] {
6546
6546
  & > [role='treeitem'] {
6547
6547
  ${_cardColorStyle(color, tone.enabled)}
@@ -6584,8 +6584,8 @@ function treeItemRootColorStyle(props) {
6584
6584
  `;
6585
6585
  }
6586
6586
  function treeItemBoxStyle(props) {
6587
- const { $level } = props, { space } = props.theme.sanity.v2;
6588
- return styled.css`
6587
+ const { $level } = props, { space } = theme.getTheme_v2(props.theme);
6588
+ return styledComponents.css`
6589
6589
  padding-left: ${rem(space[2] * $level)};
6590
6590
 
6591
6591
  &[data-as='a'] {
@@ -6614,7 +6614,7 @@ const TreeGroup = react.memo(function(props) {
6614
6614
  children
6615
6615
  }
6616
6616
  );
6617
- }), Root = react.memo(styled__default.default.li(treeItemRootStyle, treeItemRootColorStyle)), TreeItemBox = styled__default.default(Box).attrs({ forwardedAs: "a" })(treeItemBoxStyle), ToggleArrowText = styled__default.default(Text)`
6617
+ }), Root = react.memo(styledComponents.styled.li(treeItemRootStyle, treeItemRootColorStyle)), TreeItemBox = styledComponents.styled(Box).attrs({ forwardedAs: "a" })(treeItemBoxStyle), ToggleArrowText = styledComponents.styled(Text)`
6618
6618
  & > svg {
6619
6619
  transition: transform 100ms;
6620
6620
  }