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

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 (829) hide show
  1. package/README.md +7 -6
  2. package/bin/{ui.js → sanity-ui.cjs} +1 -1
  3. package/dist/_chunks-cjs/_visual-editing.cjs +2488 -0
  4. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
  5. package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -2
  6. package/dist/_chunks-cjs/refractor.cjs.map +1 -0
  7. package/dist/_chunks-es/_visual-editing.js +2500 -0
  8. package/dist/_chunks-es/_visual-editing.js.map +1 -0
  9. package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -2
  10. package/dist/_chunks-es/refractor.js.map +1 -0
  11. package/dist/_visual-editing.cjs +30 -0
  12. package/dist/_visual-editing.cjs.map +1 -0
  13. package/dist/_visual-editing.d.cts +893 -0
  14. package/dist/_visual-editing.d.ts +503 -416
  15. package/dist/_visual-editing.js +29 -30
  16. package/dist/_visual-editing.js.map +1 -1
  17. package/dist/css.cjs +598 -0
  18. package/dist/css.cjs.map +1 -0
  19. package/dist/css.d.cts +14884 -0
  20. package/dist/css.d.ts +14379 -1630
  21. package/dist/css.js +480 -4594
  22. package/dist/css.js.map +1 -1
  23. package/dist/index.cjs +2222 -0
  24. package/dist/index.cjs.map +1 -0
  25. package/dist/{index.d.mts → index.d.cts} +1284 -961
  26. package/dist/index.d.ts +1284 -961
  27. package/dist/index.js +1270 -592
  28. package/dist/index.js.map +1 -1
  29. package/dist/{theme.mjs → theme.cjs} +2843 -2571
  30. package/dist/theme.cjs.map +1 -0
  31. package/dist/{theme.d.mts → theme.d.cts} +331 -311
  32. package/dist/theme.d.ts +331 -311
  33. package/dist/theme.js +2843 -2569
  34. package/dist/theme.js.map +1 -1
  35. package/dist/ui.css +22564 -0
  36. package/exports/_visual-editing.ts +0 -1
  37. package/package.json +84 -79
  38. package/src/cli/buildCommand.ts +3 -41
  39. package/src/cli/index.ts +2 -14
  40. package/src/core/_compat/helpers.ts +72 -0
  41. package/src/core/_compat/index.ts +1 -6
  42. package/src/core/_compat/styles/_responsive.ts +1 -1
  43. package/src/core/_compat/theme/theme.test.tsx +4 -5
  44. package/src/core/_compat/theme/themeColorProvider.tsx +4 -10
  45. package/src/core/_compat/theme/themeContext.ts +5 -5
  46. package/src/core/_compat/theme/themeProvider.tsx +19 -13
  47. package/src/core/_compat/theme/types.ts +2 -4
  48. package/src/core/_compat/theme/useRootTheme.ts +2 -4
  49. package/src/core/_compat/theme/useTheme.ts +3 -7
  50. package/src/core/_compat/types.ts +0 -73
  51. package/src/core/components/autocomplete/__workshop__/async.tsx +6 -6
  52. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +11 -18
  53. package/src/core/components/autocomplete/__workshop__/custom.tsx +21 -20
  54. package/src/core/components/autocomplete/__workshop__/example.tsx +17 -17
  55. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +5 -5
  56. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +57 -59
  57. package/src/core/components/autocomplete/autocomplete.tsx +106 -140
  58. package/src/core/components/autocomplete/autocompleteOption.tsx +1 -1
  59. package/src/core/components/autocomplete/autocompleteReducer.ts +1 -1
  60. package/src/core/components/autocomplete/constants.ts +1 -1
  61. package/src/core/components/autocomplete/types.ts +4 -9
  62. package/src/core/components/breadcrumbs/__workshop__/example.tsx +2 -3
  63. package/src/core/components/breadcrumbs/breadcrumbs.tsx +32 -28
  64. package/src/core/components/dialog/__workshop__/activate.tsx +4 -4
  65. package/src/core/components/dialog/__workshop__/autoFocus.tsx +2 -2
  66. package/src/core/components/dialog/__workshop__/onScroll.tsx +16 -4
  67. package/src/core/components/dialog/__workshop__/position.tsx +4 -4
  68. package/src/core/components/dialog/__workshop__/props.tsx +7 -7
  69. package/src/core/components/dialog/__workshop__/wrapped.tsx +2 -2
  70. package/src/core/components/dialog/dialog.tsx +104 -304
  71. package/src/core/components/dialog/dialogCard.tsx +190 -0
  72. package/src/core/components/dialog/dialogContext.ts +5 -3
  73. package/src/core/components/dialog/dialogProvider.tsx +6 -7
  74. package/src/core/components/dialog/isTargetWithinScope.ts +14 -0
  75. package/src/core/components/dialog/useDialog.ts +1 -1
  76. package/src/core/components/hotkeys/hotkeys.tsx +41 -27
  77. package/src/core/components/menu/__workshop__/asComponent.tsx +6 -6
  78. package/src/core/components/menu/__workshop__/closableMenuButton.tsx +5 -4
  79. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +2 -2
  80. package/src/core/components/menu/__workshop__/customMenuItem.tsx +3 -3
  81. package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +1 -1
  82. package/src/core/components/menu/__workshop__/groups.tsx +2 -2
  83. package/src/core/components/menu/__workshop__/menuButton.tsx +4 -4
  84. package/src/core/components/menu/__workshop__/menuGroupRight.tsx +1 -1
  85. package/src/core/components/menu/__workshop__/nestedMenu.tsx +1 -1
  86. package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +13 -4
  87. package/src/core/components/menu/__workshop__/selectedItem.tsx +2 -2
  88. package/src/core/components/menu/__workshop__/tones.tsx +3 -3
  89. package/src/core/components/menu/__workshop__/withoutArrow.tsx +1 -1
  90. package/src/core/components/menu/menu.test.tsx +6 -7
  91. package/src/core/components/menu/menu.tsx +27 -35
  92. package/src/core/components/menu/menuButton.tsx +18 -24
  93. package/src/core/components/menu/menuContext.ts +1 -1
  94. package/src/core/components/menu/menuDivider.tsx +25 -15
  95. package/src/core/components/menu/menuGroup.tsx +39 -33
  96. package/src/core/components/menu/menuItem.tsx +58 -46
  97. package/src/core/components/menu/useMenu.ts +1 -1
  98. package/src/core/components/menu/useMenuController.ts +4 -4
  99. package/src/core/components/skeleton/__workshop__/delay.tsx +3 -3
  100. package/src/core/components/skeleton/__workshop__/skeleton.tsx +4 -4
  101. package/src/core/components/skeleton/codeSkeleton.tsx +49 -0
  102. package/src/core/components/skeleton/headingSkeleton.tsx +48 -0
  103. package/src/core/components/skeleton/index.ts +3 -0
  104. package/src/core/components/skeleton/labelSkeleton.tsx +47 -0
  105. package/src/core/components/skeleton/skeleton.tsx +37 -18
  106. package/src/core/components/skeleton/textSkeleton.tsx +29 -112
  107. package/src/core/components/tab/__workshop__/example.tsx +2 -2
  108. package/src/core/components/tab/tab.tsx +28 -26
  109. package/src/core/components/tab/tabList.tsx +49 -28
  110. package/src/core/components/tab/tabPanel.tsx +29 -22
  111. package/src/core/components/toast/__workshop__/hook.tsx +1 -1
  112. package/src/core/components/toast/__workshop__/toast.tsx +5 -5
  113. package/src/core/components/toast/toast.test.tsx +5 -5
  114. package/src/core/components/toast/toast.tsx +30 -57
  115. package/src/core/components/toast/toastContext.ts +1 -1
  116. package/src/core/components/toast/toastLayer.tsx +29 -13
  117. package/src/core/components/toast/toastProvider.tsx +5 -10
  118. package/src/core/components/toast/types.ts +3 -7
  119. package/src/core/components/toast/useToast.ts +2 -4
  120. package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
  121. package/src/core/components/tree/__workshop__/basic.tsx +1 -1
  122. package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
  123. package/src/core/components/tree/helpers.ts +1 -1
  124. package/src/core/components/tree/tree.tsx +196 -191
  125. package/src/core/components/tree/treeContext.ts +1 -1
  126. package/src/core/components/tree/treeGroup.tsx +24 -6
  127. package/src/core/components/tree/treeItem.tsx +44 -34
  128. package/src/core/components/tree/types.ts +2 -2
  129. package/src/core/components/tree/useTree.ts +1 -1
  130. package/src/core/constants.ts +6 -0
  131. package/src/core/helpers/props.ts +18 -0
  132. package/src/core/hooks/index.ts +1 -0
  133. package/src/core/hooks/useArrayProp.ts +1 -4
  134. package/src/core/hooks/useClickOutside.test.tsx +15 -16
  135. package/src/core/hooks/useClickOutside.ts +2 -6
  136. package/src/core/hooks/useClickOutsideEvent.test.tsx +4 -5
  137. package/src/core/hooks/useClickOutsideEvent.ts +3 -9
  138. package/src/core/hooks/useDelayed.test.ts +6 -7
  139. package/src/core/hooks/useDelayedState.ts +1 -1
  140. package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -1
  141. package/src/core/hooks/useElementSize.ts +1 -1
  142. package/src/core/hooks/useForwardedRef.ts +1 -1
  143. package/src/core/hooks/useMatchMedia.ts +13 -31
  144. package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +1 -1
  145. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +3 -18
  146. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +12 -12
  147. package/src/core/hooks/usePrefersDark.hydration.test.tsx +4 -4
  148. package/src/core/hooks/usePrefersDark.test.tsx +1 -0
  149. package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +4 -4
  150. package/src/core/hooks/usePrefersReducedMotion.test.tsx +1 -0
  151. package/src/core/hooks/useResponsiveProp.ts +28 -0
  152. package/src/core/index.ts +0 -1
  153. package/src/core/lib/isArray.ts +3 -0
  154. package/src/core/middleware/origin.ts +1 -1
  155. package/src/core/primitives/_selectable/selectable.tsx +33 -24
  156. package/src/core/primitives/avatar/__workshop__/asButton.tsx +2 -2
  157. package/src/core/primitives/avatar/__workshop__/stack.tsx +2 -2
  158. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +2 -2
  159. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
  160. package/src/core/primitives/avatar/avatar.tsx +43 -48
  161. package/src/core/primitives/avatar/avatarCounter.tsx +46 -39
  162. package/src/core/primitives/avatar/avatarStack.tsx +44 -45
  163. package/src/core/primitives/avatar/types.ts +3 -3
  164. package/src/core/primitives/badge/__workshop__/props.tsx +6 -17
  165. package/src/core/primitives/badge/__workshop__/tones.tsx +1 -6
  166. package/src/core/primitives/badge/badge.test.tsx +2 -3
  167. package/src/core/primitives/badge/badge.tsx +34 -40
  168. package/src/core/primitives/badge/types.ts +2 -1
  169. package/src/core/primitives/box/__workshop__/props.tsx +2 -2
  170. package/src/core/primitives/box/__workshop__/responsive.tsx +2 -1
  171. package/src/core/primitives/box/box.tsx +153 -88
  172. package/src/core/primitives/button/__workshop__/custom.tsx +19 -42
  173. package/src/core/primitives/button/__workshop__/customIcons.tsx +3 -3
  174. package/src/core/primitives/button/__workshop__/disabled.tsx +9 -9
  175. package/src/core/primitives/button/__workshop__/props.tsx +19 -22
  176. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
  177. package/src/core/primitives/button/__workshop__/stacked.tsx +15 -16
  178. package/src/core/primitives/button/__workshop__/uploadButton.tsx +2 -1
  179. package/src/core/primitives/button/button.test.tsx +3 -18
  180. package/src/core/primitives/button/button.tsx +67 -76
  181. package/src/core/primitives/card/__workshop__/asButton.tsx +14 -14
  182. package/src/core/primitives/card/__workshop__/asComponent.tsx +3 -3
  183. package/src/core/primitives/card/__workshop__/checkered.tsx +1 -1
  184. package/src/core/primitives/card/__workshop__/index.ts +1 -1
  185. package/src/core/primitives/card/__workshop__/interactive.tsx +3 -4
  186. package/src/core/primitives/card/__workshop__/listNavigation.tsx +3 -3
  187. package/src/core/primitives/card/__workshop__/props.tsx +14 -17
  188. package/src/core/primitives/card/__workshop__/selected.tsx +10 -41
  189. package/src/core/primitives/card/__workshop__/{allTones.tsx → tones.tsx} +3 -3
  190. package/src/core/primitives/card/card.tsx +52 -48
  191. package/src/core/primitives/card/cardContext.ts +10 -0
  192. package/src/core/primitives/card/cardProvider.tsx +27 -0
  193. package/src/core/primitives/card/index.ts +2 -0
  194. package/src/core/primitives/card/types.ts +19 -3
  195. package/src/core/primitives/card/useCard.ts +9 -0
  196. package/src/core/primitives/checkbox/__workshop__/props.tsx +6 -4
  197. package/src/core/primitives/checkbox/__workshop__/tones.tsx +11 -20
  198. package/src/core/primitives/checkbox/checkbox.tsx +30 -23
  199. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
  200. package/src/core/primitives/code/__workshop__/props.tsx +4 -7
  201. package/src/core/primitives/code/code.tsx +27 -30
  202. package/src/core/primitives/code/refractor.tsx +0 -2
  203. package/src/core/primitives/container/__workshop__/example.tsx +2 -2
  204. package/src/core/primitives/container/container.tsx +27 -25
  205. package/src/core/primitives/flex/__workshop__/example.tsx +2 -2
  206. package/src/core/primitives/flex/flex.tsx +44 -17
  207. package/src/core/primitives/grid/grid.tsx +20 -17
  208. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +2 -2
  209. package/src/core/primitives/heading/__workshop__/plain.tsx +12 -15
  210. package/src/core/primitives/heading/heading.tsx +51 -33
  211. package/src/core/primitives/inline/__workshop__/plain.tsx +2 -5
  212. package/src/core/primitives/inline/inline.tsx +46 -27
  213. package/src/core/primitives/inline/types.ts +1 -0
  214. package/src/core/primitives/kbd/kbd.tsx +28 -28
  215. package/src/core/primitives/label/__workshop__/plain.tsx +8 -17
  216. package/src/core/primitives/label/label.tsx +49 -39
  217. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +6 -6
  218. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +3 -3
  219. package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
  220. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +3 -3
  221. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -4
  222. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +10 -6
  223. package/src/core/primitives/popover/__workshop__/TestStory.tsx +5 -4
  224. package/src/core/primitives/popover/constants.ts +1 -1
  225. package/src/core/primitives/popover/floating-ui/size.ts +2 -2
  226. package/src/core/primitives/popover/helpers.ts +1 -1
  227. package/src/core/primitives/popover/popover.tsx +299 -335
  228. package/src/core/primitives/popover/popoverLayer.tsx +147 -0
  229. package/src/core/primitives/popover/types.ts +3 -2
  230. package/src/core/primitives/radio/__workshop__/example.tsx +3 -3
  231. package/src/core/primitives/radio/__workshop__/plain.tsx +3 -3
  232. package/src/core/primitives/radio/radio.tsx +34 -19
  233. package/src/core/primitives/select/__workshop__/plain.tsx +15 -6
  234. package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
  235. package/src/core/primitives/select/select.tsx +28 -28
  236. package/src/core/primitives/spinner/__workshop__/Props.tsx +4 -5
  237. package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +7 -9
  238. package/src/core/primitives/spinner/spinner.tsx +27 -15
  239. package/src/core/primitives/stack/__workshop__/plain.tsx +2 -2
  240. package/src/core/primitives/stack/stack.tsx +44 -20
  241. package/src/core/primitives/switch/switch.tsx +31 -17
  242. package/src/core/primitives/text/__workshop__/colored.tsx +6 -6
  243. package/src/core/primitives/text/__workshop__/example.tsx +9 -20
  244. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
  245. package/src/core/primitives/text/text.tsx +52 -44
  246. package/src/core/primitives/textArea/__workshop__/plain.tsx +44 -33
  247. package/src/core/primitives/textArea/textArea.tsx +47 -22
  248. package/src/core/primitives/textInput/__workshop__/customValidity.tsx +2 -2
  249. package/src/core/primitives/textInput/__workshop__/plain.tsx +36 -30
  250. package/src/core/primitives/textInput/__workshop__/states.tsx +5 -5
  251. package/src/core/primitives/textInput/__workshop__/tones.tsx +2 -2
  252. package/src/core/primitives/textInput/__workshop__/typed.tsx +2 -2
  253. package/src/core/primitives/textInput/textInput.tsx +80 -106
  254. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +5 -5
  255. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +2 -2
  256. package/src/core/primitives/tooltip/__workshop__/props.tsx +9 -8
  257. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
  258. package/src/core/primitives/tooltip/constants.ts +1 -1
  259. package/src/core/primitives/tooltip/tooltip.test.tsx +61 -60
  260. package/src/core/primitives/tooltip/tooltip.tsx +107 -90
  261. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +1 -1
  262. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +3 -5
  263. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -1
  264. package/src/core/primitives/tooltip/tooltipLayer.tsx +105 -0
  265. package/src/core/primitives/types.ts +19 -30
  266. package/src/core/types/avatar.ts +3 -6
  267. package/src/core/types/badge.ts +2 -4
  268. package/src/core/types/button.ts +2 -4
  269. package/src/core/types/card.ts +2 -4
  270. package/src/core/types/dialog.ts +1 -3
  271. package/src/core/types/flex.ts +3 -3
  272. package/src/core/types/props.ts +20 -10
  273. package/src/core/types/selectable.ts +1 -1
  274. package/src/core/utils/arrow/arrow.tsx +43 -28
  275. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +5 -5
  276. package/src/core/utils/boundaryElement/boundaryElementContext.ts +1 -1
  277. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +4 -10
  278. package/src/core/utils/boundaryElement/types.ts +1 -3
  279. package/src/core/utils/boundaryElement/useBoundaryElement.ts +2 -4
  280. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +15 -8
  281. package/src/core/utils/elementQuery/elementQuery.tsx +41 -19
  282. package/src/core/utils/errorBoundary.tsx +6 -4
  283. package/src/core/utils/index.ts +0 -1
  284. package/src/core/utils/layer/__workshop__/multipleRoots.tsx +5 -5
  285. package/src/core/utils/layer/__workshop__/nested.tsx +3 -3
  286. package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +9 -5
  287. package/src/core/utils/layer/getLayerContext.test.ts +3 -1
  288. package/src/core/utils/layer/getLayerContext.ts +1 -1
  289. package/src/core/utils/layer/layer.test.tsx +5 -5
  290. package/src/core/utils/layer/layer.tsx +25 -95
  291. package/src/core/utils/layer/layerCard.tsx +90 -0
  292. package/src/core/utils/layer/layerContext.ts +1 -1
  293. package/src/core/utils/layer/layerProvider.tsx +20 -17
  294. package/src/core/utils/layer/useLayer.ts +2 -4
  295. package/src/core/utils/portal/__workshop__/named.tsx +3 -3
  296. package/src/core/utils/portal/portal.test.tsx +5 -5
  297. package/src/core/utils/portal/{portal.ts → portal.tsx} +17 -11
  298. package/src/core/utils/portal/portalContext.ts +1 -1
  299. package/src/core/utils/portal/portalProvider.tsx +4 -10
  300. package/src/core/utils/portal/types.ts +1 -3
  301. package/src/core/utils/portal/usePortal.ts +2 -4
  302. package/src/core/utils/srOnly/srOnly.tsx +25 -27
  303. package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +1 -1
  304. package/src/core/utils/virtualList/virtualList.tsx +71 -55
  305. package/src/css/__theme/index.ts +16 -0
  306. package/src/css/__theme/lib/contract/buildVarContract.ts +78 -0
  307. package/src/css/__theme/lib/contract/index.ts +4 -0
  308. package/src/css/__theme/lib/contract/types.ts +17 -0
  309. package/src/css/__theme/resolveTheme.ts +865 -0
  310. package/src/css/_assign.ts +3 -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/_responsiveClassName.ts +45 -0
  315. package/src/css/_responsiveStyle.css.ts +34 -0
  316. package/src/css/_style.css.ts +9 -0
  317. package/src/css/components/breadcrumbs/breadcrumbs.css.ts +6 -0
  318. package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -3
  319. package/src/css/components/dialog/dialog.css.ts +81 -0
  320. package/src/css/components/dialog/dialog.ts +20 -11
  321. package/src/css/components/index.ts +6 -0
  322. package/src/css/components/menu/menu.css.ts +14 -0
  323. package/src/css/components/menu/menu.ts +8 -5
  324. package/src/css/components/skeleton/skeleton.css.ts +132 -0
  325. package/src/css/components/skeleton/skeleton.ts +14 -9
  326. package/src/css/components/skeleton/types.ts +13 -5
  327. package/src/css/components/toast/toast.css.ts +16 -0
  328. package/src/css/components/toast/toast.ts +5 -15
  329. package/src/css/components/tree/tree.css.ts +65 -0
  330. package/src/css/components/tree/tree.ts +5 -3
  331. package/src/css/constants.ts +10 -0
  332. package/src/css/defaultTheme.css.ts +468 -0
  333. package/src/css/index.ts +12 -38
  334. package/src/css/layers.css.ts +9 -0
  335. package/src/css/primitives/_arrow/_arrow.css.ts +68 -0
  336. package/src/css/primitives/_arrow/_arrow.ts +18 -6
  337. package/src/css/primitives/_input/_input.css.ts +258 -0
  338. package/src/css/primitives/_input/input.ts +17 -14
  339. package/src/css/primitives/_input/types.ts +3 -3
  340. package/src/css/primitives/_selectable/_selectable.css.ts +121 -0
  341. package/src/css/primitives/_selectable/selectable.ts +5 -5
  342. package/src/css/primitives/_selectable/types.ts +3 -2
  343. package/src/css/primitives/avatar/avatar.css.ts +175 -0
  344. package/src/css/primitives/avatar/avatar.ts +52 -11
  345. package/src/css/primitives/avatar/types.ts +5 -3
  346. package/src/css/primitives/badge/badge.css.ts +26 -0
  347. package/src/css/primitives/badge/badge.ts +4 -4
  348. package/src/css/primitives/badge/types.ts +5 -4
  349. package/src/css/primitives/box/box.css.ts +19 -0
  350. package/src/css/primitives/box/box.ts +52 -16
  351. package/src/css/primitives/box/types.ts +46 -22
  352. package/src/css/primitives/button/button.css.ts +285 -0
  353. package/src/css/primitives/button/button.ts +15 -33
  354. package/src/css/primitives/button/index.ts +1 -0
  355. package/src/css/primitives/button/types.ts +19 -0
  356. package/src/css/primitives/card/card.css.ts +365 -0
  357. package/src/css/primitives/card/card.ts +9 -12
  358. package/src/css/primitives/card/types.ts +4 -6
  359. package/src/css/primitives/checkbox/checkbox.css.ts +193 -0
  360. package/src/css/primitives/checkbox/checkbox.ts +13 -5
  361. package/src/css/primitives/code/code.css.ts +271 -0
  362. package/src/css/primitives/code/code.ts +13 -5
  363. package/src/css/primitives/code/types.ts +4 -3
  364. package/src/css/primitives/container/container.css.ts +4 -0
  365. package/src/css/primitives/container/container.ts +12 -4
  366. package/src/css/primitives/container/types.ts +4 -2
  367. package/src/css/primitives/heading/heading.css.ts +85 -0
  368. package/src/css/primitives/heading/heading.ts +13 -11
  369. package/src/css/primitives/heading/types.ts +6 -3
  370. package/src/css/primitives/index.ts +24 -0
  371. package/src/css/primitives/kbd/kbd.css.ts +16 -0
  372. package/src/css/primitives/kbd/kbd.ts +6 -4
  373. package/src/css/primitives/kbd/types.ts +2 -3
  374. package/src/css/primitives/label/label.css.ts +85 -0
  375. package/src/css/primitives/label/label.ts +13 -10
  376. package/src/css/primitives/label/types.ts +13 -5
  377. package/src/css/primitives/popover/popover.css.ts +6 -0
  378. package/src/css/primitives/popover/popover.ts +10 -3
  379. package/src/css/primitives/radio/radio.css.ts +78 -0
  380. package/src/css/primitives/radio/radio.ts +15 -3
  381. package/src/css/primitives/select/select.css.ts +24 -0
  382. package/src/css/primitives/select/select.ts +7 -4
  383. package/src/css/primitives/select/types.ts +1 -1
  384. package/src/css/primitives/spinner/index.ts +1 -0
  385. package/src/css/primitives/spinner/spinner.css.ts +23 -0
  386. package/src/css/primitives/spinner/spinner.ts +9 -5
  387. package/src/css/primitives/spinner/types.ts +4 -0
  388. package/src/css/primitives/stack/index.ts +1 -0
  389. package/src/css/primitives/stack/stack.css.ts +6 -0
  390. package/src/css/primitives/stack/stack.ts +7 -0
  391. package/src/css/primitives/switch/switch.css.ts +98 -0
  392. package/src/css/primitives/switch/switch.ts +13 -7
  393. package/src/css/primitives/text/text.css.ts +85 -0
  394. package/src/css/primitives/text/text.ts +13 -11
  395. package/src/css/primitives/text/types.ts +9 -3
  396. package/src/css/primitives/textArea/textArea.css.ts +4 -0
  397. package/src/css/primitives/textArea/textArea.ts +5 -3
  398. package/src/css/primitives/textArea/types.ts +5 -3
  399. package/src/css/primitives/textInput/textInput.css.ts +41 -0
  400. package/src/css/primitives/textInput/textInput.ts +20 -4
  401. package/src/css/primitives/textInput/types.ts +3 -7
  402. package/src/css/primitives/tooltip/index.ts +1 -0
  403. package/src/css/primitives/tooltip/tooltip.css.ts +6 -0
  404. package/src/css/primitives/tooltip/tooltip.ts +8 -7
  405. package/src/css/primitives/tooltip/types.ts +4 -0
  406. package/src/css/props/alignItems/alignItems.css.ts +22 -0
  407. package/src/css/props/alignItems/alignItems.ts +8 -0
  408. package/src/css/props/alignItems/index.ts +2 -0
  409. package/src/css/props/alignItems/types.ts +9 -0
  410. package/src/css/props/border/border.css.ts +65 -0
  411. package/src/css/props/border/border.ts +36 -0
  412. package/src/css/props/border/types.ts +13 -0
  413. package/src/css/props/boxSizing/boxSizing.css.ts +11 -0
  414. package/src/css/props/boxSizing/boxSizing.ts +10 -0
  415. package/src/css/props/boxSizing/index.ts +2 -0
  416. package/src/css/props/boxSizing/types.ts +7 -0
  417. package/src/css/props/display/display.css.ts +56 -0
  418. package/src/css/props/display/display.ts +17 -0
  419. package/src/css/{styles → props}/display/types.ts +3 -4
  420. package/src/css/props/flex/flex.css.ts +52 -0
  421. package/src/css/props/flex/flex.ts +8 -0
  422. package/src/css/props/flex/types.ts +9 -0
  423. package/src/css/props/flexDirection/flexDirection.css.ts +19 -0
  424. package/src/css/props/flexDirection/flexDirection.ts +8 -0
  425. package/src/css/props/flexDirection/index.ts +2 -0
  426. package/src/css/props/flexDirection/types.ts +9 -0
  427. package/src/css/props/flexWrap/flexWrap.css.ts +16 -0
  428. package/src/css/props/flexWrap/flexWrap.ts +8 -0
  429. package/src/css/props/flexWrap/index.ts +2 -0
  430. package/src/css/props/flexWrap/types.ts +9 -0
  431. package/src/css/props/font/font.css.ts +93 -0
  432. package/src/css/props/font/font.ts +8 -0
  433. package/src/css/props/font/types.ts +6 -0
  434. package/src/css/props/gap/gap.css.ts +40 -0
  435. package/src/css/props/gap/gap.ts +13 -0
  436. package/src/css/{styles → props}/gap/types.ts +2 -2
  437. package/src/css/props/gridAutoColumns/gridAutoColumns.css.ts +19 -0
  438. package/src/css/props/gridAutoColumns/gridAutoColumns.ts +8 -0
  439. package/src/css/props/gridAutoColumns/index.ts +2 -0
  440. package/src/css/props/gridAutoColumns/types.ts +19 -0
  441. package/src/css/props/gridAutoFlow/gridAutoFlow.css.ts +19 -0
  442. package/src/css/props/gridAutoFlow/gridAutoFlow.ts +8 -0
  443. package/src/css/props/gridAutoFlow/index.ts +2 -0
  444. package/src/css/props/gridAutoFlow/types.ts +13 -0
  445. package/src/css/props/gridAutoRows/gridAutoRows.css.ts +19 -0
  446. package/src/css/props/gridAutoRows/gridAutoRows.ts +8 -0
  447. package/src/css/props/gridAutoRows/index.ts +2 -0
  448. package/src/css/props/gridAutoRows/types.ts +13 -0
  449. package/src/css/props/gridColumn/gridColumn.css.ts +49 -0
  450. package/src/css/props/gridColumn/gridColumn.ts +8 -0
  451. package/src/css/props/gridColumn/index.ts +2 -0
  452. package/src/css/props/gridColumn/types.ts +19 -0
  453. package/src/css/props/gridColumnEnd/gridColumnEnd.css.ts +46 -0
  454. package/src/css/props/gridColumnEnd/gridColumnEnd.ts +8 -0
  455. package/src/css/props/gridColumnEnd/index.ts +2 -0
  456. package/src/css/props/gridColumnEnd/types.ts +19 -0
  457. package/src/css/props/gridColumnStart/gridColumnStart.css.ts +46 -0
  458. package/src/css/props/gridColumnStart/gridColumnStart.ts +11 -0
  459. package/src/css/props/gridColumnStart/index.ts +2 -0
  460. package/src/css/props/gridColumnStart/types.ts +19 -0
  461. package/src/css/props/gridRow/gridRow.css.ts +49 -0
  462. package/src/css/props/gridRow/gridRow.ts +8 -0
  463. package/src/css/props/gridRow/index.ts +2 -0
  464. package/src/css/props/gridRow/types.ts +19 -0
  465. package/src/css/props/gridRowEnd/gridRowEnd.css.ts +46 -0
  466. package/src/css/props/gridRowEnd/gridRowEnd.ts +8 -0
  467. package/src/css/props/gridRowEnd/index.ts +2 -0
  468. package/src/css/props/gridRowEnd/types.ts +19 -0
  469. package/src/css/props/gridRowStart/gridRowStart.css.ts +46 -0
  470. package/src/css/props/gridRowStart/gridRowStart.ts +8 -0
  471. package/src/css/props/gridRowStart/index.ts +2 -0
  472. package/src/css/props/gridRowStart/types.ts +19 -0
  473. package/src/css/props/gridTemplateColumns/gridTemplateColumns.css.ts +43 -0
  474. package/src/css/props/gridTemplateColumns/gridTemplateColumns.ts +8 -0
  475. package/src/css/props/gridTemplateColumns/index.ts +2 -0
  476. package/src/css/props/gridTemplateColumns/types.ts +19 -0
  477. package/src/css/props/gridTemplateRows/gridTemplateRows.css.ts +43 -0
  478. package/src/css/props/gridTemplateRows/gridTemplateRows.ts +8 -0
  479. package/src/css/props/gridTemplateRows/index.ts +2 -0
  480. package/src/css/props/gridTemplateRows/types.ts +19 -0
  481. package/src/css/props/height/height.css.ts +25 -0
  482. package/src/css/props/height/height.ts +8 -0
  483. package/src/css/props/height/index.ts +2 -0
  484. package/src/css/props/height/types.ts +15 -0
  485. package/src/css/props/index.ts +37 -0
  486. package/src/css/props/inset/inset.css.ts +37 -0
  487. package/src/css/props/inset/inset.ts +21 -0
  488. package/src/css/{styles → props}/inset/types.ts +1 -1
  489. package/src/css/props/justifyContent/index.ts +2 -0
  490. package/src/css/props/justifyContent/justifyContent.css.ts +25 -0
  491. package/src/css/props/justifyContent/justifyContent.ts +8 -0
  492. package/src/css/props/justifyContent/types.ts +15 -0
  493. package/src/css/props/margin/margin.css.ts +117 -0
  494. package/src/css/props/margin/margin.ts +25 -0
  495. package/src/css/props/margin/types.ts +17 -0
  496. package/src/css/props/maxWidth/maxWidth.css.ts +32 -0
  497. package/src/css/props/maxWidth/maxWidth.ts +8 -0
  498. package/src/css/props/maxWidth/types.ts +11 -0
  499. package/src/css/props/minHeight/index.ts +2 -0
  500. package/src/css/props/minHeight/minHeight.css.ts +13 -0
  501. package/src/css/props/minHeight/minHeight.ts +8 -0
  502. package/src/css/props/minHeight/types.ts +9 -0
  503. package/src/css/props/minWidth/index.ts +2 -0
  504. package/src/css/props/minWidth/minWidth.css.ts +25 -0
  505. package/src/css/props/minWidth/minWidth.ts +8 -0
  506. package/src/css/props/minWidth/types.ts +9 -0
  507. package/src/css/props/outline/index.ts +2 -0
  508. package/src/css/props/outline/outline.css.ts +10 -0
  509. package/src/css/props/outline/outline.ts +8 -0
  510. package/src/css/props/outline/types.ts +7 -0
  511. package/src/css/props/overflow/overflow.css.ts +16 -0
  512. package/src/css/props/overflow/overflow.ts +8 -0
  513. package/src/css/props/overflow/types.ts +17 -0
  514. package/src/css/props/padding/padding.css.ts +87 -0
  515. package/src/css/props/padding/padding.ts +25 -0
  516. package/src/css/props/padding/types.ts +17 -0
  517. package/src/css/props/pointerEvents/pointerEvents.css.ts +13 -0
  518. package/src/css/props/pointerEvents/pointerEvents.ts +8 -0
  519. package/src/css/props/position/position.css.ts +22 -0
  520. package/src/css/props/position/position.ts +8 -0
  521. package/src/css/{styles → props}/position/types.ts +1 -1
  522. package/src/css/props/radius/radius.css.ts +21 -0
  523. package/src/css/props/radius/radius.ts +8 -0
  524. package/src/css/props/radius/types.ts +8 -0
  525. package/src/css/props/shadow/shadow.css.ts +23 -0
  526. package/src/css/props/shadow/shadow.ts +8 -0
  527. package/src/css/props/shadow/types.ts +8 -0
  528. package/src/css/props/textAlign/index.ts +2 -0
  529. package/src/css/props/textAlign/textAlign.css.ts +22 -0
  530. package/src/css/props/textAlign/textAlign.ts +8 -0
  531. package/src/css/props/textAlign/types.ts +7 -0
  532. package/src/css/props/textOverflow/textOverflow.css.ts +13 -0
  533. package/src/css/props/textOverflow/textOverflow.ts +8 -0
  534. package/src/css/{styles → props}/textOverflow/types.ts +5 -1
  535. package/src/css/props/width/types.ts +11 -0
  536. package/src/css/props/width/width.css.ts +28 -0
  537. package/src/css/props/width/width.ts +8 -0
  538. package/src/css/types.ts +221 -766
  539. package/src/css/util.ts +3 -8
  540. package/src/css/utils/index.ts +1 -0
  541. package/src/css/utils/srOnly/srOnly.css.ts +10 -0
  542. package/src/css/utils/srOnly/srOnly.ts +5 -3
  543. package/src/css/vars.css.ts +676 -0
  544. package/src/theme/getScopedTheme.ts +4 -4
  545. package/src/theme/index.ts +0 -5
  546. package/src/theme/types.ts +6 -10
  547. package/src/theme/v0/color/_generic.ts +1 -1
  548. package/src/theme/v0/color/button.ts +1 -1
  549. package/src/theme/v0/color/card.ts +1 -1
  550. package/src/theme/v0/color/color.ts +11 -11
  551. package/src/theme/v0/color/input.ts +1 -1
  552. package/src/theme/v0/color/muted.ts +1 -1
  553. package/src/theme/v0/color/selectable.ts +1 -1
  554. package/src/theme/v0/color/solid.ts +1 -1
  555. package/src/theme/v0/color/spot.ts +1 -1
  556. package/src/theme/v0/focusRing.ts +1 -3
  557. package/src/theme/v0/font.ts +6 -19
  558. package/src/theme/v0/layer.ts +1 -3
  559. package/src/theme/v0/shadow.ts +2 -6
  560. package/src/theme/v0/styles.ts +1 -1
  561. package/src/theme/v0/theme.ts +7 -7
  562. package/src/theme/v2/avatar.ts +2 -4
  563. package/src/theme/{build → v2/build}/_deprecated/color/_selectable/createSelectableTones.ts +3 -3
  564. package/src/theme/{build → v2/build}/_deprecated/color/_solid/createSolidTones.ts +2 -2
  565. package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonModes.ts +7 -2
  566. package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonTones.ts +4 -4
  567. package/src/theme/{build → v2/build}/_deprecated/color/card/createCardStates.ts +3 -3
  568. package/src/theme/{build → v2/build}/_deprecated/color/color.test.ts +1 -1
  569. package/src/theme/{build → v2/build}/_deprecated/color/defaults.ts +1 -1
  570. package/src/theme/{build → v2/build}/_deprecated/color/factory.ts +3 -3
  571. package/src/theme/{build → v2/build}/_deprecated/color/input/createInputModes.ts +7 -2
  572. package/src/theme/{build → v2/build}/_deprecated/color/muted/createMuted.ts +2 -2
  573. package/src/theme/{build → v2/build}/_deprecated/color/spot/createSpot.ts +2 -2
  574. package/src/theme/{build → v2/build}/buildColorTheme.test.ts +3 -1
  575. package/src/theme/{build → v2/build}/buildColorTheme.ts +24 -24
  576. package/src/theme/{build → v2/build}/buildTheme.test.ts +10 -8
  577. package/src/theme/v2/build/buildTheme.ts +12 -0
  578. package/src/theme/{build → v2/build}/colorToken/colorToken.ts +2 -2
  579. package/src/theme/{build → v2/build}/colorToken/compileColorToken.ts +1 -1
  580. package/src/theme/{build → v2/build}/colorToken/types.ts +2 -2
  581. package/src/theme/{build → v2/build}/lib/color-fns/blend/mix.ts +1 -1
  582. package/src/theme/{build → v2/build}/lib/color-fns/blend/multiply.ts +1 -1
  583. package/src/theme/{build → v2/build}/lib/color-fns/blend/screen.ts +1 -1
  584. package/src/theme/{build → v2/build}/lib/color-fns/color-fns.test.ts +1 -1
  585. package/src/theme/{build → v2/build}/lib/color-fns/contrastRatio.ts +5 -2
  586. package/src/theme/{build → v2/build}/lib/color-fns/convert.ts +1 -1
  587. package/src/theme/{build → v2/build}/lib/color-fns/parse.ts +1 -1
  588. package/src/theme/{build → v2/build}/mixThemeColor.test.ts +2 -0
  589. package/src/theme/{build → v2/build}/mixThemeColor.ts +1 -1
  590. package/src/theme/{build → v2/build}/renderColorTheme.ts +27 -27
  591. package/src/theme/{build → v2/build}/renderColorValue.ts +3 -3
  592. package/src/theme/{build → v2/build}/resolveColorTokens.ts +13 -13
  593. package/src/theme/v2/color/_helpers.ts +2 -2
  594. package/src/theme/v2/color/_system.ts +2 -4
  595. package/src/theme/v2/color/avatar.ts +3 -7
  596. package/src/theme/v2/color/badge.ts +3 -7
  597. package/src/theme/v2/color/button.ts +5 -11
  598. package/src/theme/v2/color/color.ts +10 -16
  599. package/src/theme/v2/color/input.ts +8 -10
  600. package/src/theme/v2/color/kbd.ts +1 -3
  601. package/src/theme/v2/color/selectable.ts +4 -8
  602. package/src/theme/v2/color/state.ts +5 -7
  603. package/src/theme/v2/color/syntax.ts +1 -3
  604. package/src/theme/{config → v2/config}/helpers.ts +6 -13
  605. package/src/theme/{config → v2/config}/system.ts +11 -12
  606. package/src/theme/{config → v2/config}/tokens/color/types.ts +14 -10
  607. package/src/theme/{config → v2/config}/tokens/index.ts +0 -1
  608. package/src/theme/{config → v2/config}/tokens/parseTokenValue.test.ts +2 -0
  609. package/src/theme/{config → v2/config}/tokens/parseTokenValue.ts +2 -2
  610. package/src/theme/{config → v2/config}/tokens/types.ts +3 -3
  611. package/src/theme/{config → v2/config}/types.ts +8 -6
  612. package/src/theme/{defaults → v2/defaults}/colorPalette.ts +1 -1
  613. package/src/theme/{defaults → v2/defaults}/colorTokens.ts +3 -3
  614. package/src/theme/{defaults → v2/defaults}/config.ts +2 -2
  615. package/src/theme/{defaults → v2/defaults}/fonts.ts +5 -6
  616. package/src/theme/v2/index.ts +2 -0
  617. package/src/theme/v2/input.ts +2 -4
  618. package/src/theme/v2/theme.ts +10 -14
  619. package/src/theme/{_constants.ts → v3/_constants.ts} +6 -3
  620. package/src/theme/v3/{color/parseColor.ts → _parseColorToken.ts} +59 -46
  621. package/src/theme/v3/buildTheme_v3.ts +20 -11
  622. package/src/theme/v3/color/_constants.ts +15 -0
  623. package/src/theme/v3/color/avatar.ts +14 -0
  624. package/src/theme/v3/color/card.ts +58 -95
  625. package/src/theme/v3/color/color.ts +75 -71
  626. package/src/theme/v3/color/element.ts +8 -8
  627. package/src/theme/v3/color/index.ts +2 -2
  628. package/src/theme/v3/color/token.ts +19 -4
  629. package/src/theme/v3/color/tokens.ts +2 -2
  630. package/src/theme/v3/defaultFonts.ts +250 -0
  631. package/src/theme/v3/defaultTokens.ts +199 -0
  632. package/src/theme/v3/index.ts +4 -1
  633. package/src/theme/{palette → v3/palette}/constants.ts +3 -3
  634. package/src/theme/v3/palette/types.ts +7 -0
  635. package/src/theme/v3/resolveTokens.ts +70 -65
  636. package/src/theme/v3/tokens.ts +2 -2
  637. package/src/theme/v3/types.ts +97 -12
  638. package/src/theme/versioning/getTheme_v2.ts +3 -3
  639. package/src/theme/versioning/is_v0.ts +2 -2
  640. package/src/theme/versioning/is_v2.ts +2 -2
  641. package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
  642. package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -1
  643. package/src/theme/versioning/themeColor_v3_v2.ts +229 -52
  644. package/src/theme/versioning/v0_v2.ts +3 -3
  645. package/src/theme/versioning/v2_v0.ts +4 -4
  646. package/src/theme/versioning/v3_v2.ts +62 -40
  647. package/dist/_chunks-cjs/_visual-editing.js +0 -3059
  648. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  649. package/dist/_chunks-cjs/buildCommand.js +0 -32
  650. package/dist/_chunks-cjs/buildCommand.js.map +0 -1
  651. package/dist/_chunks-cjs/refractor.js.map +0 -1
  652. package/dist/_chunks-cjs/v3_v2.js +0 -251
  653. package/dist/_chunks-cjs/v3_v2.js.map +0 -1
  654. package/dist/_chunks-es/_visual-editing.mjs +0 -3066
  655. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  656. package/dist/_chunks-es/refractor.mjs.map +0 -1
  657. package/dist/_chunks-es/v3_v2.mjs +0 -252
  658. package/dist/_chunks-es/v3_v2.mjs.map +0 -1
  659. package/dist/_visual-editing.d.mts +0 -806
  660. package/dist/_visual-editing.mjs +0 -31
  661. package/dist/_visual-editing.mjs.map +0 -1
  662. package/dist/cli.d.ts +0 -1
  663. package/dist/cli.js +0 -357
  664. package/dist/cli.js.map +0 -1
  665. package/dist/css.d.mts +0 -2135
  666. package/dist/css.mjs +0 -4713
  667. package/dist/css.mjs.map +0 -1
  668. package/dist/index.mjs +0 -1542
  669. package/dist/index.mjs.map +0 -1
  670. package/dist/sanity-palette.css +0 -9
  671. package/dist/sanity-theme.css +0 -1
  672. package/dist/system.css +0 -3577
  673. package/dist/theme.mjs.map +0 -1
  674. package/src/core/StyleTags.tsx +0 -24
  675. package/src/core/primitives/popover/popoverCard.tsx +0 -148
  676. package/src/core/primitives/tooltip/tooltipCard.tsx +0 -115
  677. package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
  678. package/src/core/utils/conditionalWrapper/index.ts +0 -1
  679. package/src/css/_resp.ts +0 -31
  680. package/src/css/compile/compilePalette.ts +0 -60
  681. package/src/css/compile/compileRule.ts +0 -90
  682. package/src/css/compile/compileRules.test.ts +0 -35
  683. package/src/css/compile/compileRules.ts +0 -40
  684. package/src/css/compile/compileSystem.ts +0 -7
  685. package/src/css/compile/compileTheme.ts +0 -15
  686. package/src/css/compile/compileTheme_v3.ts +0 -410
  687. package/src/css/compile/types.ts +0 -6
  688. package/src/css/components/breadcrumbs/rules.ts +0 -25
  689. package/src/css/components/dialog/rules.ts +0 -76
  690. package/src/css/components/menu/rules.ts +0 -15
  691. package/src/css/components/skeleton/rules.ts +0 -112
  692. package/src/css/components/toast/rules.ts +0 -17
  693. package/src/css/components/tree/rules.ts +0 -168
  694. package/src/css/composeClassNames.ts +0 -13
  695. package/src/css/primitives/_arrow/rules.ts +0 -71
  696. package/src/css/primitives/_input/rules.ts +0 -163
  697. package/src/css/primitives/_selectable/__style.ts +0 -117
  698. package/src/css/primitives/_selectable/_contants.ts +0 -11
  699. package/src/css/primitives/_selectable/rules.ts +0 -129
  700. package/src/css/primitives/avatar/rules.ts +0 -176
  701. package/src/css/primitives/badge/rules.ts +0 -22
  702. package/src/css/primitives/box/rules.ts +0 -28
  703. package/src/css/primitives/button/_constants.ts +0 -17
  704. package/src/css/primitives/button/rules.ts +0 -293
  705. package/src/css/primitives/card/_constants.ts +0 -13
  706. package/src/css/primitives/card/rules.ts +0 -471
  707. package/src/css/primitives/checkbox/__styles.ts +0 -129
  708. package/src/css/primitives/checkbox/rules.ts +0 -152
  709. package/src/css/primitives/code/rules.ts +0 -96
  710. package/src/css/primitives/container/rules.ts +0 -8
  711. package/src/css/primitives/heading/rules.ts +0 -155
  712. package/src/css/primitives/kbd/rules.ts +0 -20
  713. package/src/css/primitives/label/rules.ts +0 -137
  714. package/src/css/primitives/popover/rules.ts +0 -5
  715. package/src/css/primitives/radio/rules.ts +0 -121
  716. package/src/css/primitives/select/rules.ts +0 -22
  717. package/src/css/primitives/spinner/rules.ts +0 -20
  718. package/src/css/primitives/switch/rules.ts +0 -340
  719. package/src/css/primitives/text/rules.ts +0 -164
  720. package/src/css/primitives/textArea/rules.ts +0 -7
  721. package/src/css/primitives/textInput/rules.ts +0 -224
  722. package/src/css/primitives/token/rules.ts +0 -45
  723. package/src/css/primitives/tooltip/rules.ts +0 -19
  724. package/src/css/responsiveRules.ts +0 -25
  725. package/src/css/rules.ts +0 -113
  726. package/src/css/styles/border/border.ts +0 -22
  727. package/src/css/styles/border/rules.ts +0 -24
  728. package/src/css/styles/border/types.ts +0 -10
  729. package/src/css/styles/display/display.ts +0 -7
  730. package/src/css/styles/display/rules.ts +0 -62
  731. package/src/css/styles/flex/flex.ts +0 -20
  732. package/src/css/styles/flex/rules.ts +0 -28
  733. package/src/css/styles/flex/types.ts +0 -35
  734. package/src/css/styles/flexItem/flexItem.ts +0 -8
  735. package/src/css/styles/flexItem/index.ts +0 -2
  736. package/src/css/styles/flexItem/rules.ts +0 -12
  737. package/src/css/styles/flexItem/types.ts +0 -11
  738. package/src/css/styles/font/font.ts +0 -17
  739. package/src/css/styles/font/rules.ts +0 -148
  740. package/src/css/styles/font/types.ts +0 -12
  741. package/src/css/styles/gap/gap.ts +0 -8
  742. package/src/css/styles/gap/rules.ts +0 -34
  743. package/src/css/styles/grid/grid.ts +0 -13
  744. package/src/css/styles/grid/index.ts +0 -2
  745. package/src/css/styles/grid/rules.ts +0 -146
  746. package/src/css/styles/grid/types.ts +0 -29
  747. package/src/css/styles/gridItem/gridItem.ts +0 -15
  748. package/src/css/styles/gridItem/index.ts +0 -2
  749. package/src/css/styles/gridItem/rules.ts +0 -96
  750. package/src/css/styles/gridItem/types.ts +0 -41
  751. package/src/css/styles/height/rules.ts +0 -7
  752. package/src/css/styles/index.ts +0 -19
  753. package/src/css/styles/inset/inset.ts +0 -13
  754. package/src/css/styles/inset/rules.ts +0 -16
  755. package/src/css/styles/margin/margin.ts +0 -15
  756. package/src/css/styles/margin/rules.ts +0 -64
  757. package/src/css/styles/margin/types.ts +0 -11
  758. package/src/css/styles/maxWidth/maxWidth.ts +0 -6
  759. package/src/css/styles/maxWidth/rules.ts +0 -13
  760. package/src/css/styles/maxWidth/types.ts +0 -7
  761. package/src/css/styles/outline/rules.ts +0 -7
  762. package/src/css/styles/overflow/overflow.ts +0 -11
  763. package/src/css/styles/overflow/rules.ts +0 -9
  764. package/src/css/styles/overflow/types.ts +0 -11
  765. package/src/css/styles/padding/padding.ts +0 -15
  766. package/src/css/styles/padding/rules.ts +0 -62
  767. package/src/css/styles/padding/types.ts +0 -14
  768. package/src/css/styles/pointerEvents/pointerEvents.ts +0 -6
  769. package/src/css/styles/pointerEvents/rules.ts +0 -11
  770. package/src/css/styles/position/position.ts +0 -7
  771. package/src/css/styles/position/rules.ts +0 -24
  772. package/src/css/styles/radius/radius.ts +0 -8
  773. package/src/css/styles/radius/rules.ts +0 -13
  774. package/src/css/styles/radius/types.ts +0 -8
  775. package/src/css/styles/shadow/rules.ts +0 -53
  776. package/src/css/styles/shadow/shadow.ts +0 -7
  777. package/src/css/styles/shadow/types.ts +0 -8
  778. package/src/css/styles/textOverflow/rules.ts +0 -17
  779. package/src/css/styles/textOverflow/textOverflow.ts +0 -6
  780. package/src/css/styles/width/rules.ts +0 -7
  781. package/src/css/styles/width/types.ts +0 -9
  782. package/src/css/styles/width/width.ts +0 -6
  783. package/src/css/utils/srOnly/rules.ts +0 -11
  784. package/src/css/varNames.ts +0 -473
  785. package/src/css/vars.ts +0 -443
  786. package/src/theme/_types.ts +0 -41
  787. package/src/theme/build/buildTheme.ts +0 -12
  788. package/src/theme/build/theme.test.ts +0 -27
  789. package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
  790. package/src/theme/config/tokens/parseTokenKey.ts +0 -67
  791. package/src/theme/palette/types.ts +0 -16
  792. package/src/theme/v3/buildTheme_v3.test.ts +0 -40
  793. package/src/theme/v3/color/buildColor_v3.ts +0 -193
  794. package/src/theme/v3/color/parseColor.test.ts +0 -79
  795. package/src/theme/v3/color/renderColor.test.ts +0 -19
  796. package/src/theme/v3/color/renderColor.ts +0 -33
  797. package/src/theme/v3/defaults.ts +0 -205
  798. /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/apiStore.ts +0 -0
  799. /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/countries.ts +0 -0
  800. /package/src/css/{styles → props}/border/index.ts +0 -0
  801. /package/src/css/{styles → props}/display/index.ts +0 -0
  802. /package/src/css/{styles → props}/flex/index.ts +0 -0
  803. /package/src/css/{styles → props}/font/index.ts +0 -0
  804. /package/src/css/{styles → props}/gap/index.ts +0 -0
  805. /package/src/css/{styles → props}/inset/index.ts +0 -0
  806. /package/src/css/{styles → props}/margin/index.ts +0 -0
  807. /package/src/css/{styles → props}/maxWidth/index.ts +0 -0
  808. /package/src/css/{styles → props}/overflow/index.ts +0 -0
  809. /package/src/css/{styles → props}/padding/index.ts +0 -0
  810. /package/src/css/{styles → props}/pointerEvents/index.ts +0 -0
  811. /package/src/css/{styles → props}/pointerEvents/types.ts +0 -0
  812. /package/src/css/{styles → props}/position/index.ts +0 -0
  813. /package/src/css/{styles → props}/radius/index.ts +0 -0
  814. /package/src/css/{styles → props}/shadow/index.ts +0 -0
  815. /package/src/css/{styles → props}/textOverflow/index.ts +0 -0
  816. /package/src/css/{styles → props}/width/index.ts +0 -0
  817. /package/src/theme/{build → v2/build}/_deprecated/color/index.ts +0 -0
  818. /package/src/theme/{build → v2/build}/colorToken/index.ts +0 -0
  819. /package/src/theme/{build → v2/build}/index.ts +0 -0
  820. /package/src/theme/{build → v2/build}/lib/color-fns/blend/index.ts +0 -0
  821. /package/src/theme/{build → v2/build}/lib/color-fns/index.ts +0 -0
  822. /package/src/theme/{build → v2/build}/lib/color-fns/rgba.ts +0 -0
  823. /package/src/theme/{build → v2/build}/lib/color-fns/types.ts +0 -0
  824. /package/src/theme/{build → v2/build}/lib/isRecord.ts +0 -0
  825. /package/src/theme/{build → v2/build}/lib/utils.ts +0 -0
  826. /package/src/theme/{build → v2/build}/merge.ts +0 -0
  827. /package/src/theme/{config → v2/config}/index.ts +0 -0
  828. /package/src/theme/{config → v2/config}/tokens/color/index.ts +0 -0
  829. /package/src/theme/{palette → v3/palette}/index.ts +0 -0
