@sanity/ui 2.0.13-alpha.1 → 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 (66) hide show
  1. package/dist/index.d.mts +2 -2
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.esm.js +73 -73
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +78 -78
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +73 -73
  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/dialog/styles.ts +3 -3
  19. package/src/core/components/skeleton/textSkeleton.tsx +2 -2
  20. package/src/core/components/tree/style.ts +3 -2
  21. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +1 -1
  22. package/src/core/primitives/_selectable/style.ts +2 -1
  23. package/src/core/primitives/avatar/avatarCounter.tsx +3 -2
  24. package/src/core/primitives/avatar/avatarStack.tsx +2 -1
  25. package/src/core/primitives/avatar/styles.ts +3 -3
  26. package/src/core/primitives/button/styles.ts +3 -3
  27. package/src/core/primitives/card/__workshop__/selected.tsx +2 -2
  28. package/src/core/primitives/card/styles.ts +3 -2
  29. package/src/core/primitives/checkbox/styles.ts +2 -1
  30. package/src/core/primitives/code/styles.ts +4 -1
  31. package/src/core/primitives/container/styles.ts +2 -2
  32. package/src/core/primitives/heading/styles.ts +2 -1
  33. package/src/core/primitives/inline/styles.ts +2 -2
  34. package/src/core/primitives/label/styles.ts +2 -1
  35. package/src/core/primitives/radio/styles.ts +2 -1
  36. package/src/core/primitives/select/styles.ts +5 -5
  37. package/src/core/primitives/stack/styles.ts +2 -2
  38. package/src/core/primitives/switch/styles.ts +4 -3
  39. package/src/core/primitives/text/__workshop__/colored.tsx +2 -2
  40. package/src/core/primitives/text/styles.ts +2 -1
  41. package/src/core/styles/border/borderStyle.ts +6 -6
  42. package/src/core/styles/box/boxStyle.ts +5 -5
  43. package/src/core/styles/flex/flexItemStyle.ts +2 -2
  44. package/src/core/styles/flex/flexStyle.ts +6 -6
  45. package/src/core/styles/font/responsiveFont.ts +2 -2
  46. package/src/core/styles/font/textAlignStyle.ts +2 -2
  47. package/src/core/styles/grid/gridItemStyle.ts +7 -7
  48. package/src/core/styles/grid/gridStyle.ts +9 -9
  49. package/src/core/styles/helpers.ts +2 -2
  50. package/src/core/styles/input/responsiveInputPaddingStyle.ts +2 -2
  51. package/src/core/styles/input/textInputStyle.ts +4 -4
  52. package/src/core/styles/margin/marginsStyle.test.ts +1 -1
  53. package/src/core/styles/padding/paddingStyle.test.ts +1 -1
  54. package/src/core/styles/radius/radiusStyle.ts +2 -2
  55. package/src/core/styles/shadow/shadowStyle.ts +2 -2
  56. package/src/core/theme/__workshop__/build/Root.tsx +2 -1
  57. package/src/core/theme/theme.test.tsx +1 -1
  58. package/src/core/theme/themeProvider.tsx +7 -6
  59. package/src/core/theme/useTheme.ts +1 -2
  60. package/src/theme/system/theme.ts +1 -1
  61. package/dist/_chunks-cjs/getScopedTheme.js +0 -547
  62. package/dist/_chunks-cjs/getScopedTheme.js.map +0 -1
  63. package/dist/_chunks-es/getScopedTheme.mjs +0 -548
  64. package/dist/_chunks-es/getScopedTheme.mjs.map +0 -1
  65. package/dist/_legacy/getScopedTheme.esm.js +0 -548
  66. package/dist/_legacy/getScopedTheme.esm.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,8 +1,6 @@
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"), styledComponents = 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
  }
@@ -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(styledComponents.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);
@@ -547,7 +545,7 @@ function useTheme() {
547
545
  return styledComponents.useTheme();
548
546
  }
