@sanity/ui 2.15.8 → 2.15.10

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 (262) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +134 -134
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-es/_visual-editing.mjs +134 -134
  4. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  5. package/dist/_visual-editing.d.mts +1 -1
  6. package/dist/_visual-editing.d.ts +1 -1
  7. package/dist/index.d.mts +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +48 -48
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +48 -49
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/theme.js +431 -40
  14. package/dist/theme.js.map +1 -1
  15. package/dist/theme.mjs +393 -4
  16. package/dist/theme.mjs.map +1 -1
  17. package/exports/_visual-editing.ts +15 -15
  18. package/package.json +37 -33
  19. package/src/core/_compat.ts +11 -11
  20. package/src/core/components/autocomplete/__mocks__/apiStore.ts +1 -1
  21. package/src/core/components/autocomplete/__workshop__/async.tsx +1 -0
  22. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -1
  23. package/src/core/components/autocomplete/__workshop__/custom.tsx +2 -1
  24. package/src/core/components/autocomplete/__workshop__/example.tsx +2 -1
  25. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -0
  26. package/src/core/components/autocomplete/autocomplete.styles.tsx +2 -1
  27. package/src/core/components/autocomplete/autocomplete.tsx +3 -2
  28. package/src/core/components/autocomplete/autocompleteOption.tsx +1 -0
  29. package/src/core/components/breadcrumbs/__workshop__/example.tsx +7 -0
  30. package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +1 -0
  31. package/src/core/components/breadcrumbs/breadcrumbs.tsx +1 -0
  32. package/src/core/components/dialog/__workshop__/activate.tsx +2 -1
  33. package/src/core/components/dialog/__workshop__/panes.tsx +1 -0
  34. package/src/core/components/dialog/__workshop__/position.tsx +1 -0
  35. package/src/core/components/dialog/__workshop__/props.tsx +1 -0
  36. package/src/core/components/dialog/__workshop__/wrapped.tsx +1 -3
  37. package/src/core/components/dialog/dialog.tsx +3 -0
  38. package/src/core/components/dialog/dialogProvider.tsx +1 -0
  39. package/src/core/components/dialog/styles.ts +1 -0
  40. package/src/core/components/dialog/useDialog.ts +1 -0
  41. package/src/core/components/hotkeys/hotkeys.tsx +1 -0
  42. package/src/core/components/menu/__workshop__/asComponent.tsx +1 -0
  43. package/src/core/components/menu/__workshop__/avatarMenu.tsx +1 -0
  44. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +1 -0
  45. package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -0
  46. package/src/core/components/menu/__workshop__/menuButton.tsx +1 -0
  47. package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -0
  48. package/src/core/components/menu/__workshop__/tones.tsx +1 -0
  49. package/src/core/components/menu/menu.test.tsx +1 -0
  50. package/src/core/components/menu/menu.tsx +1 -0
  51. package/src/core/components/menu/menuButton.tsx +4 -3
  52. package/src/core/components/menu/menuGroup.tsx +1 -0
  53. package/src/core/components/menu/menuItem.tsx +1 -1
  54. package/src/core/components/menu/useMenu.ts +1 -0
  55. package/src/core/components/menu/useMenuController.ts +1 -0
  56. package/src/core/components/skeleton/__workshop__/delay.tsx +1 -0
  57. package/src/core/components/skeleton/__workshop__/skeleton.tsx +1 -0
  58. package/src/core/components/skeleton/skeleton.tsx +2 -2
  59. package/src/core/components/skeleton/textSkeleton.tsx +3 -2
  60. package/src/core/components/tab/tab.tsx +1 -0
  61. package/src/core/components/tab/tabList.tsx +2 -1
  62. package/src/core/components/tab/tabPanel.tsx +1 -0
  63. package/src/core/components/toast/__workshop__/toast.tsx +1 -0
  64. package/src/core/components/toast/styles.ts +2 -1
  65. package/src/core/components/toast/toast.tsx +4 -4
  66. package/src/core/components/toast/toastLayer.tsx +1 -0
  67. package/src/core/components/toast/toastProvider.tsx +1 -0
  68. package/src/core/components/toast/useToast.ts +1 -0
  69. package/src/core/components/tree/__workshop__/basic.tsx +1 -0
  70. package/src/core/components/tree/__workshop__/tabFromElement.tsx +2 -1
  71. package/src/core/components/tree/style.ts +1 -0
  72. package/src/core/components/tree/tree.tsx +1 -0
  73. package/src/core/components/tree/treeGroup.tsx +1 -0
  74. package/src/core/components/tree/treeItem.tsx +3 -2
  75. package/src/core/components/tree/useTree.ts +1 -0
  76. package/src/core/helpers/focus.ts +2 -2
  77. package/src/core/hooks/useArrayProp.ts +1 -0
  78. package/src/core/hooks/useClickOutside.test.tsx +0 -1
  79. package/src/core/hooks/useClickOutside.ts +1 -0
  80. package/src/core/hooks/useClickOutsideEvent.test.tsx +0 -1
  81. package/src/core/hooks/useClickOutsideEvent.ts +1 -0
  82. package/src/core/hooks/useDelayed.test.ts +2 -1
  83. package/src/core/hooks/useDelayedState.ts +1 -2
  84. package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -0
  85. package/src/core/hooks/useElementSize.ts +2 -1
  86. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -1
  87. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +1 -0
  88. package/src/core/hooks/usePrefersDark.test.tsx +2 -1
  89. package/src/core/hooks/usePrefersReducedMotion.test.tsx +2 -1
  90. package/src/core/index.ts +1 -2
  91. package/src/core/lib/createGlobalScopedContext.ts +2 -1
  92. package/src/core/primitives/_selectable/selectable.tsx +1 -0
  93. package/src/core/primitives/_selectable/style.ts +1 -0
  94. package/src/core/primitives/avatar/__workshop__/asButton.tsx +1 -0
  95. package/src/core/primitives/avatar/__workshop__/stack.tsx +1 -0
  96. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -0
  97. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -0
  98. package/src/core/primitives/avatar/avatar.tsx +2 -7
  99. package/src/core/primitives/avatar/avatarCounter.tsx +3 -2
  100. package/src/core/primitives/avatar/avatarStack.tsx +3 -2
  101. package/src/core/primitives/avatar/styles.ts +2 -1
  102. package/src/core/primitives/avatar/types.ts +1 -0
  103. package/src/core/primitives/badge/__workshop__/props.tsx +1 -0
  104. package/src/core/primitives/badge/__workshop__/tones.tsx +1 -0
  105. package/src/core/primitives/badge/badge.test.tsx +1 -0
  106. package/src/core/primitives/badge/badge.tsx +1 -0
  107. package/src/core/primitives/badge/styles.ts +1 -0
  108. package/src/core/primitives/box/__workshop__/props.tsx +1 -0
  109. package/src/core/primitives/box/box.tsx +3 -2
  110. package/src/core/primitives/button/__workshop__/custom.tsx +3 -0
  111. package/src/core/primitives/button/__workshop__/disabled.tsx +1 -0
  112. package/src/core/primitives/button/__workshop__/props.tsx +2 -1
  113. package/src/core/primitives/button/__workshop__/stacked.tsx +1 -0
  114. package/src/core/primitives/button/button.test.tsx +1 -0
  115. package/src/core/primitives/button/button.tsx +1 -0
  116. package/src/core/primitives/button/styles.ts +1 -0
  117. package/src/core/primitives/card/__workshop__/asButton.tsx +1 -0
  118. package/src/core/primitives/card/__workshop__/listNavigation.tsx +1 -0
  119. package/src/core/primitives/card/__workshop__/props.tsx +3 -1
  120. package/src/core/primitives/card/__workshop__/selected.tsx +2 -2
  121. package/src/core/primitives/card/card.tsx +1 -0
  122. package/src/core/primitives/card/styles.ts +1 -0
  123. package/src/core/primitives/checkbox/checkbox.tsx +1 -0
  124. package/src/core/primitives/checkbox/styles.ts +1 -0
  125. package/src/core/primitives/code/__workshop__/props.tsx +1 -0
  126. package/src/core/primitives/code/code.tsx +2 -1
  127. package/src/core/primitives/container/__workshop__/example.tsx +1 -0
  128. package/src/core/primitives/container/container.tsx +1 -0
  129. package/src/core/primitives/container/styles.ts +2 -1
  130. package/src/core/primitives/flex/__workshop__/example.tsx +1 -0
  131. package/src/core/primitives/flex/flex.tsx +2 -1
  132. package/src/core/primitives/grid/grid.tsx +1 -0
  133. package/src/core/primitives/heading/__workshop__/plain.tsx +2 -1
  134. package/src/core/primitives/heading/heading.tsx +1 -0
  135. package/src/core/primitives/heading/styles.ts +1 -0
  136. package/src/core/primitives/inline/__workshop__/plain.tsx +1 -0
  137. package/src/core/primitives/inline/inline.tsx +2 -1
  138. package/src/core/primitives/inline/styles.ts +2 -1
  139. package/src/core/primitives/kbd/kbd.tsx +2 -1
  140. package/src/core/primitives/label/__workshop__/plain.tsx +2 -1
  141. package/src/core/primitives/label/label.tsx +1 -0
  142. package/src/core/primitives/label/styles.ts +1 -0
  143. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +1 -0
  144. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +1 -0
  145. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +1 -0
  146. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +4 -1
  147. package/src/core/primitives/popover/__workshop__/TestStory.tsx +1 -0
  148. package/src/core/primitives/popover/floating-ui/size.ts +2 -1
  149. package/src/core/primitives/popover/popover.tsx +6 -7
  150. package/src/core/primitives/popover/popoverCard.tsx +2 -1
  151. package/src/core/primitives/radio/radio.tsx +2 -1
  152. package/src/core/primitives/radio/styles.ts +1 -0
  153. package/src/core/primitives/select/select.tsx +2 -1
  154. package/src/core/primitives/select/styles.ts +3 -3
  155. package/src/core/primitives/spinner/__workshop__/Props.tsx +1 -0
  156. package/src/core/primitives/spinner/spinner.tsx +2 -1
  157. package/src/core/primitives/stack/__workshop__/plain.tsx +1 -0
  158. package/src/core/primitives/stack/stack.tsx +2 -1
  159. package/src/core/primitives/stack/styles.ts +2 -1
  160. package/src/core/primitives/switch/styles.ts +1 -0
  161. package/src/core/primitives/switch/switch.tsx +2 -1
  162. package/src/core/primitives/text/__workshop__/colored.tsx +3 -2
  163. package/src/core/primitives/text/__workshop__/example.tsx +1 -0
  164. package/src/core/primitives/text/styles.ts +1 -0
  165. package/src/core/primitives/text/text.tsx +1 -0
  166. package/src/core/primitives/textArea/__workshop__/plain.tsx +1 -0
  167. package/src/core/primitives/textArea/textArea.tsx +6 -5
  168. package/src/core/primitives/textInput/__workshop__/plain.tsx +2 -1
  169. package/src/core/primitives/textInput/__workshop__/typed.tsx +1 -0
  170. package/src/core/primitives/textInput/textInput.tsx +1 -0
  171. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +1 -0
  172. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -0
  173. package/src/core/primitives/tooltip/__workshop__/props.tsx +3 -2
  174. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -0
  175. package/src/core/primitives/tooltip/tooltip.test.tsx +4 -2
  176. package/src/core/primitives/tooltip/tooltip.tsx +6 -5
  177. package/src/core/primitives/tooltip/tooltipCard.tsx +2 -1
  178. package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +1 -1
  179. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +1 -0
  180. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -0
  181. package/src/core/styles/border/borderStyle.ts +1 -0
  182. package/src/core/styles/box/boxStyle.ts +1 -0
  183. package/src/core/styles/card/_cardColorStyle.ts +1 -2
  184. package/src/core/styles/flex/flexItemStyle.ts +1 -0
  185. package/src/core/styles/flex/flexStyle.ts +2 -1
  186. package/src/core/styles/flex/index.ts +1 -1
  187. package/src/core/styles/flex/types.ts +1 -0
  188. package/src/core/styles/font/codeFontStyle.ts +1 -0
  189. package/src/core/styles/font/headingFontStyle.ts +1 -0
  190. package/src/core/styles/font/labelFontStyle.ts +1 -0
  191. package/src/core/styles/font/responsiveFont.ts +3 -3
  192. package/src/core/styles/font/textAlignStyle.ts +1 -0
  193. package/src/core/styles/font/textFontStyle.ts +1 -0
  194. package/src/core/styles/font/types.ts +1 -0
  195. package/src/core/styles/grid/gridItemStyle.ts +1 -0
  196. package/src/core/styles/grid/gridStyle.ts +2 -1
  197. package/src/core/styles/grid/index.ts +1 -1
  198. package/src/core/styles/helpers.ts +2 -2
  199. package/src/core/styles/input/responsiveInputPaddingStyle.ts +2 -1
  200. package/src/core/styles/input/textInputStyle.ts +3 -3
  201. package/src/core/styles/margin/marginStyle.ts +1 -0
  202. package/src/core/styles/margin/marginsStyle.test.ts +1 -0
  203. package/src/core/styles/padding/paddingStyle.test.ts +1 -0
  204. package/src/core/styles/padding/paddingStyle.ts +1 -0
  205. package/src/core/styles/radius/radiusStyle.ts +1 -0
  206. package/src/core/styles/shadow/shadowStyle.ts +3 -3
  207. package/src/core/theme/__workshop__/build/Root.tsx +1 -1
  208. package/src/core/theme/__workshop__/build/story.tsx +18 -9
  209. package/src/core/theme/__workshop__/canvas.tsx +7 -6
  210. package/src/core/theme/__workshop__/debug/story.tsx +5 -3
  211. package/src/core/theme/index.ts +1 -1
  212. package/src/core/theme/theme.test.tsx +1 -0
  213. package/src/core/theme/themeColorProvider.tsx +1 -0
  214. package/src/core/theme/themeProvider.tsx +3 -2
  215. package/src/core/theme/useRootTheme.ts +1 -0
  216. package/src/core/theme/useTheme.ts +1 -1
  217. package/src/core/utils/arrow/arrow.tsx +4 -3
  218. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +1 -0
  219. package/src/core/utils/boundaryElement/index.ts +1 -1
  220. package/src/core/utils/boundaryElement/useBoundaryElement.ts +1 -0
  221. package/src/core/utils/elementQuery/elementQuery.tsx +1 -0
  222. package/src/core/utils/errorBoundary.tsx +1 -0
  223. package/src/core/utils/layer/__workshop__/multipleRoots.tsx +1 -0
  224. package/src/core/utils/layer/__workshop__/nested.tsx +1 -0
  225. package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +1 -0
  226. package/src/core/utils/layer/index.ts +1 -1
  227. package/src/core/utils/layer/layer.tsx +1 -0
  228. package/src/core/utils/layer/layerProvider.tsx +2 -1
  229. package/src/core/utils/layer/useLayer.ts +1 -0
  230. package/src/core/utils/portal/portal.ts +1 -0
  231. package/src/core/utils/portal/portalProvider.tsx +1 -0
  232. package/src/core/utils/portal/usePortal.ts +1 -0
  233. package/src/core/utils/virtualList/virtualList.tsx +1 -0
  234. package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +1 -1
  235. package/src/theme/build/_deprecated/color/card/createCardStates.ts +1 -1
  236. package/src/theme/build/_deprecated/color/factory.ts +6 -6
  237. package/src/theme/build/buildColorTheme.ts +15 -15
  238. package/src/theme/build/colorToken/colorToken.ts +1 -1
  239. package/src/theme/build/mixThemeColor.ts +1 -1
  240. package/src/theme/build/renderColorTheme.ts +7 -6
  241. package/src/theme/build/renderColorValue.ts +3 -2
  242. package/src/theme/build/resolveColorTokens.ts +5 -4
  243. package/src/theme/config/helpers.ts +2 -2
  244. package/src/theme/config/system.ts +2 -1
  245. package/src/theme/config/tokens/color/types.ts +2 -1
  246. package/src/theme/config/tokens/types.ts +2 -1
  247. package/src/theme/config/types.ts +2 -1
  248. package/src/theme/system/color/_helpers.ts +1 -0
  249. package/src/theme/system/color/_system.ts +1 -1
  250. package/src/theme/system/color/color.ts +1 -1
  251. package/src/theme/system/index.ts +1 -2
  252. package/src/theme/system/theme.ts +2 -2
  253. package/src/theme/system/v0/color/index.ts +1 -1
  254. package/src/theme/system/v0/index.ts +1 -1
  255. package/src/theme/versioning/themeColor_v0_v2.ts +5 -5
  256. package/dist/_chunks-cjs/getTheme_v2.js +0 -397
  257. package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
  258. package/dist/_chunks-es/getTheme_v2.mjs +0 -398
  259. package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
  260. package/src/core/__workshop__/fontsPlugin.tsx +0 -76
  261. /package/src/core/components/autocomplete/{__fixtures__ → __mocks__}/countries.ts +0 -0
  262. /package/src/core/primitives/kbd/{index.tsx → index.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- var jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), react = require("react"), styledComponents = require("styled-components"), theme = require("@sanity/ui/theme"), ReactIs = require("react-is"), icons = require("@sanity/icons"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer"), reactDom = require("react-dom"), useEffectEvent = require("use-effect-event");
2
+ var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), react = require("react"), styledComponents = require("styled-components"), ReactIs = require("react-is"), icons = require("@sanity/icons"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer"), reactDom = require("react-dom"), useEffectEvent = require("use-effect-event");
3
3
  function _interopDefaultCompat(e) {
4
4
  return e && typeof e == "object" && "default" in e ? e : { default: e };
5
5
  }
@@ -41,6 +41,35 @@ const createColorTheme = theme.createColorTheme, hexToRgb = theme.hexToRgb, hslT
41
41
  bounce: 0.25
42
42
  }