@@ -1,3059 +0,0 @@
1
- "use strict";
2
- var jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), theme = require("@sanity/ui/theme"), react = require("react"), styledComponents = require("styled-components"), css = require("@sanity/ui/css"), ReactIs = require("react-is"), icons = require("@sanity/icons"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer"), useEffectEvent = require("use-effect-event"), reactDom = require("react-dom");
3
- function _interopDefaultCompat(e) {
4
- return e && typeof e == "object" && "default" in e ? e : { default: e };
5
- }
6
- var ReactIs__default = /* @__PURE__ */ _interopDefaultCompat(ReactIs);
7
- function getGlobalScope() {
8
- if (typeof globalThis < "u") return globalThis;
9
- if (typeof window < "u") return window;
10
- if (typeof self < "u") return self;
11
- if (typeof global < "u") return global;
12
- throw new Error("@sanity/ui: could not locate global scope");
13
- }
14
- const globalScope = getGlobalScope();
15
- function createGlobalScopedContext(key2, defaultValue) {
16
- const symbol = Symbol.for(key2);
17
- return typeof document > "u" ? react.createContext(defaultValue) : (globalScope[symbol] = globalScope[symbol] || react.createContext(defaultValue), globalScope[symbol]);
18
- }
19
- const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
20
- function ThemeProvider(props) {
21
- const $ = reactCompilerRuntime.c(15), parentTheme = react.useContext(ThemeContext), {
22
- children
23
- } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default");
24
- let t0;
25
- bb0: {
26
- if (!rootTheme) {
27
- t0 = null;
28
- break bb0;
29
- }
30
- let t12;
31
- $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
32
- version: 0,
33
- theme: rootTheme,
34
- scheme,
35
- tone
36
- }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
37
- }
38
- const themeContext = t0;
39
- let t1;
40
- bb1: {
41
- if (!rootTheme) {
42
- t1 = null;
43
- break bb1;
44
- }
45
- let t22;
46
- $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = theme.getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
47
- }
48
- const theme$1 = t1;
49
- if (!theme$1) {
50
- let t22;
51
- return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
52
- }
53
- let t2;
54
- $[9] !== children || $[10] !== theme$1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(styledComponents.ThemeProvider, { theme: theme$1, children }), $[9] = children, $[10] = theme$1, $[11] = t2) : t2 = $[11];
55
- let t3;
56
- return $[12] !== t2 || $[13] !== themeContext ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = t2, $[13] = themeContext, $[14] = t3) : t3 = $[14], t3;
57
- }
58
- ThemeProvider.displayName = "ThemeProvider";
59
- function useRootTheme() {
60
- const value = react.useContext(ThemeContext);
61
- if (!value)
62
- throw new Error("useRootTheme(): missing context value");
63
- return value;
64
- }
65
- function ThemeColorProvider(props) {
66
- const $ = reactCompilerRuntime.c(5), {
67
- children,
68
- scheme,
69
- tone
70
- } = props, root = useRootTheme(), t0 = scheme || root.scheme;
71
- let t1;
72
- return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { scheme: t0, theme: root.theme, tone, children }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
73
- }
74
- ThemeColorProvider.displayName = "ThemeColorProvider";
75
- function useTheme() {
76
- return styledComponents.useTheme();
77
- }
78
- function useTheme_v2() {
79
- const $ = reactCompilerRuntime.c(2), t0 = styledComponents.useTheme();
80
- let t1;
81
- return $[0] !== t0 ? (t1 = theme.getTheme_v2(t0), $[0] = t0, $[1] = t1) : t1 = $[1], t1;
82
- }
83
- const createColorTheme = theme.createColorTheme, hexToRgb = theme.hexToRgb, hslToRgb = theme.hslToRgb, multiply = theme.multiply, parseColor = theme.parseColor, rgbToHex = theme.rgbToHex, rgbToHsl = theme.rgbToHsl, rgba = theme.rgba, screen = theme.screen, studioTheme = theme.buildTheme(), EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_PROPS = {
84
- card: {
85
- initial: {
86
- scale: 0.97,
87
- willChange: "transform"
88
- },
89
- hidden: {
90
- opacity: 0
91
- },
92
- visible: {
93
- opacity: 1,
94
- transition: {
95
- when: "beforeChildren",
96
- duration: 0.1
97
- }
98
- },
99
- scaleIn: {
100
- scale: 1
101
- },
102
- scaleOut: {
103
- scale: 0.97
104
- }
105
- },
106
- transition: {
107
- type: "spring",
108
- visualDuration: 0.2,
109
- bounce: 0.25
110
- }
111
- };
112
- function _isEnterToClickElement(element) {
113
- return isHTMLAnchorElement(element) || isHTMLButtonElement(element);
114
- }
115
- function isHTMLElement(node) {
116
- return node instanceof Node && node.nodeType === Node.ELEMENT_NODE;
117
- }
118
- function isHTMLAnchorElement(element) {
119
- return isHTMLElement(element) && element.nodeName === "A";
120
- }
121
- function isHTMLInputElement(element) {
122
- return isHTMLElement(element) && element.nodeName === "INPUT";
123
- }
124
- function isHTMLButtonElement(element) {
125
- return isHTMLElement(element) && element.nodeName === "BUTTON";
126
- }
127
- function isHTMLSelectElement(element) {
128
- return isHTMLElement(element) && element.nodeName === "SELECT";
129
- }
130
- function isHTMLTextAreaElement(element) {
131
- return isHTMLElement(element) && element.nodeName === "TEXTAREA";
132
- }
133
- function containsOrEqualsElement(element, node) {
134
- return element.contains(node) || element === node;
135
- }
136
- function _getArrayProp(val, defaultVal) {
137
- return val === void 0 ? defaultVal || EMPTY_ARRAY : Array.isArray(val) ? val : [val];
138
- }
139
- function _isScrollable(el) {
140
- if (!(el instanceof Element)) return !1;
141
- const style = window.getComputedStyle(el);
142
- return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
143
- }
144
- function useArrayProp(val, defaultVal) {
145
- const $ = reactCompilerRuntime.c(3);
146
- let t0;
147
- $[0] !== defaultVal || $[1] !== val ? (t0 = () => [_getArrayProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2];
148
- const [t1, setCache] = react.useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
149
- return hash !== cachedHash && setCache([_getArrayProp(val, defaultVal), hash]), cachedVal;
150
- }
151
- function useClickOutsideEvent(listener, t0, boundaryElement) {
152
- const $ = reactCompilerRuntime.c(9), elementsArg = t0 === void 0 ? _temp$8 : t0;
153
- let t1;
154
- $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
155
- if (!listener)
156
- return;
157
- const target = evt.target;
158
- if (!(target instanceof Node))
159
- return;
160
- const resolvedBoundaryElement = boundaryElement?.();
161
- if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target))
162
- return;
163
- const elements = elementsArg().flat();
164
- for (const el of elements)
165
- if (el && (target === el || el.contains(target)))
166
- return;
167
- listener(evt);
168
- }, $[0] = boundaryElement, $[1] = elementsArg, $[2] = listener, $[3] = t1) : t1 = $[3];
169
- const onEvent = useEffectEvent.useEffectEvent(t1), hasListener = !!listener;
170
- let t2;
171
- $[4] !== hasListener || $[5] !== onEvent ? (t2 = () => {
172
- if (!hasListener)
173
- return;
174
- const handleEvent = (evt_0) => onEvent(evt_0);
175
- return document.addEventListener("mousedown", handleEvent), () => {
176
- document.removeEventListener("mousedown", handleEvent);
177
- };
178
- }, $[4] = hasListener, $[5] = onEvent, $[6] = t2) : t2 = $[6];
179
- let t3;
180
- $[7] !== hasListener ? (t3 = [hasListener], $[7] = hasListener, $[8] = t3) : t3 = $[8], react.useEffect(t2, t3), react.useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
181
- }
182
- function _temp$8() {
183
- return EMPTY_ARRAY;
184
- }
185
- function useCustomValidity(ref, customValidity) {
186
- const $ = reactCompilerRuntime.c(6);
187
- let t0;
188
- $[0] !== customValidity || $[1] !== ref.current ? (t0 = () => {
189
- ref.current?.setCustomValidity(customValidity || "");
190
- }, $[0] = customValidity, $[1] = ref.current, $[2] = t0) : t0 = $[2];
191
- let t1;
192
- $[3] !== customValidity || $[4] !== ref ? (t1 = [customValidity, ref], $[3] = customValidity, $[4] = ref, $[5] = t1) : t1 = $[5], react.useEffect(t0, t1);
193
- }
194
- const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : resizeObserver.ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
195
- function _createElementRectValueListener() {
196
- return {
197
- subscribe(element, subscriber) {
198
- const resizeObserver2 = new _ResizeObserver(([entry]) => {
199
- subscriber({
200
- _contentRect: entry.contentRect,
201
- border: {
202
- width: entry.borderBoxSize[0].inlineSize,
203
- height: entry.borderBoxSize[0].blockSize
204
- },
205
- content: {
206
- width: entry.contentRect.width,
207
- height: entry.contentRect.height
208
- }
209
- });
210
- });
211
- return resizeObserver2.observe(element), () => {
212
- resizeObserver2.unobserve(element), resizeObserver2.disconnect();
213
- };
214
- }
215
- };
216
- }
217
- function _createElementSizeObserver() {
218
- const disposeCache = /* @__PURE__ */ new WeakMap(), subscribersCache = /* @__PURE__ */ new WeakMap();
219
- return {
220
- subscribe(element, subscriber) {
221
- const subscribers = subscribersCache.get(element) || [];
222
- let dispose = disposeCache.get(element);
223
- return subscribersCache.has(element) || (subscribersCache.set(element, subscribers), dispose = _createElementRectValueListener().subscribe(element, (elementRect) => {
224
- for (const sub of subscribers)
225
- sub(elementRect);
226
- })), subscribers.push(subscriber), () => {
227
- const idx = subscribers.indexOf(subscriber);
228
- idx > -1 && subscribers.splice(idx, 1), subscribers.length === 0 && dispose && dispose();
229
- };
230
- }
231
- };
232
- }
233
- function useElementSize(element) {
234
- const $ = reactCompilerRuntime.c(3), [size2, setSize] = react.useState(null);
235
- let t0, t1;
236
- return $[0] !== element ? (t0 = () => {
237
- if (element)
238
- return _elementSizeObserver.subscribe(element, setSize);
239
- }, t1 = [element], $[0] = element, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), react.useEffect(t0, t1), size2;
240
- }
241
- function useGlobalKeyDown(onKeyDown) {
242
- const $ = reactCompilerRuntime.c(5);
243
- let t0;
244
- $[0] !== onKeyDown ? (t0 = (event) => onKeyDown(event), $[0] = onKeyDown, $[1] = t0) : t0 = $[1];
245
- const handleKeyDown = useEffectEvent.useEffectEvent(t0);
246
- let t1;
247
- $[2] !== handleKeyDown ? (t1 = () => {
248
- const handler = (event_0) => handleKeyDown(event_0);
249
- return window.addEventListener("keydown", handler), () => window.removeEventListener("keydown", handler);
250
- }, $[2] = handleKeyDown, $[3] = t1) : t1 = $[3];
251
- let t2;
252
- $[4] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[4] = t2) : t2 = $[4], react.useEffect(t1, t2);
253
- }
254
- function useMatchMedia(mediaQueryString, getServerSnapshot2) {
255
- const {
256
- subscribe,
257
- getSnapshot
258
- } = react.useMemo(() => {
259
- let MEDIA_QUERY_CACHE;
260
- const getMatchMedia = () => (MEDIA_QUERY_CACHE || (MEDIA_QUERY_CACHE = window.matchMedia(mediaQueryString)), MEDIA_QUERY_CACHE);
261
- return {
262
- subscribe: (onStoreChange) => {
263
- const matchMedia = getMatchMedia();
264
- return matchMedia.addEventListener("change", onStoreChange), () => matchMedia.removeEventListener("change", onStoreChange);
265
- },
266
- getSnapshot: () => getMatchMedia().matches
267
- };
268
- }, [mediaQueryString]);
269
- return react.useDebugValue(mediaQueryString), react.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot2);
270
- }
271
- function _getMediaQuery(media, index) {
272
- return index === 0 ? `screen and (max-width: ${media[index] - 1}px)` : index === media.length ? `screen and (min-width: ${media[index - 1]}px)` : `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`;
273
- }
274
- function _createMediaStore(media) {
275
- const mediaLen = media.length;
276
- let sizes;
277
- const getSizes = () => {
278
- if (!sizes) {
279
- sizes = [];
280
- for (let index = mediaLen; index > -1; index -= 1) {
281
- const mediaQuery = _getMediaQuery(media, index);
282
- sizes.push({
283
- index,
284
- mq: window.matchMedia(mediaQuery)
285
- });
286
- }
287
- }
288
- return sizes;
289
- };
290
- return {
291
- getSnapshot: () => {
292
- for (const {
293
- index,
294
- mq
295
- } of getSizes())
296
- if (mq.matches) return index;
297
- return 0;
298
- },
299
- subscribe: (onStoreChange) => {
300
- const disposeFns = [];
301
- for (const {
302
- mq
303
- } of getSizes()) {
304
- const handleChange = () => {
305
- mq.matches && onStoreChange();
306
- };
307
- mq.addEventListener("change", handleChange), disposeFns.push(() => mq.removeEventListener("change", handleChange));
308
- }
309
- return () => {
310
- for (const disposeFn of disposeFns)
311
- disposeFn();
312
- };
313
- }
314
- };
315
- }
316
- function getServerSnapshot() {
317
- return 0;
318
- }
319
- function useMediaIndex() {
320
- const $ = reactCompilerRuntime.c(2), {
321
- media
322
- } = useTheme_v2();
323
- let t0, t1;
324
- $[0] !== media ? (t1 = _createMediaStore(media), $[0] = media, $[1] = t1) : t1 = $[1], t0 = t1;
325
- const store = t0;
326
- return react.useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
327
- }
328
- function usePrefersDark(t0) {
329
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$7 : t0);
330
- }
331
- function _temp$7() {
332
- return !1;
333
- }
334
- function usePrefersReducedMotion(t0) {
335
- return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$6 : t0);
336
- }
337
- function _temp$6() {
338
- return !1;
339
- }
340
- const Box = react.forwardRef(function(props, ref) {
341
- const $ = reactCompilerRuntime.c(112);
342
- let align, border, borderBottom, borderLeft, borderRight, borderTop, className, column, columnEnd, columnStart, columns, direction, flex, gap, gapX, gapY, height, inset, insetBottom, insetLeft, insetRight, insetTop, justify, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, maxWidth, muted, overflow, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pointerEvents, position, radius, restProps, row, rowEnd, rowStart, rows, t0, t1, t2, t3, t4, width, wrap;
343
- $[0] !== props ? ({
344
- align,
345
- as: t0,
346
- border,
347
- borderTop,
348
- borderRight,
349
- borderBottom,
350
- borderLeft,
351
- className,
352
- column,
353
- columnStart,
354
- columnEnd,
355
- columns,
356
- direction,
357
- display: t1,
358
- flex,
359
- gap,
360
- gapX,
361
- gapY,
362
- height,
363
- inset,
364
- insetBottom,
365
- insetLeft,
366
- insetRight,
367
- insetTop,
368
- justify,
369
- margin: t2,
370
- marginX,
371
- marginY,
372
- marginTop,
373
- marginRight,
374
- marginBottom,
375
- marginLeft,
376
- maxWidth,
377
- overflow,
378
- padding: t3,
379
- paddingX,
380
- paddingY,
381
- paddingTop,
382
- paddingRight,
383
- paddingBottom,
384
- paddingLeft,
385
- pointerEvents,
386
- position,
387
- muted,
388
- radius,
389
- row,
390
- rows,
391
- rowStart,
392
- rowEnd,
393
- sizing: t4,
394
- width,
395
- wrap,
396
- ...restProps
397
- } = props, $[0] = props, $[1] = align, $[2] = border, $[3] = borderBottom, $[4] = borderLeft, $[5] = borderRight, $[6] = borderTop, $[7] = className, $[8] = column, $[9] = columnEnd, $[10] = columnStart, $[11] = columns, $[12] = direction, $[13] = flex, $[14] = gap, $[15] = gapX, $[16] = gapY, $[17] = height, $[18] = inset, $[19] = insetBottom, $[20] = insetLeft, $[21] = insetRight, $[22] = insetTop, $[23] = justify, $[24] = marginBottom, $[25] = marginLeft, $[26] = marginRight, $[27] = marginTop, $[28] = marginX, $[29] = marginY, $[30] = maxWidth, $[31] = muted, $[32] = overflow, $[33] = paddingBottom, $[34] = paddingLeft, $[35] = paddingRight, $[36] = paddingTop, $[37] = paddingX, $[38] = paddingY, $[39] = pointerEvents, $[40] = position, $[41] = radius, $[42] = restProps, $[43] = row, $[44] = rowEnd, $[45] = rowStart, $[46] = rows, $[47] = t0, $[48] = t1, $[49] = t2, $[50] = t3, $[51] = t4, $[52] = width, $[53] = wrap) : (align = $[1], border = $[2], borderBottom = $[3], borderLeft = $[4], borderRight = $[5], borderTop = $[6], className = $[7], column = $[8], columnEnd = $[9], columnStart = $[10], columns = $[11], direction = $[12], flex = $[13], gap = $[14], gapX = $[15], gapY = $[16], height = $[17], inset = $[18], insetBottom = $[19], insetLeft = $[20], insetRight = $[21], insetTop = $[22], justify = $[23], marginBottom = $[24], marginLeft = $[25], marginRight = $[26], marginTop = $[27], marginX = $[28], marginY = $[29], maxWidth = $[30], muted = $[31], overflow = $[32], paddingBottom = $[33], paddingLeft = $[34], paddingRight = $[35], paddingTop = $[36], paddingX = $[37], paddingY = $[38], pointerEvents = $[39], position = $[40], radius = $[41], restProps = $[42], row = $[43], rowEnd = $[44], rowStart = $[45], rows = $[46], t0 = $[47], t1 = $[48], t2 = $[49], t3 = $[50], t4 = $[51], width = $[52], wrap = $[53]);
398
- const As = t0 === void 0 ? "div" : t0, display = t1 === void 0 ? "block" : t1, margin = t2 === void 0 ? 0 : t2, padding = t3 === void 0 ? 0 : t3, sizing = t4 === void 0 ? "border" : t4;
399
- let t5;
400
- $[54] !== align || $[55] !== border || $[56] !== borderBottom || $[57] !== borderLeft || $[58] !== borderRight || $[59] !== borderTop || $[60] !== className || $[61] !== column || $[62] !== columnEnd || $[63] !== columnStart || $[64] !== columns || $[65] !== direction || $[66] !== display || $[67] !== flex || $[68] !== gap || $[69] !== gapX || $[70] !== gapY || $[71] !== height || $[72] !== inset || $[73] !== insetBottom || $[74] !== insetLeft || $[75] !== insetRight || $[76] !== insetTop || $[77] !== justify || $[78] !== margin || $[79] !== marginBottom || $[80] !== marginLeft || $[81] !== marginRight || $[82] !== marginTop || $[83] !== marginX || $[84] !== marginY || $[85] !== maxWidth || $[86] !== muted || $[87] !== overflow || $[88] !== padding || $[89] !== paddingBottom || $[90] !== paddingLeft || $[91] !== paddingRight || $[92] !== paddingTop || $[93] !== paddingX || $[94] !== paddingY || $[95] !== pointerEvents || $[96] !== position || $[97] !== radius || $[98] !== row || $[99] !== rowEnd || $[100] !== rowStart || $[101] !== rows || $[102] !== sizing || $[103] !== width || $[104] !== wrap ? (t5 = css.composeClassNames(className, css.box({
401
- align,
402
- border,
403
- borderTop,
404
- borderRight,
405
- borderBottom,
406
- borderLeft,
407
- column,
408
- columnStart,
409
- columnEnd,
410
- columns,
411
- direction,
412
- display,
413
- flex,
414
- gap,
415
- gapX,
416
- gapY,
417
- height,
418
- inset,
419
- insetBottom,
420
- insetLeft,
421
- insetRight,
422
- insetTop,
423
- justify,
424
- overflow,
425
- margin,
426
- marginX,
427
- marginY,
428
- marginTop,
429
- marginRight,
430
- marginBottom,
431
- marginLeft,
432
- maxWidth,
433
- muted,
434
- padding,
435
- paddingX,
436
- paddingY,
437
- paddingTop,
438
- paddingRight,
439
- paddingBottom,
440
- paddingLeft,
441
- pointerEvents,
442
- position,
443
- radius,
444
- row,
445
- rows,
446
- rowStart,
447
- rowEnd,
448
- sizing,
449
- width,
450
- wrap
451
- })), $[54] = align, $[55] = border, $[56] = borderBottom, $[57] = borderLeft, $[58] = borderRight, $[59] = borderTop, $[60] = className, $[61] = column, $[62] = columnEnd, $[63] = columnStart, $[64] = columns, $[65] = direction, $[66] = display, $[67] = flex, $[68] = gap, $[69] = gapX, $[70] = gapY, $[71] = height, $[72] = inset, $[73] = insetBottom, $[74] = insetLeft, $[75] = insetRight, $[76] = insetTop, $[77] = justify, $[78] = margin, $[79] = marginBottom, $[80] = marginLeft, $[81] = marginRight, $[82] = marginTop, $[83] = marginX, $[84] = marginY, $[85] = maxWidth, $[86] = muted, $[87] = overflow, $[88] = padding, $[89] = paddingBottom, $[90] = paddingLeft, $[91] = paddingRight, $[92] = paddingTop, $[93] = paddingX, $[94] = paddingY, $[95] = pointerEvents, $[96] = position, $[97] = radius, $[98] = row, $[99] = rowEnd, $[100] = rowStart, $[101] = rows, $[102] = sizing, $[103] = width, $[104] = wrap, $[105] = t5) : t5 = $[105];
452
- let t6;
453
- return $[106] !== As || $[107] !== props.children || $[108] !== ref || $[109] !== restProps || $[110] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(As, { "data-ui": "Box", ...restProps, className: t5, ref, children: props.children }), $[106] = As, $[107] = props.children, $[108] = ref, $[109] = restProps, $[110] = t5, $[111] = t6) : t6 = $[111], t6;
454
- });
455
- Box.displayName = "ForwardRef(Box)";
456
- const Label = react.forwardRef(function(props, ref) {
457
- const $ = reactCompilerRuntime.c(29);
458
- let accent, align, children, className, restProps, t0, t1, t2, t3, textOverflowProp;
459
- $[0] !== props ? ({
460
- accent,
461
- align,
462
- as: t0,
463
- children,
464
- className,
465
- muted: t1,
466
- size: t2,
467
- textOverflow: textOverflowProp,
468
- weight: t3,
469
- ...restProps
470
- } = props, $[0] = props, $[1] = accent, $[2] = align, $[3] = children, $[4] = className, $[5] = restProps, $[6] = t0, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = textOverflowProp) : (accent = $[1], align = $[2], children = $[3], className = $[4], restProps = $[5], t0 = $[6], t1 = $[7], t2 = $[8], t3 = $[9], textOverflowProp = $[10]);
471
- const As = t0 === void 0 ? "div" : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 1 : t2, weight = t3 === void 0 ? "medium" : t3;
472
- let t4;
473
- $[11] !== accent || $[12] !== align || $[13] !== className || $[14] !== muted || $[15] !== size2 || $[16] !== weight ? (t4 = css.composeClassNames(className, css.label({
474
- accent,
475
- align,
476
- muted,
477
- size: size2,
478
- weight
479
- })), $[11] = accent, $[12] = align, $[13] = className, $[14] = muted, $[15] = size2, $[16] = weight, $[17] = t4) : t4 = $[17];
480
- let t5;
481
- $[18] !== textOverflowProp ? (t5 = css.textOverflow({
482
- textOverflow: textOverflowProp
483
- }), $[18] = textOverflowProp, $[19] = t5) : t5 = $[19];
484
- let t6;
485
- $[20] !== children || $[21] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t5, children }), $[20] = children, $[21] = t5, $[22] = t6) : t6 = $[22];
486
- let t7;
487
- return $[23] !== As || $[24] !== ref || $[25] !== restProps || $[26] !== t4 || $[27] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(As, { "data-ui": "Label", ...restProps, className: t4, ref, children: t6 }), $[23] = As, $[24] = ref, $[25] = restProps, $[26] = t4, $[27] = t6, $[28] = t7) : t7 = $[28], t7;
488
- });
489
- Label.displayName = "ForwardRef(Label)";
490
- const Avatar = react.forwardRef(function(props, ref) {
491
- const $ = reactCompilerRuntime.c(54);
492
- let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, className, initials, onImageLoadError, restProps, src, t0, t1, t2, title;
493
- $[0] !== props ? ({
494
- __unstable_hideInnerStroke,
495
- as: asProp,
496
- className,
497
- color: t0,
498
- src,
499
- title,
500
- initials,
501
- onImageLoadError,
502
- arrowPosition: arrowPositionProp,
503
- animateArrowFrom,
504
- status: t1,
505
- size: t2,
506
- ...restProps
507
- } = props, $[0] = props, $[1] = __unstable_hideInnerStroke, $[2] = animateArrowFrom, $[3] = arrowPositionProp, $[4] = asProp, $[5] = className, $[6] = initials, $[7] = onImageLoadError, $[8] = restProps, $[9] = src, $[10] = t0, $[11] = t1, $[12] = t2, $[13] = title) : (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], asProp = $[4], className = $[5], initials = $[6], onImageLoadError = $[7], restProps = $[8], src = $[9], t0 = $[10], t1 = $[11], t2 = $[12], title = $[13]);
508
- const color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, As = ReactIs__default.default.isValidElementType(asProp) ? asProp : "div", size2 = useArrayProp(sizeProp), [arrowPosition, setArrowPosition] = react.useState(animateArrowFrom || arrowPositionProp || "inside"), [imageError, setImageError] = react.useState(!1);
509
- let t3, t4;
510
- $[14] !== arrowPosition || $[15] !== arrowPositionProp ? (t3 = () => {
511
- if (arrowPosition === arrowPositionProp)
512
- return;
513
- const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
514
- return () => cancelAnimationFrame(raf);
515
- }, t4 = [arrowPosition, arrowPositionProp], $[14] = arrowPosition, $[15] = arrowPositionProp, $[16] = t3, $[17] = t4) : (t3 = $[16], t4 = $[17]), react.useEffect(t3, t4);
516
- let t5, t6;
517
- $[18] !== src ? (t5 = () => {
518
- src && setImageError(!1);
519
- }, t6 = [src], $[18] = src, $[19] = t5, $[20] = t6) : (t5 = $[19], t6 = $[20]), react.useEffect(t5, t6);
520
- let t7;
521
- $[21] !== onImageLoadError ? (t7 = () => {
522
- setImageError(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
523
- }, $[21] = onImageLoadError, $[22] = t7) : t7 = $[22];
524
- const handleImageError = t7;
525
- let t8, t9;
526
- $[23] !== size2 ? (t9 = size2.map(_temp$5), $[23] = size2, $[24] = t9) : t9 = $[24], t8 = t9;
527
- const initialsSize = t8, t10 = __unstable_hideInnerStroke ? "" : void 0;
528
- let t11;
529
- $[25] !== className || $[26] !== color || $[27] !== sizeProp ? (t11 = css.composeClassNames(className, css.avatar({
530
- color,
531
- size: sizeProp
532
- })), $[25] = className, $[26] = color, $[27] = sizeProp, $[28] = t11) : t11 = $[28];
533
- const t12 = imageError ? "" : void 0;
534
- let t13;
535
- $[29] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css.avatarArrow(), $[29] = t13) : t13 = $[29];
536
- let t14;
537
- $[30] !== color ? (t14 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t13, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[30] = color, $[31] = t14) : t14 = $[31];
538
- let t15;
539
- $[32] === Symbol.for("react.memo_cache_sentinel") ? (t15 = css.avatarInitials(), $[32] = t15) : t15 = $[32];
540
- let t16;
541
- $[33] === Symbol.for("react.memo_cache_sentinel") ? (t16 = {
542
- color: "inherit"
543
- }, $[33] = t16) : t16 = $[33];
544
- let t17;
545
- $[34] !== initials || $[35] !== initialsSize ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(Box, { align: "center", as: "span", className: t15, display: "flex", justify: "center", position: "absolute", inset: 0, children: /* @__PURE__ */ jsxRuntime.jsx(Label, { align: "center", as: "span", size: initialsSize, style: t16, weight: "medium", children: initials }) }), $[34] = initials, $[35] = initialsSize, $[36] = t17) : t17 = $[36];
546
- let t18;
547
- $[37] !== handleImageError || $[38] !== initials || $[39] !== src ? (t18 = src && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: css.avatarImage(), inset: 0, position: "absolute", children: [
548
- /* @__PURE__ */ jsxRuntime.jsx("img", { alt: initials, onError: handleImageError, src }),
549
- /* @__PURE__ */ jsxRuntime.jsx("span", {})
550
- ] }), $[37] = handleImageError, $[38] = initials, $[39] = src, $[40] = t18) : t18 = $[40];
551
- let t19;
552
- return $[41] !== As || $[42] !== arrowPosition || $[43] !== ref || $[44] !== restProps || $[45] !== status || $[46] !== t10 || $[47] !== t11 || $[48] !== t12 || $[49] !== t14 || $[50] !== t17 || $[51] !== t18 || $[52] !== title ? (t19 = /* @__PURE__ */ jsxRuntime.jsxs(As, { "data-hide-inner-stroke": t10, "data-ui": "Avatar", ...restProps, "aria-label": title, className: t11, "data-arrow-position": arrowPosition, "data-image-error": t12, "data-status": status, ref, title, children: [
553
- t14,
554
- t17,
555
- t18
556
- ] }), $[41] = As, $[42] = arrowPosition, $[43] = ref, $[44] = restProps, $[45] = status, $[46] = t10, $[47] = t11, $[48] = t12, $[49] = t14, $[50] = t17, $[51] = t18, $[52] = title, $[53] = t19) : t19 = $[53], t19;
557
- });
558
- Avatar.displayName = "ForwardRef(Avatar)";
559
- function _temp$5(s) {
560
- return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
561
- }
562
- const AvatarCounter = react.forwardRef(function(props, ref) {
563
- const $ = reactCompilerRuntime.c(18);
564
- let className, count, restProps, t0;
565
- $[0] !== props ? ({
566
- className,
567
- count,
568
- size: t0,
569
- ...restProps
570
- } = props, $[0] = props, $[1] = className, $[2] = count, $[3] = restProps, $[4] = t0) : (className = $[1], count = $[2], restProps = $[3], t0 = $[4]);
571
- const size2 = useArrayProp(t0 === void 0 ? 1 : t0);
572
- let t1, t2;
573
- $[5] !== size2 ? (t2 = size2.map(_temp$4), $[5] = size2, $[6] = t2) : t2 = $[6], t1 = t2;
574
- const fontSize = t1;
575
- let t3;
576
- $[7] !== className || $[8] !== size2 ? (t3 = css.composeClassNames(className, css.avatarCounter({
577
- size: size2
578
- })), $[7] = className, $[8] = size2, $[9] = t3) : t3 = $[9];
579
- let t4;
580
- $[10] !== count || $[11] !== fontSize ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(Label, { align: "center", as: "span", size: fontSize, weight: "medium", children: count }), $[10] = count, $[11] = fontSize, $[12] = t4) : t4 = $[12];
581
- let t5;
582
- return $[13] !== ref || $[14] !== restProps || $[15] !== t3 || $[16] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "AvatarCounter", ...restProps, align: "center", className: t3, display: "flex", justify: "center", paddingX: 2, ref, sizing: "border", children: t4 }), $[13] = ref, $[14] = restProps, $[15] = t3, $[16] = t4, $[17] = t5) : t5 = $[17], t5;
583
- });
584
- AvatarCounter.displayName = "ForwardRef(AvatarCounter)";
585
- function _temp$4(s) {
586
- return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
587
- }
588
- const AvatarStack = react.forwardRef(function(props, ref) {
589
- const $ = reactCompilerRuntime.c(19);
590
- let childrenProp, className, restProps, t0, t1;
591
- $[0] !== props ? ({
592
- children: childrenProp,
593
- className,
594
- maxLength: t0,
595
- size: t1,
596
- ...restProps
597
- } = props, $[0] = props, $[1] = childrenProp, $[2] = className, $[3] = restProps, $[4] = t0, $[5] = t1) : (childrenProp = $[1], className = $[2], restProps = $[3], t0 = $[4], t1 = $[5]);
598
- const maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1, children = react.Children.toArray(childrenProp).filter(react.isValidElement), maxLength = Math.max(maxLengthProp, 0), size2 = useArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children, T0 = Box, t2 = "AvatarStack", t3 = "center";
599
- let t4;
600
- $[6] !== className || $[7] !== size2 ? (t4 = css.composeClassNames(className, css.avatarStack({
601
- size: size2
602
- })), $[6] = className, $[7] = size2, $[8] = t4) : t4 = $[8];
603
- const t5 = "flex", t6 = len === 0 && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: len, size: size2 }) }), t7 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: extraCount, size: size2 }) });
604
- let t8;
605
- $[9] !== size2 ? (t8 = (child, childIndex) => /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: "none", children: react.cloneElement(child, {
606
- size: size2
607
- }) }, String(childIndex)), $[9] = size2, $[10] = t8) : t8 = $[10];
608
- const t9 = visibleChildren.map(t8);
609
- let t10;
610
- return $[11] !== T0 || $[12] !== ref || $[13] !== restProps || $[14] !== t4 || $[15] !== t6 || $[16] !== t7 || $[17] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsxs(T0, { "data-ui": t2, ...restProps, align: t3, className: t4, display: t5, ref, children: [
611
- t6,
612
- t7,
613
- t9
614
- ] }), $[11] = T0, $[12] = ref, $[13] = restProps, $[14] = t4, $[15] = t6, $[16] = t7, $[17] = t9, $[18] = t10) : t10 = $[18], t10;
615
- });
616
- AvatarStack.displayName = "ForwardRef(AvatarStack)";
617
- const Text = react.forwardRef(function(props, ref) {
618
- const $ = reactCompilerRuntime.c(31);
619
- let align, children, className, flex, restProps, t0, t1, t2, t3, textOverflowProp, weight;
620
- $[0] !== props ? ({
621
- accent: t0,
622
- align,
623
- as: t1,
624
- children,
625
- className,
626
- flex,
627
- muted: t2,
628
- size: t3,
629
- textOverflow: textOverflowProp,
630
- weight,
631
- ...restProps
632
- } = props, $[0] = props, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = restProps, $[6] = t0, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = textOverflowProp, $[11] = weight) : (align = $[1], children = $[2], className = $[3], flex = $[4], restProps = $[5], t0 = $[6], t1 = $[7], t2 = $[8], t3 = $[9], textOverflowProp = $[10], weight = $[11]);
633
- const accent = t0 === void 0 ? !1 : t0, As = t1 === void 0 ? "div" : t1, muted = t2 === void 0 ? !1 : t2, size2 = t3 === void 0 ? 1 : t3;
634
- let t4;
635
- $[12] !== accent || $[13] !== align || $[14] !== className || $[15] !== flex || $[16] !== muted || $[17] !== size2 || $[18] !== weight ? (t4 = css.composeClassNames(className, css.text({
636
- accent,
637
- align,
638
- flex,
639
- muted,
640
- size: size2,
641
- weight
642
- })), $[12] = accent, $[13] = align, $[14] = className, $[15] = flex, $[16] = muted, $[17] = size2, $[18] = weight, $[19] = t4) : t4 = $[19];
643
- let t5;
644
- $[20] !== textOverflowProp ? (t5 = css.textOverflow({
645
- textOverflow: textOverflowProp
646
- }), $[20] = textOverflowProp, $[21] = t5) : t5 = $[21];
647
- let t6;
648
- $[22] !== children || $[23] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t5, children }), $[22] = children, $[23] = t5, $[24] = t6) : t6 = $[24];
649
- let t7;
650
- return $[25] !== As || $[26] !== ref || $[27] !== restProps || $[28] !== t4 || $[29] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(As, { "data-ui": "Text", ...restProps, ref, className: t4, children: t6 }), $[25] = As, $[26] = ref, $[27] = restProps, $[28] = t4, $[29] = t6, $[30] = t7) : t7 = $[30], t7;
651
- });
652
- Text.displayName = "ForwardRef(Text)";
653
- const Badge = react.forwardRef(function(props, ref) {
654
- const $ = reactCompilerRuntime.c(25);
655
- let children, className, restProps, t0, t1, t2, t3, t4, textAlign;
656
- if ($[0] !== props) {
657
- const {
658
- children: t52,
659
- className: t62,
660
- display: t72,
661
- fontSize: t8,
662
- mode: _deprecated_mode,
663
- padding: t9,
664
- radius: t10,
665
- textAlign: t11,
666
- tone: t12,
667
- ...t13
668
- } = props;
669
- children = t52, className = t62, t0 = t72, t1 = t8, t2 = t9, t3 = t10, textAlign = t11, t4 = t12, restProps = t13, $[0] = props, $[1] = children, $[2] = className, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = textAlign;
670
- } else
671
- children = $[1], className = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], textAlign = $[9];
672
- const display = t0 === void 0 ? "inline-block" : t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 1 : t2, radius = t3 === void 0 ? 2 : t3, tone = t4 === void 0 ? "default" : t4;
673
- let t5;
674
- $[10] !== className || $[11] !== radius || $[12] !== tone ? (t5 = css.composeClassNames(className, css.badge({
675
- radius,
676
- tone
677
- })), $[10] = className, $[11] = radius, $[12] = tone, $[13] = t5) : t5 = $[13];
678
- let t6;
679
- $[14] !== children || $[15] !== fontSize || $[16] !== textAlign ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(Text, { align: textAlign, size: fontSize, children }), $[14] = children, $[15] = fontSize, $[16] = textAlign, $[17] = t6) : t6 = $[17];
680
- let t7;
681
- return $[18] !== display || $[19] !== padding || $[20] !== ref || $[21] !== restProps || $[22] !== t5 || $[23] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Badge", ...restProps, className: t5, display, padding, ref, children: t6 }), $[18] = display, $[19] = padding, $[20] = ref, $[21] = restProps, $[22] = t5, $[23] = t6, $[24] = t7) : t7 = $[24], t7;
682
- });
683
- Badge.displayName = "ForwardRef(Badge)";
684
- function AnimatedSpinnerIcon(props) {
685
- const $ = reactCompilerRuntime.c(8);
686
- let className, restProps;
687
- $[0] !== props ? ({
688
- className,
689
- ...restProps
690
- } = props, $[0] = props, $[1] = className, $[2] = restProps) : (className = $[1], restProps = $[2]);
691
- let t0;
692
- $[3] !== className ? (t0 = css.composeClassNames(className, css.animatedSpinnerIcon()), $[3] = className, $[4] = t0) : t0 = $[4];
693
- let t1;
694
- return $[5] !== restProps || $[6] !== t0 ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(icons.SpinnerIcon, { ...restProps, "data-sanity-icon": "animated-spinner", className: t0 }), $[5] = restProps, $[6] = t0, $[7] = t1) : t1 = $[7], t1;
695
- }
696
- const Spinner = react.forwardRef(function(props, ref) {
697
- const $ = reactCompilerRuntime.c(5);
698
- let t0;
699
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = css.spinner(), $[0] = t0) : t0 = $[0];
700
- let t1;
701
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(AnimatedSpinnerIcon, {}), $[1] = t1) : t1 = $[1];
702
- let t2;
703
- return $[2] !== props || $[3] !== ref ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Text, { "data-ui": "Spinner", ...props, className: t0, ref, children: t1 }), $[2] = props, $[3] = ref, $[4] = t2) : t2 = $[4], t2;
704
- });
705
- Spinner.displayName = "ForwardRef(Spinner)";
706
- const Button = react.forwardRef(function(props, ref) {
707
- const {
708
- align = "center",
709
- as: As = "button",
710
- children,
711
- className,
712
- direction,
713
- disabled,
714
- display = "inline-flex",
715
- flex,
716
- fontSize = 1,
717
- gap = props.space ?? props.padding ?? 3,
718
- gapX,
719
- gapY,
720
- href,
721
- icon: IconComponent,
722
- iconRight: IconRightComponent,
723
- justify = "center",
724
- loading,
725
- mode = "default",
726
- padding = 3,
727
- paddingX,
728
- paddingY,
729
- paddingTop,
730
- paddingBottom,
731
- paddingLeft,
732
- paddingRight,
733
- radius = 2,
734
- selected,
735
- space = props.gap ?? props.space ?? props.padding ?? 3,
736
- // eslint-disable-line @typescript-eslint/no-unused-vars
737
- text,
738
- textAlign,
739
- textOverflow = "ellipsis",
740
- textWeight,
741
- tone = "default",
742
- type = "button",
743
- muted = !1,
744
- width,
745
- wrap,
746
- ...restProps
747
- } = props, {
748
- button: buttonTheme
749
- } = useTheme_v2();
750
- return /* @__PURE__ */ jsxRuntime.jsxs(As, { "data-ui": "Button", ...restProps, className: css.composeClassNames(className, css.button({
751
- display,
752
- flex,
753
- mode,
754
- radius,
755
- tone,
756
- width
757
- })), "data-disabled": loading || disabled ? "" : void 0, "data-selected": selected ? "" : void 0, disabled: !!(loading || disabled), href: disabled ? void 0 : href, ref, type, children: [
758
- !!loading && /* @__PURE__ */ jsxRuntime.jsx(Box, { align, as: "span", className: css.buttonLoadingBox(), display: "flex", flex: 1, justify, width: "fill", children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: fontSize }) }),
759
- (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Box, { as: "span", direction, display: "flex", flex: 1, gap, gapX, gapY, justify, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, width: "fill", wrap, children: [
760
- IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
761
- react.isValidElement(IconComponent) && IconComponent,
762
- ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
763
- ] }),
764
- text && /* @__PURE__ */ jsxRuntime.jsx(Text, { align: textAlign, as: "span", flex: "none", muted, size: fontSize, textOverflow, weight: textWeight ?? buttonTheme.textWeight, children: text }),
765
- IconRightComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
766
- react.isValidElement(IconRightComponent) && IconRightComponent,
767
- ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
768
- ] })
769
- ] }),
770
- children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", direction, display: "flex", flex: 1, gap, gapX, gapY, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, width: "fill", wrap, children })
771
- ] });
772
- });
773
- Button.displayName = "ForwardRef(Button)";
774
- const Card = react.forwardRef(function(props, ref) {
775
- const $ = reactCompilerRuntime.c(35);
776
- let asProp, className, pressed, restProps, schemeProp, selectable, selected, shadow, style, t0, t1, t2, toneProp;
777
- $[0] !== props ? ({
778
- __unstable_checkered: t0,
779
- __unstable_focusRing: t1,
780
- as: asProp,
781
- className,
782
- pressed,
783
- radius: t2,
784
- scheme: schemeProp,
785
- selectable,
786
- selected,
787
- shadow,
788
- style,
789
- tone: toneProp,
790
- ...restProps
791
- } = props, $[0] = props, $[1] = asProp, $[2] = className, $[3] = pressed, $[4] = restProps, $[5] = schemeProp, $[6] = selectable, $[7] = selected, $[8] = shadow, $[9] = style, $[10] = t0, $[11] = t1, $[12] = t2, $[13] = toneProp) : (asProp = $[1], className = $[2], pressed = $[3], restProps = $[4], schemeProp = $[5], selectable = $[6], selected = $[7], shadow = $[8], style = $[9], t0 = $[10], t1 = $[11], t2 = $[12], toneProp = $[13]);
792
- const checkered = t0 === void 0 ? !1 : t0, focusRing = t1 === void 0 ? !1 : t1, radius = t2 === void 0 ? 0 : t2, as = ReactIs.isValidElementType(asProp) ? asProp : "div", rootTheme = useRootTheme(), tone = toneProp === "inherit" ? rootTheme.tone : toneProp, scheme = schemeProp === void 0 ? rootTheme.scheme : schemeProp, t3 = scheme === rootTheme.scheme ? void 0 : scheme, t4 = tone === rootTheme.tone ? void 0 : tone;
793
- let t5;
794
- $[14] !== className || $[15] !== shadow || $[16] !== t3 || $[17] !== t4 ? (t5 = css.composeClassNames(className, css.card({
795
- scheme: t3,
796
- shadow,
797
- tone: t4
798
- })), $[14] = className, $[15] = shadow, $[16] = t3, $[17] = t4, $[18] = t5) : t5 = $[18];
799
- const t6 = checkered ? "" : void 0, t7 = focusRing ? "" : void 0, t8 = pressed ? "" : void 0, t9 = selectable ? "" : void 0, t10 = selected ? "" : void 0;
800
- let t11;
801
- $[19] !== as || $[20] !== radius || $[21] !== ref || $[22] !== restProps || $[23] !== style || $[24] !== t10 || $[25] !== t5 || $[26] !== t6 || $[27] !== t7 || $[28] !== t8 || $[29] !== t9 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Card", ...restProps, as, className: t5, "data-checkered": t6, "data-focus-ring": t7, "data-pressed": t8, "data-selectable": t9, "data-selected": t10, radius, ref, style }), $[19] = as, $[20] = radius, $[21] = ref, $[22] = restProps, $[23] = style, $[24] = t10, $[25] = t5, $[26] = t6, $[27] = t7, $[28] = t8, $[29] = t9, $[30] = t11) : t11 = $[30];
802
- const node = t11;
803
- if (scheme === rootTheme.scheme && tone === rootTheme.tone)
804
- return node;
805
- const t12 = tone ?? rootTheme.tone;
806
- let t13;
807
- return $[31] !== node || $[32] !== scheme || $[33] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(ThemeColorProvider, { scheme, tone: t12, children: node }), $[31] = node, $[32] = scheme, $[33] = t12, $[34] = t13) : t13 = $[34], t13;
808
- });
809
- Card.displayName = "ForwardRef(Card)";
810
- const Checkbox = react.forwardRef(function(props, forwardedRef) {
811
- const $ = reactCompilerRuntime.c(31);
812
- let checked, className, customValidity, disabled, indeterminate, readOnly, restProps, style;
813
- $[0] !== props ? ({
814
- checked,
815
- className,
816
- disabled,
817
- indeterminate,
818
- customValidity,
819
- readOnly,
820
- style,
821
- ...restProps
822
- } = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = customValidity, $[4] = disabled, $[5] = indeterminate, $[6] = readOnly, $[7] = restProps, $[8] = style) : (checked = $[1], className = $[2], customValidity = $[3], disabled = $[4], indeterminate = $[5], readOnly = $[6], restProps = $[7], style = $[8]);
823
- const ref = react.useRef(null);
824
- let t0;
825
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[9] = t0) : t0 = $[9], react.useImperativeHandle(forwardedRef, t0);
826
- let t1, t2;
827
- $[10] !== indeterminate ? (t1 = () => {
828
- ref.current && (ref.current.indeterminate = indeterminate || !1);
829
- }, t2 = [indeterminate], $[10] = indeterminate, $[11] = t1, $[12] = t2) : (t1 = $[11], t2 = $[12]), react.useEffect(t1, t2), useCustomValidity(ref, customValidity);
830
- let t3;
831
- $[13] !== className ? (t3 = css.composeClassNames(className, css.checkbox()), $[13] = className, $[14] = t3) : t3 = $[14];
832
- let t4;
833
- $[15] !== className ? (t4 = css.composeClassNames(className, css.checkboxInput()), $[15] = className, $[16] = t4) : t4 = $[16];
834
- const t5 = disabled ? "" : void 0, t6 = !disabled && readOnly ? "" : void 0, t7 = customValidity ? "" : void 0, t8 = disabled || readOnly;
835
- let t9;
836
- $[17] !== checked || $[18] !== readOnly || $[19] !== restProps || $[20] !== t4 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx("input", { ...restProps, checked, className: t4, "data-disabled": t5, "data-read-only": t6, "data-error": t7, disabled: t8, type: "checkbox", readOnly, ref }), $[17] = checked, $[18] = readOnly, $[19] = restProps, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25];
837
- let t10;
838
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
839
- /* @__PURE__ */ jsxRuntime.jsx(icons.CheckmarkIcon, {}),
840
- /* @__PURE__ */ jsxRuntime.jsx(icons.RemoveIcon, {})
841
- ] }), $[26] = t10) : t10 = $[26];
842
- let t11;
843
- return $[27] !== style || $[28] !== t3 || $[29] !== t9 ? (t11 = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: t3, "data-ui": "Checkbox", style, children: [
844
- t9,
845
- t10
846
- ] }), $[27] = style, $[28] = t3, $[29] = t9, $[30] = t11) : t11 = $[30], t11;
847
- });
848
- Checkbox.displayName = "ForwardRef(Checkbox)";
849
- const LazyRefractor = react.lazy(() => Promise.resolve().then(function() {
850
- return require("./refractor.js");
851
- })), Code = react.forwardRef(function(props, ref) {
852
- const $ = reactCompilerRuntime.c(26);
853
- let children, className, languageProp, restProps, t0, t1, weight;
854
- $[0] !== props ? ({
855
- as: t0,
856
- children,
857
- className,
858
- language: languageProp,
859
- size: t1,
860
- weight,
861
- ...restProps
862
- } = props, $[0] = props, $[1] = children, $[2] = className, $[3] = languageProp, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = weight) : (children = $[1], className = $[2], languageProp = $[3], restProps = $[4], t0 = $[5], t1 = $[6], weight = $[7]);
863
- const As = t0 === void 0 ? "pre" : t0, size2 = t1 === void 0 ? 1 : t1, language = typeof languageProp == "string" ? languageProp : void 0;
864
- let t2;
865
- $[8] !== className || $[9] !== size2 || $[10] !== weight ? (t2 = css.composeClassNames(className, css.code({
866
- size: size2,
867
- weight
868
- })), $[8] = className, $[9] = size2, $[10] = weight, $[11] = t2) : t2 = $[11];
869
- let t3;
870
- $[12] !== children ? (t3 = /* @__PURE__ */ jsxRuntime.jsx("code", { children }), $[12] = children, $[13] = t3) : t3 = $[13];
871
- let t4;
872
- $[14] !== children || $[15] !== language ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(LazyRefractor, { language, value: children }), $[14] = children, $[15] = language, $[16] = t4) : t4 = $[16];
873
- let t5;
874
- $[17] !== t3 || $[18] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: t3, children: t4 }), $[17] = t3, $[18] = t4, $[19] = t5) : t5 = $[19];
875
- let t6;
876
- return $[20] !== As || $[21] !== ref || $[22] !== restProps || $[23] !== t2 || $[24] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(As, { "data-ui": "Code", ...restProps, className: t2, ref, children: t5 }), $[20] = As, $[21] = ref, $[22] = restProps, $[23] = t2, $[24] = t5, $[25] = t6) : t6 = $[25], t6;
877
- });
878
- Code.displayName = "ForwardRef(Code)";
879
- const Container = react.forwardRef(function(props, ref) {
880
- const $ = reactCompilerRuntime.c(15);
881
- let as, className, restProps, t0, t1;
882
- $[0] !== props ? ({
883
- as,
884
- className,
885
- sizing: t0,
886
- width: t1,
887
- ...restProps
888
- } = props, $[0] = props, $[1] = as, $[2] = className, $[3] = restProps, $[4] = t0, $[5] = t1) : (as = $[1], className = $[2], restProps = $[3], t0 = $[4], t1 = $[5]);
889
- const sizing = t0 === void 0 ? "border" : t0, width = t1 === void 0 ? 2 : t1;
890
- let t2;
891
- $[6] !== className || $[7] !== width ? (t2 = css.composeClassNames(className, css.container({
892
- width
893
- })), $[6] = className, $[7] = width, $[8] = t2) : t2 = $[8];
894
- let t3;
895
- return $[9] !== as || $[10] !== ref || $[11] !== restProps || $[12] !== sizing || $[13] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Container", ...restProps, as, className: t2, ref, sizing }), $[9] = as, $[10] = ref, $[11] = restProps, $[12] = sizing, $[13] = t2, $[14] = t3) : t3 = $[14], t3;
896
- });
897
- Container.displayName = "ForwardRef(Container)";
898
- const Flex = react.forwardRef(function(props, ref) {
899
- const $ = reactCompilerRuntime.c(9);
900
- let as, restProps, t0;
901
- $[0] !== props ? ({
902
- as,
903
- direction: t0,
904
- ...restProps
905
- } = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = t0) : (as = $[1], restProps = $[2], t0 = $[3]);
906
- const direction = t0 === void 0 ? "row" : t0;
907
- let t1;
908
- return $[4] !== as || $[5] !== direction || $[6] !== ref || $[7] !== restProps ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Flex", ...restProps, as, direction, display: "flex", ref }), $[4] = as, $[5] = direction, $[6] = ref, $[7] = restProps, $[8] = t1) : t1 = $[8], t1;
909
- });
910
- Flex.displayName = "ForwardRef(Flex)";
911
- const Grid = react.forwardRef(function(props, ref) {
912
- const $ = reactCompilerRuntime.c(9);
913
- let as, children, restProps;
914
- $[0] !== props ? ({
915
- as,
916
- children,
917
- ...restProps
918
- } = props, $[0] = props, $[1] = as, $[2] = children, $[3] = restProps) : (as = $[1], children = $[2], restProps = $[3]);
919
- let t0;
920
- return $[4] !== as || $[5] !== children || $[6] !== ref || $[7] !== restProps ? (t0 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Grid", ...restProps, as, display: "grid", ref, children }), $[4] = as, $[5] = children, $[6] = ref, $[7] = restProps, $[8] = t0) : t0 = $[8], t0;
921
- });
922
- Grid.displayName = "ForwardRef(Grid)";
923
- const Heading = react.forwardRef(function(props, ref) {
924
- const $ = reactCompilerRuntime.c(31);
925
- let align, children, className, flex, restProps, t0, t1, t2, t3, textOverflowProp, weight;
926
- $[0] !== props ? ({
927
- accent: t0,
928
- align,
929
- as: t1,
930
- children,
931
- className,
932
- flex,
933
- muted: t2,
934
- size: t3,
935
- textOverflow: textOverflowProp,
936
- weight,
937
- ...restProps
938
- } = props, $[0] = props, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = restProps, $[6] = t0, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = textOverflowProp, $[11] = weight) : (align = $[1], children = $[2], className = $[3], flex = $[4], restProps = $[5], t0 = $[6], t1 = $[7], t2 = $[8], t3 = $[9], textOverflowProp = $[10], weight = $[11]);
939
- const accent = t0 === void 0 ? !1 : t0, As = t1 === void 0 ? "div" : t1, muted = t2 === void 0 ? !1 : t2, size2 = t3 === void 0 ? 1 : t3;
940
- let t4;
941
- $[12] !== accent || $[13] !== align || $[14] !== className || $[15] !== flex || $[16] !== muted || $[17] !== size2 || $[18] !== weight ? (t4 = css.composeClassNames(className, css.heading({
942
- accent,
943
- align,
944
- flex,
945
- muted,
946
- size: size2,
947
- weight
948
- })), $[12] = accent, $[13] = align, $[14] = className, $[15] = flex, $[16] = muted, $[17] = size2, $[18] = weight, $[19] = t4) : t4 = $[19];
949
- let t5;
950
- $[20] !== textOverflowProp ? (t5 = css.textOverflow({
951
- textOverflow: textOverflowProp
952
- }), $[20] = textOverflowProp, $[21] = t5) : t5 = $[21];
953
- let t6;
954
- $[22] !== children || $[23] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t5, children }), $[22] = children, $[23] = t5, $[24] = t6) : t6 = $[24];
955
- let t7;
956
- return $[25] !== As || $[26] !== ref || $[27] !== restProps || $[28] !== t4 || $[29] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(As, { "data-ui": "Heading", ...restProps, className: t4, ref, children: t6 }), $[25] = As, $[26] = ref, $[27] = restProps, $[28] = t4, $[29] = t6, $[30] = t7) : t7 = $[30], t7;
957
- });
958
- Heading.displayName = "ForwardRef(Heading)";
959
- const Inline = react.forwardRef(function(props, ref) {
960
- const $ = reactCompilerRuntime.c(18);
961
- let as, childrenProp, gap, gapX, gapY, restProps, space;
962
- $[0] !== props ? ({
963
- as,
964
- children: childrenProp,
965
- gap,
966
- gapX,
967
- gapY,
968
- space,
969
- ...restProps
970
- } = props, $[0] = props, $[1] = as, $[2] = childrenProp, $[3] = gap, $[4] = gapX, $[5] = gapY, $[6] = restProps, $[7] = space) : (as = $[1], childrenProp = $[2], gap = $[3], gapX = $[4], gapY = $[5], restProps = $[6], space = $[7]);
971
- let t0, t1;
972
- $[8] !== childrenProp ? (t1 = react.Children.map(childrenProp, _temp$3), $[8] = childrenProp, $[9] = t1) : t1 = $[9], t0 = t1;
973
- const children = t0, t2 = gap ?? space;
974
- let t3;
975
- return $[10] !== as || $[11] !== children || $[12] !== gapX || $[13] !== gapY || $[14] !== ref || $[15] !== restProps || $[16] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Inline", ...restProps, align: "center", as, display: "flex", gap: t2, gapX, gapY, ref, wrap: "wrap", children }), $[10] = as, $[11] = children, $[12] = gapX, $[13] = gapY, $[14] = ref, $[15] = restProps, $[16] = t2, $[17] = t3) : t3 = $[17], t3;
976
- });
977
- Inline.displayName = "ForwardRef(Inline)";
978
- function _temp$3(child) {
979
- return child && /* @__PURE__ */ jsxRuntime.jsx(Box, { maxWidth: "fill", children: child });
980
- }
981
- const KBD = react.forwardRef(function(props, ref) {
982
- const $ = reactCompilerRuntime.c(23);
983
- let children, className, restProps, t0, t1, t2, t3, t4;
984
- $[0] !== props ? ({
985
- as: t0,
986
- children,
987
- className,
988
- display: t1,
989
- fontSize: t2,
990
- padding: t3,
991
- radius: t4,
992
- ...restProps
993
- } = props, $[0] = props, $[1] = children, $[2] = className, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4) : (children = $[1], className = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8]);
994
- const as = t0 === void 0 ? "kbd" : t0, display = t1 === void 0 ? "inline-block" : t1, fontSize = t2 === void 0 ? 1 : t2, padding = t3 === void 0 ? 1 : t3, radius = t4 === void 0 ? 2 : t4;
995
- let t5;
996
- $[9] !== className || $[10] !== radius ? (t5 = css.composeClassNames(className, css.kbd({
997
- radius
998
- })), $[9] = className, $[10] = radius, $[11] = t5) : t5 = $[11];
999
- let t6;
1000
- $[12] !== children || $[13] !== fontSize ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(Text, { as: "span", muted: !0, size: fontSize, children }), $[12] = children, $[13] = fontSize, $[14] = t6) : t6 = $[14];
1001
- let t7;
1002
- return $[15] !== as || $[16] !== display || $[17] !== padding || $[18] !== ref || $[19] !== restProps || $[20] !== t5 || $[21] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "KBD", ...restProps, as, className: t5, display, muted: !0, padding, ref, children: t6 }), $[15] = as, $[16] = display, $[17] = padding, $[18] = ref, $[19] = restProps, $[20] = t5, $[21] = t6, $[22] = t7) : t7 = $[22], t7;
1003
- });
1004
- KBD.displayName = "ForwardRef(KBD)";
1005
- const origin = {
1006
- name: "@sanity/ui/origin",
1007
- fn({
1008
- middlewareData,
1009
- placement,
1010
- rects
1011
- }) {
1012
- const [side] = placement.split("-"), floatingWidth = rects.floating.width, floatingHeight = rects.floating.height, shiftX = middlewareData.shift?.x || 0, shiftY = middlewareData.shift?.y || 0;
1013
- if (floatingWidth <= 0 || floatingHeight <= 0)
1014
- return {};
1015
- const isVerticalPlacement = ["bottom", "top"].includes(side), {
1016
- originX,
1017
- originY
1018
- } = isVerticalPlacement ? {
1019
- originX: clamp(0.5 - shiftX / floatingWidth, 0, 1),
1020
- originY: side === "bottom" ? 0 : 1
1021
- } : {
1022
- originX: side === "left" ? 1 : 0,
1023
- originY: clamp(0.5 - shiftY / floatingHeight, 0, 1)
1024
- };
1025
- return {
1026
- data: {
1027
- originX,
1028
- originY
1029
- }
1030
- };
1031
- }
1032
- };
1033
- function clamp(num, min, max) {
1034
- return Math.min(Math.max(num, min), max);
1035
- }
1036
- function moveTowardsLength(movingPoint, targetPoint, amount) {
1037
- const width = targetPoint.x - movingPoint.x, height = targetPoint.y - movingPoint.y, distance = Math.sqrt(width * width + height * height);
1038
- return moveTowardsFractional(movingPoint, targetPoint, Math.min(1, amount / distance));
1039
- }
1040
- function moveTowardsFractional(movingPoint, targetPoint, fraction) {
1041
- return {
1042
- x: movingPoint.x + (targetPoint.x - movingPoint.x) * fraction,
1043
- y: movingPoint.y + (targetPoint.y - movingPoint.y) * fraction
1044
- };
1045
- }
1046
- function getRoundedCommands(points) {
1047
- const len = points.length, cmds = [];
1048
- for (let i = 0; i < len; i += 1) {
1049
- const point = points[i], prevPoint = points[i - 1], nextPoint = points[i + 1];
1050
- if (prevPoint && point.radius) {
1051
- const curveStart = moveTowardsLength(point, prevPoint, point.radius), curveEnd = moveTowardsLength(point, nextPoint, point.radius), startControl = moveTowardsFractional(curveStart, point, 0.5), endControl = moveTowardsFractional(point, curveEnd, 0.5);
1052
- cmds.push({
1053
- type: "point",
1054
- ...curveStart
1055
- }), cmds.push({
1056
- type: "curve",
1057
- curveEnd,
1058
- startControl,
1059
- endControl
1060
- });
1061
- } else
1062
- cmds.push({
1063
- type: "point",
1064
- ...point
1065
- });
1066
- }
1067
- return cmds;
1068
- }
1069
- function compileCommands(cmds) {
1070
- return cmds.map((n, idx) => n.type === "point" ? `${idx === 0 ? "M" : "L"} ${n.x} ${n.y}` : n.type === "curve" ? `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}` : "").join(" ");
1071
- }
1072
- const Arrow = react.forwardRef(function(props, ref) {
1073
- const $ = reactCompilerRuntime.c(31);
1074
- let h, restProps, style, t0, w;
1075
- $[0] !== props ? ({
1076
- width: w,
1077
- height: h,
1078
- radius: t0,
1079
- style,
1080
- ...restProps
1081
- } = props, $[0] = props, $[1] = h, $[2] = restProps, $[3] = style, $[4] = t0, $[5] = w) : (h = $[1], restProps = $[2], style = $[3], t0 = $[4], w = $[5]);
1082
- const radius = t0 === void 0 ? 0 : t0, {
1083
- card
1084
- } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2;
1085
- let t1;
1086
- const points = [{
1087
- x: 0,
1088
- y: 0
1089
- }, {
1090
- x: radius,
1091
- y: 0,
1092
- radius
1093
- }, {
1094
- x: center,
1095
- y: h - 1,
1096
- radius
1097
- }, {
1098
- x: w - radius,
1099
- y: 0,
1100
- radius
1101
- }, {
1102
- x: w,
1103
- y: 0
1104
- }], cmds = getRoundedCommands(points);
1105
- t1 = compileCommands(cmds);
1106
- const path = t1, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`;
1107
- let t2;
1108
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t2 = css._arrow(), $[6] = t2) : t2 = $[6];
1109
- const t3 = `${w}px`;
1110
- let t4;
1111
- $[7] !== style || $[8] !== t3 ? (t4 = {
1112
- ...style,
1113
- "--arrow-size": t3
1114
- }, $[7] = style, $[8] = t3, $[9] = t4) : t4 = $[9];
1115
- const t5 = t4, t6 = `0 0 ${w} ${w}`;
1116
- let t7;
1117
- $[10] !== strokeWidth || $[11] !== w ? (t7 = /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }), $[10] = strokeWidth, $[11] = w, $[12] = t7) : t7 = $[12];
1118
- let t8;
1119
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t8 = css._arrowStroke(), $[13] = t8) : t8 = $[13];
1120
- const t9 = strokeWidth * 2;
1121
- let t10;
1122
- $[14] !== strokePath || $[15] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t8, d: strokePath, mask: "url(#stroke-mask)", strokeWidth: t9 }), $[14] = strokePath, $[15] = t9, $[16] = t10) : t10 = $[16];
1123
- let t11;
1124
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = css._arrowShape(), $[17] = t11) : t11 = $[17];
1125
- let t12;
1126
- $[18] !== fillPath ? (t12 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t11, d: fillPath }), $[18] = fillPath, $[19] = t12) : t12 = $[19];
1127
- let t13;
1128
- $[20] !== t10 || $[21] !== t12 || $[22] !== t6 || $[23] !== t7 || $[24] !== w ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox: t6, children: [
1129
- t7,
1130
- t10,
1131
- t12
1132
- ] }), $[20] = t10, $[21] = t12, $[22] = t6, $[23] = t7, $[24] = w, $[25] = t13) : t13 = $[25];
1133
- let t14;
1134
- return $[26] !== ref || $[27] !== restProps || $[28] !== t13 || $[29] !== t5 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx("div", { ...restProps, className: t2, ref, style: t5, children: t13 }), $[26] = ref, $[27] = restProps, $[28] = t13, $[29] = t5, $[30] = t14) : t14 = $[30], t14;
1135
- });
1136
- Arrow.displayName = "ForwardRef(Arrow)";
1137
- const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);
1138
- function BoundaryElementProvider(props) {
1139
- const $ = reactCompilerRuntime.c(5), {
1140
- children,
1141
- element
1142
- } = props;
1143
- let t0, t1;
1144
- $[0] !== element ? (t1 = {
1145
- version: 0,
1146
- element
1147
- }, $[0] = element, $[1] = t1) : t1 = $[1], t0 = t1;
1148
- const value = t0;
1149
- let t2;
1150
- return $[2] !== children || $[3] !== value ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(BoundaryElementContext.Provider, { value, children }), $[2] = children, $[3] = value, $[4] = t2) : t2 = $[4], t2;
1151
- }
1152
- BoundaryElementProvider.displayName = "BoundaryElementProvider";
1153
- function isRecord(value) {
1154
- return !!(value && typeof value == "object" && !Array.isArray(value));
1155
- }
1156
- const DEFAULT_VALUE = {
1157
- version: 0,
1158
- element: null
1159
- };
1160
- function useBoundaryElement() {
1161
- const value = react.useContext(BoundaryElementContext);
1162
- if (value && (!isRecord(value) || value.version !== 0))
1163
- throw new Error("useBoundaryElement(): the context value is not compatible");
1164
- return value || DEFAULT_VALUE;
1165
- }
1166
- function ConditionalWrapper({
1167
- children,
1168
- condition,
1169
- wrapper
1170
- }) {
1171
- return condition ? wrapper(children) : children;
1172
- }
1173
- ConditionalWrapper.displayName = "ConditionalWrapper";
1174
- function findMaxBreakpoints(media, width) {
1175
- const ret = [];
1176
- for (let i = 0; i < media.length; i += 1)
1177
- media[i] > width && ret.push(i);
1178
- return ret;
1179
- }
1180
- function findMinBreakpoints(media, width) {
1181
- const ret = [];
1182
- for (let i = 0; i < media.length; i += 1)
1183
- media[i] <= width && ret.push(i);
1184
- return ret;
1185
- }
1186
- const ElementQuery = react.forwardRef(function(props, forwardedRef) {
1187
- const $ = reactCompilerRuntime.c(18), theme2 = useTheme_v2();
1188
- let _media, children, restProps;
1189
- $[0] !== props ? ({
1190
- children,
1191
- media: _media,
1192
- ...restProps
1193
- } = props, $[0] = props, $[1] = _media, $[2] = children, $[3] = restProps) : (_media = $[1], children = $[2], restProps = $[3]);
1194
- const media = _media ?? theme2.media, [element, setElement] = react.useState(null), elementSize = useElementSize(element);
1195
- let t0;
1196
- t0 = elementSize?.border.width ?? window.innerWidth;
1197
- const width = t0;
1198
- let t1, t2;
1199
- if ($[4] !== media || $[5] !== width) {
1200
- const eq = findMaxBreakpoints(media, width);
1201
- t2 = eq.length ? eq.join(" ") : void 0, $[4] = media, $[5] = width, $[6] = t2;
1202
- } else
1203
- t2 = $[6];
1204
- t1 = t2;
1205
- const max = t1;
1206
- let t3, t4;
1207
- if ($[7] !== media || $[8] !== width) {
1208
- const eq_0 = findMinBreakpoints(media, width);
1209
- t4 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = media, $[8] = width, $[9] = t4;
1210
- } else
1211
- t4 = $[9];
1212
- t3 = t4;
1213
- const min = t3;
1214
- let t5, t6;
1215
- $[10] !== element ? (t5 = () => element, t6 = [element], $[10] = element, $[11] = t5, $[12] = t6) : (t5 = $[11], t6 = $[12]), react.useImperativeHandle(forwardedRef, t5, t6);
1216
- let t7;
1217
- return $[13] !== children || $[14] !== max || $[15] !== min || $[16] !== restProps ? (t7 = /* @__PURE__ */ jsxRuntime.jsx("div", { "data-ui": "ElementQuery", ...restProps, "data-eq-max": max, "data-eq-min": min, ref: setElement, children }), $[13] = children, $[14] = max, $[15] = min, $[16] = restProps, $[17] = t7) : t7 = $[17], t7;
1218
- });
1219
- ElementQuery.displayName = "ForwardRef(ElementQuery)";
1220
- function getLayerContext(contextValue) {
1221
- if (!isRecord(contextValue) || contextValue.version !== 0)
1222
- throw new Error("the context value is not compatible");
1223
- if (!contextValue)
1224
- throw new Error("components using `useLayer()` should be wrapped in a <LayerProvider>.");
1225
- if (contextValue.version === 0)
1226
- return contextValue;
1227
- throw new Error("could not get layer context");
1228
- }
1229
- const LayerContext = createGlobalScopedContext("@sanity/ui/context/layer", null);
1230
- function LayerProvider(props) {
1231
- const $ = reactCompilerRuntime.c(19), {
1232
- children,
1233
- zOffset: t0
1234
- } = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = react.useContext(LayerContext);
1235
- let t1;
1236
- $[0] !== parentContextValue ? (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1) : t1 = $[1];
1237
- const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = useArrayProp(zOffsetProp), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex];
1238
- let t2;
1239
- $[2] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[2] = t2) : t2 = $[2];
1240
- const [, setChildLayers] = react.useState(t2), [size2, setSize] = react.useState(0), isTopLayer = size2 === 0;
1241
- let t3;
1242
- $[3] !== parentRegisterChild || $[4] !== setChildLayers ? (t3 = (childLevel) => {
1243
- const parentDispose = parentRegisterChild?.(childLevel);
1244
- return childLevel !== void 0 ? setChildLayers((state) => {
1245
- const prevLen = state[childLevel] ?? 0, nextState = {
1246
- ...state,
1247
- [childLevel]: prevLen + 1
1248
- };
1249
- return setSize(Object.keys(nextState).length), nextState;
1250
- }) : setSize(_temp$2), () => {
1251
- childLevel !== void 0 ? setChildLayers((state_0) => {
1252
- const nextState_0 = {
1253
- ...state_0
1254
- };
1255
- return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
1256
- }) : setSize(_temp2$2), parentDispose?.();
1257
- };
1258
- }, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
1259
- const registerChild = t3;
1260
- let t4, t5;
1261
- $[6] !== level || $[7] !== parentRegisterChild ? (t4 = () => parentRegisterChild?.(level), t5 = [level, parentRegisterChild], $[6] = level, $[7] = parentRegisterChild, $[8] = t4, $[9] = t5) : (t4 = $[8], t5 = $[9]), react.useEffect(t4, t5);
1262
- let t6, t7;
1263
- $[10] !== isTopLayer || $[11] !== level || $[12] !== registerChild || $[13] !== size2 || $[14] !== zIndex ? (t7 = {
1264
- version: 0,
1265
- isTopLayer,
1266
- level,
1267
- registerChild,
1268
- size: size2,
1269
- zIndex
1270
- }, $[10] = isTopLayer, $[11] = level, $[12] = registerChild, $[13] = size2, $[14] = zIndex, $[15] = t7) : t7 = $[15], t6 = t7;
1271
- const value = t6;
1272
- let t8;
1273
- return $[16] !== children || $[17] !== value ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children }), $[16] = children, $[17] = value, $[18] = t8) : t8 = $[18], t8;
1274
- }
1275
- function _temp2$2(v_0) {
1276
- return v_0 - 1;
1277
- }
1278
- function _temp$2(v) {
1279
- return v + 1;
1280
- }
1281
- LayerProvider.displayName = "LayerProvider";
1282
- function useLayer() {
1283
- const $ = reactCompilerRuntime.c(2), value = react.useContext(LayerContext);
1284
- if (!value)
1285
- throw new Error("useLayer(): missing context value");
1286
- try {
1287
- let t1;
1288
- return $[0] !== value ? (t1 = getLayerContext(value), $[0] = value, $[1] = t1) : t1 = $[1], t1;
1289
- } catch (t0) {
1290
- const err = t0;
1291
- throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
1292
- }
1293
- }
1294
- const LayerChildren = react.forwardRef(function(props, forwardedRef) {
1295
- const $ = reactCompilerRuntime.c(24);
1296
- let children, onActivate, onFocus, restProps, t0, t1;
1297
- $[0] !== props ? ({
1298
- children,
1299
- onActivate,
1300
- onFocus,
1301
- position: t0,
1302
- style: t1,
1303
- ...restProps
1304
- } = props, $[0] = props, $[1] = children, $[2] = onActivate, $[3] = onFocus, $[4] = restProps, $[5] = t0, $[6] = t1) : (children = $[1], onActivate = $[2], onFocus = $[3], restProps = $[4], t0 = $[5], t1 = $[6]);
1305
- const position = t0 === void 0 ? "relative" : t0, style = t1 === void 0 ? EMPTY_RECORD : t1, {
1306
- zIndex,
1307
- isTopLayer
1308
- } = useLayer(), lastFocusedRef = react.useRef(null), ref = react.useRef(null), isTopLayerRef = react.useRef(isTopLayer);
1309
- let t2;
1310
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[7] = t2) : t2 = $[7], react.useImperativeHandle(forwardedRef, t2);
1311
- let t3, t4;
1312
- $[8] !== isTopLayer || $[9] !== onActivate ? (t3 = () => {
1313
- isTopLayerRef.current !== isTopLayer && isTopLayer && onActivate?.({
1314
- activeElement: lastFocusedRef.current
1315
- }), isTopLayerRef.current = isTopLayer;
1316
- }, t4 = [isTopLayer, onActivate], $[8] = isTopLayer, $[9] = onActivate, $[10] = t3, $[11] = t4) : (t3 = $[10], t4 = $[11]), react.useEffect(t3, t4);
1317
- let t5;
1318
- $[12] !== isTopLayer || $[13] !== onFocus ? (t5 = (event) => {
1319
- onFocus?.(event);
1320
- const rootElement = ref.current, target = document.activeElement;
1321
- !isTopLayer || !rootElement || !target || isHTMLElement(target) && containsOrEqualsElement(rootElement, target) && (lastFocusedRef.current = target);
1322
- }, $[12] = isTopLayer, $[13] = onFocus, $[14] = t5) : t5 = $[14];
1323
- const handleFocus = t5;
1324
- let t6;
1325
- $[15] !== style || $[16] !== zIndex ? (t6 = {
1326
- ...style,
1327
- zIndex
1328
- }, $[15] = style, $[16] = zIndex, $[17] = t6) : t6 = $[17];
1329
- let t7;
1330
- return $[18] !== children || $[19] !== handleFocus || $[20] !== position || $[21] !== restProps || $[22] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Layer", ...restProps, onFocus: handleFocus, position, ref, style: t6, children }), $[18] = children, $[19] = handleFocus, $[20] = position, $[21] = restProps, $[22] = t6, $[23] = t7) : t7 = $[23], t7;
1331
- }), Layer = react.forwardRef(function(props, ref) {
1332
- const $ = reactCompilerRuntime.c(11);
1333
- let children, restProps, t0;
1334
- $[0] !== props ? ({
1335
- children,
1336
- zOffset: t0,
1337
- ...restProps
1338
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
1339
- const zOffset = t0 === void 0 ? 1 : t0;
1340
- let t1;
1341
- $[4] !== children || $[5] !== ref || $[6] !== restProps ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(LayerChildren, { ...restProps, ref, children }), $[4] = children, $[5] = ref, $[6] = restProps, $[7] = t1) : t1 = $[7];
1342
- let t2;
1343
- return $[8] !== t1 || $[9] !== zOffset ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: t1 }), $[8] = t1, $[9] = zOffset, $[10] = t2) : t2 = $[10], t2;
1344
- });
1345
- Layer.displayName = "ForwardRef(Layer)";
1346
- const key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
1347
- globalScope[elementKey] = null;
1348
- const defaultContextValue = {
1349
- version: 0,
1350
- boundaryElement: null,
1351
- get element() {
1352
- return typeof document > "u" ? null : (globalScope[elementKey] || (globalScope[elementKey] = document.createElement("div"), globalScope[elementKey].setAttribute("data-portal", ""), document.body.appendChild(globalScope[elementKey])), globalScope[elementKey]);
1353
- }
1354
- }, PortalContext = createGlobalScopedContext(key, defaultContextValue);
1355
- function usePortal() {
1356
- const value = react.useContext(PortalContext);
1357
- if (!value)
1358
- throw new Error("usePortal(): missing context value");
1359
- if (!isRecord(value) || value.version !== 0)
1360
- throw new Error("usePortal(): the context value is not compatible");
1361
- return value;
1362
- }
1363
- function Portal(props) {
1364
- const $ = reactCompilerRuntime.c(3), {
1365
- children,
1366
- __unstable_name: name
1367
- } = props, portal = usePortal(), portalElement = (name ? portal.elements && portal.elements[name] : portal.element) || portal.elements?.default;
1368
- if (!portalElement)
1369
- return null;
1370
- let t0;
1371
- return $[0] !== children || $[1] !== portalElement ? (t0 = reactDom.createPortal(children, portalElement), $[0] = children, $[1] = portalElement, $[2] = t0) : t0 = $[2], t0;
1372
- }
1373
- Portal.displayName = "Portal";
1374
- function PortalProvider(props) {
1375
- const $ = reactCompilerRuntime.c(7), {
1376
- boundaryElement,
1377
- children,
1378
- element,
1379
- __unstable_elements: elementsProp
1380
- } = props, elements = useUnique(elementsProp), fallbackElement = react.useSyncExternalStore(emptySubscribe, _temp$1, _temp2$1);
1381
- let t0;
1382
- const t1 = boundaryElement || null, t2 = element || fallbackElement;
1383
- let t3;
1384
- $[0] !== elements || $[1] !== t1 || $[2] !== t2 ? (t3 = {
1385
- version: 0,
1386
- boundaryElement: t1,
1387
- element: t2,
1388
- elements
1389
- }, $[0] = elements, $[1] = t1, $[2] = t2, $[3] = t3) : t3 = $[3], t0 = t3;
1390
- const value = t0;
1391
- let t4;
1392
- return $[4] !== children || $[5] !== value ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t4) : t4 = $[6], t4;
1393
- }
1394
- function _temp2$1() {
1395
- return null;
1396
- }
1397
- function _temp$1() {
1398
- return document.body;
1399
- }
1400
- PortalProvider.displayName = "PortalProvider";
1401
- const emptySubscribe = () => () => {
1402
- };
1403
- function useUnique(value) {
1404
- const valueRef = react.useRef(value);
1405
- return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
1406
- }
1407
- function _isEqual(objA, objB) {
1408
- if (!objA || !objB)
1409
- return objA === objB;
1410
- const keysA = Object.keys(objA), keysB = Object.keys(objB);
1411
- return keysA.length !== keysB.length ? !1 : keysA.every((key2) => objA[key2] === objB[key2]);
1412
- }
1413
- const SrOnly = react.forwardRef(function(props, ref) {
1414
- const $ = reactCompilerRuntime.c(13);
1415
- let children, className, rest, t0;
1416
- $[0] !== props ? ({
1417
- as: t0,
1418
- children,
1419
- className,
1420
- ...rest
1421
- } = props, $[0] = props, $[1] = children, $[2] = className, $[3] = rest, $[4] = t0) : (children = $[1], className = $[2], rest = $[3], t0 = $[4]);
1422
- const As = t0 === void 0 ? "div" : t0;
1423
- let t1;
1424
- $[5] !== className ? (t1 = css.composeClassNames(className, css.srOnly()), $[5] = className, $[6] = t1) : t1 = $[6];
1425
- let t2;
1426
- return $[7] !== As || $[8] !== children || $[9] !== ref || $[10] !== rest || $[11] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(As, { "data-ui": "SrOnly", ...rest, "aria-hidden": !0, className: t1, ref, children }), $[7] = As, $[8] = children, $[9] = ref, $[10] = rest, $[11] = t1, $[12] = t2) : t2 = $[12], t2;
1427
- });
1428
- SrOnly.displayName = "ForwardRef(SrOnly)";
1429
- const VirtualList = react.forwardRef(function(props, forwardedRef) {
1430
- const $ = reactCompilerRuntime.c(56);
1431
- let getItemKey, onChange, renderItem, restProps, t0, t1, t2;
1432
- $[0] !== props ? ({
1433
- as: t0,
1434
- gap: t1,
1435
- getItemKey,
1436
- items: t2,
1437
- onChange,
1438
- renderItem,
1439
- ...restProps
1440
- } = props, $[0] = props, $[1] = getItemKey, $[2] = onChange, $[3] = renderItem, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = t2) : (getItemKey = $[1], onChange = $[2], renderItem = $[3], restProps = $[4], t0 = $[5], t1 = $[6], t2 = $[7]);
1441
- const as = t0 === void 0 ? "div" : t0, gap = t1 === void 0 ? 0 : t1;
1442
- let t3;
1443
- $[8] !== t2 ? (t3 = t2 === void 0 ? [] : t2, $[8] = t2, $[9] = t3) : t3 = $[9];
1444
- const items = t3, {
1445
- space
1446
- } = useTheme_v2(), ref = react.useRef(null), wrapperRef = react.useRef(null), [scrollTop, setScrollTop] = react.useState(0), [scrollHeight, setScrollHeight] = react.useState(0), [itemHeight, setItemHeight] = react.useState(-1);
1447
- let t4;
1448
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], react.useImperativeHandle(forwardedRef, t4);
1449
- let t5;
1450
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
1451
- if (!wrapperRef.current)
1452
- return;
1453
- const firstElement = wrapperRef.current.firstChild;
1454
- firstElement instanceof HTMLElement && setItemHeight(firstElement.offsetHeight);
1455
- }, $[11] = t5) : t5 = $[11];
1456
- let t6;
1457
- $[12] !== renderItem ? (t6 = [renderItem], $[12] = renderItem, $[13] = t6) : t6 = $[13], react.useEffect(t5, t6);
1458
- let t7, t8;
1459
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => {
1460
- if (!ref.current)
1461
- return;
1462
- const scrollEl = findScrollable(ref.current.parentNode);
1463
- if (scrollEl) {
1464
- if (!(scrollEl instanceof HTMLElement))
1465
- return;
1466
- const handleScroll = () => {
1467
- setScrollTop(scrollEl.scrollTop);
1468
- };
1469
- scrollEl.addEventListener("scroll", handleScroll, {
1470
- passive: !0
1471
- });
1472
- const ro = new _ResizeObserver((entries) => {
1473
- setScrollHeight(entries[0].contentRect.height);
1474
- });
1475
- return ro.observe(scrollEl), handleScroll(), () => {
1476
- scrollEl.removeEventListener("scroll", handleScroll), ro.unobserve(scrollEl), ro.disconnect();
1477
- };
1478
- }
1479
- const handleScroll_0 = () => {
1480
- setScrollTop(window.scrollY);
1481
- }, handleResize = () => {
1482
- setScrollHeight(window.innerHeight);
1483
- };
1484
- return window.addEventListener("scroll", handleScroll_0, {
1485
- passive: !0
1486
- }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
1487
- window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
1488
- };
1489
- }, t8 = [], $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]), react.useEffect(t7, t8);
1490
- const len = items.length, height = itemHeight ? len * (itemHeight + space[gap]) - space[gap] : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0;
1491
- let t10, t9;
1492
- $[16] !== fromIndex || $[17] !== gap || $[18] !== itemHeight || $[19] !== onChange || $[20] !== scrollHeight || $[21] !== scrollTop || $[22] !== space || $[23] !== toIndex ? (t9 = () => {
1493
- onChange && onChange({
1494
- fromIndex,
1495
- gap: space[gap],
1496
- itemHeight,
1497
- scrollHeight,
1498
- scrollTop,
1499
- toIndex
1500
- });
1501
- }, t10 = [fromIndex, gap, itemHeight, onChange, scrollHeight, scrollTop, space, toIndex], $[16] = fromIndex, $[17] = gap, $[18] = itemHeight, $[19] = onChange, $[20] = scrollHeight, $[21] = scrollTop, $[22] = space, $[23] = toIndex, $[24] = t10, $[25] = t9) : (t10 = $[24], t9 = $[25]), react.useEffect(t9, t10);
1502
- let t11;
1503
- bb0: {
1504
- if (!renderItem || items.length === 0) {
1505
- t11 = null;
1506
- break bb0;
1507
- }
1508
- if (itemHeight === -1) {
1509
- let t123;
1510
- $[26] !== items[0] || $[27] !== renderItem ? (t123 = renderItem(items[0]), $[26] = items[0], $[27] = renderItem, $[28] = t123) : t123 = $[28];
1511
- let t132;
1512
- $[29] !== t123 ? (t132 = [/* @__PURE__ */ jsxRuntime.jsx(Box, { insetTop: 0, insetLeft: 0, position: "absolute", children: t123 }, 0)], $[29] = t123, $[30] = t132) : t132 = $[30], t11 = t132;
1513
- break bb0;
1514
- }
1515
- let t122;
1516
- if ($[31] !== fromIndex || $[32] !== gap || $[33] !== getItemKey || $[34] !== itemHeight || $[35] !== items || $[36] !== renderItem || $[37] !== space || $[38] !== toIndex) {
1517
- let t132;
1518
- $[40] !== fromIndex || $[41] !== gap || $[42] !== getItemKey || $[43] !== itemHeight || $[44] !== renderItem || $[45] !== space ? (t132 = (item, _itemIndex) => {
1519
- const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
1520
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { insetLeft: 0, position: "absolute", style: {
1521
- top: itemIndex * (itemHeight + space[gap])
1522
- }, children: node }, key2);
1523
- }, $[40] = fromIndex, $[41] = gap, $[42] = getItemKey, $[43] = itemHeight, $[44] = renderItem, $[45] = space, $[46] = t132) : t132 = $[46], t122 = items.slice(fromIndex, toIndex).map(t132), $[31] = fromIndex, $[32] = gap, $[33] = getItemKey, $[34] = itemHeight, $[35] = items, $[36] = renderItem, $[37] = space, $[38] = toIndex, $[39] = t122;
1524
- } else
1525
- t122 = $[39];
1526
- t11 = t122;
1527
- }
1528
- const children = t11;
1529
- let t12, t13;
1530
- $[47] !== height ? (t13 = {
1531
- height
1532
- }, $[47] = height, $[48] = t13) : t13 = $[48], t12 = t13;
1533
- const wrapperStyle = t12;
1534
- let t14;
1535
- $[49] !== children || $[50] !== wrapperStyle ? (t14 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[49] = children, $[50] = wrapperStyle, $[51] = t14) : t14 = $[51];
1536
- let t15;
1537
- return $[52] !== as || $[53] !== restProps || $[54] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(Box, { as, "data-ui": "VirtualList", ...restProps, position: "relative", ref, children: t14 }), $[52] = as, $[53] = restProps, $[54] = t14, $[55] = t15) : t15 = $[55], t15;
1538
- });
1539
- VirtualList.displayName = "ForwardRef(VirtualList)";
1540
- function findScrollable(parentNode) {
1541
- let _scrollEl = parentNode;
1542
- for (; _scrollEl && !_isScrollable(_scrollEl); )
1543
- _scrollEl = _scrollEl.parentNode;
1544
- return _scrollEl;
1545
- }
1546
- const DEFAULT_POPOVER_DISTANCE = 4, DEFAULT_POPOVER_PADDING = 4, DEFAULT_POPOVER_ARROW_WIDTH = 19, DEFAULT_POPOVER_ARROW_HEIGHT = 8, DEFAULT_POPOVER_ARROW_RADIUS = 2, DEFAULT_POPOVER_MARGINS = [0, 0, 0, 0], DEFAULT_FALLBACK_PLACEMENTS$1 = {
1547
- top: ["bottom", "left", "right"],
1548
- "top-start": ["bottom-start", "left-start", "right-start"],
1549
- "top-end": ["bottom-end", "left-end", "right-end"],
1550
- bottom: ["top", "left", "right"],
1551
- "bottom-start": ["top-start", "left-start", "right-start"],
1552
- "bottom-end": ["top-end", "left-end", "right-end"],
1553
- left: ["right", "top", "bottom"],
1554
- "left-start": ["right-start", "top-start", "bottom-start"],
1555
- "left-end": ["right-end", "top-end", "bottom-end"],
1556
- right: ["left", "top", "bottom"],
1557
- "right-start": ["left-start", "top-start", "bottom-start"],
1558
- "right-end": ["left-end", "top-end", "bottom-end"]
1559
- };
1560
- function size(options) {
1561
- const {
1562
- apply,
1563
- margins,
1564
- padding = 0
1565
- } = options;
1566
- return {
1567
- name: "@sanity/ui/size",
1568
- async fn(args) {
1569
- const {
1570
- elements,
1571
- placement,
1572
- platform,
1573
- rects
1574
- } = args, {
1575
- floating,
1576
- reference
1577
- } = rects, overflow = await reactDom$1.detectOverflow(args, {
1578
- altBoundary: !0,
1579
- boundary: options.boundaryElement || void 0,
1580
- elementContext: "floating",
1581
- padding,
1582
- rootBoundary: "viewport"
1583
- });
1584
- let maxWidth = 1 / 0, maxHeight = 1 / 0;
1585
- const floatingW = floating.width, floatingH = floating.height;
1586
- placement.includes("top") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.top), placement.includes("right") && (maxWidth = floatingW - overflow.right, maxHeight = floatingH - (overflow.top + overflow.bottom)), placement.includes("bottom") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.bottom), placement.includes("left") && (maxWidth = floatingW - overflow.left, maxHeight = floatingH - (overflow.top + overflow.bottom)), apply({
1587
- availableWidth: maxWidth - margins[1] - margins[3],
1588
- availableHeight: maxHeight - margins[0] - margins[2],
1589
- elements,
1590
- referenceWidth: reference.width - margins[1] - margins[3]
1591
- });
1592
- const nextDimensions = await platform.getDimensions(elements.floating), targetH = nextDimensions.height, targetW = nextDimensions.width;
1593
- return floatingW !== targetW || floatingH !== targetH ? {
1594
- reset: {
1595
- rects: !0
1596
- }
1597
- } : {};
1598
- }
1599
- };
1600
- }
1601
- function calcCurrentWidth(params) {
1602
- const {
1603
- container,
1604
- mediaIndex,
1605
- width
1606
- } = params, w = width[mediaIndex], currentWidth = w === void 0 ? width[width.length - 1] : w;
1607
- return typeof currentWidth == "number" ? container[currentWidth] : void 0;
1608
- }
1609
- function calcMaxWidth(params) {
1610
- const {
1611
- boundaryWidth,
1612
- currentWidth
1613
- } = params;
1614
- if (!(currentWidth === void 0 && boundaryWidth === void 0))
1615
- return Math.min(currentWidth ?? 1 / 0, (boundaryWidth || 1 / 0) - DEFAULT_POPOVER_PADDING * 2);
1616
- }
1617
- const MotionCard$1 = framerMotion.motion.create(Card), PopoverCard = react.memo(react.forwardRef(function(props, ref) {
1618
- const $ = reactCompilerRuntime.c(66);
1619
- let animate, arrow, arrowRef, arrowX, arrowY, children, marginsProp, originX, originY, overflow, padding, placement, radius, referenceWidth, restProps, scheme, shadow, strategy, style, tone, xProp, yProp;
1620
- $[0] !== props ? ({
1621
- __unstable_margins: marginsProp,
1622
- animate,
1623
- arrow,
1624
- arrowRef,
1625
- arrowX,
1626
- arrowY,
1627
- children,
1628
- padding,
1629
- placement,
1630
- originX,
1631
- originY,
1632
- overflow,
1633
- radius,
1634
- referenceWidth,
1635
- scheme,
1636
- shadow,
1637
- strategy,
1638
- style,
1639
- tone,
1640
- x: xProp,
1641
- y: yProp,
1642
- ...restProps
1643
- } = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = originX, $[9] = originY, $[10] = overflow, $[11] = padding, $[12] = placement, $[13] = radius, $[14] = referenceWidth, $[15] = restProps, $[16] = scheme, $[17] = shadow, $[18] = strategy, $[19] = style, $[20] = tone, $[21] = xProp, $[22] = yProp) : (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], originX = $[8], originY = $[9], overflow = $[10], padding = $[11], placement = $[12], radius = $[13], referenceWidth = $[14], restProps = $[15], scheme = $[16], shadow = $[17], strategy = $[18], style = $[19], tone = $[20], xProp = $[21], yProp = $[22]);
1644
- const {
1645
- zIndex
1646
- } = useLayer();
1647
- let t0;
1648
- t0 = marginsProp || DEFAULT_POPOVER_MARGINS;
1649
- const margins = t0, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0];
1650
- let t1;
1651
- const t2 = animate ? "transform" : void 0;
1652
- let t3;
1653
- $[23] !== originX || $[24] !== originY || $[25] !== referenceWidth || $[26] !== strategy || $[27] !== style || $[28] !== t2 || $[29] !== x || $[30] !== y || $[31] !== zIndex ? (t3 = {
1654
- left: x,
1655
- originX,
1656
- originY,
1657
- position: strategy,
1658
- top: y,
1659
- width: referenceWidth,
1660
- zIndex,
1661
- willChange: t2,
1662
- ...style
1663
- }, $[23] = originX, $[24] = originY, $[25] = referenceWidth, $[26] = strategy, $[27] = style, $[28] = t2, $[29] = x, $[30] = y, $[31] = zIndex, $[32] = t3) : t3 = $[32], t1 = t3;
1664
- const rootStyle = t1;
1665
- let t4;
1666
- const t5 = arrowX !== null ? arrowX : void 0, t6 = arrowY !== null ? arrowY : void 0;
1667
- let t7;
1668
- $[33] !== t5 || $[34] !== t6 ? (t7 = {
1669
- left: t5,
1670
- top: t6,
1671
- right: void 0,
1672
- bottom: void 0
1673
- }, $[33] = t5, $[34] = t6, $[35] = t7) : t7 = $[35], t4 = t7;
1674
- const arrowStyle = t4, t8 = restProps;
1675
- let t9;
1676
- $[36] !== animate ? (t9 = animate ? ["hidden", "initial"] : void 0, $[36] = animate, $[37] = t9) : t9 = $[37];
1677
- let t10;
1678
- $[38] !== animate ? (t10 = animate ? ["visible", "scaleIn"] : void 0, $[38] = animate, $[39] = t10) : t10 = $[39];
1679
- let t11;
1680
- $[40] !== animate ? (t11 = animate ? ["hidden", "scaleOut"] : void 0, $[40] = animate, $[41] = t11) : t11 = $[41];
1681
- let t12;
1682
- $[42] !== children || $[43] !== padding ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { direction: "column", flex: 1, padding, children }), $[42] = children, $[43] = padding, $[44] = t12) : t12 = $[44];
1683
- let t13;
1684
- $[45] !== overflow || $[46] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, overflow, children: t12 }), $[45] = overflow, $[46] = t12, $[47] = t13) : t13 = $[47];
1685
- let t14;
1686
- $[48] !== arrow || $[49] !== arrowRef || $[50] !== arrowStyle ? (t14 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[48] = arrow, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t14) : t14 = $[51];
1687
- let t15;
1688
- return $[52] !== placement || $[53] !== radius || $[54] !== ref || $[55] !== rootStyle || $[56] !== scheme || $[57] !== shadow || $[58] !== t10 || $[59] !== t11 || $[60] !== t13 || $[61] !== t14 || $[62] !== t8 || $[63] !== t9 || $[64] !== tone ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(MotionCard$1, { className: "popover-card", "data-ui": "Popover", ...t8, "data-placement": placement, direction: "column", display: "flex", radius, ref, scheme, shadow, sizing: "border", style: rootStyle, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t9, animate: t10, exit: t11, children: [
1689
- t13,
1690
- t14
1691
- ] }), $[52] = placement, $[53] = radius, $[54] = ref, $[55] = rootStyle, $[56] = scheme, $[57] = shadow, $[58] = t10, $[59] = t11, $[60] = t13, $[61] = t14, $[62] = t8, $[63] = t9, $[64] = tone, $[65] = t15) : t15 = $[65], t15;
1692
- }));
1693
- PopoverCard.displayName = "Memo(ForwardRef(PopoverCard))";
1694
- const ViewportOverlay = () => {
1695
- const $ = reactCompilerRuntime.c(2), {
1696
- zIndex
1697
- } = useLayer();
1698
- let t0;
1699
- return $[0] !== zIndex ? (t0 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
1700
- height: "100vh",
1701
- inset: 0,
1702
- position: "fixed",
1703
- width: "100vw",
1704
- zIndex
1705
- } }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
1706
- }, Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
1707
- const {
1708
- container,
1709
- layer
1710
- } = useTheme_v2(), boundaryElementContext = useBoundaryElement(), {
1711
- __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
1712
- animate: _animate = !1,
1713
- arrow: arrowProp = !1,
1714
- boundaryElement = boundaryElementContext.element,
1715
- children: childProp,
1716
- constrainSize = !1,
1717
- content,
1718
- disabled,
1719
- fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
1720
- matchReferenceWidth,
1721
- floatingBoundary = props.boundaryElement ?? boundaryElementContext.element,
1722
- modal,
1723
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1724
- onActivate,
1725
- open,
1726
- overflow = "hidden",
1727
- padding,
1728
- placement: placementProp = "bottom",
1729
- portal,
1730
- preventOverflow = !0,
1731
- radius = 3,
1732
- referenceBoundary = props.boundaryElement ?? boundaryElementContext.element,
1733
- referenceElement,
1734
- scheme,
1735
- shadow = 3,
1736
- tone = "inherit",
1737
- width: widthProp = "auto",
1738
- zOffset: zOffsetProp = layer.popover.zOffset,
1739
- updateRef,
1740
- ...restProps
1741
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, widthArrayProp = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null), arrowRef = react.useRef(null), rootBoundary = "viewport";
1742
- react.useImperativeHandle(forwardedRef, () => ref.current);
1743
- const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
1744
- container,
1745
- mediaIndex,
1746
- width: widthArrayProp
1747
- }), widthRef = react.useRef(width);
1748
- react.useEffect(() => {
1749
- widthRef.current = width;
1750
- }, [width]);
1751
- const maxWidth = calcMaxWidth({
1752
- boundaryWidth,
1753
- currentWidth: width
1754
- }), maxWidthRef = react.useRef(maxWidth);
1755
- react.useEffect(() => {
1756
- maxWidthRef.current = maxWidth;
1757
- }, [maxWidth]);
1758
- const referenceWidthRef = react.useRef(void 0);
1759
- react.useEffect(() => {
1760
- const floatingElement = ref.current;
1761
- if (!open || !floatingElement) return;
1762
- const referenceWidth = referenceWidthRef.current;
1763
- matchReferenceWidth ? referenceWidth !== void 0 && (floatingElement.style.width = `${referenceWidth}px`) : width !== void 0 && (floatingElement.style.width = `${width}px`), typeof maxWidth == "number" && (floatingElement.style.maxWidth = `${maxWidth}px`);
1764
- }, [width, matchReferenceWidth, maxWidth, open]);
1765
- const middleware = react.useMemo(() => {
1766
- const ret = [];
1767
- return (constrainSize || preventOverflow) && ret.push(reactDom$1.flip({
1768
- boundary: floatingBoundary || void 0,
1769
- fallbackPlacements,
1770
- padding: DEFAULT_POPOVER_PADDING,
1771
- rootBoundary
1772
- })), ret.push(reactDom$1.offset({
1773
- mainAxis: DEFAULT_POPOVER_DISTANCE
1774
- })), (constrainSize || matchReferenceWidth) && ret.push(size({
1775
- apply({
1776
- availableWidth,
1777
- availableHeight,
1778
- elements,
1779
- referenceWidth: referenceWidth_0
1780
- }) {
1781
- referenceWidthRef.current = referenceWidth_0;
1782
- const _currentWidth = widthRef.current, _maxWidth = maxWidthRef.current;
1783
- matchReferenceWidth ? elements.floating.style.width = `${referenceWidth_0}px` : _currentWidth !== void 0 && (elements.floating.style.width = `${_currentWidth}px`), constrainSize && (elements.floating.style.maxWidth = `${Math.min(availableWidth, _maxWidth ?? 1 / 0)}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
1784
- },
1785
- boundaryElement: floatingBoundary || void 0,
1786
- margins,
1787
- padding: DEFAULT_POPOVER_PADDING
1788
- })), preventOverflow && ret.push(reactDom$1.shift({
1789
- boundary: floatingBoundary || void 0,
1790
- rootBoundary,
1791
- padding: DEFAULT_POPOVER_PADDING
1792
- })), arrowProp && ret.push(reactDom$1.arrow({
1793
- element: arrowRef,
1794
- padding: DEFAULT_POPOVER_PADDING
1795
- })), animate && ret.push(origin), ret.push(reactDom$1.hide({
1796
- boundary: referenceBoundary || void 0,
1797
- padding: DEFAULT_POPOVER_PADDING,
1798
- strategy: "referenceHidden"
1799
- })), ret;
1800
- }, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
1801
- x,
1802
- y,
1803
- middlewareData,
1804
- placement,
1805
- refs,
1806
- strategy,
1807
- update
1808
- } = reactDom$1.useFloating({
1809
- middleware,
1810
- placement: placementProp,
1811
- whileElementsMounted: reactDom$1.autoUpdate,
1812
- elements: referenceElement ? {
1813
- reference: referenceElement
1814
- } : void 0
1815
- }), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, setArrow = react.useCallback((arrowEl) => {
1816
- arrowRef.current = arrowEl;
1817
- }, []), setFloating = react.useCallback((node) => {
1818
- ref.current = node, refs.setFloating(node);
1819
- }, [refs]), setReference = react.useCallback((node_0) => {
1820
- refs.setReference(node_0);
1821
- const childRef = getElementRef$1(childProp);
1822
- typeof childRef == "function" ? childRef(node_0) : childRef && (childRef.current = node_0);
1823
- }, [childProp, refs]), child = react.useMemo(() => referenceElement ? childProp : childProp ? react.cloneElement(childProp, {
1824
- ref: setReference
1825
- }) : null, [childProp, referenceElement, setReference]);
1826
- if (react.useEffect(() => {
1827
- updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
1828
- }, [update, updateRef]), disabled)
1829
- return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
1830
- const popover = /* @__PURE__ */ jsxRuntime.jsxs(LayerProvider, { zOffset, children: [
1831
- modal && /* @__PURE__ */ jsxRuntime.jsx(ViewportOverlay, {}),
1832
- /* @__PURE__ */ jsxRuntime.jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, referenceWidth: matchReferenceWidth ? referenceWidthRef.current : width, scheme, shadow, originX, originY, strategy, tone, x, y, children: content })
1833
- ] }), children = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
1834
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1835
- animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
1836
- child
1837
- ] });
1838
- }));
1839
- Popover.displayName = "Memo(ForwardRef(Popover))";
1840
- function getElementRef$1(element) {
1841
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1842
- return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
1843
- }
1844
- const Radio = react.forwardRef(function(props, forwardedRef) {
1845
- const $ = reactCompilerRuntime.c(21);
1846
- let className, customValidity, disabled, readOnly, restProps, style;
1847
- $[0] !== props ? ({
1848
- className,
1849
- disabled,
1850
- style,
1851
- customValidity,
1852
- readOnly,
1853
- ...restProps
1854
- } = props, $[0] = props, $[1] = className, $[2] = customValidity, $[3] = disabled, $[4] = readOnly, $[5] = restProps, $[6] = style) : (className = $[1], customValidity = $[2], disabled = $[3], readOnly = $[4], restProps = $[5], style = $[6]);
1855
- const ref = react.useRef(null);
1856
- let t0;
1857
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[7] = t0) : t0 = $[7], react.useImperativeHandle(forwardedRef, t0), useCustomValidity(ref, customValidity);
1858
- let t1;
1859
- $[8] !== className ? (t1 = css.composeClassNames(className, css.radio()), $[8] = className, $[9] = t1) : t1 = $[9];
1860
- const t2 = !disabled && readOnly ? "" : void 0, t3 = customValidity ? "" : void 0, t4 = disabled || readOnly;
1861
- let t5;
1862
- $[10] !== readOnly || $[11] !== restProps || $[12] !== t2 || $[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx("input", { "data-read-only": t2, "data-error": t3, ...restProps, disabled: t4, readOnly, ref, type: "radio" }), $[10] = readOnly, $[11] = restProps, $[12] = t2, $[13] = t3, $[14] = t4, $[15] = t5) : t5 = $[15];
1863
- let t6;
1864
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t6 = /* @__PURE__ */ jsxRuntime.jsx("span", {}), $[16] = t6) : t6 = $[16];
1865
- let t7;
1866
- return $[17] !== style || $[18] !== t1 || $[19] !== t5 ? (t7 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t1, "data-ui": "Radio", style, children: [
1867
- t5,
1868
- t6
1869
- ] }), $[17] = style, $[18] = t1, $[19] = t5, $[20] = t7) : t7 = $[20], t7;
1870
- });
1871
- Radio.displayName = "ForwardRef(Radio)";
1872
- const Select = react.forwardRef(function(props, forwardedRef) {
1873
- const $ = reactCompilerRuntime.c(36);
1874
- let children, customValidity, disabled, gap, readOnly, restProps, t0, t1, t2, t3, t4;
1875
- $[0] !== props ? ({
1876
- border: t0,
1877
- children,
1878
- customValidity,
1879
- disabled,
1880
- fontSize: t1,
1881
- gap,
1882
- padding: t2,
1883
- radius: t3,
1884
- readOnly,
1885
- space: t4,
1886
- ...restProps
1887
- } = props, $[0] = props, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = gap, $[5] = readOnly, $[6] = restProps, $[7] = t0, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4) : (children = $[1], customValidity = $[2], disabled = $[3], gap = $[4], readOnly = $[5], restProps = $[6], t0 = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11]);
1888
- const border = t0 === void 0 ? !0 : t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, radius = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 2 : t4, ref = react.useRef(null);
1889
- let t5;
1890
- $[12] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[12] = t5) : t5 = $[12], react.useImperativeHandle(forwardedRef, t5), useCustomValidity(ref, customValidity);
1891
- const t6 = gap ?? space;
1892
- let t7;
1893
- $[13] !== border || $[14] !== fontSize || $[15] !== padding || $[16] !== radius || $[17] !== t6 ? (t7 = css.select({
1894
- border,
1895
- fontSize,
1896
- padding,
1897
- radius,
1898
- gap: t6
1899
- }), $[13] = border, $[14] = fontSize, $[15] = padding, $[16] = radius, $[17] = t6, $[18] = t7) : t7 = $[18];
1900
- const t8 = !disabled && readOnly ? "" : void 0;
1901
- let t9;
1902
- $[19] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css._inputElement(), $[19] = t9) : t9 = $[19];
1903
- const t10 = disabled || readOnly;
1904
- let t11;
1905
- $[20] !== children || $[21] !== restProps || $[22] !== t10 || $[23] !== t8 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx("select", { "data-read-only": t8, ...restProps, className: t9, disabled: t10, ref, children }), $[20] = children, $[21] = restProps, $[22] = t10, $[23] = t8, $[24] = t11) : t11 = $[24];
1906
- let t12;
1907
- $[25] === Symbol.for("react.memo_cache_sentinel") ? (t12 = css.selectPresentation(), $[25] = t12) : t12 = $[25];
1908
- let t13;
1909
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, {}), $[26] = t13) : t13 = $[26];
1910
- let t14;
1911
- $[27] !== fontSize ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize, children: t13 }), $[27] = fontSize, $[28] = t14) : t14 = $[28];
1912
- let t15;
1913
- $[29] !== padding || $[30] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t12, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", display: "inline-block", padding, children: t14 }) }), $[29] = padding, $[30] = t14, $[31] = t15) : t15 = $[31];
1914
- let t16;
1915
- return $[32] !== t11 || $[33] !== t15 || $[34] !== t7 ? (t16 = /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-ui": "Select", className: t7, "data-icon-right": "", children: [
1916
- t11,
1917
- t15
1918
- ] }), $[32] = t11, $[33] = t15, $[34] = t7, $[35] = t16) : t16 = $[35], t16;
1919
- });
1920
- Select.displayName = "ForwardRef(Select)";
1921
- const Stack = react.forwardRef(function(props, ref) {
1922
- const $ = reactCompilerRuntime.c(10);
1923
- let as, gap, restProps, space;
1924
- $[0] !== props ? ({
1925
- as,
1926
- gap,
1927
- space,
1928
- ...restProps
1929
- } = props, $[0] = props, $[1] = as, $[2] = gap, $[3] = restProps, $[4] = space) : (as = $[1], gap = $[2], restProps = $[3], space = $[4]);
1930
- const t0 = gap ?? space;
1931
- let t1;
1932
- return $[5] !== as || $[6] !== ref || $[7] !== restProps || $[8] !== t0 ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Stack", ...restProps, as, direction: "column", display: "flex", gap: t0, ref }), $[5] = as, $[6] = ref, $[7] = restProps, $[8] = t0, $[9] = t1) : t1 = $[9], t1;
1933
- });
1934
- Stack.displayName = "ForwardRef(Stack)";
1935
- const Switch = react.forwardRef(function(props, forwardedRef) {
1936
- const $ = reactCompilerRuntime.c(28);
1937
- let checked, className, disabled, indeterminate, readOnly, restProps, style;
1938
- $[0] !== props ? ({
1939
- checked,
1940
- className,
1941
- disabled,
1942
- indeterminate,
1943
- readOnly,
1944
- style,
1945
- ...restProps
1946
- } = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = disabled, $[4] = indeterminate, $[5] = readOnly, $[6] = restProps, $[7] = style) : (checked = $[1], className = $[2], disabled = $[3], indeterminate = $[4], readOnly = $[5], restProps = $[6], style = $[7]);
1947
- const ref = react.useRef(null);
1948
- let t0;
1949
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[8] = t0) : t0 = $[8], react.useImperativeHandle(forwardedRef, t0);
1950
- let t1, t2;
1951
- $[9] !== indeterminate ? (t1 = () => {
1952
- ref.current && (ref.current.indeterminate = indeterminate || !1);
1953
- }, t2 = [indeterminate], $[9] = indeterminate, $[10] = t1, $[11] = t2) : (t1 = $[10], t2 = $[11]), react.useEffect(t1, t2);
1954
- let t3;
1955
- $[12] !== className ? (t3 = css.composeClassNames(className, css._switch()), $[12] = className, $[13] = t3) : t3 = $[13];
1956
- const t4 = checked ? "" : void 0, t5 = indeterminate ? "" : void 0, t6 = indeterminate !== !0 && checked;
1957
- let t7;
1958
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = css._switchElement(), $[14] = t7) : t7 = $[14];
1959
- const t8 = disabled ? "" : void 0, t9 = !disabled && readOnly ? "" : void 0, t10 = disabled || readOnly;
1960
- let t11;
1961
- $[15] !== restProps || $[16] !== t10 || $[17] !== t6 || $[18] !== t8 || $[19] !== t9 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx("input", { ...restProps, checked: t6, className: t7, "data-disabled": t8, "data-read-only": t9, disabled: t10, type: "checkbox", ref }), $[15] = restProps, $[16] = t10, $[17] = t6, $[18] = t8, $[19] = t9, $[20] = t11) : t11 = $[20];
1962
- let t12;
1963
- $[21] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsxRuntime.jsxs("span", { "aria-hidden": !0, className: css._switchPresentation(), children: [
1964
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: css._switchTrack() }),
1965
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: css._switchThumb() })
1966
- ] }), $[21] = t12) : t12 = $[21];
1967
- let t13;
1968
- return $[22] !== style || $[23] !== t11 || $[24] !== t3 || $[25] !== t4 || $[26] !== t5 ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: t3, "data-checked": t4, "data-indeterminate": t5, "data-ui": "Switch", display: "inline-block", position: "relative", style, children: [
1969
- t11,
1970
- t12
1971
- ] }), $[22] = style, $[23] = t11, $[24] = t3, $[25] = t4, $[26] = t5, $[27] = t13) : t13 = $[27], t13;
1972
- });
1973
- Switch.displayName = "ForwardRef(Switch)";
1974
- const TextArea = react.forwardRef(function(props, forwardedRef) {
1975
- const $ = reactCompilerRuntime.c(25);
1976
- let customValidity, gap, restProps, t0, t1, t2, t3, t4, t5;
1977
- $[0] !== props ? ({
1978
- border: t0,
1979
- customValidity,
1980
- disabled: t1,
1981
- fontSize: t2,
1982
- gap,
1983
- padding: t3,
1984
- radius: t4,
1985
- space: t5,
1986
- ...restProps
1987
- } = props, $[0] = props, $[1] = customValidity, $[2] = gap, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5) : (customValidity = $[1], gap = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9]);
1988
- const border = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSize = t2 === void 0 ? 2 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, space = t5 === void 0 ? 3 : t5, ref = react.useRef(null);
1989
- let t6;
1990
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10], react.useImperativeHandle(forwardedRef, t6), useCustomValidity(ref, customValidity);
1991
- const t7 = gap ?? space;
1992
- let t8;
1993
- $[11] !== border || $[12] !== fontSize || $[13] !== padding || $[14] !== radius || $[15] !== t7 ? (t8 = css.textArea({
1994
- border,
1995
- fontSize,
1996
- padding,
1997
- radius,
1998
- gap: t7
1999
- }), $[11] = border, $[12] = fontSize, $[13] = padding, $[14] = radius, $[15] = t7, $[16] = t8) : t8 = $[16];
2000
- let t9;
2001
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css._inputElement(), $[17] = t9) : t9 = $[17];
2002
- let t10;
2003
- $[18] !== disabled || $[19] !== restProps ? (t10 = /* @__PURE__ */ jsxRuntime.jsx("textarea", { ...restProps, className: t9, disabled, ref }), $[18] = disabled, $[19] = restProps, $[20] = t10) : t10 = $[20];
2004
- let t11;
2005
- $[21] === Symbol.for("react.memo_cache_sentinel") ? (t11 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: css._inputPresentation() }), $[21] = t11) : t11 = $[21];
2006
- let t12;
2007
- return $[22] !== t10 || $[23] !== t8 ? (t12 = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: t8, "data-ui": "TextArea", children: [
2008
- t10,
2009
- t11
2010
- ] }), $[22] = t10, $[23] = t8, $[24] = t12) : t12 = $[24], t12;
2011
- });
2012
- TextArea.displayName = "ForwardRef(TextArea)";
2013
- const CLEAR_BUTTON_BOX_STYLE = {
2014
- backgroundColor: "transparent",
2015
- top: 0,
2016
- right: 0,
2017
- zIndex: 2
2018
- }, TextInput = react.forwardRef(function(props, forwardedRef) {
2019
- const $ = reactCompilerRuntime.c(83);
2020
- let IconComponent, IconRightComponent, __unstable_disableFocusRing, className, clearButton, customValidity, gap, onClear, prefix, readOnly, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, width;
2021
- if ($[0] !== props) {
2022
- const {
2023
- __unstable_disableFocusRing: t72,
2024
- border: t82,
2025
- className: t92,
2026
- clearButton: t102,
2027
- disabled: t112,
2028
- fontSize: t122,
2029
- gap: t132,
2030
- icon: t142,
2031
- iconRight: t152,
2032
- onClear: t162,
2033
- padding: t172,
2034
- prefix: t182,
2035
- radius: t192,
2036
- readOnly: t202,
2037
- space: t212,
2038
- suffix: t222,
2039
- customValidity: t232,
2040
- type: t242,
2041
- weight: _width,
2042
- width: t252,
2043
- ...t262
2044
- } = props;
2045
- __unstable_disableFocusRing = t72, t0 = t82, className = t92, clearButton = t102, t1 = t112, t2 = t122, gap = t132, IconComponent = t142, IconRightComponent = t152, onClear = t162, t3 = t172, prefix = t182, t4 = t192, readOnly = t202, t5 = t212, suffix = t222, customValidity = t232, t6 = t242, width = t252, restProps = t262, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = className, $[5] = clearButton, $[6] = customValidity, $[7] = gap, $[8] = onClear, $[9] = prefix, $[10] = readOnly, $[11] = restProps, $[12] = suffix, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4, $[18] = t5, $[19] = t6, $[20] = width;
2046
- } else
2047
- IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], className = $[4], clearButton = $[5], customValidity = $[6], gap = $[7], onClear = $[8], prefix = $[9], readOnly = $[10], restProps = $[11], suffix = $[12], t0 = $[13], t1 = $[14], t2 = $[15], t3 = $[16], t4 = $[17], t5 = $[18], t6 = $[19], width = $[20];
2048
- const border = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSize = t2 === void 0 ? 1 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, space = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = react.useRef(null), paddingArray = useArrayProp(padding), withClearButton = !!clearButton;
2049
- let t7;
2050
- $[21] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[21] = t7) : t7 = $[21], react.useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
2051
- const handleClearMouseDown = _temp;
2052
- let t8;
2053
- $[22] !== onClear ? (t8 = (event_0) => {
2054
- event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
2055
- }, $[22] = onClear, $[23] = t8) : t8 = $[23];
2056
- const handleClearClick = t8;
2057
- let t9, t10;
2058
- $[24] !== paddingArray ? (t10 = paddingArray.map(_temp2), $[24] = paddingArray, $[25] = t10) : t10 = $[25], t9 = t10;
2059
- const clearButtonBoxPadding = t9;
2060
- let t11, t12;
2061
- $[26] !== paddingArray ? (t12 = paddingArray.map(_temp3), $[26] = paddingArray, $[27] = t12) : t12 = $[27], t11 = t12;
2062
- const clearButtonPadding = t11;
2063
- let t13;
2064
- t13 = isRecord(clearButton) ? clearButton : EMPTY_RECORD;
2065
- const clearButtonProps = t13, t14 = gap ?? space;
2066
- let t15;
2067
- $[28] !== border || $[29] !== className || $[30] !== fontSize || $[31] !== padding || $[32] !== radius || $[33] !== t14 || $[34] !== width ? (t15 = css.composeClassNames(className, css.textInput({
2068
- border,
2069
- fontSize,
2070
- padding,
2071
- radius,
2072
- gap: t14,
2073
- width
2074
- })), $[28] = border, $[29] = className, $[30] = fontSize, $[31] = padding, $[32] = radius, $[33] = t14, $[34] = width, $[35] = t15) : t15 = $[35];
2075
- const t16 = IconComponent ? "" : void 0, t17 = IconRightComponent ? "" : void 0, t18 = prefix ? "" : void 0, t19 = suffix ? "" : void 0;
2076
- let t20;
2077
- $[36] !== prefix ? (t20 = prefix && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", className: "text-input-prefix", sizing: "border", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: prefix }) }), $[36] = prefix, $[37] = t20) : t20 = $[37];
2078
- let t21;
2079
- $[38] === Symbol.for("react.memo_cache_sentinel") ? (t21 = css._inputElement(), $[38] = t21) : t21 = $[38];
2080
- let t22;
2081
- $[39] !== disabled || $[40] !== readOnly || $[41] !== restProps || $[42] !== type ? (t22 = /* @__PURE__ */ jsxRuntime.jsx("input", { ...restProps, className: t21, disabled, readOnly, ref, type }), $[39] = disabled, $[40] = readOnly, $[41] = restProps, $[42] = type, $[43] = t22) : t22 = $[43];
2082
- let t23;
2083
- $[44] === Symbol.for("react.memo_cache_sentinel") ? (t23 = css._inputPresentation(), $[44] = t23) : t23 = $[44];
2084
- const t24 = __unstable_disableFocusRing ? "" : void 0;
2085
- let t25;
2086
- $[45] !== IconComponent || $[46] !== fontSize || $[47] !== padding ? (t25 = IconComponent && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", padding, position: "absolute", style: {
2087
- top: 0,
2088
- left: 0
2089
- }, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize, children: [
2090
- react.isValidElement(IconComponent) && IconComponent,
2091
- ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
2092
- ] }) }), $[45] = IconComponent, $[46] = fontSize, $[47] = padding, $[48] = t25) : t25 = $[48];
2093
- let t26;
2094
- $[49] !== IconRightComponent || $[50] !== fontSize || $[51] !== padding || $[52] !== withClearButton ? (t26 = !withClearButton && IconRightComponent && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", padding, position: "absolute", style: {
2095
- top: 0,
2096
- right: 0
2097
- }, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize, children: [
2098
- react.isValidElement(IconRightComponent) && IconRightComponent,
2099
- ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
2100
- ] }) }), $[49] = IconRightComponent, $[50] = fontSize, $[51] = padding, $[52] = withClearButton, $[53] = t26) : t26 = $[53];
2101
- let t27;
2102
- $[54] !== t24 || $[55] !== t25 || $[56] !== t26 ? (t27 = /* @__PURE__ */ jsxRuntime.jsxs(Box, { as: "span", className: t23, "data-disable-focus-ring": t24, position: "absolute", children: [
2103
- t25,
2104
- t26
2105
- ] }), $[54] = t24, $[55] = t25, $[56] = t26, $[57] = t27) : t27 = $[57];
2106
- let t28;
2107
- $[58] !== clearButton || $[59] !== clearButtonBoxPadding || $[60] !== clearButtonPadding || $[61] !== clearButtonProps || $[62] !== disabled || $[63] !== fontSize || $[64] !== handleClearClick || $[65] !== radius || $[66] !== readOnly ? (t28 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", padding: clearButtonBoxPadding, position: "absolute", style: CLEAR_BUTTON_BOX_STYLE, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { "aria-label": "Clear", "data-qa": "clear-button", display: "block", fontSize, icon: icons.CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[58] = clearButton, $[59] = clearButtonBoxPadding, $[60] = clearButtonPadding, $[61] = clearButtonProps, $[62] = disabled, $[63] = fontSize, $[64] = handleClearClick, $[65] = radius, $[66] = readOnly, $[67] = t28) : t28 = $[67];
2108
- let t29;
2109
- $[68] !== t22 || $[69] !== t27 || $[70] !== t28 ? (t29 = /* @__PURE__ */ jsxRuntime.jsxs(Box, { as: "span", flex: 1, position: "relative", children: [
2110
- t22,
2111
- t27,
2112
- t28
2113
- ] }), $[68] = t22, $[69] = t27, $[70] = t28, $[71] = t29) : t29 = $[71];
2114
- let t30;
2115
- $[72] !== suffix ? (t30 = suffix && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", className: "text-input-suffix", sizing: "border", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: suffix }) }), $[72] = suffix, $[73] = t30) : t30 = $[73];
2116
- let t31;
2117
- return $[74] !== t15 || $[75] !== t16 || $[76] !== t17 || $[77] !== t18 || $[78] !== t19 || $[79] !== t20 || $[80] !== t29 || $[81] !== t30 ? (t31 = /* @__PURE__ */ jsxRuntime.jsxs(Box, { align: "center", as: "span", className: t15, "data-icon-left": t16, "data-icon-right": t17, "data-prefix": t18, "data-suffix": t19, "data-ui": "TextInput", display: "flex", children: [
2118
- t20,
2119
- t29,
2120
- t30
2121
- ] }), $[74] = t15, $[75] = t16, $[76] = t17, $[77] = t18, $[78] = t19, $[79] = t20, $[80] = t29, $[81] = t30, $[82] = t31) : t31 = $[82], t31;
2122
- });
2123
- TextInput.displayName = "ForwardRef(TextInput)";
2124
- function _temp(event) {
2125
- event.preventDefault(), event.stopPropagation();
2126
- }
2127
- function _temp2(v) {
2128
- return v === 0 ? 0 : v === 1 || v === 2 ? 1 : typeof v == "number" ? v - 2 : 0;
2129
- }
2130
- function _temp3(v_0) {
2131
- return v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : typeof v_0 == "number" ? v_0 - 1 : 0;
2132
- }
2133
- function useDelayedState(initialState) {
2134
- const $ = reactCompilerRuntime.c(3), [state, setState] = react.useState(initialState), delayedAction = react.useRef(void 0);
2135
- let t0;
2136
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = (nextState, delay) => {
2137
- const action = () => {
2138
- setState(nextState);
2139
- };
2140
- if (delayedAction.current && (clearTimeout(delayedAction.current), delayedAction.current = void 0), !delay)
2141
- return action();
2142
- delayedAction.current = setTimeout(action, delay);
2143
- }, $[0] = t0) : t0 = $[0];
2144
- const onStateChange = t0;
2145
- let t1;
2146
- return $[1] !== state ? (t1 = [state, onStateChange], $[1] = state, $[2] = t1) : t1 = $[2], t1;
2147
- }
2148
- function getElementRef(element) {
2149
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
2150
- return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
2151
- }
2152
- const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAULT_TOOLTIP_ARROW_RADIUS = 2, DEFAULT_TOOLTIP_DISTANCE = 4, DEFAULT_TOOLTIP_PADDING = 4, DEFAULT_FALLBACK_PLACEMENTS = {
2153
- top: ["top-end", "top-start", "bottom", "left", "right"],
2154
- "top-start": ["top", "top-end", "bottom-start", "left-start", "right-start"],
2155
- "top-end": ["top", "top-start", "bottom-end", "left-end", "right-end"],
2156
- bottom: ["bottom-end", "bottom-start", "top", "left", "right"],
2157
- "bottom-start": ["bottom", "bottom-end", "top-start", "left-start", "right-start"],
2158
- "bottom-end": ["bottom", "bottom-start", "top-end", "left-end", "right-end"],
2159
- left: ["left-end", "left-start", "right", "top", "bottom"],
2160
- "left-start": ["left", "left-end", "right-start", "top-start", "bottom-start"],
2161
- "left-end": ["left", "left-start", "right-end", "top-end", "bottom-end"],
2162
- right: ["right-end", "right-start", "left", "top", "bottom"],
2163
- "right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
2164
- "right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
2165
- }, MotionCard = framerMotion.motion.create(Card), TooltipCard = react.memo(react.forwardRef(function(props, ref) {
2166
- const $ = reactCompilerRuntime.c(52);
2167
- let animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style, tone;
2168
- $[0] !== props ? ({
2169
- animate,
2170
- arrow,
2171
- arrowRef,
2172
- arrowX,
2173
- arrowY,
2174
- children,
2175
- originX,
2176
- originY,
2177
- padding,
2178
- placement,
2179
- radius,
2180
- scheme,
2181
- shadow,
2182
- style,
2183
- tone,
2184
- ...restProps
2185
- } = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = restProps, $[13] = scheme, $[14] = shadow, $[15] = style, $[16] = tone) : (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], restProps = $[12], scheme = $[13], shadow = $[14], style = $[15], tone = $[16]);
2186
- let t0;
2187
- const t1 = animate ? "transform" : void 0;
2188
- let t2;
2189
- $[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t1 ? (t2 = {
2190
- originX,
2191
- originY,
2192
- willChange: t1,
2193
- ...style
2194
- }, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t1, $[21] = t2) : t2 = $[21], t0 = t2;
2195
- const rootStyle = t0;
2196
- let t3;
2197
- const t4 = arrowX !== null ? arrowX : void 0, t5 = arrowY !== null ? arrowY : void 0;
2198
- let t6;
2199
- $[22] !== t4 || $[23] !== t5 ? (t6 = {
2200
- left: t4,
2201
- top: t5,
2202
- right: void 0,
2203
- bottom: void 0
2204
- }, $[22] = t4, $[23] = t5, $[24] = t6) : t6 = $[24], t3 = t6;
2205
- const arrowStyle = t3, t7 = animate ? "" : void 0;
2206
- let t8;
2207
- $[25] === Symbol.for("react.memo_cache_sentinel") ? (t8 = css.tooltipCard(), $[25] = t8) : t8 = $[25];
2208
- let t9;
2209
- $[26] !== animate ? (t9 = animate ? ["hidden", "initial"] : void 0, $[26] = animate, $[27] = t9) : t9 = $[27];
2210
- let t10;
2211
- $[28] !== animate ? (t10 = animate ? ["visible", "scaleIn"] : void 0, $[28] = animate, $[29] = t10) : t10 = $[29];
2212
- let t11;
2213
- $[30] !== animate ? (t11 = animate ? ["hidden", "scaleOut"] : void 0, $[30] = animate, $[31] = t11) : t11 = $[31];
2214
- let t12;
2215
- $[32] !== arrow || $[33] !== arrowRef || $[34] !== arrowStyle ? (t12 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[32] = arrow, $[33] = arrowRef, $[34] = arrowStyle, $[35] = t12) : t12 = $[35];
2216
- let t13;
2217
- return $[36] !== children || $[37] !== padding || $[38] !== placement || $[39] !== radius || $[40] !== ref || $[41] !== restProps || $[42] !== rootStyle || $[43] !== scheme || $[44] !== shadow || $[45] !== t10 || $[46] !== t11 || $[47] !== t12 || $[48] !== t7 || $[49] !== t9 || $[50] !== tone ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(MotionCard, { "data-ui": "Tooltip__card", ...restProps, "data-animate": t7, className: t8, "data-placement": placement, padding, radius, ref, scheme, shadow, style: rootStyle, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t9, animate: t10, exit: t11, tone, children: [
2218
- children,
2219
- t12
2220
- ] }), $[36] = children, $[37] = padding, $[38] = placement, $[39] = radius, $[40] = ref, $[41] = restProps, $[42] = rootStyle, $[43] = scheme, $[44] = shadow, $[45] = t10, $[46] = t11, $[47] = t12, $[48] = t7, $[49] = t9, $[50] = tone, $[51] = t13) : t13 = $[51], t13;
2221
- }));
2222
- TooltipCard.displayName = "Memo(ForwardRef(TooltipCard))";
2223
- const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
2224
- function TooltipDelayGroupProvider(props) {
2225
- const $ = reactCompilerRuntime.c(9), {
2226
- children,
2227
- delay
2228
- } = props, [isGroupActive, setIsGroupActive] = useDelayedState(!1), [openTooltipId, setOpenTooltipId] = useDelayedState(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0;
2229
- let t0;
2230
- const t1 = isGroupActive ? 1 : openDelay;
2231
- let t2;
2232
- $[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t1 ? (t2 = {
2233
- setIsGroupActive,
2234
- openTooltipId,
2235
- setOpenTooltipId,
2236
- openDelay: t1,
2237
- closeDelay
2238
- }, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t1, $[5] = t2) : t2 = $[5], t0 = t2;
2239
- const value = t0;
2240
- let t3;
2241
- return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
2242
- }
2243
- TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
2244
- function useTooltipDelayGroup() {
2245
- return react.useContext(TooltipDelayGroupContext);
2246
- }
2247
- const Tooltip = react.forwardRef(function(props, forwardedRef) {
2248
- const boundaryElementContext = useBoundaryElement(), {
2249
- layer
2250
- } = useTheme_v2(), {
2251
- animate: _animate = !1,
2252
- arrow: arrowProp = !1,
2253
- boundaryElement = boundaryElementContext?.element,
2254
- children: childProp,
2255
- className,
2256
- content,
2257
- delay,
2258
- disabled,
2259
- fallbackPlacements: fallbackPlacementsProp = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"],
2260
- padding = 2,
2261
- placement: placementProp = "bottom",
2262
- portal: portalProp,
2263
- radius = 3,
2264
- scheme,
2265
- shadow = 2,
2266
- zOffset = layer.tooltip.zOffset,
2267
- tone,
2268
- ...restProps
2269
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = react.useRef(null), [referenceElement, setReferenceElement] = react.useState(null), arrowRef = react.useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = react.useState(0);
2270
- react.useImperativeHandle(forwardedRef, () => ref.current);
2271
- const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, middleware = react.useMemo(() => {
2272
- const ret = [];
2273
- return ret.push(reactDom$1.flip({
2274
- boundary: boundaryElement || void 0,
2275
- fallbackPlacements,
2276
- padding: DEFAULT_TOOLTIP_PADDING,
2277
- rootBoundary
2278
- })), ret.push(reactDom$1.offset({
2279
- mainAxis: DEFAULT_TOOLTIP_DISTANCE
2280
- })), ret.push(reactDom$1.shift({
2281
- boundary: boundaryElement || void 0,
2282
- rootBoundary,
2283
- padding: DEFAULT_TOOLTIP_PADDING
2284
- })), arrowProp && ret.push(reactDom$1.arrow({
2285
- element: arrowRef,
2286
- padding: DEFAULT_TOOLTIP_PADDING
2287
- })), animate && ret.push(origin), ret;
2288
- }, [animate, arrowProp, boundaryElement, fallbackPlacements]), {
2289
- floatingStyles,
2290
- placement,
2291
- middlewareData,
2292
- refs,
2293
- update
2294
- } = reactDom$1.useFloating({
2295
- middleware,
2296
- placement: placementProp,
2297
- whileElementsMounted: reactDom$1.autoUpdate,
2298
- elements: {
2299
- reference: referenceElement
2300
- }
2301
- }), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = react.useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), {
2302
- setIsGroupActive,
2303
- setOpenTooltipId
2304
- } = delayGroupContext || {}, showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, handleIsOpenChange = react.useCallback((open, immediate) => {
2305
- if (isInsideGroup)
2306
- if (open) {
2307
- const groupedOpenDelay = immediate ? 0 : openDelay;
2308
- setIsGroupActive?.(open, groupedOpenDelay), setOpenTooltipId?.(tooltipId, groupedOpenDelay);
2309
- } else {
2310
- const groupDeactivateDelay = closeDelay > 200 ? closeDelay : 200;
2311
- setIsGroupActive?.(open, groupDeactivateDelay), setOpenTooltipId?.(null, immediate ? 0 : closeDelay);
2312
- }
2313
- else
2314
- setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
2315
- }, [isInsideGroup, openDelay, setIsGroupActive, setOpenTooltipId, tooltipId, closeDelay, setIsOpen]), handleBlur = react.useCallback((e) => {
2316
- handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
2317
- }, [childProp?.props, handleIsOpenChange]), handleClick = react.useCallback((e_0) => {
2318
- handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
2319
- }, [childProp?.props, handleIsOpenChange]), handleContextMenu = react.useCallback((e_1) => {
2320
- handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
2321
- }, [childProp?.props, handleIsOpenChange]), handleFocus = react.useCallback((e_2) => {
2322
- handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
2323
- }, [childProp?.props, handleIsOpenChange]), handleMouseEnter = react.useCallback((e_3) => {
2324
- handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
2325
- }, [childProp?.props, handleIsOpenChange]), handleMouseLeave = react.useCallback((e_4) => {
2326
- handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
2327
- }, [childProp?.props, handleIsOpenChange]);
2328
- useCloseOnMouseLeave({
2329
- handleIsOpenChange,
2330
- referenceElement,
2331
- showTooltip,
2332
- isInsideGroup
2333
- }), react.useEffect(() => {
2334
- disabled && showTooltip && handleIsOpenChange(!1);
2335
- }, [disabled, handleIsOpenChange, showTooltip]), react.useEffect(() => {
2336
- !content && showTooltip && handleIsOpenChange(!1);
2337
- }, [content, handleIsOpenChange, showTooltip]), react.useEffect(() => {
2338
- if (!showTooltip) return;
2339
- function handleWindowKeyDown(event) {
2340
- event.key === "Escape" && handleIsOpenChange(!1, !0);
2341
- }
2342
- return window.addEventListener("keydown", handleWindowKeyDown), () => {
2343
- window.removeEventListener("keydown", handleWindowKeyDown);
2344
- };
2345
- }, [handleIsOpenChange, showTooltip]), react.useLayoutEffect(() => {
2346
- const availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
2347
- setTooltipMaxWidth(Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2);
2348
- }, [boundaryElement, portalElement]);
2349
- const setArrow = react.useCallback((arrowEl) => {
2350
- arrowRef.current = arrowEl, update();
2351
- }, [update]), setFloating = react.useCallback((node) => {
2352
- ref.current = node, refs.setFloating(node);
2353
- }, [refs]), child = react.useMemo(() => childProp ? react.cloneElement(childProp, {
2354
- onBlur: handleBlur,
2355
- onFocus: handleFocus,
2356
- onMouseEnter: handleMouseEnter,
2357
- onMouseLeave: handleMouseLeave,
2358
- onClick: handleClick,
2359
- onContextMenu: handleContextMenu,
2360
- ref: setReferenceElement
2361
- }) : null, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave]);
2362
- if (react.useImperativeHandle(childProp ? getElementRef(childProp) : null, () => referenceElement, [referenceElement]), !child) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
2363
- if (disabled) return child;
2364
- const node_0 = /* @__PURE__ */ jsxRuntime.jsx(
2365
- Layer,
2366
- {
2367
- "data-ui": "Tooltip",
2368
- className: css.composeClassNames(className, css.tooltip()),
2369
- ref: setFloating,
2370
- style: {
2371
- ...floatingStyles,
2372
- maxWidth: tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0
2373
- },
2374
- zOffset,
2375
- children: /* @__PURE__ */ jsxRuntime.jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, tone, children: content })
2376
- }
2377
- ), children = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: node_0 }) : node_0);
2378
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2379
- animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
2380
- child
2381
- ] });
2382
- });
2383
- Tooltip.displayName = "ForwardRef(Tooltip)";
2384
- function useCloseOnMouseLeave(t0) {
2385
- const $ = reactCompilerRuntime.c(10), {
2386
- handleIsOpenChange,
2387
- referenceElement,
2388
- showTooltip,
2389
- isInsideGroup
2390
- } = t0;
2391
- let t1;
2392
- $[0] !== handleIsOpenChange || $[1] !== referenceElement ? (t1 = (target, teardown) => {
2393
- referenceElement && (referenceElement === target || target instanceof Node && referenceElement.contains(target) || (handleIsOpenChange(!1), teardown()));
2394
- }, $[0] = handleIsOpenChange, $[1] = referenceElement, $[2] = t1) : t1 = $[2];
2395
- const onMouseMove = useEffectEvent.useEffectEvent(t1);
2396
- let t2;
2397
- $[3] !== isInsideGroup || $[4] !== onMouseMove || $[5] !== showTooltip ? (t2 = () => {
2398
- if (!showTooltip || isInsideGroup)
2399
- return;
2400
- const handleMouseMove = (event) => {
2401
- onMouseMove(event.target, () => window.removeEventListener("mousemove", handleMouseMove));
2402
- };
2403
- return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
2404
- }, $[3] = isInsideGroup, $[4] = onMouseMove, $[5] = showTooltip, $[6] = t2) : t2 = $[6];
2405
- let t3;
2406
- $[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], react.useEffect(t2, t3);
2407
- }
2408
- const Hotkeys = react.forwardRef(function(props, ref) {
2409
- const $ = reactCompilerRuntime.c(30);
2410
- let fontSize, gap, gapX, gapY, keys, padding, radius, restProps, t0;
2411
- $[0] !== props ? ({
2412
- fontSize,
2413
- gap,
2414
- gapX,
2415
- gapY,
2416
- keys,
2417
- padding,
2418
- radius,
2419
- space: t0,
2420
- ...restProps
2421
- } = props, $[0] = props, $[1] = fontSize, $[2] = gap, $[3] = gapX, $[4] = gapY, $[5] = keys, $[6] = padding, $[7] = radius, $[8] = restProps, $[9] = t0) : (fontSize = $[1], gap = $[2], gapX = $[3], gapY = $[4], keys = $[5], padding = $[6], radius = $[7], restProps = $[8], t0 = $[9]);
2422
- const space = t0 === void 0 ? 1 : t0;
2423
- if (!keys || keys.length === 0) {
2424
- let t12;
2425
- return $[10] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[10] = t12) : t12 = $[10], t12;
2426
- }
2427
- const t1 = gap ?? space;
2428
- let t2;
2429
- if ($[11] !== fontSize || $[12] !== keys || $[13] !== padding || $[14] !== radius) {
2430
- let t32;
2431
- $[16] !== fontSize || $[17] !== padding || $[18] !== radius ? (t32 = (key2, i) => /* @__PURE__ */ jsxRuntime.jsx(KBD, { display: "block", fontSize, padding, radius, children: key2 }, i), $[16] = fontSize, $[17] = padding, $[18] = radius, $[19] = t32) : t32 = $[19], t2 = keys.map(t32), $[11] = fontSize, $[12] = keys, $[13] = padding, $[14] = radius, $[15] = t2;
2432
- } else
2433
- t2 = $[15];
2434
- let t3;
2435
- $[20] !== gap || $[21] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Inline, { as: "span", gap, children: t2 }), $[20] = gap, $[21] = t2, $[22] = t3) : t3 = $[22];
2436
- let t4;
2437
- return $[23] !== gapX || $[24] !== gapY || $[25] !== ref || $[26] !== restProps || $[27] !== t1 || $[28] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "kbd", "data-ui": "Hotkeys", ...restProps, display: "flex", gap: t1, gapX, gapY, ref, children: t3 }), $[23] = gapX, $[24] = gapY, $[25] = ref, $[26] = restProps, $[27] = t1, $[28] = t3, $[29] = t4) : t4 = $[29], t4;
2438
- });
2439
- Hotkeys.displayName = "ForwardRef(Hotkeys)";
2440
- const MenuContext = createGlobalScopedContext("@sanity/ui/context/menu", null);
2441
- function _isFocusable(element) {
2442
- return isHTMLAnchorElement(element) && element.getAttribute("data-disabled") !== "true" || isHTMLButtonElement(element) && !element.disabled;
2443
- }
2444
- function _getFocusableElements(elements) {
2445
- return elements.filter(_isFocusable);
2446
- }
2447
- function _getDOMPath(rootElement, el) {
2448
- const path = [];
2449
- let e = el;
2450
- for (; e !== rootElement; ) {
2451
- const parentElement = e.parentElement;
2452
- if (!parentElement) return path;
2453
- const index = Array.from(parentElement.childNodes).indexOf(e);
2454
- if (path.unshift(index), parentElement === rootElement)
2455
- return path;
2456
- e = parentElement;
2457
- }
2458
- return path;
2459
- }
2460
- const EMPTY_PATH = [];
2461
- function _sortElements(rootElement, elements) {
2462
- if (!rootElement) return;
2463
- const map = /* @__PURE__ */ new WeakMap();
2464
- for (const el of elements)
2465
- map.set(el, _getDOMPath(rootElement, el));
2466
- const _sort = (a, b) => {
2467
- const _a = map.get(a) || EMPTY_PATH, _b = map.get(b) || EMPTY_PATH, len = Math.max(_a.length, _b.length);
2468
- for (let i = 0; i < len; i += 1) {
2469
- const aIndex = _a[i] || -1, bIndex = _b[i] || -1;
2470
- if (aIndex !== bIndex)
2471
- return aIndex - bIndex;
2472
- }
2473
- return 0;
2474
- };
2475
- elements.sort(_sort);
2476
- }
2477
- function useMenuController(props) {
2478
- const {
2479
- onKeyDown,
2480
- originElement,
2481
- shouldFocus,
2482
- rootElementRef
2483
- } = props, elementsRef = react.useRef([]), [activeIndex, _setActiveIndex] = react.useState(-1), activeIndexRef = react.useRef(activeIndex), activeElement = react.useMemo(() => elementsRef.current[activeIndex] || null, [activeIndex]), mounted = !!rootElementRef.current, setActiveIndex = react.useCallback((nextActiveIndex) => {
2484
- _setActiveIndex(nextActiveIndex), activeIndexRef.current = nextActiveIndex;
2485
- }, []), mount = react.useCallback((element, selected) => {
2486
- if (!element) return () => {
2487
- };
2488
- if (elementsRef.current.indexOf(element) === -1 && (elementsRef.current.push(element), _sortElements(rootElementRef.current, elementsRef.current)), selected) {
2489
- const selectedIndex = elementsRef.current.indexOf(element);
2490
- setActiveIndex(selectedIndex);
2491
- }
2492
- return () => {
2493
- const idx = elementsRef.current.indexOf(element);
2494
- idx > -1 && elementsRef.current.splice(idx, 1);
2495
- };
2496
- }, [rootElementRef, setActiveIndex]), handleKeyDown = react.useCallback((event) => {
2497
- if (event.key === "Tab") {
2498
- originElement && originElement.focus();
2499
- return;
2500
- }
2501
- if (event.key === "Home") {
2502
- event.preventDefault(), event.stopPropagation();
2503
- const el = _getFocusableElements(elementsRef.current)[0];
2504
- if (!el) return;
2505
- const currentIndex = elementsRef.current.indexOf(el);
2506
- setActiveIndex(currentIndex);
2507
- return;
2508
- }
2509
- if (event.key === "End") {
2510
- event.preventDefault(), event.stopPropagation();
2511
- const focusableElements_0 = _getFocusableElements(elementsRef.current), el_0 = focusableElements_0[focusableElements_0.length - 1];
2512
- if (!el_0) return;
2513
- const currentIndex_0 = elementsRef.current.indexOf(el_0);
2514
- setActiveIndex(currentIndex_0);
2515
- return;
2516
- }
2517
- if (event.key === "ArrowUp") {
2518
- event.preventDefault(), event.stopPropagation();
2519
- const focusableElements_1 = _getFocusableElements(elementsRef.current), focusableLen = focusableElements_1.length;
2520
- if (focusableLen === 0) return;
2521
- const focusedElement = elementsRef.current[activeIndexRef.current];
2522
- let focusedIndex = focusableElements_1.indexOf(focusedElement);
2523
- focusedIndex = (focusedIndex - 1 + focusableLen) % focusableLen;
2524
- const el_1 = focusableElements_1[focusedIndex], currentIndex_1 = elementsRef.current.indexOf(el_1);
2525
- setActiveIndex(currentIndex_1);
2526
- return;
2527
- }
2528
- if (event.key === "ArrowDown") {
2529
- event.preventDefault(), event.stopPropagation();
2530
- const focusableElements_2 = _getFocusableElements(elementsRef.current), focusableLen_0 = focusableElements_2.length;
2531
- if (focusableLen_0 === 0) return;
2532
- const focusedElement_0 = elementsRef.current[activeIndexRef.current];
2533
- let focusedIndex_0 = focusableElements_2.indexOf(focusedElement_0);
2534
- focusedIndex_0 = (focusedIndex_0 + 1) % focusableLen_0;
2535
- const el_2 = focusableElements_2[focusedIndex_0], currentIndex_2 = elementsRef.current.indexOf(el_2);
2536
- setActiveIndex(currentIndex_2);
2537
- return;
2538
- }
2539
- onKeyDown && onKeyDown(event);
2540
- }, [onKeyDown, originElement, setActiveIndex]), handleItemMouseEnter = react.useCallback((event_0) => {
2541
- const element_0 = event_0.currentTarget, currentIndex_3 = elementsRef.current.indexOf(element_0);
2542
- setActiveIndex(currentIndex_3);
2543
- }, [setActiveIndex]), handleItemMouseLeave = react.useCallback(() => {
2544
- setActiveIndex(-2), rootElementRef.current?.focus();
2545
- }, [rootElementRef, setActiveIndex]);
2546
- return react.useEffect(() => {
2547
- if (!mounted) return;
2548
- const rafId = requestAnimationFrame(() => {
2549
- if (activeIndex === -1) {
2550
- if (shouldFocus === "first") {
2551
- const el_3 = _getFocusableElements(elementsRef.current)[0];
2552
- if (el_3) {
2553
- const currentIndex_4 = elementsRef.current.indexOf(el_3);
2554
- setActiveIndex(currentIndex_4);
2555
- }
2556
- }
2557
- if (shouldFocus === "last") {
2558
- const focusableElements_4 = _getFocusableElements(elementsRef.current), el_4 = focusableElements_4[focusableElements_4.length - 1];
2559
- if (el_4) {
2560
- const currentIndex_5 = elementsRef.current.indexOf(el_4);
2561
- setActiveIndex(currentIndex_5);
2562
- }
2563
- }
2564
- return;
2565
- }
2566
- (elementsRef.current[activeIndex] || null)?.focus();
2567
- });
2568
- return () => cancelAnimationFrame(rafId);
2569
- }, [activeIndex, mounted, setActiveIndex, shouldFocus]), {
2570
- activeElement,
2571
- activeIndex,
2572
- handleItemMouseEnter,
2573
- handleItemMouseLeave,
2574
- handleKeyDown,
2575
- mount
2576
- };
2577
- }
2578
- const Menu = react.forwardRef(function(props, forwardedRef) {
2579
- const $ = reactCompilerRuntime.c(55);
2580
- let _shouldFocus, children, className, gap, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, restProps, t0, t1;
2581
- if ($[0] !== props) {
2582
- const {
2583
- children: t22,
2584
- className: t32,
2585
- focusFirst,
2586
- focusLast,
2587
- gap: t42,
2588
- onClickOutside: t52,
2589
- onEscape: t62,
2590
- onItemClick: t72,
2591
- onItemSelect: t82,
2592
- onKeyDown: t92,
2593
- originElement: t102,
2594
- padding: t112,
2595
- registerElement: t122,
2596
- shouldFocus: t132,
2597
- space: t142,
2598
- ...t152
2599
- } = props;
2600
- children = t22, className = t32, gap = t42, onClickOutside = t52, onEscape = t62, onItemClick = t72, onItemSelect = t82, onKeyDown = t92, originElement = t102, t0 = t112, registerElement = t122, _shouldFocus = t132, t1 = t142, restProps = t152, $[0] = props, $[1] = _shouldFocus, $[2] = children, $[3] = className, $[4] = gap, $[5] = onClickOutside, $[6] = onEscape, $[7] = onItemClick, $[8] = onItemSelect, $[9] = onKeyDown, $[10] = originElement, $[11] = registerElement, $[12] = restProps, $[13] = t0, $[14] = t1;
2601
- } else
2602
- _shouldFocus = $[1], children = $[2], className = $[3], gap = $[4], onClickOutside = $[5], onEscape = $[6], onItemClick = $[7], onItemSelect = $[8], onKeyDown = $[9], originElement = $[10], registerElement = $[11], restProps = $[12], t0 = $[13], t1 = $[14];
2603
- const padding = t0 === void 0 ? 1 : t0, space = t1 === void 0 ? 1 : t1, shouldFocus = _shouldFocus ?? (props.focusFirst && "first" || props.focusLast && "last" || null), ref = react.useRef(null);
2604
- let t2;
2605
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[15] = t2) : t2 = $[15], react.useImperativeHandle(forwardedRef, t2);
2606
- const {
2607
- isTopLayer
2608
- } = useLayer();
2609
- let t3;
2610
- $[16] !== onKeyDown || $[17] !== originElement || $[18] !== shouldFocus ? (t3 = {
2611
- onKeyDown,
2612
- originElement,
2613
- shouldFocus,
2614
- rootElementRef: ref
2615
- }, $[16] = onKeyDown, $[17] = originElement, $[18] = shouldFocus, $[19] = t3) : t3 = $[19];
2616
- const {
2617
- activeElement,
2618
- activeIndex,
2619
- handleItemMouseEnter,
2620
- handleItemMouseLeave,
2621
- handleKeyDown,
2622
- mount
2623
- } = useMenuController(t3), unregisterElementRef = react.useRef(null);
2624
- let t4;
2625
- $[20] !== registerElement ? (t4 = (el) => {
2626
- unregisterElementRef.current && (unregisterElementRef.current(), unregisterElementRef.current = null), ref.current = el, ref.current && registerElement && (unregisterElementRef.current = registerElement(ref.current));
2627
- }, $[20] = registerElement, $[21] = t4) : t4 = $[21];
2628
- const handleRefChange = t4;
2629
- let t5, t6;
2630
- $[22] !== activeIndex || $[23] !== onItemSelect ? (t5 = () => {
2631
- onItemSelect && onItemSelect(activeIndex);
2632
- }, t6 = [activeIndex, onItemSelect], $[22] = activeIndex, $[23] = onItemSelect, $[24] = t5, $[25] = t6) : (t5 = $[24], t6 = $[25]), react.useEffect(t5, t6);
2633
- let t7;
2634
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[26] = t7) : t7 = $[26], useClickOutsideEvent(isTopLayer && onClickOutside, t7);
2635
- let t8;
2636
- $[27] !== isTopLayer || $[28] !== onEscape ? (t8 = (event) => {
2637
- isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
2638
- }, $[27] = isTopLayer, $[28] = onEscape, $[29] = t8) : t8 = $[29], useGlobalKeyDown(t8);
2639
- let t9, t10;
2640
- $[30] !== activeElement || $[31] !== activeIndex || $[32] !== handleItemMouseEnter || $[33] !== handleItemMouseLeave || $[34] !== mount || $[35] !== onClickOutside || $[36] !== onEscape || $[37] !== onItemClick || $[38] !== registerElement ? (t10 = {
2641
- version: 0,
2642
- activeElement,
2643
- activeIndex,
2644
- mount,
2645
- onClickOutside,
2646
- onEscape,
2647
- onItemClick,
2648
- onItemMouseEnter: handleItemMouseEnter,
2649
- onItemMouseLeave: handleItemMouseLeave,
2650
- registerElement,
2651
- onMouseEnter: handleItemMouseEnter,
2652
- onMouseLeave: handleItemMouseLeave
2653
- }, $[30] = activeElement, $[31] = activeIndex, $[32] = handleItemMouseEnter, $[33] = handleItemMouseLeave, $[34] = mount, $[35] = onClickOutside, $[36] = onEscape, $[37] = onItemClick, $[38] = registerElement, $[39] = t10) : t10 = $[39], t9 = t10;
2654
- const value = t9;
2655
- let t11;
2656
- $[40] !== className ? (t11 = css.composeClassNames(className, css.menu()), $[40] = className, $[41] = t11) : t11 = $[41];
2657
- const t12 = gap ?? space;
2658
- let t13;
2659
- $[42] !== children || $[43] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: t12, children }), $[42] = children, $[43] = t12, $[44] = t13) : t13 = $[44];
2660
- let t14;
2661
- $[45] !== handleKeyDown || $[46] !== handleRefChange || $[47] !== padding || $[48] !== restProps || $[49] !== t11 || $[50] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Menu", ...restProps, className: t11, onKeyDown: handleKeyDown, overflow: "auto", outline: "none", padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t13 }), $[45] = handleKeyDown, $[46] = handleRefChange, $[47] = padding, $[48] = restProps, $[49] = t11, $[50] = t13, $[51] = t14) : t14 = $[51];
2662
- let t15;
2663
- return $[52] !== t14 || $[53] !== value ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children: t14 }), $[52] = t14, $[53] = value, $[54] = t15) : t15 = $[54], t15;
2664
- });
2665
- Menu.displayName = "ForwardRef(Menu)";
2666
- const MenuDivider = react.forwardRef(function(props, ref) {
2667
- const $ = reactCompilerRuntime.c(9);
2668
- let className, restProps;
2669
- $[0] !== props ? ({
2670
- className,
2671
- ...restProps
2672
- } = props, $[0] = props, $[1] = className, $[2] = restProps) : (className = $[1], restProps = $[2]);
2673
- let t0;
2674
- $[3] !== className ? (t0 = css.composeClassNames(className, css.menuDivider()), $[3] = className, $[4] = t0) : t0 = $[4];
2675
- let t1;
2676
- return $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */ jsxRuntime.jsx("hr", { ...restProps, className: t0, ref }), $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1) : t1 = $[8], t1;
2677
- });
2678
- MenuDivider.displayName = "MenuDivider";
2679
- const Selectable = react.forwardRef(function(props, ref) {
2680
- const $ = reactCompilerRuntime.c(13);
2681
- let className, radius, restProps, tone;
2682
- $[0] !== props ? ({
2683
- className,
2684
- radius,
2685
- tone,
2686
- ...restProps
2687
- } = props, $[0] = props, $[1] = className, $[2] = radius, $[3] = restProps, $[4] = tone) : (className = $[1], radius = $[2], restProps = $[3], tone = $[4]);
2688
- let t0;
2689
- $[5] !== className || $[6] !== radius || $[7] !== tone ? (t0 = css.composeClassNames(className, css._selectable({
2690
- radius,
2691
- tone
2692
- })), $[5] = className, $[6] = radius, $[7] = tone, $[8] = t0) : t0 = $[8];
2693
- let t1;
2694
- return $[9] !== ref || $[10] !== restProps || $[11] !== t0 ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(Box, { ...restProps, className: t0, ref }), $[9] = ref, $[10] = restProps, $[11] = t0, $[12] = t1) : t1 = $[12], t1;
2695
- });
2696
- Selectable.displayName = "ForwardRef(Selectable)";
2697
- function useMenu() {
2698
- const value = react.useContext(MenuContext);
2699
- if (!value)
2700
- throw new Error("useMenu(): missing context value");
2701
- if (!isRecord(value) || value.version !== 0)
2702
- throw new Error("useMenu(): the context value is not compatible");
2703
- return value;
2704
- }
2705
- function MenuGroup(props) {
2706
- const $ = reactCompilerRuntime.c(83);
2707
- let IconComponent, children, gap, gapX, gapY, menuProps, onClick, popover, restProps, t0, t1, t2, t3, t4, t5, text;
2708
- $[0] !== props ? ({
2709
- as: t0,
2710
- children,
2711
- fontSize: t1,
2712
- gap,
2713
- gapX,
2714
- gapY,
2715
- icon: IconComponent,
2716
- menu: menuProps,
2717
- onClick,
2718
- padding: t2,
2719
- popover,
2720
- radius: t3,
2721
- space: t4,
2722
- text,
2723
- tone: t5,
2724
- ...restProps
2725
- } = props, $[0] = props, $[1] = IconComponent, $[2] = children, $[3] = gap, $[4] = gapX, $[5] = gapY, $[6] = menuProps, $[7] = onClick, $[8] = popover, $[9] = restProps, $[10] = t0, $[11] = t1, $[12] = t2, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = text) : (IconComponent = $[1], children = $[2], gap = $[3], gapX = $[4], gapY = $[5], menuProps = $[6], onClick = $[7], popover = $[8], restProps = $[9], t0 = $[10], t1 = $[11], t2 = $[12], t3 = $[13], t4 = $[14], t5 = $[15], text = $[16]);
2726
- const as = t0 === void 0 ? "button" : t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, menu = useMenu(), {
2727
- activeElement,
2728
- mount,
2729
- onClickOutside,
2730
- onEscape,
2731
- onItemClick,
2732
- onItemMouseEnter: _onItemMouseEnter,
2733
- registerElement
2734
- } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onMouseEnter, [rootElement, setRootElement] = react.useState(null), [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = react.useState(!1);
2735
- let t6;
2736
- $[17] !== onItemMouseEnter ? (t6 = (event) => {
2737
- setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
2738
- }, $[17] = onItemMouseEnter, $[18] = t6) : t6 = $[18];
2739
- const handleMouseEnter = t6;
2740
- let t7;
2741
- $[19] !== rootElement ? (t7 = (event_0) => {
2742
- event_0.key === "ArrowLeft" && (event_0.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
2743
- rootElement?.focus();
2744
- }));
2745
- }, $[19] = rootElement, $[20] = t7) : t7 = $[20];
2746
- const handleMenuKeyDown = t7;
2747
- let t8;
2748
- $[21] !== onClick ? (t8 = (event_1) => {
2749
- onClick?.(event_1), setShouldFocus("first"), setOpen(!0);
2750
- }, $[21] = onClick, $[22] = t8) : t8 = $[22];
2751
- const handleClick = t8;
2752
- let t9;
2753
- $[23] !== onItemClick ? (t9 = () => {
2754
- setOpen(!1), onItemClick?.();
2755
- }, $[23] = onItemClick, $[24] = t9) : t9 = $[24];
2756
- const handleChildItemClick = t9;
2757
- let t10;
2758
- $[25] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => setWithinMenu(!0), $[25] = t10) : t10 = $[25];
2759
- const handleMenuMouseEnter = t10;
2760
- let t11, t12;
2761
- $[26] !== mount || $[27] !== rootElement ? (t11 = () => mount(rootElement), t12 = [mount, rootElement], $[26] = mount, $[27] = rootElement, $[28] = t11, $[29] = t12) : (t11 = $[28], t12 = $[29]), react.useEffect(t11, t12);
2762
- let t13, t14;
2763
- $[30] !== active ? (t13 = () => {
2764
- active || setOpen(!1);
2765
- }, t14 = [active], $[30] = active, $[31] = t13, $[32] = t14) : (t13 = $[31], t14 = $[32]), react.useEffect(t13, t14);
2766
- let t15, t16;
2767
- $[33] !== open ? (t15 = () => {
2768
- open || setWithinMenu(!1);
2769
- }, t16 = [open], $[33] = open, $[34] = t15, $[35] = t16) : (t15 = $[34], t16 = $[35]), react.useEffect(t15, t16);
2770
- let t17, t18;
2771
- $[36] !== shouldFocus ? (t17 = () => {
2772
- if (!shouldFocus)
2773
- return;
2774
- const rafId = requestAnimationFrame(() => setShouldFocus(null));
2775
- return () => cancelAnimationFrame(rafId);
2776
- }, t18 = [shouldFocus], $[36] = shouldFocus, $[37] = t17, $[38] = t18) : (t17 = $[37], t18 = $[38]), react.useEffect(t17, t18);
2777
- let t19;
2778
- $[39] !== children || $[40] !== handleChildItemClick || $[41] !== handleMenuKeyDown || $[42] !== menuProps || $[43] !== onClickOutside || $[44] !== onEscape || $[45] !== registerElement || $[46] !== shouldFocus ? (t19 = /* @__PURE__ */ jsxRuntime.jsx(Menu, { ...menuProps, onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus, children }), $[39] = children, $[40] = handleChildItemClick, $[41] = handleMenuKeyDown, $[42] = menuProps, $[43] = onClickOutside, $[44] = onEscape, $[45] = registerElement, $[46] = shouldFocus, $[47] = t19) : t19 = $[47];
2779
- const childMenu = t19;
2780
- let t20;
2781
- $[48] === Symbol.for("react.memo_cache_sentinel") ? (t20 = (event_2) => {
2782
- const target = event_2.currentTarget;
2783
- if (document.activeElement === target && event_2.key === "ArrowRight") {
2784
- setShouldFocus("first"), setOpen(!0), setWithinMenu(!0);
2785
- return;
2786
- }
2787
- }, $[48] = t20) : t20 = $[48];
2788
- const handleKeyDown = t20, t21 = as === "button" ? withinMenu : void 0, t22 = as !== "button" ? withinMenu : void 0, t23 = !withinMenu && active ? "" : void 0, t24 = as === "button" ? "button" : void 0, t25 = gap ?? space;
2789
- let t26;
2790
- $[49] !== IconComponent || $[50] !== fontSize ? (t26 = IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize, children: [
2791
- react.isValidElement(IconComponent) && IconComponent,
2792
- ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
2793
- ] }), $[49] = IconComponent, $[50] = fontSize, $[51] = t26) : t26 = $[51];
2794
- let t27;
2795
- $[52] !== fontSize || $[53] !== text ? (t27 = /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize, textOverflow: "ellipsis", weight: "medium", children: text }) }), $[52] = fontSize, $[53] = text, $[54] = t27) : t27 = $[54];
2796
- let t28;
2797
- $[55] === Symbol.for("react.memo_cache_sentinel") ? (t28 = /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRightIcon, {}), $[55] = t28) : t28 = $[55];
2798
- let t29;
2799
- $[56] !== fontSize ? (t29 = /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize, children: t28 }), $[56] = fontSize, $[57] = t29) : t29 = $[57];
2800
- let t30;
2801
- $[58] !== gapX || $[59] !== gapY || $[60] !== padding || $[61] !== t25 || $[62] !== t26 || $[63] !== t27 || $[64] !== t29 ? (t30 = /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: t25, gapX, gapY, padding, children: [
2802
- t26,
2803
- t27,
2804
- t29
2805
- ] }), $[58] = gapX, $[59] = gapY, $[60] = padding, $[61] = t25, $[62] = t26, $[63] = t27, $[64] = t29, $[65] = t30) : t30 = $[65];
2806
- let t31;
2807
- $[66] !== as || $[67] !== handleClick || $[68] !== handleMouseEnter || $[69] !== radius || $[70] !== restProps || $[71] !== t21 || $[72] !== t22 || $[73] !== t23 || $[74] !== t24 || $[75] !== t30 || $[76] !== tone ? (t31 = /* @__PURE__ */ jsxRuntime.jsx(Selectable, { "data-ui": "MenuGroup", ...restProps, "aria-pressed": t21, as, "data-pressed": t22, "data-selected": t23, onClick: handleClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, radius, ref: setRootElement, tabIndex: -1, tone, type: t24, children: t30 }), $[66] = as, $[67] = handleClick, $[68] = handleMouseEnter, $[69] = radius, $[70] = restProps, $[71] = t21, $[72] = t22, $[73] = t23, $[74] = t24, $[75] = t30, $[76] = tone, $[77] = t31) : t31 = $[77];
2808
- let t32;
2809
- return $[78] !== childMenu || $[79] !== open || $[80] !== popover || $[81] !== t31 ? (t32 = /* @__PURE__ */ jsxRuntime.jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t31 }), $[78] = childMenu, $[79] = open, $[80] = popover, $[81] = t31, $[82] = t32) : t32 = $[82], t32;
2810
- }
2811
- MenuGroup.displayName = "MenuGroup";
2812
- const MenuItem = react.forwardRef(function(props, forwardedRef) {
2813
- const $ = reactCompilerRuntime.c(74);
2814
- let IconComponent, IconRightComponent, children, disabled, gap, gapX, gapY, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, restProps, selectedProp, t0, t1, t2, t3, t4, t5, text;
2815
- $[0] !== props ? ({
2816
- as: t0,
2817
- children,
2818
- disabled,
2819
- fontSize: t1,
2820
- gap,
2821
- gapX,
2822
- gapY,
2823
- hotkeys,
2824
- icon: IconComponent,
2825
- iconRight: IconRightComponent,
2826
- onClick,
2827
- padding: t2,
2828
- paddingX,
2829
- paddingY,
2830
- paddingTop,
2831
- paddingRight,
2832
- paddingBottom,
2833
- paddingLeft,
2834
- pressed,
2835
- radius: t3,
2836
- selected: selectedProp,
2837
- space: t4,
2838
- text,
2839
- tone: t5,
2840
- ...restProps
2841
- } = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = gap, $[6] = gapX, $[7] = gapY, $[8] = hotkeys, $[9] = onClick, $[10] = paddingBottom, $[11] = paddingLeft, $[12] = paddingRight, $[13] = paddingTop, $[14] = paddingX, $[15] = paddingY, $[16] = pressed, $[17] = restProps, $[18] = selectedProp, $[19] = t0, $[20] = t1, $[21] = t2, $[22] = t3, $[23] = t4, $[24] = t5, $[25] = text) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], gap = $[5], gapX = $[6], gapY = $[7], hotkeys = $[8], onClick = $[9], paddingBottom = $[10], paddingLeft = $[11], paddingRight = $[12], paddingTop = $[13], paddingX = $[14], paddingY = $[15], pressed = $[16], restProps = $[17], selectedProp = $[18], t0 = $[19], t1 = $[20], t2 = $[21], t3 = $[22], t4 = $[23], t5 = $[24], text = $[25]);
2842
- const as = t0 === void 0 ? "button" : t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, menu = useMenu(), {
2843
- activeElement,
2844
- mount,
2845
- onItemClick,
2846
- onItemMouseEnter: _onItemMouseEnter,
2847
- onItemMouseLeave: _onItemMouseLeave
2848
- } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onMouseEnter, onItemMouseLeave = _onItemMouseLeave ?? menu.onMouseLeave, [rootElement, setRootElement] = react.useState(null), active = !!activeElement && activeElement === rootElement, ref = react.useRef(null);
2849
- let t6;
2850
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[26] = t6) : t6 = $[26], react.useImperativeHandle(forwardedRef, t6);
2851
- let t7, t8;
2852
- $[27] !== mount || $[28] !== rootElement || $[29] !== selectedProp ? (t7 = () => mount(rootElement, selectedProp), t8 = [mount, rootElement, selectedProp], $[27] = mount, $[28] = rootElement, $[29] = selectedProp, $[30] = t7, $[31] = t8) : (t7 = $[30], t8 = $[31]), react.useEffect(t7, t8);
2853
- let t9;
2854
- $[32] !== disabled || $[33] !== onClick || $[34] !== onItemClick ? (t9 = (event) => {
2855
- disabled || (onClick && onClick(event), onItemClick && onItemClick());
2856
- }, $[32] = disabled, $[33] = onClick, $[34] = onItemClick, $[35] = t9) : t9 = $[35];
2857
- const handleClick = t9;
2858
- let t10, t11;
2859
- $[36] !== padding || $[37] !== paddingBottom || $[38] !== paddingLeft || $[39] !== paddingRight || $[40] !== paddingTop || $[41] !== paddingX || $[42] !== paddingY ? (t11 = {
2860
- padding,
2861
- paddingX,
2862
- paddingY,
2863
- paddingTop,
2864
- paddingRight,
2865
- paddingBottom,
2866
- paddingLeft
2867
- }, $[36] = padding, $[37] = paddingBottom, $[38] = paddingLeft, $[39] = paddingRight, $[40] = paddingTop, $[41] = paddingX, $[42] = paddingY, $[43] = t11) : t11 = $[43], t10 = t11;
2868
- const paddingProps = t10;
2869
- let t12;
2870
- $[44] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (el) => {
2871
- ref.current = el, setRootElement(el);
2872
- }, $[44] = t12) : t12 = $[44];
2873
- const setRef = t12, t13 = pressed ? "" : void 0, t14 = active ? "" : void 0, t15 = disabled ? "" : void 0, t16 = as === "button" ? "button" : void 0;
2874
- let t17;
2875
- $[45] !== IconComponent || $[46] !== IconRightComponent || $[47] !== fontSize || $[48] !== gap || $[49] !== gapX || $[50] !== gapY || $[51] !== hotkeys || $[52] !== paddingProps || $[53] !== space || $[54] !== text ? (t17 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", gap: gap ?? space, gapX, gapY, align: "center", ...paddingProps, children: [
2876
- IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { muted: !0, size: fontSize, children: [
2877
- react.isValidElement(IconComponent) && IconComponent,
2878
- ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
2879
- ] }),
2880
- text && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize, textOverflow: "ellipsis", weight: "medium", children: text }) }),
2881
- hotkeys && /* @__PURE__ */ jsxRuntime.jsx(Hotkeys, { gap: 0.5, keys: hotkeys, style: {
2882
- marginTop: -4,
2883
- marginBottom: -4
2884
- } }),
2885
- IconRightComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { muted: !0, size: fontSize, children: [
2886
- react.isValidElement(IconRightComponent) && IconRightComponent,
2887
- ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
2888
- ] })
2889
- ] }), $[45] = IconComponent, $[46] = IconRightComponent, $[47] = fontSize, $[48] = gap, $[49] = gapX, $[50] = gapY, $[51] = hotkeys, $[52] = paddingProps, $[53] = space, $[54] = text, $[55] = t17) : t17 = $[55];
2890
- let t18;
2891
- $[56] !== children || $[57] !== paddingProps ? (t18 = children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...paddingProps, children }), $[56] = children, $[57] = paddingProps, $[58] = t18) : t18 = $[58];
2892
- let t19;
2893
- return $[59] !== as || $[60] !== disabled || $[61] !== handleClick || $[62] !== onItemMouseEnter || $[63] !== onItemMouseLeave || $[64] !== radius || $[65] !== restProps || $[66] !== t13 || $[67] !== t14 || $[68] !== t15 || $[69] !== t16 || $[70] !== t17 || $[71] !== t18 || $[72] !== tone ? (t19 = /* @__PURE__ */ jsxRuntime.jsxs(Selectable, { "data-ui": "MenuItem", role: "menuitem", ...restProps, as, "data-pressed": t13, "data-selected": t14, "data-disabled": t15, radius, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, tabIndex: -1, tone, type: t16, children: [
2894
- t17,
2895
- t18
2896
- ] }), $[59] = as, $[60] = disabled, $[61] = handleClick, $[62] = onItemMouseEnter, $[63] = onItemMouseLeave, $[64] = radius, $[65] = restProps, $[66] = t13, $[67] = t14, $[68] = t15, $[69] = t16, $[70] = t17, $[71] = t18, $[72] = tone, $[73] = t19) : t19 = $[73], t19;
2897
- });
2898
- MenuItem.displayName = "ForwardRef(MenuItem)";
2899
- const Tab = react.forwardRef(function(props, forwardedRef) {
2900
- const $ = reactCompilerRuntime.c(30);
2901
- let focused, icon, id, label, onClick, onFocus, restProps, selected, t0, t1;
2902
- $[0] !== props ? ({
2903
- icon,
2904
- id,
2905
- focused,
2906
- fontSize: t0,
2907
- label,
2908
- onClick,
2909
- onFocus,
2910
- padding: t1,
2911
- selected,
2912
- ...restProps
2913
- } = props, $[0] = props, $[1] = focused, $[2] = icon, $[3] = id, $[4] = label, $[5] = onClick, $[6] = onFocus, $[7] = restProps, $[8] = selected, $[9] = t0, $[10] = t1) : (focused = $[1], icon = $[2], id = $[3], label = $[4], onClick = $[5], onFocus = $[6], restProps = $[7], selected = $[8], t0 = $[9], t1 = $[10]);
2914
- const fontSize = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 2 : t1, ref = react.useRef(null), focusedRef = react.useRef(!1);
2915
- let t2;
2916
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[11] = t2) : t2 = $[11], react.useImperativeHandle(forwardedRef, t2);
2917
- let t3;
2918
- $[12] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => {
2919
- focusedRef.current = !1;
2920
- }, $[12] = t3) : t3 = $[12];
2921
- const handleBlur = t3;
2922
- let t4;
2923
- $[13] !== onFocus ? (t4 = (event) => {
2924
- focusedRef.current = !0, onFocus && onFocus(event);
2925
- }, $[13] = onFocus, $[14] = t4) : t4 = $[14];
2926
- const handleFocus = t4;
2927
- let t5, t6;
2928
- $[15] !== focused ? (t5 = () => {
2929
- focused && !focusedRef.current && (ref.current && ref.current.focus(), focusedRef.current = !0);
2930
- }, t6 = [focused], $[15] = focused, $[16] = t5, $[17] = t6) : (t5 = $[16], t6 = $[17]), react.useEffect(t5, t6);
2931
- const t7 = selected ? "true" : "false", t8 = selected ? 0 : -1;
2932
- let t9;
2933
- return $[18] !== fontSize || $[19] !== handleFocus || $[20] !== icon || $[21] !== id || $[22] !== label || $[23] !== onClick || $[24] !== padding || $[25] !== restProps || $[26] !== selected || $[27] !== t7 || $[28] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Button, { "data-ui": "Tab", ...restProps, "aria-selected": t7, fontSize, icon, id, mode: "bleed", onClick, onBlur: handleBlur, onFocus: handleFocus, padding, ref, role: "tab", selected, tabIndex: t8, text: label, type: "button" }), $[18] = fontSize, $[19] = handleFocus, $[20] = icon, $[21] = id, $[22] = label, $[23] = onClick, $[24] = padding, $[25] = restProps, $[26] = selected, $[27] = t7, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
2934
- });
2935
- Tab.displayName = "ForwardRef(Tab)";
2936
- function _isReactElement(node) {
2937
- return !!node;
2938
- }
2939
- const TabList = react.forwardRef(function(props, ref) {
2940
- const $ = reactCompilerRuntime.c(15);
2941
- let childrenProp, restProps;
2942
- $[0] !== props ? ({
2943
- children: childrenProp,
2944
- ...restProps
2945
- } = props, $[0] = props, $[1] = childrenProp, $[2] = restProps) : (childrenProp = $[1], restProps = $[2]);
2946
- const [focusedIndex, setFocusedIndex] = react.useState(-1);
2947
- let t0;
2948
- if ($[3] !== childrenProp || $[4] !== focusedIndex) {
2949
- const children = react.Children.toArray(childrenProp).filter(_isReactElement);
2950
- let t12;
2951
- $[6] !== focusedIndex ? (t12 = (child, childIndex) => react.cloneElement(child, {
2952
- focused: focusedIndex === childIndex,
2953
- key: childIndex,
2954
- onFocus: () => setFocusedIndex(childIndex)
2955
- }), $[6] = focusedIndex, $[7] = t12) : t12 = $[7], t0 = children.map(t12), $[3] = childrenProp, $[4] = focusedIndex, $[5] = t0;
2956
- } else
2957
- t0 = $[5];
2958
- const tabs = t0, numTabs = tabs.length;
2959
- let t1;
2960
- $[8] !== numTabs ? (t1 = (event) => {
2961
- event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
2962
- }, $[8] = numTabs, $[9] = t1) : t1 = $[9];
2963
- const handleKeyDown = t1;
2964
- let t2;
2965
- return $[10] !== handleKeyDown || $[11] !== ref || $[12] !== restProps || $[13] !== tabs ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Inline, { "data-ui": "TabList", ...restProps, onKeyDown: handleKeyDown, ref, role: "tablist", children: tabs }), $[10] = handleKeyDown, $[11] = ref, $[12] = restProps, $[13] = tabs, $[14] = t2) : t2 = $[14], t2;
2966
- });
2967
- TabList.displayName = "ForwardRef(TabList)";
2968
- exports.AnimatedSpinnerIcon = AnimatedSpinnerIcon;
2969
- exports.Arrow = Arrow;
2970
- exports.Avatar = Avatar;
2971
- exports.AvatarCounter = AvatarCounter;
2972
- exports.AvatarStack = AvatarStack;
2973
- exports.Badge = Badge;
2974
- exports.BoundaryElementProvider = BoundaryElementProvider;
2975
- exports.Box = Box;
2976
- exports.Button = Button;
2977
- exports.Card = Card;
2978
- exports.Checkbox = Checkbox;
2979
- exports.Code = Code;
2980
- exports.ConditionalWrapper = ConditionalWrapper;
2981
- exports.Container = Container;
2982
- exports.EMPTY_ARRAY = EMPTY_ARRAY;
2983
- exports.EMPTY_RECORD = EMPTY_RECORD;
2984
- exports.ElementQuery = ElementQuery;
2985
- exports.Flex = Flex;
2986
- exports.Grid = Grid;
2987
- exports.Heading = Heading;
2988
- exports.Hotkeys = Hotkeys;
2989
- exports.Inline = Inline;
2990
- exports.KBD = KBD;
2991
- exports.Label = Label;
2992
- exports.Layer = Layer;
2993
- exports.LayerProvider = LayerProvider;
2994
- exports.Menu = Menu;
2995
- exports.MenuDivider = MenuDivider;
2996
- exports.MenuGroup = MenuGroup;
2997
- exports.MenuItem = MenuItem;
2998
- exports.Popover = Popover;
2999
- exports.Portal = Portal;
3000
- exports.PortalProvider = PortalProvider;
3001
- exports.Radio = Radio;
3002
- exports.Select = Select;
3003
- exports.Selectable = Selectable;
3004
- exports.Spinner = Spinner;
3005
- exports.SrOnly = SrOnly;
3006
- exports.Stack = Stack;
3007
- exports.Switch = Switch;
3008
- exports.Tab = Tab;
3009
- exports.TabList = TabList;
3010
- exports.Text = Text;
3011
- exports.TextArea = TextArea;
3012
- exports.TextInput = TextInput;
3013
- exports.ThemeColorProvider = ThemeColorProvider;
3014
- exports.ThemeProvider = ThemeProvider;
3015
- exports.Tooltip = Tooltip;
3016
- exports.TooltipDelayGroupContext = TooltipDelayGroupContext;
3017
- exports.TooltipDelayGroupProvider = TooltipDelayGroupProvider;
3018
- exports.VirtualList = VirtualList;
3019
- exports._ResizeObserver = _ResizeObserver;
3020
- exports._elementSizeObserver = _elementSizeObserver;
3021
- exports._getArrayProp = _getArrayProp;
3022
- exports._isEnterToClickElement = _isEnterToClickElement;
3023
- exports._isScrollable = _isScrollable;
3024
- exports.containsOrEqualsElement = containsOrEqualsElement;
3025
- exports.createColorTheme = createColorTheme;
3026
- exports.createGlobalScopedContext = createGlobalScopedContext;
3027
- exports.hexToRgb = hexToRgb;
3028
- exports.hslToRgb = hslToRgb;
3029
- exports.isHTMLAnchorElement = isHTMLAnchorElement;
3030
- exports.isHTMLButtonElement = isHTMLButtonElement;
3031
- exports.isHTMLElement = isHTMLElement;
3032
- exports.isHTMLInputElement = isHTMLInputElement;
3033
- exports.isHTMLSelectElement = isHTMLSelectElement;
3034
- exports.isHTMLTextAreaElement = isHTMLTextAreaElement;
3035
- exports.isRecord = isRecord;
3036
- exports.multiply = multiply;
3037
- exports.parseColor = parseColor;
3038
- exports.rgbToHex = rgbToHex;
3039
- exports.rgbToHsl = rgbToHsl;
3040
- exports.rgba = rgba;
3041
- exports.screen = screen;
3042
- exports.studioTheme = studioTheme;
3043
- exports.useArrayProp = useArrayProp;
3044
- exports.useBoundaryElement = useBoundaryElement;
3045
- exports.useClickOutsideEvent = useClickOutsideEvent;
3046
- exports.useCustomValidity = useCustomValidity;
3047
- exports.useElementSize = useElementSize;
3048
- exports.useGlobalKeyDown = useGlobalKeyDown;
3049
- exports.useLayer = useLayer;
3050
- exports.useMatchMedia = useMatchMedia;
3051
- exports.useMediaIndex = useMediaIndex;
3052
- exports.usePortal = usePortal;
3053
- exports.usePrefersDark = usePrefersDark;
3054
- exports.usePrefersReducedMotion = usePrefersReducedMotion;
3055
- exports.useRootTheme = useRootTheme;
3056
- exports.useTheme = useTheme;
3057
- exports.useTheme_v2 = useTheme_v2;
3058
- exports.useTooltipDelayGroup = useTooltipDelayGroup;
3059
- //# sourceMappingURL=_visual-editing.js.map