549
547
  function useTheme_v2() {
550
- return getScopedTheme.getTheme_v2(styledComponents.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) => {
@@ -947,7 +945,7 @@ 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;
948
+ const { $scheme, $tone, $weight } = props, { color, font } = theme.getTheme_v2(props.theme);
951
949
  return styledComponents.css`
952
950
  appearance: none;
953
951
  background: none;
@@ -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,7 +1023,7 @@ 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;
1026
+ const { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props, { color, input } = theme.getTheme_v2(props.theme);
1029
1027
  return styledComponents.css`
1030
1028
  --input-box-shadow: none;
1031
1029
 
@@ -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,7 +1199,7 @@ function responsiveShadowStyle(props) {
1201
1199
  );
1202
1200
  }
1203
1201
  function labelBaseStyle(props) {
1204
- const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
1202
+ const { $accent, $muted } = props, { font } = theme.getTheme_v2(props.theme);
1205
1203
  return styledComponents.css`
1206
1204
  text-transform: uppercase;
1207
1205
 
@@ -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 {
@@ -1496,7 +1494,7 @@ const Root$B = styledComponents.styled.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,7 +1505,7 @@ function _responsiveAvatarCounterSizeStyle(props) {
1507
1505
  });
1508
1506
  }
1509
1507
  function _avatarCounterBaseStyle(props) {
1510
- const { space } = props.theme.sanity.v2;
1508
+ const { space } = theme.getTheme_v2(props.theme);
1511
1509
  return styledComponents.css`
1512
1510
  align-items: center;
1513
1511
  justify-content: center;
@@ -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 ? {
@@ -1655,7 +1653,7 @@ const Root$z = styledComponents.styled.div(responsiveAvatarStackSizeStyle, avata
1655
1653
  );
1656
1654
  });
1657
1655
  function textBaseStyle(props) {
1658
- const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
1656
+ const { $accent, $muted } = props, { font } = theme.getTheme_v2(props.theme);
1659
1657
  return styledComponents.css`
1660
1658
  color: var(--card-fg-color);
1661
1659
 
@@ -1899,7 +1897,7 @@ function _cardColorStyle(base, color, checkered = !1) {
1899
1897
  };
1900
1898
  }
1901
1899
  function buttonBaseStyles(props) {
1902
- const { $width } = props, { style } = props.theme.sanity.v2;
1900
+ const { $width } = props, { style } = theme.getTheme_v2(props.theme);
1903
1901
  return styledComponents.css`
1904
1902
  ${style == null ? void 0 : style.button};
1905
1903
 
@@ -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;
@@ -2084,7 +2082,7 @@ 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;
2085
+ const { $checkered } = props, { space } = theme.getTheme_v2(props.theme);
2088
2086
  return styledComponents.css`
2089
2087
  ${$checkered && styledComponents.css`
2090
2088
  background-size: ${space[3]}px ${space[3]}px;
@@ -2118,7 +2116,7 @@ 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)" };
2119
+ const { $checkered, $focusRing } = props, { card, color, style } = theme.getTheme_v2(props.theme), border2 = { width: card.border.width, color: "var(--card-border-color)" };
2122
2120
  return styledComponents.css`
2123
2121
  color-scheme: ${color._dark ? "dark" : "light"};
2124
2122
 
@@ -2258,7 +2256,7 @@ function checkboxBaseStyles() {
2258
2256
  `;
2259
2257
  }