43
43
  };
44
+ function _isEnterToClickElement(element) {
45
+ return isHTMLAnchorElement(element) || isHTMLButtonElement(element);
46
+ }
47
+ function isHTMLElement(node) {
48
+ return node instanceof Node && node.nodeType === Node.ELEMENT_NODE;
49
+ }
50
+ function isHTMLAnchorElement(element) {
51
+ return isHTMLElement(element) && element.nodeName === "A";
52
+ }
53
+ function isHTMLInputElement(element) {
54
+ return isHTMLElement(element) && element.nodeName === "INPUT";
55
+ }
56
+ function isHTMLButtonElement(element) {
57
+ return isHTMLElement(element) && element.nodeName === "BUTTON";
58
+ }
59
+ function isHTMLSelectElement(element) {
60
+ return isHTMLElement(element) && element.nodeName === "SELECT";
61
+ }
62
+ function isHTMLTextAreaElement(element) {
63
+ return isHTMLElement(element) && element.nodeName === "TEXTAREA";
64
+ }
65
+ function containsOrEqualsElement(element, node) {
66
+ return element.contains(node) || element === node;
67
+ }
68
+ function _isScrollable(el) {
69
+ if (!(el instanceof Element)) return !1;
70
+ const style = window.getComputedStyle(el);
71
+ return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
72
+ }
44
73
  function _fillCSSObject(keys, value) {
45
74
  return keys.reduce((style, key2) => (style[key2] = value, style), {});
46
75
  }
