@sanity/ui 3.0.0-static.2 → 3.0.0-static.20

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 (770) hide show
  1. package/README.md +6 -6
  2. package/bin/{ui.js → sanity-ui.cjs} +1 -1
  3. package/dist/_chunks-cjs/_visual-editing.cjs +3152 -0
  4. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
  5. package/dist/_chunks-cjs/buildCommand.cjs +71 -0
  6. package/dist/_chunks-cjs/buildCommand.cjs.map +1 -0
  7. package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -1
  8. package/dist/_chunks-cjs/refractor.cjs.map +1 -0
  9. package/dist/_chunks-es/_visual-editing.js +3163 -0
  10. package/dist/_chunks-es/_visual-editing.js.map +1 -0
  11. package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -1
  12. package/dist/_chunks-es/refractor.js.map +1 -0
  13. package/dist/_visual-editing.cjs +30 -0
  14. package/dist/_visual-editing.cjs.map +1 -0
  15. package/dist/_visual-editing.d.cts +959 -0
  16. package/dist/_visual-editing.d.ts +545 -392
  17. package/dist/_visual-editing.js +29 -30
  18. package/dist/_visual-editing.js.map +1 -1
  19. package/dist/{cli.js → cli.cjs} +4 -4
  20. package/dist/cli.cjs.map +1 -0
  21. package/dist/css.cjs +4353 -0
  22. package/dist/css.cjs.map +1 -0
  23. package/dist/css.d.cts +10251 -0
  24. package/dist/css.d.ts +9714 -1598
  25. package/dist/css.js +3460 -3818
  26. package/dist/css.js.map +1 -1
  27. package/dist/index.cjs +1594 -0
  28. package/dist/index.cjs.map +1 -0
  29. package/dist/{index.d.mts → index.d.cts} +1435 -918
  30. package/dist/index.d.ts +1435 -918
  31. package/dist/index.js +622 -572
  32. package/dist/index.js.map +1 -1
  33. package/dist/{theme.mjs → theme.cjs} +2821 -2570
  34. package/dist/theme.cjs.map +1 -0
  35. package/dist/{theme.d.mts → theme.d.cts} +330 -310
  36. package/dist/theme.d.ts +330 -310
  37. package/dist/theme.js +2822 -2569
  38. package/dist/theme.js.map +1 -1
  39. package/dist/ui-system.css +24528 -0
  40. package/dist/ui-system.min.css +1 -0
  41. package/dist/ui-theme.css +1184 -0
  42. package/dist/ui-theme.min.css +1 -0
  43. package/dist/ui.css +25715 -0
  44. package/dist/ui.min.css +1 -0
  45. package/exports/_visual-editing.ts +0 -1
  46. package/package.json +78 -78
  47. package/src/cli/buildCommand.ts +77 -25
  48. package/src/cli/index.ts +2 -14
  49. package/src/core/StyleTags.tsx +8 -14
  50. package/src/core/_compat/helpers.ts +72 -0
  51. package/src/core/_compat/index.ts +1 -6
  52. package/src/core/_compat/styles/_responsive.ts +1 -1
  53. package/src/core/_compat/theme/theme.test.tsx +4 -5
  54. package/src/core/_compat/theme/themeColorProvider.tsx +4 -8
  55. package/src/core/_compat/theme/themeContext.ts +5 -5
  56. package/src/core/_compat/theme/themeProvider.tsx +19 -11
  57. package/src/core/_compat/theme/types.ts +2 -4
  58. package/src/core/_compat/theme/useRootTheme.ts +2 -4
  59. package/src/core/_compat/theme/useTheme.ts +3 -7
  60. package/src/core/_compat/types.ts +0 -73
  61. package/src/core/components/autocomplete/__workshop__/async.tsx +6 -6
  62. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +11 -18
  63. package/src/core/components/autocomplete/__workshop__/custom.tsx +21 -20
  64. package/src/core/components/autocomplete/__workshop__/example.tsx +17 -17
  65. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +5 -5
  66. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +57 -59
  67. package/src/core/components/autocomplete/autocomplete.tsx +92 -126
  68. package/src/core/components/autocomplete/autocompleteOption.tsx +3 -1
  69. package/src/core/components/autocomplete/autocompleteReducer.ts +1 -1
  70. package/src/core/components/autocomplete/constants.ts +1 -1
  71. package/src/core/components/autocomplete/types.ts +4 -9
  72. package/src/core/components/breadcrumbs/__workshop__/example.tsx +2 -3
  73. package/src/core/components/breadcrumbs/breadcrumbs.tsx +34 -28
  74. package/src/core/components/dialog/__workshop__/activate.tsx +4 -4
  75. package/src/core/components/dialog/__workshop__/autoFocus.tsx +2 -2
  76. package/src/core/components/dialog/__workshop__/onScroll.tsx +16 -4
  77. package/src/core/components/dialog/__workshop__/position.tsx +4 -4
  78. package/src/core/components/dialog/__workshop__/props.tsx +7 -7
  79. package/src/core/components/dialog/__workshop__/wrapped.tsx +2 -2
  80. package/src/core/components/dialog/dialog.tsx +104 -300
  81. package/src/core/components/dialog/dialogCard.tsx +198 -0
  82. package/src/core/components/dialog/dialogContext.ts +1 -1
  83. package/src/core/components/dialog/dialogProvider.tsx +3 -3
  84. package/src/core/components/dialog/isTargetWithinScope.ts +14 -0
  85. package/src/core/components/dialog/useDialog.ts +1 -1
  86. package/src/core/components/hotkeys/hotkeys.tsx +42 -26
  87. package/src/core/components/menu/__workshop__/asComponent.tsx +6 -6
  88. package/src/core/components/menu/__workshop__/closableMenuButton.tsx +5 -4
  89. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +2 -2
  90. package/src/core/components/menu/__workshop__/customMenuItem.tsx +3 -3
  91. package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +1 -1
  92. package/src/core/components/menu/__workshop__/groups.tsx +2 -2
  93. package/src/core/components/menu/__workshop__/menuButton.tsx +4 -4
  94. package/src/core/components/menu/__workshop__/menuGroupRight.tsx +1 -1
  95. package/src/core/components/menu/__workshop__/nestedMenu.tsx +1 -1
  96. package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +13 -4
  97. package/src/core/components/menu/__workshop__/selectedItem.tsx +2 -2
  98. package/src/core/components/menu/__workshop__/tones.tsx +3 -3
  99. package/src/core/components/menu/__workshop__/withoutArrow.tsx +1 -1
  100. package/src/core/components/menu/menu.test.tsx +6 -7
  101. package/src/core/components/menu/menu.tsx +28 -34
  102. package/src/core/components/menu/menuButton.tsx +19 -23
  103. package/src/core/components/menu/menuContext.ts +1 -1
  104. package/src/core/components/menu/menuDivider.tsx +26 -14
  105. package/src/core/components/menu/menuGroup.tsx +39 -31
  106. package/src/core/components/menu/menuItem.tsx +59 -45
  107. package/src/core/components/menu/useMenu.ts +1 -1
  108. package/src/core/components/menu/useMenuController.ts +4 -4
  109. package/src/core/components/skeleton/__workshop__/delay.tsx +3 -3
  110. package/src/core/components/skeleton/__workshop__/skeleton.tsx +4 -4
  111. package/src/core/components/skeleton/codeSkeleton.tsx +53 -0
  112. package/src/core/components/skeleton/headingSkeleton.tsx +52 -0
  113. package/src/core/components/skeleton/index.ts +3 -0
  114. package/src/core/components/skeleton/labelSkeleton.tsx +51 -0
  115. package/src/core/components/skeleton/skeleton.tsx +40 -17
  116. package/src/core/components/skeleton/textSkeleton.tsx +32 -111
  117. package/src/core/components/tab/__workshop__/example.tsx +2 -2
  118. package/src/core/components/tab/tab.tsx +29 -25
  119. package/src/core/components/tab/tabList.tsx +51 -28
  120. package/src/core/components/tab/tabPanel.tsx +30 -21
  121. package/src/core/components/toast/__workshop__/hook.tsx +1 -1
  122. package/src/core/components/toast/__workshop__/toast.tsx +5 -5
  123. package/src/core/components/toast/toast.test.tsx +5 -5
  124. package/src/core/components/toast/toast.tsx +25 -22
  125. package/src/core/components/toast/toastContext.ts +1 -1
  126. package/src/core/components/toast/toastLayer.tsx +29 -11
  127. package/src/core/components/toast/toastProvider.tsx +3 -7
  128. package/src/core/components/toast/types.ts +3 -7
  129. package/src/core/components/toast/useToast.ts +2 -4
  130. package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
  131. package/src/core/components/tree/__workshop__/basic.tsx +1 -1
  132. package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
  133. package/src/core/components/tree/helpers.ts +1 -1
  134. package/src/core/components/tree/tree.tsx +198 -191
  135. package/src/core/components/tree/treeContext.ts +1 -1
  136. package/src/core/components/tree/treeGroup.tsx +26 -6
  137. package/src/core/components/tree/treeItem.tsx +45 -33
  138. package/src/core/components/tree/types.ts +2 -2
  139. package/src/core/components/tree/useTree.ts +1 -1
  140. package/src/core/constants.ts +6 -0
  141. package/src/core/hooks/useClickOutside.test.tsx +15 -16
  142. package/src/core/hooks/useClickOutside.ts +2 -6
  143. package/src/core/hooks/useClickOutsideEvent.test.tsx +4 -5
  144. package/src/core/hooks/useClickOutsideEvent.ts +3 -9
  145. package/src/core/hooks/useDelayed.test.ts +6 -7
  146. package/src/core/hooks/useDelayedState.ts +1 -1
  147. package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -1
  148. package/src/core/hooks/useElementSize.ts +1 -1
  149. package/src/core/hooks/useForwardedRef.ts +1 -1
  150. package/src/core/hooks/useMatchMedia.ts +13 -31
  151. package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +1 -1
  152. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +3 -18
  153. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +12 -12
  154. package/src/core/hooks/usePrefersDark.hydration.test.tsx +4 -4
  155. package/src/core/hooks/usePrefersDark.test.tsx +1 -0
  156. package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +4 -4
  157. package/src/core/hooks/usePrefersReducedMotion.test.tsx +1 -0
  158. package/src/core/middleware/origin.ts +1 -1
  159. package/src/core/primitives/_selectable/selectable.tsx +34 -21
  160. package/src/core/primitives/avatar/__workshop__/asButton.tsx +2 -2
  161. package/src/core/primitives/avatar/__workshop__/stack.tsx +2 -2
  162. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +2 -2
  163. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
  164. package/src/core/primitives/avatar/avatar.tsx +33 -36
  165. package/src/core/primitives/avatar/avatarCounter.tsx +35 -27
  166. package/src/core/primitives/avatar/avatarStack.tsx +35 -28
  167. package/src/core/primitives/avatar/types.ts +3 -3
  168. package/src/core/primitives/badge/__workshop__/props.tsx +6 -17
  169. package/src/core/primitives/badge/__workshop__/tones.tsx +1 -6
  170. package/src/core/primitives/badge/badge.test.tsx +2 -3
  171. package/src/core/primitives/badge/badge.tsx +34 -33
  172. package/src/core/primitives/badge/types.ts +2 -1
  173. package/src/core/primitives/box/__workshop__/props.tsx +2 -2
  174. package/src/core/primitives/box/__workshop__/responsive.tsx +2 -1
  175. package/src/core/primitives/box/box.tsx +76 -31
  176. package/src/core/primitives/button/__workshop__/custom.tsx +19 -42
  177. package/src/core/primitives/button/__workshop__/customIcons.tsx +3 -3
  178. package/src/core/primitives/button/__workshop__/disabled.tsx +9 -9
  179. package/src/core/primitives/button/__workshop__/props.tsx +19 -22
  180. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
  181. package/src/core/primitives/button/__workshop__/stacked.tsx +15 -16
  182. package/src/core/primitives/button/__workshop__/uploadButton.tsx +2 -1
  183. package/src/core/primitives/button/button.test.tsx +3 -18
  184. package/src/core/primitives/button/button.tsx +75 -73
  185. package/src/core/primitives/card/__workshop__/asButton.tsx +14 -14
  186. package/src/core/primitives/card/__workshop__/asComponent.tsx +3 -3
  187. package/src/core/primitives/card/__workshop__/checkered.tsx +1 -1
  188. package/src/core/primitives/card/__workshop__/index.ts +1 -1
  189. package/src/core/primitives/card/__workshop__/interactive.tsx +3 -4
  190. package/src/core/primitives/card/__workshop__/listNavigation.tsx +3 -3
  191. package/src/core/primitives/card/__workshop__/props.tsx +14 -17
  192. package/src/core/primitives/card/__workshop__/selected.tsx +10 -41
  193. package/src/core/primitives/card/__workshop__/{allTones.tsx → tones.tsx} +3 -3
  194. package/src/core/primitives/card/card.tsx +53 -43
  195. package/src/core/primitives/card/cardContext.ts +10 -0
  196. package/src/core/primitives/card/cardProvider.tsx +27 -0
  197. package/src/core/primitives/card/index.ts +2 -0
  198. package/src/core/primitives/card/types.ts +19 -3
  199. package/src/core/primitives/card/useCard.ts +8 -0
  200. package/src/core/primitives/checkbox/__workshop__/props.tsx +6 -4
  201. package/src/core/primitives/checkbox/__workshop__/tones.tsx +11 -20
  202. package/src/core/primitives/checkbox/checkbox.tsx +30 -21
  203. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
  204. package/src/core/primitives/code/__workshop__/props.tsx +4 -7
  205. package/src/core/primitives/code/code.tsx +28 -26
  206. package/src/core/primitives/container/__workshop__/example.tsx +2 -2
  207. package/src/core/primitives/container/container.tsx +29 -18
  208. package/src/core/primitives/flex/__workshop__/example.tsx +2 -2
  209. package/src/core/primitives/flex/flex.tsx +21 -19
  210. package/src/core/primitives/grid/grid.tsx +21 -16
  211. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +2 -2
  212. package/src/core/primitives/heading/__workshop__/plain.tsx +12 -15
  213. package/src/core/primitives/heading/heading.tsx +46 -23
  214. package/src/core/primitives/inline/__workshop__/plain.tsx +2 -5
  215. package/src/core/primitives/inline/inline.tsx +27 -24
  216. package/src/core/primitives/inline/types.ts +1 -0
  217. package/src/core/primitives/kbd/kbd.tsx +29 -27
  218. package/src/core/primitives/label/__workshop__/plain.tsx +8 -17
  219. package/src/core/primitives/label/label.tsx +45 -30
  220. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +6 -6
  221. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +3 -3
  222. package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
  223. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +3 -3
  224. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -4
  225. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +10 -6
  226. package/src/core/primitives/popover/__workshop__/TestStory.tsx +5 -4
  227. package/src/core/primitives/popover/constants.ts +1 -1
  228. package/src/core/primitives/popover/floating-ui/size.ts +2 -2
  229. package/src/core/primitives/popover/helpers.ts +1 -1
  230. package/src/core/primitives/popover/popover.tsx +296 -334
  231. package/src/core/primitives/popover/popoverLayer.tsx +149 -0
  232. package/src/core/primitives/popover/types.ts +3 -2
  233. package/src/core/primitives/radio/__workshop__/example.tsx +3 -3
  234. package/src/core/primitives/radio/__workshop__/plain.tsx +3 -3
  235. package/src/core/primitives/radio/radio.tsx +33 -17
  236. package/src/core/primitives/select/__workshop__/plain.tsx +15 -6
  237. package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
  238. package/src/core/primitives/select/select.tsx +29 -27
  239. package/src/core/primitives/spinner/__workshop__/Props.tsx +4 -5
  240. package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +7 -5
  241. package/src/core/primitives/spinner/spinner.tsx +26 -14
  242. package/src/core/primitives/stack/__workshop__/plain.tsx +2 -2
  243. package/src/core/primitives/stack/stack.tsx +33 -19
  244. package/src/core/primitives/switch/switch.tsx +33 -16
  245. package/src/core/primitives/text/__workshop__/colored.tsx +6 -6
  246. package/src/core/primitives/text/__workshop__/example.tsx +9 -20
  247. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
  248. package/src/core/primitives/text/text.tsx +48 -30
  249. package/src/core/primitives/textArea/__workshop__/plain.tsx +44 -33
  250. package/src/core/primitives/textArea/textArea.tsx +48 -21
  251. package/src/core/primitives/textInput/__workshop__/customValidity.tsx +2 -2
  252. package/src/core/primitives/textInput/__workshop__/plain.tsx +36 -30
  253. package/src/core/primitives/textInput/__workshop__/states.tsx +5 -5
  254. package/src/core/primitives/textInput/__workshop__/tones.tsx +2 -2
  255. package/src/core/primitives/textInput/__workshop__/typed.tsx +2 -2
  256. package/src/core/primitives/textInput/textInput.tsx +52 -71
  257. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +5 -5
  258. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +2 -2
  259. package/src/core/primitives/tooltip/__workshop__/props.tsx +9 -8
  260. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
  261. package/src/core/primitives/tooltip/constants.ts +1 -1
  262. package/src/core/primitives/tooltip/tooltip.test.tsx +61 -60
  263. package/src/core/primitives/tooltip/tooltip.tsx +112 -87
  264. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +1 -1
  265. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +3 -3
  266. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -1
  267. package/src/core/primitives/tooltip/tooltipLayer.tsx +107 -0
  268. package/src/core/primitives/types.ts +16 -27
  269. package/src/core/types/avatar.ts +3 -6
  270. package/src/core/types/badge.ts +2 -4
  271. package/src/core/types/button.ts +2 -4
  272. package/src/core/types/card.ts +2 -4
  273. package/src/core/types/dialog.ts +1 -3
  274. package/src/core/types/props.ts +20 -10
  275. package/src/core/types/selectable.ts +1 -1
  276. package/src/core/utils/arrow/arrow.tsx +37 -28
  277. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +5 -5
  278. package/src/core/utils/boundaryElement/boundaryElementContext.ts +1 -1
  279. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +4 -8
  280. package/src/core/utils/boundaryElement/types.ts +1 -3
  281. package/src/core/utils/boundaryElement/useBoundaryElement.ts +2 -4
  282. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +15 -8
  283. package/src/core/utils/elementQuery/elementQuery.tsx +43 -19
  284. package/src/core/utils/errorBoundary.tsx +6 -4
  285. package/src/core/utils/index.ts +0 -1
  286. package/src/core/utils/layer/__workshop__/multipleRoots.tsx +5 -5
  287. package/src/core/utils/layer/__workshop__/nested.tsx +3 -3
  288. package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +9 -5
  289. package/src/core/utils/layer/getLayerContext.test.ts +3 -1
  290. package/src/core/utils/layer/getLayerContext.ts +1 -1
  291. package/src/core/utils/layer/layer.test.tsx +5 -5
  292. package/src/core/utils/layer/layer.tsx +24 -94
  293. package/src/core/utils/layer/layerCard.tsx +92 -0
  294. package/src/core/utils/layer/layerContext.ts +1 -1
  295. package/src/core/utils/layer/layerProvider.tsx +13 -9
  296. package/src/core/utils/layer/useLayer.ts +2 -4
  297. package/src/core/utils/portal/__workshop__/named.tsx +3 -3
  298. package/src/core/utils/portal/portal.test.tsx +5 -5
  299. package/src/core/utils/portal/{portal.ts → portal.tsx} +17 -9
  300. package/src/core/utils/portal/portalContext.ts +1 -1
  301. package/src/core/utils/portal/portalProvider.tsx +4 -8
  302. package/src/core/utils/portal/types.ts +1 -3
  303. package/src/core/utils/portal/usePortal.ts +2 -4
  304. package/src/core/utils/srOnly/srOnly.tsx +27 -22
  305. package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +1 -1
  306. package/src/core/utils/virtualList/virtualList.tsx +72 -54
  307. package/src/css/_assign.ts +3 -0
  308. package/src/css/_compileStyle.ts +156 -0
  309. package/src/css/_compileSystem.ts +7 -0
  310. package/src/css/_compileTheme.ts +13 -0
  311. package/src/css/_composeClassNames.ts +12 -0
  312. package/src/css/_fromEntries.ts +3 -0
  313. package/src/css/_getClassNames.ts +9 -0
  314. package/src/css/_hash.ts +9 -0
  315. package/src/css/_mergeStyles.ts +24 -0
  316. package/src/css/_resp.ts +2 -2
  317. package/src/css/_responsiveRule.ts +38 -0
  318. package/src/css/_scopeClassName.ts +9 -0
  319. package/src/css/_scopeClassNames.ts +12 -0
  320. package/src/css/_system.style.ts +166 -0
  321. package/src/css/aspects/border/border.style.ts +13 -0
  322. package/src/css/aspects/border/border.ts +14 -0
  323. package/src/css/{styles → aspects}/border/types.ts +1 -1
  324. package/src/css/aspects/boxSizing/boxSizing.style.ts +10 -0
  325. package/src/css/aspects/boxSizing/boxSizing.ts +8 -0
  326. package/src/css/aspects/boxSizing/index.ts +2 -0
  327. package/src/css/aspects/boxSizing/types.ts +9 -0
  328. package/src/css/aspects/display/display.style.ts +34 -0
  329. package/src/css/aspects/display/display.ts +8 -0
  330. package/src/css/{styles → aspects}/display/types.ts +3 -4
  331. package/src/css/aspects/flex/flex.ts +13 -0
  332. package/src/css/aspects/flex/flexAlign.style.ts +12 -0
  333. package/src/css/aspects/flex/flexDirection.style.ts +11 -0
  334. package/src/css/aspects/flex/flexJustify.style.ts +13 -0
  335. package/src/css/aspects/flex/flexWrap.style.ts +10 -0
  336. package/src/css/{styles → aspects}/flex/types.ts +5 -13
  337. package/src/css/aspects/flexItem/flex.style.ts +22 -0
  338. package/src/css/aspects/flexItem/flexItem.ts +8 -0
  339. package/src/css/aspects/flexItem/types.ts +25 -0
  340. package/src/css/aspects/font/font.style.ts +83 -0
  341. package/src/css/aspects/font/font.ts +7 -0
  342. package/src/css/aspects/font/types.ts +6 -0
  343. package/src/css/aspects/gap/gap.style.ts +21 -0
  344. package/src/css/aspects/gap/gap.ts +8 -0
  345. package/src/css/{styles → aspects}/gap/types.ts +2 -2
  346. package/src/css/{styles → aspects}/grid/grid.ts +6 -5
  347. package/src/css/aspects/grid/gridAutoColumns.style.ts +11 -0
  348. package/src/css/aspects/grid/gridAutoFlow.style.ts +11 -0
  349. package/src/css/aspects/grid/gridAutoRows.style.ts +11 -0
  350. package/src/css/aspects/grid/gridColumns.style.ts +18 -0
  351. package/src/css/aspects/grid/gridRows.style.ts +18 -0
  352. package/src/css/{styles → aspects}/grid/types.ts +8 -12
  353. package/src/css/aspects/gridItem/gridColumn.style.ts +20 -0
  354. package/src/css/aspects/gridItem/gridColumnEnd.style.ts +20 -0
  355. package/src/css/aspects/gridItem/gridColumnStart.style.ts +20 -0
  356. package/src/css/{styles → aspects}/gridItem/gridItem.ts +4 -4
  357. package/src/css/aspects/gridItem/gridRow.style.ts +20 -0
  358. package/src/css/aspects/gridItem/gridRowEnd.style.ts +20 -0
  359. package/src/css/aspects/gridItem/gridRowStart.style.ts +20 -0
  360. package/src/css/{styles → aspects}/gridItem/types.ts +8 -19
  361. package/src/css/aspects/height/height.style.ts +9 -0
  362. package/src/css/aspects/height/height.ts +16 -0
  363. package/src/css/aspects/height/index.ts +1 -0
  364. package/src/css/{styles → aspects}/index.ts +5 -0
  365. package/src/css/aspects/inset/inset.style.ts +12 -0
  366. package/src/css/{styles → aspects}/inset/inset.ts +4 -3
  367. package/src/css/{styles → aspects}/inset/types.ts +1 -1
  368. package/src/css/aspects/margin/margin.style.ts +56 -0
  369. package/src/css/{styles → aspects}/margin/margin.ts +4 -3
  370. package/src/css/aspects/margin/types.ts +17 -0
  371. package/src/css/aspects/maxWidth/maxWidth.style.ts +16 -0
  372. package/src/css/aspects/maxWidth/maxWidth.ts +8 -0
  373. package/src/css/aspects/maxWidth/types.ts +8 -0
  374. package/src/css/aspects/minHeight/index.ts +2 -0
  375. package/src/css/aspects/minHeight/minHeight.style.ts +9 -0
  376. package/src/css/aspects/minHeight/minHeight.ts +8 -0
  377. package/src/css/aspects/minHeight/types.ts +9 -0
  378. package/src/css/aspects/minWidth/index.ts +2 -0
  379. package/src/css/aspects/minWidth/minWidth.style.ts +13 -0
  380. package/src/css/aspects/minWidth/minWidth.ts +8 -0
  381. package/src/css/aspects/minWidth/types.ts +9 -0
  382. package/src/css/aspects/outline/outline.style.ts +9 -0
  383. package/src/css/aspects/overflow/overflow.style.ts +11 -0
  384. package/src/css/{styles → aspects}/overflow/overflow.ts +4 -3
  385. package/src/css/{styles → aspects}/overflow/types.ts +1 -1
  386. package/src/css/aspects/padding/padding.style.ts +43 -0
  387. package/src/css/{styles → aspects}/padding/padding.ts +4 -3
  388. package/src/css/{styles → aspects}/padding/types.ts +2 -2
  389. package/src/css/aspects/pointerEvents/pointerEvents.style.ts +13 -0
  390. package/src/css/aspects/pointerEvents/pointerEvents.ts +7 -0
  391. package/src/css/aspects/position/position.style.ts +12 -0
  392. package/src/css/aspects/position/position.ts +8 -0
  393. package/src/css/{styles → aspects}/position/types.ts +1 -1
  394. package/src/css/aspects/radius/radius.style.ts +16 -0
  395. package/src/css/aspects/radius/radius.ts +8 -0
  396. package/src/css/aspects/radius/types.ts +8 -0
  397. package/src/css/aspects/shadow/shadow.style.ts +24 -0
  398. package/src/css/aspects/shadow/shadow.ts +8 -0
  399. package/src/css/aspects/shadow/types.ts +8 -0
  400. package/src/css/aspects/textAlign/index.ts +2 -0
  401. package/src/css/aspects/textAlign/textAlign.style.ts +26 -0
  402. package/src/css/aspects/textAlign/textAlign.ts +8 -0
  403. package/src/css/aspects/textAlign/types.ts +7 -0
  404. package/src/css/aspects/textOverflow/textOverflow.style.ts +21 -0
  405. package/src/css/aspects/textOverflow/textOverflow.ts +7 -0
  406. package/src/css/{styles → aspects}/textOverflow/types.ts +1 -0
  407. package/src/css/aspects/width/types.ts +11 -0
  408. package/src/css/aspects/width/width.style.ts +11 -0
  409. package/src/css/aspects/width/width.ts +8 -0
  410. package/src/css/components/breadcrumbs/breadcrumbs.style.ts +9 -0
  411. package/src/css/components/breadcrumbs/breadcrumbs.ts +3 -2
  412. package/src/css/components/dialog/dialog.style.ts +77 -0
  413. package/src/css/components/dialog/dialog.ts +17 -8
  414. package/src/css/components/menu/menu.style.ts +17 -0
  415. package/src/css/components/menu/menu.ts +5 -3
  416. package/src/css/components/skeleton/skeleton.style.ts +104 -0
  417. package/src/css/components/skeleton/skeleton.ts +13 -8
  418. package/src/css/components/skeleton/types.ts +8 -6
  419. package/src/css/components/toast/toast.style.ts +20 -0
  420. package/src/css/components/toast/toast.ts +11 -6
  421. package/src/css/components/tree/tree.style.ts +39 -0
  422. package/src/css/components/tree/tree.ts +3 -2
  423. package/src/css/constants.ts +10 -0
  424. package/src/css/index.ts +8 -8
  425. package/src/css/prefix/constants.ts +6 -0
  426. package/src/css/prefix/types.ts +1 -0
  427. package/src/css/primitives/_arrow/{rules.ts → _arrow.style.ts} +23 -25
  428. package/src/css/primitives/_arrow/_arrow.ts +13 -6
  429. package/src/css/primitives/_input/_input.style.ts +235 -0
  430. package/src/css/primitives/_input/input.ts +18 -13
  431. package/src/css/primitives/_input/types.ts +3 -3
  432. package/src/css/primitives/_selectable/{rules.ts → _selectable.style.ts} +36 -36
  433. package/src/css/primitives/_selectable/selectable.ts +5 -5
  434. package/src/css/primitives/_selectable/types.ts +2 -2
  435. package/src/css/primitives/avatar/{rules.ts → avatar.style.ts} +62 -67
  436. package/src/css/primitives/avatar/avatar.ts +14 -8
  437. package/src/css/primitives/avatar/types.ts +4 -3
  438. package/src/css/primitives/badge/badge.style.ts +21 -0
  439. package/src/css/primitives/badge/badge.ts +8 -4
  440. package/src/css/primitives/badge/types.ts +2 -2
  441. package/src/css/primitives/box/box.style.ts +22 -0
  442. package/src/css/primitives/box/box.ts +16 -10
  443. package/src/css/primitives/box/types.ts +12 -15
  444. package/src/css/primitives/button/button.style.ts +275 -0
  445. package/src/css/primitives/button/button.ts +9 -30
  446. package/src/css/primitives/button/index.ts +1 -0
  447. package/src/css/primitives/button/types.ts +13 -0
  448. package/src/css/primitives/card/card.style.ts +295 -0
  449. package/src/css/primitives/card/card.ts +7 -11
  450. package/src/css/primitives/card/types.ts +4 -5
  451. package/src/css/primitives/checkbox/checkbox.style.ts +178 -0
  452. package/src/css/primitives/checkbox/checkbox.ts +5 -3
  453. package/src/css/primitives/code/code.style.ts +61 -0
  454. package/src/css/primitives/code/code.ts +8 -4
  455. package/src/css/primitives/code/types.ts +2 -2
  456. package/src/css/primitives/container/container.style.ts +10 -0
  457. package/src/css/primitives/container/container.ts +6 -4
  458. package/src/css/primitives/container/types.ts +3 -2
  459. package/src/css/primitives/heading/heading.style.ts +56 -0
  460. package/src/css/primitives/heading/heading.ts +13 -10
  461. package/src/css/primitives/heading/types.ts +4 -2
  462. package/src/css/primitives/kbd/kbd.style.ts +19 -0
  463. package/src/css/primitives/kbd/kbd.ts +6 -4
  464. package/src/css/primitives/kbd/types.ts +1 -1
  465. package/src/css/primitives/label/label.style.ts +52 -0
  466. package/src/css/primitives/label/label.ts +7 -9
  467. package/src/css/primitives/label/types.ts +11 -4
  468. package/src/css/primitives/popover/popover.style.ts +9 -0
  469. package/src/css/primitives/popover/popover.ts +8 -2
  470. package/src/css/primitives/radio/radio.style.ts +84 -0
  471. package/src/css/primitives/radio/radio.ts +3 -2
  472. package/src/css/primitives/select/{rules.ts → select.style.ts} +8 -6
  473. package/src/css/primitives/select/select.ts +7 -4
  474. package/src/css/primitives/select/types.ts +1 -1
  475. package/src/css/primitives/spinner/spinner.style.ts +22 -0
  476. package/src/css/primitives/spinner/spinner.ts +5 -3
  477. package/src/css/primitives/stack/index.ts +1 -0
  478. package/src/css/primitives/stack/stack.style.ts +13 -0
  479. package/src/css/primitives/stack/stack.ts +6 -0
  480. package/src/css/primitives/switch/switch.style.ts +102 -0
  481. package/src/css/primitives/switch/switch.ts +11 -6
  482. package/src/css/primitives/text/text.style.ts +65 -0
  483. package/src/css/primitives/text/text.ts +7 -9
  484. package/src/css/primitives/text/types.ts +7 -2
  485. package/src/css/primitives/textArea/textArea.style.ts +11 -0
  486. package/src/css/primitives/textArea/textArea.ts +5 -3
  487. package/src/css/primitives/textArea/types.ts +1 -1
  488. package/src/css/primitives/textInput/textInput.style.ts +46 -0
  489. package/src/css/primitives/textInput/textInput.ts +20 -4
  490. package/src/css/primitives/textInput/types.ts +2 -8
  491. package/src/css/primitives/token/token.style.ts +50 -0
  492. package/src/css/primitives/tooltip/tooltip.style.ts +9 -0
  493. package/src/css/primitives/tooltip/tooltip.ts +3 -6
  494. package/src/css/renderColor.ts +31 -0
  495. package/src/css/responsiveRules.ts +12 -19
  496. package/src/css/theme/index.ts +14 -0
  497. package/src/css/theme/lib/contract/buildVarContract.ts +76 -0
  498. package/src/css/theme/lib/contract/index.ts +2 -0
  499. package/src/css/theme/lib/contract/types.ts +15 -0
  500. package/src/css/theme/resolveTheme.ts +863 -0
  501. package/src/css/types.ts +29 -755
  502. package/src/css/util.ts +5 -0
  503. package/src/css/utils/srOnly/srOnly.style.ts +14 -0
  504. package/src/css/utils/srOnly/srOnly.ts +4 -2
  505. package/src/theme/getScopedTheme.ts +4 -4
  506. package/src/theme/index.ts +0 -5
  507. package/src/theme/types.ts +6 -10
  508. package/src/theme/v0/color/_generic.ts +1 -1
  509. package/src/theme/v0/color/button.ts +1 -1
  510. package/src/theme/v0/color/card.ts +1 -1
  511. package/src/theme/v0/color/color.ts +11 -11
  512. package/src/theme/v0/color/input.ts +1 -1
  513. package/src/theme/v0/color/muted.ts +1 -1
  514. package/src/theme/v0/color/selectable.ts +1 -1
  515. package/src/theme/v0/color/solid.ts +1 -1
  516. package/src/theme/v0/color/spot.ts +1 -1
  517. package/src/theme/v0/focusRing.ts +1 -3
  518. package/src/theme/v0/font.ts +6 -19
  519. package/src/theme/v0/layer.ts +1 -3
  520. package/src/theme/v0/shadow.ts +2 -6
  521. package/src/theme/v0/styles.ts +1 -1
  522. package/src/theme/v0/theme.ts +7 -7
  523. package/src/theme/v2/avatar.ts +2 -4
  524. package/src/theme/{build → v2/build}/_deprecated/color/_selectable/createSelectableTones.ts +3 -3
  525. package/src/theme/{build → v2/build}/_deprecated/color/_solid/createSolidTones.ts +2 -2
  526. package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonModes.ts +7 -2
  527. package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonTones.ts +4 -4
  528. package/src/theme/{build → v2/build}/_deprecated/color/card/createCardStates.ts +3 -3
  529. package/src/theme/{build → v2/build}/_deprecated/color/color.test.ts +1 -1
  530. package/src/theme/{build → v2/build}/_deprecated/color/defaults.ts +1 -1
  531. package/src/theme/{build → v2/build}/_deprecated/color/factory.ts +3 -3
  532. package/src/theme/{build → v2/build}/_deprecated/color/input/createInputModes.ts +7 -2
  533. package/src/theme/{build → v2/build}/_deprecated/color/muted/createMuted.ts +2 -2
  534. package/src/theme/{build → v2/build}/_deprecated/color/spot/createSpot.ts +2 -2
  535. package/src/theme/{build → v2/build}/buildColorTheme.test.ts +3 -1
  536. package/src/theme/{build → v2/build}/buildColorTheme.ts +24 -24
  537. package/src/theme/{build → v2/build}/buildTheme.test.ts +10 -8
  538. package/src/theme/v2/build/buildTheme.ts +12 -0
  539. package/src/theme/{build → v2/build}/colorToken/colorToken.ts +2 -2
  540. package/src/theme/{build → v2/build}/colorToken/compileColorToken.ts +1 -1
  541. package/src/theme/{build → v2/build}/colorToken/types.ts +2 -2
  542. package/src/theme/{build → v2/build}/lib/color-fns/blend/mix.ts +1 -1
  543. package/src/theme/{build → v2/build}/lib/color-fns/blend/multiply.ts +1 -1
  544. package/src/theme/{build → v2/build}/lib/color-fns/blend/screen.ts +1 -1
  545. package/src/theme/{build → v2/build}/lib/color-fns/color-fns.test.ts +1 -1
  546. package/src/theme/{build → v2/build}/lib/color-fns/contrastRatio.ts +5 -2
  547. package/src/theme/{build → v2/build}/lib/color-fns/convert.ts +1 -1
  548. package/src/theme/{build → v2/build}/lib/color-fns/parse.ts +1 -1
  549. package/src/theme/{build → v2/build}/mixThemeColor.test.ts +2 -0
  550. package/src/theme/{build → v2/build}/mixThemeColor.ts +1 -1
  551. package/src/theme/{build → v2/build}/renderColorTheme.ts +27 -27
  552. package/src/theme/{build → v2/build}/renderColorValue.ts +3 -3
  553. package/src/theme/{build → v2/build}/resolveColorTokens.ts +13 -13
  554. package/src/theme/v2/color/_helpers.ts +2 -2
  555. package/src/theme/v2/color/_system.ts +2 -4
  556. package/src/theme/v2/color/avatar.ts +3 -7
  557. package/src/theme/v2/color/badge.ts +3 -7
  558. package/src/theme/v2/color/button.ts +5 -11
  559. package/src/theme/v2/color/color.ts +10 -16
  560. package/src/theme/v2/color/input.ts +8 -10
  561. package/src/theme/v2/color/kbd.ts +1 -3
  562. package/src/theme/v2/color/selectable.ts +4 -8
  563. package/src/theme/v2/color/state.ts +5 -7
  564. package/src/theme/v2/color/syntax.ts +1 -3
  565. package/src/theme/{config → v2/config}/helpers.ts +6 -13
  566. package/src/theme/{config → v2/config}/system.ts +11 -12
  567. package/src/theme/{config → v2/config}/tokens/color/types.ts +14 -10
  568. package/src/theme/{config → v2/config}/tokens/index.ts +0 -1
  569. package/src/theme/{config → v2/config}/tokens/parseTokenValue.test.ts +2 -0
  570. package/src/theme/{config → v2/config}/tokens/parseTokenValue.ts +2 -2
  571. package/src/theme/{config → v2/config}/tokens/types.ts +3 -3
  572. package/src/theme/{config → v2/config}/types.ts +8 -6
  573. package/src/theme/{defaults → v2/defaults}/colorPalette.ts +1 -1
  574. package/src/theme/{defaults → v2/defaults}/colorTokens.ts +3 -3
  575. package/src/theme/{defaults → v2/defaults}/config.ts +2 -2
  576. package/src/theme/{defaults → v2/defaults}/fonts.ts +5 -6
  577. package/src/theme/v2/index.ts +2 -0
  578. package/src/theme/v2/input.ts +2 -4
  579. package/src/theme/v2/theme.ts +10 -14
  580. package/src/theme/{_constants.ts → v3/_constants.ts} +6 -3
  581. package/src/theme/v3/{color/parseColor.ts → _parseColorToken.ts} +59 -46
  582. package/src/theme/v3/buildTheme_v3.ts +14 -10
  583. package/src/theme/v3/color/_constants.ts +15 -0
  584. package/src/theme/v3/color/avatar.ts +14 -0
  585. package/src/theme/v3/color/card.ts +58 -95
  586. package/src/theme/v3/color/color.ts +75 -71
  587. package/src/theme/v3/color/element.ts +8 -8
  588. package/src/theme/v3/color/index.ts +2 -2
  589. package/src/theme/v3/color/token.ts +19 -4
  590. package/src/theme/v3/color/tokens.ts +2 -2
  591. package/src/theme/v3/defaultFonts.ts +250 -0
  592. package/src/theme/v3/defaultTokens.ts +199 -0
  593. package/src/theme/v3/index.ts +4 -1
  594. package/src/theme/{palette → v3/palette}/constants.ts +3 -3
  595. package/src/theme/v3/palette/index.ts +2 -0
  596. package/src/theme/v3/palette/types.ts +7 -0
  597. package/src/theme/v3/resolveTokens.ts +70 -65
  598. package/src/theme/v3/tokens.ts +2 -2
  599. package/src/theme/v3/types.ts +95 -11
  600. package/src/theme/versioning/getTheme_v2.ts +3 -3
  601. package/src/theme/versioning/is_v0.ts +2 -2
  602. package/src/theme/versioning/is_v2.ts +2 -2
  603. package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
  604. package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -1
  605. package/src/theme/versioning/themeColor_v3_v2.ts +229 -52
  606. package/src/theme/versioning/v0_v2.ts +3 -3
  607. package/src/theme/versioning/v2_v0.ts +4 -4
  608. package/src/theme/versioning/v3_v2.ts +39 -38
  609. package/dist/_chunks-cjs/_visual-editing.js +0 -3059
  610. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  611. package/dist/_chunks-cjs/buildCommand.js +0 -32
  612. package/dist/_chunks-cjs/buildCommand.js.map +0 -1
  613. package/dist/_chunks-cjs/refractor.js.map +0 -1
  614. package/dist/_chunks-cjs/v3_v2.js +0 -251
  615. package/dist/_chunks-cjs/v3_v2.js.map +0 -1
  616. package/dist/_chunks-es/_visual-editing.mjs +0 -3066
  617. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  618. package/dist/_chunks-es/refractor.mjs.map +0 -1
  619. package/dist/_chunks-es/v3_v2.mjs +0 -252
  620. package/dist/_chunks-es/v3_v2.mjs.map +0 -1
  621. package/dist/_visual-editing.d.mts +0 -806
  622. package/dist/_visual-editing.mjs +0 -31
  623. package/dist/_visual-editing.mjs.map +0 -1
  624. package/dist/cli.js.map +0 -1
  625. package/dist/css.d.mts +0 -2135
  626. package/dist/css.mjs +0 -4713
  627. package/dist/css.mjs.map +0 -1
  628. package/dist/index.mjs +0 -1542
  629. package/dist/index.mjs.map +0 -1
  630. package/dist/sanity-palette.css +0 -9
  631. package/dist/sanity-theme.css +0 -1
  632. package/dist/system.css +0 -3577
  633. package/dist/theme.mjs.map +0 -1
  634. package/src/core/primitives/popover/popoverCard.tsx +0 -148
  635. package/src/core/primitives/tooltip/tooltipCard.tsx +0 -115
  636. package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
  637. package/src/core/utils/conditionalWrapper/index.ts +0 -1
  638. package/src/css/compile/compilePalette.ts +0 -60
  639. package/src/css/compile/compileRule.ts +0 -90
  640. package/src/css/compile/compileRules.test.ts +0 -35
  641. package/src/css/compile/compileRules.ts +0 -40
  642. package/src/css/compile/compileSystem.ts +0 -7
  643. package/src/css/compile/compileTheme.ts +0 -15
  644. package/src/css/compile/compileTheme_v3.ts +0 -410
  645. package/src/css/compile/types.ts +0 -6
  646. package/src/css/components/breadcrumbs/rules.ts +0 -25
  647. package/src/css/components/dialog/rules.ts +0 -76
  648. package/src/css/components/menu/rules.ts +0 -15
  649. package/src/css/components/skeleton/rules.ts +0 -112
  650. package/src/css/components/toast/rules.ts +0 -17
  651. package/src/css/components/tree/rules.ts +0 -168
  652. package/src/css/composeClassNames.ts +0 -13
  653. package/src/css/primitives/_input/rules.ts +0 -163
  654. package/src/css/primitives/_selectable/__style.ts +0 -117
  655. package/src/css/primitives/_selectable/_contants.ts +0 -11
  656. package/src/css/primitives/badge/rules.ts +0 -22
  657. package/src/css/primitives/box/rules.ts +0 -28
  658. package/src/css/primitives/button/_constants.ts +0 -17
  659. package/src/css/primitives/button/rules.ts +0 -293
  660. package/src/css/primitives/card/_constants.ts +0 -13
  661. package/src/css/primitives/card/rules.ts +0 -471
  662. package/src/css/primitives/checkbox/__styles.ts +0 -129
  663. package/src/css/primitives/checkbox/rules.ts +0 -152
  664. package/src/css/primitives/code/rules.ts +0 -96
  665. package/src/css/primitives/container/rules.ts +0 -8
  666. package/src/css/primitives/heading/rules.ts +0 -155
  667. package/src/css/primitives/kbd/rules.ts +0 -20
  668. package/src/css/primitives/label/rules.ts +0 -137
  669. package/src/css/primitives/popover/rules.ts +0 -5
  670. package/src/css/primitives/radio/rules.ts +0 -121
  671. package/src/css/primitives/spinner/rules.ts +0 -20
  672. package/src/css/primitives/switch/rules.ts +0 -340
  673. package/src/css/primitives/text/rules.ts +0 -164
  674. package/src/css/primitives/textArea/rules.ts +0 -7
  675. package/src/css/primitives/textInput/rules.ts +0 -224
  676. package/src/css/primitives/token/rules.ts +0 -45
  677. package/src/css/primitives/tooltip/rules.ts +0 -19
  678. package/src/css/rules.ts +0 -113
  679. package/src/css/styles/border/border.ts +0 -22
  680. package/src/css/styles/border/rules.ts +0 -24
  681. package/src/css/styles/display/display.ts +0 -7
  682. package/src/css/styles/display/rules.ts +0 -62
  683. package/src/css/styles/flex/flex.ts +0 -20
  684. package/src/css/styles/flex/rules.ts +0 -28
  685. package/src/css/styles/flexItem/flexItem.ts +0 -8
  686. package/src/css/styles/flexItem/rules.ts +0 -12
  687. package/src/css/styles/flexItem/types.ts +0 -11
  688. package/src/css/styles/font/font.ts +0 -17
  689. package/src/css/styles/font/rules.ts +0 -148
  690. package/src/css/styles/font/types.ts +0 -12
  691. package/src/css/styles/gap/gap.ts +0 -8
  692. package/src/css/styles/gap/rules.ts +0 -34
  693. package/src/css/styles/grid/rules.ts +0 -146
  694. package/src/css/styles/gridItem/rules.ts +0 -96
  695. package/src/css/styles/height/rules.ts +0 -7
  696. package/src/css/styles/inset/rules.ts +0 -16
  697. package/src/css/styles/margin/rules.ts +0 -64
  698. package/src/css/styles/margin/types.ts +0 -11
  699. package/src/css/styles/maxWidth/maxWidth.ts +0 -6
  700. package/src/css/styles/maxWidth/rules.ts +0 -13
  701. package/src/css/styles/maxWidth/types.ts +0 -7
  702. package/src/css/styles/outline/rules.ts +0 -7
  703. package/src/css/styles/overflow/rules.ts +0 -9
  704. package/src/css/styles/padding/rules.ts +0 -62
  705. package/src/css/styles/pointerEvents/pointerEvents.ts +0 -6
  706. package/src/css/styles/pointerEvents/rules.ts +0 -11
  707. package/src/css/styles/position/position.ts +0 -7
  708. package/src/css/styles/position/rules.ts +0 -24
  709. package/src/css/styles/radius/radius.ts +0 -8
  710. package/src/css/styles/radius/rules.ts +0 -13
  711. package/src/css/styles/radius/types.ts +0 -8
  712. package/src/css/styles/shadow/rules.ts +0 -53
  713. package/src/css/styles/shadow/shadow.ts +0 -7
  714. package/src/css/styles/shadow/types.ts +0 -8
  715. package/src/css/styles/textOverflow/rules.ts +0 -17
  716. package/src/css/styles/textOverflow/textOverflow.ts +0 -6
  717. package/src/css/styles/width/rules.ts +0 -7
  718. package/src/css/styles/width/types.ts +0 -9
  719. package/src/css/styles/width/width.ts +0 -6
  720. package/src/css/utils/srOnly/rules.ts +0 -11
  721. package/src/css/varNames.ts +0 -473
  722. package/src/css/vars.ts +0 -443
  723. package/src/theme/_types.ts +0 -41
  724. package/src/theme/build/buildTheme.ts +0 -12
  725. package/src/theme/build/theme.test.ts +0 -27
  726. package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
  727. package/src/theme/config/tokens/parseTokenKey.ts +0 -67
  728. package/src/theme/palette/types.ts +0 -16
  729. package/src/theme/v3/buildTheme_v3.test.ts +0 -40
  730. package/src/theme/v3/color/buildColor_v3.ts +0 -193
  731. package/src/theme/v3/color/parseColor.test.ts +0 -79
  732. package/src/theme/v3/color/renderColor.test.ts +0 -19
  733. package/src/theme/v3/color/renderColor.ts +0 -33
  734. package/src/theme/v3/defaults.ts +0 -205
  735. /package/dist/{cli.d.ts → cli.d.cts} +0 -0
  736. /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/apiStore.ts +0 -0
  737. /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/countries.ts +0 -0
  738. /package/src/css/{styles → aspects}/border/index.ts +0 -0
  739. /package/src/css/{styles → aspects}/display/index.ts +0 -0
  740. /package/src/css/{styles → aspects}/flex/index.ts +0 -0
  741. /package/src/css/{styles → aspects}/flexItem/index.ts +0 -0
  742. /package/src/css/{styles → aspects}/font/index.ts +0 -0
  743. /package/src/css/{styles → aspects}/gap/index.ts +0 -0
  744. /package/src/css/{styles → aspects}/grid/index.ts +0 -0
  745. /package/src/css/{styles → aspects}/gridItem/index.ts +0 -0
  746. /package/src/css/{styles → aspects}/inset/index.ts +0 -0
  747. /package/src/css/{styles → aspects}/margin/index.ts +0 -0
  748. /package/src/css/{styles → aspects}/maxWidth/index.ts +0 -0
  749. /package/src/css/{styles → aspects}/overflow/index.ts +0 -0
  750. /package/src/css/{styles → aspects}/padding/index.ts +0 -0
  751. /package/src/css/{styles → aspects}/pointerEvents/index.ts +0 -0
  752. /package/src/css/{styles → aspects}/pointerEvents/types.ts +0 -0
  753. /package/src/css/{styles → aspects}/position/index.ts +0 -0
  754. /package/src/css/{styles → aspects}/radius/index.ts +0 -0
  755. /package/src/css/{styles → aspects}/shadow/index.ts +0 -0
  756. /package/src/css/{styles → aspects}/textOverflow/index.ts +0 -0
  757. /package/src/css/{styles → aspects}/width/index.ts +0 -0
  758. /package/src/{theme/palette → css/prefix}/index.ts +0 -0
  759. /package/src/theme/{build → v2/build}/_deprecated/color/index.ts +0 -0
  760. /package/src/theme/{build → v2/build}/colorToken/index.ts +0 -0
  761. /package/src/theme/{build → v2/build}/index.ts +0 -0
  762. /package/src/theme/{build → v2/build}/lib/color-fns/blend/index.ts +0 -0
  763. /package/src/theme/{build → v2/build}/lib/color-fns/index.ts +0 -0
  764. /package/src/theme/{build → v2/build}/lib/color-fns/rgba.ts +0 -0
  765. /package/src/theme/{build → v2/build}/lib/color-fns/types.ts +0 -0
  766. /package/src/theme/{build → v2/build}/lib/isRecord.ts +0 -0
  767. /package/src/theme/{build → v2/build}/lib/utils.ts +0 -0
  768. /package/src/theme/{build → v2/build}/merge.ts +0 -0
  769. /package/src/theme/{config → v2/config}/index.ts +0 -0
  770. /package/src/theme/{config → v2/config}/tokens/color/index.ts +0 -0