2260
2258
  function inputElementStyles(props) {
2261
- const { color, input, radius } = props.theme.sanity.v2, { focusRing } = input.checkbox;
2259
+ const { color, input, radius } = theme.getTheme_v2(props.theme), { focusRing } = input.checkbox;
2262
2260
  return styledComponents.css`
2263
2261
  position: absolute;
2264
2262
  top: 0;
@@ -2403,8 +2401,10 @@ const Root$r = styledComponents.styled.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 },
@@ -2487,7 +2487,7 @@ 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
  }));
@@ -2530,7 +2530,7 @@ const Root$p = styledComponents.styled(Box)(
2530
2530
  );
2531
2531
  });
2532
2532
  function headingBaseStyle(props) {
2533
- const { $accent, $muted } = props, { font } = props.theme.sanity.v2;
2533
+ const { $accent, $muted } = props, { font } = theme.getTheme_v2(props.theme);
2534
2534
  return styledComponents.css`
2535
2535
  ${$accent && styledComponents.css`
2536
2536
  color: var(--card-accent-fg-color);
@@ -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 {
@@ -3498,7 +3498,7 @@ 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;
3501
+ const { color, input } = theme.getTheme_v2(props.theme), dist = (input.radio.size - input.radio.markSize) / 2;
3502
3502
  return styledComponents.css`
3503
3503
  appearance: none;
3504
3504
  position: absolute;
@@ -3623,7 +3623,7 @@ function rootStyle() {
3623
3623
  `;
3624
3624
  }
3625
3625
  function inputBaseStyle(props) {
3626
- const { font } = props.theme.sanity.v2;
3626
+ const { font } = theme.getTheme_v2(props.theme);
3627
3627
  return styledComponents.css`
3628
3628
  -webkit-font-smoothing: antialiased;
3629
3629
  appearance: none;
@@ -3640,7 +3640,7 @@ function inputBaseStyle(props) {
3640
3640
  `;
3641
3641
  }
3642
3642
  function inputColorStyle(props) {
3643
- const { color, input } = props.theme.sanity.v2;
3643
+ const { color, input } = theme.getTheme_v2(props.theme);
3644
3644
  return styledComponents.css`
3645
3645
  /* enabled */
3646
3646
  background-color: ${color.input.default.enabled.bg};
@@ -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,7 +3712,7 @@ function inputStyle() {
3712
3712
  ];
3713
3713
  }
3714
3714
  function iconBoxStyle(props) {
3715
- const { color } = props.theme.sanity.v2;
3715
+ const { color } = theme.getTheme_v2(props.theme);
3716
3716
  return styledComponents.css`
3717
3717
  pointer-events: none;
3718
3718
  position: absolute;
@@ -3788,7 +3788,7 @@ 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
  }));
@@ -3834,7 +3834,7 @@ function switchInputStyles() {
3834
3834
  `;
3835
3835
  }
3836
3836
  function switchRepresentationStyles(props) {
3837
- const { color, input } = props.theme.sanity.v2;
3837
+ const { color, input } = theme.getTheme_v2(props.theme);
3838
3838
  return styledComponents.css`
3839
3839
  --switch-bg-color: ${color.input.default.enabled.border};
3840
3840
  --switch-fg-color: ${color.input.default.enabled.bg};
@@ -3907,7 +3907,7 @@ function switchRepresentationStyles(props) {
3907
3907
  `;
3908
3908
  }
3909
3909
  function switchTrackStyles(props) {
3910
- const { input } = props.theme.sanity.v2;
3910
+ const { input } = theme.getTheme_v2(props.theme);
3911
3911
  return styledComponents.css`
3912
3912
  &:not([hidden]) {
3913
3913
  display: block;
@@ -3922,7 +3922,7 @@ 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;
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
3926
  return styledComponents.css`
3927
3927
  &:not([hidden]) {
3928
3928
  display: block;
@@ -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,7 +5017,7 @@ 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) {
@@ -5696,7 +5696,7 @@ 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];
5699
+ const { $tone } = props, { color, style } = theme.getTheme_v2(props.theme), tone = color.selectable[$tone];
5700
5700
  return styledComponents.css`
5701
5701
  ${_cardColorStyle(color, tone.enabled)}
5702
5702
 
@@ -6041,7 +6041,7 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
6041
6041
  }
6042
6042
  );
6043
6043
  }), Root$3 = styledComponents.styled(Skeleton)((props) => {
6044
- const { $size, $style } = props, { font, media } = props.theme.sanity.v2, fontStyle = font[$style];
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 };
@@ -6540,7 +6540,7 @@ function treeItemRootStyle() {
6540
6540
  `;
6541
6541
  }
6542
6542
  function treeItemRootColorStyle(props) {
6543
- const $tone = "default", { color } = props.theme.sanity.v2, tone = color.selectable[$tone];
6543
+ const $tone = "default", { color } = theme.getTheme_v2(props.theme), tone = color.selectable[$tone];
6544
6544
  return styledComponents.css`
6545
6545
  &[role='none'] {
6546
6546
  & > [role='treeitem'] {
@@ -6584,7 +6584,7 @@ function treeItemRootColorStyle(props) {
6584
6584
  `;
6585
6585
  }
6586
6586
  function treeItemBoxStyle(props) {
6587
- const { $level } = props, { space } = props.theme.sanity.v2;
6587
+ const { $level } = props, { space } = theme.getTheme_v2(props.theme);
6588
6588
  return styledComponents.css`
6589
6589
  padding-left: ${rem(space[2] * $level)};
6590
6590