@@ -562,12 +591,27 @@ function responsiveBoxOverflowStyle(props) {
562
591
  }));
563
592
  }
564
593
  const BASE_STYLE$3 = {
594
+ minWidth: 0,
595
+ minHeight: 0
596
+ };
597
+ function flexItemStyle() {
598
+ return [BASE_STYLE$3, responsiveFlexItemStyle];
599
+ }
600
+ function responsiveFlexItemStyle(props) {
601
+ const {
602
+ media
603
+ } = theme.getTheme_v2(props.theme);
604
+ return props.$flex ? _responsive(media, props.$flex, (flex) => ({
605
+ flex
606
+ })) : EMPTY_ARRAY;
607
+ }
608
+ const BASE_STYLE$2 = {
565
609
  "&&:not([hidden])": {
566
610
  display: "flex"
567
611
  }
568
612
  };
569
613
  function responsiveFlexStyle() {
570
- return [BASE_STYLE$3, responsiveFlexAlignStyle, responsiveFlexGapStyle, responsiveFlexWrapStyle, responsiveFlexJustifyStyle, responsiveFlexDirectionStyle];
614
+ return [BASE_STYLE$2, responsiveFlexAlignStyle, responsiveFlexGapStyle, responsiveFlexWrapStyle, responsiveFlexJustifyStyle, responsiveFlexDirectionStyle];
571
615
  }