package/dist/index.js CHANGED
@@ -1,6 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: !0 });
3
- var _visualEditing = require("./_chunks-cjs/_visual-editing.js"), css = require("@sanity/ui/css"), jsxRuntime = require("react/jsx-runtime"), icons = require("@sanity/icons"), react = require("react"), reactCompilerRuntime = require("react-compiler-runtime"), framerMotion = require("framer-motion"), theme = require("@sanity/ui/theme");
1
+ import { createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1 } from "@sanity/ui/theme";
2
+ import { isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, isHTMLElement, EMPTY_ARRAY, useElementSize, Code, _isEnterToClickElement, Card, Text, useArrayProp, EMPTY_RECORD, Box, Button, Stack, Popover, TextInput, AnimatedSpinnerIcon, useClickOutsideEvent, Flex, containsOrEqualsElement, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, createGlobalScopedContext, usePrefersReducedMotion, Portal, Z_OFFSETS, Container, Layer, Grid, LayerProvider, isRecord, Selectable } from "./_chunks-es/_visual-editing.js";
3
+ import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, CardProvider, Checkbox, DEFAULT_ARROW_ELEMENT, DEFAULT_AVATAR_COUNTER_ELEMENT, DEFAULT_AVATAR_ELEMENT, DEFAULT_AVATAR_STACK_ELEMENT, DEFAULT_BADGE_ELEMENT, DEFAULT_BOX_ELEMENT, DEFAULT_BUTTON_ELEMENT, DEFAULT_CARD_ELEMENT, DEFAULT_CHECKBOX_ELEMENT, DEFAULT_CODE_ELEMENT, DEFAULT_CONTAINER_ELEMENT, DEFAULT_ELEMENT_QUERY_ELEMENT, DEFAULT_FLEX_ELEMENT, DEFAULT_GRID_ELEMENT, DEFAULT_HEADING_ELEMENT, DEFAULT_HOTKEYS_ELEMENT, DEFAULT_INLINE_ELEMENT, DEFAULT_KBD_ELEMENT, DEFAULT_LABEL_ELEMENT, DEFAULT_LAYER_ELEMENT, DEFAULT_MENU_DIVIDER_ELEMENT, DEFAULT_MENU_ELEMENT, DEFAULT_MENU_GROUP_ELEMENT, DEFAULT_MENU_ITEM_ELEMENT, DEFAULT_POPOVER_ELEMENT, DEFAULT_RADIO_ELEMENT, DEFAULT_SELECT_ELEMENT, DEFAULT_SPINNER_ELEMENT, DEFAULT_SR_ONLY_ELEMENT, DEFAULT_STACK_ELEMENT, DEFAULT_SWITCH_ELEMENT, DEFAULT_TAB_ELEMENT, DEFAULT_TAB_LIST_ELEMENT, DEFAULT_TEXT_AREA_ELEMENT, DEFAULT_TEXT_ELEMENT, DEFAULT_TEXT_INPUT_ELEMENT, DEFAULT_TOOLTIP_ELEMENT, DEFAULT_VIRTUAL_LIST_ELEMENT, ElementQuery, Heading, Hotkeys, Inline, KBD, Label, Menu, MenuDivider, MenuGroup, MenuItem, PortalProvider, Radio, Select, Spinner, SrOnly, Switch, Tab, TabList, TextArea, ThemeColorProvider, ThemeProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, VirtualList, _ResizeObserver, _elementSizeObserver, _getArrayProp, _isScrollable, useCard, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTheme_v2, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.js";
4
+ import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
5
+ import { ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
6
+ import { useState, useRef, useEffect, useImperativeHandle, Component, useReducer, useCallback, useMemo, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
7
+ import { c } from "react-compiler-runtime";
8
+ import { _composeClassNames, breadcrumbs, dialogCardRoot, dialogLayout, dialogHeader, dialogContent, dialogFooter, dialog, dialogContainer, skeleton, codeSkeleton, headingSkeleton, labelSkeleton, textSkeleton, toast, toastLoadingBar, toastLoadingBarMask, toastLoadingBarProgress, toastLayer, vars, treeItem, _compileTheme, _compileSystem } from "@sanity/ui/css";
9
+ import { px, rem } from "@sanity/ui/css";
10
+ import { motion, AnimatePresence } from "framer-motion";
11
+ const createColorTheme = createColorTheme$1, hexToRgb = hexToRgb$1, hslToRgb = hslToRgb$1, multiply = multiply$1, parseColor = parseColor$1, rgbToHex = rgbToHex$1, rgbToHsl = rgbToHsl$1, rgba = rgba$1, screen = screen$1;
4
12
  function _responsive(media, values, callback) {
5
13
  return (values?.map(callback) || []).map((statement, mediaIndex) => mediaIndex === 0 ? statement : {
6
14
  [`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
@@ -25,7 +33,7 @@ function _hasFocus(element) {
25
33
  return !!document.activeElement && element.contains(document.activeElement);
26
34
  }
27
35
  function isFocusable(element) {
28
- return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 : _visualEditing.isHTMLAnchorElement(element) ? !!element.href && element.rel !== "ignore" : _visualEditing.isHTMLInputElement(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : _visualEditing.isHTMLButtonElement(element) || _visualEditing.isHTMLSelectElement(element) || _visualEditing.isHTMLTextAreaElement(element) ? !element.disabled : !1;
36
+ return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 : isHTMLAnchorElement(element) ? !!element.href && element.rel !== "ignore" : isHTMLInputElement(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : isHTMLButtonElement(element) || isHTMLSelectElement(element) || isHTMLTextAreaElement(element) ? !element.disabled : !1;
29
37
  }
30
38
  function attemptFocus(element) {
31
39
  if (!isFocusable(element))
@@ -39,7 +47,7 @@ function attemptFocus(element) {
39
47
  function focusFirstDescendant(element) {
40
48
  for (let i = 0; i < element.childNodes.length; i++) {
41
49
  const child = element.childNodes[i];
42
- if (_visualEditing.isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
50
+ if (isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
43
51
  return !0;
44
52
  }
45
53
  return !1;
@@ -47,7 +55,7 @@ function focusFirstDescendant(element) {
47
55
  function focusLastDescendant(element) {
48
56
  for (let i = element.childNodes.length - 1; i >= 0; i--) {
49
57
  const child = element.childNodes[i];
50
- if (_visualEditing.isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
58
+ if (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
51
59
  return !0;
52
60
  }
53
61
  return !1;
@@ -59,10 +67,10 @@ function _getElements(element, elementsArg) {
59
67
  return ret.filter(Boolean);
60
68
  }
61
69
  function useClickOutside(listener, t0, boundaryElement) {
62
- const $ = reactCompilerRuntime.c(12), elementsArg = t0 === void 0 ? _visualEditing.EMPTY_ARRAY : t0, [element, setElement] = react.useState(null);
70
+ const $ = c(12), elementsArg = t0 === void 0 ? EMPTY_ARRAY : t0, [element, setElement] = useState(null);
63
71
  let t1;
64
72
  $[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
65
- const [elements, setElements] = react.useState(t1), elementsRef = react.useRef(elements);
73
+ const [elements, setElements] = useState(t1), elementsRef = useRef(elements);
66
74
  let t2, t3;
67
75
  $[3] !== element || $[4] !== elementsArg ? (t2 = () => {
68
76
  const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
@@ -80,7 +88,7 @@ function useClickOutside(listener, t0, boundaryElement) {
80
88
  setElements(nextElements), elementsRef.current = nextElements;
81
89
  return;
82
90
  }
83
- }, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), react.useEffect(t2, t3);
91
+ }, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), useEffect(t2, t3);
84
92
  let t4, t5;
85
93
  return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
86
94
  if (!listener)
@@ -97,20 +105,21 @@ function useClickOutside(listener, t0, boundaryElement) {
97
105
  return window.addEventListener("mousedown", handleWindowMouseDown), () => {
98
106
  window.removeEventListener("mousedown", handleWindowMouseDown);
99
107
  };
100
- }, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), react.useEffect(t4, t5), setElement;
108
+ }, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
101
109
  }
102
110
  function useElementRect(element) {
103
- return _visualEditing.useElementSize(element)?._contentRect || null;
111
+ return useElementSize(element)?._contentRect || null;
104
112
  }
105
113
  function useForwardedRef(ref) {
106
- const $ = reactCompilerRuntime.c(1), innerRef = react.useRef(null);
114
+ const $ = c(1), innerRef = useRef(null);
107
115
  let t0;
108
- return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], react.useImperativeHandle(ref, t0), innerRef;
116
+ return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], useImperativeHandle(ref, t0), innerRef;
109
117
  }
110
- class ErrorBoundary extends react.Component {
118
+ class ErrorBoundary extends Component {
111
119
  state = {
112
120
  error: null
113
121
  };
122
+ static displayName = "ErrorBoundary";
114
123
  static getDerivedStateFromError(error) {
115
124
  return {
116
125
  error
@@ -128,13 +137,13 @@ class ErrorBoundary extends react.Component {
128
137
  } = this.state;
129
138
  if (error) {
130
139
  const message = typeof error?.message == "string" ? error.message : "Error";
131
- return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Code, { children: message });
140
+ return /* @__PURE__ */ jsx(Code, { children: message });
132
141
  }
133
142
  return this.props.children;
134
143
  }
135
144
  }
136
145
  function AutocompleteOption(props) {
137
- const $ = reactCompilerRuntime.c(11), {
146
+ const $ = c(11), {
138
147
  children,
139
148
  id,
140
149
  onSelect,
@@ -150,12 +159,13 @@ function AutocompleteOption(props) {
150
159
  const handleClick = t0;
151
160
  let t1;
152
161
  $[3] !== handleClick ? (t1 = (event) => {
153
- event.key === "Enter" && !_visualEditing._isEnterToClickElement(event.currentTarget) && handleClick();
162
+ event.key === "Enter" && !_isEnterToClickElement(event.currentTarget) && handleClick();
154
163
  }, $[3] = handleClick, $[4] = t1) : t1 = $[4];
155
164
  const handleKeyDown = t1;
156
165
  let t2;
157
- return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsxRuntime.jsx("li", { "aria-selected": selected, "data-ui": "AutocompleteOption", id, role: "option", onClick: handleClick, onKeyDown: handleKeyDown, children }), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
166
+ return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsx("li", { "aria-selected": selected, "data-ui": "AutocompleteOption", id, role: "option", onClick: handleClick, onKeyDown: handleKeyDown, children }), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
158
167
  }
168
+ AutocompleteOption.displayName = "AutocompleteOption";
159
169
  function autocompleteReducer(state, msg) {
160
170
  return msg.type === "input/change" ? {
161
171
  ...state,
@@ -195,16 +205,18 @@ function autocompleteReducer(state, msg) {
195
205
  value: msg.value
196
206
  } : state;
197
207
  }
198
- const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1, InnerAutocomplete = react.forwardRef(function(props, forwardedRef) {
208
+ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_AUTOCOMPLETE_ELEMENT = "input", DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1;
209
+ function Autocomplete(props) {
199
210
  const {
211
+ as = DEFAULT_AUTOCOMPLETE_ELEMENT,
200
212
  border = !0,
201
213
  customValidity,
202
214
  disabled,
203
215
  filterOption: filterOptionProp,
204
- fontSize = 1,
216
+ fontSize = 2,
205
217
  icon,
206
218
  id,
207
- listBox = _visualEditing.EMPTY_RECORD,
219
+ listBox = EMPTY_RECORD,
208
220
  loading,
209
221
  onBlur,
210
222
  onChange,
@@ -215,18 +227,19 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
215
227
  openOnFocus,
216
228
  options: optionsProp,
217
229
  padding: paddingProp = 3,
218
- popover = _visualEditing.EMPTY_RECORD,
230
+ popover = EMPTY_RECORD,
219
231
  prefix,
220
232
  radius = 2,
221
233
  readOnly,
234
+ ref: forwardedRef,
222
235
  relatedElements,
223
236
  renderOption: renderOptionProp,
224
237
  renderPopover,
225
238
  renderValue = DEFAULT_RENDER_VALUE,
226
239
  suffix,
227
240
  value: valueProp,
228
- ...restProps
229
- } = props, [state, dispatch] = react.useReducer(autocompleteReducer, {
241
+ ...rest
242
+ } = props, [state, dispatch] = useReducer(autocompleteReducer, {
230
243
  activeValue: valueProp || null,
231
244
  focused: !1,
232
245
  listFocused: !1,
@@ -238,20 +251,11 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
238
251
  listFocused,
239
252
  query,
240
253
  value
241
- } = state, defaultRenderOption = react.useCallback(({
254
+ } = state, defaultRenderOption = useCallback(({
242
255
  value: value_0
243
- }) => /* @__PURE__ */ jsxRuntime.jsx(
244
- _visualEditing.Card,
245
- {
246
- as: "button",
247
- padding: paddingProp,
248
- radius: 2,
249
- tone: "inherit",
250
- children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 })
251
- }
252
- ), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = react.useRef(null), resultsPopoverElementRef = react.useRef(null), inputElementRef = react.useRef(null), listBoxElementRef = react.useRef(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
253
- react.useImperativeHandle(forwardedRef, () => inputElementRef.current);
254
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing.useArrayProp(paddingProp), currentOption = react.useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = react.useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = react.useCallback((event) => {
256
+ }) => /* @__PURE__ */ jsx(Card, { as: "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) }), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
257
+ useImperativeHandle(forwardedRef, () => inputElementRef.current);
258
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = useCallback((event) => {
255
259
  setTimeout(() => {
256
260
  if (popoverMouseWithinRef.current)
257
261
  return;
@@ -268,18 +272,18 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
268
272
  type: "root/blur"
269
273
  }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
270
274
  }, 0);
271
- }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = react.useCallback((event_0) => {
275
+ }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = useCallback((event_0) => {
272
276
  const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
273
277
  listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
274
278
  type: "root/setListFocused",
275
279
  listFocused: listFocused_0
276
280
  }));
277
- }, []), handleOptionSelect = react.useCallback((v) => {
281
+ }, []), handleOptionSelect = useCallback((v) => {
278
282
  dispatch({
279
283
  type: "value/change",
280
284
  value: v
281
285
  }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
282
- }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = react.useCallback((event_1) => {
286
+ }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = useCallback((event_1) => {
283
287
  if (event_1.key === "ArrowDown") {
284
288
  if (event_1.preventDefault(), !filteredOptionsLen) return;
285
289
  const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
@@ -311,35 +315,35 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
311
315
  inputElementRef.current?.focus();
312
316
  return;
313
317
  }
314
- }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = react.useCallback((event_2) => {
318
+ }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = useCallback((event_2) => {
315
319
  const nextQuery = event_2.currentTarget.value;
316
320
  dispatch({
317
321
  type: "input/change",
318
322
  query: nextQuery
319
323
  }), onQueryChange && onQueryChange(nextQuery);
320
- }, [onQueryChange]), dispatchOpen = react.useCallback(() => {
324
+ }, [onQueryChange]), dispatchOpen = useCallback(() => {
321
325
  dispatch({
322
326
  type: "root/open",
323
327
  query: value ? renderValue(value, currentOption) : ""
324
328
  });
325
- }, [currentOption, renderValue, value]), handleInputFocus = react.useCallback((event_3) => {
329
+ }, [currentOption, renderValue, value]), handleInputFocus = useCallback((event_3) => {
326
330
  focused || (dispatch({
327
331
  type: "input/focus"
328
332
  }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
329
- }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = react.useCallback(() => {
333
+ }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = useCallback(() => {
330
334
  popoverMouseWithinRef.current = !0;
331
- }, []), handlePopoverMouseLeave = react.useCallback(() => {
335
+ }, []), handlePopoverMouseLeave = useCallback(() => {
332
336
  popoverMouseWithinRef.current = !1;
333
- }, []), handleClearButtonClick = react.useCallback(() => {
337
+ }, []), handleClearButtonClick = useCallback(() => {
334
338
  dispatch({
335
339
  type: "root/clear"
336
340
  }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
337
- }, [onChange, onQueryChange]), handleClearButtonFocus = react.useCallback(() => {
341
+ }, [onChange, onQueryChange]), handleClearButtonFocus = useCallback(() => {
338
342
  dispatch({
339
343
  type: "input/focus"
340
344
  });
341
345
  }, []);
342
- react.useEffect(() => {
346
+ useEffect(() => {
343
347
  if (valueProp !== valuePropRef.current) {
344
348
  valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
345
349
  type: "value/change",
@@ -351,12 +355,12 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
351
355
  type: "value/change",
352
356
  value: valueProp || null
353
357
  }));
354
- }, [valueProp]), react.useEffect(() => {
358
+ }, [valueProp]), useEffect(() => {
355
359
  !focused && valueRef.current && dispatch({
356
360
  type: "root/setActiveValue",
357
361
  value: valueRef.current
358
362
  });
359
- }, [focused]), react.useEffect(() => {
363
+ }, [focused]), useEffect(() => {
360
364
  const listElement = listBoxElementRef.current;
361
365
  if (!listElement) return;
362
366
  const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
@@ -369,41 +373,43 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
369
373
  }
370
374
  }
371
375
  }, [activeValue, filteredOptions]);
372
- const clearButton = react.useMemo(() => {
376
+ const clearButton = useMemo(() => {
373
377
  if (!loading && !disabled && value)
374
378
  return {
375
379
  "aria-label": "Clear",
376
380
  onFocus: handleClearButtonFocus
377
381
  };
378
- }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = react.useMemo(() => padding.map((v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2), [padding]), openButtonPadding = react.useMemo(() => padding.map((v_1) => Math.max(v_1 - 1, 0)), [padding]), openButtonProps = react.useMemo(() => typeof openButton == "object" ? openButton : _visualEditing.EMPTY_RECORD, [openButton]), handleOpenClick = react.useCallback((event_4) => {
382
+ }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = useMemo(() => padding.map((v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2), [padding]), openButtonPadding = useMemo(() => padding.map((v_1) => Math.max(v_1 - 1, 0)), [padding]), openButtonProps = useMemo(() => typeof openButton == "object" ? openButton : EMPTY_RECORD, [openButton]), handleOpenClick = useCallback((event_4) => {
379
383
  dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
380
- }, [openButtonProps, dispatchOpen]), openButtonNode = react.useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = react.useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && _visualEditing.AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = react.useCallback((event_5) => {
384
+ }, [openButtonProps, dispatchOpen]), openButtonNode = useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsx(TextInput, { ...rest, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", as, border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = useCallback((event_5) => {
381
385
  event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
382
- }, [listFocused]), content2 = react.useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: filteredOptions.map((option_0) => {
386
+ }, [listFocused]), content2 = useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsx(Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", gap: 1, id: listBoxId, ref: listBoxElementRef, role: "listbox", children: filteredOptions.map((option_0) => {
383
387
  const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
384
- return /* @__PURE__ */ jsxRuntime.jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: react.cloneElement(renderOption(option_0), {
388
+ return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
385
389
  disabled: loading,
386
390
  selected: active,
387
391
  tabIndex: listFocused && active ? 0 : -1
388
392
  }) }, option_0.value);
389
- }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = react.useMemo(() => renderPopover ? renderPopover({
393
+ }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = useMemo(() => renderPopover ? renderPopover({
390
394
  content: content2,
391
395
  hidden: !expanded,
392
396
  inputElement: inputElementRef.current,
393
397
  onMouseEnter: handlePopoverMouseEnter,
394
398
  onMouseLeave: handlePopoverMouseLeave
395
- }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, radius, renderPopover]);
399
+ }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsx(Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius: 3, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, renderPopover]);
396
400
  return (
397
401
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
398
- /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
402
+ /* @__PURE__ */ jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
399
403
  input,
400
404
  results
401
405
  ] })
402
406
  );
403
- });
404
- InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
405
- const Autocomplete = InnerAutocomplete, Breadcrumbs = react.forwardRef(function(props, ref) {
407
+ }
408
+ Autocomplete.displayName = "Autocomplete";
409
+ const DEFAULT_BREADCRUMBS_ELEMENT = "nav";
410
+ function Breadcrumbs(props) {
406
411
  const {
412
+ as = DEFAULT_BREADCRUMBS_ELEMENT,
407
413
  children,
408
414
  className,
409
415
  expandButton: expandButtonProps,
@@ -415,36 +421,34 @@ const Autocomplete = InnerAutocomplete, Breadcrumbs = react.forwardRef(function(
415
421
  separator,
416
422
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
417
423
  space: _spaceProp,
418
- ...restProps
419
- } = props, [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null), collapse = react.useCallback(() => setOpen(!1), []), expand = react.useCallback(() => setOpen(!0), []);
420
- _visualEditing.useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
421
- const rawItems = react.useMemo(() => react.Children.toArray(children).filter(react.isValidElement), [children]), items = react.useMemo(() => {
424
+ ...rest
425
+ } = props, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
426
+ useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
427
+ const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
422
428
  const len = rawItems.length;
423
429
  if (maxLength && len > maxLength) {
424
430
  const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
425
- return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { constrainSize: !0, content: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ol", overflow: "auto", space: gapY, children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, padding: 2, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { mode: "bleed", padding: 0, text: "\u2026", ...expandButtonProps, onClick: open ? collapse : expand, ref: expandElementRef, selected: open }) }, "button"), ...rawItems.slice(len - afterLength)];
431
+ return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsx(Popover, { constrainSize: !0, content: /* @__PURE__ */ jsx(Stack, { as: "ol", gap: gapY, overflow: "auto", children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, padding: 2, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsx(Button, { mode: "bleed", padding: 0, text: "\u2026", ...expandButtonProps, onClick: open ? collapse : expand, ref: expandElementRef, selected: open }) }, "button"), ...rawItems.slice(len - afterLength)];
426
432
  }
427
433
  return rawItems;
428
434
  }, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
429
- return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Flex, { as: "nav", "data-ui": "Breadcrumbs", ...restProps, className: css.composeClassNames(className, css.breadcrumbs()), gapX, gapY, ref, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
430
- itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted: !0, children: "/" }) }),
431
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "li", children: item })
435
+ return /* @__PURE__ */ jsx(Flex, { as, "data-ui": "Breadcrumbs", ...rest, className: _composeClassNames(className, breadcrumbs()), gapX, gapY, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
436
+ itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
437
+ /* @__PURE__ */ jsx(Box, { as: "li", children: item })
432
438
  ] }, itemIndex)) });
433
- });
434
- Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
435
- const DialogContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/dialog", {
436
- version: 0
437
- });
438
- function useDialog() {
439
- return react.useContext(DialogContext);
440
439
  }
440
+ Breadcrumbs.displayName = "Breadcrumbs";
441
441
  function isTargetWithinScope(boundaryElement, portalElement, target) {
442
- return !boundaryElement || !portalElement ? !0 : _visualEditing.containsOrEqualsElement(boundaryElement, target) || _visualEditing.containsOrEqualsElement(portalElement, target);
442
+ return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
443
443
  }
444
- const DialogCard = react.forwardRef(function(props, forwardedRef) {
445
- const $ = reactCompilerRuntime.c(43), {
444
+ const DEFAULT_DIALOG_CARD_ELEMENT = "div";
445
+ function DialogCard(props) {
446
+ const $ = c(51), t0 = props;
447
+ let autoFocus, children, footer, forwardedContentRef, forwardedRef, header, hideCloseButton, id, onClickOutside, onClose, portalProp, rest, t1;
448
+ $[0] !== t0 ? ({
446
449
  __unstable_autoFocus: autoFocus,
447
450
  __unstable_hideCloseButton: hideCloseButton,
451
+ as: t1,
448
452
  children,
449
453
  contentRef: forwardedContentRef,
450
454
  footer,
@@ -453,75 +457,74 @@ const DialogCard = react.forwardRef(function(props, forwardedRef) {
453
457
  onClickOutside,
454
458
  onClose,
455
459
  portal: portalProp,
456
- radius: radiusProp,
457
- scheme,
458
- shadow: t0,
459
- tone,
460
- width: widthProp
461
- } = props, shadowProp = t0 === void 0 ? 4 : t0, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, radius = _visualEditing.useArrayProp(radiusProp), shadow = _visualEditing.useArrayProp(shadowProp), width = _visualEditing.useArrayProp(widthProp), ref = react.useRef(null), contentRef = react.useRef(null), layer = _visualEditing.useLayer(), {
460
+ ref: forwardedRef,
461
+ ...rest
462
+ } = t0, $[0] = t0, $[1] = autoFocus, $[2] = children, $[3] = footer, $[4] = forwardedContentRef, $[5] = forwardedRef, $[6] = header, $[7] = hideCloseButton, $[8] = id, $[9] = onClickOutside, $[10] = onClose, $[11] = portalProp, $[12] = rest, $[13] = t1) : (autoFocus = $[1], children = $[2], footer = $[3], forwardedContentRef = $[4], forwardedRef = $[5], header = $[6], hideCloseButton = $[7], id = $[8], onClickOutside = $[9], onClose = $[10], portalProp = $[11], rest = $[12], t1 = $[13]);
463
+ const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
462
464
  isTopLayer
463
465
  } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
464
- let t1;
465
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[0] = t1) : t1 = $[0], react.useImperativeHandle(forwardedRef, t1);
466
466
  let t2;
467
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => contentRef.current, $[1] = t2) : t2 = $[1], react.useImperativeHandle(forwardedContentRef, t2);
468
- let t3, t4;
469
- $[2] !== autoFocus ? (t3 = () => {
467
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], useImperativeHandle(forwardedRef, t2);
468
+ let t3;
469
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => contentRef.current, $[15] = t3) : t3 = $[15], useImperativeHandle(forwardedContentRef, t3);
470
+ let t4, t5;
471
+ $[16] !== autoFocus ? (t4 = () => {
470
472
  autoFocus && ref.current && focusFirstDescendant(ref.current);
471
- }, t4 = [autoFocus, ref], $[2] = autoFocus, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), react.useEffect(t3, t4);
472
- let t5;
473
- $[5] !== boundaryElement || $[6] !== isTopLayer || $[7] !== onClose || $[8] !== portalElement ? (t5 = (event) => {
473
+ }, t5 = [autoFocus, ref], $[16] = autoFocus, $[17] = t4, $[18] = t5) : (t4 = $[17], t5 = $[18]), useEffect(t4, t5);
474
+ let t6;
475
+ $[19] !== boundaryElement || $[20] !== isTopLayer || $[21] !== onClose || $[22] !== portalElement ? (t6 = (event) => {
474
476
  if (!isTopLayer || !onClose)
475
477
  return;
476
478
  const target = document.activeElement;
477
479
  target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
478
- }, $[5] = boundaryElement, $[6] = isTopLayer, $[7] = onClose, $[8] = portalElement, $[9] = t5) : t5 = $[9], _visualEditing.useGlobalKeyDown(t5);
479
- let t6;
480
- $[10] !== boundaryElement || $[11] !== isTopLayer || $[12] !== onClickOutside || $[13] !== portalElement ? (t6 = isTopLayer && onClickOutside && ((event_0) => {
480
+ }, $[19] = boundaryElement, $[20] = isTopLayer, $[21] = onClose, $[22] = portalElement, $[23] = t6) : t6 = $[23], useGlobalKeyDown(t6);
481
+ let t7;
482
+ $[24] !== boundaryElement || $[25] !== isTopLayer || $[26] !== onClickOutside || $[27] !== portalElement ? (t7 = isTopLayer && onClickOutside && ((event_0) => {
481
483
  const target_0 = event_0.target;
482
484
  target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
483
- }), $[10] = boundaryElement, $[11] = isTopLayer, $[12] = onClickOutside, $[13] = portalElement, $[14] = t6) : t6 = $[14];
484
- let t7;
485
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[15] = t7) : t7 = $[15], _visualEditing.useClickOutsideEvent(t6, t7);
485
+ }), $[24] = boundaryElement, $[25] = isTopLayer, $[26] = onClickOutside, $[27] = portalElement, $[28] = t7) : t7 = $[28];
486
486
  let t8;
487
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t8 = css.dialogContainer(), $[16] = t8) : t8 = $[16];
487
+ $[29] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => [ref.current], $[29] = t8) : t8 = $[29], useClickOutsideEvent(t7, t8);
488
488
  let t9;
489
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css.dialogCardRoot(), $[17] = t9) : t9 = $[17];
489
+ $[30] === Symbol.for("react.memo_cache_sentinel") ? (t9 = dialogCardRoot(), $[30] = t9) : t9 = $[30];
490
490
  let t10;
491
- $[18] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css.dialogLayout(), $[18] = t10) : t10 = $[18];
491
+ $[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = dialogLayout(), $[31] = t10) : t10 = $[31];
492
492
  let t11;
493
- $[19] !== header || $[20] !== labelId || $[21] !== onClose || $[22] !== showCloseButton || $[23] !== showHeader ? (t11 = showHeader && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: css.dialogHeader(), position: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { align: "flex-start", padding: 3, children: [
494
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
495
- showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Close dialog", disabled: !onClose, icon: icons.CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
496
- ] }) }), $[19] = header, $[20] = labelId, $[21] = onClose, $[22] = showCloseButton, $[23] = showHeader, $[24] = t11) : t11 = $[24];
493
+ $[32] !== header || $[33] !== labelId || $[34] !== onClose || $[35] !== showCloseButton || $[36] !== showHeader ? (t11 = showHeader && /* @__PURE__ */ jsx(Box, { className: dialogHeader(), position: "relative", children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", padding: 3, children: [
494
+ /* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
495
+ showCloseButton && /* @__PURE__ */ jsx(Box, { flex: "none", children: /* @__PURE__ */ jsx(Button, { "aria-label": "Close dialog", disabled: !onClose, icon: CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
496
+ ] }) }), $[32] = header, $[33] = labelId, $[34] = onClose, $[35] = showCloseButton, $[36] = showHeader, $[37] = t11) : t11 = $[37];
497
497
  let t12;
498
- $[25] === Symbol.for("react.memo_cache_sentinel") ? (t12 = css.dialogContent(), $[25] = t12) : t12 = $[25];
498
+ $[38] === Symbol.for("react.memo_cache_sentinel") ? (t12 = dialogContent(), $[38] = t12) : t12 = $[38];
499
499
  let t13;
500
- $[26] !== children ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: t12, flex: 1, overflow: "auto", position: "relative", ref: contentRef, tabIndex: -1, children }), $[26] = children, $[27] = t13) : t13 = $[27];
500
+ $[39] !== children ? (t13 = /* @__PURE__ */ jsx(Box, { className: t12, flex: 1, overflow: "auto", position: "relative", ref: contentRef, tabIndex: -1, children }), $[39] = children, $[40] = t13) : t13 = $[40];
501
501
  let t14;
502
- $[28] !== footer ? (t14 = footer && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: css.dialogFooter(), position: "relative", children: footer }), $[28] = footer, $[29] = t14) : t14 = $[29];
502
+ $[41] !== footer ? (t14 = footer && /* @__PURE__ */ jsx(Box, { className: dialogFooter(), position: "relative", children: footer }), $[41] = footer, $[42] = t14) : t14 = $[42];
503
503
  let t15;
504
- $[30] !== t11 || $[31] !== t13 || $[32] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { className: t10, direction: "column", flex: 1, children: [
504
+ $[43] !== t11 || $[44] !== t13 || $[45] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Flex, { className: t10, direction: "column", flex: 1, children: [
505
505
  t11,
506
506
  t13,
507
507
  t14
508
- ] }), $[30] = t11, $[31] = t13, $[32] = t14, $[33] = t15) : t15 = $[33];
508
+ ] }), $[43] = t11, $[44] = t13, $[45] = t14, $[46] = t15) : t15 = $[46];
509
509
  let t16;
510
- $[34] !== radius || $[35] !== scheme || $[36] !== shadow || $[37] !== t15 || $[38] !== tone ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { className: t9, display: "flex", radius, ref, scheme, shadow, tone, children: t15 }), $[34] = radius, $[35] = scheme, $[36] = shadow, $[37] = t15, $[38] = tone, $[39] = t16) : t16 = $[39];
511
- let t17;
512
- return $[40] !== t16 || $[41] !== width ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Container, { align: "center", className: t8, "data-ui": "DialogCard", direction: "column", display: "flex", justify: "center", width, children: t16 }), $[40] = t16, $[41] = width, $[42] = t17) : t17 = $[42], t17;
510
+ return $[47] !== as || $[48] !== rest || $[49] !== t15 ? (t16 = /* @__PURE__ */ jsx(Card, { ...rest, as, className: t9, display: "flex", ref, children: t15 }), $[47] = as, $[48] = rest, $[49] = t15, $[50] = t16) : t16 = $[50], t16;
511
+ }
512
+ DialogCard.displayName = "DialogCard";
513
+ const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
514
+ version: 0
513
515
  });
514
- DialogCard.displayName = "ForwardRef(DialogCard)";
515
- const Dialog = react.forwardRef(function(props, ref) {
516
- const $ = reactCompilerRuntime.c(66), context = useDialog(), {
517
- layer
518
- } = _visualEditing.useTheme_v2();
519
- let _positionProp, _zOffsetProp, cardShadow, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, tone;
520
- $[0] !== props ? ({
521
- __unstable_autoFocus: t0,
522
- __unstable_hideCloseButton: t1,
523
- animate: t2,
524
- cardRadius: t3,
516
+ function useDialog() {
517
+ return useContext(DialogContext);
518
+ }
519
+ const DEFAULT_DIALOG_ELEMENT = "div";
520
+ function Dialog(props) {
521
+ const $ = c(69), context = useDialog(), t0 = props;
522
+ let _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, tone;
523
+ $[0] !== t0 ? ({
524
+ __unstable_autoFocus: t1,
525
+ __unstable_hideCloseButton: t2,
526
+ animate: t3,
527
+ cardRadius: t4,
525
528
  children,
526
529
  className,
527
530
  contentRef,
@@ -532,19 +535,19 @@ const Dialog = react.forwardRef(function(props, ref) {
532
535
  onClickOutside,
533
536
  onClose,
534
537
  onFocus,
535
- padding: t4,
538
+ padding: t5,
536
539
  portal: portalProp,
537
540
  position: _positionProp,
538
541
  scheme,
539
- shadow: cardShadow,
540
- width: t5,
542
+ shadow: t6,
543
+ width: t7,
541
544
  zOffset: _zOffsetProp,
542
545
  tone,
543
- ...restProps
544
- } = props, $[0] = props, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = cardShadow, $[4] = children, $[5] = className, $[6] = contentRef, $[7] = footer, $[8] = header, $[9] = id, $[10] = onActivate, $[11] = onClickOutside, $[12] = onClose, $[13] = onFocus, $[14] = portalProp, $[15] = restProps, $[16] = scheme, $[17] = t0, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4, $[22] = t5, $[23] = tone) : (_positionProp = $[1], _zOffsetProp = $[2], cardShadow = $[3], children = $[4], className = $[5], contentRef = $[6], footer = $[7], header = $[8], id = $[9], onActivate = $[10], onClickOutside = $[11], onClose = $[12], onFocus = $[13], portalProp = $[14], restProps = $[15], scheme = $[16], t0 = $[17], t1 = $[18], t2 = $[19], t3 = $[20], t4 = $[21], t5 = $[22], tone = $[23]);
545
- const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, _animate = t2 === void 0 ? !1 : t2, cardRadiusProp = t3 === void 0 ? 4 : t3, padding = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, positionProp = _positionProp ?? (context.position || "fixed"), zOffsetProp = _zOffsetProp ?? (context.zOffset || layer.dialog.zOffset), animate = _visualEditing.usePrefersReducedMotion() ? !1 : _animate, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, cardRadius = _visualEditing.useArrayProp(cardRadiusProp), position = _visualEditing.useArrayProp(positionProp), width = _visualEditing.useArrayProp(widthProp), zOffset = _visualEditing.useArrayProp(zOffsetProp), preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null);
546
- let t6;
547
- $[24] !== onFocus ? (t6 = (event) => {
546
+ ...rest
547
+ } = t0, $[0] = t0, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = className, $[5] = contentRef, $[6] = footer, $[7] = header, $[8] = id, $[9] = onActivate, $[10] = onClickOutside, $[11] = onClose, $[12] = onFocus, $[13] = portalProp, $[14] = rest, $[15] = scheme, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = tone) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], className = $[4], contentRef = $[5], footer = $[6], header = $[7], id = $[8], onActivate = $[9], onClickOutside = $[10], onClose = $[11], onFocus = $[12], portalProp = $[13], rest = $[14], scheme = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21], t7 = $[22], tone = $[23]);
548
+ const autoFocus = t1 === void 0 ? !0 : t1, hideCloseButton = t2 === void 0 ? !1 : t2, _animate = t3 === void 0 ? !1 : t3, cardRadiusProp = t4 === void 0 ? 4 : t4, padding = t5 === void 0 ? 3 : t5, cardShadow = t6 === void 0 ? 4 : t6, width = t7 === void 0 ? 0 : t7, positionProp = _positionProp ?? context.position ?? "fixed", zOffsetProp = _zOffsetProp ?? context.zOffset ?? Z_OFFSETS.dialog, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), position = useArrayProp(positionProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
549
+ let t8;
550
+ $[24] !== onFocus ? (t8 = (event) => {
548
551
  onFocus?.(event);
549
552
  const target = event.target, cardElement = cardRef.current;
550
553
  if (cardElement && target === preDivRef.current) {
@@ -555,11 +558,11 @@ const Dialog = react.forwardRef(function(props, ref) {
555
558
  focusFirstDescendant(cardElement);
556
559
  return;
557
560
  }
558
- _visualEditing.isHTMLElement(event.target) && (focusedElementRef.current = event.target);
559
- }, $[24] = onFocus, $[25] = t6) : t6 = $[25];
560
- const handleFocus = t6, labelId = `${id}_label`, rootClickTimeoutRef = react.useRef(void 0);
561
- let t7;
562
- $[26] !== boundaryElement || $[27] !== portalElement ? (t7 = () => {
561
+ isHTMLElement(event.target) && (focusedElementRef.current = event.target);
562
+ }, $[24] = onFocus, $[25] = t8) : t8 = $[25];
563
+ const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
564
+ let t9;
565
+ $[26] !== boundaryElement || $[27] !== portalElement ? (t9 = () => {
563
566
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
564
567
  const activeElement = document.activeElement;
565
568
  if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
@@ -572,29 +575,33 @@ const Dialog = react.forwardRef(function(props, ref) {
572
575
  target_0.focus();
573
576
  }
574
577
  }, 0);
575
- }, $[26] = boundaryElement, $[27] = portalElement, $[28] = t7) : t7 = $[28];
576
- const handleRootClick = t7;
577
- let t8;
578
- $[29] !== className ? (t8 = css.composeClassNames(className, css.dialog()), $[29] = className, $[30] = t8) : t8 = $[30];
579
- const t9 = animate ? "" : void 0;
578
+ }, $[26] = boundaryElement, $[27] = portalElement, $[28] = t9) : t9 = $[28];
579
+ const handleRootClick = t9;
580
580
  let t10;
581
- $[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t10) : t10 = $[31];
582
- let t11;
583
- $[32] !== autoFocus || $[33] !== cardRadius || $[34] !== cardShadow || $[35] !== children || $[36] !== contentRef || $[37] !== footer || $[38] !== header || $[39] !== hideCloseButton || $[40] !== id || $[41] !== onClickOutside || $[42] !== onClose || $[43] !== portalProp || $[44] !== scheme || $[45] !== tone || $[46] !== width ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[32] = autoFocus, $[33] = cardRadius, $[34] = cardShadow, $[35] = children, $[36] = contentRef, $[37] = footer, $[38] = header, $[39] = hideCloseButton, $[40] = id, $[41] = onClickOutside, $[42] = onClose, $[43] = portalProp, $[44] = scheme, $[45] = tone, $[46] = width, $[47] = t11) : t11 = $[47];
581
+ $[29] !== className ? (t10 = _composeClassNames(className, dialog()), $[29] = className, $[30] = t10) : t10 = $[30];
582
+ const t11 = animate ? "" : void 0;
584
583
  let t12;
585
- $[48] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 }), $[48] = t12) : t12 = $[48];
584
+ $[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
586
585
  let t13;
587
- $[49] !== handleFocus || $[50] !== handleRootClick || $[51] !== id || $[52] !== labelId || $[53] !== onActivate || $[54] !== padding || $[55] !== position || $[56] !== ref || $[57] !== restProps || $[58] !== t11 || $[59] !== t8 || $[60] !== t9 || $[61] !== zOffset ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Layer, { ...restProps, "aria-labelledby": labelId, "aria-modal": !0, className: t8, "data-animate": t9, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, ref, role: "dialog", zOffset, children: [
588
- t10,
589
- t11,
590
- t12
591
- ] }), $[49] = handleFocus, $[50] = handleRootClick, $[51] = id, $[52] = labelId, $[53] = onActivate, $[54] = padding, $[55] = position, $[56] = ref, $[57] = restProps, $[58] = t11, $[59] = t8, $[60] = t9, $[61] = zOffset, $[62] = t13) : t13 = $[62];
586
+ $[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 = dialogContainer(), $[32] = t13) : t13 = $[32];
592
587
  let t14;
593
- return $[63] !== portalProp || $[64] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Portal, { __unstable_name: portalProp, children: t13 }), $[63] = portalProp, $[64] = t13, $[65] = t14) : t14 = $[65], t14;
594
- });
595
- Dialog.displayName = "ForwardRef(Dialog)";
588
+ $[33] !== autoFocus || $[34] !== cardRadius || $[35] !== cardShadow || $[36] !== children || $[37] !== contentRef || $[38] !== footer || $[39] !== header || $[40] !== hideCloseButton || $[41] !== id || $[42] !== onClickOutside || $[43] !== onClose || $[44] !== portalProp || $[45] !== scheme || $[46] !== tone || $[47] !== width ? (t14 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[33] = autoFocus, $[34] = cardRadius, $[35] = cardShadow, $[36] = children, $[37] = contentRef, $[38] = footer, $[39] = header, $[40] = hideCloseButton, $[41] = id, $[42] = onClickOutside, $[43] = onClose, $[44] = portalProp, $[45] = scheme, $[46] = tone, $[47] = width, $[48] = t14) : t14 = $[48];
589
+ let t15;
590
+ $[49] !== t14 || $[50] !== width ? (t15 = /* @__PURE__ */ jsx(Container, { align: "center", className: t13, "data-ui": "DialogCard", direction: "column", display: "flex", justify: "center", width, children: t14 }), $[49] = t14, $[50] = width, $[51] = t15) : t15 = $[51];
591
+ let t16;
592
+ $[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[52] = t16) : t16 = $[52];
593
+ let t17;
594
+ $[53] !== handleFocus || $[54] !== handleRootClick || $[55] !== id || $[56] !== labelId || $[57] !== onActivate || $[58] !== padding || $[59] !== position || $[60] !== rest || $[61] !== t10 || $[62] !== t11 || $[63] !== t15 || $[64] !== zOffset ? (t17 = /* @__PURE__ */ jsxs(Layer, { ...rest, "aria-labelledby": labelId, "aria-modal": !0, className: t10, "data-animate": t11, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, role: "dialog", zOffset, children: [
595
+ t12,
596
+ t15,
597
+ t16
598
+ ] }), $[53] = handleFocus, $[54] = handleRootClick, $[55] = id, $[56] = labelId, $[57] = onActivate, $[58] = padding, $[59] = position, $[60] = rest, $[61] = t10, $[62] = t11, $[63] = t15, $[64] = zOffset, $[65] = t17) : t17 = $[65];
599
+ let t18;
600
+ return $[66] !== portalProp || $[67] !== t17 ? (t18 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t17 }), $[66] = portalProp, $[67] = t17, $[68] = t18) : t18 = $[68], t18;
601
+ }
602
+ Dialog.displayName = "Dialog";
596
603
  function DialogProvider(props) {
597
- const $ = reactCompilerRuntime.c(6), {
604
+ const $ = c(6), {
598
605
  children,
599
606
  position,
600
607
  zOffset
@@ -607,11 +614,11 @@ function DialogProvider(props) {
607
614
  }, $[0] = position, $[1] = zOffset, $[2] = t1) : t1 = $[2], t0 = t1;
608
615
  const contextValue = t0;
609
616
  let t2;
610
- return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
617
+ return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
611
618
  }
612
619
  DialogProvider.displayName = "DialogProvider";
613
- const MenuButton = react.forwardRef(function(props, forwardedRef) {
614
- const $ = reactCompilerRuntime.c(63), {
620
+ function MenuButton(props) {
621
+ const $ = c(63), {
615
622
  __unstable_disableRestoreFocusOnClose: t0,
616
623
  boundaryElement: deprecated_boundaryElement,
617
624
  button: buttonProp,
@@ -624,23 +631,24 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
624
631
  portal: t1,
625
632
  popover,
626
633
  popoverRadius: deprecated_popoverRadius,
627
- preventOverflow: deprecated_preventOverflow
628
- } = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), [buttonElement, setButtonElement] = react.useState(null);
634
+ preventOverflow: deprecated_preventOverflow,
635
+ ref: forwardedRef
636
+ } = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), [buttonElement, setButtonElement] = useState(null);
629
637
  let t2;
630
638
  $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
631
- const [menuElements, setChildMenuElements] = react.useState(t2), openRef = react.useRef(open);
639
+ const [menuElements, setChildMenuElements] = useState(t2), openRef = useRef(open);
632
640
  let t3, t4;
633
641
  $[1] !== onOpen || $[2] !== open ? (t3 = () => {
634
642
  onOpen && open && !openRef.current && onOpen();
635
- }, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), react.useEffect(t3, t4);
643
+ }, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), useEffect(t3, t4);
636
644
  let t5, t6;
637
645
  $[5] !== onClose || $[6] !== open ? (t5 = () => {
638
646
  onClose && !open && openRef.current && onClose();
639
- }, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), react.useEffect(t5, t6);
647
+ }, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), useEffect(t5, t6);
640
648
  let t7, t8;
641
649
  $[9] !== open ? (t7 = () => {
642
650
  openRef.current = open;
643
- }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), react.useEffect(t7, t8);
651
+ }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
644
652
  let t9;
645
653
  $[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
646
654
  setOpen(_temp$2), setShouldFocus(null);
@@ -699,7 +707,7 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
699
707
  $[27] === Symbol.for("react.memo_cache_sentinel") ? (t16 = (el_1) => (setChildMenuElements((els) => els.concat([el_1])), () => setChildMenuElements((els_0) => els_0.filter((_el) => _el !== el_1))), $[27] = t16) : t16 = $[27];
700
708
  const registerElement = t16;
701
709
  let t17;
702
- $[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && react.cloneElement(menuProp, {
710
+ $[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && cloneElement(menuProp, {
703
711
  "aria-labelledby": id,
704
712
  onBlurCapture: handleBlur,
705
713
  onClickOutside: handleMenuClickOutside,
@@ -718,7 +726,7 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
718
726
  }
719
727
  const t192 = buttonProp.props.selected ?? open;
720
728
  let t202;
721
- $[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open || $[41] !== t192 ? (t202 = react.cloneElement(buttonProp, {
729
+ $[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open || $[41] !== t192 ? (t202 = cloneElement(buttonProp, {
722
730
  "data-ui": "MenuButton",
723
731
  id,
724
732
  onClick: handleButtonClick,
@@ -732,7 +740,7 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
732
740
  }
733
741
  const button = t18;
734
742
  let t19, t20;
735
- $[43] !== buttonElement ? (t19 = () => buttonElement, t20 = [buttonElement], $[43] = buttonElement, $[44] = t19, $[45] = t20) : (t19 = $[44], t20 = $[45]), react.useImperativeHandle(forwardedRef, t19, t20);
743
+ $[43] !== buttonElement ? (t19 = () => buttonElement, t20 = [buttonElement], $[43] = buttonElement, $[44] = t19, $[45] = t20) : (t19 = $[44], t20 = $[45]), useImperativeHandle(forwardedRef, t19, t20);
736
744
  let t21, t22;
737
745
  $[46] !== popover ? (t22 = popover || {}, $[46] = popover, $[47] = t22) : t22 = $[47];
738
746
  let t23;
@@ -748,27 +756,28 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
748
756
  }, $[48] = deprecated_boundaryElement, $[49] = deprecated_placement, $[50] = deprecated_popoverRadius, $[51] = deprecated_popoverScheme, $[52] = deprecated_portal, $[53] = deprecated_preventOverflow, $[54] = t22, $[55] = t23) : t23 = $[55], t21 = t23;
749
757
  const popoverProps = t21;
750
758
  let t24;
751
- $[56] !== button ? (t24 = button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[56] = button, $[57] = t24) : t24 = $[57];
759
+ $[56] !== button ? (t24 = button || /* @__PURE__ */ jsx(Fragment$1, {}), $[56] = button, $[57] = t24) : t24 = $[57];
752
760
  let t25;
753
- return $[58] !== menu || $[59] !== open || $[60] !== popoverProps || $[61] !== t24 ? (t25 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t24 }), $[58] = menu, $[59] = open, $[60] = popoverProps, $[61] = t24, $[62] = t25) : t25 = $[62], t25;
754
- });
755
- MenuButton.displayName = "ForwardRef(MenuButton)";
761
+ return $[58] !== menu || $[59] !== open || $[60] !== popoverProps || $[61] !== t24 ? (t25 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t24 }), $[58] = menu, $[59] = open, $[60] = popoverProps, $[61] = t24, $[62] = t25) : t25 = $[62], t25;
762
+ }
756
763
  function _temp$2(v) {
757
764
  return !v;
758
765
  }
759
- const Skeleton = react.forwardRef(function(props, ref) {
760
- const $ = reactCompilerRuntime.c(18);
761
- let className, delay, radius, restProps, t0;
762
- $[0] !== props ? ({
763
- animated: t0,
766
+ MenuButton.displayName = "MenuButton";
767
+ const DEFAULT_SKELETON_ELEMENT = "div";
768
+ function Skeleton(props) {
769
+ const $ = c(17), t0 = props;
770
+ let className, delay, radius, rest, t1;
771
+ $[0] !== t0 ? ({
772
+ animated: t1,
764
773
  className,
765
774
  delay,
766
775
  radius,
767
- ...restProps
768
- } = props, $[0] = props, $[1] = className, $[2] = delay, $[3] = radius, $[4] = restProps, $[5] = t0) : (className = $[1], delay = $[2], radius = $[3], restProps = $[4], t0 = $[5]);
769
- const animated = t0 === void 0 ? !1 : t0, [visible, setVisible] = react.useState(!delay);
770
- let t1, t2;
771
- $[6] !== delay ? (t1 = () => {
776
+ ...rest
777
+ } = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] = radius, $[4] = rest, $[5] = t1) : (className = $[1], delay = $[2], radius = $[3], rest = $[4], t1 = $[5]);
778
+ const animated = t1 === void 0 ? !1 : t1, [visible, setVisible] = useState(!delay);
779
+ let t2, t3;
780
+ $[6] !== delay ? (t2 = () => {
772
781
  if (!delay)
773
782
  return setVisible(!0);
774
783
  const timeout = setTimeout(() => {
@@ -777,97 +786,104 @@ const Skeleton = react.forwardRef(function(props, ref) {
777
786
  return () => {
778
787
  clearTimeout(timeout);
779
788
  };
780
- }, t2 = [delay], $[6] = delay, $[7] = t1, $[8] = t2) : (t1 = $[7], t2 = $[8]), react.useEffect(t1, t2);
781
- let t3;
782
- $[9] !== className || $[10] !== radius ? (t3 = css.composeClassNames(className, css.skeleton({
789
+ }, t3 = [delay], $[6] = delay, $[7] = t2, $[8] = t3) : (t2 = $[7], t3 = $[8]), useEffect(t2, t3);
790
+ let t4;
791
+ $[9] !== className || $[10] !== radius ? (t4 = _composeClassNames(className, skeleton({
783
792
  radius
784
- })), $[9] = className, $[10] = radius, $[11] = t3) : t3 = $[11];
785
- const t4 = animated ? "" : void 0, t5 = visible ? "" : void 0;
786
- let t6;
787
- return $[12] !== ref || $[13] !== restProps || $[14] !== t3 || $[15] !== t4 || $[16] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "Skeleton", ...restProps, className: t3, "data-animated": t4, "data-visible": t5, ref }), $[12] = ref, $[13] = restProps, $[14] = t3, $[15] = t4, $[16] = t5, $[17] = t6) : t6 = $[17], t6;
788
- });
789
- Skeleton.displayName = "ForwardRef(Skeleton)";
790
- const TextSkeleton = react.forwardRef(function(props, ref) {
791
- const $ = reactCompilerRuntime.c(11);
792
- let className, restProps, t0;
793
- $[0] !== props ? ({
793
+ })), $[9] = className, $[10] = radius, $[11] = t4) : t4 = $[11];
794
+ const t5 = animated ? "" : void 0, t6 = visible ? "" : void 0;
795
+ let t7;
796
+ return $[12] !== rest || $[13] !== t4 || $[14] !== t5 || $[15] !== t6 ? (t7 = /* @__PURE__ */ jsx(Box, { "data-ui": "Skeleton", ...rest, className: t4, "data-animated": t5, "data-visible": t6 }), $[12] = rest, $[13] = t4, $[14] = t5, $[15] = t6, $[16] = t7) : t7 = $[16], t7;
797
+ }
798
+ Skeleton.displayName = "Skeleton";
799
+ const DEFAULT_CODE_SKELETON_ELEMENT = "div";
800
+ function CodeSkeleton(props) {
801
+ const $ = c(10), t0 = props;
802
+ let className, rest, t1;
803
+ $[0] !== t0 ? ({
794
804
  className,
795
- size: t0,
796
- ...restProps
797
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
798
- const size = t0 === void 0 ? 2 : t0;
799
- let t1;
800
- $[4] !== className || $[5] !== size ? (t1 = css.composeClassNames(className, css.textSkeleton({
801
- size
802
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
805
+ size: t1,
806
+ ...rest
807
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
808
+ const size = t1 === void 0 ? 2 : t1;
803
809
  let t2;
804
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { "data-ui": "TextSkeleton", ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
805
- });
806
- TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
807
- const LabelSkeleton = react.forwardRef(function(props, ref) {
808
- const $ = reactCompilerRuntime.c(11);
809
- let className, restProps, t0;
810
- $[0] !== props ? ({
811
- className,
812
- size: t0,
813
- ...restProps
814
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
815
- const size = t0 === void 0 ? 2 : t0;
816
- let t1;
817
- $[4] !== className || $[5] !== size ? (t1 = css.composeClassNames(className, css.labelSkeleton({
810
+ $[4] !== className || $[5] !== size ? (t2 = _composeClassNames(className, codeSkeleton({
818
811
  size
819
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
820
- let t2;
821
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { "data-ui": "LabelSkeleton", ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
822
- });
823
- LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
824
- const HeadingSkeleton = react.forwardRef(function(props, ref) {
825
- const $ = reactCompilerRuntime.c(11);
826
- let className, restProps, t0;
827
- $[0] !== props ? ({
812
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
813
+ let t3;
814
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
815
+ }
816
+ CodeSkeleton.displayName = "CodeSkeleton";
817
+ const DEFAULT_HEADING_SKELETON_ELEMENT = "div";
818
+ function HeadingSkeleton(props) {
819
+ const $ = c(10), t0 = props;
820
+ let className, rest, t1;
821
+ $[0] !== t0 ? ({
828
822
  className,
829
- size: t0,
830
- ...restProps
831
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
832
- const size = t0 === void 0 ? 2 : t0;
833
- let t1;
834
- $[4] !== className || $[5] !== size ? (t1 = css.composeClassNames(className, css.headingSkeleton({
835
- size
836
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
823
+ size: t1,
824
+ ...rest
825
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
826
+ const size = t1 === void 0 ? 2 : t1;
837
827
  let t2;
838
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
839
- });
840
- HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
841
- const CodeSkeleton = react.forwardRef(function(props, ref) {
842
- const $ = reactCompilerRuntime.c(11);
843
- let className, restProps, t0;
844
- $[0] !== props ? ({
828
+ $[4] !== className || $[5] !== size ? (t2 = _composeClassNames(className, headingSkeleton({
829
+ size
830
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
831
+ let t3;
832
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
833
+ }
834
+ HeadingSkeleton.displayName = "HeadingSkeleton";
835
+ const DEFAULT_LABEL_SKELETON_ELEMENT = "div";
836
+ function LabelSkeleton(props) {
837
+ const $ = c(10), t0 = props;
838
+ let className, rest, t1;
839
+ $[0] !== t0 ? ({
845
840
  className,
846
- size: t0,
847
- ...restProps
848
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
849
- const size = t0 === void 0 ? 2 : t0;
850
- let t1;
851
- $[4] !== className || $[5] !== size ? (t1 = css.composeClassNames(className, css.codeSkeleton({
841
+ size: t1,
842
+ ...rest
843
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
844
+ const size = t1 === void 0 ? 2 : t1;
845
+ let t2;
846
+ $[4] !== className || $[5] !== size ? (t2 = _composeClassNames(className, labelSkeleton({
852
847
  size
853
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
848
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
849
+ let t3;
850
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
851
+ }
852
+ LabelSkeleton.displayName = "LabelSkeleton";
853
+ const DEFAULT_TEXT_SKELETON_ELEMENT = "div";
854
+ function TextSkeleton(props) {
855
+ const $ = c(10), t0 = props;
856
+ let className, rest, t1;
857
+ $[0] !== t0 ? ({
858
+ className,
859
+ size: t1,
860
+ ...rest
861
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
862
+ const size = t1 === void 0 ? 2 : t1;
854
863
  let t2;
855
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
856
- });
857
- CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
858
- const TabPanel = react.forwardRef(function(props, ref) {
859
- const $ = reactCompilerRuntime.c(9);
860
- let flex, restProps;
861
- $[0] !== props ? ({
862
- flex,
863
- ...restProps
864
- } = props, $[0] = props, $[1] = flex, $[2] = restProps) : (flex = $[1], restProps = $[2]);
865
- const t0 = props.tabIndex === void 0 ? 0 : props.tabIndex;
866
- let t1;
867
- return $[3] !== flex || $[4] !== props.children || $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "TabPanel", ...restProps, flex, ref, role: "tabpanel", tabIndex: t0, children: props.children }), $[3] = flex, $[4] = props.children, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1) : t1 = $[8], t1;
868
- });
869
- TabPanel.displayName = "ForwardRef(TabPanel)";
870
- const ROLES = {
864
+ $[4] !== className || $[5] !== size ? (t2 = _composeClassNames(className, textSkeleton({
865
+ size
866
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
867
+ let t3;
868
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
869
+ }
870
+ TextSkeleton.displayName = "TextSkeleton";
871
+ const DEFAULT_TAB_PANEL_ELEMENT = "div";
872
+ function TabPanel(props) {
873
+ const $ = c(10), t0 = props;
874
+ let children, rest, t1, tabIndex;
875
+ $[0] !== t0 ? ({
876
+ as: t1,
877
+ children,
878
+ tabIndex,
879
+ ...rest
880
+ } = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1, $[4] = tabIndex) : (children = $[1], rest = $[2], t1 = $[3], tabIndex = $[4]);
881
+ const as = t1 === void 0 ? DEFAULT_TAB_PANEL_ELEMENT : t1, t2 = tabIndex === void 0 ? 0 : tabIndex;
882
+ let t3;
883
+ return $[5] !== as || $[6] !== children || $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Box, { "data-ui": "TabPanel", ...rest, as, role: "tabpanel", tabIndex: t2, children }), $[5] = as, $[6] = children, $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
884
+ }
885
+ TabPanel.displayName = "TabPanel";
886
+ const DEFAULT_TOAST_ELEMENT = "li", ROLES = {
871
887
  error: "alert",
872
888
  warning: "alert",
873
889
  success: "alert",
@@ -884,63 +900,64 @@ const ROLES = {
884
900
  info: "neutral"
885
901
  }, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
886
902
  function Toast(props) {
887
- const $ = reactCompilerRuntime.c(51);
888
- let closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
889
- $[0] !== props ? ({
903
+ const $ = c(53), t0 = props;
904
+ let closable, description, duration, onClose, rest, status, t1, t2, title, updatedAt;
905
+ $[0] !== t0 ? ({
906
+ as: t1,
890
907
  closable,
891
908
  description,
892
909
  duration,
893
910
  onClose,
894
- radius: t0,
911
+ radius: t2,
895
912
  title,
896
913
  status,
897
914
  updatedAt,
898
- ...restProps
899
- } = props, $[0] = props, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = restProps, $[6] = status, $[7] = t0, $[8] = title, $[9] = updatedAt) : (closable = $[1], description = $[2], duration = $[3], onClose = $[4], restProps = $[5], status = $[6], t0 = $[7], title = $[8], updatedAt = $[9]);
900
- const radius = t0 === void 0 ? 3 : t0, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = _visualEditing.usePrefersReducedMotion() ? 0 : 0.26;
901
- let t1;
902
- $[10] !== visualDuration ? (t1 = visualDuration ? {
915
+ ...rest
916
+ } = t0, $[0] = t0, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = rest, $[6] = status, $[7] = t1, $[8] = t2, $[9] = title, $[10] = updatedAt) : (closable = $[1], description = $[2], duration = $[3], onClose = $[4], rest = $[5], status = $[6], t1 = $[7], t2 = $[8], title = $[9], updatedAt = $[10]);
917
+ const as = t1 === void 0 ? DEFAULT_TOAST_ELEMENT : t1, radius = t2 === void 0 ? 3 : t2, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = usePrefersReducedMotion() ? 0 : 0.26;
918
+ let t3;
919
+ $[11] !== visualDuration ? (t3 = visualDuration ? {
903
920
  type: "spring",
904
921
  visualDuration,
905
922
  bounce: 0.25
906
923
  } : {
907
924
  duration: 0
908
- }, $[10] = visualDuration, $[11] = t1) : t1 = $[11];
909
- const transition = t1, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
910
- let t2;
911
- $[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
912
- const initial = t2;
913
- let t3;
914
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
915
- const animate = t3;
925
+ }, $[11] = visualDuration, $[12] = t3) : t3 = $[12];
926
+ const transition = t3, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
916
927
  let t4;
917
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "slideOut"], $[14] = t4) : t4 = $[14];
918
- const exit = t4;
928
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "initial"], $[13] = t4) : t4 = $[13];
929
+ const initial = t4;
919
930
  let t5;
920
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t5 = css.toast(), $[15] = t5) : t5 = $[15];
921
- const t6 = hasDuration ? "" : void 0;
931
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = ["visible", "slideIn"], $[14] = t5) : t5 = $[14];
932
+ const animate = t5;
933
+ let t6;
934
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = ["hidden", "slideOut"], $[15] = t6) : t6 = $[15];
935
+ const exit = t6;
922
936
  let t7;
923
- $[16] !== title ? (t7 = title && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: 1, weight: "medium", children: title }), $[16] = title, $[17] = t7) : t7 = $[17];
924
- let t8;
925
- $[18] !== description || $[19] !== transition ? (t8 = description && /* @__PURE__ */ jsxRuntime.jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[18] = description, $[19] = transition, $[20] = t8) : t8 = $[20];
937
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t7 = toast(), $[16] = t7) : t7 = $[16];
938
+ const t8 = hasDuration ? "" : void 0;
926
939
  let t9;
927
- $[21] !== t7 || $[22] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Stack, { space: 3, children: [
928
- t7,
929
- t8
930
- ] }) }), $[21] = t7, $[22] = t8, $[23] = t9) : t9 = $[23];
940
+ $[17] !== title ? (t9 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[17] = title, $[18] = t9) : t9 = $[18];
931
941
  let t10;
932
- $[24] !== buttonTone || $[25] !== closable || $[26] !== onClose ? (t10 = closable && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { padding: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { as: "button", icon: icons.CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
933
- verticalAlign: "top"
934
- } }) }), $[24] = buttonTone, $[25] = closable, $[26] = onClose, $[27] = t10) : t10 = $[27];
942
+ $[19] !== description || $[20] !== transition ? (t10 = description && /* @__PURE__ */ jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[19] = description, $[20] = transition, $[21] = t10) : t10 = $[21];
935
943
  let t11;
936
- $[28] !== t10 || $[29] !== t9 || $[30] !== transition ? (t11 = /* @__PURE__ */ jsxRuntime.jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
944
+ $[22] !== t10 || $[23] !== t9 ? (t11 = /* @__PURE__ */ jsx(Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxs(Stack, { gap: 3, children: [
937
945
  t9,
938
946
  t10
939
- ] }), $[28] = t10, $[29] = t9, $[30] = transition, $[31] = t11) : t11 = $[31];
947
+ ] }) }), $[22] = t10, $[23] = t9, $[24] = t11) : t11 = $[24];
940
948
  let t12;
941
- $[32] !== cardTone || $[33] !== duration || $[34] !== hasDuration || $[35] !== onClose || $[36] !== radius || $[37] !== transition || $[38] !== updatedAt || $[39] !== visualDuration ? (t12 = hasDuration && /* @__PURE__ */ jsxRuntime.jsxs(MotionBox, { className: css.toastLoadingBar(), variants: content, transition, children: [
942
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { className: css.toastLoadingBarMask(), tone: cardTone, radius }),
943
- /* @__PURE__ */ jsxRuntime.jsx(MotionCard, { className: css.toastLoadingBarProgress(), tone: cardTone, initial: {
949
+ $[25] !== buttonTone || $[26] !== closable || $[27] !== onClose ? (t12 = closable && /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "button", icon: CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
950
+ verticalAlign: "top"
951
+ } }) }), $[25] = buttonTone, $[26] = closable, $[27] = onClose, $[28] = t12) : t12 = $[28];
952
+ let t13;
953
+ $[29] !== t11 || $[30] !== t12 || $[31] !== transition ? (t13 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
954
+ t11,
955
+ t12
956
+ ] }), $[29] = t11, $[30] = t12, $[31] = transition, $[32] = t13) : t13 = $[32];
957
+ let t14;
958
+ $[33] !== cardTone || $[34] !== duration || $[35] !== hasDuration || $[36] !== onClose || $[37] !== radius || $[38] !== transition || $[39] !== updatedAt || $[40] !== visualDuration ? (t14 = hasDuration && /* @__PURE__ */ jsxs(MotionBox, { className: toastLoadingBar(), variants: content, transition, children: [
959
+ /* @__PURE__ */ jsx(Card, { className: toastLoadingBarMask(), tone: cardTone, radius }),
960
+ /* @__PURE__ */ jsx(MotionCard, { className: toastLoadingBarProgress(), tone: cardTone, initial: {
944
961
  scaleX: 0
945
962
  }, animate: {
946
963
  scaleX: 1
@@ -949,12 +966,12 @@ function Toast(props) {
949
966
  duration: duration / 1e3,
950
967
  ease: "linear"
951
968
  }, onAnimationComplete: onClose }, `progress-${updatedAt}`)
952
- ] }), $[32] = cardTone, $[33] = duration, $[34] = hasDuration, $[35] = onClose, $[36] = radius, $[37] = transition, $[38] = updatedAt, $[39] = visualDuration, $[40] = t12) : t12 = $[40];
953
- let t13;
954
- return $[41] !== cardTone || $[42] !== radius || $[43] !== restProps || $[44] !== role || $[45] !== t11 || $[46] !== t12 || $[47] !== t6 || $[48] !== transition || $[49] !== visualDuration ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(MotionCard, { as: "li", className: t5, "data-ui": "Toast", role, ...restProps, "data-has-duration": t6, custom: visualDuration, radius, shadow: 2, tone: cardTone, layout: "position", variants: container, initial, animate, exit, transition, width: "fill", position: "relative", children: [
955
- t11,
956
- t12
957
- ] }), $[41] = cardTone, $[42] = radius, $[43] = restProps, $[44] = role, $[45] = t11, $[46] = t12, $[47] = t6, $[48] = transition, $[49] = visualDuration, $[50] = t13) : t13 = $[50], t13;
969
+ ] }), $[33] = cardTone, $[34] = duration, $[35] = hasDuration, $[36] = onClose, $[37] = radius, $[38] = transition, $[39] = updatedAt, $[40] = visualDuration, $[41] = t14) : t14 = $[41];
970
+ let t15;
971
+ return $[42] !== as || $[43] !== cardTone || $[44] !== radius || $[45] !== rest || $[46] !== role || $[47] !== t13 || $[48] !== t14 || $[49] !== t8 || $[50] !== transition || $[51] !== visualDuration ? (t15 = /* @__PURE__ */ jsxs(MotionCard, { as, className: t7, "data-ui": "Toast", role, ...rest, "data-has-duration": t8, custom: visualDuration, radius, shadow: 2, tone: cardTone, layout: "position", variants: container, initial, animate, exit, transition, position: "relative", children: [
972
+ t13,
973
+ t14
974
+ ] }), $[42] = as, $[43] = cardTone, $[44] = radius, $[45] = rest, $[46] = role, $[47] = t13, $[48] = t14, $[49] = t8, $[50] = transition, $[51] = visualDuration, $[52] = t15) : t15 = $[52], t15;
958
975
  }
959
976
  Toast.displayName = "Toast";
960
977
  const container = {
@@ -994,9 +1011,9 @@ const container = {
994
1011
  visible: {
995
1012
  opacity: 1
996
1013
  }
997
- }, MotionCard = framerMotion.motion.create(_visualEditing.Card), MotionFlex = framerMotion.motion.create(_visualEditing.Flex), MotionText = framerMotion.motion.create(_visualEditing.Text), MotionBox = framerMotion.motion.create(_visualEditing.Box);
1014
+ }, MotionCard = motion.create(Card), MotionFlex = motion.create(Flex), MotionText = motion.create(Text), MotionBox = motion.create(Box);
998
1015
  function useMounted() {
999
- return react.useSyncExternalStore(subscribe, _temp$1, _temp2);
1016
+ return useSyncExternalStore(subscribe, _temp$1, _temp2);
1000
1017
  }
1001
1018
  function _temp2() {
1002
1019
  return !1;
@@ -1005,25 +1022,26 @@ function _temp$1() {
1005
1022
  return !0;
1006
1023
  }
1007
1024
  const subscribe = () => () => {
1008
- }, ToastContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/toast", null);
1025
+ }, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null), DEFAULT_TOAST_LAYER_ELEMENT = "ul";
1009
1026
  function ToastLayer(props) {
1010
- const $ = reactCompilerRuntime.c(10), {
1027
+ const $ = c(11), {
1028
+ as: t0,
1011
1029
  children,
1012
- padding: t0,
1030
+ padding: t1,
1013
1031
  paddingX,
1014
1032
  paddingY,
1015
- gap: t1
1016
- } = props, padding = t0 === void 0 ? 4 : t0, gap = t1 === void 0 ? 3 : t1, {
1033
+ gap: t2
1034
+ } = props, as = t0 === void 0 ? DEFAULT_TOAST_LAYER_ELEMENT : t0, padding = t1 === void 0 ? 4 : t1, gap = t2 === void 0 ? 3 : t2, {
1017
1035
  zIndex
1018
- } = _visualEditing.useLayer();
1019
- let t2;
1020
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = css.toastLayer(), $[0] = t2) : t2 = $[0];
1036
+ } = useLayer();
1021
1037
  let t3;
1022
- $[1] !== zIndex ? (t3 = {
1023
- zIndex
1024
- }, $[1] = zIndex, $[2] = t3) : t3 = $[2];
1038
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = toastLayer(), $[0] = t3) : t3 = $[0];
1025
1039
  let t4;
1026
- return $[3] !== children || $[4] !== gap || $[5] !== padding || $[6] !== paddingX || $[7] !== paddingY || $[8] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Grid, { as: "ul", className: t2, "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t3, children }), $[3] = children, $[4] = gap, $[5] = padding, $[6] = paddingX, $[7] = paddingY, $[8] = t3, $[9] = t4) : t4 = $[9], t4;
1040
+ $[1] !== zIndex ? (t4 = {
1041
+ zIndex
1042
+ }, $[1] = zIndex, $[2] = t4) : t4 = $[2];
1043
+ let t5;
1044
+ return $[3] !== as || $[4] !== children || $[5] !== gap || $[6] !== padding || $[7] !== paddingX || $[8] !== paddingY || $[9] !== t4 ? (t5 = /* @__PURE__ */ jsx(Grid, { as, className: t3, "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t4, children }), $[3] = as, $[4] = children, $[5] = gap, $[6] = padding, $[7] = paddingX, $[8] = paddingY, $[9] = t4, $[10] = t5) : t5 = $[10], t5;
1027
1045
  }
1028
1046
  ToastLayer.displayName = "ToastLayer";
1029
1047
  let toastId = 0;
@@ -1031,7 +1049,7 @@ function generateToastId() {
1031
1049
  return String(toastId++);
1032
1050
  }
1033
1051
  function ToastProvider(props) {
1034
- const $ = reactCompilerRuntime.c(13), {
1052
+ const $ = c(13), {
1035
1053
  children,
1036
1054
  padding,
1037
1055
  paddingX,
@@ -1041,17 +1059,17 @@ function ToastProvider(props) {
1041
1059
  } = props, zOffset = t0 === void 0 ? 1 : t0;
1042
1060
  let t1;
1043
1061
  $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
1044
- const [state, setState] = react.useState(t1), mounted = useMounted();
1062
+ const [state, setState] = useState(t1), mounted = useMounted();
1045
1063
  let t2, t3;
1046
1064
  $[1] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
1047
1065
  version: 0,
1048
1066
  push: (params) => {
1049
1067
  const id = params.id || generateToastId(), duration = params.duration || 5e3;
1050
- return react.startTransition(() => {
1068
+ return startTransition(() => {
1051
1069
  setState((prevState) => {
1052
1070
  if (duration === 0.01)
1053
- return prevState.filter((toast) => toast.id !== id);
1054
- const dismiss = () => react.startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
1071
+ return prevState.filter((toast2) => toast2.id !== id);
1072
+ const dismiss = () => startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
1055
1073
  return [...prevState.filter((toast_1) => toast_1.id !== id), {
1056
1074
  dismiss,
1057
1075
  id,
@@ -1067,9 +1085,9 @@ function ToastProvider(props) {
1067
1085
  }, $[1] = t3) : t3 = $[1], t2 = t3;
1068
1086
  const value = t2;
1069
1087
  let t4;
1070
- $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
1088
+ $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
1071
1089
  let t5;
1072
- return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
1090
+ return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
1073
1091
  children,
1074
1092
  t4
1075
1093
  ] }), $[10] = children, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
@@ -1081,14 +1099,14 @@ function _temp(t0) {
1081
1099
  params: params_0,
1082
1100
  updatedAt
1083
1101
  } = t0;
1084
- return /* @__PURE__ */ jsxRuntime.jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration, updatedAt }, id_0);
1102
+ return /* @__PURE__ */ jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration, updatedAt }, id_0);
1085
1103
  }
1086
1104
  ToastProvider.displayName = "ToastProvider";
1087
1105
  function useToast() {
1088
- const value = react.useContext(ToastContext);
1106
+ const value = useContext(ToastContext);
1089
1107
  if (!value)
1090
1108
  throw new Error("useToast(): missing context value");
1091
- if (!_visualEditing.isRecord(value) || value.version !== 0)
1109
+ if (!isRecord(value) || value.version !== 0)
1092
1110
  throw new Error("useToast(): the context value is not compatible");
1093
1111
  return value;
1094
1112
  }
@@ -1146,38 +1164,40 @@ function _focusItemElement(el) {
1146
1164
  firstChild && firstChild instanceof HTMLElement && firstChild.focus();
1147
1165
  }
1148
1166
  }
1149
- const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = react.memo(react.forwardRef(function(props, forwardedRef) {
1150
- const $ = reactCompilerRuntime.c(38);
1151
- let children, gap, onFocus, restProps, t0;
1152
- $[0] !== props ? ({
1167
+ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), DEFAULT_TREE_ELEMENT = "div";
1168
+ function Tree(props) {
1169
+ const $ = c(39), t0 = props;
1170
+ let children, forwardedRef, gap, onFocus, rest, t1;
1171
+ $[0] !== t0 ? ({
1153
1172
  children,
1154
1173
  gap,
1155
- space: t0,
1174
+ space: t1,
1156
1175
  onFocus,
1157
- ...restProps
1158
- } = props, $[0] = props, $[1] = children, $[2] = gap, $[3] = onFocus, $[4] = restProps, $[5] = t0) : (children = $[1], gap = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]);
1159
- const space = t0 === void 0 ? 1 : t0, ref = react.useRef(null), [focusedElement, setFocusedElement] = react.useState(null), focusedElementRef = react.useRef(focusedElement);
1160
- let t1, t2;
1161
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[6] = t2) : t2 = $[6], t1 = t2;
1162
- const path = t1;
1163
- let t3;
1164
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7];
1165
- const [itemElements, setItemElements] = react.useState(t3);
1176
+ ref: forwardedRef,
1177
+ ...rest
1178
+ } = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = gap, $[4] = onFocus, $[5] = rest, $[6] = t1) : (children = $[1], forwardedRef = $[2], gap = $[3], onFocus = $[4], rest = $[5], t1 = $[6]);
1179
+ const space = t1 === void 0 ? 1 : t1, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
1180
+ let t2, t3;
1181
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7], t2 = t3;
1182
+ const path = t2;
1166
1183
  let t4;
1167
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {}, $[8] = t4) : t4 = $[8];
1168
- const [state, setState] = react.useState(t4), stateRef = react.useRef(state);
1184
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [], $[8] = t4) : t4 = $[8];
1185
+ const [itemElements, setItemElements] = useState(t4);
1169
1186
  let t5;
1170
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[9] = t5) : t5 = $[9], react.useImperativeHandle(forwardedRef, t5);
1171
- let t6, t7;
1172
- $[10] !== focusedElement ? (t6 = () => {
1187
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = {}, $[9] = t5) : t5 = $[9];
1188
+ const [state, setState] = useState(t5), stateRef = useRef(state);
1189
+ let t6;
1190
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10], useImperativeHandle(forwardedRef, t6);
1191
+ let t7, t8;
1192
+ $[11] !== focusedElement ? (t7 = () => {
1173
1193
  focusedElementRef.current = focusedElement;
1174
- }, t7 = [focusedElement], $[10] = focusedElement, $[11] = t6, $[12] = t7) : (t6 = $[11], t7 = $[12]), react.useEffect(t6, t7);
1175
- let t8, t9;
1176
- $[13] !== state ? (t8 = () => {
1194
+ }, t8 = [focusedElement], $[11] = focusedElement, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]), useEffect(t7, t8);
1195
+ let t10, t9;
1196
+ $[14] !== state ? (t9 = () => {
1177
1197
  stateRef.current = state;
1178
- }, t9 = [state], $[13] = state, $[14] = t8, $[15] = t9) : (t8 = $[14], t9 = $[15]), react.useEffect(t8, t9);
1179
- let t10;
1180
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (element, path_0, expanded, selected) => (setState((s) => ({
1198
+ }, t10 = [state], $[14] = state, $[15] = t10, $[16] = t9) : (t10 = $[15], t9 = $[16]), useEffect(t9, t10);
1199
+ let t11;
1200
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (element, path_0, expanded, selected) => (setState((s) => ({
1181
1201
  ...s,
1182
1202
  [path_0]: {
1183
1203
  element,
@@ -1190,10 +1210,10 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1190
1210
  };
1191
1211
  return delete newState[path_0], newState;
1192
1212
  });
1193
- }), $[16] = t10) : t10 = $[16];
1194
- const registerItem = t10;
1195
- let t11;
1196
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (path_1, expanded_0) => {
1213
+ }), $[17] = t11) : t11 = $[17];
1214
+ const registerItem = t11;
1215
+ let t12;
1216
+ $[18] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (path_1, expanded_0) => {
1197
1217
  setState((s_1) => {
1198
1218
  const itemState = s_1[path_1];
1199
1219
  return itemState ? {
@@ -1204,14 +1224,14 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1204
1224
  }
1205
1225
  } : s_1;
1206
1226
  });
1207
- }, $[17] = t11) : t11 = $[17];
1208
- const setExpanded = t11;
1209
- let t12;
1210
- const t13 = focusedElement || itemElements[0] || null;
1211
- let t14;
1212
- $[18] !== space || $[19] !== state || $[20] !== t13 ? (t14 = {
1227
+ }, $[18] = t12) : t12 = $[18];
1228
+ const setExpanded = t12;
1229
+ let t13;
1230
+ const t14 = focusedElement || itemElements[0] || null;
1231
+ let t15;
1232
+ $[19] !== space || $[20] !== state || $[21] !== t14 ? (t15 = {
1213
1233
  version: 0,
1214
- focusedElement: t13,
1234
+ focusedElement: t14,
1215
1235
  level: 0,
1216
1236
  path,
1217
1237
  registerItem,
@@ -1219,10 +1239,10 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1219
1239
  setFocusedElement,
1220
1240
  space,
1221
1241
  state
1222
- }, $[18] = space, $[19] = state, $[20] = t13, $[21] = t14) : t14 = $[21], t12 = t14;
1223
- const contextValue = t12;
1224
- let t15;
1225
- $[22] !== itemElements ? (t15 = (event) => {
1242
+ }, $[19] = space, $[20] = state, $[21] = t14, $[22] = t15) : t15 = $[22], t13 = t15;
1243
+ const contextValue = t13;
1244
+ let t16;
1245
+ $[23] !== itemElements ? (t16 = (event) => {
1226
1246
  if (focusedElementRef.current) {
1227
1247
  if (event.key === "ArrowDown") {
1228
1248
  event.preventDefault();
@@ -1281,47 +1301,50 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1281
1301
  return;
1282
1302
  }
1283
1303
  }
1284
- }, $[22] = itemElements, $[23] = t15) : t15 = $[23];
1285
- const handleKeyDown = t15;
1286
- let t16;
1287
- $[24] !== onFocus ? (t16 = (event_0) => {
1288
- setFocusedElement(event_0.target), onFocus?.(event_0);
1289
- }, $[24] = onFocus, $[25] = t16) : t16 = $[25];
1290
- const handleFocus = t16;
1304
+ }, $[23] = itemElements, $[24] = t16) : t16 = $[24];
1305
+ const handleKeyDown = t16;
1291
1306
  let t17;
1292
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t17 = () => {
1307
+ $[25] !== onFocus ? (t17 = (event_0) => {
1308
+ setFocusedElement(event_0.target), onFocus?.(event_0);
1309
+ }, $[25] = onFocus, $[26] = t17) : t17 = $[26];
1310
+ const handleFocus = t17;
1311
+ let t18;
1312
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t18 = () => {
1293
1313
  if (!ref.current)
1294
1314
  return;
1295
1315
  const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
1296
1316
  setItemElements(_itemElements);
1297
- }, $[26] = t17) : t17 = $[26];
1298
- let t18;
1299
- $[27] !== children ? (t18 = [children], $[27] = children, $[28] = t18) : t18 = $[28], react.useEffect(t17, t18);
1300
- const t19 = gap ?? space;
1301
- let t20;
1302
- $[29] !== children || $[30] !== handleFocus || $[31] !== handleKeyDown || $[32] !== restProps || $[33] !== t19 ? (t20 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "Tree", ...restProps, gap: t19, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[29] = children, $[30] = handleFocus, $[31] = handleKeyDown, $[32] = restProps, $[33] = t19, $[34] = t20) : t20 = $[34];
1317
+ }, $[27] = t18) : t18 = $[27];
1318
+ let t19;
1319
+ $[28] !== children ? (t19 = [children], $[28] = children, $[29] = t19) : t19 = $[29], useEffect(t18, t19);
1320
+ const t20 = gap ?? space;
1303
1321
  let t21;
1304
- return $[35] !== contextValue || $[36] !== t20 ? (t21 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t20 }), $[35] = contextValue, $[36] = t20, $[37] = t21) : t21 = $[37], t21;
1305
- }));
1306
- Tree.displayName = "Memo(ForwardRef(Tree))";
1322
+ $[30] !== children || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest || $[34] !== t20 ? (t21 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...rest, gap: t20, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[30] = children, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = rest, $[34] = t20, $[35] = t21) : t21 = $[35];
1323
+ let t22;
1324
+ return $[36] !== contextValue || $[37] !== t21 ? (t22 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t21 }), $[36] = contextValue, $[37] = t21, $[38] = t22) : t22 = $[38], t22;
1325
+ }
1326
+ Tree.displayName = "Tree";
1307
1327
  function useTree() {
1308
- const tree = react.useContext(TreeContext);
1328
+ const tree = useContext(TreeContext);
1309
1329
  if (!tree)
1310
1330
  throw new Error("Tree: missing context value");
1311
1331
  return tree;
1312
1332
  }
1313
- const TreeGroup = react.memo(function(props) {
1314
- const $ = reactCompilerRuntime.c(9);
1315
- let children, restProps, t0;
1316
- $[0] !== props ? ({
1333
+ const TreeGroup = memo(function(props) {
1334
+ const $ = c(9), t0 = props;
1335
+ let children, rest, t1;
1336
+ $[0] !== t0 ? ({
1317
1337
  children,
1318
- expanded: t0,
1319
- ...restProps
1320
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
1321
- const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
1322
- let t2;
1323
- return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.space ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.space, role: "group", space: tree.space, children }), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.space, $[8] = t2) : t2 = $[8], t2;
1324
- }), TreeItem = react.memo(function(props) {
1338
+ expanded: t1,
1339
+ ...rest
1340
+ } = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1) : (children = $[1], rest = $[2], t1 = $[3]);
1341
+ const expanded = t1 === void 0 ? !1 : t1, tree = useTree(), t2 = !expanded;
1342
+ let t3;
1343
+ return $[4] !== children || $[5] !== rest || $[6] !== t2 || $[7] !== tree.space ? (t3 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...rest, hidden: t2, marginTop: tree.space, role: "group", gap: tree.space, children }), $[4] = children, $[5] = rest, $[6] = t2, $[7] = tree.space, $[8] = t3) : t3 = $[8], t3;
1344
+ });
1345
+ TreeGroup.displayName = "TreeGroup";
1346
+ const DEFAULT_TREE_ITEM_ELEMENT = "a";
1347
+ function TreeItem(props) {
1325
1348
  const {
1326
1349
  children,
1327
1350
  className,
@@ -1339,205 +1362,232 @@ const TreeGroup = react.memo(function(props) {
1339
1362
  space = 2,
1340
1363
  text,
1341
1364
  weight,
1342
- ...restProps
1343
- } = props, rootRef = react.useRef(null), treeitemRef = react.useRef(null), tree = useTree(), {
1365
+ ...rest
1366
+ } = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
1344
1367
  path,
1345
1368
  registerItem,
1346
1369
  setExpanded,
1347
1370
  setFocusedElement
1348
- } = tree, _id = react.useId(), id = idProp || _id, itemPath = react.useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = react.useMemo(() => ({
1371
+ } = tree, _id = useId(), id = idProp || _id, itemPath = useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = useMemo(() => ({
1349
1372
  ...tree,
1350
1373
  level: tree.level + 1,
1351
1374
  path: itemPath
1352
- }), [itemPath, tree]), handleClick = react.useCallback((event) => {
1375
+ }), [itemPath, tree]), handleClick = useCallback((event) => {
1353
1376
  onClick && onClick(event);
1354
1377
  const target = event.target;
1355
1378
  target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
1356
- }, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = react.useCallback((event_0) => {
1379
+ }, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = useCallback((event_0) => {
1357
1380
  focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
1358
1381
  }, [focused]);
1359
- react.useEffect(() => {
1382
+ useEffect(() => {
1360
1383
  if (rootRef.current)
1361
1384
  return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
1362
1385
  }, [expanded, itemPath, registerItem, selected]);
1363
- const content2 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { gap: space, padding, children: [
1364
- /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { style: {
1386
+ const content2 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
1387
+ /* @__PURE__ */ jsxs(Box, { style: {
1365
1388
  visibility: IconComponent || children ? "visible" : "hidden",
1366
1389
  pointerEvents: "none"
1367
1390
  }, children: [
1368
- IconComponent && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {}) }),
1369
- !IconComponent && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ToggleArrowRightIcon, { style: {
1391
+ IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }),
1392
+ !IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
1370
1393
  transform: expanded ? "rotate(90deg)" : void 0
1371
1394
  } }) })
1372
1395
  ] }),
1373
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
1396
+ /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
1374
1397
  ] });
1375
- return href ? /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, as: "li", className: css.composeClassNames(className, css.treeItem()), onClick: handleClick, ref: rootRef, role: "none", children: [
1376
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Selectable, { "aria-expanded": expanded, as: linkAs, "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", href, radius, ref: treeitemRef, role: "treeitem", tabIndex, style: {
1377
- paddingLeft: `calc(var(--space-2) * ${tree.level})`
1398
+ return href ? /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...rest, as: "li", className: _composeClassNames(className, treeItem()), onClick: handleClick, ref: rootRef, role: "none", children: [
1399
+ /* @__PURE__ */ jsx(Selectable, { "aria-expanded": expanded, as: linkAs, "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", href, radius, ref: treeitemRef, role: "treeitem", tabIndex, style: {
1400
+ paddingLeft: `calc(${vars.space[2]} * ${tree.level})`
1378
1401
  }, children: content2 }),
1379
- /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { hidden: !expanded, children }) })
1380
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, className: css.composeClassNames(className, css.treeItem()), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
1381
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
1382
- paddingLeft: `calc(var(--space-2) * ${tree.level})`
1402
+ /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
1403
+ ] }) : /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...rest, "aria-expanded": expanded, className: _composeClassNames(className, treeItem()), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
1404
+ /* @__PURE__ */ jsx(Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
1405
+ paddingLeft: `calc(${vars.space[2]} * ${tree.level})`
1383
1406
  }, children: content2 }),
1384
- /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }) })
1407
+ /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
1385
1408
  ] });
1386
- });
1387
- TreeItem.displayName = "Memo(TreeItem)";
1388
- function StyleTags(props) {
1389
- const $ = reactCompilerRuntime.c(14), {
1390
- theme: themeProp
1391
- } = props;
1409
+ }
1410
+ TreeItem.displayName = "TreeItem";
1411
+ function StyleTags() {
1412
+ const $ = c(2);
1392
1413
  let t0;
1393
- $[0] !== themeProp ? (t0 = themeProp ?? theme.buildTheme_v3(), $[0] = themeProp, $[1] = t0) : t0 = $[1];
1394
- const theme$1 = t0;
1414
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsx("style", { href: "sanity-theme", precedence: "theme", children: _compileTheme() }), $[0] = t0) : t0 = $[0];
1395
1415
  let t1;
1396
- $[2] !== theme$1._palette ? (t1 = css.compilePalette(theme$1._palette), $[2] = theme$1._palette, $[3] = t1) : t1 = $[3];
1397
- let t2;
1398
- $[4] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx("style", { href: "sanity-palette", precedence: "palette", children: t1 }), $[4] = t1, $[5] = t2) : t2 = $[5];
1399
- let t3;
1400
- $[6] !== theme$1 ? (t3 = css.compileTheme({
1401
- v3: theme$1
1402
- }), $[6] = theme$1, $[7] = t3) : t3 = $[7];
1403
- let t4;
1404
- $[8] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx("style", { href: "sanity-theme", precedence: "theme", children: t3 }), $[8] = t3, $[9] = t4) : t4 = $[9];
1405
- let t5;
1406
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t5 = /* @__PURE__ */ jsxRuntime.jsx("style", { href: "sanity-system", precedence: "system", children: css.compileSystem() }), $[10] = t5) : t5 = $[10];
1407
- let t6;
1408
- return $[11] !== t2 || $[12] !== t4 ? (t6 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1409
- t2,
1410
- t4,
1411
- t5
1412
- ] }), $[11] = t2, $[12] = t4, $[13] = t6) : t6 = $[13], t6;
1416
+ return $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
1417
+ t0,
1418
+ /* @__PURE__ */ jsx("style", { href: "sanity-system", precedence: "system", children: _compileSystem() })
1419
+ ] }), $[1] = t1) : t1 = $[1], t1;
1413
1420
  }
1414
- exports.Arrow = _visualEditing.Arrow;
1415
- exports.Avatar = _visualEditing.Avatar;
1416
- exports.AvatarCounter = _visualEditing.AvatarCounter;
1417
- exports.AvatarStack = _visualEditing.AvatarStack;
1418
- exports.Badge = _visualEditing.Badge;
1419
- exports.BoundaryElementProvider = _visualEditing.BoundaryElementProvider;
1420
- exports.Box = _visualEditing.Box;
1421
- exports.Button = _visualEditing.Button;
1422
- exports.Card = _visualEditing.Card;
1423
- exports.Checkbox = _visualEditing.Checkbox;
1424
- exports.Code = _visualEditing.Code;
1425
- exports.ConditionalWrapper = _visualEditing.ConditionalWrapper;
1426
- exports.Container = _visualEditing.Container;
1427
- exports.ElementQuery = _visualEditing.ElementQuery;
1428
- exports.Flex = _visualEditing.Flex;
1429
- exports.Grid = _visualEditing.Grid;
1430
- exports.Heading = _visualEditing.Heading;
1431
- exports.Hotkeys = _visualEditing.Hotkeys;
1432
- exports.Inline = _visualEditing.Inline;
1433
- exports.KBD = _visualEditing.KBD;
1434
- exports.Label = _visualEditing.Label;
1435
- exports.Layer = _visualEditing.Layer;
1436
- exports.LayerProvider = _visualEditing.LayerProvider;
1437
- exports.Menu = _visualEditing.Menu;
1438
- exports.MenuDivider = _visualEditing.MenuDivider;
1439
- exports.MenuGroup = _visualEditing.MenuGroup;
1440
- exports.MenuItem = _visualEditing.MenuItem;
1441
- exports.Popover = _visualEditing.Popover;
1442
- exports.Portal = _visualEditing.Portal;
1443
- exports.PortalProvider = _visualEditing.PortalProvider;
1444
- exports.Radio = _visualEditing.Radio;
1445
- exports.Select = _visualEditing.Select;
1446
- exports.Spinner = _visualEditing.Spinner;
1447
- exports.SrOnly = _visualEditing.SrOnly;
1448
- exports.Stack = _visualEditing.Stack;
1449
- exports.Switch = _visualEditing.Switch;
1450
- exports.Tab = _visualEditing.Tab;
1451
- exports.TabList = _visualEditing.TabList;
1452
- exports.Text = _visualEditing.Text;
1453
- exports.TextArea = _visualEditing.TextArea;
1454
- exports.TextInput = _visualEditing.TextInput;
1455
- exports.ThemeColorProvider = _visualEditing.ThemeColorProvider;
1456
- exports.ThemeProvider = _visualEditing.ThemeProvider;
1457
- exports.Tooltip = _visualEditing.Tooltip;
1458
- exports.TooltipDelayGroupContext = _visualEditing.TooltipDelayGroupContext;
1459
- exports.TooltipDelayGroupProvider = _visualEditing.TooltipDelayGroupProvider;
1460
- exports.VirtualList = _visualEditing.VirtualList;
1461
- exports._ResizeObserver = _visualEditing._ResizeObserver;
1462
- exports._elementSizeObserver = _visualEditing._elementSizeObserver;
1463
- exports._getArrayProp = _visualEditing._getArrayProp;
1464
- exports._isEnterToClickElement = _visualEditing._isEnterToClickElement;
1465
- exports._isScrollable = _visualEditing._isScrollable;
1466
- exports.containsOrEqualsElement = _visualEditing.containsOrEqualsElement;
1467
- exports.createColorTheme = _visualEditing.createColorTheme;
1468
- exports.hexToRgb = _visualEditing.hexToRgb;
1469
- exports.hslToRgb = _visualEditing.hslToRgb;
1470
- exports.isHTMLAnchorElement = _visualEditing.isHTMLAnchorElement;
1471
- exports.isHTMLButtonElement = _visualEditing.isHTMLButtonElement;
1472
- exports.isHTMLElement = _visualEditing.isHTMLElement;
1473
- exports.isHTMLInputElement = _visualEditing.isHTMLInputElement;
1474
- exports.isHTMLSelectElement = _visualEditing.isHTMLSelectElement;
1475
- exports.isHTMLTextAreaElement = _visualEditing.isHTMLTextAreaElement;
1476
- exports.multiply = _visualEditing.multiply;
1477
- exports.parseColor = _visualEditing.parseColor;
1478
- exports.rgbToHex = _visualEditing.rgbToHex;
1479
- exports.rgbToHsl = _visualEditing.rgbToHsl;
1480
- exports.rgba = _visualEditing.rgba;
1481
- exports.screen = _visualEditing.screen;
1482
- exports.studioTheme = _visualEditing.studioTheme;
1483
- exports.useArrayProp = _visualEditing.useArrayProp;
1484
- exports.useBoundaryElement = _visualEditing.useBoundaryElement;
1485
- exports.useClickOutsideEvent = _visualEditing.useClickOutsideEvent;
1486
- exports.useCustomValidity = _visualEditing.useCustomValidity;
1487
- exports.useElementSize = _visualEditing.useElementSize;
1488
- exports.useGlobalKeyDown = _visualEditing.useGlobalKeyDown;
1489
- exports.useLayer = _visualEditing.useLayer;
1490
- exports.useMatchMedia = _visualEditing.useMatchMedia;
1491
- exports.useMediaIndex = _visualEditing.useMediaIndex;
1492
- exports.usePortal = _visualEditing.usePortal;
1493
- exports.usePrefersDark = _visualEditing.usePrefersDark;
1494
- exports.usePrefersReducedMotion = _visualEditing.usePrefersReducedMotion;
1495
- exports.useRootTheme = _visualEditing.useRootTheme;
1496
- exports.useTheme = _visualEditing.useTheme;
1497
- exports.useTheme_v2 = _visualEditing.useTheme_v2;
1498
- exports.useTooltipDelayGroup = _visualEditing.useTooltipDelayGroup;
1499
- Object.defineProperty(exports, "px", {
1500
- enumerable: !0,
1501
- get: function() {
1502
- return css.px;
1503
- }
1504
- });
1505
- Object.defineProperty(exports, "rem", {
1506
- enumerable: !0,
1507
- get: function() {
1508
- return css.rem;
1509
- }
1510
- });
1511
- exports.Autocomplete = Autocomplete;
1512
- exports.Breadcrumbs = Breadcrumbs;
1513
- exports.CodeSkeleton = CodeSkeleton;
1514
- exports.Dialog = Dialog;
1515
- exports.DialogContext = DialogContext;
1516
- exports.DialogProvider = DialogProvider;
1517
- exports.ErrorBoundary = ErrorBoundary;
1518
- exports.HeadingSkeleton = HeadingSkeleton;
1519
- exports.LabelSkeleton = LabelSkeleton;
1520
- exports.MenuButton = MenuButton;
1521
- exports.Skeleton = Skeleton;
1522
- exports.StyleTags = StyleTags;
1523
- exports.TabPanel = TabPanel;
1524
- exports.TextSkeleton = TextSkeleton;
1525
- exports.Toast = Toast;
1526
- exports.ToastProvider = ToastProvider;
1527
- exports.Tree = Tree;
1528
- exports.TreeItem = TreeItem;
1529
- exports._hasFocus = _hasFocus;
1530
- exports._raf = _raf;
1531
- exports._raf2 = _raf2;
1532
- exports._responsive = _responsive;
1533
- exports.attemptFocus = attemptFocus;
1534
- exports.focusFirstDescendant = focusFirstDescendant;
1535
- exports.focusLastDescendant = focusLastDescendant;
1536
- exports.isFocusable = isFocusable;
1537
- exports.useClickOutside = useClickOutside;
1538
- exports.useDialog = useDialog;
1539
- exports.useElementRect = useElementRect;
1540
- exports.useForwardedRef = useForwardedRef;
1541
- exports.useToast = useToast;
1542
- exports.useTree = useTree;
1421
+ StyleTags.displayName = "StyleTags";
1422
+ export {
1423
+ Arrow,
1424
+ Autocomplete,
1425
+ Avatar,
1426
+ AvatarCounter,
1427
+ AvatarStack,
1428
+ Badge,
1429
+ BoundaryElementProvider,
1430
+ Box,
1431
+ Breadcrumbs,
1432
+ Button,
1433
+ Card,
1434
+ CardProvider,
1435
+ Checkbox,
1436
+ Code,
1437
+ CodeSkeleton,
1438
+ Container,
1439
+ DEFAULT_ARROW_ELEMENT,
1440
+ DEFAULT_AUTOCOMPLETE_ELEMENT,
1441
+ DEFAULT_AVATAR_COUNTER_ELEMENT,
1442
+ DEFAULT_AVATAR_ELEMENT,
1443
+ DEFAULT_AVATAR_STACK_ELEMENT,
1444
+ DEFAULT_BADGE_ELEMENT,
1445
+ DEFAULT_BOX_ELEMENT,
1446
+ DEFAULT_BREADCRUMBS_ELEMENT,
1447
+ DEFAULT_BUTTON_ELEMENT,
1448
+ DEFAULT_CARD_ELEMENT,
1449
+ DEFAULT_CHECKBOX_ELEMENT,
1450
+ DEFAULT_CODE_ELEMENT,
1451
+ DEFAULT_CODE_SKELETON_ELEMENT,
1452
+ DEFAULT_CONTAINER_ELEMENT,
1453
+ DEFAULT_DIALOG_ELEMENT,
1454
+ DEFAULT_ELEMENT_QUERY_ELEMENT,
1455
+ DEFAULT_FLEX_ELEMENT,
1456
+ DEFAULT_GRID_ELEMENT,
1457
+ DEFAULT_HEADING_ELEMENT,
1458
+ DEFAULT_HEADING_SKELETON_ELEMENT,
1459
+ DEFAULT_HOTKEYS_ELEMENT,
1460
+ DEFAULT_INLINE_ELEMENT,
1461
+ DEFAULT_KBD_ELEMENT,
1462
+ DEFAULT_LABEL_ELEMENT,
1463
+ DEFAULT_LABEL_SKELETON_ELEMENT,
1464
+ DEFAULT_LAYER_ELEMENT,
1465
+ DEFAULT_MENU_DIVIDER_ELEMENT,
1466
+ DEFAULT_MENU_ELEMENT,
1467
+ DEFAULT_MENU_GROUP_ELEMENT,
1468
+ DEFAULT_MENU_ITEM_ELEMENT,
1469
+ DEFAULT_POPOVER_ELEMENT,
1470
+ DEFAULT_RADIO_ELEMENT,
1471
+ DEFAULT_SELECT_ELEMENT,
1472
+ DEFAULT_SKELETON_ELEMENT,
1473
+ DEFAULT_SPINNER_ELEMENT,
1474
+ DEFAULT_SR_ONLY_ELEMENT,
1475
+ DEFAULT_STACK_ELEMENT,
1476
+ DEFAULT_SWITCH_ELEMENT,
1477
+ DEFAULT_TAB_ELEMENT,
1478
+ DEFAULT_TAB_LIST_ELEMENT,
1479
+ DEFAULT_TAB_PANEL_ELEMENT,
1480
+ DEFAULT_TEXT_AREA_ELEMENT,
1481
+ DEFAULT_TEXT_ELEMENT,
1482
+ DEFAULT_TEXT_INPUT_ELEMENT,
1483
+ DEFAULT_TEXT_SKELETON_ELEMENT,
1484
+ DEFAULT_TOAST_ELEMENT,
1485
+ DEFAULT_TOOLTIP_ELEMENT,
1486
+ DEFAULT_TREE_ELEMENT,
1487
+ DEFAULT_TREE_ITEM_ELEMENT,
1488
+ DEFAULT_VIRTUAL_LIST_ELEMENT,
1489
+ Dialog,
1490
+ DialogContext,
1491
+ DialogProvider,
1492
+ ElementQuery,
1493
+ ErrorBoundary,
1494
+ Flex,
1495
+ Grid,
1496
+ Heading,
1497
+ HeadingSkeleton,
1498
+ Hotkeys,
1499
+ Inline,
1500
+ KBD,
1501
+ Label,
1502
+ LabelSkeleton,
1503
+ Layer,
1504
+ LayerProvider,
1505
+ Menu,
1506
+ MenuButton,
1507
+ MenuDivider,
1508
+ MenuGroup,
1509
+ MenuItem,
1510
+ Popover,
1511
+ Portal,
1512
+ PortalProvider,
1513
+ Radio,
1514
+ Select,
1515
+ Skeleton,
1516
+ Spinner,
1517
+ SrOnly,
1518
+ Stack,
1519
+ StyleTags,
1520
+ Switch,
1521
+ Tab,
1522
+ TabList,
1523
+ TabPanel,
1524
+ Text,
1525
+ TextArea,
1526
+ TextInput,
1527
+ TextSkeleton,
1528
+ ThemeColorProvider,
1529
+ ThemeProvider,
1530
+ Toast,
1531
+ ToastProvider,
1532
+ Tooltip,
1533
+ TooltipDelayGroupContext,
1534
+ TooltipDelayGroupProvider,
1535
+ Tree,
1536
+ TreeItem,
1537
+ VirtualList,
1538
+ _ResizeObserver,
1539
+ _elementSizeObserver,
1540
+ _getArrayProp,
1541
+ _hasFocus,
1542
+ _isEnterToClickElement,
1543
+ _isScrollable,
1544
+ _raf,
1545
+ _raf2,
1546
+ _responsive,
1547
+ attemptFocus,
1548
+ containsOrEqualsElement,
1549
+ createColorTheme,
1550
+ focusFirstDescendant,
1551
+ focusLastDescendant,
1552
+ hexToRgb,
1553
+ hslToRgb,
1554
+ isFocusable,
1555
+ isHTMLAnchorElement,
1556
+ isHTMLButtonElement,
1557
+ isHTMLElement,
1558
+ isHTMLInputElement,
1559
+ isHTMLSelectElement,
1560
+ isHTMLTextAreaElement,
1561
+ multiply,
1562
+ parseColor,
1563
+ px,
1564
+ rem,
1565
+ rgbToHex,
1566
+ rgbToHsl,
1567
+ rgba,
1568
+ screen,
1569
+ useArrayProp,
1570
+ useBoundaryElement,
1571
+ useCard,
1572
+ useClickOutside,
1573
+ useClickOutsideEvent,
1574
+ useCustomValidity,
1575
+ useDialog,
1576
+ useElementRect,
1577
+ useElementSize,
1578
+ useForwardedRef,
1579
+ useGlobalKeyDown,
1580
+ useLayer,
1581
+ useMatchMedia,
1582
+ useMediaIndex,
1583
+ usePortal,
1584
+ usePrefersDark,
1585
+ usePrefersReducedMotion,
1586
+ useRootTheme,
1587
+ useTheme,
1588
+ useTheme_v2,
1589
+ useToast,
1590
+ useTooltipDelayGroup,
1591
+ useTree
1592
+ };
1543
1593
  //# sourceMappingURL=index.js.map