572
616
  function responsiveFlexAlignStyle(props) {
573
617
  const {
@@ -610,21 +654,6 @@ function responsiveFlexDirectionStyle(props) {
610
654
  flexDirection: direction
611
655
  }));
612
656
  }
613
- const BASE_STYLE$2 = {
614
- minWidth: 0,
615
- minHeight: 0
616
- };
617
- function flexItemStyle() {
618
- return [BASE_STYLE$2, responsiveFlexItemStyle];
619
- }
620
- function responsiveFlexItemStyle(props) {
621
- const {
622
- media
623
- } = theme.getTheme_v2(props.theme);
624
- return props.$flex ? _responsive(media, props.$flex, (flex) => ({
625
- flex
626
- })) : EMPTY_ARRAY;
627
- }
628
657
  function focusRingBorderStyle(border2) {
629
658
  return `inset 0 0 0 ${border2.width}px ${border2.color}`;
630
659
  }
@@ -636,6 +665,68 @@ function focusRingStyle(opts) {
636
665
  } = opts, focusRingOutsetWidth = focusRing.offset + focusRing.width, focusRingInsetWidth = 0 - focusRing.offset, bgColor = base ? base.bg : "var(--card-bg-color)";
637
666
  return [focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`, border2 && focusRingBorderStyle(border2), focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`, focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`].filter(Boolean).join(",");
638
667
  }
668
+ function responsiveGridItemStyle() {
669
+ return [responsiveGridItemRowStyle, responsiveGridItemRowStartStyle, responsiveGridItemRowEndStyle, responsiveGridItemColumnStyle, responsiveGridItemColumnStartStyle, responsiveGridItemColumnEndStyle];
670
+ }
671
+ const GRID_ITEM_ROW = {
672
+ auto: "auto",
673
+ full: "1 / -1"
674
+ }, GRID_ITEM_COLUMN = {
675
+ auto: "auto",
676
+ full: "1 / -1"
677
+ };
678
+ function responsiveGridItemRowStyle(props) {
679
+ const {
680
+ media
681
+ } = theme.getTheme_v2(props.theme);
682
+ return _responsive(media, props.$row, (row) => typeof row == "number" ? {
683
+ gridRow: `span ${row} / span ${row}`
684
+ } : {
685
+ gridRow: GRID_ITEM_ROW[row]
686
+ });
687
+ }
688
+ function responsiveGridItemRowStartStyle(props) {
689
+ const {
690
+ media
691
+ } = theme.getTheme_v2(props.theme);
692
+ return _responsive(media, props.$rowStart, (rowStart) => ({
693
+ gridRowStart: rowStart
694
+ }));
695
+ }
696
+ function responsiveGridItemRowEndStyle(props) {
697
+ const {
698
+ media
699
+ } = theme.getTheme_v2(props.theme);
700
+ return _responsive(media, props.$rowEnd, (rowEnd) => ({
701
+ gridRowEnd: rowEnd
702
+ }));
703
+ }
704
+ function responsiveGridItemColumnStyle(props) {
705
+ const {
706
+ media
707
+ } = theme.getTheme_v2(props.theme);
708
+ return _responsive(media, props.$column, (column) => typeof column == "number" ? {
709
+ gridColumn: `span ${column} / span ${column}`
710
+ } : {
711
+ gridColumn: GRID_ITEM_COLUMN[column]
712
+ });
713
+ }
714
+ function responsiveGridItemColumnStartStyle(props) {
715
+ const {
716
+ media
717
+ } = theme.getTheme_v2(props.theme);
718
+ return _responsive(media, props.$columnStart, (columnStart) => ({
719
+ gridColumnStart: columnStart
720
+ }));
721
+ }
722
+ function responsiveGridItemColumnEndStyle(props) {
723
+ const {
724
+ media
725
+ } = theme.getTheme_v2(props.theme);
726
+ return _responsive(media, props.$columnEnd, (columnEnd) => ({
727
+ gridColumnEnd: columnEnd
728
+ }));
729
+ }
639
730
  const GRID_CSS = {
640
731
  "&&:not([hidden])": {
641
732
  display: "grid"
@@ -724,68 +815,6 @@ function responsiveGridGapYStyle(props) {
724
815
  rowGap: gapY ? rem(space[gapY]) : void 0
725
816
  }));
726
817
  }
727
- function responsiveGridItemStyle() {
728
- return [responsiveGridItemRowStyle, responsiveGridItemRowStartStyle, responsiveGridItemRowEndStyle, responsiveGridItemColumnStyle, responsiveGridItemColumnStartStyle, responsiveGridItemColumnEndStyle];
729
- }
730
- const GRID_ITEM_ROW = {
731
- auto: "auto",
732
- full: "1 / -1"
733
- }, GRID_ITEM_COLUMN = {
734
- auto: "auto",
735
- full: "1 / -1"
736
- };
737
- function responsiveGridItemRowStyle(props) {
738
- const {
739
- media
740
- } = theme.getTheme_v2(props.theme);
741
- return _responsive(media, props.$row, (row) => typeof row == "number" ? {
742
- gridRow: `span ${row} / span ${row}`
743
- } : {
744
- gridRow: GRID_ITEM_ROW[row]
745
- });
746
- }
747
- function responsiveGridItemRowStartStyle(props) {
748
- const {
749
- media
750
- } = theme.getTheme_v2(props.theme);
751
- return _responsive(media, props.$rowStart, (rowStart) => ({
752
- gridRowStart: rowStart
753
- }));
754
- }
755
- function responsiveGridItemRowEndStyle(props) {
756
- const {
757
- media
758
- } = theme.getTheme_v2(props.theme);
759
- return _responsive(media, props.$rowEnd, (rowEnd) => ({
760
- gridRowEnd: rowEnd
761
- }));
762
- }
763
- function responsiveGridItemColumnStyle(props) {
764
- const {
765
- media
766
- } = theme.getTheme_v2(props.theme);
767
- return _responsive(media, props.$column, (column) => typeof column == "number" ? {
768
- gridColumn: `span ${column} / span ${column}`
769
- } : {
770
- gridColumn: GRID_ITEM_COLUMN[column]
771
- });
772
- }
773
- function responsiveGridItemColumnStartStyle(props) {
774
- const {
775
- media
776
- } = theme.getTheme_v2(props.theme);
777
- return _responsive(media, props.$columnStart, (columnStart) => ({
778
- gridColumnStart: columnStart
779
- }));
780
- }
781
- function responsiveGridItemColumnEndStyle(props) {
782
- const {
783
- media
784
- } = theme.getTheme_v2(props.theme);
785
- return _responsive(media, props.$columnEnd, (columnEnd) => ({
786
- gridColumnEnd: columnEnd
787
- }));
788
- }
789
818
  function responsiveInputPaddingStyle(props) {
790
819
  const {
791
820
  $fontSize,
@@ -2996,47 +3025,6 @@ function getLayerContext(contextValue) {
2996
3025
  throw new Error("could not get layer context");
2997
3026
  }
2998
3027
  const LayerContext = createGlobalScopedContext("@sanity/ui/context/layer", null);
2999
- function useLayer() {
3000
- const $ = reactCompilerRuntime.c(2), value = react.useContext(LayerContext);
3001
- if (!value)
3002
- throw new Error("useLayer(): missing context value");
3003
- try {
3004
- let t1;
3005
- return $[0] !== value ? (t1 = getLayerContext(value), $[0] = value, $[1] = t1) : t1 = $[1], t1;
3006
- } catch (t0) {
3007
- const err = t0;
3008
- throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
3009
- }
3010
- }
3011
- function _isEnterToClickElement(element) {
3012
- return isHTMLAnchorElement(element) || isHTMLButtonElement(element);
3013
- }
3014
- function isHTMLElement(node) {
3015
- return node instanceof Node && node.nodeType === Node.ELEMENT_NODE;
3016
- }
3017
- function isHTMLAnchorElement(element) {
3018
- return isHTMLElement(element) && element.nodeName === "A";
3019
- }
3020
- function isHTMLInputElement(element) {
3021
- return isHTMLElement(element) && element.nodeName === "INPUT";
3022
- }
3023
- function isHTMLButtonElement(element) {
3024
- return isHTMLElement(element) && element.nodeName === "BUTTON";
3025
- }
3026
- function isHTMLSelectElement(element) {
3027
- return isHTMLElement(element) && element.nodeName === "SELECT";
3028
- }
3029
- function isHTMLTextAreaElement(element) {
3030
- return isHTMLElement(element) && element.nodeName === "TEXTAREA";
3031
- }
3032
- function containsOrEqualsElement(element, node) {
3033
- return element.contains(node) || element === node;
3034
- }
3035
- function _isScrollable(el) {
3036
- if (!(el instanceof Element)) return !1;
3037
- const style = window.getComputedStyle(el);
3038
- return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
3039
- }
3040
3028
  function LayerProvider(props) {
3041
3029
  const $ = reactCompilerRuntime.c(19), {
3042
3030
  children,
@@ -3089,6 +3077,18 @@ function _temp$3(v) {
3089
3077
  return v + 1;
3090
3078
  }
3091
3079
  LayerProvider.displayName = "LayerProvider";
3080
+ function useLayer() {
3081
+ const $ = reactCompilerRuntime.c(2), value = react.useContext(LayerContext);
3082
+ if (!value)
3083
+ throw new Error("useLayer(): missing context value");
3084
+ try {
3085
+ let t1;
3086
+ return $[0] !== value ? (t1 = getLayerContext(value), $[0] = value, $[1] = t1) : t1 = $[1], t1;
3087
+ } catch (t0) {
3088
+ const err = t0;
3089
+ throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
3090
+ }
3091
+ }
3092
3092
  const StyledLayer = /* @__PURE__ */ styledComponents.styled.div.withConfig({
3093
3093
  displayName: "StyledLayer",
3094
3094
  componentId: "sc-16kojrv-0"
@@ -4487,9 +4487,6 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
4487
4487
  }));
4488
4488
  TooltipCard.displayName = "Memo(ForwardRef(TooltipCard))";
4489
4489
  const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
4490
- function useTooltipDelayGroup() {
4491
- return react.useContext(TooltipDelayGroupContext);
4492
- }
4493
4490
  function TooltipDelayGroupProvider(props) {
4494
4491
  const $ = reactCompilerRuntime.c(10), {
4495
4492
  children,
@@ -4511,6 +4508,9 @@ function TooltipDelayGroupProvider(props) {
4511
4508
  return $[7] !== children || $[8] !== value ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(TooltipDelayGroupContext.Provider, { value, children }), $[7] = children, $[8] = value, $[9] = t3) : t3 = $[9], t3;
4512
4509
  }
4513
4510
  TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
4511
+ function useTooltipDelayGroup() {
4512
+ return react.useContext(TooltipDelayGroupContext);
4513
+ }
4514
4514
  const StyledTooltip = styledComponents.styled(Layer).withConfig({
4515
4515
  displayName: "StyledTooltip",
4516
4516
  componentId: "sc-13f2zvh-0"
@@ -5141,7 +5141,7 @@ function MenuGroup(props) {
5141
5141
  }
5142
5142
  MenuGroup.displayName = "MenuGroup";
5143
5143
  const MenuItem = react.forwardRef(function(props, forwardedRef) {
5144
- const $ = reactCompilerRuntime.c(74);
5144
+ const $ = reactCompilerRuntime.c(73);
5145
5145
  let IconComponent, IconRightComponent, children, disabled, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, restProps, selectedProp, t0, t1, t2, t3, t4, t5, text;
5146
5146
  $[0] !== props ? ({
5147
5147
  as: t0,
@@ -5203,9 +5203,9 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5203
5203
  $[43] === Symbol.for("react.memo_cache_sentinel") ? (t14 = (el) => {
5204
5204
  ref.current = el, setRootElement(el);
5205
5205
  }, $[43] = t14) : t14 = $[43];
5206
- const setRef = t14, t15 = as === "button" && pressed, t16 = as !== "button" && pressed ? "" : void 0, t17 = active ? "" : void 0, t18 = disabled ? "" : void 0, t19 = useArrayProp(radius), t20 = useArrayProp(0), t21 = disabled ? "default" : tone, t22 = as === "button" ? "button" : void 0;
5207
- let t23;
5208
- $[44] !== IconComponent || $[45] !== IconRightComponent || $[46] !== fontSize2 || $[47] !== hotkeys || $[48] !== hotkeysFontSize || $[49] !== paddingProps || $[50] !== space || $[51] !== text ? (t23 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
5206
+ const setRef = t14, t15 = as !== "button" && pressed ? "" : void 0, t16 = active ? "" : void 0, t17 = disabled ? "" : void 0, t18 = useArrayProp(radius), t19 = useArrayProp(0), t20 = disabled ? "default" : tone, t21 = as === "button" ? "button" : void 0;
5207
+ let t22;
5208
+ $[44] !== IconComponent || $[45] !== IconRightComponent || $[46] !== fontSize2 || $[47] !== hotkeys || $[48] !== hotkeysFontSize || $[49] !== paddingProps || $[50] !== space || $[51] !== text ? (t22 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
5209
5209
  IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
5210
5210
  react.isValidElement(IconComponent) && IconComponent,
5211
5211
  ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
@@ -5219,14 +5219,14 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5219
5219
  react.isValidElement(IconRightComponent) && IconRightComponent,
5220
5220
  ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
5221
5221
  ] })
5222
- ] }), $[44] = IconComponent, $[45] = IconRightComponent, $[46] = fontSize2, $[47] = hotkeys, $[48] = hotkeysFontSize, $[49] = paddingProps, $[50] = space, $[51] = text, $[52] = t23) : t23 = $[52];
5222
+ ] }), $[44] = IconComponent, $[45] = IconRightComponent, $[46] = fontSize2, $[47] = hotkeys, $[48] = hotkeysFontSize, $[49] = paddingProps, $[50] = space, $[51] = text, $[52] = t22) : t22 = $[52];
5223
+ let t23;
5224
+ $[53] !== children || $[54] !== paddingProps ? (t23 = children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...paddingProps, children }), $[53] = children, $[54] = paddingProps, $[55] = t23) : t23 = $[55];
5223
5225
  let t24;
5224
- $[53] !== children || $[54] !== paddingProps ? (t24 = children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...paddingProps, children }), $[53] = children, $[54] = paddingProps, $[55] = t24) : t24 = $[55];
5225
- let t25;
5226
- return $[56] !== as || $[57] !== disabled || $[58] !== handleClick || $[59] !== onItemMouseEnter || $[60] !== onItemMouseLeave || $[61] !== restProps || $[62] !== scheme || $[63] !== t15 || $[64] !== t16 || $[65] !== t17 || $[66] !== t18 || $[67] !== t19 || $[68] !== t20 || $[69] !== t21 || $[70] !== t22 || $[71] !== t23 || $[72] !== t24 ? (t25 = /* @__PURE__ */ jsxRuntime.jsxs(Selectable, { "data-ui": "MenuItem", role: "menuitem", ...restProps, "aria-pressed": t15, "data-pressed": t16, "data-selected": t17, "data-disabled": t18, forwardedAs: as, $radius: t19, $padding: t20, $tone: t21, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, tabIndex: -1, type: t22, children: [
5227
- t23,
5228
- t24
5229
- ] }), $[56] = as, $[57] = disabled, $[58] = handleClick, $[59] = onItemMouseEnter, $[60] = onItemMouseLeave, $[61] = restProps, $[62] = scheme, $[63] = t15, $[64] = t16, $[65] = t17, $[66] = t18, $[67] = t19, $[68] = t20, $[69] = t21, $[70] = t22, $[71] = t23, $[72] = t24, $[73] = t25) : t25 = $[73], t25;
5226
+ return $[56] !== as || $[57] !== disabled || $[58] !== handleClick || $[59] !== onItemMouseEnter || $[60] !== onItemMouseLeave || $[61] !== restProps || $[62] !== scheme || $[63] !== t15 || $[64] !== t16 || $[65] !== t17 || $[66] !== t18 || $[67] !== t19 || $[68] !== t20 || $[69] !== t21 || $[70] !== t22 || $[71] !== t23 ? (t24 = /* @__PURE__ */ jsxRuntime.jsxs(Selectable, { "data-ui": "MenuItem", role: "menuitem", ...restProps, "data-pressed": t15, "data-selected": t16, "data-disabled": t17, forwardedAs: as, $radius: t18, $padding: t19, $tone: t20, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, tabIndex: -1, type: t21, children: [
5227
+ t22,
5228
+ t23
5229
+ ] }), $[56] = as, $[57] = disabled, $[58] = handleClick, $[59] = onItemMouseEnter, $[60] = onItemMouseLeave, $[61] = restProps, $[62] = scheme, $[63] = t15, $[64] = t16, $[65] = t17, $[66] = t18, $[67] = t19, $[68] = t20, $[69] = t21, $[70] = t22, $[71] = t23, $[72] = t24) : t24 = $[72], t24;
5230
5230
  });
5231
5231
  MenuItem.displayName = "ForwardRef(MenuItem)";
5232
5232
  function _temp(s) {