@sanity/ui 4.0.0-static.4 → 4.0.0-static.40

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 (341) hide show
  1. package/dist/_chunks-es/{refractor.js → Refractor.js} +1 -1
  2. package/dist/_chunks-es/{refractor.js.map → Refractor.js.map} +1 -1
  3. package/dist/css/index.css +2 -1
  4. package/dist/css/index.css.map +1 -0
  5. package/dist/css/index.d.ts +51 -7
  6. package/dist/css/index.js +17979 -55
  7. package/dist/css/index.js.map +1 -1
  8. package/dist/index.d.ts +26 -38
  9. package/dist/index.js +1744 -1127
  10. package/dist/index.js.map +1 -1
  11. package/exports/css/index.css +1 -0
  12. package/package.json +39 -51
  13. package/src/core/Root.tsx +1 -1
  14. package/src/core/RootProvider.tsx +5 -5
  15. package/src/core/__workshop__/index.ts +1 -1
  16. package/src/core/components/autocomplete/{autocomplete.tsx → Autocomplete.tsx} +90 -58
  17. package/src/core/components/autocomplete/__workshop__/{custom.tsx → Custom.tsx} +14 -1
  18. package/src/core/components/autocomplete/__workshop__/{example.tsx → Example.tsx} +12 -1
  19. package/src/core/components/autocomplete/__workshop__/index.ts +6 -6
  20. package/src/core/components/autocomplete/types.ts +1 -1
  21. package/src/core/components/breadcrumbs/{breadcrumbs.tsx → Breadcrumbs.tsx} +80 -47
  22. package/src/core/components/breadcrumbs/__workshop__/index.ts +1 -1
  23. package/src/core/components/dialog/{dialog.tsx → Dialog.tsx} +20 -11
  24. package/src/core/components/dialog/{dialogCard.tsx → DialogCard.tsx} +9 -9
  25. package/src/core/components/dialog/{dialogContext.ts → DialogContext.ts} +1 -1
  26. package/src/core/components/dialog/{dialogProvider.tsx → DialogProvider.tsx} +2 -2
  27. package/src/core/components/dialog/__workshop__/{panes.tsx → Panes.tsx} +9 -21
  28. package/src/core/components/dialog/__workshop__/{position.tsx → Position.tsx} +9 -1
  29. package/src/core/components/dialog/__workshop__/{props.tsx → Props.tsx} +2 -0
  30. package/src/core/components/dialog/__workshop__/index.ts +10 -10
  31. package/src/core/components/dialog/__workshop__/styles.css.ts +18 -0
  32. package/src/core/components/dialog/useDialog.ts +3 -3
  33. package/src/core/components/hotkeys/{hotkeys.tsx → Hotkeys.tsx} +2 -2
  34. package/src/core/components/hotkeys/__workshop__/index.ts +1 -1
  35. package/src/core/components/menu/{menu.test.tsx → Menu.test.tsx} +9 -13
  36. package/src/core/components/menu/{menu.tsx → Menu.tsx} +19 -24
  37. package/src/core/components/menu/{menuButton.tsx → MenuButton.tsx} +14 -9
  38. package/src/core/components/menu/{menuContext.ts → MenuContext.ts} +3 -4
  39. package/src/core/components/menu/{menuGroup.tsx → MenuGroup.tsx} +16 -11
  40. package/src/core/components/menu/{menuItem.tsx → MenuItem.tsx} +7 -9
  41. package/src/core/components/menu/__workshop__/DataProps.tsx +27 -0
  42. package/src/core/components/menu/__workshop__/{menuButton.tsx → MenuButton.tsx} +6 -1
  43. package/src/core/components/menu/__workshop__/{tones.tsx → Tones.tsx} +7 -1
  44. package/src/core/components/menu/__workshop__/index.ts +22 -17
  45. package/src/core/components/menu/useMenu.ts +5 -5
  46. package/src/core/components/menu/useMenuController.ts +5 -5
  47. package/src/core/components/tab/{tab.tsx → Tab.tsx} +1 -1
  48. package/src/core/components/tab/{tabList.tsx → TabList.tsx} +2 -2
  49. package/src/core/components/tab/{tabPanel.tsx → TabPanel.tsx} +1 -1
  50. package/src/core/components/tab/__workshop__/index.ts +1 -1
  51. package/src/core/components/toast/{toast.test.tsx → Toast.test.tsx} +7 -7
  52. package/src/core/components/toast/{toast.tsx → Toast.tsx} +6 -6
  53. package/src/core/components/toast/{toastContext.ts → ToastContext.ts} +1 -1
  54. package/src/core/components/toast/{toastLayer.tsx → ToastLayer.tsx} +1 -1
  55. package/src/core/components/toast/{toastProvider.tsx → ToastProvider.tsx} +7 -7
  56. package/src/core/components/toast/__workshop__/{toast.tsx → Toast.tsx} +2 -0
  57. package/src/core/components/toast/__workshop__/index.ts +2 -2
  58. package/src/core/components/toast/useToast.ts +3 -3
  59. package/src/core/components/tree/{tree.tsx → Tree.tsx} +4 -4
  60. package/src/core/components/tree/{treeContext.ts → TreeContext.ts} +1 -1
  61. package/src/core/components/tree/{treeGroup.tsx → TreeGroup.tsx} +1 -1
  62. package/src/core/components/tree/{treeItem.tsx → TreeItem.tsx} +28 -25
  63. package/src/core/components/tree/__workshop__/index.ts +4 -4
  64. package/src/core/components/tree/useTree.ts +3 -3
  65. package/src/core/components/virtualList/{virtualList.tsx → VirtualList.tsx} +87 -45
  66. package/src/core/components/virtualList/__workshop__/index.ts +4 -4
  67. package/src/core/helpers/props.ts +0 -9
  68. package/src/core/hooks/useGlobalKeyDown.ts +11 -4
  69. package/src/core/hooks/useMediaIndex/__workshop__/index.ts +1 -1
  70. package/src/core/hooks/useResponsiveProp.ts +4 -17
  71. package/src/core/index.ts +68 -66
  72. package/src/core/lib/createGlobalScopedContext.ts +5 -3
  73. package/src/core/primitives/avatar/{avatar.tsx → Avatar.tsx} +7 -6
  74. package/src/core/primitives/avatar/{avatarCounter.tsx → AvatarCounter.tsx} +2 -2
  75. package/src/core/primitives/avatar/{avatarStack.tsx → AvatarStack.tsx} +3 -3
  76. package/src/core/primitives/avatar/__workshop__/{asButton.tsx → AsButton.tsx} +8 -1
  77. package/src/core/primitives/avatar/__workshop__/PropsStory.tsx +22 -0
  78. package/src/core/primitives/avatar/__workshop__/{stack.tsx → Stack.tsx} +5 -1
  79. package/src/core/primitives/avatar/__workshop__/index.ts +9 -4
  80. package/src/core/primitives/badge/{badge.test.tsx → Badge.test.tsx} +1 -1
  81. package/src/core/primitives/badge/{badge.tsx → Badge.tsx} +2 -2
  82. package/src/core/primitives/badge/__workshop__/{props.tsx → Props.tsx} +12 -1
  83. package/src/core/primitives/badge/__workshop__/index.ts +2 -2
  84. package/src/core/primitives/box/__workshop__/{props.tsx → Props.tsx} +6 -1
  85. package/src/core/primitives/box/__workshop__/index.ts +2 -2
  86. package/src/core/primitives/button/{button.test.tsx → Button.test.tsx} +1 -1
  87. package/src/core/primitives/button/{button.tsx → Button.tsx} +12 -11
  88. package/src/core/primitives/button/__workshop__/DataProps.tsx +22 -0
  89. package/src/core/primitives/button/__workshop__/{props.tsx → Props.tsx} +22 -0
  90. package/src/core/primitives/button/__workshop__/SanityUploadButton.tsx +21 -0
  91. package/src/core/primitives/button/__workshop__/{stacked.tsx → Stacked.tsx} +16 -0
  92. package/src/core/primitives/button/__workshop__/Styled1.tsx +11 -0
  93. package/src/core/primitives/button/__workshop__/index.ts +15 -15
  94. package/src/core/primitives/button/__workshop__/styles.css.ts +30 -0
  95. package/src/core/primitives/card/{card.tsx → Card.tsx} +10 -10
  96. package/src/core/primitives/card/{cardContext.ts → CardContext.ts} +1 -1
  97. package/src/core/primitives/card/{cardProvider.tsx → CardProvider.tsx} +3 -12
  98. package/src/core/primitives/card/__workshop__/DataProps.tsx +30 -0
  99. package/src/core/primitives/card/__workshop__/{props.tsx → Props.tsx} +10 -0
  100. package/src/core/primitives/card/__workshop__/{selected.tsx → Selected.tsx} +1 -1
  101. package/src/core/primitives/card/__workshop__/{styled.tsx → Styled.tsx} +2 -5
  102. package/src/core/primitives/card/__workshop__/index.ts +10 -9
  103. package/src/core/primitives/card/useCard.ts +11 -6
  104. package/src/core/primitives/checkbox/__workshop__/index.ts +4 -4
  105. package/src/core/primitives/code/{code.tsx → Code.tsx} +26 -2
  106. package/src/core/primitives/code/__workshop__/{props.tsx → Props.tsx} +6 -1
  107. package/src/core/primitives/code/__workshop__/index.ts +2 -2
  108. package/src/core/primitives/container/{container.tsx → Container.tsx} +1 -1
  109. package/src/core/primitives/container/__workshop__/{example.tsx → Example.tsx} +6 -1
  110. package/src/core/primitives/container/__workshop__/index.ts +1 -1
  111. package/src/core/primitives/flex/{flex.tsx → Flex.tsx} +1 -1
  112. package/src/core/primitives/flex/__workshop__/{example.tsx → Example.tsx} +14 -16
  113. package/src/core/primitives/flex/__workshop__/index.ts +2 -2
  114. package/src/core/primitives/flex/__workshop__/styles.css.ts +12 -0
  115. package/src/core/primitives/grid/{grid.tsx → Grid.tsx} +1 -1
  116. package/src/core/primitives/grid/__workshop__/index.ts +1 -1
  117. package/src/core/primitives/heading/{heading.tsx → Heading.tsx} +16 -0
  118. package/src/core/primitives/heading/__workshop__/{plain.tsx → Plain.tsx} +12 -1
  119. package/src/core/primitives/heading/__workshop__/index.ts +2 -2
  120. package/src/core/primitives/inline/{inline.tsx → Inline.tsx} +2 -1
  121. package/src/core/primitives/inline/__workshop__/{plain.tsx → Plain.tsx} +5 -1
  122. package/src/core/primitives/inline/__workshop__/index.ts +1 -1
  123. package/src/core/primitives/kbd/{kbd.tsx → Kbd.tsx} +2 -2
  124. package/src/core/primitives/kbd/__workshop__/index.ts +1 -1
  125. package/src/core/primitives/label/{label.tsx → Label.tsx} +16 -0
  126. package/src/core/primitives/label/__workshop__/{plain.tsx → Plain.tsx} +15 -1
  127. package/src/core/primitives/label/__workshop__/index.ts +2 -2
  128. package/src/core/primitives/layer/{layer.test.tsx → Layer.test.tsx} +7 -7
  129. package/src/core/primitives/layer/{layer.tsx → Layer.tsx} +3 -3
  130. package/src/core/primitives/layer/{layerCard.tsx → LayerCard.tsx} +2 -2
  131. package/src/core/primitives/layer/{layerContext.ts → LayerContext.ts} +1 -1
  132. package/src/core/primitives/layer/{layerProvider.tsx → LayerProvider.tsx} +6 -6
  133. package/src/core/primitives/layer/__workshop__/index.ts +3 -3
  134. package/src/core/primitives/layer/useLayer.ts +3 -3
  135. package/src/core/primitives/popover/{popover.tsx → Popover.tsx} +170 -150
  136. package/src/core/primitives/popover/{popoverLayer.tsx → PopoverLayer.tsx} +3 -3
  137. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +13 -1
  138. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +2 -0
  139. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +8 -0
  140. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +7 -1
  141. package/src/core/primitives/popover/__workshop__/TestStory.tsx +6 -0
  142. package/src/core/primitives/popover/floating-ui/size.ts +17 -16
  143. package/src/core/primitives/radio/{radio.tsx → Radio.tsx} +2 -2
  144. package/src/core/primitives/radio/__workshop__/index.ts +2 -2
  145. package/src/core/primitives/select/{select.tsx → Select.tsx} +7 -5
  146. package/src/core/primitives/select/__workshop__/{plain.tsx → Plain.tsx} +4 -0
  147. package/src/core/primitives/select/__workshop__/index.ts +2 -2
  148. package/src/core/primitives/selectable/{selectable.tsx → Selectable.tsx} +2 -2
  149. package/src/core/primitives/selectable/__workshop__/DataProps.tsx +27 -0
  150. package/src/core/primitives/selectable/__workshop__/index.ts +14 -0
  151. package/src/core/primitives/skeleton/{codeSkeleton.tsx → CodeSkeleton.tsx} +1 -1
  152. package/src/core/primitives/skeleton/{headingSkeleton.tsx → HeadingSkeleton.tsx} +1 -1
  153. package/src/core/primitives/skeleton/{labelSkeleton.tsx → LabelSkeleton.tsx} +1 -1
  154. package/src/core/primitives/skeleton/{skeleton.tsx → Skeleton.tsx} +2 -2
  155. package/src/core/primitives/skeleton/{textSkeleton.tsx → TextSkeleton.tsx} +1 -1
  156. package/src/core/primitives/skeleton/__workshop__/{delay.tsx → Delay.tsx} +9 -1
  157. package/src/core/primitives/skeleton/__workshop__/{skeleton.tsx → Skeleton.tsx} +9 -1
  158. package/src/core/primitives/skeleton/__workshop__/index.ts +2 -2
  159. package/src/core/primitives/spinner/{spinner.tsx → Spinner.tsx} +2 -2
  160. package/src/core/primitives/spinner/__workshop__/Props.tsx +6 -1
  161. package/src/core/primitives/stack/{stack.tsx → Stack.tsx} +1 -1
  162. package/src/core/primitives/stack/__workshop__/{plain.tsx → Plain.tsx} +4 -1
  163. package/src/core/primitives/stack/__workshop__/index.ts +1 -1
  164. package/src/core/primitives/switch/{switch.tsx → Switch.tsx} +2 -10
  165. package/src/core/primitives/switch/__workshop__/index.ts +2 -2
  166. package/src/core/primitives/text/{text.tsx → Text.tsx} +14 -0
  167. package/src/core/primitives/text/__workshop__/{colored.tsx → Colored.tsx} +10 -8
  168. package/src/core/primitives/text/__workshop__/{example.tsx → Example.tsx} +15 -1
  169. package/src/core/primitives/text/__workshop__/index.ts +3 -3
  170. package/src/core/primitives/textArea/{textArea.tsx → TextArea.tsx} +7 -1
  171. package/src/core/primitives/textArea/__workshop__/{plain.tsx → Plain.tsx} +8 -0
  172. package/src/core/primitives/textArea/__workshop__/index.ts +1 -1
  173. package/src/core/primitives/textInput/{textInput.tsx → TextInput.tsx} +93 -72
  174. package/src/core/primitives/textInput/__workshop__/{plain.tsx → Plain.tsx} +34 -4
  175. package/src/core/primitives/textInput/__workshop__/{typed.tsx → Typed.tsx} +7 -1
  176. package/src/core/primitives/textInput/__workshop__/index.ts +7 -7
  177. package/src/core/primitives/tooltip/{tooltip.test.tsx → Tooltip.test.tsx} +4 -4
  178. package/src/core/primitives/tooltip/{tooltip.tsx → Tooltip.tsx} +102 -63
  179. package/src/core/primitives/tooltip/{tooltipLayer.tsx → TooltipLayer.tsx} +2 -2
  180. package/src/core/primitives/tooltip/__workshop__/{customPortal.tsx → CustomPortal.tsx} +2 -0
  181. package/src/core/primitives/tooltip/__workshop__/{overflowingBoundary.tsx → OverflowingBoundary.tsx} +2 -0
  182. package/src/core/primitives/tooltip/__workshop__/{props.tsx → Props.tsx} +12 -0
  183. package/src/core/primitives/tooltip/__workshop__/{resizableBoundary.tsx → ResizableBoundary.tsx} +5 -0
  184. package/src/core/primitives/tooltip/__workshop__/index.ts +4 -4
  185. package/src/core/primitives/tooltip/tooltipDelayGroup/{tooltipDelayGroupContext.tsx → TooltipDelayGroupContext.tsx} +1 -1
  186. package/src/core/primitives/tooltip/tooltipDelayGroup/{tooltipDelayGroupProvider.tsx → TooltipDelayGroupProvider.tsx} +2 -4
  187. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +3 -3
  188. package/src/core/types.ts +6 -5
  189. package/src/core/utils/{errorBoundary.tsx → ErrorBoundary.tsx} +1 -1
  190. package/src/core/utils/boundaryElement/{boundaryElementContext.ts → BoundaryElementContext.ts} +2 -5
  191. package/src/core/utils/boundaryElement/BoundaryElementProvider.tsx +16 -0
  192. package/src/core/utils/boundaryElement/__workshop__/index.ts +1 -1
  193. package/src/core/utils/boundaryElement/types.ts +1 -4
  194. package/src/core/utils/boundaryElement/useBoundaryElement.ts +7 -19
  195. package/src/core/utils/elementQuery/__workshop__/CustomMedia.tsx +19 -0
  196. package/src/core/utils/elementQuery/__workshop__/index.ts +1 -1
  197. package/src/core/utils/elementQuery/__workshop__/styles.css.ts +31 -0
  198. package/src/core/utils/portal/{portal.test.tsx → Portal.test.tsx} +7 -7
  199. package/src/core/utils/portal/{portal.tsx → Portal.tsx} +7 -4
  200. package/src/core/utils/portal/{portalContext.ts → PortalContext.ts} +1 -1
  201. package/src/core/utils/portal/PortalProvider.tsx +38 -0
  202. package/src/core/utils/portal/__workshop__/index.ts +1 -1
  203. package/src/core/utils/portal/usePortal.ts +12 -5
  204. package/src/css/_responsiveStyle.css.ts +2 -2
  205. package/src/css/primitives/_input/_input.css.ts +13 -12
  206. package/src/css/primitives/_input/input.ts +2 -0
  207. package/src/css/primitives/_input/types.ts +2 -1
  208. package/src/css/primitives/avatar/avatar.css.ts +17 -5
  209. package/src/css/primitives/box/box.css.ts +19 -1
  210. package/src/css/primitives/button/button.css.ts +252 -183
  211. package/src/css/primitives/card/__workshop__/{color.tsx → Color.tsx} +9 -1
  212. package/src/css/primitives/card/__workshop__/index.ts +1 -1
  213. package/src/css/primitives/card/card.css.ts +133 -130
  214. package/src/css/primitives/checkbox/checkbox.css.ts +1 -0
  215. package/src/css/primitives/code/code.ts +4 -0
  216. package/src/css/primitives/code/types.ts +7 -1
  217. package/src/css/primitives/heading/heading.ts +4 -0
  218. package/src/css/primitives/heading/types.ts +7 -1
  219. package/src/css/primitives/label/label.ts +4 -0
  220. package/src/css/primitives/label/types.ts +7 -1
  221. package/src/css/primitives/radio/radio.css.ts +1 -1
  222. package/src/css/primitives/root/root.css.ts +1 -1
  223. package/src/css/primitives/select/select.css.ts +7 -1
  224. package/src/css/primitives/selectable/selectable.css.ts +79 -70
  225. package/src/css/primitives/switch/switch.css.ts +10 -1
  226. package/src/css/primitives/text/text.ts +2 -0
  227. package/src/css/primitives/text/types.ts +6 -1
  228. package/src/css/primitives/textInput/textInput.css.ts +15 -3
  229. package/src/css/props/width/types.ts +1 -1
  230. package/src/css/props/width/width.css.ts +5 -2
  231. package/src/css/theme/buildCSSTheme.ts +4 -0
  232. package/src/css/types.ts +4 -0
  233. package/src/css/vars.css.ts +4 -0
  234. package/dist/_chunks-cjs/refractor.cjs +0 -22
  235. package/dist/_chunks-cjs/refractor.cjs.map +0 -1
  236. package/dist/css/index.cjs +0 -966
  237. package/dist/css/index.cjs.map +0 -1
  238. package/dist/css/index.d.cts +0 -1370
  239. package/dist/index.cjs +0 -4515
  240. package/dist/index.cjs.map +0 -1
  241. package/dist/index.d.cts +0 -2521
  242. package/dist/theme.cjs +0 -870
  243. package/dist/theme.cjs.map +0 -1
  244. package/dist/theme.d.cts +0 -499
  245. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
  246. package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
  247. package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
  248. package/src/core/primitives/popover/helpers.ts +0 -32
  249. package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +0 -4
  250. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +0 -102
  251. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +0 -18
  252. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -41
  253. package/src/core/utils/portal/portalProvider.tsx +0 -70
  254. /package/src/core/__workshop__/{boundary.tsx → Boundary.tsx} +0 -0
  255. /package/src/core/components/autocomplete/{autocompleteOption.tsx → AutocompleteOption.tsx} +0 -0
  256. /package/src/core/components/autocomplete/__workshop__/{async.tsx → Async.tsx} +0 -0
  257. /package/src/core/components/autocomplete/__workshop__/{constrainedHeight.tsx → ConstrainedHeight.tsx} +0 -0
  258. /package/src/core/components/autocomplete/__workshop__/{focusAndBlur.tsx → FocusAndBlur.tsx} +0 -0
  259. /package/src/core/components/autocomplete/__workshop__/{fullscreen.tsx → Fullscreen.tsx} +0 -0
  260. /package/src/core/components/breadcrumbs/__workshop__/{example.tsx → Example.tsx} +0 -0
  261. /package/src/core/components/dialog/__workshop__/{activate.tsx → Activate.tsx} +0 -0
  262. /package/src/core/components/dialog/__workshop__/{autoFocus.tsx → AutoFocus.tsx} +0 -0
  263. /package/src/core/components/dialog/__workshop__/{layering.tsx → Layering.tsx} +0 -0
  264. /package/src/core/components/dialog/__workshop__/{nested.tsx → Nested.tsx} +0 -0
  265. /package/src/core/components/dialog/__workshop__/{onScroll.tsx → OnScroll.tsx} +0 -0
  266. /package/src/core/components/dialog/__workshop__/{provider.tsx → Provider.tsx} +0 -0
  267. /package/src/core/components/dialog/__workshop__/{wrapped.tsx → Wrapped.tsx} +0 -0
  268. /package/src/core/components/hotkeys/__workshop__/{plain.tsx → Plain.tsx} +0 -0
  269. /package/src/core/components/menu/{menuDivider.tsx → MenuDivider.tsx} +0 -0
  270. /package/src/core/components/menu/__workshop__/{asComponent.tsx → AsComponent.tsx} +0 -0
  271. /package/src/core/components/menu/__workshop__/{avatarMenu.tsx → AvatarMenu.tsx} +0 -0
  272. /package/src/core/components/menu/__workshop__/{closableMenuButton.tsx → ClosableMenuButton.tsx} +0 -0
  273. /package/src/core/components/menu/__workshop__/{constrainedInBoundary.tsx → ConstrainedInBoundary.tsx} +0 -0
  274. /package/src/core/components/menu/__workshop__/{customMenuItem.tsx → CustomMenuItem.tsx} +0 -0
  275. /package/src/core/components/menu/__workshop__/{customSelectedState.tsx → CustomSelectedState.tsx} +0 -0
  276. /package/src/core/components/menu/__workshop__/{disableFocusOnClose.tsx → DisableFocusOnClose.tsx} +0 -0
  277. /package/src/core/components/menu/__workshop__/{groups.tsx → Groups.tsx} +0 -0
  278. /package/src/core/components/menu/__workshop__/{menuGroupRight.tsx → MenuGroupRight.tsx} +0 -0
  279. /package/src/core/components/menu/__workshop__/{nestedMenu.tsx → NestedMenu.tsx} +0 -0
  280. /package/src/core/components/menu/__workshop__/{onCloseMenuButton.tsx → OnCloseMenuButton.tsx} +0 -0
  281. /package/src/core/components/menu/__workshop__/{selectedItem.tsx → SelectedItem.tsx} +0 -0
  282. /package/src/core/components/menu/__workshop__/{shouldFocus.tsx → ShouldFocus.tsx} +0 -0
  283. /package/src/core/components/menu/__workshop__/{withoutArrow.tsx → WithoutArrow.tsx} +0 -0
  284. /package/src/core/components/tab/__workshop__/{example.tsx → Example.tsx} +0 -0
  285. /package/src/core/components/toast/__workshop__/{hook.tsx → Hook.tsx} +0 -0
  286. /package/src/core/components/tree/__workshop__/{basic.tsx → Basic.tsx} +0 -0
  287. /package/src/core/components/tree/__workshop__/{tabFromElement.tsx → TabFromElement.tsx} +0 -0
  288. /package/src/core/components/virtualList/__workshop__/{changingProps.tsx → ChangingProps.tsx} +0 -0
  289. /package/src/core/components/virtualList/__workshop__/{elementScroll.tsx → ElementScroll.tsx} +0 -0
  290. /package/src/core/components/virtualList/__workshop__/{infiniteList.tsx → InfiniteList.tsx} +0 -0
  291. /package/src/core/components/virtualList/__workshop__/{windowScrolll.tsx → WindowScrolll.tsx} +0 -0
  292. /package/src/core/hooks/useMediaIndex/__workshop__/{test.tsx → Test.tsx} +0 -0
  293. /package/src/core/primitives/arrow/{arrow.tsx → Arrow.tsx} +0 -0
  294. /package/src/core/primitives/avatar/__workshop__/{withinButton.tsx → WithinButton.tsx} +0 -0
  295. /package/src/core/primitives/avatar/__workshop__/{withinMenuItem.tsx → WithinMenuItem.tsx} +0 -0
  296. /package/src/core/primitives/badge/__workshop__/{tones.tsx → Tones.tsx} +0 -0
  297. /package/src/core/primitives/box/{box.tsx → Box.tsx} +0 -0
  298. /package/src/core/primitives/box/__workshop__/{responsive.tsx → Responsive.tsx} +0 -0
  299. /package/src/core/primitives/button/__workshop__/{custom.tsx → Custom.tsx} +0 -0
  300. /package/src/core/primitives/button/__workshop__/{customIcons.tsx → CustomIcons.tsx} +0 -0
  301. /package/src/core/primitives/button/__workshop__/{disabled.tsx → Disabled.tsx} +0 -0
  302. /package/src/core/primitives/button/__workshop__/{mixedChildren.tsx → MixedChildren.tsx} +0 -0
  303. /package/src/core/primitives/button/__workshop__/{textOverflow.tsx → TextOverflow.tsx} +0 -0
  304. /package/src/core/primitives/button/__workshop__/{uploadButton.tsx → UploadButton.tsx} +0 -0
  305. /package/src/core/primitives/card/__workshop__/{asButton.tsx → AsButton.tsx} +0 -0
  306. /package/src/core/primitives/card/__workshop__/{asComponent.tsx → AsComponent.tsx} +0 -0
  307. /package/src/core/primitives/card/__workshop__/{checkered.tsx → Checkered.tsx} +0 -0
  308. /package/src/core/primitives/card/__workshop__/{interactive.tsx → Interactive.tsx} +0 -0
  309. /package/src/core/primitives/card/__workshop__/{listNavigation.tsx → ListNavigation.tsx} +0 -0
  310. /package/src/core/primitives/card/__workshop__/{tones.tsx → Tones.tsx} +0 -0
  311. /package/src/core/primitives/checkbox/{checkbox.tsx → Checkbox.tsx} +0 -0
  312. /package/src/core/primitives/checkbox/__workshop__/{example.tsx → Example.tsx} +0 -0
  313. /package/src/core/primitives/checkbox/__workshop__/{props.tsx → Props.tsx} +0 -0
  314. /package/src/core/primitives/checkbox/__workshop__/{readOnly.tsx → ReadOnly.tsx} +0 -0
  315. /package/src/core/primitives/checkbox/__workshop__/{tones.tsx → Tones.tsx} +0 -0
  316. /package/src/core/primitives/code/{refractor.tsx → Refractor.tsx} +0 -0
  317. /package/src/core/primitives/code/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
  318. /package/src/core/primitives/flex/__workshop__/{gap.tsx → Gap.tsx} +0 -0
  319. /package/src/core/primitives/grid/__workshop__/{responsive.tsx → Responsive.tsx} +0 -0
  320. /package/src/core/primitives/heading/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
  321. /package/src/core/primitives/kbd/__workshop__/{plain.tsx → Plain.tsx} +0 -0
  322. /package/src/core/primitives/label/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
  323. /package/src/core/primitives/layer/__workshop__/{multipleRoots.tsx → MultipleRoots.tsx} +0 -0
  324. /package/src/core/primitives/layer/__workshop__/{nested.tsx → Nested.tsx} +0 -0
  325. /package/src/core/primitives/layer/__workshop__/{responsiveZOffset.tsx → ResponsiveZOffset.tsx} +0 -0
  326. /package/src/core/primitives/radio/__workshop__/{example.tsx → Example.tsx} +0 -0
  327. /package/src/core/primitives/radio/__workshop__/{plain.tsx → Plain.tsx} +0 -0
  328. /package/src/core/primitives/select/__workshop__/{readOnly.tsx → ReadOnly.tsx} +0 -0
  329. /package/src/core/primitives/spinner/{animatedSpinnerIcon.tsx → AnimatedSpinnerIcon.tsx} +0 -0
  330. /package/src/core/primitives/srOnly/{srOnly.tsx → SrOnly.tsx} +0 -0
  331. /package/src/core/primitives/switch/__workshop__/{example.tsx → Example.tsx} +0 -0
  332. /package/src/core/primitives/switch/__workshop__/{props.tsx → Props.tsx} +0 -0
  333. /package/src/core/primitives/text/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
  334. /package/src/core/primitives/textInput/__workshop__/{clearButton.tsx → ClearButton.tsx} +0 -0
  335. /package/src/core/primitives/textInput/__workshop__/{customValidity.tsx → CustomValidity.tsx} +0 -0
  336. /package/src/core/primitives/textInput/__workshop__/{readOnly.tsx → ReadOnly.tsx} +0 -0
  337. /package/src/core/primitives/textInput/__workshop__/{states.tsx → States.tsx} +0 -0
  338. /package/src/core/primitives/textInput/__workshop__/{tones.tsx → Tones.tsx} +0 -0
  339. /package/src/core/utils/boundaryElement/__workshop__/{plain.tsx → Plain.tsx} +0 -0
  340. /package/src/core/utils/elementQuery/{elementQuery.tsx → ElementQuery.tsx} +0 -0
  341. /package/src/core/utils/portal/__workshop__/{named.tsx → Named.tsx} +0 -0
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { SpinnerIcon, CloseIcon, ChevronDownIcon, ChevronRightIcon, ToggleArrowRightIcon, CheckmarkIcon, RemoveIcon } from "@sanity/icons";
3
- import { useState, isValidElement, useDebugValue, useSyncExternalStore, createContext, useContext, useRef, useImperativeHandle, useEffect, useMemo, useCallback, cloneElement, useReducer, Children, Fragment as Fragment$1, startTransition, useId, lazy, Suspense, useLayoutEffect, Component } from "react";
4
2
  import { c } from "react/compiler-runtime";
3
+ import { SpinnerIcon, CloseIcon, ChevronDownIcon, ChevronRightIcon, ToggleArrowRightIcon, CheckmarkIcon, RemoveIcon } from "@sanity/icons";
4
+ import { isValidElement, useDebugValue, useSyncExternalStore, createContext, use, useRef, useImperativeHandle, useEffect, useState, cloneElement, useReducer, Children, Fragment as Fragment$1, startTransition, useId, lazy, Suspense, useLayoutEffect, Component } from "react";
5
5
  import { box, text, textOverflow, animatedSpinnerIcon, spinner, button, buttonLoadingBox, _arrow, vars, _arrowSvg, _arrowStrokeMask, _arrowStroke, _arrowShape, card, BREAKPOINTS, popoverCard, popover, _selectable, stack, textInput, textInputPrefix, textInputElement, _inputElement, _inputPresentation, textInputSuffix, breadcrumbs, container as container$1, dialogCard, dialogHeader, dialogContent, dialogScrollerShadowTop, dialogScroller, dialogScrollerShadowBottom, dialogFooter, dialog, dialogContainer, kbd, menu, menuDivider, toast, toastLayer, treeItem, label, avatar, avatarArrow, avatarInitials, avatarImage, avatarImageOutline, avatarCounter, avatarStack, badge, checkbox, checkboxInput, checkboxPresentation, code, heading, radio, radioInput, radioPresentation, select, selectPresentation, skeleton, codeSkeleton, headingSkeleton, labelSkeleton, textSkeleton, srOnly, _switch, _switchElement, _switchPresentation, _switchTrack, _switchThumb, textArea, tooltip, root } from "@sanity/ui/css";
6
6
  import { isValidElementType } from "react-is";
7
- import { detectOverflow, autoPlacement, flip, offset, shift, arrow, hide, useFloating, autoUpdate } from "@floating-ui/react-dom";
7
+ import { detectOverflow, useFloating, autoPlacement, flip, offset, shift, arrow, hide, autoUpdate } from "@floating-ui/react-dom";
8
8
  import { motion, AnimatePresence } from "framer-motion";
9
9
  import { createPortal } from "react-dom";
10
10
  import { assignInlineVars } from "@vanilla-extract/dynamic";
@@ -119,18 +119,13 @@ function isArray(val) {
119
119
  function isRecord(value) {
120
120
  return !!(value && typeof value == "object" && !Array.isArray(value));
121
121
  }
122
- function _getArrayProp(val, defaultVal) {
123
- return val === void 0 ? defaultVal || EMPTY_ARRAY : Array.isArray(val) ? val : [val];
124
- }
125
122
  function _getResponsiveProp(val, defaultVal) {
126
123
  return val === void 0 ? defaultVal || EMPTY_ARRAY : isArray(val) || isRecord(val) ? val : [val];
127
124
  }
128
125
  function useResponsiveProp(val, defaultVal) {
129
126
  const $ = c(3);
130
127
  let t0;
131
- $[0] !== defaultVal || $[1] !== val ? (t0 = () => [_getResponsiveProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2];
132
- const [t1, setCache] = useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
133
- return hash !== cachedHash && setCache([_getResponsiveProp(val, defaultVal), hash]), cachedVal;
128
+ return $[0] !== defaultVal || $[1] !== val ? (t0 = _getResponsiveProp(val, defaultVal), $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2], t0;
134
129
  }
135
130
  const DEFAULT_BOX_ELEMENT = "div";
136
131
  function Box(props) {
@@ -272,40 +267,54 @@ function Box(props) {
272
267
  }
273
268
  const DEFAULT_TEXT_ELEMENT = "div";
274
269
  function Text(props) {
275
- const $ = c(30), t0 = props;
276
- let align, children, className, flex, muted, rest, t1, t2, t3, t4, textOverflowProp;
270
+ const $ = c(44), t0 = props;
271
+ let align, children, className, flex, margin, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, muted, rest, t1, t2, t3, t4, textOverflowProp;
277
272
  $[0] !== t0 ? ({
278
273
  align,
279
274
  as: t1,
280
275
  children,
281
276
  className,
282
277
  flex,
278
+ margin,
279
+ marginX,
280
+ marginY,
281
+ marginTop,
282
+ marginRight,
283
+ marginBottom,
284
+ marginLeft,
283
285
  maxWidth: t2,
284
286
  muted,
285
287
  size: t3,
286
288
  textOverflow: textOverflowProp,
287
289
  weight: t4,
288
290
  ...rest
289
- } = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = muted, $[6] = rest, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], flex = $[4], muted = $[5], rest = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10], textOverflowProp = $[11]);
291
+ } = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = margin, $[6] = marginBottom, $[7] = marginLeft, $[8] = marginRight, $[9] = marginTop, $[10] = marginX, $[11] = marginY, $[12] = muted, $[13] = rest, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4, $[18] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], flex = $[4], margin = $[5], marginBottom = $[6], marginLeft = $[7], marginRight = $[8], marginTop = $[9], marginX = $[10], marginY = $[11], muted = $[12], rest = $[13], t1 = $[14], t2 = $[15], t3 = $[16], t4 = $[17], textOverflowProp = $[18]);
290
292
  const Element2 = t1 === void 0 ? DEFAULT_TEXT_ELEMENT : t1, maxWidth = t2 === void 0 ? "fill" : t2, size2 = t3 === void 0 ? 2 : t3, weight = t4 === void 0 ? "regular" : t4;
291
293
  let t5;
292
- $[12] !== align || $[13] !== className || $[14] !== flex || $[15] !== maxWidth || $[16] !== muted || $[17] !== size2 || $[18] !== weight ? (t5 = text({
294
+ $[19] !== align || $[20] !== className || $[21] !== flex || $[22] !== margin || $[23] !== marginBottom || $[24] !== marginLeft || $[25] !== marginRight || $[26] !== marginTop || $[27] !== marginX || $[28] !== marginY || $[29] !== maxWidth || $[30] !== muted || $[31] !== size2 || $[32] !== weight ? (t5 = text({
293
295
  className,
294
296
  align,
295
297
  flex,
298
+ margin,
299
+ marginX,
300
+ marginY,
301
+ marginTop,
302
+ marginRight,
303
+ marginBottom,
304
+ marginLeft,
296
305
  maxWidth,
297
306
  muted,
298
307
  size: size2,
299
308
  weight
300
- }), $[12] = align, $[13] = className, $[14] = flex, $[15] = maxWidth, $[16] = muted, $[17] = size2, $[18] = weight, $[19] = t5) : t5 = $[19];
309
+ }), $[19] = align, $[20] = className, $[21] = flex, $[22] = margin, $[23] = marginBottom, $[24] = marginLeft, $[25] = marginRight, $[26] = marginTop, $[27] = marginX, $[28] = marginY, $[29] = maxWidth, $[30] = muted, $[31] = size2, $[32] = weight, $[33] = t5) : t5 = $[33];
301
310
  let t6;
302
- $[20] !== textOverflowProp ? (t6 = textOverflow({
311
+ $[34] !== textOverflowProp ? (t6 = textOverflow({
303
312
  textOverflow: textOverflowProp
304
- }), $[20] = textOverflowProp, $[21] = t6) : t6 = $[21];
313
+ }), $[34] = textOverflowProp, $[35] = t6) : t6 = $[35];
305
314
  let t7;
306
- $[22] !== children || $[23] !== t6 ? (t7 = /* @__PURE__ */ jsx("span", { className: t6, children }), $[22] = children, $[23] = t6, $[24] = t7) : t7 = $[24];
315
+ $[36] !== children || $[37] !== t6 ? (t7 = /* @__PURE__ */ jsx("span", { className: t6, children }), $[36] = children, $[37] = t6, $[38] = t7) : t7 = $[38];
307
316
  let t8;
308
- return $[25] !== Element2 || $[26] !== rest || $[27] !== t5 || $[28] !== t7 ? (t8 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Text", ...rest, className: t5, children: t7 }), $[25] = Element2, $[26] = rest, $[27] = t5, $[28] = t7, $[29] = t8) : t8 = $[29], t8;
317
+ return $[39] !== Element2 || $[40] !== rest || $[41] !== t5 || $[42] !== t7 ? (t8 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Text", ...rest, className: t5, children: t7 }), $[39] = Element2, $[40] = rest, $[41] = t5, $[42] = t7, $[43] = t8) : t8 = $[43], t8;
309
318
  }
310
319
  function AnimatedSpinnerIcon(props) {
311
320
  const $ = c(5);
@@ -339,77 +348,79 @@ function Spinner(props) {
339
348
  }
340
349
  const DEFAULT_BUTTON_ELEMENT = "button";
341
350
  function Button(props) {
342
- const {
343
- align = "center",
344
- as: Element2 = DEFAULT_BUTTON_ELEMENT,
345
- children,
351
+ const $ = c(88), t0 = props;
352
+ let Element2, IconComponent, IconRightComponent, align, children, className, disabled, flex, fontSize, gap, gapX, gapY, href, justify, loading, mode, muted, padding, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, radius, rest, selected, text2, textAlign, textOverflow2, textWeight, tone, type, width;
353
+ if ($[0] !== props.padding || $[1] !== t0) {
354
+ const {
355
+ align: t12,
356
+ as: t22,
357
+ children: t32,
358
+ className: t42,
359
+ disabled: t52,
360
+ flex: t62,
361
+ fontSize: t72,
362
+ gap: _gap,
363
+ gapX: t82,
364
+ gapY: t92,
365
+ icon: t10,
366
+ iconRight: t11,
367
+ justify: t122,
368
+ loading: t13,
369
+ mode: t14,
370
+ muted: t15,
371
+ padding: t16,
372
+ paddingX: t17,
373
+ paddingY: t18,
374
+ paddingTop: t19,
375
+ paddingBottom: t20,
376
+ paddingLeft: t21,
377
+ paddingRight: t222,
378
+ radius: t23,
379
+ selected: t24,
380
+ text: t25,
381
+ textAlign: t26,
382
+ textOverflow: t27,
383
+ textWeight: t28,
384
+ tone: t29,
385
+ type: t30,
386
+ width: t31,
387
+ ...t322
388
+ } = t0;
389
+ children = t32, className = t42, disabled = t52, flex = t62, gapX = t82, gapY = t92, IconComponent = t10, IconRightComponent = t11, loading = t13, paddingX = t17, paddingY = t18, paddingTop = t19, paddingBottom = t20, paddingLeft = t21, paddingRight = t222, selected = t24, text2 = t25, textAlign = t26, width = t31, rest = t322, align = t12 === void 0 ? "center" : t12, Element2 = t22 === void 0 ? DEFAULT_BUTTON_ELEMENT : t22, fontSize = t72 === void 0 ? 1 : t72, justify = t122 === void 0 ? "center" : t122, mode = t14 === void 0 ? "default" : t14, muted = t15 === void 0 ? !1 : t15, padding = t16 === void 0 ? 3 : t16, radius = t23 === void 0 ? 2 : t23, textOverflow2 = t27 === void 0 ? "ellipsis" : t27, textWeight = t28 === void 0 ? "medium" : t28, tone = t29 === void 0 ? "default" : t29, type = t30 === void 0 ? "button" : t30, gap = _gap ?? props.padding ?? 3, href = void 0, "href" in rest && (href = typeof rest.href == "string" ? rest.href : void 0, delete rest.href), $[0] = props.padding, $[1] = t0, $[2] = Element2, $[3] = IconComponent, $[4] = IconRightComponent, $[5] = align, $[6] = children, $[7] = className, $[8] = disabled, $[9] = flex, $[10] = fontSize, $[11] = gap, $[12] = gapX, $[13] = gapY, $[14] = href, $[15] = justify, $[16] = loading, $[17] = mode, $[18] = muted, $[19] = padding, $[20] = paddingBottom, $[21] = paddingLeft, $[22] = paddingRight, $[23] = paddingTop, $[24] = paddingX, $[25] = paddingY, $[26] = radius, $[27] = rest, $[28] = selected, $[29] = text2, $[30] = textAlign, $[31] = textOverflow2, $[32] = textWeight, $[33] = tone, $[34] = type, $[35] = width;
390
+ } else
391
+ Element2 = $[2], IconComponent = $[3], IconRightComponent = $[4], align = $[5], children = $[6], className = $[7], disabled = $[8], flex = $[9], fontSize = $[10], gap = $[11], gapX = $[12], gapY = $[13], href = $[14], justify = $[15], loading = $[16], mode = $[17], muted = $[18], padding = $[19], paddingBottom = $[20], paddingLeft = $[21], paddingRight = $[22], paddingTop = $[23], paddingX = $[24], paddingY = $[25], radius = $[26], rest = $[27], selected = $[28], text2 = $[29], textAlign = $[30], textOverflow2 = $[31], textWeight = $[32], tone = $[33], type = $[34], width = $[35];
392
+ let t1;
393
+ $[36] !== className || $[37] !== flex || $[38] !== mode || $[39] !== radius || $[40] !== tone || $[41] !== width ? (t1 = button({
346
394
  className,
347
- disabled,
348
395
  flex,
349
- fontSize = 1,
350
- gap = props.padding ?? 3,
351
- gapX,
352
- gapY,
353
- icon: IconComponent,
354
- iconRight: IconRightComponent,
355
- justify = "center",
356
- loading,
357
- mode = "default",
358
- padding = 3,
359
- paddingX,
360
- paddingY,
361
- paddingTop,
362
- paddingBottom,
363
- paddingLeft,
364
- paddingRight,
365
- radius = 2,
366
- selected,
367
- text: text2,
368
- textAlign,
369
- textOverflow: textOverflow2 = "ellipsis",
370
- textWeight = "medium",
371
- tone = "default",
372
- type = "button",
373
- muted = !1,
374
- width,
375
- ...rest
376
- } = props;
377
- let href;
378
- return "href" in rest && (href = typeof rest.href == "string" ? rest.href : href, delete rest.href), /* @__PURE__ */ jsxs(
379
- Element2,
380
- {
381
- "data-ui": "Button",
382
- ...rest,
383
- className: button({
384
- className,
385
- flex,
386
- mode,
387
- radius,
388
- tone,
389
- width
390
- }),
391
- "data-disabled": loading || disabled ? "" : void 0,
392
- "data-selected": selected ? "" : void 0,
393
- disabled: !!(loading || disabled),
394
- href: disabled ? void 0 : href,
395
- type,
396
- children: [
397
- !!loading && /* @__PURE__ */ jsx(Box, { alignItems: "center", as: "span", className: buttonLoadingBox(), display: "flex", flex: 1, justifyContent: "center", width: "fill", children: /* @__PURE__ */ jsx(Spinner, { size: fontSize }) }),
398
- (IconComponent || text2 || IconRightComponent) && /* @__PURE__ */ jsxs(Box, { alignItems: align, as: "span", display: "flex", flex: 1, gap, gapX, gapY, justifyContent: justify, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, children: [
399
- IconComponent && /* @__PURE__ */ jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
400
- isValidElement(IconComponent) && IconComponent,
401
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
402
- ] }),
403
- text2 && /* @__PURE__ */ jsx(Box, { as: "span", maxWidth: "auto", children: /* @__PURE__ */ jsx(Text, { align: textAlign, as: "span", muted, size: fontSize, textOverflow: textOverflow2, weight: textWeight, children: text2 }) }),
404
- IconRightComponent && /* @__PURE__ */ jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
405
- isValidElement(IconRightComponent) && IconRightComponent,
406
- isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
407
- ] })
408
- ] }),
409
- children && /* @__PURE__ */ jsx(Box, { as: "span", flex: 1, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, children })
410
- ]
411
- }
412
- );
396
+ mode,
397
+ radius,
398
+ tone,
399
+ width
400
+ }), $[36] = className, $[37] = flex, $[38] = mode, $[39] = radius, $[40] = tone, $[41] = width, $[42] = t1) : t1 = $[42];
401
+ const t2 = loading || disabled ? "" : props["data-disabled"], t3 = selected ? "" : props["data-selected"], t4 = !!(loading || disabled), t5 = disabled ? void 0 : href;
402
+ let t6;
403
+ $[43] !== fontSize || $[44] !== loading ? (t6 = !!loading && /* @__PURE__ */ jsx(Box, { alignItems: "center", as: "span", className: buttonLoadingBox(), display: "flex", flex: 1, justifyContent: "center", width: "fill", children: /* @__PURE__ */ jsx(Spinner, { size: fontSize }) }), $[43] = fontSize, $[44] = loading, $[45] = t6) : t6 = $[45];
404
+ let t7;
405
+ $[46] !== IconComponent || $[47] !== IconRightComponent || $[48] !== align || $[49] !== fontSize || $[50] !== gap || $[51] !== gapX || $[52] !== gapY || $[53] !== justify || $[54] !== muted || $[55] !== padding || $[56] !== paddingBottom || $[57] !== paddingLeft || $[58] !== paddingRight || $[59] !== paddingTop || $[60] !== paddingX || $[61] !== paddingY || $[62] !== text2 || $[63] !== textAlign || $[64] !== textOverflow2 || $[65] !== textWeight ? (t7 = (IconComponent || text2 || IconRightComponent) && /* @__PURE__ */ jsxs(Box, { alignItems: align, as: "span", display: "flex", flex: 1, gap, gapX, gapY, justifyContent: justify, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, children: [
406
+ IconComponent && /* @__PURE__ */ jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
407
+ isValidElement(IconComponent) && IconComponent,
408
+ isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
409
+ ] }),
410
+ text2 && /* @__PURE__ */ jsx(Box, { as: "span", maxWidth: "auto", children: /* @__PURE__ */ jsx(Text, { align: textAlign, as: "span", muted, size: fontSize, textOverflow: textOverflow2, weight: textWeight, children: text2 }) }),
411
+ IconRightComponent && /* @__PURE__ */ jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
412
+ isValidElement(IconRightComponent) && IconRightComponent,
413
+ isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
414
+ ] })
415
+ ] }), $[46] = IconComponent, $[47] = IconRightComponent, $[48] = align, $[49] = fontSize, $[50] = gap, $[51] = gapX, $[52] = gapY, $[53] = justify, $[54] = muted, $[55] = padding, $[56] = paddingBottom, $[57] = paddingLeft, $[58] = paddingRight, $[59] = paddingTop, $[60] = paddingX, $[61] = paddingY, $[62] = text2, $[63] = textAlign, $[64] = textOverflow2, $[65] = textWeight, $[66] = t7) : t7 = $[66];
416
+ let t8;
417
+ $[67] !== children || $[68] !== padding || $[69] !== paddingBottom || $[70] !== paddingLeft || $[71] !== paddingRight || $[72] !== paddingTop || $[73] !== paddingX || $[74] !== paddingY ? (t8 = children && /* @__PURE__ */ jsx(Box, { as: "span", flex: 1, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, children }), $[67] = children, $[68] = padding, $[69] = paddingBottom, $[70] = paddingLeft, $[71] = paddingRight, $[72] = paddingTop, $[73] = paddingX, $[74] = paddingY, $[75] = t8) : t8 = $[75];
418
+ let t9;
419
+ return $[76] !== Element2 || $[77] !== rest || $[78] !== t1 || $[79] !== t2 || $[80] !== t3 || $[81] !== t4 || $[82] !== t5 || $[83] !== t6 || $[84] !== t7 || $[85] !== t8 || $[86] !== type ? (t9 = /* @__PURE__ */ jsxs(Element2, { "data-ui": "Button", ...rest, className: t1, "data-disabled": t2, "data-selected": t3, disabled: t4, href: t5, type, children: [
420
+ t6,
421
+ t7,
422
+ t8
423
+ ] }), $[76] = Element2, $[77] = rest, $[78] = t1, $[79] = t2, $[80] = t3, $[81] = t4, $[82] = t5, $[83] = t6, $[84] = t7, $[85] = t8, $[86] = type, $[87] = t9) : t9 = $[87], t9;
413
424
  }
414
425
  function useMatchMedia(mediaQueryString, getServerSnapshot2) {
415
426
  const $ = c(4);
@@ -423,9 +434,9 @@ function useMatchMedia(mediaQueryString, getServerSnapshot2) {
423
434
  return $[2] !== mediaQueryString ? (t1 = () => window.matchMedia(mediaQueryString).matches, $[2] = mediaQueryString, $[3] = t1) : t1 = $[3], useSyncExternalStore(t0, t1, getServerSnapshot2);
424
435
  }
425
436
  function usePrefersReducedMotion(t0) {
426
- return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$a : t0);
437
+ return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$c : t0);
427
438
  }
428
- function _temp$a() {
439
+ function _temp$c() {
429
440
  return !1;
430
441
  }
431
442
  const origin = {
@@ -469,26 +480,19 @@ function getGlobalScope() {
469
480
  const globalScope = getGlobalScope();
470
481
  function createGlobalScopedContext(key2, defaultValue) {
471
482
  const symbol = Symbol.for(key2);
472
- if (typeof document > "u")
473
- return createContext(defaultValue);
483
+ if (typeof document > "u") {
484
+ const context = createContext(defaultValue);
485
+ return context.displayName = key2, context;
486
+ }
474
487
  const symbolMap = globalScope;
475
488
  return symbolMap[symbol] = symbolMap[symbol] || createContext(defaultValue), symbolMap[symbol];
476
489
  }
477
- const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/v3/boundaryElement", null), DEFAULT_VALUE = {
478
- version: 0,
479
- element: null
480
- };
481
- function useBoundaryElement() {
482
- const value = useContext(BoundaryElementContext);
483
- if (value && (!isRecord(value) || value.version !== 0))
484
- throw new Error("useBoundaryElement(): the context value is not compatible");
485
- return value || DEFAULT_VALUE;
486
- }
490
+ const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/v4/boundaryElement", null);
487
491
  function getElementRef(element) {
488
492
  let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
489
493
  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);
490
494
  }
491
- const CardContext = createGlobalScopedContext("@sanity/ui/v3/card", null);
495
+ const CardContext = createGlobalScopedContext("@sanity/ui/v4/card", null);
492
496
  function CardProvider(props) {
493
497
  const $ = c(7), {
494
498
  children,
@@ -496,22 +500,26 @@ function CardProvider(props) {
496
500
  scheme,
497
501
  unstable_CompatProvider
498
502
  } = props;
499
- let t0, t1;
500
- $[0] !== scheme || $[1] !== tone || $[2] !== unstable_CompatProvider ? (t1 = {
503
+ let t0;
504
+ $[0] !== scheme || $[1] !== tone || $[2] !== unstable_CompatProvider ? (t0 = {
501
505
  tone,
502
506
  scheme,
503
507
  unstable_CompatProvider
504
- }, $[0] = scheme, $[1] = tone, $[2] = unstable_CompatProvider, $[3] = t1) : t1 = $[3], t0 = t1;
505
- let t2;
506
- return $[4] !== children || $[5] !== t0 ? (t2 = /* @__PURE__ */ jsx(CardContext.Provider, { value: t0, children }), $[4] = children, $[5] = t0, $[6] = t2) : t2 = $[6], t2;
508
+ }, $[0] = scheme, $[1] = tone, $[2] = unstable_CompatProvider, $[3] = t0) : t0 = $[3];
509
+ let t1;
510
+ return $[4] !== children || $[5] !== t0 ? (t1 = /* @__PURE__ */ jsx(CardContext, { value: t0, children }), $[4] = children, $[5] = t0, $[6] = t1) : t1 = $[6], t1;
507
511
  }
508
512
  function useCard() {
509
- const card2 = useContext(CardContext);
513
+ const card2 = use(CardContext);
514
+ return assertCardContext(card2), card2;
515
+ }
516
+ function assertCardContext(card2) {
510
517
  if (!card2)
511
- throw new Error("useCard(): missing context value");
512
- return card2;
518
+ throw new Error("useCard(): missing context value", {
519
+ cause: card2
520
+ });
513
521
  }
514
- const key = "@sanity/ui/v3/portal", elementKey = Symbol.for(`${key}/element`), elementMap = globalScope;
522
+ const key = "@sanity/ui/v4/portal", elementKey = Symbol.for(`${key}/element`), elementMap = globalScope;
515
523
  elementMap[elementKey] = null;
516
524
  const defaultContextValue = {
517
525
  version: 0,
@@ -521,20 +529,24 @@ const defaultContextValue = {
521
529
  }
522
530
  }, PortalContext = createGlobalScopedContext(key, defaultContextValue);
523
531
  function usePortal() {
524
- const value = useContext(PortalContext);
532
+ const value = use(PortalContext);
533
+ return assertPortalContext(value), value;
534
+ }
535
+ function assertPortalContext(value) {
525
536
  if (!value)
526
537
  throw new Error("usePortal(): missing context value");
527
538
  if (!isRecord(value) || value.version !== 0)
528
539
  throw new Error("usePortal(): the context value is not compatible");
529
- return value;
530
540
  }
531
541
  function Portal(props) {
532
542
  const $ = c(6), {
533
543
  children,
534
544
  __unstable_name: name
535
- } = props, card2 = useCard(), portal = usePortal(), portalElement = (name ? portal.elements && portal.elements[name] : portal.element) || portal.elements?.default;
545
+ } = props, portal = usePortal(), portalElement = (name ? portal.elements && portal.elements[name] : portal.element) || portal.elements?.default;
536
546
  if (!portalElement)
537
547
  return null;
548
+ const card2 = use(CardContext);
549
+ assertCardContext(card2);
538
550
  let t0;
539
551
  $[0] !== card2.scheme || $[1] !== children ? (t0 = /* @__PURE__ */ jsx(CardProvider, { tone: "transparent", scheme: card2.scheme, children }), $[0] = card2.scheme, $[1] = children, $[2] = t0) : t0 = $[2];
540
552
  let t1;
@@ -549,16 +561,14 @@ function getLayerContext(contextValue) {
549
561
  return contextValue;
550
562
  throw new Error("could not get layer context");
551
563
  }
552
- const LayerContext = createGlobalScopedContext("@sanity/ui/v3/layer", null);
564
+ const LayerContext = createGlobalScopedContext("@sanity/ui/v4/layer", null);
553
565
  function useLayer() {
554
- const $ = c(2), value = useContext(LayerContext);
566
+ const value = use(LayerContext);
555
567
  if (!value)
556
568
  throw new Error("useLayer(): missing context value");
557
569
  try {
558
- let t1;
559
- return $[0] !== value ? (t1 = getLayerContext(value), $[0] = value, $[1] = t1) : t1 = $[1], t1;
560
- } catch (t0) {
561
- const err = t0;
570
+ return getLayerContext(value);
571
+ } catch (err) {
562
572
  throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
563
573
  }
564
574
  }
@@ -578,9 +588,11 @@ const DEFAULT_POPOVER_DISTANCE = 4, DEFAULT_POPOVER_PADDING = 4, DEFAULT_POPOVER
578
588
  };
579
589
  function size(options) {
580
590
  const {
581
- apply,
582
591
  margins,
583
- padding = 0
592
+ padding = 0,
593
+ constrainSize,
594
+ matchReferenceWidth,
595
+ referenceWidthRef
584
596
  } = options;
585
597
  return {
586
598
  name: "@sanity/ui/size",
@@ -602,12 +614,9 @@ function size(options) {
602
614
  });
603
615
  let maxWidth = 1 / 0, maxHeight = 1 / 0;
604
616
  const floatingW = floating.width, floatingH = floating.height;
605
- 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({
606
- availableWidth: maxWidth - margins[1] - margins[3],
607
- availableHeight: maxHeight - margins[0] - margins[2],
608
- elements,
609
- referenceWidth: reference.width - margins[1] - margins[3]
610
- });
617
+ 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));
618
+ const availableWidth = maxWidth - margins[1] - margins[3], availableHeight = maxHeight - margins[0] - margins[2], referenceWidth = reference.width - margins[1] - margins[3];
619
+ referenceWidthRef.current = referenceWidth, matchReferenceWidth && (elements.floating.style.width = `${referenceWidth}px`), constrainSize && (elements.floating.style.maxWidth = `${availableWidth}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
611
620
  const nextDimensions = await platform.getDimensions(elements.floating), targetH = nextDimensions.height, targetW = nextDimensions.width;
612
621
  return floatingW !== targetW || floatingH !== targetH ? {
613
622
  reset: {
@@ -655,7 +664,7 @@ function compileCommands(cmds) {
655
664
  }
656
665
  const DEFAULT_ARROW_ELEMENT = "div";
657
666
  function Arrow(props) {
658
- const $ = c(34), t0 = props;
667
+ const $ = c(39), t0 = props;
659
668
  let h, rest, style, t1, t2, w;
660
669
  $[0] !== t0 ? ({
661
670
  as: t1,
@@ -667,62 +676,65 @@ function Arrow(props) {
667
676
  } = t0, $[0] = t0, $[1] = h, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2, $[6] = w) : (h = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5], w = $[6]);
668
677
  const Element2 = t1 === void 0 ? DEFAULT_ARROW_ELEMENT : t1, radius = t2 === void 0 ? 0 : t2, center = w / 2;
669
678
  let t3;
670
- const points = [{
671
- x: 0,
672
- y: 0
673
- }, {
674
- x: radius,
675
- y: 0,
676
- radius
677
- }, {
678
- x: center,
679
- y: h - 1,
680
- radius
681
- }, {
682
- x: w - radius,
683
- y: 0,
684
- radius
685
- }, {
686
- x: w,
687
- y: 0
688
- }], cmds = getRoundedCommands(points);
689
- t3 = compileCommands(cmds);
679
+ if ($[7] !== center || $[8] !== h || $[9] !== radius || $[10] !== w) {
680
+ const points = [{
681
+ x: 0,
682
+ y: 0
683
+ }, {
684
+ x: radius,
685
+ y: 0,
686
+ radius
687
+ }, {
688
+ x: center,
689
+ y: h - 1,
690
+ radius
691
+ }, {
692
+ x: w - radius,
693
+ y: 0,
694
+ radius
695
+ }, {
696
+ x: w,
697
+ y: 0
698
+ }], cmds = getRoundedCommands(points);
699
+ t3 = compileCommands(cmds), $[7] = center, $[8] = h, $[9] = radius, $[10] = w, $[11] = t3;
700
+ } else
701
+ t3 = $[11];
690
702
  const path = t3, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`;
691
703
  let t4;
692
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = _arrow(), $[7] = t4) : t4 = $[7];
704
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t4 = _arrow(), $[12] = t4) : t4 = $[12];
693
705
  const t5 = `${w}px`;
694
706
  let t6;
695
- $[8] !== t5 ? (t6 = assignInlineVars({
707
+ $[13] !== t5 ? (t6 = assignInlineVars({
696
708
  [vars.arrow.size]: t5
697
- }), $[8] = t5, $[9] = t6) : t6 = $[9];
709
+ }), $[13] = t5, $[14] = t6) : t6 = $[14];
698
710
  let t7;
699
- $[10] !== style || $[11] !== t6 ? (t7 = {
711
+ $[15] !== style || $[16] !== t6 ? (t7 = {
700
712
  ...style,
701
713
  ...t6
702
- }, $[10] = style, $[11] = t6, $[12] = t7) : t7 = $[12];
714
+ }, $[15] = style, $[16] = t6, $[17] = t7) : t7 = $[17];
703
715
  let t8;
704
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t8 = _arrowSvg(), $[13] = t8) : t8 = $[13];
716
+ $[18] === Symbol.for("react.memo_cache_sentinel") ? (t8 = _arrowSvg(), $[18] = t8) : t8 = $[18];
705
717
  const t9 = `0 0 ${w} ${w}`;
706
718
  let t10;
707
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t10 = _arrowStrokeMask(), $[14] = t10) : t10 = $[14];
719
+ $[19] === Symbol.for("react.memo_cache_sentinel") ? (t10 = _arrowStrokeMask(), $[19] = t10) : t10 = $[19];
708
720
  let t11;
709
- $[15] !== w ? (t11 = /* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { className: t10, x: 0, width: w, height: w, fill: "white" }) }), $[15] = w, $[16] = t11) : t11 = $[16];
721
+ $[20] !== w ? (t11 = /* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { className: t10, x: 0, width: w, height: w, fill: "white" }) }), $[20] = w, $[21] = t11) : t11 = $[21];
710
722
  let t12;
711
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t12 = _arrowStroke(), $[17] = t12) : t12 = $[17];
723
+ $[22] === Symbol.for("react.memo_cache_sentinel") ? (t12 = _arrowStroke(), $[22] = t12) : t12 = $[22];
712
724
  let t13;
713
- $[18] !== strokePath ? (t13 = /* @__PURE__ */ jsx("path", { className: t12, d: strokePath, mask: "url(#stroke-mask)" }), $[18] = strokePath, $[19] = t13) : t13 = $[19];
725
+ $[23] !== strokePath ? (t13 = /* @__PURE__ */ jsx("path", { className: t12, d: strokePath, mask: "url(#stroke-mask)" }), $[23] = strokePath, $[24] = t13) : t13 = $[24];
714
726
  let t14;
715
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t14 = _arrowShape(), $[20] = t14) : t14 = $[20];
727
+ $[25] === Symbol.for("react.memo_cache_sentinel") ? (t14 = _arrowShape(), $[25] = t14) : t14 = $[25];
716
728
  let t15;
717
- $[21] !== fillPath ? (t15 = /* @__PURE__ */ jsx("path", { className: t14, d: fillPath }), $[21] = fillPath, $[22] = t15) : t15 = $[22];
729
+ $[26] !== fillPath ? (t15 = /* @__PURE__ */ jsx("path", { className: t14, d: fillPath }), $[26] = fillPath, $[27] = t15) : t15 = $[27];
718
730
  let t16;
719
- $[23] !== t11 || $[24] !== t13 || $[25] !== t15 || $[26] !== t9 || $[27] !== w ? (t16 = /* @__PURE__ */ jsxs("svg", { className: t8, width: w, height: w, viewBox: t9, children: [
731
+ $[28] !== t11 || $[29] !== t13 || $[30] !== t15 || $[31] !== t9 || $[32] !== w ? (t16 = /* @__PURE__ */ jsxs("svg", { className: t8, width: w, height: w, viewBox: t9, children: [
720
732
  t11,
721
733
  t13,
722
734
  t15
723
- ] }), $[23] = t11, $[24] = t13, $[25] = t15, $[26] = t9, $[27] = w, $[28] = t16) : t16 = $[28];
735
+ ] }), $[28] = t11, $[29] = t13, $[30] = t15, $[31] = t9, $[32] = w, $[33] = t16) : t16 = $[33];
724
736
  let t17;
725
- return $[29] !== Element2 || $[30] !== rest || $[31] !== t16 || $[32] !== t7 ? (t17 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t4, style: t7, children: t16 }), $[29] = Element2, $[30] = rest, $[31] = t16, $[32] = t7, $[33] = t17) : t17 = $[33], t17;
737
+ return $[34] !== Element2 || $[35] !== rest || $[36] !== t16 || $[37] !== t7 ? (t17 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t4, style: t7, children: t16 }), $[34] = Element2, $[35] = rest, $[36] = t16, $[37] = t7, $[38] = t17) : t17 = $[38], t17;
726
738
  }
727
739
  const DEFAULT_FLEX_ELEMENT = "div";
728
740
  function Flex(props) {
@@ -742,14 +754,13 @@ function Flex(props) {
742
754
  }
743
755
  const DEFAULT_CARD_ELEMENT = "div";
744
756
  function Card(props) {
745
- const $ = c(38), t0 = props;
746
- let className, disabled, pressed, rest, schemeProp, selected, style, t1, t2, t3, t4, t5;
757
+ const $ = c(37), t0 = props;
758
+ let className, pressed, rest, schemeProp, selected, style, t1, t2, t3, t4, t5;
747
759
  $[0] !== t0 ? ({
748
760
  __unstable_checkered: t1,
749
761
  __unstable_focusRing: t2,
750
762
  as: t3,
751
763
  className,
752
- disabled,
753
764
  pressed,
754
765
  radius: t4,
755
766
  scheme: schemeProp,
@@ -757,26 +768,26 @@ function Card(props) {
757
768
  style,
758
769
  tone: t5,
759
770
  ...rest
760
- } = t0, $[0] = t0, $[1] = className, $[2] = disabled, $[3] = pressed, $[4] = rest, $[5] = schemeProp, $[6] = selected, $[7] = style, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5) : (className = $[1], disabled = $[2], pressed = $[3], rest = $[4], schemeProp = $[5], selected = $[6], style = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12]);
761
- const checkered = t1 === void 0 ? !1 : t1, focusRing = t2 === void 0 ? !1 : t2, as = t3 === void 0 ? DEFAULT_CARD_ELEMENT : t3, radius = t4 === void 0 ? 0 : t4, toneProp = t5 === void 0 ? "default" : t5, parent = useContext(CardContext), tone = toneProp === "inherit" ? parent?.tone : toneProp, scheme = schemeProp === void 0 ? parent?.scheme : schemeProp, t6 = scheme === parent?.scheme ? void 0 : scheme;
771
+ } = t0, $[0] = t0, $[1] = className, $[2] = pressed, $[3] = rest, $[4] = schemeProp, $[5] = selected, $[6] = style, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = t5) : (className = $[1], pressed = $[2], rest = $[3], schemeProp = $[4], selected = $[5], style = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10], t5 = $[11]);
772
+ const checkered = t1 === void 0 ? !1 : t1, focusRing = t2 === void 0 ? !1 : t2, as = t3 === void 0 ? DEFAULT_CARD_ELEMENT : t3, radius = t4 === void 0 ? 0 : t4, toneProp = t5 === void 0 ? "default" : t5, parent = use(CardContext), tone = toneProp === "inherit" ? parent?.tone : toneProp, scheme = schemeProp === void 0 ? parent?.scheme : schemeProp, t6 = scheme === parent?.scheme ? void 0 : scheme;
762
773
  let t7;
763
- $[13] !== className || $[14] !== t6 || $[15] !== tone ? (t7 = card({
774
+ $[12] !== className || $[13] !== t6 || $[14] !== tone ? (t7 = card({
764
775
  className,
765
776
  scheme: t6,
766
777
  tone
767
- }), $[13] = className, $[14] = t6, $[15] = tone, $[16] = t7) : t7 = $[16];
768
- const t8 = checkered ? "" : void 0, t9 = disabled ? "" : void 0, t10 = focusRing ? "" : void 0, t11 = pressed ? "" : void 0, t12 = selected ? "" : void 0;
778
+ }), $[12] = className, $[13] = t6, $[14] = tone, $[15] = t7) : t7 = $[15];
779
+ const t8 = checkered ? "" : void 0, t9 = props.disabled ? "" : props["data-disabled"], t10 = focusRing ? "" : props["data-focus-ring"], t11 = pressed ? "" : props["data-pressed"], t12 = selected ? "" : props["data-selected"];
769
780
  let t13;
770
- $[17] !== as || $[18] !== radius || $[19] !== rest || $[20] !== style || $[21] !== t10 || $[22] !== t11 || $[23] !== t12 || $[24] !== t7 || $[25] !== t8 || $[26] !== t9 ? (t13 = /* @__PURE__ */ jsx(Box, { "data-ui": "Card", ...rest, as, className: t7, "data-checkered": t8, "data-disabled": t9, "data-focus-ring": t10, "data-pressed": t11, "data-selected": t12, radius, style }), $[17] = as, $[18] = radius, $[19] = rest, $[20] = style, $[21] = t10, $[22] = t11, $[23] = t12, $[24] = t7, $[25] = t8, $[26] = t9, $[27] = t13) : t13 = $[27];
781
+ $[16] !== as || $[17] !== radius || $[18] !== rest || $[19] !== style || $[20] !== t10 || $[21] !== t11 || $[22] !== t12 || $[23] !== t7 || $[24] !== t8 || $[25] !== t9 ? (t13 = /* @__PURE__ */ jsx(Box, { "data-ui": "Card", ...rest, as, className: t7, "data-checkered": t8, "data-disabled": t9, "data-focus-ring": t10, "data-pressed": t11, "data-selected": t12, radius, style }), $[16] = as, $[17] = radius, $[18] = rest, $[19] = style, $[20] = t10, $[21] = t11, $[22] = t12, $[23] = t7, $[24] = t8, $[25] = t9, $[26] = t13) : t13 = $[26];
771
782
  let node = t13;
772
783
  if (scheme === parent?.scheme && tone === parent?.tone)
773
784
  return node;
774
785
  const t14 = scheme ?? "light", t15 = tone ?? "default", t16 = parent?.unstable_CompatProvider;
775
786
  let t17;
776
- if ($[28] !== node || $[29] !== t14 || $[30] !== t15 || $[31] !== t16 ? (t17 = /* @__PURE__ */ jsx(CardProvider, { scheme: t14, tone: t15, unstable_CompatProvider: t16, children: node }), $[28] = node, $[29] = t14, $[30] = t15, $[31] = t16, $[32] = t17) : t17 = $[32], node = t17, parent?.unstable_CompatProvider) {
787
+ if ($[27] !== node || $[28] !== t14 || $[29] !== t15 || $[30] !== t16 ? (t17 = /* @__PURE__ */ jsx(CardProvider, { scheme: t14, tone: t15, unstable_CompatProvider: t16, children: node }), $[27] = node, $[28] = t14, $[29] = t15, $[30] = t16, $[31] = t17) : t17 = $[31], node = t17, parent?.unstable_CompatProvider) {
777
788
  const CompatProvider = parent.unstable_CompatProvider, t18 = scheme ?? "light", t19 = tone ?? parent.tone;
778
789
  let t20;
779
- return $[33] !== CompatProvider || $[34] !== node || $[35] !== t18 || $[36] !== t19 ? (t20 = /* @__PURE__ */ jsx(CompatProvider, { scheme: t18, tone: t19, children: node }), $[33] = CompatProvider, $[34] = node, $[35] = t18, $[36] = t19, $[37] = t20) : t20 = $[37], t20;
790
+ return $[32] !== CompatProvider || $[33] !== node || $[34] !== t18 || $[35] !== t19 ? (t20 = /* @__PURE__ */ jsx(CompatProvider, { scheme: t18, tone: t19, children: node }), $[32] = CompatProvider, $[33] = node, $[34] = t18, $[35] = t19, $[36] = t20) : t20 = $[36], t20;
780
791
  }
781
792
  return node;
782
793
  }
@@ -874,24 +885,27 @@ function getServerSnapshot() {
874
885
  }
875
886
  function useMediaIndex() {
876
887
  const $ = c(1);
877
- let t0, t1;
878
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = _createMediaStore(), $[0] = t1) : t1 = $[0], t0 = t1;
888
+ let t0;
889
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = _createMediaStore(), $[0] = t0) : t0 = $[0];
879
890
  const store = t0;
880
891
  return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
881
892
  }
882
893
  function LayerProvider(props) {
883
- const $ = c(19), {
894
+ const $ = c(21), {
884
895
  children,
885
896
  zOffset: t0
886
- } = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = useContext(LayerContext);
897
+ } = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = use(LayerContext);
887
898
  let t1;
888
899
  $[0] !== parentContextValue ? (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1) : t1 = $[1];
889
- const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = useResponsiveProp(zOffsetProp), maxMediaIndex = Object.values(zOffset).length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + (zOffset[mediaIndex] ?? 0) : zOffset[mediaIndex] ?? 0;
900
+ const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1;
890
901
  let t2;
891
- $[2] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[2] = t2) : t2 = $[2];
892
- const [, setChildLayers] = useState(t2), [size2, setSize] = useState(0), isTopLayer = size2 === 0;
902
+ $[2] !== zOffsetProp ? (t2 = _getResponsiveProp(zOffsetProp), $[2] = zOffsetProp, $[3] = t2) : t2 = $[3];
903
+ const zOffset = t2, maxMediaIndex = Object.values(zOffset).length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + (zOffset[mediaIndex] ?? 0) : zOffset[mediaIndex] ?? 0;
893
904
  let t3;
894
- $[3] !== parentRegisterChild || $[4] !== setChildLayers ? (t3 = (childLevel) => {
905
+ $[4] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[4] = t3) : t3 = $[4];
906
+ const [, setChildLayers] = useState(t3), [size2, setSize] = useState(0), isTopLayer = size2 === 0;
907
+ let t4;
908
+ $[5] !== parentRegisterChild || $[6] !== setChildLayers ? (t4 = (childLevel) => {
895
909
  const parentDispose = parentRegisterChild?.(childLevel);
896
910
  return childLevel !== void 0 ? setChildLayers((state) => {
897
911
  const prevLen = state[childLevel] ?? 0, nextState = {
@@ -899,35 +913,35 @@ function LayerProvider(props) {
899
913
  [childLevel]: prevLen + 1
900
914
  };
901
915
  return setSize(Object.keys(nextState).length), nextState;
902
- }) : setSize(_temp$9), () => {
916
+ }) : setSize(_temp$b), () => {
903
917
  childLevel !== void 0 ? setChildLayers((state_0) => {
904
918
  const nextState_0 = {
905
919
  ...state_0
906
920
  };
907
921
  return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
908
- }) : setSize(_temp2$2), parentDispose?.();
922
+ }) : setSize(_temp2$3), parentDispose?.();
909
923
  };
910
- }, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
911
- const registerChild = t3;
912
- let t4, t5;
913
- $[6] !== level || $[7] !== parentRegisterChild ? (t4 = () => parentRegisterChild?.(level), t5 = [level, parentRegisterChild], $[6] = level, $[7] = parentRegisterChild, $[8] = t4, $[9] = t5) : (t4 = $[8], t5 = $[9]), useEffect(t4, t5);
914
- let t6, t7;
915
- $[10] !== isTopLayer || $[11] !== level || $[12] !== registerChild || $[13] !== size2 || $[14] !== zIndex ? (t7 = {
924
+ }, $[5] = parentRegisterChild, $[6] = setChildLayers, $[7] = t4) : t4 = $[7];
925
+ const registerChild = t4;
926
+ let t5, t6;
927
+ $[8] !== level || $[9] !== parentRegisterChild ? (t5 = () => parentRegisterChild?.(level), t6 = [level, parentRegisterChild], $[8] = level, $[9] = parentRegisterChild, $[10] = t5, $[11] = t6) : (t5 = $[10], t6 = $[11]), useEffect(t5, t6);
928
+ let t7;
929
+ $[12] !== isTopLayer || $[13] !== level || $[14] !== registerChild || $[15] !== size2 || $[16] !== zIndex ? (t7 = {
916
930
  version: 0,
917
931
  isTopLayer,
918
932
  level,
919
933
  registerChild,
920
934
  size: size2,
921
935
  zIndex
922
- }, $[10] = isTopLayer, $[11] = level, $[12] = registerChild, $[13] = size2, $[14] = zIndex, $[15] = t7) : t7 = $[15], t6 = t7;
923
- const value = t6;
936
+ }, $[12] = isTopLayer, $[13] = level, $[14] = registerChild, $[15] = size2, $[16] = zIndex, $[17] = t7) : t7 = $[17];
937
+ const value = t7;
924
938
  let t8;
925
- return $[16] !== children || $[17] !== value ? (t8 = /* @__PURE__ */ jsx(LayerContext.Provider, { value, children }), $[16] = children, $[17] = value, $[18] = t8) : t8 = $[18], t8;
939
+ return $[18] !== children || $[19] !== value ? (t8 = /* @__PURE__ */ jsx(LayerContext, { value, children }), $[18] = children, $[19] = value, $[20] = t8) : t8 = $[20], t8;
926
940
  }
927
- function _temp2$2(v_0) {
941
+ function _temp2$3(v_0) {
928
942
  return v_0 - 1;
929
943
  }
930
- function _temp$9(v) {
944
+ function _temp$b(v) {
931
945
  return v + 1;
932
946
  }
933
947
  const DEFAULT_LAYER_ELEMENT = "div";
@@ -973,52 +987,45 @@ function PopoverLayer(props) {
973
987
  y: yProp,
974
988
  ...rest
975
989
  } = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = maxWidth, $[9] = originX, $[10] = originY, $[11] = overflow, $[12] = padding, $[13] = placement, $[14] = radius, $[15] = referenceWidth, $[16] = rest, $[17] = shadow, $[18] = strategy, $[19] = style, $[20] = t0, $[21] = xProp, $[22] = yProp) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], maxWidth = $[8], originX = $[9], originY = $[10], overflow = $[11], padding = $[12], placement = $[13], radius = $[14], referenceWidth = $[15], rest = $[16], shadow = $[17], strategy = $[18], style = $[19], t0 = $[20], xProp = $[21], yProp = $[22]);
976
- const tone = t0 === void 0 ? "inherit" : t0;
977
- let t1;
978
- t1 = marginsProp || DEFAULT_POPOVER_MARGINS;
979
- const margins = t1, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0];
990
+ const tone = t0 === void 0 ? "inherit" : t0, margins = marginsProp || DEFAULT_POPOVER_MARGINS, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0], t1 = animate ? "transform" : void 0;
980
991
  let t2;
981
- const t3 = animate ? "transform" : void 0;
982
- let t4;
983
- $[23] !== originX || $[24] !== originY || $[25] !== referenceWidth || $[26] !== style || $[27] !== t3 || $[28] !== x || $[29] !== y ? (t4 = {
992
+ $[23] !== originX || $[24] !== originY || $[25] !== referenceWidth || $[26] !== style || $[27] !== t1 || $[28] !== x || $[29] !== y ? (t2 = {
984
993
  left: x,
985
994
  originX,
986
995
  originY,
987
996
  top: y,
988
997
  width: referenceWidth,
989
- willChange: t3,
998
+ willChange: t1,
990
999
  ...style
991
- }, $[23] = originX, $[24] = originY, $[25] = referenceWidth, $[26] = style, $[27] = t3, $[28] = x, $[29] = y, $[30] = t4) : t4 = $[30], t2 = t4;
992
- const rootStyle = t2;
1000
+ }, $[23] = originX, $[24] = originY, $[25] = referenceWidth, $[26] = style, $[27] = t1, $[28] = x, $[29] = y, $[30] = t2) : t2 = $[30];
1001
+ const rootStyle = t2, t3 = arrowX !== null ? arrowX : void 0, t4 = arrowY !== null ? arrowY : void 0;
993
1002
  let t5;
994
- const t6 = arrowX !== null ? arrowX : void 0, t7 = arrowY !== null ? arrowY : void 0;
995
- let t8;
996
- $[31] !== t6 || $[32] !== t7 ? (t8 = {
997
- left: t6,
998
- top: t7,
1003
+ $[31] !== t3 || $[32] !== t4 ? (t5 = {
1004
+ left: t3,
1005
+ top: t4,
999
1006
  right: void 0,
1000
1007
  bottom: void 0
1001
- }, $[31] = t6, $[32] = t7, $[33] = t8) : t8 = $[33], t5 = t8;
1008
+ }, $[31] = t3, $[32] = t4, $[33] = t5) : t5 = $[33];
1002
1009
  const arrowStyle = t5;
1010
+ let t6;
1011
+ $[34] === Symbol.for("react.memo_cache_sentinel") ? (t6 = popoverCard(), $[34] = t6) : t6 = $[34];
1012
+ let t7;
1013
+ $[35] !== animate ? (t7 = animate ? ["hidden", "initial"] : void 0, $[35] = animate, $[36] = t7) : t7 = $[36];
1014
+ let t8;
1015
+ $[37] !== animate ? (t8 = animate ? ["visible", "scaleIn"] : void 0, $[37] = animate, $[38] = t8) : t8 = $[38];
1003
1016
  let t9;
1004
- $[34] === Symbol.for("react.memo_cache_sentinel") ? (t9 = popoverCard(), $[34] = t9) : t9 = $[34];
1017
+ $[39] !== animate ? (t9 = animate ? ["hidden", "scaleOut"] : void 0, $[39] = animate, $[40] = t9) : t9 = $[40];
1005
1018
  let t10;
1006
- $[35] !== animate ? (t10 = animate ? ["hidden", "initial"] : void 0, $[35] = animate, $[36] = t10) : t10 = $[36];
1019
+ $[41] !== children || $[42] !== padding ? (t10 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, padding, children }), $[41] = children, $[42] = padding, $[43] = t10) : t10 = $[43];
1007
1020
  let t11;
1008
- $[37] !== animate ? (t11 = animate ? ["visible", "scaleIn"] : void 0, $[37] = animate, $[38] = t11) : t11 = $[38];
1021
+ $[44] !== maxWidth || $[45] !== overflow || $[46] !== t10 ? (t11 = /* @__PURE__ */ jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, maxWidth, overflow, children: t10 }), $[44] = maxWidth, $[45] = overflow, $[46] = t10, $[47] = t11) : t11 = $[47];
1009
1022
  let t12;
1010
- $[39] !== animate ? (t12 = animate ? ["hidden", "scaleOut"] : void 0, $[39] = animate, $[40] = t12) : t12 = $[40];
1023
+ $[48] !== arrow2 || $[49] !== arrowRef || $[50] !== arrowStyle ? (t12 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[48] = arrow2, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t12) : t12 = $[51];
1011
1024
  let t13;
1012
- $[41] !== children || $[42] !== padding ? (t13 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, padding, children }), $[41] = children, $[42] = padding, $[43] = t13) : t13 = $[43];
1013
- let t14;
1014
- $[44] !== maxWidth || $[45] !== overflow || $[46] !== t13 ? (t14 = /* @__PURE__ */ jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, maxWidth, overflow, children: t13 }), $[44] = maxWidth, $[45] = overflow, $[46] = t13, $[47] = t14) : t14 = $[47];
1015
- let t15;
1016
- $[48] !== arrow2 || $[49] !== arrowRef || $[50] !== arrowStyle ? (t15 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[48] = arrow2, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t15) : t15 = $[51];
1017
- let t16;
1018
- return $[52] !== placement || $[53] !== radius || $[54] !== rest || $[55] !== rootStyle || $[56] !== shadow || $[57] !== strategy || $[58] !== t10 || $[59] !== t11 || $[60] !== t12 || $[61] !== t14 || $[62] !== t15 || $[63] !== tone ? (t16 = /* @__PURE__ */ jsxs(Layer, { className: t9, "data-ui": "Popover", ...rest, as: motion.div, "data-context-tone": tone, "data-placement": placement, flexDirection: "column", display: "flex", position: strategy, radius, shadow, sizing: "border", style: rootStyle, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t10, animate: t11, exit: t12, children: [
1019
- t14,
1020
- t15
1021
- ] }), $[52] = placement, $[53] = radius, $[54] = rest, $[55] = rootStyle, $[56] = shadow, $[57] = strategy, $[58] = t10, $[59] = t11, $[60] = t12, $[61] = t14, $[62] = t15, $[63] = tone, $[64] = t16) : t16 = $[64], t16;
1025
+ return $[52] !== placement || $[53] !== radius || $[54] !== rest || $[55] !== rootStyle || $[56] !== shadow || $[57] !== strategy || $[58] !== t11 || $[59] !== t12 || $[60] !== t7 || $[61] !== t8 || $[62] !== t9 || $[63] !== tone ? (t13 = /* @__PURE__ */ jsxs(Layer, { className: t6, "data-ui": "Popover", ...rest, as: motion.div, "data-context-tone": tone, "data-placement": placement, flexDirection: "column", display: "flex", position: strategy, radius, shadow, sizing: "border", style: rootStyle, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t7, animate: t8, exit: t9, children: [
1026
+ t11,
1027
+ t12
1028
+ ] }), $[52] = placement, $[53] = radius, $[54] = rest, $[55] = rootStyle, $[56] = shadow, $[57] = strategy, $[58] = t11, $[59] = t12, $[60] = t7, $[61] = t8, $[62] = t9, $[63] = tone, $[64] = t13) : t13 = $[64], t13;
1022
1029
  }
1023
1030
  const DEFAULT_POPOVER_ELEMENT = "div";
1024
1031
  function ViewportOverlay() {
@@ -1035,78 +1042,83 @@ function ViewportOverlay() {
1035
1042
  } }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
1036
1043
  }
1037
1044
  function Popover(props) {
1038
- const boundaryElementContext = useBoundaryElement(), {
1039
- __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
1040
- animate: _animate = !1,
1041
- arrow: arrowProp = !1,
1042
- as = DEFAULT_POPOVER_ELEMENT,
1043
- children: childProp,
1044
- className,
1045
- constrainSize = !1,
1046
- content: content2,
1047
- disabled,
1048
- fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
1045
+ const $ = c(113), t0 = props;
1046
+ let _fallbackPlacements, _floatingBoundary, _referenceBoundary, childProp, className, content2, disabled, forwardedRef, matchReferenceWidth, modal, open, padding, portal, referenceElement, rest, scheme, t1, t10, t11, t12, t13, t14, t2, t3, t4, t5, t6, t7, t8, t9, updateRef;
1047
+ if ($[0] !== t0) {
1048
+ const {
1049
+ __unstable_margins: t152,
1050
+ animate: t162,
1051
+ arrow: t172,
1052
+ as: t182,
1053
+ children: t192,
1054
+ className: t202,
1055
+ constrainSize: t212,
1056
+ content: t222,
1057
+ disabled: t232,
1058
+ fallbackPlacements: t242,
1059
+ matchReferenceWidth: t252,
1060
+ floatingBoundary: t262,
1061
+ modal: t272,
1062
+ onActivate,
1063
+ open: t282,
1064
+ overflow: t292,
1065
+ padding: t302,
1066
+ placement: t312,
1067
+ placementStrategy: t32,
1068
+ portal: t33,
1069
+ preventOverflow: t34,
1070
+ radius: t35,
1071
+ ref: t36,
1072
+ referenceBoundary: t37,
1073
+ referenceElement: t38,
1074
+ scheme: t39,
1075
+ shadow: t40,
1076
+ tone: t41,
1077
+ width: t42,
1078
+ zOffset: t43,
1079
+ updateRef: t44,
1080
+ ...t45
1081
+ } = t0;
1082
+ t1 = t152, t2 = t162, t3 = t172, t4 = t182, childProp = t192, className = t202, t5 = t212, content2 = t222, disabled = t232, _fallbackPlacements = t242, matchReferenceWidth = t252, _floatingBoundary = t262, modal = t272, open = t282, t6 = t292, padding = t302, t7 = t312, t8 = t32, portal = t33, t9 = t34, t10 = t35, forwardedRef = t36, _referenceBoundary = t37, referenceElement = t38, scheme = t39, t11 = t40, t12 = t41, t13 = t42, t14 = t43, updateRef = t44, rest = t45, $[0] = t0, $[1] = _fallbackPlacements, $[2] = _floatingBoundary, $[3] = _referenceBoundary, $[4] = childProp, $[5] = className, $[6] = content2, $[7] = disabled, $[8] = forwardedRef, $[9] = matchReferenceWidth, $[10] = modal, $[11] = open, $[12] = padding, $[13] = portal, $[14] = referenceElement, $[15] = rest, $[16] = scheme, $[17] = t1, $[18] = t10, $[19] = t11, $[20] = t12, $[21] = t13, $[22] = t14, $[23] = t2, $[24] = t3, $[25] = t4, $[26] = t5, $[27] = t6, $[28] = t7, $[29] = t8, $[30] = t9, $[31] = updateRef;
1083
+ } else
1084
+ _fallbackPlacements = $[1], _floatingBoundary = $[2], _referenceBoundary = $[3], childProp = $[4], className = $[5], content2 = $[6], disabled = $[7], forwardedRef = $[8], matchReferenceWidth = $[9], modal = $[10], open = $[11], padding = $[12], portal = $[13], referenceElement = $[14], rest = $[15], scheme = $[16], t1 = $[17], t10 = $[18], t11 = $[19], t12 = $[20], t13 = $[21], t14 = $[22], t2 = $[23], t3 = $[24], t4 = $[25], t5 = $[26], t6 = $[27], t7 = $[28], t8 = $[29], t9 = $[30], updateRef = $[31];
1085
+ const margins = t1 === void 0 ? DEFAULT_POPOVER_MARGINS : t1, _animate = t2 === void 0 ? !1 : t2, arrowProp = t3 === void 0 ? !1 : t3, as = t4 === void 0 ? DEFAULT_POPOVER_ELEMENT : t4, constrainSize = t5 === void 0 ? !1 : t5, overflow = t6 === void 0 ? "hidden" : t6, placementProp = t7 === void 0 ? "bottom" : t7, placementStrategy = t8 === void 0 ? "flip" : t8, preventOverflow = t9 === void 0 ? !0 : t9, radius = t10 === void 0 ? 3 : t10, shadow = t11 === void 0 ? 3 : t11, tone = t12 === void 0 ? "inherit" : t12, widthProp = t13 === void 0 ? "auto" : t13, zOffsetProp = t14 === void 0 ? Z_OFFSETS.popover : t14, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? use(BoundaryElementContext), referenceBoundary = _referenceBoundary ?? use(BoundaryElementContext), animate = usePrefersReducedMotion() ? !1 : _animate;
1086
+ let t15;
1087
+ $[32] !== zOffsetProp ? (t15 = _getResponsiveProp(zOffsetProp), $[32] = zOffsetProp, $[33] = t15) : t15 = $[33];
1088
+ const zOffset = t15, ref = useRef(null), arrowRef = useRef(null);
1089
+ let t16;
1090
+ $[34] === Symbol.for("react.memo_cache_sentinel") ? (t16 = () => ref.current, $[34] = t16) : t16 = $[34], useImperativeHandle(forwardedRef, t16);
1091
+ const referenceWidthRef = useRef(void 0);
1092
+ let t17;
1093
+ $[35] !== animate || $[36] !== arrowProp || $[37] !== constrainSize || $[38] !== fallbackPlacements || $[39] !== floatingBoundary || $[40] !== margins || $[41] !== matchReferenceWidth || $[42] !== placementProp || $[43] !== placementStrategy || $[44] !== preventOverflow || $[45] !== referenceBoundary ? (t17 = {
1094
+ animate,
1095
+ arrowProp,
1096
+ arrowRef,
1097
+ constrainSize,
1098
+ fallbackPlacements,
1099
+ floatingBoundary,
1100
+ margins,
1049
1101
  matchReferenceWidth,
1050
- floatingBoundary = boundaryElementContext.element,
1051
- modal,
1052
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1053
- onActivate,
1054
- open,
1055
- overflow = "hidden",
1056
- padding,
1057
- placement: placementProp = "bottom",
1058
- placementStrategy = "flip",
1059
- portal,
1060
- preventOverflow = !0,
1061
- radius = 3,
1062
- ref: forwardedRef,
1063
- referenceBoundary = boundaryElementContext.element,
1064
- referenceElement,
1065
- scheme,
1066
- shadow = 3,
1067
- tone = "inherit",
1068
- width: widthProp = "auto",
1069
- zOffset: zOffsetProp = Z_OFFSETS.popover,
1070
- updateRef,
1071
- ...rest
1072
- } = props, card2 = useCard(), animate = usePrefersReducedMotion() ? !1 : _animate, zOffset = useResponsiveProp(zOffsetProp), ref = useRef(null), arrowRef = useRef(null), rootBoundary = "viewport";
1073
- useImperativeHandle(forwardedRef, () => ref.current);
1074
- const referenceWidthRef = useRef(void 0), middleware = useMemo(() => {
1075
- const ret = [];
1076
- return (constrainSize || preventOverflow) && (placementStrategy === "autoPlacement" ? ret.push(autoPlacement({
1077
- allowedPlacements: [placementProp].concat(fallbackPlacements)
1078
- })) : ret.push(flip({
1079
- boundary: floatingBoundary || void 0,
1080
- fallbackPlacements,
1081
- padding: DEFAULT_POPOVER_PADDING,
1082
- rootBoundary
1083
- }))), ret.push(offset({
1084
- mainAxis: DEFAULT_POPOVER_DISTANCE
1085
- })), (constrainSize || matchReferenceWidth) && ret.push(size({
1086
- apply({
1087
- availableWidth,
1088
- availableHeight,
1089
- elements,
1090
- referenceWidth
1091
- }) {
1092
- referenceWidthRef.current = referenceWidth, matchReferenceWidth && (elements.floating.style.width = `${referenceWidth}px`), constrainSize && (elements.floating.style.maxWidth = `${availableWidth}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
1093
- },
1094
- boundaryElement: floatingBoundary || void 0,
1095
- margins,
1096
- padding: DEFAULT_POPOVER_PADDING
1097
- })), preventOverflow && ret.push(shift({
1098
- boundary: floatingBoundary || void 0,
1099
- rootBoundary,
1100
- padding: DEFAULT_POPOVER_PADDING
1101
- })), arrowProp && ret.push(arrow({
1102
- element: arrowRef,
1103
- padding: DEFAULT_POPOVER_PADDING
1104
- })), animate && ret.push(origin), ret.push(hide({
1105
- boundary: referenceBoundary || void 0,
1106
- padding: DEFAULT_POPOVER_PADDING,
1107
- strategy: "referenceHidden"
1108
- })), ret;
1109
- }, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, placementProp, placementStrategy, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
1102
+ placementProp,
1103
+ placementStrategy,
1104
+ preventOverflow,
1105
+ referenceBoundary,
1106
+ referenceWidthRef,
1107
+ rootBoundary: "viewport"
1108
+ }, $[35] = animate, $[36] = arrowProp, $[37] = constrainSize, $[38] = fallbackPlacements, $[39] = floatingBoundary, $[40] = margins, $[41] = matchReferenceWidth, $[42] = placementProp, $[43] = placementStrategy, $[44] = preventOverflow, $[45] = referenceBoundary, $[46] = t17) : t17 = $[46];
1109
+ const middleware = useMiddleware$1(t17);
1110
+ let t18;
1111
+ $[47] !== referenceElement ? (t18 = referenceElement ? {
1112
+ reference: referenceElement
1113
+ } : void 0, $[47] = referenceElement, $[48] = t18) : t18 = $[48];
1114
+ let t19;
1115
+ $[49] !== middleware || $[50] !== placementProp || $[51] !== t18 ? (t19 = {
1116
+ middleware,
1117
+ placement: placementProp,
1118
+ whileElementsMounted: autoUpdate,
1119
+ elements: t18
1120
+ }, $[49] = middleware, $[50] = placementProp, $[51] = t18, $[52] = t19) : t19 = $[52];
1121
+ const {
1110
1122
  x,
1111
1123
  y,
1112
1124
  middlewareData,
@@ -1114,38 +1126,149 @@ function Popover(props) {
1114
1126
  refs,
1115
1127
  strategy,
1116
1128
  update
1117
- } = useFloating({
1118
- middleware,
1119
- placement: placementProp,
1120
- whileElementsMounted: autoUpdate,
1121
- elements: referenceElement ? {
1122
- reference: referenceElement
1123
- } : void 0
1124
- }), 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 = useCallback((arrowEl) => {
1125
- arrowRef.current = arrowEl;
1126
- }, []), setFloating = useCallback((node) => {
1129
+ } = useFloating(t19), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY;
1130
+ let t20;
1131
+ $[53] !== refs ? (t20 = (node) => {
1127
1132
  ref.current = node, refs.setFloating(node);
1128
- }, [refs]), setReference = useCallback((node_0) => {
1129
- if (refs.setReference(node_0), !childProp) return;
1130
- const childRef = getElementRef(childProp);
1131
- typeof childRef == "function" ? childRef(node_0) : childRef && (childRef.current = node_0);
1132
- }, [childProp, refs]), child = useMemo(() => referenceElement ? childProp : childProp ? cloneElement(childProp, {
1133
- ref: setReference
1134
- }) : null, [childProp, referenceElement, setReference]);
1135
- if (useEffect(() => {
1136
- updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
1137
- }, [update, updateRef]), disabled)
1138
- return childProp || /* @__PURE__ */ jsx(Fragment, {});
1139
- const node_1 = /* @__PURE__ */ jsxs(Fragment, { children: [
1140
- modal && /* @__PURE__ */ jsx(ViewportOverlay, {}),
1141
- /* @__PURE__ */ jsx(PopoverLayer, { ...rest, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, className: popover({
1142
- className
1143
- }), hidden: referenceHidden, maxWidth: widthProp, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, tone, strategy, x, y, zOffset, children: content2 })
1144
- ] }), children = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: /* @__PURE__ */ jsx(CardProvider, { tone: tone === "inherit" ? card2.tone : tone, scheme: scheme ?? "light", children: node_1 }) }) : node_1);
1145
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1146
- animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
1133
+ }, $[53] = refs, $[54] = t20) : t20 = $[54];
1134
+ const setFloating = t20;
1135
+ let t21;
1136
+ $[55] !== childProp ? (t21 = childProp ? getElementRef(childProp) : null, $[55] = childProp, $[56] = t21) : t21 = $[56];
1137
+ let t22;
1138
+ $[57] !== refs.reference.current ? (t22 = () => refs.reference.current, $[57] = refs.reference.current, $[58] = t22) : t22 = $[58], useImperativeHandle(t21, t22);
1139
+ let t23;
1140
+ bb0: {
1141
+ if (referenceElement) {
1142
+ t23 = childProp;
1143
+ break bb0;
1144
+ }
1145
+ if (!childProp) {
1146
+ t23 = null;
1147
+ break bb0;
1148
+ }
1149
+ let t242;
1150
+ $[59] !== childProp || $[60] !== refs.setReference ? (t242 = cloneElement(childProp, {
1151
+ ref: refs.setReference
1152
+ }), $[59] = childProp, $[60] = refs.setReference, $[61] = t242) : t242 = $[61], t23 = t242;
1153
+ }
1154
+ const child = t23;
1155
+ let t24, t25;
1156
+ if ($[62] !== update ? (t24 = () => update, t25 = [update], $[62] = update, $[63] = t24, $[64] = t25) : (t24 = $[63], t25 = $[64]), useImperativeHandle(updateRef, t24, t25), disabled) {
1157
+ let t262;
1158
+ return $[65] !== childProp ? (t262 = childProp || /* @__PURE__ */ jsx(Fragment, {}), $[65] = childProp, $[66] = t262) : t262 = $[66], t262;
1159
+ }
1160
+ let t26;
1161
+ $[67] !== modal ? (t26 = modal && /* @__PURE__ */ jsx(ViewportOverlay, {}), $[67] = modal, $[68] = t26) : t26 = $[68];
1162
+ let t27;
1163
+ $[69] !== className ? (t27 = popover({
1164
+ className
1165
+ }), $[69] = className, $[70] = t27) : t27 = $[70];
1166
+ let t28;
1167
+ $[71] !== animate || $[72] !== arrowProp || $[73] !== arrowX || $[74] !== arrowY || $[75] !== as || $[76] !== content2 || $[77] !== margins || $[78] !== originX || $[79] !== originY || $[80] !== overflow || $[81] !== padding || $[82] !== placement || $[83] !== radius || $[84] !== referenceHidden || $[85] !== rest || $[86] !== scheme || $[87] !== setFloating || $[88] !== shadow || $[89] !== strategy || $[90] !== t27 || $[91] !== tone || $[92] !== widthProp || $[93] !== x || $[94] !== y || $[95] !== zOffset ? (t28 = /* @__PURE__ */ jsx(PopoverLayer, { ...rest, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef, arrowX, arrowY, as, className: t27, hidden: referenceHidden, maxWidth: widthProp, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, tone, strategy, x, y, zOffset, children: content2 }), $[71] = animate, $[72] = arrowProp, $[73] = arrowX, $[74] = arrowY, $[75] = as, $[76] = content2, $[77] = margins, $[78] = originX, $[79] = originY, $[80] = overflow, $[81] = padding, $[82] = placement, $[83] = radius, $[84] = referenceHidden, $[85] = rest, $[86] = scheme, $[87] = setFloating, $[88] = shadow, $[89] = strategy, $[90] = t27, $[91] = tone, $[92] = widthProp, $[93] = x, $[94] = y, $[95] = zOffset, $[96] = t28) : t28 = $[96];
1168
+ let t29;
1169
+ $[97] !== t26 || $[98] !== t28 ? (t29 = /* @__PURE__ */ jsxs(Fragment, { children: [
1170
+ t26,
1171
+ t28
1172
+ ] }), $[97] = t26, $[98] = t28, $[99] = t29) : t29 = $[99];
1173
+ const node_0 = t29;
1174
+ let children = open ? node_0 : null;
1175
+ if (open && portal) {
1176
+ let resolvedTone = tone;
1177
+ if (tone === "inherit") {
1178
+ const card2 = use(CardContext);
1179
+ assertCardContext(card2), resolvedTone = card2.tone;
1180
+ }
1181
+ const t302 = typeof portal == "string" ? portal : void 0, t312 = scheme ?? "light";
1182
+ let t32;
1183
+ $[100] !== node_0 || $[101] !== resolvedTone || $[102] !== t312 ? (t32 = /* @__PURE__ */ jsx(CardProvider, { tone: resolvedTone, scheme: t312, children: node_0 }), $[100] = node_0, $[101] = resolvedTone, $[102] = t312, $[103] = t32) : t32 = $[103];
1184
+ let t33;
1185
+ $[104] !== t302 || $[105] !== t32 ? (t33 = /* @__PURE__ */ jsx(Portal, { __unstable_name: t302, children: t32 }), $[104] = t302, $[105] = t32, $[106] = t33) : t33 = $[106], children = t33;
1186
+ }
1187
+ let t30;
1188
+ $[107] !== animate || $[108] !== children ? (t30 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[107] = animate, $[108] = children, $[109] = t30) : t30 = $[109];
1189
+ let t31;
1190
+ return $[110] !== child || $[111] !== t30 ? (t31 = /* @__PURE__ */ jsxs(Fragment, { children: [
1191
+ t30,
1147
1192
  child
1148
- ] });
1193
+ ] }), $[110] = child, $[111] = t30, $[112] = t31) : t31 = $[112], t31;
1194
+ }
1195
+ function useMiddleware$1(t0) {
1196
+ const $ = c(36), {
1197
+ animate,
1198
+ arrowProp,
1199
+ arrowRef,
1200
+ constrainSize,
1201
+ fallbackPlacements,
1202
+ floatingBoundary,
1203
+ margins,
1204
+ matchReferenceWidth,
1205
+ placementProp,
1206
+ placementStrategy,
1207
+ preventOverflow,
1208
+ referenceBoundary,
1209
+ referenceWidthRef,
1210
+ rootBoundary
1211
+ } = t0;
1212
+ let ret;
1213
+ if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== constrainSize || $[4] !== fallbackPlacements || $[5] !== floatingBoundary || $[6] !== margins || $[7] !== matchReferenceWidth || $[8] !== placementProp || $[9] !== placementStrategy || $[10] !== preventOverflow || $[11] !== referenceBoundary || $[12] !== referenceWidthRef || $[13] !== rootBoundary) {
1214
+ if (ret = [], constrainSize || preventOverflow)
1215
+ if (placementStrategy === "autoPlacement") {
1216
+ let t12;
1217
+ $[15] !== fallbackPlacements || $[16] !== placementProp ? (t12 = autoPlacement({
1218
+ allowedPlacements: [placementProp].concat(fallbackPlacements)
1219
+ }), $[15] = fallbackPlacements, $[16] = placementProp, $[17] = t12) : t12 = $[17], ret.push(t12);
1220
+ } else {
1221
+ const t12 = floatingBoundary || void 0;
1222
+ let t22;
1223
+ $[18] !== fallbackPlacements || $[19] !== rootBoundary || $[20] !== t12 ? (t22 = flip({
1224
+ boundary: t12,
1225
+ fallbackPlacements,
1226
+ padding: DEFAULT_POPOVER_PADDING,
1227
+ rootBoundary
1228
+ }), $[18] = fallbackPlacements, $[19] = rootBoundary, $[20] = t12, $[21] = t22) : t22 = $[21], ret.push(t22);
1229
+ }
1230
+ let t1;
1231
+ if ($[22] === Symbol.for("react.memo_cache_sentinel") ? (t1 = offset({
1232
+ mainAxis: DEFAULT_POPOVER_DISTANCE
1233
+ }), $[22] = t1) : t1 = $[22], ret.push(t1), constrainSize || matchReferenceWidth) {
1234
+ const t22 = floatingBoundary || void 0;
1235
+ let t32;
1236
+ $[23] !== constrainSize || $[24] !== margins || $[25] !== matchReferenceWidth || $[26] !== referenceWidthRef || $[27] !== t22 ? (t32 = size({
1237
+ boundaryElement: t22,
1238
+ constrainSize,
1239
+ margins,
1240
+ matchReferenceWidth,
1241
+ padding: DEFAULT_POPOVER_PADDING,
1242
+ referenceWidthRef
1243
+ }), $[23] = constrainSize, $[24] = margins, $[25] = matchReferenceWidth, $[26] = referenceWidthRef, $[27] = t22, $[28] = t32) : t32 = $[28], ret.push(t32);
1244
+ }
1245
+ if (preventOverflow) {
1246
+ const t22 = floatingBoundary || void 0;
1247
+ let t32;
1248
+ $[29] !== rootBoundary || $[30] !== t22 ? (t32 = shift({
1249
+ boundary: t22,
1250
+ rootBoundary,
1251
+ padding: DEFAULT_POPOVER_PADDING
1252
+ }), $[29] = rootBoundary, $[30] = t22, $[31] = t32) : t32 = $[31], ret.push(t32);
1253
+ }
1254
+ if (arrowProp) {
1255
+ let t22;
1256
+ $[32] !== arrowRef ? (t22 = arrow({
1257
+ element: arrowRef,
1258
+ padding: DEFAULT_POPOVER_PADDING
1259
+ }), $[32] = arrowRef, $[33] = t22) : t22 = $[33], ret.push(t22);
1260
+ }
1261
+ animate && ret.push(origin);
1262
+ const t2 = referenceBoundary || void 0;
1263
+ let t3;
1264
+ $[34] !== t2 ? (t3 = hide({
1265
+ boundary: t2,
1266
+ padding: DEFAULT_POPOVER_PADDING,
1267
+ strategy: "referenceHidden"
1268
+ }), $[34] = t2, $[35] = t3) : t3 = $[35], ret.push(t3), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = constrainSize, $[4] = fallbackPlacements, $[5] = floatingBoundary, $[6] = margins, $[7] = matchReferenceWidth, $[8] = placementProp, $[9] = placementStrategy, $[10] = preventOverflow, $[11] = referenceBoundary, $[12] = referenceWidthRef, $[13] = rootBoundary, $[14] = ret;
1269
+ } else
1270
+ ret = $[14];
1271
+ return ret;
1149
1272
  }
1150
1273
  const DEFAULT_SELECTABLE_ELEMENT = "button";
1151
1274
  function Selectable(props) {
@@ -1166,7 +1289,7 @@ function Selectable(props) {
1166
1289
  radius,
1167
1290
  tone
1168
1291
  }), $[7] = className, $[8] = radius, $[9] = tone, $[10] = t2) : t2 = $[10];
1169
- const t3 = selected ? "" : void 0;
1292
+ const t3 = selected ? "" : props["data-selected"];
1170
1293
  let t4;
1171
1294
  return $[11] !== as || $[12] !== rest || $[13] !== t2 || $[14] !== t3 ? (t4 = /* @__PURE__ */ jsx(Box, { ...rest, as, className: t2, "data-selected": t3 }), $[11] = as, $[12] = rest, $[13] = t2, $[14] = t3, $[15] = t4) : t4 = $[15], t4;
1172
1295
  }
@@ -1189,18 +1312,16 @@ function Stack(props) {
1189
1312
  return $[7] !== as || $[8] !== gap || $[9] !== rest || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(Box, { "data-ui": "Stack", ...rest, as, gridAutoRows: "min", className: t2, display: "grid", gap }), $[7] = as, $[8] = gap, $[9] = rest, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
1190
1313
  }
1191
1314
  function useCustomValidity(ref, customValidity) {
1192
- const $ = c(6);
1193
- let t0;
1194
- $[0] !== customValidity || $[1] !== ref.current ? (t0 = () => {
1315
+ const $ = c(4);
1316
+ let t0, t1;
1317
+ $[0] !== customValidity || $[1] !== ref ? (t0 = () => {
1195
1318
  ref.current?.setCustomValidity(customValidity || "");
1196
- }, $[0] = customValidity, $[1] = ref.current, $[2] = t0) : t0 = $[2];
1197
- let t1;
1198
- $[3] !== customValidity || $[4] !== ref ? (t1 = [customValidity, ref], $[3] = customValidity, $[4] = ref, $[5] = t1) : t1 = $[5], useEffect(t0, t1);
1319
+ }, t1 = [customValidity, ref], $[0] = customValidity, $[1] = ref, $[2] = t0, $[3] = t1) : (t0 = $[2], t1 = $[3]), useEffect(t0, t1);
1199
1320
  }
1200
1321
  const DEFAULT_TEXT_INPUT_ELEMENT = "input";
1201
1322
  function TextInput(props) {
1202
- const $ = c(88), t0 = props;
1203
- let IconComponent, IconRightComponent, __unstable_disableFocusRing, className, clearButton, customValidity, forwardedRef, onClear, prefix, readOnly, rest, suffix, t1, t2, t3, t4, t5, t6, t7, t8, width;
1323
+ const $ = c(86), t0 = props;
1324
+ let IconComponent, IconRightComponent, __unstable_disableFocusRing, className, clearButton, customValidity, flex, forwardedRef, onClear, prefix, readOnly, rest, suffix, t1, t2, t3, t4, t5, t6, t7, t8, width;
1204
1325
  if ($[0] !== t0) {
1205
1326
  const {
1206
1327
  __unstable_disableFocusRing: t92,
@@ -1209,111 +1330,129 @@ function TextInput(props) {
1209
1330
  className: t122,
1210
1331
  clearButton: t132,
1211
1332
  disabled: t142,
1212
- fontSize: t152,
1213
- gap: t162,
1214
- icon: t172,
1215
- iconRight: t182,
1216
- onClear: t192,
1217
- padding: t202,
1218
- prefix: t212,
1219
- radius: t222,
1220
- readOnly: t232,
1221
- ref: t242,
1222
- suffix: t252,
1223
- customValidity: t262,
1224
- type: t272,
1333
+ flex: t152,
1334
+ fontSize: t162,
1335
+ gap: t172,
1336
+ icon: t182,
1337
+ iconRight: t192,
1338
+ onClear: t202,
1339
+ padding: t212,
1340
+ prefix: t222,
1341
+ radius: t232,
1342
+ readOnly: t242,
1343
+ ref: t252,
1344
+ suffix: t262,
1345
+ customValidity: t272,
1346
+ type: t282,
1225
1347
  weight: _width,
1226
- width: t282,
1227
- ...t292
1348
+ width: t292,
1349
+ ...t302
1228
1350
  } = t0;
1229
- __unstable_disableFocusRing = t92, t1 = t102, t2 = t112, className = t122, clearButton = t132, t3 = t142, t4 = t152, t5 = t162, IconComponent = t172, IconRightComponent = t182, onClear = t192, t6 = t202, prefix = t212, t7 = t222, readOnly = t232, forwardedRef = t242, suffix = t252, customValidity = t262, t8 = t272, width = t282, rest = t292, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = className, $[5] = clearButton, $[6] = customValidity, $[7] = forwardedRef, $[8] = onClear, $[9] = prefix, $[10] = readOnly, $[11] = rest, $[12] = suffix, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7, $[20] = t8, $[21] = width;
1351
+ __unstable_disableFocusRing = t92, t1 = t102, t2 = t112, className = t122, clearButton = t132, t3 = t142, flex = t152, t4 = t162, t5 = t172, IconComponent = t182, IconRightComponent = t192, onClear = t202, t6 = t212, prefix = t222, t7 = t232, readOnly = t242, forwardedRef = t252, suffix = t262, customValidity = t272, t8 = t282, width = t292, rest = t302, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = className, $[5] = clearButton, $[6] = customValidity, $[7] = flex, $[8] = forwardedRef, $[9] = onClear, $[10] = prefix, $[11] = readOnly, $[12] = rest, $[13] = suffix, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4, $[18] = t5, $[19] = t6, $[20] = t7, $[21] = t8, $[22] = width;
1230
1352
  } else
1231
- IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], className = $[4], clearButton = $[5], customValidity = $[6], forwardedRef = $[7], onClear = $[8], prefix = $[9], readOnly = $[10], rest = $[11], suffix = $[12], t1 = $[13], t2 = $[14], t3 = $[15], t4 = $[16], t5 = $[17], t6 = $[18], t7 = $[19], t8 = $[20], width = $[21];
1232
- const Element2 = t1 === void 0 ? DEFAULT_TEXT_INPUT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, gap = t5 === void 0 ? 3 : t5, padding = t6 === void 0 ? 3 : t6, radius = t7 === void 0 ? 2 : t7, type = t8 === void 0 ? "text" : t8, ref = useRef(null), responsivePadding = useResponsiveProp(padding), withClearButton = !!clearButton;
1353
+ IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], className = $[4], clearButton = $[5], customValidity = $[6], flex = $[7], forwardedRef = $[8], onClear = $[9], prefix = $[10], readOnly = $[11], rest = $[12], suffix = $[13], t1 = $[14], t2 = $[15], t3 = $[16], t4 = $[17], t5 = $[18], t6 = $[19], t7 = $[20], t8 = $[21], width = $[22];
1354
+ const Element2 = t1 === void 0 ? DEFAULT_TEXT_INPUT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, gap = t5 === void 0 ? 3 : t5, padding = t6 === void 0 ? 3 : t6, radius = t7 === void 0 ? 2 : t7, type = t8 === void 0 ? "text" : t8, ref = useRef(null);
1233
1355
  let t9;
1234
- $[22] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => ref.current, $[22] = t9) : t9 = $[22], useImperativeHandle(forwardedRef, t9), useCustomValidity(ref, customValidity);
1235
- const handleClearMouseDown = _temp$8;
1356
+ $[23] !== padding ? (t9 = _getResponsiveProp(padding), $[23] = padding, $[24] = t9) : t9 = $[24];
1357
+ const responsivePadding = t9, withClearButton = !!clearButton;
1236
1358
  let t10;
1237
- $[23] !== onClear ? (t10 = (event_0) => {
1359
+ $[25] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => ref.current, $[25] = t10) : t10 = $[25], useImperativeHandle(forwardedRef, t10), useCustomValidity(ref, customValidity);
1360
+ const handleClearMouseDown = _temp$a;
1361
+ let t11;
1362
+ $[26] !== onClear ? (t11 = (event_0) => {
1238
1363
  event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
1239
- }, $[23] = onClear, $[24] = t10) : t10 = $[24];
1240
- const handleClearClick = t10;
1241
- let t11, t12;
1242
- $[25] !== responsivePadding ? (t12 = Object.fromEntries(Object.entries(responsivePadding).map(_temp2$1)), $[25] = responsivePadding, $[26] = t12) : t12 = $[26], t11 = t12;
1243
- const clearButtonBoxPadding = t11;
1244
- let t13, t14;
1245
- $[27] !== responsivePadding ? (t14 = Object.fromEntries(Object.entries(responsivePadding).map(_temp3)), $[27] = responsivePadding, $[28] = t14) : t14 = $[28], t13 = t14;
1246
- const clearButtonPadding = t13;
1247
- let t15;
1248
- t15 = isRecord(clearButton) ? clearButton : EMPTY_RECORD;
1249
- const clearButtonProps = t15;
1250
- let t16;
1251
- $[29] !== border || $[30] !== className || $[31] !== fontSize || $[32] !== gap || $[33] !== padding || $[34] !== radius || $[35] !== width ? (t16 = textInput({
1364
+ }, $[26] = onClear, $[27] = t11) : t11 = $[27];
1365
+ const handleClearClick = t11;
1366
+ let t12;
1367
+ $[28] !== border || $[29] !== className || $[30] !== flex || $[31] !== fontSize || $[32] !== gap || $[33] !== padding || $[34] !== radius || $[35] !== width ? (t12 = textInput({
1252
1368
  className,
1253
1369
  border,
1370
+ flex,
1254
1371
  fontSize,
1255
1372
  padding,
1256
1373
  radius,
1257
1374
  gap,
1258
1375
  width
1259
- }), $[29] = border, $[30] = className, $[31] = fontSize, $[32] = gap, $[33] = padding, $[34] = radius, $[35] = width, $[36] = t16) : t16 = $[36];
1260
- const t17 = IconComponent ? "" : void 0, t18 = IconRightComponent ? "" : void 0, t19 = customValidity ? "" : void 0, t20 = prefix ? "" : void 0, t21 = !disabled && readOnly ? "" : void 0, t22 = suffix ? "" : void 0;
1376
+ }), $[28] = border, $[29] = className, $[30] = flex, $[31] = fontSize, $[32] = gap, $[33] = padding, $[34] = radius, $[35] = width, $[36] = t12) : t12 = $[36];
1377
+ const t13 = IconComponent ? "" : void 0, t14 = IconRightComponent ? "" : void 0, t15 = customValidity ? "" : void 0, t16 = prefix ? "" : void 0, t17 = !disabled && readOnly ? "" : void 0, t18 = suffix ? "" : void 0;
1378
+ let t19;
1379
+ $[37] !== prefix ? (t19 = prefix && /* @__PURE__ */ jsx("span", { className: textInputPrefix(), children: /* @__PURE__ */ jsx("span", { children: prefix }) }), $[37] = prefix, $[38] = t19) : t19 = $[38];
1380
+ let t20;
1381
+ $[39] === Symbol.for("react.memo_cache_sentinel") ? (t20 = textInputElement(), $[39] = t20) : t20 = $[39];
1382
+ let t21;
1383
+ $[40] === Symbol.for("react.memo_cache_sentinel") ? (t21 = _inputElement(), $[40] = t21) : t21 = $[40];
1384
+ const t22 = __unstable_disableFocusRing ? "" : void 0;
1261
1385
  let t23;
1262
- $[37] !== prefix ? (t23 = prefix && /* @__PURE__ */ jsx(Box, { className: textInputPrefix(), sizing: "border", children: /* @__PURE__ */ jsx("span", { children: prefix }) }), $[37] = prefix, $[38] = t23) : t23 = $[38];
1386
+ $[41] !== Element2 || $[42] !== disabled || $[43] !== readOnly || $[44] !== rest || $[45] !== t22 || $[46] !== type ? (t23 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t21, "data-no-focus-ring": t22, disabled, readOnly, ref, type }), $[41] = Element2, $[42] = disabled, $[43] = readOnly, $[44] = rest, $[45] = t22, $[46] = type, $[47] = t23) : t23 = $[47];
1263
1387
  let t24;
1264
- $[39] === Symbol.for("react.memo_cache_sentinel") ? (t24 = textInputElement(), $[39] = t24) : t24 = $[39];
1388
+ $[48] === Symbol.for("react.memo_cache_sentinel") ? (t24 = _inputPresentation(), $[48] = t24) : t24 = $[48];
1265
1389
  let t25;
1266
- $[40] === Symbol.for("react.memo_cache_sentinel") ? (t25 = _inputElement(), $[40] = t25) : t25 = $[40];
1267
- const t26 = __unstable_disableFocusRing ? "" : void 0;
1268
- let t27;
1269
- $[41] !== Element2 || $[42] !== disabled || $[43] !== readOnly || $[44] !== rest || $[45] !== t26 || $[46] !== type ? (t27 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t25, "data-no-focus-ring": t26, disabled, readOnly, ref, type }), $[41] = Element2, $[42] = disabled, $[43] = readOnly, $[44] = rest, $[45] = t26, $[46] = type, $[47] = t27) : t27 = $[47];
1270
- let t28;
1271
- $[48] === Symbol.for("react.memo_cache_sentinel") ? (t28 = _inputPresentation(), $[48] = t28) : t28 = $[48];
1272
- let t29;
1273
- $[49] !== IconComponent || $[50] !== fontSize || $[51] !== padding ? (t29 = IconComponent && /* @__PURE__ */ jsx(Box, { padding, position: "absolute", insetTop: 0, insetLeft: 0, children: /* @__PURE__ */ jsxs(Text, { size: fontSize, children: [
1390
+ $[49] !== IconComponent || $[50] !== fontSize || $[51] !== padding ? (t25 = IconComponent && /* @__PURE__ */ jsx(Box, { as: "span", padding, position: "absolute", insetTop: 0, insetLeft: 0, children: /* @__PURE__ */ jsxs(Text, { as: "span", size: fontSize, children: [
1274
1391
  isValidElement(IconComponent) && IconComponent,
1275
1392
  isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
1276
- ] }) }), $[49] = IconComponent, $[50] = fontSize, $[51] = padding, $[52] = t29) : t29 = $[52];
1277
- let t30;
1278
- $[53] !== IconRightComponent || $[54] !== fontSize || $[55] !== padding || $[56] !== withClearButton ? (t30 = !withClearButton && IconRightComponent && /* @__PURE__ */ jsx(Box, { padding, position: "absolute", insetTop: 0, insetRight: 0, children: /* @__PURE__ */ jsxs(Text, { size: fontSize, children: [
1393
+ ] }) }), $[49] = IconComponent, $[50] = fontSize, $[51] = padding, $[52] = t25) : t25 = $[52];
1394
+ let t26;
1395
+ $[53] !== IconRightComponent || $[54] !== fontSize || $[55] !== padding || $[56] !== withClearButton ? (t26 = !withClearButton && IconRightComponent && /* @__PURE__ */ jsx(Box, { as: "span", padding, position: "absolute", insetTop: 0, insetRight: 0, children: /* @__PURE__ */ jsxs(Text, { as: "span", size: fontSize, children: [
1279
1396
  isValidElement(IconRightComponent) && IconRightComponent,
1280
1397
  isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
1281
- ] }) }), $[53] = IconRightComponent, $[54] = fontSize, $[55] = padding, $[56] = withClearButton, $[57] = t30) : t30 = $[57];
1398
+ ] }) }), $[53] = IconRightComponent, $[54] = fontSize, $[55] = padding, $[56] = withClearButton, $[57] = t26) : t26 = $[57];
1399
+ let t27;
1400
+ $[58] !== t25 || $[59] !== t26 ? (t27 = /* @__PURE__ */ jsxs("span", { className: t24, children: [
1401
+ t25,
1402
+ t26
1403
+ ] }), $[58] = t25, $[59] = t26, $[60] = t27) : t27 = $[60];
1404
+ let t28;
1405
+ $[61] !== clearButton || $[62] !== disabled || $[63] !== fontSize || $[64] !== handleClearClick || $[65] !== radius || $[66] !== readOnly || $[67] !== responsivePadding ? (t28 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(ClearButton, { fontSize, radius, clearButtonProps: isRecord(clearButton) ? clearButton : EMPTY_RECORD, handleClearClick, handleClearMouseDown, padding: responsivePadding }), $[61] = clearButton, $[62] = disabled, $[63] = fontSize, $[64] = handleClearClick, $[65] = radius, $[66] = readOnly, $[67] = responsivePadding, $[68] = t28) : t28 = $[68];
1406
+ let t29;
1407
+ $[69] !== t23 || $[70] !== t27 || $[71] !== t28 ? (t29 = /* @__PURE__ */ jsxs("span", { className: t20, children: [
1408
+ t23,
1409
+ t27,
1410
+ t28
1411
+ ] }), $[69] = t23, $[70] = t27, $[71] = t28, $[72] = t29) : t29 = $[72];
1412
+ let t30;
1413
+ $[73] !== suffix ? (t30 = suffix && /* @__PURE__ */ jsx("span", { className: textInputSuffix(), children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[73] = suffix, $[74] = t30) : t30 = $[74];
1282
1414
  let t31;
1283
- $[58] !== t29 || $[59] !== t30 ? (t31 = /* @__PURE__ */ jsxs(Box, { className: t28, position: "absolute", children: [
1415
+ return $[75] !== t12 || $[76] !== t13 || $[77] !== t14 || $[78] !== t15 || $[79] !== t16 || $[80] !== t17 || $[81] !== t18 || $[82] !== t19 || $[83] !== t29 || $[84] !== t30 ? (t31 = /* @__PURE__ */ jsxs("span", { className: t12, "data-icon-left": t13, "data-icon-right": t14, "data-invalid": t15, "data-prefix": t16, "data-read-only": t17, "data-suffix": t18, "data-ui": "TextInput", children: [
1416
+ t19,
1284
1417
  t29,
1285
1418
  t30
1286
- ] }), $[58] = t29, $[59] = t30, $[60] = t31) : t31 = $[60];
1287
- let t32;
1288
- $[61] !== clearButton || $[62] !== clearButtonBoxPadding || $[63] !== clearButtonPadding || $[64] !== clearButtonProps || $[65] !== disabled || $[66] !== fontSize || $[67] !== handleClearClick || $[68] !== radius || $[69] !== readOnly ? (t32 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(Box, { insetTop: 0, insetRight: 0, padding: clearButtonBoxPadding, position: "absolute", style: {
1419
+ ] }), $[75] = t12, $[76] = t13, $[77] = t14, $[78] = t15, $[79] = t16, $[80] = t17, $[81] = t18, $[82] = t19, $[83] = t29, $[84] = t30, $[85] = t31) : t31 = $[85], t31;
1420
+ }
1421
+ function _temp$a(event) {
1422
+ event.preventDefault(), event.stopPropagation();
1423
+ }
1424
+ function ClearButton(t0) {
1425
+ const $ = c(15), {
1426
+ fontSize,
1427
+ radius,
1428
+ clearButtonProps,
1429
+ handleClearClick,
1430
+ handleClearMouseDown,
1431
+ padding
1432
+ } = t0;
1433
+ let t1;
1434
+ $[0] !== padding ? (t1 = Object.fromEntries(Object.entries(padding).map(_temp2$2)), $[0] = padding, $[1] = t1) : t1 = $[1];
1435
+ const clearButtonBoxPadding = t1;
1436
+ let t2;
1437
+ $[2] !== padding ? (t2 = Object.fromEntries(Object.entries(padding).map(_temp3)), $[2] = padding, $[3] = t2) : t2 = $[3];
1438
+ const clearButtonPadding = t2;
1439
+ let t3;
1440
+ $[4] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
1289
1441
  zIndex: 2
1290
- }, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Clear", "data-qa": "clear-button", display: "block", fontSize, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[61] = clearButton, $[62] = clearButtonBoxPadding, $[63] = clearButtonPadding, $[64] = clearButtonProps, $[65] = disabled, $[66] = fontSize, $[67] = handleClearClick, $[68] = radius, $[69] = readOnly, $[70] = t32) : t32 = $[70];
1291
- let t33;
1292
- $[71] !== t27 || $[72] !== t31 || $[73] !== t32 ? (t33 = /* @__PURE__ */ jsxs(Box, { className: t24, flex: 1, position: "relative", children: [
1293
- t27,
1294
- t31,
1295
- t32
1296
- ] }), $[71] = t27, $[72] = t31, $[73] = t32, $[74] = t33) : t33 = $[74];
1297
- let t34;
1298
- $[75] !== suffix ? (t34 = suffix && /* @__PURE__ */ jsx(Box, { className: textInputSuffix(), sizing: "border", children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[75] = suffix, $[76] = t34) : t34 = $[76];
1299
- let t35;
1300
- return $[77] !== t16 || $[78] !== t17 || $[79] !== t18 || $[80] !== t19 || $[81] !== t20 || $[82] !== t21 || $[83] !== t22 || $[84] !== t23 || $[85] !== t33 || $[86] !== t34 ? (t35 = /* @__PURE__ */ jsxs(Box, { alignItems: "center", className: t16, "data-icon-left": t17, "data-icon-right": t18, "data-invalid": t19, "data-prefix": t20, "data-read-only": t21, "data-suffix": t22, "data-ui": "TextInput", display: "flex", children: [
1301
- t23,
1302
- t33,
1303
- t34
1304
- ] }), $[77] = t16, $[78] = t17, $[79] = t18, $[80] = t19, $[81] = t20, $[82] = t21, $[83] = t22, $[84] = t23, $[85] = t33, $[86] = t34, $[87] = t35) : t35 = $[87], t35;
1442
+ }, $[4] = t3) : t3 = $[4];
1443
+ let t4;
1444
+ $[5] !== clearButtonPadding || $[6] !== clearButtonProps || $[7] !== fontSize || $[8] !== handleClearClick || $[9] !== handleClearMouseDown || $[10] !== radius ? (t4 = /* @__PURE__ */ jsx(Button, { "aria-label": "Clear", "data-qa": "clear-button", display: "block", fontSize, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }), $[5] = clearButtonPadding, $[6] = clearButtonProps, $[7] = fontSize, $[8] = handleClearClick, $[9] = handleClearMouseDown, $[10] = radius, $[11] = t4) : t4 = $[11];
1445
+ let t5;
1446
+ return $[12] !== clearButtonBoxPadding || $[13] !== t4 ? (t5 = /* @__PURE__ */ jsx(Box, { as: "span", insetTop: 0, insetRight: 0, padding: clearButtonBoxPadding, position: "absolute", style: t3, children: t4 }), $[12] = clearButtonBoxPadding, $[13] = t4, $[14] = t5) : t5 = $[14], t5;
1305
1447
  }
1306
1448
  function _temp3(t0) {
1307
1449
  const [key_0, value_0] = t0;
1308
1450
  return value_0 === 0 ? [key_0, 0] : value_0 === 1 ? [key_0, 0] : value_0 === 2 ? [key_0, 1] : [key_0, typeof value_0 == "number" ? value_0 - 1 : 0];
1309
1451
  }
1310
- function _temp2$1(t0) {
1452
+ function _temp2$2(t0) {
1311
1453
  const [key2, value] = t0;
1312
1454
  return value === 0 ? [key2, 0] : value === 1 ? [key2, 1] : value === 2 ? [key2, 1] : [key2, typeof value == "number" ? value - 2 : 0];
1313
1455
  }
1314
- function _temp$8(event) {
1315
- event.preventDefault(), event.stopPropagation();
1316
- }
1317
1456
  function AutocompleteOption(props) {
1318
1457
  const $ = c(11), {
1319
1458
  children,
@@ -1378,16 +1517,18 @@ function autocompleteReducer(state, msg) {
1378
1517
  }
1379
1518
  const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_AUTOCOMPLETE_ELEMENT = "input", DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1;
1380
1519
  function Autocomplete(props) {
1381
- const {
1382
- as = DEFAULT_AUTOCOMPLETE_ELEMENT,
1383
- border = !0,
1520
+ const $ = c(181), t0 = props;
1521
+ let customValidity, disabled, filterOptionProp, forwardedRef, icon, id, loading, onBlur, onChange, onFocus, onQueryChange, onSelect, openButton, openOnFocus, optionsProp, prefix, readOnly, relatedElements, renderOptionProp, renderPopover, rest, suffix, t1, t2, t3, t4, t5, t6, t7, t8, valueProp;
1522
+ $[0] !== t0 ? ({
1523
+ as: t1,
1524
+ border: t2,
1384
1525
  customValidity,
1385
1526
  disabled,
1386
1527
  filterOption: filterOptionProp,
1387
- fontSize = 2,
1528
+ fontSize: t3,
1388
1529
  icon,
1389
1530
  id,
1390
- listBox = EMPTY_RECORD,
1531
+ listBox: t4,
1391
1532
  loading,
1392
1533
  onBlur,
1393
1534
  onChange,
@@ -1397,36 +1538,61 @@ function Autocomplete(props) {
1397
1538
  openButton,
1398
1539
  openOnFocus,
1399
1540
  options: optionsProp,
1400
- padding: paddingProp = 3,
1401
- popover: popover2 = EMPTY_RECORD,
1541
+ padding: t5,
1542
+ popover: t6,
1402
1543
  prefix,
1403
- radius = 2,
1544
+ radius: t7,
1404
1545
  readOnly,
1405
1546
  ref: forwardedRef,
1406
1547
  relatedElements,
1407
1548
  renderOption: renderOptionProp,
1408
1549
  renderPopover,
1409
- renderValue = DEFAULT_RENDER_VALUE,
1550
+ renderValue: t8,
1410
1551
  suffix,
1411
1552
  value: valueProp,
1412
1553
  ...rest
1413
- } = props, [state, dispatch] = useReducer(autocompleteReducer, {
1414
- activeValue: valueProp || null,
1554
+ } = t0, $[0] = t0, $[1] = customValidity, $[2] = disabled, $[3] = filterOptionProp, $[4] = forwardedRef, $[5] = icon, $[6] = id, $[7] = loading, $[8] = onBlur, $[9] = onChange, $[10] = onFocus, $[11] = onQueryChange, $[12] = onSelect, $[13] = openButton, $[14] = openOnFocus, $[15] = optionsProp, $[16] = prefix, $[17] = readOnly, $[18] = relatedElements, $[19] = renderOptionProp, $[20] = renderPopover, $[21] = rest, $[22] = suffix, $[23] = t1, $[24] = t2, $[25] = t3, $[26] = t4, $[27] = t5, $[28] = t6, $[29] = t7, $[30] = t8, $[31] = valueProp) : (customValidity = $[1], disabled = $[2], filterOptionProp = $[3], forwardedRef = $[4], icon = $[5], id = $[6], loading = $[7], onBlur = $[8], onChange = $[9], onFocus = $[10], onQueryChange = $[11], onSelect = $[12], openButton = $[13], openOnFocus = $[14], optionsProp = $[15], prefix = $[16], readOnly = $[17], relatedElements = $[18], renderOptionProp = $[19], renderPopover = $[20], rest = $[21], suffix = $[22], t1 = $[23], t2 = $[24], t3 = $[25], t4 = $[26], t5 = $[27], t6 = $[28], t7 = $[29], t8 = $[30], valueProp = $[31]);
1555
+ const as = t1 === void 0 ? DEFAULT_AUTOCOMPLETE_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, fontSize = t3 === void 0 ? 2 : t3, listBox = t4 === void 0 ? EMPTY_RECORD : t4, paddingProp = t5 === void 0 ? 3 : t5, popover2 = t6 === void 0 ? EMPTY_RECORD : t6, radius = t7 === void 0 ? 2 : t7, renderValue = t8 === void 0 ? DEFAULT_RENDER_VALUE : t8, t9 = valueProp || null, t10 = valueProp || null;
1556
+ let t11;
1557
+ $[32] !== t10 || $[33] !== t9 ? (t11 = {
1558
+ activeValue: t9,
1415
1559
  focused: !1,
1416
1560
  listFocused: !1,
1417
1561
  query: null,
1418
- value: valueProp || null
1419
- }), {
1562
+ value: t10
1563
+ }, $[32] = t10, $[33] = t9, $[34] = t11) : t11 = $[34];
1564
+ const [state, dispatch] = useReducer(autocompleteReducer, t11), {
1420
1565
  activeValue,
1421
1566
  focused,
1422
1567
  listFocused,
1423
1568
  query,
1424
1569
  value
1425
- } = state, defaultRenderOption = useCallback(({
1426
- value: value_0
1427
- }) => /* @__PURE__ */ jsx(Selectable, { as: "button", padding: paddingProp, radius: 2, children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) }), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
1428
- useImperativeHandle(forwardedRef, () => inputElementRef.current);
1429
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useResponsiveProp(paddingProp), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = useCallback((event) => {
1570
+ } = state;
1571
+ let t12;
1572
+ $[35] !== fontSize || $[36] !== paddingProp ? (t12 = (t132) => {
1573
+ const {
1574
+ value: value_0
1575
+ } = t132;
1576
+ return /* @__PURE__ */ jsx(Selectable, { as: "button", padding: paddingProp, radius: 2, children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) });
1577
+ }, $[35] = fontSize, $[36] = paddingProp, $[37] = t12) : t12 = $[37];
1578
+ const renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t12, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), [inputElement, setInputElement] = useState(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
1579
+ let t13, t14;
1580
+ $[38] !== inputElement ? (t13 = () => inputElement, t14 = [inputElement], $[38] = inputElement, $[39] = t13, $[40] = t14) : (t13 = $[39], t14 = $[40]), useImperativeHandle(inputElementRef, t13, t14);
1581
+ let t15, t16;
1582
+ $[41] !== inputElement ? (t15 = () => inputElement, t16 = [inputElement], $[41] = inputElement, $[42] = t15, $[43] = t16) : (t15 = $[42], t16 = $[43]), useImperativeHandle(forwardedRef, t15, t16);
1583
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useResponsiveProp(paddingProp);
1584
+ let t17;
1585
+ $[44] !== options || $[45] !== value ? (t17 = value !== null ? options.find((o) => o.value === value) : void 0, $[44] = options, $[45] = value, $[46] = t17) : t17 = $[46];
1586
+ const currentOption = t17;
1587
+ let t18;
1588
+ if ($[47] !== filterOption || $[48] !== options || $[49] !== query) {
1589
+ let t192;
1590
+ $[51] !== filterOption || $[52] !== query ? (t192 = (option) => query ? filterOption(query, option) : !0, $[51] = filterOption, $[52] = query, $[53] = t192) : t192 = $[53], t18 = options.filter(t192), $[47] = filterOption, $[48] = options, $[49] = query, $[50] = t18;
1591
+ } else
1592
+ t18 = $[50];
1593
+ const filteredOptions = t18, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null;
1594
+ let t19;
1595
+ $[54] !== onBlur || $[55] !== onQueryChange || $[56] !== relatedElements ? (t19 = (event) => {
1430
1596
  setTimeout(() => {
1431
1597
  if (popoverMouseWithinRef.current)
1432
1598
  return;
@@ -1443,20 +1609,30 @@ function Autocomplete(props) {
1443
1609
  type: "root/blur"
1444
1610
  }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
1445
1611
  }, 0);
1446
- }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = useCallback((event_0) => {
1612
+ }, $[54] = onBlur, $[55] = onQueryChange, $[56] = relatedElements, $[57] = t19) : t19 = $[57];
1613
+ const handleRootBlur = t19;
1614
+ let t20;
1615
+ $[58] === Symbol.for("react.memo_cache_sentinel") ? (t20 = (event_0) => {
1447
1616
  const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
1448
1617
  listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
1449
1618
  type: "root/setListFocused",
1450
1619
  listFocused: listFocused_0
1451
1620
  }));
1452
- }, []), handleOptionSelect = useCallback((v) => {
1621
+ }, $[58] = t20) : t20 = $[58];
1622
+ const handleRootFocus = t20;
1623
+ let t21;
1624
+ $[59] !== onChange || $[60] !== onQueryChange || $[61] !== onSelect ? (t21 = (v) => {
1453
1625
  dispatch({
1454
1626
  type: "value/change",
1455
1627
  value: v
1456
1628
  }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
1457
- }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = useCallback((event_1) => {
1629
+ }, $[59] = onChange, $[60] = onQueryChange, $[61] = onSelect, $[62] = t21) : t21 = $[62];
1630
+ const handleOptionSelect = t21;
1631
+ let t22;
1632
+ $[63] !== activeValue || $[64] !== filteredOptions || $[65] !== filteredOptionsLen || $[66] !== onQueryChange ? (t22 = (event_1) => {
1458
1633
  if (event_1.key === "ArrowDown") {
1459
- if (event_1.preventDefault(), !filteredOptionsLen) return;
1634
+ if (event_1.preventDefault(), !filteredOptionsLen)
1635
+ return;
1460
1636
  const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
1461
1637
  nextActiveOption && dispatch({
1462
1638
  type: "root/setActiveValue",
@@ -1466,7 +1642,8 @@ function Autocomplete(props) {
1466
1642
  return;
1467
1643
  }
1468
1644
  if (event_1.key === "ArrowUp") {
1469
- if (event_1.preventDefault(), !filteredOptionsLen) return;
1645
+ if (event_1.preventDefault(), !filteredOptionsLen)
1646
+ return;
1470
1647
  const activeOption_0 = filteredOptions.find((o_1) => o_1.value === activeValue), activeIndex_0 = activeOption_0 ? filteredOptions.indexOf(activeOption_0) : -1, nextActiveOption_0 = filteredOptions[activeIndex_0 === -1 ? filteredOptionsLen - 1 : (filteredOptionsLen + activeIndex_0 - 1) % filteredOptionsLen];
1471
1648
  nextActiveOption_0 && dispatch({
1472
1649
  type: "root/setActiveValue",
@@ -1486,35 +1663,58 @@ function Autocomplete(props) {
1486
1663
  inputElementRef.current?.focus();
1487
1664
  return;
1488
1665
  }
1489
- }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = useCallback((event_2) => {
1666
+ }, $[63] = activeValue, $[64] = filteredOptions, $[65] = filteredOptionsLen, $[66] = onQueryChange, $[67] = t22) : t22 = $[67];
1667
+ const handleRootKeyDown = t22;
1668
+ let t23;
1669
+ $[68] !== onQueryChange ? (t23 = (event_2) => {
1490
1670
  const nextQuery = event_2.currentTarget.value;
1491
1671
  dispatch({
1492
1672
  type: "input/change",
1493
1673
  query: nextQuery
1494
1674
  }), onQueryChange && onQueryChange(nextQuery);
1495
- }, [onQueryChange]), dispatchOpen = useCallback(() => {
1675
+ }, $[68] = onQueryChange, $[69] = t23) : t23 = $[69];
1676
+ const handleInputChange = t23;
1677
+ let t24;
1678
+ $[70] !== currentOption || $[71] !== renderValue || $[72] !== value ? (t24 = () => {
1496
1679
  dispatch({
1497
1680
  type: "root/open",
1498
1681
  query: value ? renderValue(value, currentOption) : ""
1499
1682
  });
1500
- }, [currentOption, renderValue, value]), handleInputFocus = useCallback((event_3) => {
1683
+ }, $[70] = currentOption, $[71] = renderValue, $[72] = value, $[73] = t24) : t24 = $[73];
1684
+ const dispatchOpen = t24;
1685
+ let t25;
1686
+ $[74] !== dispatchOpen || $[75] !== focused || $[76] !== onFocus || $[77] !== openOnFocus ? (t25 = (event_3) => {
1501
1687
  focused || (dispatch({
1502
1688
  type: "input/focus"
1503
1689
  }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
1504
- }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = useCallback(() => {
1690
+ }, $[74] = dispatchOpen, $[75] = focused, $[76] = onFocus, $[77] = openOnFocus, $[78] = t25) : t25 = $[78];
1691
+ const handleInputFocus = t25;
1692
+ let t26;
1693
+ $[79] === Symbol.for("react.memo_cache_sentinel") ? (t26 = () => {
1505
1694
  popoverMouseWithinRef.current = !0;
1506
- }, []), handlePopoverMouseLeave = useCallback(() => {
1695
+ }, $[79] = t26) : t26 = $[79];
1696
+ const handlePopoverMouseEnter = t26;
1697
+ let t27;
1698
+ $[80] === Symbol.for("react.memo_cache_sentinel") ? (t27 = () => {
1507
1699
  popoverMouseWithinRef.current = !1;
1508
- }, []), handleClearButtonClick = useCallback(() => {
1700
+ }, $[80] = t27) : t27 = $[80];
1701
+ const handlePopoverMouseLeave = t27;
1702
+ let t28;
1703
+ $[81] !== onChange || $[82] !== onQueryChange ? (t28 = () => {
1509
1704
  dispatch({
1510
1705
  type: "root/clear"
1511
1706
  }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
1512
- }, [onChange, onQueryChange]), handleClearButtonFocus = useCallback(() => {
1707
+ }, $[81] = onChange, $[82] = onQueryChange, $[83] = t28) : t28 = $[83];
1708
+ const handleClearButtonClick = t28;
1709
+ let t29;
1710
+ $[84] === Symbol.for("react.memo_cache_sentinel") ? (t29 = () => {
1513
1711
  dispatch({
1514
1712
  type: "input/focus"
1515
1713
  });
1516
- }, []);
1517
- useEffect(() => {
1714
+ }, $[84] = t29) : t29 = $[84];
1715
+ const handleClearButtonFocus = t29;
1716
+ let t30, t31;
1717
+ $[85] !== valueProp ? (t30 = () => {
1518
1718
  if (valueProp !== valuePropRef.current) {
1519
1719
  valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
1520
1720
  type: "value/change",
@@ -1526,14 +1726,19 @@ function Autocomplete(props) {
1526
1726
  type: "value/change",
1527
1727
  value: valueProp || null
1528
1728
  }));
1529
- }, [valueProp]), useEffect(() => {
1729
+ }, t31 = [valueProp], $[85] = valueProp, $[86] = t30, $[87] = t31) : (t30 = $[86], t31 = $[87]), useEffect(t30, t31);
1730
+ let t32, t33;
1731
+ $[88] !== focused ? (t32 = () => {
1530
1732
  !focused && valueRef.current && dispatch({
1531
1733
  type: "root/setActiveValue",
1532
1734
  value: valueRef.current
1533
1735
  });
1534
- }, [focused]), useEffect(() => {
1736
+ }, t33 = [focused], $[88] = focused, $[89] = t32, $[90] = t33) : (t32 = $[89], t33 = $[90]), useEffect(t32, t33);
1737
+ let t34, t35;
1738
+ $[91] !== activeValue || $[92] !== filteredOptions ? (t34 = () => {
1535
1739
  const listElement = listBoxElementRef.current;
1536
- if (!listElement) return;
1740
+ if (!listElement)
1741
+ return;
1537
1742
  const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
1538
1743
  if (activeOption_1) {
1539
1744
  const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
@@ -1543,41 +1748,128 @@ function Autocomplete(props) {
1543
1748
  focusFirstDescendant(activeItemElement);
1544
1749
  }
1545
1750
  }
1546
- }, [activeValue, filteredOptions]);
1547
- const clearButton = useMemo(() => {
1548
- if (!loading && !disabled && value)
1549
- return {
1751
+ }, t35 = [activeValue, filteredOptions], $[91] = activeValue, $[92] = filteredOptions, $[93] = t34, $[94] = t35) : (t34 = $[93], t35 = $[94]), useEffect(t34, t35);
1752
+ let t36;
1753
+ bb0: {
1754
+ if (!loading && !disabled && value) {
1755
+ let t372;
1756
+ $[95] === Symbol.for("react.memo_cache_sentinel") ? (t372 = {
1550
1757
  "aria-label": "Clear",
1551
1758
  onFocus: handleClearButtonFocus
1552
- };
1553
- }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = useMemo(() => Object.fromEntries(Object.entries(padding).map(([key2, value_1]) => value_1 === 0 ? [key2, 0] : value_1 === 1 ? [key2, 1] : value_1 === 2 ? [key2, 1] : [key2, value_1 - 2])), [padding]), openButtonPadding = useMemo(() => Object.values(padding).map((v_0) => Math.max(v_0 - 1, 0)), [padding]), openButtonProps = useMemo(() => typeof openButton == "object" ? openButton : EMPTY_RECORD, [openButton]), handleOpenClick = useCallback((event_4) => {
1554
- dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
1555
- }, [openButtonProps, dispatchOpen]), openButtonNode = useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsx(TextInput, { ...rest, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", as, border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = useCallback((event_5) => {
1556
- event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
1557
- }, [listFocused]), content2 = useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsx(Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", gap: 1, id: listBoxId, ref: listBoxElementRef, role: "listbox", children: filteredOptions.map((option_0) => {
1558
- const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
1559
- return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
1560
- disabled: loading,
1561
- selected: active,
1562
- tabIndex: listFocused && active ? 0 : -1
1563
- }) }, option_0.value);
1564
- }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = useMemo(() => renderPopover ? renderPopover({
1759
+ }, $[95] = t372) : t372 = $[95], t36 = t372;
1760
+ break bb0;
1761
+ }
1762
+ t36 = void 0;
1763
+ }
1764
+ const clearButton = t36;
1765
+ let t37;
1766
+ $[96] !== padding ? (t37 = Object.fromEntries(Object.entries(padding).map(_temp$9)), $[96] = padding, $[97] = t37) : t37 = $[97];
1767
+ const openButtonBoxPadding = t37;
1768
+ let t38;
1769
+ $[98] !== padding ? (t38 = Object.values(padding).map(_temp2$1), $[98] = padding, $[99] = t38) : t38 = $[99];
1770
+ const openButtonPadding = t38, openButtonProps = typeof openButton == "object" ? openButton : EMPTY_RECORD;
1771
+ let t39;
1772
+ $[100] !== dispatchOpen || $[101] !== openButtonProps ? (t39 = (event_4) => {
1773
+ dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
1774
+ }, $[100] = dispatchOpen, $[101] = openButtonProps, $[102] = t39) : t39 = $[102];
1775
+ const handleOpenClick = t39;
1776
+ let t40;
1777
+ $[103] !== disabled || $[104] !== expanded || $[105] !== fontSize || $[106] !== handleOpenClick || $[107] !== openButton || $[108] !== openButtonBoxPadding || $[109] !== openButtonPadding || $[110] !== openButtonProps || $[111] !== readOnly ? (t40 = !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, $[103] = disabled, $[104] = expanded, $[105] = fontSize, $[106] = handleOpenClick, $[107] = openButton, $[108] = openButtonBoxPadding, $[109] = openButtonPadding, $[110] = openButtonProps, $[111] = readOnly, $[112] = t40) : t40 = $[112];
1778
+ const openButtonNode = t40;
1779
+ let t41;
1780
+ bb1: {
1781
+ if (query === null) {
1782
+ if (value !== null) {
1783
+ let t422;
1784
+ $[113] !== currentOption || $[114] !== renderValue || $[115] !== value ? (t422 = renderValue(value, currentOption), $[113] = currentOption, $[114] = renderValue, $[115] = value, $[116] = t422) : t422 = $[116], t41 = t422;
1785
+ break bb1;
1786
+ }
1787
+ t41 = "";
1788
+ break bb1;
1789
+ }
1790
+ t41 = query;
1791
+ }
1792
+ const inputValue = t41;
1793
+ let t42;
1794
+ $[117] !== listFocused ? (t42 = (event_5) => {
1795
+ event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
1796
+ }, $[117] = listFocused, $[118] = t42) : t42 = $[118];
1797
+ const handleListBoxKeyDown = t42;
1798
+ let t43;
1799
+ bb2: {
1800
+ if (filteredOptions.length === 0) {
1801
+ t43 = null;
1802
+ break bb2;
1803
+ }
1804
+ let t442;
1805
+ if ($[119] !== activeValue || $[120] !== currentOption || $[121] !== filteredOptions || $[122] !== handleOptionSelect || $[123] !== id || $[124] !== listFocused || $[125] !== loading || $[126] !== renderOption) {
1806
+ let t453;
1807
+ $[128] !== activeValue || $[129] !== currentOption || $[130] !== handleOptionSelect || $[131] !== id || $[132] !== listFocused || $[133] !== loading || $[134] !== renderOption ? (t453 = (option_0) => {
1808
+ const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
1809
+ return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
1810
+ disabled: loading,
1811
+ selected: active,
1812
+ tabIndex: listFocused && active ? 0 : -1
1813
+ }) }, option_0.value);
1814
+ }, $[128] = activeValue, $[129] = currentOption, $[130] = handleOptionSelect, $[131] = id, $[132] = listFocused, $[133] = loading, $[134] = renderOption, $[135] = t453) : t453 = $[135], t442 = filteredOptions.map(t453), $[119] = activeValue, $[120] = currentOption, $[121] = filteredOptions, $[122] = handleOptionSelect, $[123] = id, $[124] = listFocused, $[125] = loading, $[126] = renderOption, $[127] = t442;
1815
+ } else
1816
+ t442 = $[127];
1817
+ let t452;
1818
+ $[136] !== listBoxId || $[137] !== t442 ? (t452 = /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", gap: 1, id: listBoxId, ref: listBoxElementRef, role: "listbox", children: t442 }), $[136] = listBoxId, $[137] = t442, $[138] = t452) : t452 = $[138];
1819
+ let t462;
1820
+ $[139] !== handleListBoxKeyDown || $[140] !== listBox || $[141] !== t452 ? (t462 = /* @__PURE__ */ jsx(Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: t452 }), $[139] = handleListBoxKeyDown, $[140] = listBox, $[141] = t452, $[142] = t462) : t462 = $[142], t43 = t462;
1821
+ }
1822
+ const content2 = t43;
1823
+ let t44;
1824
+ bb3: {
1825
+ if (renderPopover) {
1826
+ const t453 = !expanded;
1827
+ let t462;
1828
+ $[143] !== content2 || $[144] !== inputElement || $[145] !== renderPopover || $[146] !== t453 ? (t462 = /* @__PURE__ */ jsx(RenderPopover, { content: content2, hidden: t453, inputElement, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, resultsPopoverElementRef, renderPopover }), $[143] = content2, $[144] = inputElement, $[145] = renderPopover, $[146] = t453, $[147] = t462) : t462 = $[147], t44 = t462;
1829
+ break bb3;
1830
+ }
1831
+ if (filteredOptionsLen === 0) {
1832
+ t44 = null;
1833
+ break bb3;
1834
+ }
1835
+ let t452;
1836
+ $[148] !== content2 || $[149] !== expanded || $[150] !== inputElement || $[151] !== popover2 ? (t452 = /* @__PURE__ */ jsx(Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius: 3, ref: resultsPopoverElementRef, referenceElement: inputElement, ...popover2 }), $[148] = content2, $[149] = expanded, $[150] = inputElement, $[151] = popover2, $[152] = t452) : t452 = $[152], t44 = t452;
1837
+ }
1838
+ const results = t44, t45 = loading && AnimatedSpinnerIcon, t46 = suffix || openButtonNode;
1839
+ let t47;
1840
+ $[153] !== activeItemId || $[154] !== as || $[155] !== border || $[156] !== clearButton || $[157] !== customValidity || $[158] !== disabled || $[159] !== expanded || $[160] !== fontSize || $[161] !== handleClearButtonClick || $[162] !== handleInputChange || $[163] !== handleInputFocus || $[164] !== icon || $[165] !== id || $[166] !== inputValue || $[167] !== listBoxId || $[168] !== padding || $[169] !== prefix || $[170] !== radius || $[171] !== readOnly || $[172] !== rest || $[173] !== t45 || $[174] !== t46 ? (t47 = /* @__PURE__ */ jsx(TextInput, { ...rest, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", as, border, clearButton, customValidity, disabled, fontSize, icon, iconRight: t45, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: t46, value: inputValue }), $[153] = activeItemId, $[154] = as, $[155] = border, $[156] = clearButton, $[157] = customValidity, $[158] = disabled, $[159] = expanded, $[160] = fontSize, $[161] = handleClearButtonClick, $[162] = handleInputChange, $[163] = handleInputFocus, $[164] = icon, $[165] = id, $[166] = inputValue, $[167] = listBoxId, $[168] = padding, $[169] = prefix, $[170] = radius, $[171] = readOnly, $[172] = rest, $[173] = t45, $[174] = t46, $[175] = t47) : t47 = $[175];
1841
+ let t48;
1842
+ return $[176] !== handleRootBlur || $[177] !== handleRootKeyDown || $[178] !== results || $[179] !== t47 ? (t48 = /* @__PURE__ */ jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
1843
+ t47,
1844
+ results
1845
+ ] }), $[176] = handleRootBlur, $[177] = handleRootKeyDown, $[178] = results, $[179] = t47, $[180] = t48) : t48 = $[180], t48;
1846
+ }
1847
+ function _temp2$1(v_0) {
1848
+ return Math.max(v_0 - 1, 0);
1849
+ }
1850
+ function _temp$9(t0) {
1851
+ const [key2, value_1] = t0;
1852
+ return value_1 === 0 ? [key2, 0] : value_1 === 1 ? [key2, 1] : value_1 === 2 ? [key2, 1] : [key2, value_1 - 2];
1853
+ }
1854
+ function RenderPopover({
1855
+ renderPopover,
1856
+ content: content2,
1857
+ hidden,
1858
+ inputElement,
1859
+ onMouseEnter,
1860
+ onMouseLeave,
1861
+ resultsPopoverElementRef
1862
+ }) {
1863
+ return renderPopover({
1565
1864
  content: content2,
1566
- hidden: !expanded,
1567
- inputElement: inputElementRef.current,
1568
- onMouseEnter: handlePopoverMouseEnter,
1569
- onMouseLeave: handlePopoverMouseLeave
1570
- }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsx(Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius: 3, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover2 }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover2, renderPopover]);
1571
- return (
1572
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
1573
- /* @__PURE__ */ jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
1574
- input,
1575
- results
1576
- ] })
1577
- );
1865
+ hidden,
1866
+ inputElement,
1867
+ onMouseEnter,
1868
+ onMouseLeave
1869
+ }, resultsPopoverElementRef);
1578
1870
  }
1579
1871
  function useClickOutsideEvent(listener, t0, boundaryElement) {
1580
- const $ = c(9), elementsArg = t0 === void 0 ? _temp$7 : t0;
1872
+ const $ = c(9), elementsArg = t0 === void 0 ? _temp$8 : t0;
1581
1873
  let t1;
1582
1874
  $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
1583
1875
  if (!listener)
@@ -1607,38 +1899,97 @@ function useClickOutsideEvent(listener, t0, boundaryElement) {
1607
1899
  let t3;
1608
1900
  $[7] !== hasListener ? (t3 = [hasListener], $[7] = hasListener, $[8] = t3) : t3 = $[8], useEffect(t2, t3), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
1609
1901
  }
1610
- function _temp$7() {
1902
+ function _temp$8() {
1611
1903
  return EMPTY_ARRAY;
1612
1904
  }
1613
1905
  const DEFAULT_BREADCRUMBS_ELEMENT = "nav";
1614
1906
  function Breadcrumbs(props) {
1615
- const {
1616
- as = DEFAULT_BREADCRUMBS_ELEMENT,
1907
+ const $ = c(37), t0 = props;
1908
+ let children, className, expandButtonProps, maxLength, rest, separator, t1, t2, t3, t4;
1909
+ $[0] !== t0 ? ({
1910
+ as: t1,
1617
1911
  children,
1618
1912
  className,
1619
1913
  expandButton: expandButtonProps,
1620
- gap = 2,
1621
- gapX,
1622
- gapY,
1914
+ gap: t2,
1915
+ gapX: t3,
1916
+ gapY: t4,
1623
1917
  maxLength,
1624
1918
  separator,
1625
1919
  ...rest
1626
- } = props, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
1627
- useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
1628
- const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
1629
- const len = rawItems.length;
1630
- if (maxLength && len > maxLength) {
1631
- const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
1632
- return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsx(Popover, { constrainSize: !0, content: /* @__PURE__ */ jsx(Stack, { as: "ol", gap: gapY, overflow: "auto", children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, padding: 2, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsx(Button, { mode: "bleed", padding: 0, text: "\u2026", ...expandButtonProps, onClick: open ? collapse : expand, ref: expandElementRef, selected: open }) }, "button"), ...rawItems.slice(len - afterLength)];
1633
- }
1634
- return rawItems;
1635
- }, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
1636
- return /* @__PURE__ */ jsx(Flex, { as, "data-ui": "Breadcrumbs", ...rest, className: breadcrumbs({
1920
+ } = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = expandButtonProps, $[4] = maxLength, $[5] = rest, $[6] = separator, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4) : (children = $[1], className = $[2], expandButtonProps = $[3], maxLength = $[4], rest = $[5], separator = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10]);
1921
+ const as = t1 === void 0 ? DEFAULT_BREADCRUMBS_ELEMENT : t1, gap = t2 === void 0 ? 2 : t2, gapX = t3 === void 0 ? gap : t3, gapY = t4 === void 0 ? gap : t4, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null);
1922
+ let t5;
1923
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => setOpen(!1), $[11] = t5) : t5 = $[11];
1924
+ const collapse = t5;
1925
+ let t6;
1926
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => setOpen(!0), $[12] = t6) : t6 = $[12];
1927
+ const expand = t6;
1928
+ let t7;
1929
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [expandElementRef.current, popoverElementRef.current], $[13] = t7) : t7 = $[13], useClickOutsideEvent(collapse, t7);
1930
+ let t8;
1931
+ $[14] !== children ? (t8 = Children.toArray(children).filter(isValidElement), $[14] = children, $[15] = t8) : t8 = $[15];
1932
+ const rawItems = t8;
1933
+ let t9;
1934
+ $[16] !== expandButtonProps || $[17] !== gapY || $[18] !== maxLength || $[19] !== open || $[20] !== rawItems ? (t9 = {
1935
+ collapse,
1936
+ expand,
1937
+ expandElementRef,
1938
+ maxLength,
1939
+ open,
1940
+ popoverElementRef,
1941
+ rawItems,
1942
+ gapY,
1943
+ expandButtonProps
1944
+ }, $[16] = expandButtonProps, $[17] = gapY, $[18] = maxLength, $[19] = open, $[20] = rawItems, $[21] = t9) : t9 = $[21];
1945
+ const items = useItems(t9);
1946
+ let t10;
1947
+ $[22] !== className ? (t10 = breadcrumbs({
1637
1948
  className
1638
- }), gap, gapX, gapY, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
1639
- itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
1640
- /* @__PURE__ */ jsx(Box, { as: "li", children: item })
1641
- ] }, itemIndex)) });
1949
+ }), $[22] = className, $[23] = t10) : t10 = $[23];
1950
+ let t11;
1951
+ if ($[24] !== items || $[25] !== separator) {
1952
+ let t122;
1953
+ $[27] !== separator ? (t122 = (item, itemIndex) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
1954
+ itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
1955
+ /* @__PURE__ */ jsx(Box, { as: "li", children: item })
1956
+ ] }, itemIndex), $[27] = separator, $[28] = t122) : t122 = $[28], t11 = items.map(t122), $[24] = items, $[25] = separator, $[26] = t11;
1957
+ } else
1958
+ t11 = $[26];
1959
+ let t12;
1960
+ return $[29] !== as || $[30] !== gap || $[31] !== gapX || $[32] !== gapY || $[33] !== rest || $[34] !== t10 || $[35] !== t11 ? (t12 = /* @__PURE__ */ jsx(Flex, { as, "data-ui": "Breadcrumbs", ...rest, className: t10, gap, gapX, gapY, children: t11 }), $[29] = as, $[30] = gap, $[31] = gapX, $[32] = gapY, $[33] = rest, $[34] = t10, $[35] = t11, $[36] = t12) : t12 = $[36], t12;
1961
+ }
1962
+ function useItems(t0) {
1963
+ const $ = c(30), {
1964
+ collapse,
1965
+ expand,
1966
+ expandElementRef,
1967
+ maxLength,
1968
+ open,
1969
+ popoverElementRef,
1970
+ rawItems,
1971
+ gapY,
1972
+ expandButtonProps
1973
+ } = t0, len = rawItems.length;
1974
+ if (maxLength && len > maxLength) {
1975
+ const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
1976
+ let t1;
1977
+ if ($[0] !== afterLength || $[1] !== beforeLength || $[2] !== collapse || $[3] !== expand || $[4] !== expandButtonProps || $[5] !== expandElementRef || $[6] !== gapY || $[7] !== len || $[8] !== open || $[9] !== popoverElementRef || $[10] !== rawItems) {
1978
+ const t2 = rawItems.slice(0, beforeLength - 1);
1979
+ let t3;
1980
+ $[12] !== afterLength || $[13] !== beforeLength || $[14] !== len || $[15] !== rawItems ? (t3 = rawItems.slice(beforeLength - 1, len - afterLength), $[12] = afterLength, $[13] = beforeLength, $[14] = len, $[15] = rawItems, $[16] = t3) : t3 = $[16];
1981
+ let t4;
1982
+ $[17] !== gapY || $[18] !== t3 ? (t4 = /* @__PURE__ */ jsx(Stack, { as: "ol", gap: gapY, overflow: "auto", children: t3 }), $[17] = gapY, $[18] = t3, $[19] = t4) : t4 = $[19];
1983
+ const t5 = open ? collapse : expand;
1984
+ let t6;
1985
+ $[20] !== expandButtonProps || $[21] !== expandElementRef || $[22] !== open || $[23] !== t5 ? (t6 = /* @__PURE__ */ jsx(Button, { mode: "bleed", padding: 0, text: "\u2026", ...expandButtonProps, onClick: t5, ref: expandElementRef, selected: open }), $[20] = expandButtonProps, $[21] = expandElementRef, $[22] = open, $[23] = t5, $[24] = t6) : t6 = $[24];
1986
+ let t7;
1987
+ $[25] !== open || $[26] !== popoverElementRef || $[27] !== t4 || $[28] !== t6 ? (t7 = /* @__PURE__ */ jsx(Popover, { constrainSize: !0, content: t4, open, padding: 2, placement: "top", portal: !0, ref: popoverElementRef, children: t6 }, "button"), $[25] = open, $[26] = popoverElementRef, $[27] = t4, $[28] = t6, $[29] = t7) : t7 = $[29], t1 = [...t2, t7, ...rawItems.slice(len - afterLength)], $[0] = afterLength, $[1] = beforeLength, $[2] = collapse, $[3] = expand, $[4] = expandButtonProps, $[5] = expandElementRef, $[6] = gapY, $[7] = len, $[8] = open, $[9] = popoverElementRef, $[10] = rawItems, $[11] = t1;
1988
+ } else
1989
+ t1 = $[11];
1990
+ return t1;
1991
+ }
1992
+ return rawItems;
1642
1993
  }
1643
1994
  const DEFAULT_CONTAINER_ELEMENT = "div";
1644
1995
  function Container(props) {
@@ -1659,18 +2010,18 @@ function Container(props) {
1659
2010
  let t4;
1660
2011
  return $[8] !== as || $[9] !== rest || $[10] !== t3 ? (t4 = /* @__PURE__ */ jsx(Box, { "data-ui": "Container", ...rest, as, className: t3 }), $[8] = as, $[9] = rest, $[10] = t3, $[11] = t4) : t4 = $[11], t4;
1661
2012
  }
1662
- function useGlobalKeyDown(onKeyDown) {
1663
- const $ = c(5);
2013
+ function useGlobalKeyDown(onKeyDown, options) {
2014
+ const $ = c(7);
1664
2015
  let t0;
1665
2016
  $[0] !== onKeyDown ? (t0 = (event) => onKeyDown(event), $[0] = onKeyDown, $[1] = t0) : t0 = $[1];
1666
2017
  const handleKeyDown = useEffectEvent(t0);
1667
2018
  let t1;
1668
- $[2] !== handleKeyDown ? (t1 = () => {
2019
+ $[2] !== handleKeyDown || $[3] !== options ? (t1 = () => {
1669
2020
  const handler = (event_0) => handleKeyDown(event_0);
1670
- return window.addEventListener("keydown", handler), () => window.removeEventListener("keydown", handler);
1671
- }, $[2] = handleKeyDown, $[3] = t1) : t1 = $[3];
2021
+ return window.addEventListener("keydown", handler, options), () => window.removeEventListener("keydown", handler, options);
2022
+ }, $[2] = handleKeyDown, $[3] = options, $[4] = t1) : t1 = $[4];
1672
2023
  let t2;
1673
- $[4] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[4] = t2) : t2 = $[4], useEffect(t1, t2);
2024
+ $[5] !== options ? (t2 = [options], $[5] = options, $[6] = t2) : t2 = $[6], useEffect(t1, t2);
1674
2025
  }
1675
2026
  function isTargetWithinScope(boundaryElement, portalElement, target) {
1676
2027
  return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
@@ -1694,9 +2045,9 @@ function DialogCard(props) {
1694
2045
  ref: forwardedRef,
1695
2046
  ...rest
1696
2047
  } = t0, $[0] = t0, $[1] = autoFocus, $[2] = children, $[3] = footer, $[4] = forwardedContentRef, $[5] = forwardedRef, $[6] = header, $[7] = hideCloseButton, $[8] = id, $[9] = onClickOutside, $[10] = onClose, $[11] = portalProp, $[12] = rest, $[13] = t1) : (autoFocus = $[1], children = $[2], footer = $[3], forwardedContentRef = $[4], forwardedRef = $[5], header = $[6], hideCloseButton = $[7], id = $[8], onClickOutside = $[9], onClose = $[10], portalProp = $[11], rest = $[12], t1 = $[13]);
1697
- const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
2048
+ const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = use(BoundaryElementContext), ref = useRef(null), contentRef = useRef(null), {
1698
2049
  isTopLayer
1699
- } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton, [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), scrollBottom = scrollHeight - scrollTop;
2050
+ } = useLayer(), labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton, [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), scrollBottom = scrollHeight - scrollTop;
1700
2051
  let t2;
1701
2052
  $[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], useImperativeHandle(forwardedRef, t2);
1702
2053
  let t3;
@@ -1769,15 +2120,15 @@ function DialogCard(props) {
1769
2120
  t19
1770
2121
  ] }), $[55] = as, $[56] = rest, $[57] = t12, $[58] = t18, $[59] = t19, $[60] = t20) : t20 = $[60], t20;
1771
2122
  }
1772
- const DialogContext = createGlobalScopedContext("@sanity/ui/v3/dialog", {
2123
+ const DialogContext = createGlobalScopedContext("@sanity/ui/v4/dialog", {
1773
2124
  version: 0
1774
2125
  });
1775
2126
  function useDialog() {
1776
- return useContext(DialogContext);
2127
+ return use(DialogContext);
1777
2128
  }
1778
2129
  const DEFAULT_DIALOG_ELEMENT = "div";
1779
2130
  function Dialog(props) {
1780
- const $ = c(69), context = useDialog(), t0 = props;
2131
+ const $ = c(75), context = useDialog(), t0 = props;
1781
2132
  let _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, tone;
1782
2133
  $[0] !== t0 ? ({
1783
2134
  __unstable_autoFocus: t1,
@@ -1804,9 +2155,18 @@ function Dialog(props) {
1804
2155
  tone,
1805
2156
  ...rest
1806
2157
  } = t0, $[0] = t0, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = className, $[5] = contentRef, $[6] = footer, $[7] = header, $[8] = id, $[9] = onActivate, $[10] = onClickOutside, $[11] = onClose, $[12] = onFocus, $[13] = portalProp, $[14] = rest, $[15] = scheme, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = tone) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], className = $[4], contentRef = $[5], footer = $[6], header = $[7], id = $[8], onActivate = $[9], onClickOutside = $[10], onClose = $[11], onFocus = $[12], portalProp = $[13], rest = $[14], scheme = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21], t7 = $[22], tone = $[23]);
1807
- const autoFocus = t1 === void 0 ? !0 : t1, hideCloseButton = t2 === void 0 ? !1 : t2, _animate = t3 === void 0 ? !1 : t3, cardRadiusProp = t4 === void 0 ? 4 : t4, padding = t5 === void 0 ? 3 : t5, cardShadow = t6 === void 0 ? 4 : t6, width = t7 === void 0 ? 0 : t7, positionProp = _positionProp ?? context.position ?? "fixed", zOffsetProp = _zOffsetProp ?? context.zOffset ?? Z_OFFSETS.dialog, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useResponsiveProp(cardRadiusProp), position = useResponsiveProp(positionProp), zOffset = useResponsiveProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
2158
+ const autoFocus = t1 === void 0 ? !0 : t1, hideCloseButton = t2 === void 0 ? !1 : t2, _animate = t3 === void 0 ? !1 : t3, cardRadiusProp = t4 === void 0 ? 4 : t4, padding = t5 === void 0 ? 3 : t5, cardShadow = t6 === void 0 ? 4 : t6, width = t7 === void 0 ? 0 : t7, positionProp = _positionProp ?? context.position ?? "fixed", zOffsetProp = _zOffsetProp ?? context.zOffset ?? Z_OFFSETS.dialog, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = use(BoundaryElementContext);
1808
2159
  let t8;
1809
- $[24] !== onFocus ? (t8 = (event) => {
2160
+ $[24] !== cardRadiusProp ? (t8 = _getResponsiveProp(cardRadiusProp), $[24] = cardRadiusProp, $[25] = t8) : t8 = $[25];
2161
+ const cardRadius = t8;
2162
+ let t9;
2163
+ $[26] !== positionProp ? (t9 = _getResponsiveProp(positionProp), $[26] = positionProp, $[27] = t9) : t9 = $[27];
2164
+ const position = t9;
2165
+ let t10;
2166
+ $[28] !== zOffsetProp ? (t10 = _getResponsiveProp(zOffsetProp), $[28] = zOffsetProp, $[29] = t10) : t10 = $[29];
2167
+ const zOffset = t10, preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
2168
+ let t11;
2169
+ $[30] !== onFocus ? (t11 = (event) => {
1810
2170
  onFocus?.(event);
1811
2171
  const target = event.target, cardElement = cardRef.current;
1812
2172
  if (cardElement && target === preDivRef.current) {
@@ -1818,10 +2178,10 @@ function Dialog(props) {
1818
2178
  return;
1819
2179
  }
1820
2180
  isHTMLElement(event.target) && (focusedElementRef.current = event.target);
1821
- }, $[24] = onFocus, $[25] = t8) : t8 = $[25];
1822
- const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
1823
- let t9;
1824
- $[26] !== boundaryElement || $[27] !== portalElement ? (t9 = () => {
2181
+ }, $[30] = onFocus, $[31] = t11) : t11 = $[31];
2182
+ const handleFocus = t11, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
2183
+ let t12;
2184
+ $[32] !== boundaryElement || $[33] !== portalElement ? (t12 = () => {
1825
2185
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
1826
2186
  const activeElement = document.activeElement;
1827
2187
  if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
@@ -1834,31 +2194,31 @@ function Dialog(props) {
1834
2194
  target_0.focus();
1835
2195
  }
1836
2196
  }, 0);
1837
- }, $[26] = boundaryElement, $[27] = portalElement, $[28] = t9) : t9 = $[28];
1838
- const handleRootClick = t9;
1839
- let t10;
1840
- $[29] !== className ? (t10 = dialog({
1841
- className
1842
- }), $[29] = className, $[30] = t10) : t10 = $[30];
1843
- const t11 = animate ? "" : void 0;
1844
- let t12;
1845
- $[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
2197
+ }, $[32] = boundaryElement, $[33] = portalElement, $[34] = t12) : t12 = $[34];
2198
+ const handleRootClick = t12;
1846
2199
  let t13;
1847
- $[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 = dialogContainer(), $[32] = t13) : t13 = $[32];
1848
- let t14;
1849
- $[33] !== autoFocus || $[34] !== cardRadius || $[35] !== cardShadow || $[36] !== children || $[37] !== contentRef || $[38] !== footer || $[39] !== header || $[40] !== hideCloseButton || $[41] !== id || $[42] !== onClickOutside || $[43] !== onClose || $[44] !== portalProp || $[45] !== scheme || $[46] !== tone || $[47] !== width ? (t14 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[33] = autoFocus, $[34] = cardRadius, $[35] = cardShadow, $[36] = children, $[37] = contentRef, $[38] = footer, $[39] = header, $[40] = hideCloseButton, $[41] = id, $[42] = onClickOutside, $[43] = onClose, $[44] = portalProp, $[45] = scheme, $[46] = tone, $[47] = width, $[48] = t14) : t14 = $[48];
2200
+ $[35] !== className ? (t13 = dialog({
2201
+ className
2202
+ }), $[35] = className, $[36] = t13) : t13 = $[36];
2203
+ const t14 = animate ? "" : void 0;
1850
2204
  let t15;
1851
- $[49] !== t14 || $[50] !== width ? (t15 = /* @__PURE__ */ jsx(Container, { alignItems: "center", className: t13, "data-ui": "DialogCard", flexDirection: "column", display: "flex", justifyContent: "center", width, children: t14 }), $[49] = t14, $[50] = width, $[51] = t15) : t15 = $[51];
2205
+ $[37] === Symbol.for("react.memo_cache_sentinel") ? (t15 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[37] = t15) : t15 = $[37];
1852
2206
  let t16;
1853
- $[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[52] = t16) : t16 = $[52];
2207
+ $[38] === Symbol.for("react.memo_cache_sentinel") ? (t16 = dialogContainer(), $[38] = t16) : t16 = $[38];
1854
2208
  let t17;
1855
- $[53] !== handleFocus || $[54] !== handleRootClick || $[55] !== id || $[56] !== labelId || $[57] !== onActivate || $[58] !== padding || $[59] !== position || $[60] !== rest || $[61] !== t10 || $[62] !== t11 || $[63] !== t15 || $[64] !== zOffset ? (t17 = /* @__PURE__ */ jsxs(Layer, { ...rest, "aria-labelledby": labelId, "aria-modal": !0, className: t10, "data-animate": t11, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, role: "dialog", zOffset, children: [
1856
- t12,
1857
- t15,
1858
- t16
1859
- ] }), $[53] = handleFocus, $[54] = handleRootClick, $[55] = id, $[56] = labelId, $[57] = onActivate, $[58] = padding, $[59] = position, $[60] = rest, $[61] = t10, $[62] = t11, $[63] = t15, $[64] = zOffset, $[65] = t17) : t17 = $[65];
2209
+ $[39] !== autoFocus || $[40] !== cardRadius || $[41] !== cardShadow || $[42] !== children || $[43] !== contentRef || $[44] !== footer || $[45] !== header || $[46] !== hideCloseButton || $[47] !== id || $[48] !== onClickOutside || $[49] !== onClose || $[50] !== portalProp || $[51] !== scheme || $[52] !== tone || $[53] !== width ? (t17 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[39] = autoFocus, $[40] = cardRadius, $[41] = cardShadow, $[42] = children, $[43] = contentRef, $[44] = footer, $[45] = header, $[46] = hideCloseButton, $[47] = id, $[48] = onClickOutside, $[49] = onClose, $[50] = portalProp, $[51] = scheme, $[52] = tone, $[53] = width, $[54] = t17) : t17 = $[54];
1860
2210
  let t18;
1861
- return $[66] !== portalProp || $[67] !== t17 ? (t18 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t17 }), $[66] = portalProp, $[67] = t17, $[68] = t18) : t18 = $[68], t18;
2211
+ $[55] !== t17 || $[56] !== width ? (t18 = /* @__PURE__ */ jsx(Container, { alignItems: "center", className: t16, "data-ui": "DialogCard", flexDirection: "column", display: "flex", justifyContent: "center", width, children: t17 }), $[55] = t17, $[56] = width, $[57] = t18) : t18 = $[57];
2212
+ let t19;
2213
+ $[58] === Symbol.for("react.memo_cache_sentinel") ? (t19 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[58] = t19) : t19 = $[58];
2214
+ let t20;
2215
+ $[59] !== handleFocus || $[60] !== handleRootClick || $[61] !== id || $[62] !== labelId || $[63] !== onActivate || $[64] !== padding || $[65] !== position || $[66] !== rest || $[67] !== t13 || $[68] !== t14 || $[69] !== t18 || $[70] !== zOffset ? (t20 = /* @__PURE__ */ jsxs(Layer, { ...rest, "aria-labelledby": labelId, "aria-modal": !0, className: t13, "data-animate": t14, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, role: "dialog", zOffset, children: [
2216
+ t15,
2217
+ t18,
2218
+ t19
2219
+ ] }), $[59] = handleFocus, $[60] = handleRootClick, $[61] = id, $[62] = labelId, $[63] = onActivate, $[64] = padding, $[65] = position, $[66] = rest, $[67] = t13, $[68] = t14, $[69] = t18, $[70] = zOffset, $[71] = t20) : t20 = $[71];
2220
+ let t21;
2221
+ return $[72] !== portalProp || $[73] !== t20 ? (t21 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t20 }), $[72] = portalProp, $[73] = t20, $[74] = t21) : t21 = $[74], t21;
1862
2222
  }
1863
2223
  function DialogProvider(props) {
1864
2224
  const $ = c(6), {
@@ -1866,15 +2226,15 @@ function DialogProvider(props) {
1866
2226
  position,
1867
2227
  zOffset
1868
2228
  } = props;
1869
- let t0, t1;
1870
- $[0] !== position || $[1] !== zOffset ? (t1 = {
2229
+ let t0;
2230
+ $[0] !== position || $[1] !== zOffset ? (t0 = {
1871
2231
  version: 0,
1872
2232
  position,
1873
2233
  zOffset
1874
- }, $[0] = position, $[1] = zOffset, $[2] = t1) : t1 = $[2], t0 = t1;
2234
+ }, $[0] = position, $[1] = zOffset, $[2] = t0) : t0 = $[2];
1875
2235
  const contextValue = t0;
1876
- let t2;
1877
- return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
2236
+ let t1;
2237
+ return $[3] !== children || $[4] !== contextValue ? (t1 = /* @__PURE__ */ jsx(DialogContext, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t1) : t1 = $[5], t1;
1878
2238
  }
1879
2239
  const DEFAULT_KBD_ELEMENT = "kbd";
1880
2240
  function KBD(props) {
@@ -1928,7 +2288,7 @@ function Hotkeys(props) {
1928
2288
  let t4;
1929
2289
  return $[19] !== as || $[20] !== gap || $[21] !== gapX || $[22] !== gapY || $[23] !== rest || $[24] !== t3 ? (t4 = /* @__PURE__ */ jsx(Box, { as, "data-ui": "Hotkeys", ...rest, display: "flex", gap, gapX, gapY, children: t3 }), $[19] = as, $[20] = gap, $[21] = gapX, $[22] = gapY, $[23] = rest, $[24] = t3, $[25] = t4) : t4 = $[25], t4;
1930
2290
  }
1931
- const MenuContext = createGlobalScopedContext("@sanity/ui/v3/menu", null);
2291
+ const MenuContext = createGlobalScopedContext("@sanity/ui/v4/menu", null);
1932
2292
  function _isFocusable(element) {
1933
2293
  return isHTMLAnchorElement(element) && element.getAttribute("data-disabled") !== "true" || isHTMLButtonElement(element) && !element.disabled;
1934
2294
  }
@@ -1966,16 +2326,24 @@ function _sortElements(rootElement, elements) {
1966
2326
  elements.sort(_sort);
1967
2327
  }
1968
2328
  function useMenuController(props) {
1969
- const {
2329
+ const $ = c(21), {
1970
2330
  onKeyDown,
1971
2331
  originElement,
1972
2332
  shouldFocus,
1973
2333
  rootElementRef
1974
- } = props, elementsRef = useRef([]), [activeIndex, _setActiveIndex] = useState(-1), activeIndexRef = useRef(activeIndex), activeElement = useMemo(() => elementsRef.current[activeIndex] || null, [activeIndex]), mounted = !!rootElementRef.current, setActiveIndex = useCallback((nextActiveIndex) => {
1975
- _setActiveIndex(nextActiveIndex), activeIndexRef.current = nextActiveIndex;
1976
- }, []), mount = useCallback((element, selected) => {
1977
- if (!element) return () => {
1978
- };
2334
+ } = props;
2335
+ let t0;
2336
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = [], $[0] = t0) : t0 = $[0];
2337
+ const elementsRef = useRef(t0), [activeIndex, _setActiveIndex] = useState(-1), activeIndexRef = useRef(activeIndex), [activeElement, setActiveElement] = useState(null);
2338
+ let t1;
2339
+ $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = (nextActiveIndex) => {
2340
+ _setActiveIndex(nextActiveIndex), activeIndexRef.current = nextActiveIndex, setActiveElement(elementsRef.current[nextActiveIndex] || null);
2341
+ }, $[1] = t1) : t1 = $[1];
2342
+ const setActiveIndex = t1;
2343
+ let t2;
2344
+ $[2] !== rootElementRef ? (t2 = (element, selected) => {
2345
+ if (!element)
2346
+ return _temp$7;
1979
2347
  if (elementsRef.current.indexOf(element) === -1 && (elementsRef.current.push(element), _sortElements(rootElementRef.current, elementsRef.current)), selected) {
1980
2348
  const selectedIndex = elementsRef.current.indexOf(element);
1981
2349
  setActiveIndex(selectedIndex);
@@ -1984,7 +2352,10 @@ function useMenuController(props) {
1984
2352
  const idx = elementsRef.current.indexOf(element);
1985
2353
  idx > -1 && elementsRef.current.splice(idx, 1);
1986
2354
  };
1987
- }, [rootElementRef, setActiveIndex]), handleKeyDown = useCallback((event) => {
2355
+ }, $[2] = rootElementRef, $[3] = t2) : t2 = $[3];
2356
+ const mount = t2;
2357
+ let t3;
2358
+ $[4] !== onKeyDown || $[5] !== originElement ? (t3 = (event) => {
1988
2359
  if (event.key === "Tab") {
1989
2360
  originElement && originElement.focus();
1990
2361
  return;
@@ -1992,7 +2363,8 @@ function useMenuController(props) {
1992
2363
  if (event.key === "Home") {
1993
2364
  event.preventDefault(), event.stopPropagation();
1994
2365
  const el = _getFocusableElements(elementsRef.current)[0];
1995
- if (!el) return;
2366
+ if (!el)
2367
+ return;
1996
2368
  const currentIndex = elementsRef.current.indexOf(el);
1997
2369
  setActiveIndex(currentIndex);
1998
2370
  return;
@@ -2000,7 +2372,8 @@ function useMenuController(props) {
2000
2372
  if (event.key === "End") {
2001
2373
  event.preventDefault(), event.stopPropagation();
2002
2374
  const focusableElements_0 = _getFocusableElements(elementsRef.current), el_0 = focusableElements_0[focusableElements_0.length - 1];
2003
- if (!el_0) return;
2375
+ if (!el_0)
2376
+ return;
2004
2377
  const currentIndex_0 = elementsRef.current.indexOf(el_0);
2005
2378
  setActiveIndex(currentIndex_0);
2006
2379
  return;
@@ -2008,7 +2381,8 @@ function useMenuController(props) {
2008
2381
  if (event.key === "ArrowUp") {
2009
2382
  event.preventDefault(), event.stopPropagation();
2010
2383
  const focusableElements_1 = _getFocusableElements(elementsRef.current), focusableLen = focusableElements_1.length;
2011
- if (focusableLen === 0) return;
2384
+ if (focusableLen === 0)
2385
+ return;
2012
2386
  const focusedElement = elementsRef.current[activeIndexRef.current];
2013
2387
  let focusedIndex = focusableElements_1.indexOf(focusedElement);
2014
2388
  focusedIndex = (focusedIndex - 1 + focusableLen) % focusableLen;
@@ -2019,7 +2393,8 @@ function useMenuController(props) {
2019
2393
  if (event.key === "ArrowDown") {
2020
2394
  event.preventDefault(), event.stopPropagation();
2021
2395
  const focusableElements_2 = _getFocusableElements(elementsRef.current), focusableLen_0 = focusableElements_2.length;
2022
- if (focusableLen_0 === 0) return;
2396
+ if (focusableLen_0 === 0)
2397
+ return;
2023
2398
  const focusedElement_0 = elementsRef.current[activeIndexRef.current];
2024
2399
  let focusedIndex_0 = focusableElements_2.indexOf(focusedElement_0);
2025
2400
  focusedIndex_0 = (focusedIndex_0 + 1) % focusableLen_0;
@@ -2028,14 +2403,23 @@ function useMenuController(props) {
2028
2403
  return;
2029
2404
  }
2030
2405
  onKeyDown && onKeyDown(event);
2031
- }, [onKeyDown, originElement, setActiveIndex]), handleItemMouseEnter = useCallback((event_0) => {
2406
+ }, $[4] = onKeyDown, $[5] = originElement, $[6] = t3) : t3 = $[6];
2407
+ const handleKeyDown = t3;
2408
+ let t4;
2409
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = (event_0) => {
2032
2410
  const element_0 = event_0.currentTarget, currentIndex_3 = elementsRef.current.indexOf(element_0);
2033
2411
  setActiveIndex(currentIndex_3);
2034
- }, [setActiveIndex]), handleItemMouseLeave = useCallback(() => {
2412
+ }, $[7] = t4) : t4 = $[7];
2413
+ const handleItemMouseEnter = t4;
2414
+ let t5;
2415
+ $[8] !== rootElementRef ? (t5 = () => {
2035
2416
  setActiveIndex(-2), rootElementRef.current?.focus();
2036
- }, [rootElementRef, setActiveIndex]);
2037
- return useEffect(() => {
2038
- if (!mounted) return;
2417
+ }, $[8] = rootElementRef, $[9] = t5) : t5 = $[9];
2418
+ const handleItemMouseLeave = t5;
2419
+ let t6, t7;
2420
+ $[10] !== activeIndex || $[11] !== rootElementRef || $[12] !== shouldFocus ? (t6 = () => {
2421
+ if (!rootElementRef.current)
2422
+ return;
2039
2423
  const rafId = requestAnimationFrame(() => {
2040
2424
  if (activeIndex === -1) {
2041
2425
  if (shouldFocus === "first") {
@@ -2057,18 +2441,22 @@ function useMenuController(props) {
2057
2441
  (elementsRef.current[activeIndex] || null)?.focus();
2058
2442
  });
2059
2443
  return () => cancelAnimationFrame(rafId);
2060
- }, [activeIndex, mounted, setActiveIndex, shouldFocus]), {
2444
+ }, t7 = [activeIndex, rootElementRef, setActiveIndex, shouldFocus], $[10] = activeIndex, $[11] = rootElementRef, $[12] = shouldFocus, $[13] = t6, $[14] = t7) : (t6 = $[13], t7 = $[14]), useEffect(t6, t7);
2445
+ let t8;
2446
+ return $[15] !== activeElement || $[16] !== activeIndex || $[17] !== handleItemMouseLeave || $[18] !== handleKeyDown || $[19] !== mount ? (t8 = {
2061
2447
  activeElement,
2062
2448
  activeIndex,
2063
2449
  handleItemMouseEnter,
2064
2450
  handleItemMouseLeave,
2065
2451
  handleKeyDown,
2066
2452
  mount
2067
- };
2453
+ }, $[15] = activeElement, $[16] = activeIndex, $[17] = handleItemMouseLeave, $[18] = handleKeyDown, $[19] = mount, $[20] = t8) : t8 = $[20], t8;
2454
+ }
2455
+ function _temp$7() {
2068
2456
  }
2069
2457
  const DEFAULT_MENU_ELEMENT = "div";
2070
2458
  function Menu(props) {
2071
- const $ = c(57), t0 = props;
2459
+ const $ = c(56), t0 = props;
2072
2460
  let _shouldFocus, children, className, forwardedRef, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, rest, t1, t2, t3;
2073
2461
  $[0] !== t0 ? ({
2074
2462
  as: t1,
@@ -2123,32 +2511,29 @@ function Menu(props) {
2123
2511
  $[28] !== isTopLayer || $[29] !== onEscape ? (t10 = (event) => {
2124
2512
  isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
2125
2513
  }, $[28] = isTopLayer, $[29] = onEscape, $[30] = t10) : t10 = $[30], useGlobalKeyDown(t10);
2126
- let t11, t12;
2127
- $[31] !== activeElement || $[32] !== activeIndex || $[33] !== handleItemMouseEnter || $[34] !== handleItemMouseLeave || $[35] !== mount || $[36] !== onClickOutside || $[37] !== onEscape || $[38] !== onItemClick || $[39] !== registerElement ? (t12 = {
2128
- version: 0,
2514
+ let t11;
2515
+ $[31] !== activeElement || $[32] !== handleItemMouseEnter || $[33] !== handleItemMouseLeave || $[34] !== mount || $[35] !== onClickOutside || $[36] !== onEscape || $[37] !== onItemClick || $[38] !== registerElement ? (t11 = {
2516
+ version: 2,
2129
2517
  activeElement,
2130
- activeIndex,
2131
2518
  mount,
2132
2519
  onClickOutside,
2133
2520
  onEscape,
2134
2521
  onItemClick,
2135
2522
  onItemMouseEnter: handleItemMouseEnter,
2136
2523
  onItemMouseLeave: handleItemMouseLeave,
2137
- registerElement,
2138
- onMouseEnter: handleItemMouseEnter,
2139
- onMouseLeave: handleItemMouseLeave
2140
- }, $[31] = activeElement, $[32] = activeIndex, $[33] = handleItemMouseEnter, $[34] = handleItemMouseLeave, $[35] = mount, $[36] = onClickOutside, $[37] = onEscape, $[38] = onItemClick, $[39] = registerElement, $[40] = t12) : t12 = $[40], t11 = t12;
2524
+ registerElement
2525
+ }, $[31] = activeElement, $[32] = handleItemMouseEnter, $[33] = handleItemMouseLeave, $[34] = mount, $[35] = onClickOutside, $[36] = onEscape, $[37] = onItemClick, $[38] = registerElement, $[39] = t11) : t11 = $[39];
2141
2526
  const value = t11;
2142
- let t13;
2143
- $[41] !== className ? (t13 = menu({
2527
+ let t12;
2528
+ $[40] !== className ? (t12 = menu({
2144
2529
  className
2145
- }), $[41] = className, $[42] = t13) : t13 = $[42];
2530
+ }), $[40] = className, $[41] = t12) : t12 = $[41];
2531
+ let t13;
2532
+ $[42] !== children || $[43] !== gap ? (t13 = /* @__PURE__ */ jsx(Stack, { gap, children }), $[42] = children, $[43] = gap, $[44] = t13) : t13 = $[44];
2146
2533
  let t14;
2147
- $[43] !== children || $[44] !== gap ? (t14 = /* @__PURE__ */ jsx(Stack, { gap, children }), $[43] = children, $[44] = gap, $[45] = t14) : t14 = $[45];
2534
+ $[45] !== as || $[46] !== handleKeyDown || $[47] !== handleRefChange || $[48] !== padding || $[49] !== rest || $[50] !== t12 || $[51] !== t13 ? (t14 = /* @__PURE__ */ jsx(Box, { "data-ui": "Menu", ...rest, as, className: t12, onKeyDown: handleKeyDown, overflow: "auto", outline: "none", padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t13 }), $[45] = as, $[46] = handleKeyDown, $[47] = handleRefChange, $[48] = padding, $[49] = rest, $[50] = t12, $[51] = t13, $[52] = t14) : t14 = $[52];
2148
2535
  let t15;
2149
- $[46] !== as || $[47] !== handleKeyDown || $[48] !== handleRefChange || $[49] !== padding || $[50] !== rest || $[51] !== t13 || $[52] !== t14 ? (t15 = /* @__PURE__ */ jsx(Box, { "data-ui": "Menu", ...rest, as, className: t13, onKeyDown: handleKeyDown, overflow: "auto", outline: "none", padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t14 }), $[46] = as, $[47] = handleKeyDown, $[48] = handleRefChange, $[49] = padding, $[50] = rest, $[51] = t13, $[52] = t14, $[53] = t15) : t15 = $[53];
2150
- let t16;
2151
- return $[54] !== t15 || $[55] !== value ? (t16 = /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: t15 }), $[54] = t15, $[55] = value, $[56] = t16) : t16 = $[56], t16;
2536
+ return $[53] !== t14 || $[54] !== value ? (t15 = /* @__PURE__ */ jsx(MenuContext, { value, children: t14 }), $[53] = t14, $[54] = value, $[55] = t15) : t15 = $[55], t15;
2152
2537
  }
2153
2538
  function MenuButton(props) {
2154
2539
  const $ = c(57), {
@@ -2226,8 +2611,8 @@ function MenuButton(props) {
2226
2611
  }, $[22] = menuElements, $[23] = t13) : t13 = $[23];
2227
2612
  const handleBlur = t13;
2228
2613
  let t14;
2229
- $[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t14 = () => {
2230
- setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
2614
+ $[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t14 = (e) => {
2615
+ e.defaultPrevented || (setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus());
2231
2616
  }, $[24] = buttonElement, $[25] = disableRestoreFocusOnClose, $[26] = t14) : t14 = $[26];
2232
2617
  const handleItemClick = t14;
2233
2618
  let t15;
@@ -2268,18 +2653,18 @@ function MenuButton(props) {
2268
2653
  const button2 = t17;
2269
2654
  let t18, t19;
2270
2655
  $[43] !== buttonElement ? (t18 = () => buttonElement, t19 = [buttonElement], $[43] = buttonElement, $[44] = t18, $[45] = t19) : (t18 = $[44], t19 = $[45]), useImperativeHandle(forwardedRef, t18, t19);
2271
- let t20, t21;
2272
- $[46] !== popover2 ? (t21 = popover2 || {}, $[46] = popover2, $[47] = t21) : t21 = $[47];
2273
- let t22;
2274
- $[48] !== t21 ? (t22 = {
2656
+ let t20;
2657
+ $[46] !== popover2 ? (t20 = popover2 || {}, $[46] = popover2, $[47] = t20) : t20 = $[47];
2658
+ let t21;
2659
+ $[48] !== t20 ? (t21 = {
2275
2660
  overflow: "auto",
2276
- ...t21
2277
- }, $[48] = t21, $[49] = t22) : t22 = $[49], t20 = t22;
2278
- const popoverProps = t20;
2661
+ ...t20
2662
+ }, $[48] = t20, $[49] = t21) : t21 = $[49];
2663
+ const popoverProps = t21;
2664
+ let t22;
2665
+ $[50] !== button2 ? (t22 = button2 || /* @__PURE__ */ jsx(Fragment, {}), $[50] = button2, $[51] = t22) : t22 = $[51];
2279
2666
  let t23;
2280
- $[50] !== button2 ? (t23 = button2 || /* @__PURE__ */ jsx(Fragment, {}), $[50] = button2, $[51] = t23) : t23 = $[51];
2281
- let t24;
2282
- return $[52] !== menu2 || $[53] !== open || $[54] !== popoverProps || $[55] !== t23 ? (t24 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu2, open, children: t23 }), $[52] = menu2, $[53] = open, $[54] = popoverProps, $[55] = t23, $[56] = t24) : t24 = $[56], t24;
2667
+ return $[52] !== menu2 || $[53] !== open || $[54] !== popoverProps || $[55] !== t22 ? (t23 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu2, open, children: t22 }), $[52] = menu2, $[53] = open, $[54] = popoverProps, $[55] = t22, $[56] = t23) : t23 = $[56], t23;
2283
2668
  }
2284
2669
  function _temp$6(v) {
2285
2670
  return !v;
@@ -2302,10 +2687,10 @@ function MenuDivider(props) {
2302
2687
  return $[6] !== Element2 || $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t2 }), $[6] = Element2, $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
2303
2688
  }
2304
2689
  function useMenu() {
2305
- const value = useContext(MenuContext);
2690
+ const value = use(MenuContext);
2306
2691
  if (!value)
2307
2692
  throw new Error("useMenu(): missing context value");
2308
- if (!isRecord(value) || value.version !== 0)
2693
+ if (!isRecord(value) || value.version !== 2)
2309
2694
  throw new Error("useMenu(): the context value is not compatible");
2310
2695
  return value;
2311
2696
  }
@@ -2355,8 +2740,8 @@ function MenuGroup(props) {
2355
2740
  }, $[18] = onClick, $[19] = t9) : t9 = $[19];
2356
2741
  const handleClick = t9;
2357
2742
  let t10;
2358
- $[20] !== onItemClick ? (t10 = () => {
2359
- setOpen(!1), onItemClick?.();
2743
+ $[20] !== onItemClick ? (t10 = (e) => {
2744
+ setOpen(!1), onItemClick?.(e);
2360
2745
  }, $[20] = onItemClick, $[21] = t10) : t10 = $[21];
2361
2746
  const handleChildItemClick = t10;
2362
2747
  let t11;
@@ -2415,36 +2800,40 @@ function MenuGroup(props) {
2415
2800
  }
2416
2801
  const DEFAULT_MENU_ITEM_ELEMENT = "button";
2417
2802
  function MenuItem(props) {
2418
- const $ = c(75), t0 = props;
2419
- let IconComponent, IconRightComponent, children, disabled, forwardedRef, gapX, gapY, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, rest, selectedProp, t1, t2, t3, t4, t5, t6, t7, text2;
2420
- $[0] !== t0 ? ({
2421
- as: t1,
2422
- children,
2423
- disabled,
2424
- fontSize: t2,
2425
- gap: t3,
2426
- gapX,
2427
- gapY,
2428
- hotkeys,
2429
- icon: IconComponent,
2430
- iconRight: IconRightComponent,
2431
- onClick,
2432
- padding: t4,
2433
- paddingX,
2434
- paddingY,
2435
- paddingTop,
2436
- paddingRight,
2437
- paddingBottom,
2438
- paddingLeft,
2439
- pressed,
2440
- radius: t5,
2441
- ref: forwardedRef,
2442
- role: t6,
2443
- selected: selectedProp,
2444
- text: text2,
2445
- tone: t7,
2446
- ...rest
2447
- } = t0, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = forwardedRef, $[6] = gapX, $[7] = gapY, $[8] = hotkeys, $[9] = onClick, $[10] = paddingBottom, $[11] = paddingLeft, $[12] = paddingRight, $[13] = paddingTop, $[14] = paddingX, $[15] = paddingY, $[16] = pressed, $[17] = rest, $[18] = selectedProp, $[19] = t1, $[20] = t2, $[21] = t3, $[22] = t4, $[23] = t5, $[24] = t6, $[25] = t7, $[26] = text2) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], forwardedRef = $[5], gapX = $[6], gapY = $[7], hotkeys = $[8], onClick = $[9], paddingBottom = $[10], paddingLeft = $[11], paddingRight = $[12], paddingTop = $[13], paddingX = $[14], paddingY = $[15], pressed = $[16], rest = $[17], selectedProp = $[18], t1 = $[19], t2 = $[20], t3 = $[21], t4 = $[22], t5 = $[23], t6 = $[24], t7 = $[25], text2 = $[26]);
2803
+ const $ = c(72), t0 = props;
2804
+ let IconComponent, IconRightComponent, children, disabled, forwardedRef, gapX, gapY, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, rest, selectedProp, t1, t2, t3, t4, t5, t6, t7, text2;
2805
+ if ($[0] !== t0) {
2806
+ const {
2807
+ as: t82,
2808
+ children: t92,
2809
+ disabled: t102,
2810
+ fontSize: t112,
2811
+ gap: t122,
2812
+ gapX: t132,
2813
+ gapY: t142,
2814
+ hotkeys: t152,
2815
+ icon: t162,
2816
+ iconRight: t172,
2817
+ onClick: t18,
2818
+ padding: t19,
2819
+ paddingX: t20,
2820
+ paddingY: t21,
2821
+ paddingTop: t22,
2822
+ paddingRight: t23,
2823
+ paddingBottom: t24,
2824
+ paddingLeft: t25,
2825
+ pressed,
2826
+ radius: t26,
2827
+ ref: t27,
2828
+ role: t28,
2829
+ selected: t29,
2830
+ text: t30,
2831
+ tone: t31,
2832
+ ...t32
2833
+ } = t0;
2834
+ t1 = t82, children = t92, disabled = t102, t2 = t112, t3 = t122, gapX = t132, gapY = t142, hotkeys = t152, IconComponent = t162, IconRightComponent = t172, onClick = t18, t4 = t19, paddingX = t20, paddingY = t21, paddingTop = t22, paddingRight = t23, paddingBottom = t24, paddingLeft = t25, t5 = t26, forwardedRef = t27, t6 = t28, selectedProp = t29, text2 = t30, t7 = t31, rest = t32, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = forwardedRef, $[6] = gapX, $[7] = gapY, $[8] = hotkeys, $[9] = onClick, $[10] = paddingBottom, $[11] = paddingLeft, $[12] = paddingRight, $[13] = paddingTop, $[14] = paddingX, $[15] = paddingY, $[16] = rest, $[17] = selectedProp, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4, $[22] = t5, $[23] = t6, $[24] = t7, $[25] = text2;
2835
+ } else
2836
+ IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], forwardedRef = $[5], gapX = $[6], gapY = $[7], hotkeys = $[8], onClick = $[9], paddingBottom = $[10], paddingLeft = $[11], paddingRight = $[12], paddingTop = $[13], paddingX = $[14], paddingY = $[15], rest = $[16], selectedProp = $[17], t1 = $[18], t2 = $[19], t3 = $[20], t4 = $[21], t5 = $[22], t6 = $[23], t7 = $[24], text2 = $[25];
2448
2837
  const as = t1 === void 0 ? DEFAULT_MENU_ITEM_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, gap = t3 === void 0 ? 3 : t3, padding = t4 === void 0 ? 3 : t4, radius = t5 === void 0 ? 2 : t5, role = t6 === void 0 ? "menuitem" : t6, tone = t7 === void 0 ? "default" : t7, menu2 = useMenu(), {
2449
2838
  activeElement,
2450
2839
  mount,
@@ -2453,16 +2842,16 @@ function MenuItem(props) {
2453
2842
  onItemMouseLeave
2454
2843
  } = menu2, [rootElement, setRootElement] = useState(null), active = !!activeElement && activeElement === rootElement, ref = useRef(null);
2455
2844
  let t8;
2456
- $[27] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[27] = t8) : t8 = $[27], useImperativeHandle(forwardedRef, t8);
2845
+ $[26] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[26] = t8) : t8 = $[26], useImperativeHandle(forwardedRef, t8);
2457
2846
  let t10, t9;
2458
- $[28] !== mount || $[29] !== rootElement || $[30] !== selectedProp ? (t9 = () => mount(rootElement, selectedProp), t10 = [mount, rootElement, selectedProp], $[28] = mount, $[29] = rootElement, $[30] = selectedProp, $[31] = t10, $[32] = t9) : (t10 = $[31], t9 = $[32]), useEffect(t9, t10);
2847
+ $[27] !== mount || $[28] !== rootElement || $[29] !== selectedProp ? (t9 = () => mount(rootElement, selectedProp), t10 = [mount, rootElement, selectedProp], $[27] = mount, $[28] = rootElement, $[29] = selectedProp, $[30] = t10, $[31] = t9) : (t10 = $[30], t9 = $[31]), useEffect(t9, t10);
2459
2848
  let t11;
2460
- $[33] !== disabled || $[34] !== onClick || $[35] !== onItemClick ? (t11 = (event) => {
2461
- disabled || (onClick && onClick(event), onItemClick && onItemClick());
2462
- }, $[33] = disabled, $[34] = onClick, $[35] = onItemClick, $[36] = t11) : t11 = $[36];
2849
+ $[32] !== disabled || $[33] !== onClick || $[34] !== onItemClick ? (t11 = (event) => {
2850
+ disabled || (onClick && onClick(event), onItemClick && onItemClick(event));
2851
+ }, $[32] = disabled, $[33] = onClick, $[34] = onItemClick, $[35] = t11) : t11 = $[35];
2463
2852
  const handleClick = t11;
2464
- let t12, t13;
2465
- $[37] !== padding || $[38] !== paddingBottom || $[39] !== paddingLeft || $[40] !== paddingRight || $[41] !== paddingTop || $[42] !== paddingX || $[43] !== paddingY ? (t13 = {
2853
+ let t12;
2854
+ $[36] !== padding || $[37] !== paddingBottom || $[38] !== paddingLeft || $[39] !== paddingRight || $[40] !== paddingTop || $[41] !== paddingX || $[42] !== paddingY ? (t12 = {
2466
2855
  padding,
2467
2856
  paddingX,
2468
2857
  paddingY,
@@ -2470,15 +2859,15 @@ function MenuItem(props) {
2470
2859
  paddingRight,
2471
2860
  paddingBottom,
2472
2861
  paddingLeft
2473
- }, $[37] = padding, $[38] = paddingBottom, $[39] = paddingLeft, $[40] = paddingRight, $[41] = paddingTop, $[42] = paddingX, $[43] = paddingY, $[44] = t13) : t13 = $[44], t12 = t13;
2862
+ }, $[36] = padding, $[37] = paddingBottom, $[38] = paddingLeft, $[39] = paddingRight, $[40] = paddingTop, $[41] = paddingX, $[42] = paddingY, $[43] = t12) : t12 = $[43];
2474
2863
  const paddingProps = t12;
2475
- let t14;
2476
- $[45] === Symbol.for("react.memo_cache_sentinel") ? (t14 = (el) => {
2864
+ let t13;
2865
+ $[44] === Symbol.for("react.memo_cache_sentinel") ? (t13 = (el) => {
2477
2866
  ref.current = el, setRootElement(el);
2478
- }, $[45] = t14) : t14 = $[45];
2479
- const setRef = t14, t15 = pressed ? "" : void 0, t16 = active ? "" : void 0, t17 = disabled ? "" : void 0, t18 = as === "button" ? "button" : void 0;
2480
- let t19;
2481
- $[46] !== IconComponent || $[47] !== IconRightComponent || $[48] !== fontSize || $[49] !== gap || $[50] !== gapX || $[51] !== gapY || $[52] !== hotkeys || $[53] !== paddingProps || $[54] !== text2 ? (t19 = (IconComponent || text2 || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap, gapX, gapY, align: "center", ...paddingProps, children: [
2867
+ }, $[44] = t13) : t13 = $[44];
2868
+ const setRef = t13, t14 = as === "button" ? "button" : void 0;
2869
+ let t15;
2870
+ $[45] !== IconComponent || $[46] !== IconRightComponent || $[47] !== fontSize || $[48] !== gap || $[49] !== gapX || $[50] !== gapY || $[51] !== hotkeys || $[52] !== paddingProps || $[53] !== text2 ? (t15 = (IconComponent || text2 || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap, gapX, gapY, align: "center", ...paddingProps, children: [
2482
2871
  IconComponent && /* @__PURE__ */ jsxs(Text, { muted: !0, size: fontSize, children: [
2483
2872
  isValidElement(IconComponent) && IconComponent,
2484
2873
  isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
@@ -2492,14 +2881,14 @@ function MenuItem(props) {
2492
2881
  isValidElement(IconRightComponent) && IconRightComponent,
2493
2882
  isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
2494
2883
  ] })
2495
- ] }), $[46] = IconComponent, $[47] = IconRightComponent, $[48] = fontSize, $[49] = gap, $[50] = gapX, $[51] = gapY, $[52] = hotkeys, $[53] = paddingProps, $[54] = text2, $[55] = t19) : t19 = $[55];
2496
- let t20;
2497
- $[56] !== children || $[57] !== paddingProps ? (t20 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[56] = children, $[57] = paddingProps, $[58] = t20) : t20 = $[58];
2498
- let t21;
2499
- return $[59] !== as || $[60] !== disabled || $[61] !== handleClick || $[62] !== onItemMouseEnter || $[63] !== onItemMouseLeave || $[64] !== radius || $[65] !== rest || $[66] !== role || $[67] !== t15 || $[68] !== t16 || $[69] !== t17 || $[70] !== t18 || $[71] !== t19 || $[72] !== t20 || $[73] !== tone ? (t21 = /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", ...rest, as, "data-pressed": t15, "data-selected": t16, "data-disabled": t17, radius, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role, tabIndex: -1, tone, type: t18, children: [
2500
- t19,
2501
- t20
2502
- ] }), $[59] = as, $[60] = disabled, $[61] = handleClick, $[62] = onItemMouseEnter, $[63] = onItemMouseLeave, $[64] = radius, $[65] = rest, $[66] = role, $[67] = t15, $[68] = t16, $[69] = t17, $[70] = t18, $[71] = t19, $[72] = t20, $[73] = tone, $[74] = t21) : t21 = $[74], t21;
2884
+ ] }), $[45] = IconComponent, $[46] = IconRightComponent, $[47] = fontSize, $[48] = gap, $[49] = gapX, $[50] = gapY, $[51] = hotkeys, $[52] = paddingProps, $[53] = text2, $[54] = t15) : t15 = $[54];
2885
+ let t16;
2886
+ $[55] !== children || $[56] !== paddingProps ? (t16 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[55] = children, $[56] = paddingProps, $[57] = t16) : t16 = $[57];
2887
+ let t17;
2888
+ return $[58] !== active || $[59] !== as || $[60] !== disabled || $[61] !== handleClick || $[62] !== onItemMouseEnter || $[63] !== onItemMouseLeave || $[64] !== radius || $[65] !== rest || $[66] !== role || $[67] !== t14 || $[68] !== t15 || $[69] !== t16 || $[70] !== tone ? (t17 = /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", ...rest, as, radius, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role, selected: active, tabIndex: -1, tone, type: t14, children: [
2889
+ t15,
2890
+ t16
2891
+ ] }), $[58] = active, $[59] = as, $[60] = disabled, $[61] = handleClick, $[62] = onItemMouseEnter, $[63] = onItemMouseLeave, $[64] = radius, $[65] = rest, $[66] = role, $[67] = t14, $[68] = t15, $[69] = t16, $[70] = tone, $[71] = t17) : t17 = $[71], t17;
2503
2892
  }
2504
2893
  const DEFAULT_TAB_ELEMENT = "button";
2505
2894
  function Tab(props) {
@@ -2710,7 +3099,7 @@ function _temp$5() {
2710
3099
  return !0;
2711
3100
  }
2712
3101
  const subscribe = () => () => {
2713
- }, ToastContext = createGlobalScopedContext("@sanity/ui/v3/toast", null), DEFAULT_GRID_ELEMENT = "div";
3102
+ }, ToastContext = createGlobalScopedContext("@sanity/ui/v4/toast", null), DEFAULT_GRID_ELEMENT = "div";
2714
3103
  function Grid(props) {
2715
3104
  const $ = c(8), t0 = props;
2716
3105
  let children, rest, t1;
@@ -2760,8 +3149,8 @@ function ToastProvider(props) {
2760
3149
  let t1;
2761
3150
  $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
2762
3151
  const [state, setState] = useState(t1), mounted = useMounted();
2763
- let t2, t3;
2764
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
3152
+ let t2;
3153
+ $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {
2765
3154
  version: 0,
2766
3155
  push: (params) => {
2767
3156
  const id = params.id ?? generateToastId(), duration = params.duration ?? 5e3;
@@ -2773,7 +3162,7 @@ function ToastProvider(props) {
2773
3162
  startTransition(() => {
2774
3163
  timeoutId && clearTimeout(timeoutId), setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id));
2775
3164
  });
2776
- }, timeoutId = setTimeout(dismiss, duration);
3165
+ }, timeoutId = duration === 1 / 0 ? void 0 : setTimeout(dismiss, duration);
2777
3166
  return [...prevState.filter((toast_1) => toast_1.id !== id), {
2778
3167
  dismiss,
2779
3168
  id,
@@ -2785,15 +3174,15 @@ function ToastProvider(props) {
2785
3174
  });
2786
3175
  }), id;
2787
3176
  }
2788
- }, $[1] = t3) : t3 = $[1], t2 = t3;
3177
+ }, $[1] = t2) : t2 = $[1];
2789
3178
  const value = t2;
3179
+ let t3;
3180
+ $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t3 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp$4) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t3) : t3 = $[9];
2790
3181
  let t4;
2791
- $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp$4) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
2792
- let t5;
2793
- return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
3182
+ return $[10] !== children || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxs(ToastContext, { value, children: [
2794
3183
  children,
2795
- t4
2796
- ] }), $[10] = children, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
3184
+ t3
3185
+ ] }), $[10] = children, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
2797
3186
  }
2798
3187
  function _temp$4(t0) {
2799
3188
  const {
@@ -2804,7 +3193,7 @@ function _temp$4(t0) {
2804
3193
  return /* @__PURE__ */ jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration }, id_0);
2805
3194
  }
2806
3195
  function useToast() {
2807
- const value = useContext(ToastContext);
3196
+ const value = use(ToastContext);
2808
3197
  if (!value)
2809
3198
  throw new Error("useToast(): missing context value");
2810
3199
  if (!isRecord(value) || value.version !== 0)
@@ -2865,7 +3254,7 @@ function _focusItemElement(el) {
2865
3254
  firstChild && firstChild instanceof HTMLElement && firstChild.focus();
2866
3255
  }
2867
3256
  }
2868
- const TreeContext = createGlobalScopedContext("@sanity/ui/v3/tree", null), DEFAULT_TREE_ELEMENT = "div";
3257
+ const TreeContext = createGlobalScopedContext("@sanity/ui/v4/tree", null), DEFAULT_TREE_ELEMENT = "div";
2869
3258
  function Tree(props) {
2870
3259
  const $ = c(38), t0 = props;
2871
3260
  let children, forwardedRef, onFocus, rest, t1;
@@ -2877,27 +3266,27 @@ function Tree(props) {
2877
3266
  ...rest
2878
3267
  } = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = onFocus, $[4] = rest, $[5] = t1) : (children = $[1], forwardedRef = $[2], onFocus = $[3], rest = $[4], t1 = $[5]);
2879
3268
  const gap = t1 === void 0 ? 1 : t1, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
2880
- let t2, t3;
2881
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[6] = t3) : t3 = $[6], t2 = t3;
3269
+ let t2;
3270
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[6] = t2) : t2 = $[6];
2882
3271
  const path = t2;
3272
+ let t3;
3273
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7];
3274
+ const [itemElements, setItemElements] = useState(t3);
2883
3275
  let t4;
2884
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [], $[7] = t4) : t4 = $[7];
2885
- const [itemElements, setItemElements] = useState(t4);
3276
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {}, $[8] = t4) : t4 = $[8];
3277
+ const [state, setState] = useState(t4), stateRef = useRef(state);
2886
3278
  let t5;
2887
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t5 = {}, $[8] = t5) : t5 = $[8];
2888
- const [state, setState] = useState(t5), stateRef = useRef(state);
2889
- let t6;
2890
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[9] = t6) : t6 = $[9], useImperativeHandle(forwardedRef, t6);
2891
- let t7, t8;
2892
- $[10] !== focusedElement ? (t7 = () => {
3279
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[9] = t5) : t5 = $[9], useImperativeHandle(forwardedRef, t5);
3280
+ let t6, t7;
3281
+ $[10] !== focusedElement ? (t6 = () => {
2893
3282
  focusedElementRef.current = focusedElement;
2894
- }, t8 = [focusedElement], $[10] = focusedElement, $[11] = t7, $[12] = t8) : (t7 = $[11], t8 = $[12]), useEffect(t7, t8);
2895
- let t10, t9;
2896
- $[13] !== state ? (t9 = () => {
3283
+ }, t7 = [focusedElement], $[10] = focusedElement, $[11] = t6, $[12] = t7) : (t6 = $[11], t7 = $[12]), useEffect(t6, t7);
3284
+ let t8, t9;
3285
+ $[13] !== state ? (t8 = () => {
2897
3286
  stateRef.current = state;
2898
- }, t10 = [state], $[13] = state, $[14] = t10, $[15] = t9) : (t10 = $[14], t9 = $[15]), useEffect(t9, t10);
2899
- let t11;
2900
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (element, path_0, expanded, selected) => (setState((s) => ({
3287
+ }, t9 = [state], $[13] = state, $[14] = t8, $[15] = t9) : (t8 = $[14], t9 = $[15]), useEffect(t8, t9);
3288
+ let t10;
3289
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (element, path_0, expanded, selected) => (setState((s) => ({
2901
3290
  ...s,
2902
3291
  [path_0]: {
2903
3292
  element,
@@ -2910,10 +3299,10 @@ function Tree(props) {
2910
3299
  };
2911
3300
  return delete newState[path_0], newState;
2912
3301
  });
2913
- }), $[16] = t11) : t11 = $[16];
2914
- const registerItem = t11;
2915
- let t12;
2916
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (path_1, expanded_0) => {
3302
+ }), $[16] = t10) : t10 = $[16];
3303
+ const registerItem = t10;
3304
+ let t11;
3305
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (path_1, expanded_0) => {
2917
3306
  setState((s_1) => {
2918
3307
  const itemState = s_1[path_1];
2919
3308
  return itemState ? {
@@ -2924,14 +3313,12 @@ function Tree(props) {
2924
3313
  }
2925
3314
  } : s_1;
2926
3315
  });
2927
- }, $[17] = t12) : t12 = $[17];
2928
- const setExpanded = t12;
3316
+ }, $[17] = t11) : t11 = $[17];
3317
+ const setExpanded = t11, t12 = focusedElement || itemElements[0] || null;
2929
3318
  let t13;
2930
- const t14 = focusedElement || itemElements[0] || null;
2931
- let t15;
2932
- $[18] !== gap || $[19] !== state || $[20] !== t14 ? (t15 = {
3319
+ $[18] !== gap || $[19] !== state || $[20] !== t12 ? (t13 = {
2933
3320
  version: 0,
2934
- focusedElement: t14,
3321
+ focusedElement: t12,
2935
3322
  gap,
2936
3323
  level: 0,
2937
3324
  path,
@@ -2939,10 +3326,10 @@ function Tree(props) {
2939
3326
  setExpanded,
2940
3327
  setFocusedElement,
2941
3328
  state
2942
- }, $[18] = gap, $[19] = state, $[20] = t14, $[21] = t15) : t15 = $[21], t13 = t15;
3329
+ }, $[18] = gap, $[19] = state, $[20] = t12, $[21] = t13) : t13 = $[21];
2943
3330
  const contextValue = t13;
2944
- let t16;
2945
- $[22] !== itemElements ? (t16 = (event) => {
3331
+ let t14;
3332
+ $[22] !== itemElements ? (t14 = (event) => {
2946
3333
  if (focusedElementRef.current) {
2947
3334
  if (event.key === "ArrowDown") {
2948
3335
  event.preventDefault();
@@ -3001,29 +3388,29 @@ function Tree(props) {
3001
3388
  return;
3002
3389
  }
3003
3390
  }
3004
- }, $[22] = itemElements, $[23] = t16) : t16 = $[23];
3005
- const handleKeyDown = t16;
3006
- let t17;
3007
- $[24] !== onFocus ? (t17 = (event_0) => {
3391
+ }, $[22] = itemElements, $[23] = t14) : t14 = $[23];
3392
+ const handleKeyDown = t14;
3393
+ let t15;
3394
+ $[24] !== onFocus ? (t15 = (event_0) => {
3008
3395
  setFocusedElement(event_0.target), onFocus?.(event_0);
3009
- }, $[24] = onFocus, $[25] = t17) : t17 = $[25];
3010
- const handleFocus = t17;
3011
- let t18;
3012
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t18 = () => {
3396
+ }, $[24] = onFocus, $[25] = t15) : t15 = $[25];
3397
+ const handleFocus = t15;
3398
+ let t16;
3399
+ $[26] === Symbol.for("react.memo_cache_sentinel") ? (t16 = () => {
3013
3400
  if (!ref.current)
3014
3401
  return;
3015
3402
  const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
3016
3403
  setItemElements(_itemElements);
3017
- }, $[26] = t18) : t18 = $[26];
3404
+ }, $[26] = t16) : t16 = $[26];
3405
+ let t17;
3406
+ $[27] !== children ? (t17 = [children], $[27] = children, $[28] = t17) : t17 = $[28], useEffect(t16, t17);
3407
+ let t18;
3408
+ $[29] !== children || $[30] !== gap || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest ? (t18 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...rest, gap, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[29] = children, $[30] = gap, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = rest, $[34] = t18) : t18 = $[34];
3018
3409
  let t19;
3019
- $[27] !== children ? (t19 = [children], $[27] = children, $[28] = t19) : t19 = $[28], useEffect(t18, t19);
3020
- let t20;
3021
- $[29] !== children || $[30] !== gap || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest ? (t20 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...rest, gap, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[29] = children, $[30] = gap, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = rest, $[34] = t20) : t20 = $[34];
3022
- let t21;
3023
- return $[35] !== contextValue || $[36] !== t20 ? (t21 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t20 }), $[35] = contextValue, $[36] = t20, $[37] = t21) : t21 = $[37], t21;
3410
+ return $[35] !== contextValue || $[36] !== t18 ? (t19 = /* @__PURE__ */ jsx(TreeContext, { value: contextValue, children: t18 }), $[35] = contextValue, $[36] = t18, $[37] = t19) : t19 = $[37], t19;
3024
3411
  }
3025
3412
  function useTree() {
3026
- const tree = useContext(TreeContext);
3413
+ const tree = use(TreeContext);
3027
3414
  if (!tree)
3028
3415
  throw new Error("Tree: missing context value");
3029
3416
  return tree;
@@ -3041,97 +3428,135 @@ const TreeGroup = function(props) {
3041
3428
  return $[4] !== children || $[5] !== rest || $[6] !== t2 || $[7] !== tree.gap ? (t3 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...rest, hidden: t2, marginTop: tree.gap, role: "group", gap: tree.gap, children }), $[4] = children, $[5] = rest, $[6] = t2, $[7] = tree.gap, $[8] = t3) : t3 = $[8], t3;
3042
3429
  }, DEFAULT_TREE_ITEM_ELEMENT = "a";
3043
3430
  function TreeItem(props) {
3044
- const {
3431
+ const $ = c(129), t0 = props;
3432
+ let IconComponent, children, className, href, idProp, muted, onClick, rest, t1, t2, t3, t4, t5, t6, t7, text2, weight;
3433
+ $[0] !== t0 ? ({
3045
3434
  children,
3046
3435
  className,
3047
- expanded: expandedProp = !1,
3048
- fontSize = 1,
3436
+ expanded: t1,
3437
+ fontSize: t2,
3049
3438
  href,
3050
3439
  icon: IconComponent,
3051
3440
  id: idProp,
3052
- linkAs = "a",
3441
+ linkAs: t3,
3053
3442
  muted,
3054
3443
  onClick,
3055
- padding = 2,
3056
- radius = 2,
3057
- selected = !1,
3058
- space = 2,
3444
+ padding: t4,
3445
+ radius: t5,
3446
+ selected: t6,
3447
+ space: t7,
3059
3448
  text: text2,
3060
3449
  weight,
3061
3450
  ...rest
3062
- } = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
3451
+ } = t0, $[0] = t0, $[1] = IconComponent, $[2] = children, $[3] = className, $[4] = href, $[5] = idProp, $[6] = muted, $[7] = onClick, $[8] = rest, $[9] = t1, $[10] = t2, $[11] = t3, $[12] = t4, $[13] = t5, $[14] = t6, $[15] = t7, $[16] = text2, $[17] = weight) : (IconComponent = $[1], children = $[2], className = $[3], href = $[4], idProp = $[5], muted = $[6], onClick = $[7], rest = $[8], t1 = $[9], t2 = $[10], t3 = $[11], t4 = $[12], t5 = $[13], t6 = $[14], t7 = $[15], text2 = $[16], weight = $[17]);
3452
+ const expandedProp = t1 === void 0 ? !1 : t1, fontSize = t2 === void 0 ? 1 : t2, linkAs = t3 === void 0 ? "a" : t3, padding = t4 === void 0 ? 2 : t4, radius = t5 === void 0 ? 2 : t5, selected = t6 === void 0 ? !1 : t6, space = t7 === void 0 ? 2 : t7, [rootElement, setRootElement] = useState(null), treeitemRef = useRef(null), tree = useTree(), {
3063
3453
  path,
3064
3454
  registerItem,
3065
3455
  setExpanded,
3066
3456
  setFocusedElement
3067
- } = tree, _id = useId(), id = idProp || _id, itemPath = useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, focused = tree.focusedElement && tree.focusedElement === rootRef.current, tabIndex = focused ? 0 : -1, contextValue = useMemo(() => ({
3457
+ } = tree, _id = useId(), id = idProp || _id;
3458
+ let t8, t9;
3459
+ if ($[18] !== id || $[19] !== path) {
3460
+ const itemPath = path.concat([id || ""]);
3461
+ t8 = itemPath, t9 = itemPath.join("/"), $[18] = id, $[19] = path, $[20] = t8, $[21] = t9;
3462
+ } else
3463
+ t8 = $[20], t9 = $[21];
3464
+ let t10;
3465
+ $[22] !== t8 || $[23] !== t9 ? (t10 = [t8, t9], $[22] = t8, $[23] = t9, $[24] = t10) : t10 = $[24];
3466
+ const [itemPath_0, itemKey] = t10, itemState = tree.state[itemKey], expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, focused = tree.focusedElement && tree.focusedElement === rootElement, tabIndex = focused ? 0 : -1, t11 = tree.level + 1;
3467
+ let t12;
3468
+ $[25] !== itemPath_0 || $[26] !== t11 || $[27] !== tree ? (t12 = {
3068
3469
  ...tree,
3069
- level: tree.level + 1,
3070
- path: itemPath
3071
- }), [itemPath, tree]), handleClick = useCallback((event) => {
3470
+ level: t11,
3471
+ path: itemPath_0
3472
+ }, $[25] = itemPath_0, $[26] = t11, $[27] = tree, $[28] = t12) : t12 = $[28];
3473
+ const contextValue = t12;
3474
+ let t13;
3475
+ $[29] !== expanded || $[30] !== itemKey || $[31] !== onClick || $[32] !== rootElement || $[33] !== setExpanded || $[34] !== setFocusedElement ? (t13 = (event) => {
3072
3476
  onClick && onClick(event);
3073
3477
  const target = event.target;
3074
- target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
3075
- }, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = useCallback((event_0) => {
3076
- focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
3077
- }, [focused]);
3078
- useEffect(() => {
3079
- if (rootRef.current)
3080
- return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
3081
- }, [expanded, itemPath, registerItem, selected]);
3082
- const content2 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
3083
- /* @__PURE__ */ jsxs(Box, { style: {
3084
- visibility: IconComponent || children ? "visible" : "hidden",
3085
- pointerEvents: "none"
3086
- }, children: [
3087
- IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }),
3088
- !IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
3089
- transform: expanded ? "rotate(90deg)" : void 0
3090
- } }) })
3091
- ] }),
3092
- /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text2 }) })
3093
- ] });
3094
- return href ? /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...rest, as: "li", className: treeItem({
3095
- className
3096
- }), onClick: handleClick, ref: rootRef, role: "none", children: [
3097
- /* @__PURE__ */ jsx(
3098
- Selectable,
3099
- {
3100
- "aria-expanded": expanded,
3101
- as: linkAs,
3102
- "data-ui": "TreeItem__box",
3103
- href,
3104
- radius,
3105
- ref: treeitemRef,
3106
- role: "treeitem",
3107
- selected,
3108
- tabIndex,
3109
- style: {
3110
- paddingLeft: `calc(${vars.space[2]} * ${tree.level})`
3111
- },
3112
- children: content2
3113
- }
3114
- ),
3115
- /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
3116
- ] }) : /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...rest, "aria-expanded": expanded, className: treeItem({
3478
+ target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
3479
+ }, $[29] = expanded, $[30] = itemKey, $[31] = onClick, $[32] = rootElement, $[33] = setExpanded, $[34] = setFocusedElement, $[35] = t13) : t13 = $[35];
3480
+ const handleClick = t13;
3481
+ let t14;
3482
+ $[36] !== focused || $[37] !== rootElement ? (t14 = (event_0) => {
3483
+ focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
3484
+ }, $[36] = focused, $[37] = rootElement, $[38] = t14) : t14 = $[38];
3485
+ const handleKeyDown = t14;
3486
+ let t15, t16;
3487
+ $[39] !== expanded || $[40] !== itemKey || $[41] !== registerItem || $[42] !== rootElement || $[43] !== selected ? (t15 = () => {
3488
+ if (rootElement)
3489
+ return registerItem(rootElement, itemKey, expanded, selected);
3490
+ }, t16 = [expanded, itemKey, registerItem, rootElement, selected], $[39] = expanded, $[40] = itemKey, $[41] = registerItem, $[42] = rootElement, $[43] = selected, $[44] = t15, $[45] = t16) : (t15 = $[44], t16 = $[45]), useEffect(t15, t16);
3491
+ const t17 = IconComponent || children ? "visible" : "hidden";
3492
+ let t18;
3493
+ $[46] !== t17 ? (t18 = {
3494
+ visibility: t17,
3495
+ pointerEvents: "none"
3496
+ }, $[46] = t17, $[47] = t18) : t18 = $[47];
3497
+ let t19;
3498
+ $[48] !== IconComponent || $[49] !== fontSize || $[50] !== muted || $[51] !== weight ? (t19 = IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }), $[48] = IconComponent, $[49] = fontSize, $[50] = muted, $[51] = weight, $[52] = t19) : t19 = $[52];
3499
+ let t20;
3500
+ $[53] !== IconComponent || $[54] !== expanded || $[55] !== fontSize || $[56] !== muted || $[57] !== weight ? (t20 = !IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
3501
+ transform: expanded ? "rotate(90deg)" : void 0
3502
+ } }) }), $[53] = IconComponent, $[54] = expanded, $[55] = fontSize, $[56] = muted, $[57] = weight, $[58] = t20) : t20 = $[58];
3503
+ let t21;
3504
+ $[59] !== t18 || $[60] !== t19 || $[61] !== t20 ? (t21 = /* @__PURE__ */ jsxs(Box, { style: t18, children: [
3505
+ t19,
3506
+ t20
3507
+ ] }), $[59] = t18, $[60] = t19, $[61] = t20, $[62] = t21) : t21 = $[62];
3508
+ let t22;
3509
+ $[63] !== fontSize || $[64] !== muted || $[65] !== text2 || $[66] !== weight ? (t22 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text2 }) }), $[63] = fontSize, $[64] = muted, $[65] = text2, $[66] = weight, $[67] = t22) : t22 = $[67];
3510
+ let t23;
3511
+ $[68] !== padding || $[69] !== space || $[70] !== t21 || $[71] !== t22 ? (t23 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
3512
+ t21,
3513
+ t22
3514
+ ] }), $[68] = padding, $[69] = space, $[70] = t21, $[71] = t22, $[72] = t23) : t23 = $[72];
3515
+ const content2 = t23;
3516
+ if (href) {
3517
+ const t242 = selected ? "" : void 0, t252 = rest;
3518
+ let t262;
3519
+ $[73] !== className ? (t262 = treeItem({
3520
+ className
3521
+ }), $[73] = className, $[74] = t262) : t262 = $[74];
3522
+ const t272 = `calc(${vars.space[2]} * ${tree.level})`;
3523
+ let t282;
3524
+ $[75] !== t272 ? (t282 = {
3525
+ paddingLeft: t272
3526
+ }, $[75] = t272, $[76] = t282) : t282 = $[76];
3527
+ let t292;
3528
+ $[77] !== content2 || $[78] !== expanded || $[79] !== href || $[80] !== linkAs || $[81] !== radius || $[82] !== selected || $[83] !== t282 || $[84] !== tabIndex ? (t292 = /* @__PURE__ */ jsx(Selectable, { "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, radius, ref: treeitemRef, role: "treeitem", selected, tabIndex, style: t282, children: content2 }), $[77] = content2, $[78] = expanded, $[79] = href, $[80] = linkAs, $[81] = radius, $[82] = selected, $[83] = t282, $[84] = tabIndex, $[85] = t292) : t292 = $[85];
3529
+ let t302;
3530
+ $[86] !== children || $[87] !== expanded ? (t302 = children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }), $[86] = children, $[87] = expanded, $[88] = t302) : t302 = $[88];
3531
+ let t312;
3532
+ $[89] !== contextValue || $[90] !== t302 ? (t312 = /* @__PURE__ */ jsx(TreeContext, { value: contextValue, children: t302 }), $[89] = contextValue, $[90] = t302, $[91] = t312) : t312 = $[91];
3533
+ let t322;
3534
+ return $[92] !== handleClick || $[93] !== id || $[94] !== itemKey || $[95] !== t242 || $[96] !== t252 || $[97] !== t262 || $[98] !== t292 || $[99] !== t312 ? (t322 = /* @__PURE__ */ jsxs(Box, { "data-selected": t242, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...t252, as: "li", className: t262, onClick: handleClick, ref: setRootElement, role: "none", children: [
3535
+ t292,
3536
+ t312
3537
+ ] }), $[92] = handleClick, $[93] = id, $[94] = itemKey, $[95] = t242, $[96] = t252, $[97] = t262, $[98] = t292, $[99] = t312, $[100] = t322) : t322 = $[100], t322;
3538
+ }
3539
+ const t24 = selected ? "" : void 0, t25 = rest;
3540
+ let t26;
3541
+ $[101] !== className ? (t26 = treeItem({
3117
3542
  className
3118
- }), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
3119
- /* @__PURE__ */ jsx(
3120
- Selectable,
3121
- {
3122
- as: "button",
3123
- "data-focused": focused ? "" : void 0,
3124
- "data-ui": "TreeItem__box",
3125
- radius,
3126
- selected,
3127
- style: {
3128
- paddingLeft: `calc(${vars.space[2]} * ${tree.level})`
3129
- },
3130
- children: content2
3131
- }
3132
- ),
3133
- /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
3134
- ] });
3543
+ }), $[101] = className, $[102] = t26) : t26 = $[102];
3544
+ const t27 = focused ? "" : void 0, t28 = `calc(${vars.space[2]} * ${tree.level})`;
3545
+ let t29;
3546
+ $[103] !== t28 ? (t29 = {
3547
+ paddingLeft: t28
3548
+ }, $[103] = t28, $[104] = t29) : t29 = $[104];
3549
+ let t30;
3550
+ $[105] !== content2 || $[106] !== radius || $[107] !== selected || $[108] !== t27 || $[109] !== t29 ? (t30 = /* @__PURE__ */ jsx(Selectable, { as: "button", "data-focused": t27, "data-ui": "TreeItem__box", radius, selected, style: t29, children: content2 }), $[105] = content2, $[106] = radius, $[107] = selected, $[108] = t27, $[109] = t29, $[110] = t30) : t30 = $[110];
3551
+ let t31;
3552
+ $[111] !== children || $[112] !== expanded ? (t31 = children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }), $[111] = children, $[112] = expanded, $[113] = t31) : t31 = $[113];
3553
+ let t32;
3554
+ $[114] !== contextValue || $[115] !== t31 ? (t32 = /* @__PURE__ */ jsx(TreeContext, { value: contextValue, children: t31 }), $[114] = contextValue, $[115] = t31, $[116] = t32) : t32 = $[116];
3555
+ let t33;
3556
+ return $[117] !== expanded || $[118] !== handleClick || $[119] !== handleKeyDown || $[120] !== id || $[121] !== itemKey || $[122] !== t24 || $[123] !== t25 || $[124] !== t26 || $[125] !== t30 || $[126] !== t32 || $[127] !== tabIndex ? (t33 = /* @__PURE__ */ jsxs(Box, { "data-selected": t24, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...t25, "aria-expanded": expanded, className: t26, onClick: handleClick, onKeyDown: handleKeyDown, ref: setRootElement, role: "treeitem", tabIndex, children: [
3557
+ t30,
3558
+ t32
3559
+ ] }), $[117] = expanded, $[118] = handleClick, $[119] = handleKeyDown, $[120] = id, $[121] = itemKey, $[122] = t24, $[123] = t25, $[124] = t26, $[125] = t30, $[126] = t32, $[127] = tabIndex, $[128] = t33) : t33 = $[128], t33;
3135
3560
  }
3136
3561
  function _isScrollable(el) {
3137
3562
  if (!(el instanceof Element)) return !1;
@@ -3140,7 +3565,7 @@ function _isScrollable(el) {
3140
3565
  }
3141
3566
  const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : ResizeObserver, DEFAULT_VIRTUAL_LIST_ELEMENT = "div";
3142
3567
  function VirtualList(props) {
3143
- const $ = c(61), t0 = props;
3568
+ const $ = c(44), t0 = props;
3144
3569
  let forwardedRef, getItemKey, onChange, renderItem, rest, t1, t2, t3;
3145
3570
  $[0] !== t0 ? ({
3146
3571
  as: t1,
@@ -3204,60 +3629,87 @@ function VirtualList(props) {
3204
3629
  }, t9 = [fromIndex, gapValue, itemHeight, onChange, scrollHeight, scrollTop, toIndex], $[14] = fromIndex, $[15] = gapValue, $[16] = itemHeight, $[17] = onChange, $[18] = scrollHeight, $[19] = scrollTop, $[20] = toIndex, $[21] = t8, $[22] = t9) : (t8 = $[21], t9 = $[22]), useEffect(t8, t9);
3205
3630
  let t10;
3206
3631
  $[23] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => {
3207
- setItemHeight(-1);
3632
+ startTransition(() => setItemHeight(-1));
3208
3633
  }, $[23] = t10) : t10 = $[23];
3209
3634
  let t11;
3210
3635
  $[24] !== renderItem ? (t11 = [renderItem], $[24] = renderItem, $[25] = t11) : t11 = $[25], useEffect(t10, t11);
3211
3636
  let t12;
3212
- bb0: {
3213
- if (!renderItem || items.length === 0) {
3214
- t12 = null;
3215
- break bb0;
3216
- }
3217
- if (itemHeight === -1) {
3218
- let t133;
3219
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t133 = (el) => el ? setItemHeight(el.offsetHeight) : void 0, $[26] = t133) : t133 = $[26];
3220
- let t142;
3221
- $[27] !== items[0] || $[28] !== renderItem ? (t142 = renderItem(items[0]), $[27] = items[0], $[28] = renderItem, $[29] = t142) : t142 = $[29];
3222
- let t152;
3223
- $[30] !== t142 ? (t152 = /* @__PURE__ */ jsx(Box, { ref: t133, insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t142 }, 0), $[30] = t142, $[31] = t152) : t152 = $[31];
3224
- let t162;
3225
- $[32] === Symbol.for("react.memo_cache_sentinel") ? (t162 = (el_0) => el_0 ? setGapValue(el_0.offsetHeight) : void 0, $[32] = t162) : t162 = $[32];
3226
- const t17 = vars.space[gap];
3227
- let t18;
3228
- $[33] !== t17 ? (t18 = /* @__PURE__ */ jsx("div", { ref: t162, style: {
3229
- height: t17
3230
- } }), $[33] = t17, $[34] = t18) : t18 = $[34];
3231
- let t19;
3232
- $[35] !== t152 || $[36] !== t18 ? (t19 = [/* @__PURE__ */ jsxs(Fragment, { children: [
3233
- t152,
3234
- t18
3235
- ] })], $[35] = t152, $[36] = t18, $[37] = t19) : t19 = $[37], t12 = t19;
3236
- break bb0;
3237
- }
3238
- let t132;
3239
- if ($[38] !== fromIndex || $[39] !== gapValue || $[40] !== getItemKey || $[41] !== itemHeight || $[42] !== items || $[43] !== renderItem || $[44] !== toIndex) {
3240
- let t142;
3241
- $[46] !== fromIndex || $[47] !== gapValue || $[48] !== getItemKey || $[49] !== itemHeight || $[50] !== renderItem ? (t142 = (item, _itemIndex) => {
3242
- const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
3243
- return /* @__PURE__ */ jsx(Box, { insetLeft: 0, insetRight: 0, position: "absolute", style: {
3244
- top: itemIndex * (itemHeight + gapValue)
3245
- }, children: node }, key2);
3246
- }, $[46] = fromIndex, $[47] = gapValue, $[48] = getItemKey, $[49] = itemHeight, $[50] = renderItem, $[51] = t142) : t142 = $[51], t132 = items.slice(fromIndex, toIndex).map(t142), $[38] = fromIndex, $[39] = gapValue, $[40] = getItemKey, $[41] = itemHeight, $[42] = items, $[43] = renderItem, $[44] = toIndex, $[45] = t132;
3247
- } else
3248
- t132 = $[45];
3249
- t12 = t132;
3250
- }
3251
- const children = t12;
3252
- let t13, t14;
3253
- $[52] !== height ? (t14 = {
3637
+ $[26] !== fromIndex || $[27] !== gap || $[28] !== gapValue || $[29] !== getItemKey || $[30] !== itemHeight || $[31] !== items || $[32] !== renderItem || $[33] !== toIndex ? (t12 = {
3638
+ fromIndex,
3639
+ gap,
3640
+ getItemKey,
3641
+ itemHeight,
3642
+ items,
3643
+ renderItem,
3644
+ toIndex,
3645
+ gapValue,
3646
+ setGapValue,
3647
+ setItemHeight
3648
+ }, $[26] = fromIndex, $[27] = gap, $[28] = gapValue, $[29] = getItemKey, $[30] = itemHeight, $[31] = items, $[32] = renderItem, $[33] = toIndex, $[34] = t12) : t12 = $[34];
3649
+ const children = useChildren(t12);
3650
+ let t13;
3651
+ $[35] !== height ? (t13 = {
3254
3652
  height
3255
- }, $[52] = height, $[53] = t14) : t14 = $[53], t13 = t14;
3653
+ }, $[35] = height, $[36] = t13) : t13 = $[36];
3256
3654
  const wrapperStyle = t13;
3655
+ let t14;
3656
+ $[37] !== children || $[38] !== wrapperStyle ? (t14 = /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[37] = children, $[38] = wrapperStyle, $[39] = t14) : t14 = $[39];
3257
3657
  let t15;
3258
- $[54] !== children || $[55] !== wrapperStyle ? (t15 = /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[54] = children, $[55] = wrapperStyle, $[56] = t15) : t15 = $[56];
3259
- let t16;
3260
- return $[57] !== as || $[58] !== rest || $[59] !== t15 ? (t16 = /* @__PURE__ */ jsx(Box, { "data-ui": "VirtualList", ...rest, as, position: "relative", ref, children: t15 }), $[57] = as, $[58] = rest, $[59] = t15, $[60] = t16) : t16 = $[60], t16;
3658
+ return $[40] !== as || $[41] !== rest || $[42] !== t14 ? (t15 = /* @__PURE__ */ jsx(Box, { "data-ui": "VirtualList", ...rest, as, position: "relative", ref, children: t14 }), $[40] = as, $[41] = rest, $[42] = t14, $[43] = t15) : t15 = $[43], t15;
3659
+ }
3660
+ function useChildren(t0) {
3661
+ const $ = c(32), {
3662
+ fromIndex,
3663
+ gap,
3664
+ getItemKey,
3665
+ itemHeight,
3666
+ items,
3667
+ renderItem,
3668
+ toIndex,
3669
+ gapValue,
3670
+ setGapValue,
3671
+ setItemHeight
3672
+ } = t0;
3673
+ if (!renderItem || items.length === 0)
3674
+ return null;
3675
+ if (itemHeight === -1) {
3676
+ let t12;
3677
+ $[0] !== setItemHeight ? (t12 = (el) => {
3678
+ el && setItemHeight(el.offsetHeight);
3679
+ }, $[0] = setItemHeight, $[1] = t12) : t12 = $[1];
3680
+ let t2;
3681
+ $[2] !== items[0] || $[3] !== renderItem ? (t2 = renderItem(items[0]), $[2] = items[0], $[3] = renderItem, $[4] = t2) : t2 = $[4];
3682
+ let t3;
3683
+ $[5] !== t12 || $[6] !== t2 ? (t3 = /* @__PURE__ */ jsx(Box, { ref: t12, insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t2 }, 0), $[5] = t12, $[6] = t2, $[7] = t3) : t3 = $[7];
3684
+ let t4;
3685
+ $[8] !== setGapValue ? (t4 = (el_0) => {
3686
+ el_0 && setGapValue(el_0.offsetHeight);
3687
+ }, $[8] = setGapValue, $[9] = t4) : t4 = $[9];
3688
+ const t5 = vars.space[gap];
3689
+ let t6;
3690
+ $[10] !== t5 ? (t6 = {
3691
+ height: t5
3692
+ }, $[10] = t5, $[11] = t6) : t6 = $[11];
3693
+ let t7;
3694
+ $[12] !== t4 || $[13] !== t6 ? (t7 = /* @__PURE__ */ jsx("div", { ref: t4, style: t6 }), $[12] = t4, $[13] = t6, $[14] = t7) : t7 = $[14];
3695
+ let t8;
3696
+ return $[15] !== t3 || $[16] !== t7 ? (t8 = [/* @__PURE__ */ jsxs(Fragment, { children: [
3697
+ t3,
3698
+ t7
3699
+ ] })], $[15] = t3, $[16] = t7, $[17] = t8) : t8 = $[17], t8;
3700
+ }
3701
+ let t1;
3702
+ if ($[18] !== fromIndex || $[19] !== gapValue || $[20] !== getItemKey || $[21] !== itemHeight || $[22] !== items || $[23] !== renderItem || $[24] !== toIndex) {
3703
+ let t2;
3704
+ $[26] !== fromIndex || $[27] !== gapValue || $[28] !== getItemKey || $[29] !== itemHeight || $[30] !== renderItem ? (t2 = (item, _itemIndex) => {
3705
+ const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
3706
+ return /* @__PURE__ */ jsx(Box, { insetLeft: 0, insetRight: 0, position: "absolute", style: {
3707
+ top: itemIndex * (itemHeight + gapValue)
3708
+ }, children: node }, key2);
3709
+ }, $[26] = fromIndex, $[27] = gapValue, $[28] = getItemKey, $[29] = itemHeight, $[30] = renderItem, $[31] = t2) : t2 = $[31], t1 = items.slice(fromIndex, toIndex).map(t2), $[18] = fromIndex, $[19] = gapValue, $[20] = getItemKey, $[21] = itemHeight, $[22] = items, $[23] = renderItem, $[24] = toIndex, $[25] = t1;
3710
+ } else
3711
+ t1 = $[25];
3712
+ return t1;
3261
3713
  }
3262
3714
  function findScrollable(parentNode) {
3263
3715
  let _scrollEl = parentNode;
@@ -3320,43 +3772,59 @@ function _temp$3() {
3320
3772
  }
3321
3773
  const DEFAULT_LABEL_ELEMENT = "div";
3322
3774
  function Label(props) {
3323
- const $ = c(26);
3324
- let align, children, className, rest, t0, t1, t2, t3, textOverflowProp;
3775
+ const $ = c(42);
3776
+ let align, children, className, margin, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, maxWidth, rest, t0, t1, t2, t3, textOverflowProp;
3325
3777
  $[0] !== props ? ({
3326
3778
  align,
3327
3779
  as: t0,
3328
3780
  children,
3329
3781
  className,
3782
+ margin,
3783
+ marginX,
3784
+ marginY,
3785
+ marginTop,
3786
+ marginRight,
3787
+ marginBottom,
3788
+ marginLeft,
3789
+ maxWidth,
3330
3790
  muted: t1,
3331
3791
  size: t2,
3332
3792
  textOverflow: textOverflowProp,
3333
3793
  weight: t3,
3334
3794
  ...rest
3335
- } = props, $[0] = props, $[1] = align, $[2] = children, $[3] = className, $[4] = rest, $[5] = t0, $[6] = t1, $[7] = t2, $[8] = t3, $[9] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], rest = $[4], t0 = $[5], t1 = $[6], t2 = $[7], t3 = $[8], textOverflowProp = $[9]);
3795
+ } = props, $[0] = props, $[1] = align, $[2] = children, $[3] = className, $[4] = margin, $[5] = marginBottom, $[6] = marginLeft, $[7] = marginRight, $[8] = marginTop, $[9] = marginX, $[10] = marginY, $[11] = maxWidth, $[12] = rest, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], margin = $[4], marginBottom = $[5], marginLeft = $[6], marginRight = $[7], marginTop = $[8], marginX = $[9], marginY = $[10], maxWidth = $[11], rest = $[12], t0 = $[13], t1 = $[14], t2 = $[15], t3 = $[16], textOverflowProp = $[17]);
3336
3796
  const Element2 = t0 === void 0 ? DEFAULT_LABEL_ELEMENT : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 1 : t2, weight = t3 === void 0 ? "regular" : t3;
3337
3797
  let t4;
3338
- $[10] !== align || $[11] !== className || $[12] !== muted || $[13] !== size2 || $[14] !== weight ? (t4 = label({
3798
+ $[18] !== align || $[19] !== className || $[20] !== margin || $[21] !== marginBottom || $[22] !== marginLeft || $[23] !== marginRight || $[24] !== marginTop || $[25] !== marginX || $[26] !== marginY || $[27] !== maxWidth || $[28] !== muted || $[29] !== size2 || $[30] !== weight ? (t4 = label({
3339
3799
  className,
3340
3800
  align,
3801
+ margin,
3802
+ marginX,
3803
+ marginY,
3804
+ marginTop,
3805
+ marginRight,
3806
+ marginBottom,
3807
+ marginLeft,
3808
+ maxWidth,
3341
3809
  muted,
3342
3810
  size: size2,
3343
3811
  weight
3344
- }), $[10] = align, $[11] = className, $[12] = muted, $[13] = size2, $[14] = weight, $[15] = t4) : t4 = $[15];
3812
+ }), $[18] = align, $[19] = className, $[20] = margin, $[21] = marginBottom, $[22] = marginLeft, $[23] = marginRight, $[24] = marginTop, $[25] = marginX, $[26] = marginY, $[27] = maxWidth, $[28] = muted, $[29] = size2, $[30] = weight, $[31] = t4) : t4 = $[31];
3345
3813
  let t5;
3346
- $[16] !== textOverflowProp ? (t5 = textOverflow({
3814
+ $[32] !== textOverflowProp ? (t5 = textOverflow({
3347
3815
  textOverflow: textOverflowProp
3348
- }), $[16] = textOverflowProp, $[17] = t5) : t5 = $[17];
3816
+ }), $[32] = textOverflowProp, $[33] = t5) : t5 = $[33];
3349
3817
  let t6;
3350
- $[18] !== children || $[19] !== t5 ? (t6 = /* @__PURE__ */ jsx("span", { className: t5, children }), $[18] = children, $[19] = t5, $[20] = t6) : t6 = $[20];
3818
+ $[34] !== children || $[35] !== t5 ? (t6 = /* @__PURE__ */ jsx("span", { className: t5, children }), $[34] = children, $[35] = t5, $[36] = t6) : t6 = $[36];
3351
3819
  let t7;
3352
- return $[21] !== Element2 || $[22] !== rest || $[23] !== t4 || $[24] !== t6 ? (t7 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Label", ...rest, className: t4, children: t6 }), $[21] = Element2, $[22] = rest, $[23] = t4, $[24] = t6, $[25] = t7) : t7 = $[25], t7;
3820
+ return $[37] !== Element2 || $[38] !== rest || $[39] !== t4 || $[40] !== t6 ? (t7 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Label", ...rest, className: t4, children: t6 }), $[37] = Element2, $[38] = rest, $[39] = t4, $[40] = t6, $[41] = t7) : t7 = $[41], t7;
3353
3821
  }
3354
3822
  const DEFAULT_AVATAR_ELEMENT = "span";
3355
3823
  function Avatar(props) {
3356
- const $ = c(50), t0 = props;
3357
- let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, className, initials, onImageLoadError, rest, src, t1, t2, t3, title;
3824
+ const $ = c(52), t0 = props;
3825
+ let animateArrowFrom, arrowPositionProp, className, hideInnerStroke, initials, onImageLoadError, rest, src, t1, t2, t3, title;
3358
3826
  $[0] !== t0 ? ({
3359
- __unstable_hideInnerStroke,
3827
+ __unstable_hideInnerStroke: hideInnerStroke,
3360
3828
  as: t1,
3361
3829
  className,
3362
3830
  color: t2,
@@ -3368,53 +3836,56 @@ function Avatar(props) {
3368
3836
  animateArrowFrom,
3369
3837
  size: t3,
3370
3838
  ...rest
3371
- } = t0, $[0] = t0, $[1] = __unstable_hideInnerStroke, $[2] = animateArrowFrom, $[3] = arrowPositionProp, $[4] = className, $[5] = initials, $[6] = onImageLoadError, $[7] = rest, $[8] = src, $[9] = t1, $[10] = t2, $[11] = t3, $[12] = title) : (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], className = $[4], initials = $[5], onImageLoadError = $[6], rest = $[7], src = $[8], t1 = $[9], t2 = $[10], t3 = $[11], title = $[12]);
3372
- const Element2 = t1 === void 0 ? DEFAULT_AVATAR_ELEMENT : t1, color = t2 === void 0 ? "magenta" : t2, sizeProp = t3 === void 0 ? 1 : t3, size2 = useResponsiveProp(sizeProp), [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageError, setImageError] = useState(!1);
3373
- let t4, t5;
3374
- $[13] !== arrowPosition || $[14] !== arrowPositionProp ? (t4 = () => {
3839
+ } = t0, $[0] = t0, $[1] = animateArrowFrom, $[2] = arrowPositionProp, $[3] = className, $[4] = hideInnerStroke, $[5] = initials, $[6] = onImageLoadError, $[7] = rest, $[8] = src, $[9] = t1, $[10] = t2, $[11] = t3, $[12] = title) : (animateArrowFrom = $[1], arrowPositionProp = $[2], className = $[3], hideInnerStroke = $[4], initials = $[5], onImageLoadError = $[6], rest = $[7], src = $[8], t1 = $[9], t2 = $[10], t3 = $[11], title = $[12]);
3840
+ const Element2 = t1 === void 0 ? DEFAULT_AVATAR_ELEMENT : t1, color = t2 === void 0 ? "magenta" : t2, sizeProp = t3 === void 0 ? 1 : t3;
3841
+ let t4;
3842
+ $[13] !== sizeProp ? (t4 = _getResponsiveProp(sizeProp), $[13] = sizeProp, $[14] = t4) : t4 = $[14];
3843
+ const size2 = t4, [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageError, setImageError] = useState(!1);
3844
+ let t5, t6;
3845
+ $[15] !== arrowPosition || $[16] !== arrowPositionProp ? (t5 = () => {
3375
3846
  if (arrowPosition === arrowPositionProp)
3376
3847
  return;
3377
3848
  const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
3378
3849
  return () => cancelAnimationFrame(raf);
3379
- }, t5 = [arrowPosition, arrowPositionProp], $[13] = arrowPosition, $[14] = arrowPositionProp, $[15] = t4, $[16] = t5) : (t4 = $[15], t5 = $[16]), useEffect(t4, t5);
3380
- let t6, t7;
3381
- $[17] !== src ? (t6 = () => {
3850
+ }, t6 = [arrowPosition, arrowPositionProp], $[15] = arrowPosition, $[16] = arrowPositionProp, $[17] = t5, $[18] = t6) : (t5 = $[17], t6 = $[18]), useEffect(t5, t6);
3851
+ let t7, t8;
3852
+ $[19] !== src ? (t7 = () => {
3382
3853
  src && setImageError(!1);
3383
- }, t7 = [src], $[17] = src, $[18] = t6, $[19] = t7) : (t6 = $[18], t7 = $[19]), useEffect(t6, t7);
3384
- let t8;
3385
- $[20] !== onImageLoadError ? (t8 = () => {
3854
+ }, t8 = [src], $[19] = src, $[20] = t7, $[21] = t8) : (t7 = $[20], t8 = $[21]), useEffect(t7, t8);
3855
+ let t9;
3856
+ $[22] !== onImageLoadError ? (t9 = () => {
3386
3857
  setImageError(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
3387
- }, $[20] = onImageLoadError, $[21] = t8) : t8 = $[21];
3388
- const handleImageError = t8;
3389
- let t9, t10;
3390
- $[22] !== size2 ? (t10 = Object.values(size2).map(_temp$2), $[22] = size2, $[23] = t10) : t10 = $[23], t9 = t10;
3391
- const initialsSize = t9, t11 = __unstable_hideInnerStroke ? "" : void 0;
3858
+ }, $[22] = onImageLoadError, $[23] = t9) : t9 = $[23];
3859
+ const handleImageError = t9;
3860
+ let t10;
3861
+ $[24] !== size2 ? (t10 = Object.values(size2).map(_temp$2), $[24] = size2, $[25] = t10) : t10 = $[25];
3862
+ const initialsSize = t10, t11 = hideInnerStroke ? "" : void 0;
3392
3863
  let t12;
3393
- $[24] !== className || $[25] !== color || $[26] !== sizeProp ? (t12 = avatar({
3864
+ $[26] !== className || $[27] !== color || $[28] !== sizeProp ? (t12 = avatar({
3394
3865
  className,
3395
3866
  color,
3396
3867
  size: sizeProp
3397
- }), $[24] = className, $[25] = color, $[26] = sizeProp, $[27] = t12) : t12 = $[27];
3868
+ }), $[26] = className, $[27] = color, $[28] = sizeProp, $[29] = t12) : t12 = $[29];
3398
3869
  const t13 = imageError ? "" : void 0;
3399
3870
  let t14;
3400
- $[28] === Symbol.for("react.memo_cache_sentinel") ? (t14 = avatarArrow(), $[28] = t14) : t14 = $[28];
3871
+ $[30] === Symbol.for("react.memo_cache_sentinel") ? (t14 = avatarArrow(), $[30] = t14) : t14 = $[30];
3401
3872
  let t15;
3402
- $[29] !== color ? (t15 = /* @__PURE__ */ jsx("span", { className: t14, children: /* @__PURE__ */ jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ 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 }) }) }), $[29] = color, $[30] = t15) : t15 = $[30];
3873
+ $[31] !== color ? (t15 = /* @__PURE__ */ jsx("span", { className: t14, children: /* @__PURE__ */ jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ 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 }) }) }), $[31] = color, $[32] = t15) : t15 = $[32];
3403
3874
  let t16;
3404
- $[31] === Symbol.for("react.memo_cache_sentinel") ? (t16 = avatarInitials(), $[31] = t16) : t16 = $[31];
3875
+ $[33] === Symbol.for("react.memo_cache_sentinel") ? (t16 = avatarInitials(), $[33] = t16) : t16 = $[33];
3405
3876
  let t17;
3406
- $[32] !== initials || $[33] !== initialsSize ? (t17 = /* @__PURE__ */ jsx(Box, { alignItems: "center", as: "span", className: t16, display: "flex", justifyContent: "center", position: "absolute", inset: 0, children: /* @__PURE__ */ jsx(Label, { align: "center", as: "span", size: initialsSize, weight: "medium", children: initials }) }), $[32] = initials, $[33] = initialsSize, $[34] = t17) : t17 = $[34];
3877
+ $[34] !== initials || $[35] !== initialsSize ? (t17 = /* @__PURE__ */ jsx(Box, { alignItems: "center", as: "span", className: t16, display: "flex", justifyContent: "center", position: "absolute", inset: 0, children: /* @__PURE__ */ jsx(Label, { align: "center", as: "span", size: initialsSize, weight: "medium", children: initials }) }), $[34] = initials, $[35] = initialsSize, $[36] = t17) : t17 = $[36];
3407
3878
  let t18;
3408
- $[35] !== handleImageError || $[36] !== initials || $[37] !== src ? (t18 = src && /* @__PURE__ */ jsxs(Box, { className: avatarImage(), inset: 0, position: "absolute", children: [
3879
+ $[37] !== handleImageError || $[38] !== initials || $[39] !== src ? (t18 = src && /* @__PURE__ */ jsxs(Box, { className: avatarImage(), inset: 0, position: "absolute", children: [
3409
3880
  /* @__PURE__ */ jsx("img", { alt: initials, onError: handleImageError, src }),
3410
3881
  /* @__PURE__ */ jsx("span", { className: avatarImageOutline() })
3411
- ] }), $[35] = handleImageError, $[36] = initials, $[37] = src, $[38] = t18) : t18 = $[38];
3882
+ ] }), $[37] = handleImageError, $[38] = initials, $[39] = src, $[40] = t18) : t18 = $[40];
3412
3883
  let t19;
3413
- return $[39] !== Element2 || $[40] !== arrowPosition || $[41] !== rest || $[42] !== t11 || $[43] !== t12 || $[44] !== t13 || $[45] !== t15 || $[46] !== t17 || $[47] !== t18 || $[48] !== title ? (t19 = /* @__PURE__ */ jsxs(Element2, { "data-hide-inner-stroke": t11, "data-ui": "Avatar", ...rest, "aria-label": title, className: t12, "data-arrow-position": arrowPosition, "data-image-error": t13, title, children: [
3884
+ return $[41] !== Element2 || $[42] !== arrowPosition || $[43] !== rest || $[44] !== t11 || $[45] !== t12 || $[46] !== t13 || $[47] !== t15 || $[48] !== t17 || $[49] !== t18 || $[50] !== title ? (t19 = /* @__PURE__ */ jsxs(Element2, { "data-hide-inner-stroke": t11, "data-ui": "Avatar", ...rest, "aria-label": title, className: t12, "data-arrow-position": arrowPosition, "data-image-error": t13, title, children: [
3414
3885
  t15,
3415
3886
  t17,
3416
3887
  t18
3417
- ] }), $[39] = Element2, $[40] = arrowPosition, $[41] = rest, $[42] = t11, $[43] = t12, $[44] = t13, $[45] = t15, $[46] = t17, $[47] = t18, $[48] = title, $[49] = t19) : t19 = $[49], t19;
3888
+ ] }), $[41] = Element2, $[42] = arrowPosition, $[43] = rest, $[44] = t11, $[45] = t12, $[46] = t13, $[47] = t15, $[48] = t17, $[49] = t18, $[50] = title, $[51] = t19) : t19 = $[51], t19;
3418
3889
  }
3419
3890
  function _temp$2(s) {
3420
3891
  return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
@@ -3431,25 +3902,25 @@ function AvatarCounter(props) {
3431
3902
  ...rest
3432
3903
  } = t0, $[0] = t0, $[1] = className, $[2] = count, $[3] = rest, $[4] = t1, $[5] = t2) : (className = $[1], count = $[2], rest = $[3], t1 = $[4], t2 = $[5]);
3433
3904
  const as = t1 === void 0 ? DEFAULT_AVATAR_COUNTER_ELEMENT : t1, size2 = useResponsiveProp(t2 === void 0 ? 1 : t2);
3434
- let t3, t4;
3435
- $[6] !== size2 ? (t4 = Object.values(size2).map(_temp$1), $[6] = size2, $[7] = t4) : t4 = $[7], t3 = t4;
3905
+ let t3;
3906
+ $[6] !== size2 ? (t3 = Object.values(size2).map(_temp$1), $[6] = size2, $[7] = t3) : t3 = $[7];
3436
3907
  const labelSize = t3;
3437
- let t5;
3438
- $[8] !== className || $[9] !== size2 ? (t5 = avatarCounter({
3908
+ let t4;
3909
+ $[8] !== className || $[9] !== size2 ? (t4 = avatarCounter({
3439
3910
  className,
3440
3911
  size: size2
3441
- }), $[8] = className, $[9] = size2, $[10] = t5) : t5 = $[10];
3912
+ }), $[8] = className, $[9] = size2, $[10] = t4) : t4 = $[10];
3913
+ let t5;
3914
+ $[11] !== count || $[12] !== labelSize ? (t5 = /* @__PURE__ */ jsx(Label, { align: "center", as: "span", size: labelSize, weight: "medium", children: count }), $[11] = count, $[12] = labelSize, $[13] = t5) : t5 = $[13];
3442
3915
  let t6;
3443
- $[11] !== count || $[12] !== labelSize ? (t6 = /* @__PURE__ */ jsx(Label, { align: "center", as: "span", size: labelSize, weight: "medium", children: count }), $[11] = count, $[12] = labelSize, $[13] = t6) : t6 = $[13];
3444
- let t7;
3445
- return $[14] !== as || $[15] !== rest || $[16] !== t5 || $[17] !== t6 ? (t7 = /* @__PURE__ */ jsx(Box, { "data-ui": "AvatarCounter", ...rest, alignItems: "center", as, className: t5, display: "flex", flex: "none", justifyContent: "center", paddingX: 2, sizing: "border", children: t6 }), $[14] = as, $[15] = rest, $[16] = t5, $[17] = t6, $[18] = t7) : t7 = $[18], t7;
3916
+ return $[14] !== as || $[15] !== rest || $[16] !== t4 || $[17] !== t5 ? (t6 = /* @__PURE__ */ jsx(Box, { "data-ui": "AvatarCounter", ...rest, alignItems: "center", as, className: t4, display: "flex", flex: "none", justifyContent: "center", paddingX: 2, sizing: "border", children: t5 }), $[14] = as, $[15] = rest, $[16] = t4, $[17] = t5, $[18] = t6) : t6 = $[18], t6;
3446
3917
  }
3447
3918
  function _temp$1(s) {
3448
3919
  return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
3449
3920
  }
3450
3921
  const DEFAULT_AVATAR_STACK_ELEMENT = "span";
3451
3922
  function AvatarStack(props) {
3452
- const $ = c(20), t0 = props;
3923
+ const $ = c(27), t0 = props;
3453
3924
  let childrenProp, className, rest, t1, t2, t3;
3454
3925
  $[0] !== t0 ? ({
3455
3926
  as: t1,
@@ -3465,18 +3936,22 @@ function AvatarStack(props) {
3465
3936
  className,
3466
3937
  size: size2
3467
3938
  }), $[7] = className, $[8] = size2, $[9] = t6) : t6 = $[9];
3468
- const t7 = "flex", t8 = "flex-start", t9 = len === 0 && /* @__PURE__ */ jsx(AvatarCounter, { count: len, size: size2 }), t10 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 });
3939
+ const t7 = "flex", t8 = "flex-start";
3940
+ let t9;
3941
+ $[10] !== len || $[11] !== size2 ? (t9 = len === 0 && /* @__PURE__ */ jsx(AvatarCounter, { count: len, size: size2 }), $[10] = len, $[11] = size2, $[12] = t9) : t9 = $[12];
3942
+ let t10;
3943
+ $[13] !== extraCount || $[14] !== len || $[15] !== size2 ? (t10 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 }), $[13] = extraCount, $[14] = len, $[15] = size2, $[16] = t10) : t10 = $[16];
3469
3944
  let t11;
3470
- $[10] !== size2 ? (t11 = (child, childIndex) => /* @__PURE__ */ jsx(Fragment$1, { children: cloneElement(child, {
3945
+ $[17] !== size2 ? (t11 = (child, childIndex) => /* @__PURE__ */ jsx(Fragment$1, { children: cloneElement(child, {
3471
3946
  size: size2
3472
- }) }, String(childIndex)), $[10] = size2, $[11] = t11) : t11 = $[11];
3947
+ }) }, String(childIndex)), $[17] = size2, $[18] = t11) : t11 = $[18];
3473
3948
  const t12 = visibleChildren.map(t11);
3474
3949
  let t13;
3475
- return $[12] !== T0 || $[13] !== as || $[14] !== rest || $[15] !== t10 || $[16] !== t12 || $[17] !== t6 || $[18] !== t9 ? (t13 = /* @__PURE__ */ jsxs(T0, { "data-ui": t4, ...rest, alignItems: t5, as, className: t6, display: t7, justifyContent: t8, children: [
3950
+ return $[19] !== T0 || $[20] !== as || $[21] !== rest || $[22] !== t10 || $[23] !== t12 || $[24] !== t6 || $[25] !== t9 ? (t13 = /* @__PURE__ */ jsxs(T0, { "data-ui": t4, ...rest, alignItems: t5, as, className: t6, display: t7, justifyContent: t8, children: [
3476
3951
  t9,
3477
3952
  t10,
3478
3953
  t12
3479
- ] }), $[12] = T0, $[13] = as, $[14] = rest, $[15] = t10, $[16] = t12, $[17] = t6, $[18] = t9, $[19] = t13) : t13 = $[19], t13;
3954
+ ] }), $[19] = T0, $[20] = as, $[21] = rest, $[22] = t10, $[23] = t12, $[24] = t6, $[25] = t9, $[26] = t13) : t13 = $[26], t13;
3480
3955
  }
3481
3956
  const DEFAULT_BADGE_ELEMENT = "span";
3482
3957
  function Badge(props) {
@@ -3546,69 +4021,101 @@ function Checkbox(props) {
3546
4021
  t11
3547
4022
  ] }), $[25] = style, $[26] = t10, $[27] = t5, $[28] = t12) : t12 = $[28], t12;
3548
4023
  }
3549
- const LazyRefractor = lazy(() => import("./_chunks-es/refractor.js")), DEFAULT_CODE_ELEMENT = "pre";
4024
+ const LazyRefractor = lazy(() => import("./_chunks-es/Refractor.js")), DEFAULT_CODE_ELEMENT = "pre";
3550
4025
  function Code(props) {
3551
- const $ = c(25), t0 = props;
3552
- let children, className, languageProp, rest, t1, t2, t3;
4026
+ const $ = c(41), t0 = props;
4027
+ let children, className, languageProp, margin, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, maxWidth, rest, t1, t2, t3;
3553
4028
  $[0] !== t0 ? ({
3554
4029
  as: t1,
3555
4030
  children,
3556
4031
  className,
3557
4032
  language: languageProp,
4033
+ margin,
4034
+ marginX,
4035
+ marginY,
4036
+ marginTop,
4037
+ marginRight,
4038
+ marginBottom,
4039
+ marginLeft,
4040
+ maxWidth,
3558
4041
  size: t2,
3559
4042
  weight: t3,
3560
4043
  ...rest
3561
- } = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = languageProp, $[4] = rest, $[5] = t1, $[6] = t2, $[7] = t3) : (children = $[1], className = $[2], languageProp = $[3], rest = $[4], t1 = $[5], t2 = $[6], t3 = $[7]);
4044
+ } = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = languageProp, $[4] = margin, $[5] = marginBottom, $[6] = marginLeft, $[7] = marginRight, $[8] = marginTop, $[9] = marginX, $[10] = marginY, $[11] = maxWidth, $[12] = rest, $[13] = t1, $[14] = t2, $[15] = t3) : (children = $[1], className = $[2], languageProp = $[3], margin = $[4], marginBottom = $[5], marginLeft = $[6], marginRight = $[7], marginTop = $[8], marginX = $[9], marginY = $[10], maxWidth = $[11], rest = $[12], t1 = $[13], t2 = $[14], t3 = $[15]);
3562
4045
  const Element2 = t1 === void 0 ? DEFAULT_CODE_ELEMENT : t1, size2 = t2 === void 0 ? 2 : t2, weight = t3 === void 0 ? "regular" : t3, language = typeof languageProp == "string" ? languageProp : void 0;
3563
4046
  let t4;
3564
- $[8] !== className || $[9] !== size2 || $[10] !== weight ? (t4 = code({
4047
+ $[16] !== className || $[17] !== margin || $[18] !== marginBottom || $[19] !== marginLeft || $[20] !== marginRight || $[21] !== marginTop || $[22] !== marginX || $[23] !== marginY || $[24] !== maxWidth || $[25] !== size2 || $[26] !== weight ? (t4 = code({
3565
4048
  className,
4049
+ margin,
4050
+ marginX,
4051
+ marginY,
4052
+ marginTop,
4053
+ marginRight,
4054
+ marginBottom,
4055
+ marginLeft,
4056
+ maxWidth,
3566
4057
  size: size2,
3567
4058
  weight
3568
- }), $[8] = className, $[9] = size2, $[10] = weight, $[11] = t4) : t4 = $[11];
4059
+ }), $[16] = className, $[17] = margin, $[18] = marginBottom, $[19] = marginLeft, $[20] = marginRight, $[21] = marginTop, $[22] = marginX, $[23] = marginY, $[24] = maxWidth, $[25] = size2, $[26] = weight, $[27] = t4) : t4 = $[27];
3569
4060
  let t5;
3570
- $[12] !== children ? (t5 = /* @__PURE__ */ jsx("code", { children }), $[12] = children, $[13] = t5) : t5 = $[13];
4061
+ $[28] !== children ? (t5 = /* @__PURE__ */ jsx("code", { children }), $[28] = children, $[29] = t5) : t5 = $[29];
3571
4062
  let t6;
3572
- $[14] !== children || $[15] !== language ? (t6 = /* @__PURE__ */ jsx(LazyRefractor, { language, value: children }), $[14] = children, $[15] = language, $[16] = t6) : t6 = $[16];
4063
+ $[30] !== children || $[31] !== language ? (t6 = /* @__PURE__ */ jsx(LazyRefractor, { language, value: children }), $[30] = children, $[31] = language, $[32] = t6) : t6 = $[32];
3573
4064
  let t7;
3574
- $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsx(Suspense, { fallback: t5, children: t6 }), $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19];
4065
+ $[33] !== t5 || $[34] !== t6 ? (t7 = /* @__PURE__ */ jsx(Suspense, { fallback: t5, children: t6 }), $[33] = t5, $[34] = t6, $[35] = t7) : t7 = $[35];
3575
4066
  let t8;
3576
- return $[20] !== Element2 || $[21] !== rest || $[22] !== t4 || $[23] !== t7 ? (t8 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Code", ...rest, className: t4, children: t7 }), $[20] = Element2, $[21] = rest, $[22] = t4, $[23] = t7, $[24] = t8) : t8 = $[24], t8;
4067
+ return $[36] !== Element2 || $[37] !== rest || $[38] !== t4 || $[39] !== t7 ? (t8 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Code", ...rest, className: t4, children: t7 }), $[36] = Element2, $[37] = rest, $[38] = t4, $[39] = t7, $[40] = t8) : t8 = $[40], t8;
3577
4068
  }
3578
4069
  const DEFAULT_HEADING_ELEMENT = "div";
3579
4070
  function Heading(props) {
3580
- const $ = c(28), t0 = props;
3581
- let align, children, className, flex, rest, t1, t2, t3, t4, textOverflowProp;
4071
+ const $ = c(44), t0 = props;
4072
+ let align, children, className, flex, margin, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, maxWidth, rest, t1, t2, t3, t4, textOverflowProp;
3582
4073
  $[0] !== t0 ? ({
3583
4074
  align,
3584
4075
  as: t1,
3585
4076
  children,
3586
4077
  className,
3587
4078
  flex,
4079
+ margin,
4080
+ marginX,
4081
+ marginY,
4082
+ marginTop,
4083
+ marginRight,
4084
+ marginBottom,
4085
+ marginLeft,
4086
+ maxWidth,
3588
4087
  muted: t2,
3589
4088
  size: t3,
3590
4089
  textOverflow: textOverflowProp,
3591
4090
  weight: t4,
3592
4091
  ...rest
3593
- } = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = rest, $[6] = t1, $[7] = t2, $[8] = t3, $[9] = t4, $[10] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], flex = $[4], rest = $[5], t1 = $[6], t2 = $[7], t3 = $[8], t4 = $[9], textOverflowProp = $[10]);
4092
+ } = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = margin, $[6] = marginBottom, $[7] = marginLeft, $[8] = marginRight, $[9] = marginTop, $[10] = marginX, $[11] = marginY, $[12] = maxWidth, $[13] = rest, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4, $[18] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], flex = $[4], margin = $[5], marginBottom = $[6], marginLeft = $[7], marginRight = $[8], marginTop = $[9], marginX = $[10], marginY = $[11], maxWidth = $[12], rest = $[13], t1 = $[14], t2 = $[15], t3 = $[16], t4 = $[17], textOverflowProp = $[18]);
3594
4093
  const Element2 = t1 === void 0 ? DEFAULT_HEADING_ELEMENT : t1, muted = t2 === void 0 ? !1 : t2, size2 = t3 === void 0 ? 2 : t3, weight = t4 === void 0 ? "regular" : t4;
3595
4094
  let t5;
3596
- $[11] !== align || $[12] !== className || $[13] !== flex || $[14] !== muted || $[15] !== size2 || $[16] !== weight ? (t5 = heading({
4095
+ $[19] !== align || $[20] !== className || $[21] !== flex || $[22] !== margin || $[23] !== marginBottom || $[24] !== marginLeft || $[25] !== marginRight || $[26] !== marginTop || $[27] !== marginX || $[28] !== marginY || $[29] !== maxWidth || $[30] !== muted || $[31] !== size2 || $[32] !== weight ? (t5 = heading({
3597
4096
  className,
3598
4097
  align,
3599
4098
  flex,
4099
+ margin,
4100
+ marginX,
4101
+ marginY,
4102
+ marginTop,
4103
+ marginRight,
4104
+ marginBottom,
4105
+ marginLeft,
4106
+ maxWidth,
3600
4107
  muted,
3601
4108
  size: size2,
3602
4109
  weight
3603
- }), $[11] = align, $[12] = className, $[13] = flex, $[14] = muted, $[15] = size2, $[16] = weight, $[17] = t5) : t5 = $[17];
4110
+ }), $[19] = align, $[20] = className, $[21] = flex, $[22] = margin, $[23] = marginBottom, $[24] = marginLeft, $[25] = marginRight, $[26] = marginTop, $[27] = marginX, $[28] = marginY, $[29] = maxWidth, $[30] = muted, $[31] = size2, $[32] = weight, $[33] = t5) : t5 = $[33];
3604
4111
  let t6;
3605
- $[18] !== textOverflowProp ? (t6 = textOverflow({
4112
+ $[34] !== textOverflowProp ? (t6 = textOverflow({
3606
4113
  textOverflow: textOverflowProp
3607
- }), $[18] = textOverflowProp, $[19] = t6) : t6 = $[19];
4114
+ }), $[34] = textOverflowProp, $[35] = t6) : t6 = $[35];
3608
4115
  let t7;
3609
- $[20] !== children || $[21] !== t6 ? (t7 = /* @__PURE__ */ jsx("span", { className: t6, children }), $[20] = children, $[21] = t6, $[22] = t7) : t7 = $[22];
4116
+ $[36] !== children || $[37] !== t6 ? (t7 = /* @__PURE__ */ jsx("span", { className: t6, children }), $[36] = children, $[37] = t6, $[38] = t7) : t7 = $[38];
3610
4117
  let t8;
3611
- return $[23] !== Element2 || $[24] !== rest || $[25] !== t5 || $[26] !== t7 ? (t8 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Heading", ...rest, className: t5, children: t7 }), $[23] = Element2, $[24] = rest, $[25] = t5, $[26] = t7, $[27] = t8) : t8 = $[27], t8;
4118
+ return $[39] !== Element2 || $[40] !== rest || $[41] !== t5 || $[42] !== t7 ? (t8 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Heading", ...rest, className: t5, children: t7 }), $[39] = Element2, $[40] = rest, $[41] = t5, $[42] = t7, $[43] = t8) : t8 = $[43], t8;
3612
4119
  }
3613
4120
  const DEFAULT_INLINE_ELEMENT = "div";
3614
4121
  function Inline(props) {
@@ -3653,90 +4160,89 @@ function Radio(props) {
3653
4160
  let t9;
3654
4161
  $[20] === Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsx("span", { className: radioPresentation() }), $[20] = t9) : t9 = $[20];
3655
4162
  let t10;
3656
- return $[21] !== style || $[22] !== t3 || $[23] !== t8 ? (t10 = /* @__PURE__ */ jsxs("div", { className: t3, "data-ui": "Radio", style, children: [
4163
+ return $[21] !== style || $[22] !== t3 || $[23] !== t8 ? (t10 = /* @__PURE__ */ jsxs("span", { className: t3, "data-ui": "Radio", style, children: [
3657
4164
  t8,
3658
4165
  t9
3659
4166
  ] }), $[21] = style, $[22] = t3, $[23] = t8, $[24] = t10) : t10 = $[24], t10;
3660
4167
  }
3661
4168
  const DEFAULT_SELECT_ELEMENT = "select";
3662
4169
  function Select(props) {
3663
- const $ = c(37), t0 = props;
3664
- let children, customValidity, disabled, forwardedRef, readOnly, rest, t1, t2, t3, t4, t5, t6;
4170
+ const $ = c(41), t0 = props;
4171
+ let children, customValidity, disabled, flex, forwardedRef, readOnly, rest, t1, t2, t3, t4, t5, t6, t7;
3665
4172
  $[0] !== t0 ? ({
3666
4173
  as: t1,
3667
4174
  border: t2,
3668
4175
  children,
3669
4176
  customValidity,
3670
4177
  disabled,
4178
+ flex,
3671
4179
  fontSize: t3,
3672
4180
  gap: t4,
3673
4181
  padding: t5,
3674
4182
  radius: t6,
3675
4183
  readOnly,
3676
4184
  ref: forwardedRef,
4185
+ width: t7,
3677
4186
  ...rest
3678
- } = t0, $[0] = t0, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = forwardedRef, $[5] = readOnly, $[6] = rest, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = t5, $[12] = t6) : (children = $[1], customValidity = $[2], disabled = $[3], forwardedRef = $[4], readOnly = $[5], rest = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10], t5 = $[11], t6 = $[12]);
3679
- const Element2 = t1 === void 0 ? DEFAULT_SELECT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, fontSize = t3 === void 0 ? 2 : t3, gap = t4 === void 0 ? 2 : t4, padding = t5 === void 0 ? 3 : t5, radius = t6 === void 0 ? 1 : t6, ref = useRef(null);
3680
- let t7;
3681
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[13] = t7) : t7 = $[13], useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
4187
+ } = t0, $[0] = t0, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = flex, $[5] = forwardedRef, $[6] = readOnly, $[7] = rest, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5, $[13] = t6, $[14] = t7) : (children = $[1], customValidity = $[2], disabled = $[3], flex = $[4], forwardedRef = $[5], readOnly = $[6], rest = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12], t6 = $[13], t7 = $[14]);
4188
+ const Element2 = t1 === void 0 ? DEFAULT_SELECT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, fontSize = t3 === void 0 ? 2 : t3, gap = t4 === void 0 ? 2 : t4, padding = t5 === void 0 ? 3 : t5, radius = t6 === void 0 ? 1 : t6, width = t7 === void 0 ? "fill" : t7, ref = useRef(null);
3682
4189
  let t8;
3683
- $[14] !== border || $[15] !== fontSize || $[16] !== gap || $[17] !== padding || $[18] !== radius ? (t8 = select({
4190
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[15] = t8) : t8 = $[15], useImperativeHandle(forwardedRef, t8), useCustomValidity(ref, customValidity);
4191
+ let t9;
4192
+ $[16] !== border || $[17] !== flex || $[18] !== fontSize || $[19] !== gap || $[20] !== padding || $[21] !== radius || $[22] !== width ? (t9 = select({
3684
4193
  border,
3685
4194
  fontSize,
4195
+ flex,
3686
4196
  gap,
3687
4197
  padding,
3688
- radius
3689
- }), $[14] = border, $[15] = fontSize, $[16] = gap, $[17] = padding, $[18] = radius, $[19] = t8) : t8 = $[19];
3690
- let t9;
3691
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t9 = _inputElement(), $[20] = t9) : t9 = $[20];
3692
- const t10 = disabled || readOnly;
3693
- let t11;
3694
- $[21] !== Element2 || $[22] !== children || $[23] !== rest || $[24] !== t10 ? (t11 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t9, disabled: t10, ref, children }), $[21] = Element2, $[22] = children, $[23] = rest, $[24] = t10, $[25] = t11) : t11 = $[25];
4198
+ radius,
4199
+ width
4200
+ }), $[16] = border, $[17] = flex, $[18] = fontSize, $[19] = gap, $[20] = padding, $[21] = radius, $[22] = width, $[23] = t9) : t9 = $[23];
4201
+ let t10;
4202
+ $[24] === Symbol.for("react.memo_cache_sentinel") ? (t10 = _inputElement(), $[24] = t10) : t10 = $[24];
4203
+ const t11 = disabled || readOnly;
3695
4204
  let t12;
3696
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t12 = selectPresentation(), $[26] = t12) : t12 = $[26];
4205
+ $[25] !== Element2 || $[26] !== children || $[27] !== rest || $[28] !== t11 ? (t12 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t10, disabled: t11, ref, children }), $[25] = Element2, $[26] = children, $[27] = rest, $[28] = t11, $[29] = t12) : t12 = $[29];
3697
4206
  let t13;
3698
- $[27] === Symbol.for("react.memo_cache_sentinel") ? (t13 = /* @__PURE__ */ jsx(ChevronDownIcon, {}), $[27] = t13) : t13 = $[27];
4207
+ $[30] === Symbol.for("react.memo_cache_sentinel") ? (t13 = selectPresentation(), $[30] = t13) : t13 = $[30];
3699
4208
  let t14;
3700
- $[28] !== fontSize ? (t14 = /* @__PURE__ */ jsx(Text, { size: fontSize, children: t13 }), $[28] = fontSize, $[29] = t14) : t14 = $[29];
4209
+ $[31] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsx(ChevronDownIcon, {}), $[31] = t14) : t14 = $[31];
3701
4210
  let t15;
3702
- $[30] !== padding || $[31] !== t14 ? (t15 = /* @__PURE__ */ jsx("span", { className: t12, children: /* @__PURE__ */ jsx(Box, { as: "span", display: "inline-block", padding, children: t14 }) }), $[30] = padding, $[31] = t14, $[32] = t15) : t15 = $[32];
4211
+ $[32] !== fontSize ? (t15 = /* @__PURE__ */ jsx(Text, { size: fontSize, children: t14 }), $[32] = fontSize, $[33] = t15) : t15 = $[33];
3703
4212
  let t16;
3704
- return $[33] !== t11 || $[34] !== t15 || $[35] !== t8 ? (t16 = /* @__PURE__ */ jsxs("div", { "data-ui": "Select", className: t8, "data-icon-right": "", children: [
3705
- t11,
3706
- t15
3707
- ] }), $[33] = t11, $[34] = t15, $[35] = t8, $[36] = t16) : t16 = $[36], t16;
4213
+ $[34] !== padding || $[35] !== t15 ? (t16 = /* @__PURE__ */ jsx("span", { className: t13, children: /* @__PURE__ */ jsx(Box, { as: "span", display: "inline-block", padding, children: t15 }) }), $[34] = padding, $[35] = t15, $[36] = t16) : t16 = $[36];
4214
+ let t17;
4215
+ return $[37] !== t12 || $[38] !== t16 || $[39] !== t9 ? (t17 = /* @__PURE__ */ jsxs("span", { "data-ui": "Select", className: t9, "data-icon-right": "", children: [
4216
+ t12,
4217
+ t16
4218
+ ] }), $[37] = t12, $[38] = t16, $[39] = t9, $[40] = t17) : t17 = $[40], t17;
3708
4219
  }
3709
4220
  const DEFAULT_SKELETON_ELEMENT = "div";
3710
4221
  function Skeleton(props) {
3711
- const $ = c(18), t0 = props;
3712
- let className, delay, rest, t1, t2;
3713
- $[0] !== t0 ? ({
3714
- as: t1,
3715
- animated: t2,
4222
+ const $ = c(9), {
4223
+ as: t0,
4224
+ animated: t1,
3716
4225
  className,
3717
4226
  delay,
3718
4227
  ...rest
3719
- } = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] = rest, $[4] = t1, $[5] = t2) : (className = $[1], delay = $[2], rest = $[3], t1 = $[4], t2 = $[5]);
3720
- const As = t1 === void 0 ? DEFAULT_SKELETON_ELEMENT : t1, animated = t2 === void 0 ? !1 : t2, [visible, setVisible] = useState(!delay);
3721
- let t3, t4;
3722
- $[6] !== delay ? (t3 = () => {
4228
+ } = props, As = t0 === void 0 ? DEFAULT_SKELETON_ELEMENT : t0, animated = t1 === void 0 ? !1 : t1, [visible, setVisible] = useState(!delay);
4229
+ let t2, t3;
4230
+ $[0] !== delay ? (t2 = () => {
3723
4231
  if (!delay)
3724
- return setVisible(!0);
4232
+ return;
3725
4233
  const timeout = setTimeout(() => {
3726
4234
  setVisible(!0);
3727
4235
  }, delay);
3728
4236
  return () => {
3729
4237
  clearTimeout(timeout);
3730
4238
  };
3731
- }, t4 = [delay], $[6] = delay, $[7] = t3, $[8] = t4) : (t3 = $[7], t4 = $[8]), useEffect(t3, t4);
3732
- let t5;
3733
- $[9] !== className || $[10] !== rest ? (t5 = skeleton({
4239
+ }, t3 = [delay], $[0] = delay, $[1] = t2, $[2] = t3) : (t2 = $[1], t3 = $[2]), useEffect(t2, t3);
4240
+ const t4 = "Skeleton", t5 = skeleton({
3734
4241
  className,
3735
4242
  ...rest
3736
- }), $[9] = className, $[10] = rest, $[11] = t5) : t5 = $[11];
3737
- const t6 = animated ? "" : void 0, t7 = visible ? "" : void 0;
4243
+ }), t6 = animated ? "" : void 0, t7 = !delay || visible ? "" : void 0;
3738
4244
  let t8;
3739
- return $[12] !== As || $[13] !== rest || $[14] !== t5 || $[15] !== t6 || $[16] !== t7 ? (t8 = /* @__PURE__ */ jsx(As, { "data-ui": "Skeleton", ...rest, className: t5, "data-animated": t6, "data-visible": t7 }), $[12] = As, $[13] = rest, $[14] = t5, $[15] = t6, $[16] = t7, $[17] = t8) : t8 = $[17], t8;
4245
+ return $[3] !== As || $[4] !== rest || $[5] !== t5 || $[6] !== t6 || $[7] !== t7 ? (t8 = /* @__PURE__ */ jsx(As, { "data-ui": t4, ...rest, className: t5, "data-animated": t6, "data-visible": t7 }), $[3] = As, $[4] = rest, $[5] = t5, $[6] = t6, $[7] = t7, $[8] = t8) : t8 = $[8], t8;
3740
4246
  }
3741
4247
  const DEFAULT_CODE_SKELETON_ELEMENT = "div";
3742
4248
  function CodeSkeleton(props) {
@@ -3830,8 +4336,8 @@ function SrOnly(props) {
3830
4336
  }
3831
4337
  const DEFAULT_SWITCH_ELEMENT = "input";
3832
4338
  function Switch(props) {
3833
- const $ = c(26), t0 = props;
3834
- let className, disabled, forwardedRef, indeterminate, readOnly, rest, style, t1;
4339
+ const $ = c(24), t0 = props;
4340
+ let className, disabled, forwardedRef, indeterminate, readOnly, rest, t1;
3835
4341
  $[0] !== t0 ? ({
3836
4342
  as: t1,
3837
4343
  className,
@@ -3839,78 +4345,83 @@ function Switch(props) {
3839
4345
  indeterminate,
3840
4346
  readOnly,
3841
4347
  ref: forwardedRef,
3842
- style,
3843
4348
  ...rest
3844
- } = t0, $[0] = t0, $[1] = className, $[2] = disabled, $[3] = forwardedRef, $[4] = indeterminate, $[5] = readOnly, $[6] = rest, $[7] = style, $[8] = t1) : (className = $[1], disabled = $[2], forwardedRef = $[3], indeterminate = $[4], readOnly = $[5], rest = $[6], style = $[7], t1 = $[8]);
4349
+ } = t0, $[0] = t0, $[1] = className, $[2] = disabled, $[3] = forwardedRef, $[4] = indeterminate, $[5] = readOnly, $[6] = rest, $[7] = t1) : (className = $[1], disabled = $[2], forwardedRef = $[3], indeterminate = $[4], readOnly = $[5], rest = $[6], t1 = $[7]);
3845
4350
  const Element2 = t1 === void 0 ? DEFAULT_SWITCH_ELEMENT : t1, ref = useRef(null);
3846
4351
  let t2;
3847
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[9] = t2) : t2 = $[9], useImperativeHandle(forwardedRef, t2);
4352
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[8] = t2) : t2 = $[8], useImperativeHandle(forwardedRef, t2);
3848
4353
  let t3, t4;
3849
- $[10] !== indeterminate ? (t3 = () => {
4354
+ $[9] !== indeterminate ? (t3 = () => {
3850
4355
  ref.current && (ref.current.indeterminate = indeterminate || !1);
3851
- }, t4 = [indeterminate], $[10] = indeterminate, $[11] = t3, $[12] = t4) : (t3 = $[11], t4 = $[12]), useEffect(t3, t4);
4356
+ }, t4 = [indeterminate], $[9] = indeterminate, $[10] = t3, $[11] = t4) : (t3 = $[10], t4 = $[11]), useEffect(t3, t4);
3852
4357
  let t5;
3853
- $[13] !== className ? (t5 = _switch({
4358
+ $[12] !== className ? (t5 = _switch({
3854
4359
  className
3855
- }), $[13] = className, $[14] = t5) : t5 = $[14];
4360
+ }), $[12] = className, $[13] = t5) : t5 = $[13];
3856
4361
  let t6;
3857
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = _switchElement(), $[15] = t6) : t6 = $[15];
4362
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t6 = _switchElement(), $[14] = t6) : t6 = $[14];
3858
4363
  const t7 = !disabled && readOnly ? "" : void 0, t8 = disabled || readOnly;
3859
4364
  let t9;
3860
- $[16] !== Element2 || $[17] !== rest || $[18] !== t7 || $[19] !== t8 ? (t9 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t6, "data-read-only": t7, disabled: t8, type: "checkbox", ref }), $[16] = Element2, $[17] = rest, $[18] = t7, $[19] = t8, $[20] = t9) : t9 = $[20];
4365
+ $[15] !== Element2 || $[16] !== rest || $[17] !== t7 || $[18] !== t8 ? (t9 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t6, "data-read-only": t7, disabled: t8, type: "checkbox", ref }), $[15] = Element2, $[16] = rest, $[17] = t7, $[18] = t8, $[19] = t9) : t9 = $[19];
3861
4366
  let t10;
3862
- $[21] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsxs("span", { "aria-hidden": !0, className: _switchPresentation(), children: [
4367
+ $[20] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsxs("span", { "aria-hidden": !0, className: _switchPresentation(), children: [
3863
4368
  /* @__PURE__ */ jsx("span", { className: _switchTrack() }),
3864
4369
  /* @__PURE__ */ jsx("span", { className: _switchThumb() })
3865
- ] }), $[21] = t10) : t10 = $[21];
4370
+ ] }), $[20] = t10) : t10 = $[20];
3866
4371
  let t11;
3867
- return $[22] !== style || $[23] !== t5 || $[24] !== t9 ? (t11 = /* @__PURE__ */ jsxs(Box, { className: t5, "data-ui": "Switch", display: "block", position: "relative", style, children: [
4372
+ return $[21] !== t5 || $[22] !== t9 ? (t11 = /* @__PURE__ */ jsxs("span", { className: t5, "data-ui": "Switch", children: [
3868
4373
  t9,
3869
4374
  t10
3870
- ] }), $[22] = style, $[23] = t5, $[24] = t9, $[25] = t11) : t11 = $[25], t11;
4375
+ ] }), $[21] = t5, $[22] = t9, $[23] = t11) : t11 = $[23], t11;
3871
4376
  }
3872
4377
  const DEFAULT_TEXT_AREA_ELEMENT = "textarea";
3873
4378
  function TextArea(props) {
3874
- const $ = c(33), t0 = props;
3875
- let __unstable_disableFocusRing, customValidity, forwardedRef, readOnly, rest, t1, t2, t3, t4, t5, t6, t7;
4379
+ const $ = c(39), t0 = props;
4380
+ let __unstable_disableFocusRing, className, customValidity, flex, forwardedRef, readOnly, rest, t1, t2, t3, t4, t5, t6, t7, width;
3876
4381
  $[0] !== t0 ? ({
3877
4382
  __unstable_disableFocusRing,
3878
4383
  as: t1,
3879
4384
  border: t2,
4385
+ className,
3880
4386
  customValidity,
3881
4387
  disabled: t3,
4388
+ flex,
3882
4389
  fontSize: t4,
3883
4390
  gap: t5,
3884
4391
  padding: t6,
3885
4392
  radius: t7,
3886
4393
  readOnly,
3887
4394
  ref: forwardedRef,
4395
+ width,
3888
4396
  ...rest
3889
- } = t0, $[0] = t0, $[1] = __unstable_disableFocusRing, $[2] = customValidity, $[3] = forwardedRef, $[4] = readOnly, $[5] = rest, $[6] = t1, $[7] = t2, $[8] = t3, $[9] = t4, $[10] = t5, $[11] = t6, $[12] = t7) : (__unstable_disableFocusRing = $[1], customValidity = $[2], forwardedRef = $[3], readOnly = $[4], rest = $[5], t1 = $[6], t2 = $[7], t3 = $[8], t4 = $[9], t5 = $[10], t6 = $[11], t7 = $[12]);
4397
+ } = t0, $[0] = t0, $[1] = __unstable_disableFocusRing, $[2] = className, $[3] = customValidity, $[4] = flex, $[5] = forwardedRef, $[6] = readOnly, $[7] = rest, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5, $[13] = t6, $[14] = t7, $[15] = width) : (__unstable_disableFocusRing = $[1], className = $[2], customValidity = $[3], flex = $[4], forwardedRef = $[5], readOnly = $[6], rest = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12], t6 = $[13], t7 = $[14], width = $[15]);
3890
4398
  const Element2 = t1 === void 0 ? DEFAULT_TEXT_AREA_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, gap = t5 === void 0 ? 3 : t5, padding = t6 === void 0 ? 3 : t6, radius = t7 === void 0 ? 2 : t7, ref = useRef(null);
3891
4399
  let t8;
3892
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[13] = t8) : t8 = $[13], useImperativeHandle(forwardedRef, t8), useCustomValidity(ref, customValidity);
4400
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[16] = t8) : t8 = $[16], useImperativeHandle(forwardedRef, t8), useCustomValidity(ref, customValidity);
3893
4401
  let t9;
3894
- $[14] !== border || $[15] !== fontSize || $[16] !== gap || $[17] !== padding || $[18] !== radius ? (t9 = textArea({
4402
+ $[17] !== border || $[18] !== className || $[19] !== flex || $[20] !== fontSize || $[21] !== gap || $[22] !== padding || $[23] !== radius || $[24] !== width ? (t9 = textArea({
4403
+ className,
3895
4404
  border,
4405
+ flex,
3896
4406
  fontSize,
4407
+ gap,
3897
4408
  padding,
3898
4409
  radius,
3899
- gap
3900
- }), $[14] = border, $[15] = fontSize, $[16] = gap, $[17] = padding, $[18] = radius, $[19] = t9) : t9 = $[19];
4410
+ width
4411
+ }), $[17] = border, $[18] = className, $[19] = flex, $[20] = fontSize, $[21] = gap, $[22] = padding, $[23] = radius, $[24] = width, $[25] = t9) : t9 = $[25];
3901
4412
  const t10 = customValidity ? "" : void 0, t11 = !disabled && readOnly ? "" : void 0;
3902
4413
  let t12;
3903
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t12 = _inputElement(), $[20] = t12) : t12 = $[20];
4414
+ $[26] === Symbol.for("react.memo_cache_sentinel") ? (t12 = _inputElement(), $[26] = t12) : t12 = $[26];
3904
4415
  const t13 = __unstable_disableFocusRing ? "" : void 0;
3905
4416
  let t14;
3906
- $[21] !== Element2 || $[22] !== disabled || $[23] !== readOnly || $[24] !== rest || $[25] !== t13 ? (t14 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t12, "data-no-focus-ring": t13, disabled, readOnly, ref }), $[21] = Element2, $[22] = disabled, $[23] = readOnly, $[24] = rest, $[25] = t13, $[26] = t14) : t14 = $[26];
4417
+ $[27] !== Element2 || $[28] !== disabled || $[29] !== readOnly || $[30] !== rest || $[31] !== t13 ? (t14 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t12, "data-no-focus-ring": t13, disabled, readOnly, ref }), $[27] = Element2, $[28] = disabled, $[29] = readOnly, $[30] = rest, $[31] = t13, $[32] = t14) : t14 = $[32];
3907
4418
  let t15;
3908
- $[27] === Symbol.for("react.memo_cache_sentinel") ? (t15 = /* @__PURE__ */ jsx("span", { className: _inputPresentation() }), $[27] = t15) : t15 = $[27];
4419
+ $[33] === Symbol.for("react.memo_cache_sentinel") ? (t15 = /* @__PURE__ */ jsx("span", { className: _inputPresentation() }), $[33] = t15) : t15 = $[33];
3909
4420
  let t16;
3910
- return $[28] !== t10 || $[29] !== t11 || $[30] !== t14 || $[31] !== t9 ? (t16 = /* @__PURE__ */ jsxs("span", { className: t9, "data-invalid": t10, "data-read-only": t11, "data-ui": "TextArea", children: [
4421
+ return $[34] !== t10 || $[35] !== t11 || $[36] !== t14 || $[37] !== t9 ? (t16 = /* @__PURE__ */ jsxs("span", { className: t9, "data-invalid": t10, "data-read-only": t11, "data-ui": "TextArea", children: [
3911
4422
  t14,
3912
4423
  t15
3913
- ] }), $[28] = t10, $[29] = t11, $[30] = t14, $[31] = t9, $[32] = t16) : t16 = $[32], t16;
4424
+ ] }), $[34] = t10, $[35] = t11, $[36] = t14, $[37] = t9, $[38] = t16) : t16 = $[38], t16;
3914
4425
  }
3915
4426
  function useDelayedState(initialState) {
3916
4427
  const $ = c(3), [state, setState] = useState(initialState), delayedAction = useRef(void 0);
@@ -3940,29 +4451,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
3940
4451
  right: ["right-end", "right-start", "left", "top", "bottom"],
3941
4452
  "right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
3942
4453
  "right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
3943
- }, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/v3/tooltipDelayGroup", null);
3944
- function TooltipDelayGroupProvider(props) {
3945
- const $ = c(9), {
3946
- children,
3947
- delay
3948
- } = 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;
3949
- let t0;
3950
- const t1 = isGroupActive ? 1 : openDelay;
3951
- let t2;
3952
- $[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t1 ? (t2 = {
3953
- setIsGroupActive,
3954
- openTooltipId,
3955
- setOpenTooltipId,
3956
- openDelay: t1,
3957
- closeDelay
3958
- }, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t1, $[5] = t2) : t2 = $[5], t0 = t2;
3959
- const value = t0;
3960
- let t3;
3961
- return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsx(TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
3962
- }
3963
- function useTooltipDelayGroup() {
3964
- return useContext(TooltipDelayGroupContext);
3965
- }
4454
+ }, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/v4/tooltipDelayGroup", null);
3966
4455
  function TooltipLayer(props) {
3967
4456
  const $ = c(50);
3968
4457
  let animate, arrow2, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, rest, scheme, shadow, style, t0;
@@ -3984,101 +4473,108 @@ function TooltipLayer(props) {
3984
4473
  tone: t0,
3985
4474
  ...rest
3986
4475
  } = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = rest, $[13] = scheme, $[14] = shadow, $[15] = style, $[16] = t0) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], rest = $[12], scheme = $[13], shadow = $[14], style = $[15], t0 = $[16]);
3987
- const tone = t0 === void 0 ? "inherit" : t0;
3988
- let t1;
3989
- const t2 = animate ? "transform" : void 0;
3990
- let t3;
3991
- $[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t2 ? (t3 = {
4476
+ const tone = t0 === void 0 ? "inherit" : t0, t1 = animate ? "transform" : void 0;
4477
+ let t2;
4478
+ $[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t1 ? (t2 = {
3992
4479
  originX,
3993
4480
  originY,
3994
- willChange: t2,
4481
+ willChange: t1,
3995
4482
  ...style
3996
- }, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t2, $[21] = t3) : t3 = $[21], t1 = t3;
3997
- const rootStyle = t1;
3998
- let t4;
3999
- const t5 = arrowX !== null ? arrowX : void 0, t6 = arrowY !== null ? arrowY : void 0;
4000
- let t7;
4001
- $[22] !== t5 || $[23] !== t6 ? (t7 = {
4002
- left: t5,
4003
- top: t6,
4483
+ }, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t1, $[21] = t2) : t2 = $[21];
4484
+ const rootStyle = t2, t3 = arrowX !== null ? arrowX : void 0, t4 = arrowY !== null ? arrowY : void 0;
4485
+ let t5;
4486
+ $[22] !== t3 || $[23] !== t4 ? (t5 = {
4487
+ left: t3,
4488
+ top: t4,
4004
4489
  right: void 0,
4005
4490
  bottom: void 0
4006
- }, $[22] = t5, $[23] = t6, $[24] = t7) : t7 = $[24], t4 = t7;
4007
- const arrowStyle = t4, t8 = animate ? "" : void 0;
4491
+ }, $[22] = t3, $[23] = t4, $[24] = t5) : t5 = $[24];
4492
+ const arrowStyle = t5, t6 = animate ? "" : void 0;
4493
+ let t7;
4494
+ $[25] !== animate ? (t7 = animate ? ["hidden", "initial"] : void 0, $[25] = animate, $[26] = t7) : t7 = $[26];
4495
+ let t8;
4496
+ $[27] !== animate ? (t8 = animate ? ["visible", "scaleIn"] : void 0, $[27] = animate, $[28] = t8) : t8 = $[28];
4008
4497
  let t9;
4009
- $[25] !== animate ? (t9 = animate ? ["hidden", "initial"] : void 0, $[25] = animate, $[26] = t9) : t9 = $[26];
4498
+ $[29] !== animate ? (t9 = animate ? ["hidden", "scaleOut"] : void 0, $[29] = animate, $[30] = t9) : t9 = $[30];
4010
4499
  let t10;
4011
- $[27] !== animate ? (t10 = animate ? ["visible", "scaleIn"] : void 0, $[27] = animate, $[28] = t10) : t10 = $[28];
4500
+ $[31] !== arrow2 || $[32] !== arrowRef || $[33] !== arrowStyle ? (t10 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[31] = arrow2, $[32] = arrowRef, $[33] = arrowStyle, $[34] = t10) : t10 = $[34];
4012
4501
  let t11;
4013
- $[29] !== animate ? (t11 = animate ? ["hidden", "scaleOut"] : void 0, $[29] = animate, $[30] = t11) : t11 = $[30];
4014
- let t12;
4015
- $[31] !== arrow2 || $[32] !== arrowRef || $[33] !== arrowStyle ? (t12 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[31] = arrow2, $[32] = arrowRef, $[33] = arrowStyle, $[34] = t12) : t12 = $[34];
4016
- let t13;
4017
- return $[35] !== children || $[36] !== padding || $[37] !== placement || $[38] !== radius || $[39] !== rest || $[40] !== rootStyle || $[41] !== scheme || $[42] !== shadow || $[43] !== t10 || $[44] !== t11 || $[45] !== t12 || $[46] !== t8 || $[47] !== t9 || $[48] !== tone ? (t13 = /* @__PURE__ */ jsxs(Layer, { "data-ui": "Tooltip__layer", ...rest, as: motion.div, "data-animate": t8, "data-placement": placement, padding, radius, scheme, shadow, style: rootStyle, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t9, animate: t10, exit: t11, tone, children: [
4502
+ return $[35] !== children || $[36] !== padding || $[37] !== placement || $[38] !== radius || $[39] !== rest || $[40] !== rootStyle || $[41] !== scheme || $[42] !== shadow || $[43] !== t10 || $[44] !== t6 || $[45] !== t7 || $[46] !== t8 || $[47] !== t9 || $[48] !== tone ? (t11 = /* @__PURE__ */ jsxs(Layer, { "data-ui": "Tooltip__layer", ...rest, as: motion.div, "data-animate": t6, "data-placement": placement, padding, radius, scheme, shadow, style: rootStyle, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t7, animate: t8, exit: t9, tone, children: [
4018
4503
  children,
4019
- t12
4020
- ] }), $[35] = children, $[36] = padding, $[37] = placement, $[38] = radius, $[39] = rest, $[40] = rootStyle, $[41] = scheme, $[42] = shadow, $[43] = t10, $[44] = t11, $[45] = t12, $[46] = t8, $[47] = t9, $[48] = tone, $[49] = t13) : t13 = $[49], t13;
4504
+ t10
4505
+ ] }), $[35] = children, $[36] = padding, $[37] = placement, $[38] = radius, $[39] = rest, $[40] = rootStyle, $[41] = scheme, $[42] = shadow, $[43] = t10, $[44] = t6, $[45] = t7, $[46] = t8, $[47] = t9, $[48] = tone, $[49] = t11) : t11 = $[49], t11;
4021
4506
  }
4022
4507
  const DEFAULT_TOOLTIP_ELEMENT = "div";
4023
4508
  function Tooltip(props) {
4024
- const boundaryElementContext = useBoundaryElement(), {
4025
- animate: _animate = !1,
4026
- arrow: arrowProp = !1,
4027
- as = DEFAULT_TOOLTIP_ELEMENT,
4028
- boundaryElement = boundaryElementContext?.element,
4509
+ const $ = c(143), t0 = props;
4510
+ let _boundaryElement, _fallbackPlacements, childProp, className, content2, delay, disabled, forwardedRef, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, t8, t9;
4511
+ $[0] !== t0 ? ({
4512
+ animate: t1,
4513
+ arrow: t2,
4514
+ as: t3,
4515
+ boundaryElement: _boundaryElement,
4029
4516
  children: childProp,
4030
4517
  className,
4031
4518
  content: content2,
4032
4519
  delay,
4033
4520
  disabled,
4034
- fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"],
4035
- padding = 2,
4036
- placement: placementProp = "bottom",
4521
+ fallbackPlacements: _fallbackPlacements,
4522
+ padding: t4,
4523
+ placement: t5,
4037
4524
  portal: portalProp,
4038
- radius = 3,
4525
+ radius: t6,
4039
4526
  ref: forwardedRef,
4040
4527
  scheme,
4041
- shadow = 2,
4042
- zOffset = Z_OFFSETS.tooltip,
4043
- tone = "inherit",
4528
+ shadow: t7,
4529
+ zOffset: t8,
4530
+ tone: t9,
4044
4531
  ...rest
4045
- } = props, card2 = useCard(), animate = usePrefersReducedMotion() ? !1 : _animate, ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
4046
- useImperativeHandle(forwardedRef, () => ref.current);
4047
- const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, middleware = useMemo(() => {
4048
- const ret = [];
4049
- return ret.push(flip({
4050
- boundary: boundaryElement || void 0,
4051
- fallbackPlacements,
4052
- padding: DEFAULT_TOOLTIP_PADDING,
4053
- rootBoundary
4054
- })), ret.push(offset({
4055
- mainAxis: DEFAULT_TOOLTIP_DISTANCE
4056
- })), ret.push(shift({
4057
- boundary: boundaryElement || void 0,
4058
- rootBoundary,
4059
- padding: DEFAULT_TOOLTIP_PADDING
4060
- })), arrowProp && ret.push(arrow({
4061
- element: arrowRef,
4062
- padding: DEFAULT_TOOLTIP_PADDING
4063
- })), animate && ret.push(origin), ret;
4064
- }, [animate, arrowProp, boundaryElement, fallbackPlacements]), {
4532
+ } = t0, $[0] = t0, $[1] = _boundaryElement, $[2] = _fallbackPlacements, $[3] = childProp, $[4] = className, $[5] = content2, $[6] = delay, $[7] = disabled, $[8] = forwardedRef, $[9] = portalProp, $[10] = rest, $[11] = scheme, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5, $[17] = t6, $[18] = t7, $[19] = t8, $[20] = t9) : (_boundaryElement = $[1], _fallbackPlacements = $[2], childProp = $[3], className = $[4], content2 = $[5], delay = $[6], disabled = $[7], forwardedRef = $[8], portalProp = $[9], rest = $[10], scheme = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], t5 = $[16], t6 = $[17], t7 = $[18], t8 = $[19], t9 = $[20]);
4533
+ const _animate = t1 === void 0 ? !1 : t1, arrowProp = t2 === void 0 ? !1 : t2, as = t3 === void 0 ? DEFAULT_TOOLTIP_ELEMENT : t3, padding = t4 === void 0 ? 2 : t4, placementProp = t5 === void 0 ? "bottom" : t5, radius = t6 === void 0 ? 3 : t6, shadow = t7 === void 0 ? 2 : t7, zOffset = t8 === void 0 ? Z_OFFSETS.tooltip : t8, tone = t9 === void 0 ? "inherit" : t9, boundaryElement = _boundaryElement ?? use(BoundaryElementContext), fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], animate = usePrefersReducedMotion() ? !1 : _animate, ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
4534
+ let t10;
4535
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => ref.current, $[21] = t10) : t10 = $[21], useImperativeHandle(forwardedRef, t10);
4536
+ let portalElement = null;
4537
+ if (portalProp) {
4538
+ const portal = use(PortalContext);
4539
+ assertPortalContext(portal), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element;
4540
+ }
4541
+ let t11;
4542
+ $[22] !== animate || $[23] !== arrowProp || $[24] !== boundaryElement || $[25] !== fallbackPlacements ? (t11 = {
4543
+ animate,
4544
+ arrowProp,
4545
+ arrowRef,
4546
+ boundaryElement,
4547
+ fallbackPlacements,
4548
+ rootBoundary: "viewport"
4549
+ }, $[22] = animate, $[23] = arrowProp, $[24] = boundaryElement, $[25] = fallbackPlacements, $[26] = t11) : t11 = $[26];
4550
+ const middleware = useMiddleware(t11);
4551
+ let t12;
4552
+ $[27] !== referenceElement ? (t12 = {
4553
+ reference: referenceElement
4554
+ }, $[27] = referenceElement, $[28] = t12) : t12 = $[28];
4555
+ let t13;
4556
+ $[29] !== middleware || $[30] !== placementProp || $[31] !== t12 ? (t13 = {
4557
+ middleware,
4558
+ placement: placementProp,
4559
+ whileElementsMounted: autoUpdate,
4560
+ elements: t12,
4561
+ transform: !1
4562
+ }, $[29] = middleware, $[30] = placementProp, $[31] = t12, $[32] = t13) : t13 = $[32];
4563
+ const {
4065
4564
  floatingStyles,
4066
4565
  placement,
4067
4566
  middlewareData,
4068
4567
  refs,
4069
4568
  update
4070
- } = useFloating({
4071
- middleware,
4072
- placement: placementProp,
4073
- whileElementsMounted: autoUpdate,
4074
- elements: {
4075
- reference: referenceElement
4076
- },
4077
- transform: !1
4078
- }), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), {
4569
+ } = useFloating(t13), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = use(TooltipDelayGroupContext);
4570
+ let t14;
4571
+ $[33] !== delayGroupContext ? (t14 = delayGroupContext || {}, $[33] = delayGroupContext, $[34] = t14) : t14 = $[34];
4572
+ const {
4079
4573
  setIsGroupActive,
4080
4574
  setOpenTooltipId
4081
- } = 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 = useCallback((open, immediate) => {
4575
+ } = t14, 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;
4576
+ let t15;
4577
+ $[35] !== closeDelay || $[36] !== isInsideGroup || $[37] !== openDelay || $[38] !== setIsGroupActive || $[39] !== setIsOpen || $[40] !== setOpenTooltipId || $[41] !== tooltipId ? (t15 = (open, immediate) => {
4082
4578
  if (isInsideGroup)
4083
4579
  if (open) {
4084
4580
  const groupedOpenDelay = immediate ? 0 : openDelay;
@@ -4089,65 +4585,183 @@ function Tooltip(props) {
4089
4585
  }
4090
4586
  else
4091
4587
  setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
4092
- }, [isInsideGroup, openDelay, setIsGroupActive, setOpenTooltipId, tooltipId, closeDelay, setIsOpen]), handleBlur = useCallback((e) => {
4588
+ }, $[35] = closeDelay, $[36] = isInsideGroup, $[37] = openDelay, $[38] = setIsGroupActive, $[39] = setIsOpen, $[40] = setOpenTooltipId, $[41] = tooltipId, $[42] = t15) : t15 = $[42];
4589
+ const handleIsOpenChange = t15;
4590
+ let t16;
4591
+ $[43] !== childProp?.props || $[44] !== handleIsOpenChange ? (t16 = (e) => {
4093
4592
  handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
4094
- }, [childProp?.props, handleIsOpenChange]), handleClick = useCallback((e_0) => {
4593
+ }, $[43] = childProp?.props, $[44] = handleIsOpenChange, $[45] = t16) : t16 = $[45];
4594
+ const handleBlur = t16;
4595
+ let t17;
4596
+ $[46] !== childProp?.props || $[47] !== handleIsOpenChange ? (t17 = (e_0) => {
4095
4597
  handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
4096
- }, [childProp?.props, handleIsOpenChange]), handleContextMenu = useCallback((e_1) => {
4598
+ }, $[46] = childProp?.props, $[47] = handleIsOpenChange, $[48] = t17) : t17 = $[48];
4599
+ const handleClick = t17;
4600
+ let t18;
4601
+ $[49] !== childProp?.props || $[50] !== handleIsOpenChange ? (t18 = (e_1) => {
4097
4602
  handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
4098
- }, [childProp?.props, handleIsOpenChange]), handleFocus = useCallback((e_2) => {
4603
+ }, $[49] = childProp?.props, $[50] = handleIsOpenChange, $[51] = t18) : t18 = $[51];
4604
+ const handleContextMenu = t18;
4605
+ let t19;
4606
+ $[52] !== childProp?.props || $[53] !== handleIsOpenChange ? (t19 = (e_2) => {
4099
4607
  handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
4100
- }, [childProp?.props, handleIsOpenChange]), handleMouseEnter = useCallback((e_3) => {
4608
+ }, $[52] = childProp?.props, $[53] = handleIsOpenChange, $[54] = t19) : t19 = $[54];
4609
+ const handleFocus = t19;
4610
+ let t20;
4611
+ $[55] !== childProp?.props || $[56] !== handleIsOpenChange ? (t20 = (e_3) => {
4101
4612
  handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
4102
- }, [childProp?.props, handleIsOpenChange]), handleMouseLeave = useCallback((e_4) => {
4613
+ }, $[55] = childProp?.props, $[56] = handleIsOpenChange, $[57] = t20) : t20 = $[57];
4614
+ const handleMouseEnter = t20;
4615
+ let t21;
4616
+ $[58] !== childProp?.props || $[59] !== handleIsOpenChange ? (t21 = (e_4) => {
4103
4617
  handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
4104
- }, [childProp?.props, handleIsOpenChange]);
4105
- useCloseOnMouseLeave({
4618
+ }, $[58] = childProp?.props, $[59] = handleIsOpenChange, $[60] = t21) : t21 = $[60];
4619
+ const handleMouseLeave = t21;
4620
+ let t22;
4621
+ $[61] !== handleIsOpenChange || $[62] !== isInsideGroup || $[63] !== referenceElement || $[64] !== showTooltip ? (t22 = {
4106
4622
  handleIsOpenChange,
4107
4623
  referenceElement,
4108
4624
  showTooltip,
4109
4625
  isInsideGroup
4110
- }), useEffect(() => {
4626
+ }, $[61] = handleIsOpenChange, $[62] = isInsideGroup, $[63] = referenceElement, $[64] = showTooltip, $[65] = t22) : t22 = $[65], useCloseOnMouseLeave(t22);
4627
+ let t23, t24;
4628
+ $[66] !== disabled || $[67] !== handleIsOpenChange || $[68] !== showTooltip ? (t23 = () => {
4111
4629
  disabled && showTooltip && handleIsOpenChange(!1);
4112
- }, [disabled, handleIsOpenChange, showTooltip]), useEffect(() => {
4630
+ }, t24 = [disabled, handleIsOpenChange, showTooltip], $[66] = disabled, $[67] = handleIsOpenChange, $[68] = showTooltip, $[69] = t23, $[70] = t24) : (t23 = $[69], t24 = $[70]), useEffect(t23, t24);
4631
+ let t25, t26;
4632
+ $[71] !== content2 || $[72] !== handleIsOpenChange || $[73] !== showTooltip ? (t25 = () => {
4113
4633
  !content2 && showTooltip && handleIsOpenChange(!1);
4114
- }, [content2, handleIsOpenChange, showTooltip]), useEffect(() => {
4115
- if (!showTooltip) return;
4116
- function handleWindowKeyDown(event) {
4634
+ }, t26 = [content2, handleIsOpenChange, showTooltip], $[71] = content2, $[72] = handleIsOpenChange, $[73] = showTooltip, $[74] = t25, $[75] = t26) : (t25 = $[74], t26 = $[75]), useEffect(t25, t26);
4635
+ let t27, t28;
4636
+ $[76] !== handleIsOpenChange || $[77] !== showTooltip ? (t27 = () => {
4637
+ if (!showTooltip)
4638
+ return;
4639
+ const handleWindowKeyDown = function(event) {
4117
4640
  event.key === "Escape" && handleIsOpenChange(!1, !0);
4118
- }
4641
+ };
4119
4642
  return window.addEventListener("keydown", handleWindowKeyDown), () => {
4120
4643
  window.removeEventListener("keydown", handleWindowKeyDown);
4121
4644
  };
4122
- }, [handleIsOpenChange, showTooltip]), useLayoutEffect(() => {
4645
+ }, t28 = [handleIsOpenChange, showTooltip], $[76] = handleIsOpenChange, $[77] = showTooltip, $[78] = t27, $[79] = t28) : (t27 = $[78], t28 = $[79]), useEffect(t27, t28);
4646
+ let t29;
4647
+ $[80] !== boundaryElement || $[81] !== portalElement ? (t29 = () => {
4123
4648
  const availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
4124
4649
  setTooltipMaxWidth(Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2);
4125
- }, [boundaryElement, portalElement]);
4126
- const setArrow = useCallback((arrowEl) => {
4650
+ }, $[80] = boundaryElement, $[81] = portalElement, $[82] = t29) : t29 = $[82];
4651
+ let t30;
4652
+ $[83] !== boundaryElement || $[84] !== portalElement ? (t30 = [boundaryElement, portalElement], $[83] = boundaryElement, $[84] = portalElement, $[85] = t30) : t30 = $[85], useLayoutEffect(t29, t30);
4653
+ let t31;
4654
+ $[86] !== update ? (t31 = (arrowEl) => {
4127
4655
  arrowRef.current = arrowEl, update();
4128
- }, [update]), setFloating = useCallback((node) => {
4656
+ }, $[86] = update, $[87] = t31) : t31 = $[87];
4657
+ const setArrow = t31;
4658
+ let t32;
4659
+ $[88] !== refs ? (t32 = (node) => {
4129
4660
  ref.current = node, refs.setFloating(node);
4130
- }, [refs]), child = useMemo(() => childProp ? cloneElement(childProp, {
4131
- onBlur: handleBlur,
4132
- onFocus: handleFocus,
4133
- onMouseEnter: handleMouseEnter,
4134
- onMouseLeave: handleMouseLeave,
4135
- onClick: handleClick,
4136
- onContextMenu: handleContextMenu,
4137
- ref: setReferenceElement
4138
- }) : null, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave]);
4139
- if (useImperativeHandle(childProp ? getElementRef(childProp) : null, () => referenceElement, [referenceElement]), !child) return /* @__PURE__ */ jsx(Fragment, {});
4140
- if (disabled) return child;
4141
- const node_0 = /* @__PURE__ */ jsx(TooltipLayer, { "data-ui": "Tooltip", ...rest, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, className: tooltip({
4661
+ }, $[88] = refs, $[89] = t32) : t32 = $[89];
4662
+ const setFloating = t32;
4663
+ let t33;
4664
+ bb0: {
4665
+ if (!childProp) {
4666
+ t33 = null;
4667
+ break bb0;
4668
+ }
4669
+ let t342;
4670
+ $[90] !== childProp || $[91] !== handleBlur || $[92] !== handleClick || $[93] !== handleContextMenu || $[94] !== handleFocus || $[95] !== handleMouseEnter || $[96] !== handleMouseLeave ? (t342 = cloneElement(childProp, {
4671
+ onBlur: handleBlur,
4672
+ onFocus: handleFocus,
4673
+ onMouseEnter: handleMouseEnter,
4674
+ onMouseLeave: handleMouseLeave,
4675
+ onClick: handleClick,
4676
+ onContextMenu: handleContextMenu,
4677
+ ref: setReferenceElement
4678
+ }), $[90] = childProp, $[91] = handleBlur, $[92] = handleClick, $[93] = handleContextMenu, $[94] = handleFocus, $[95] = handleMouseEnter, $[96] = handleMouseLeave, $[97] = t342) : t342 = $[97], t33 = t342;
4679
+ }
4680
+ const child = t33;
4681
+ let t34;
4682
+ $[98] !== childProp ? (t34 = childProp ? getElementRef(childProp) : null, $[98] = childProp, $[99] = t34) : t34 = $[99];
4683
+ let t35, t36;
4684
+ if ($[100] !== referenceElement ? (t35 = () => referenceElement, t36 = [referenceElement], $[100] = referenceElement, $[101] = t35, $[102] = t36) : (t35 = $[101], t36 = $[102]), useImperativeHandle(t34, t35, t36), !child) {
4685
+ let t372;
4686
+ return $[103] === Symbol.for("react.memo_cache_sentinel") ? (t372 = /* @__PURE__ */ jsx(Fragment, {}), $[103] = t372) : t372 = $[103], t372;
4687
+ }
4688
+ if (disabled)
4689
+ return child;
4690
+ let t37;
4691
+ $[104] !== className ? (t37 = tooltip({
4142
4692
  className
4143
- }), originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, style: {
4693
+ }), $[104] = className, $[105] = t37) : t37 = $[105];
4694
+ const t38 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0;
4695
+ let t39;
4696
+ $[106] !== floatingStyles || $[107] !== t38 ? (t39 = {
4144
4697
  ...floatingStyles,
4145
- maxWidth: tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0
4146
- }, tone, zOffset, children: content2 }), children = showTooltip && (portalProp ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: /* @__PURE__ */ jsx(CardProvider, { tone: tone === "inherit" ? card2.tone : tone, scheme: scheme ?? "light", children: node_0 }) }) : node_0);
4147
- return /* @__PURE__ */ jsxs(Fragment, { children: [
4148
- animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
4698
+ maxWidth: t38
4699
+ }, $[106] = floatingStyles, $[107] = t38, $[108] = t39) : t39 = $[108];
4700
+ let t40;
4701
+ $[109] !== animate || $[110] !== arrowProp || $[111] !== arrowX || $[112] !== arrowY || $[113] !== as || $[114] !== content2 || $[115] !== originX || $[116] !== originY || $[117] !== padding || $[118] !== placement || $[119] !== radius || $[120] !== rest || $[121] !== scheme || $[122] !== setArrow || $[123] !== setFloating || $[124] !== shadow || $[125] !== t37 || $[126] !== t39 || $[127] !== tone || $[128] !== zOffset ? (t40 = /* @__PURE__ */ jsx(TooltipLayer, { "data-ui": "Tooltip", ...rest, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, className: t37, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, style: t39, tone, zOffset, children: content2 }), $[109] = animate, $[110] = arrowProp, $[111] = arrowX, $[112] = arrowY, $[113] = as, $[114] = content2, $[115] = originX, $[116] = originY, $[117] = padding, $[118] = placement, $[119] = radius, $[120] = rest, $[121] = scheme, $[122] = setArrow, $[123] = setFloating, $[124] = shadow, $[125] = t37, $[126] = t39, $[127] = tone, $[128] = zOffset, $[129] = t40) : t40 = $[129];
4702
+ const node_0 = t40;
4703
+ let children = showTooltip ? node_0 : null;
4704
+ if (showTooltip && portalProp) {
4705
+ let resolvedTone = tone;
4706
+ if (tone === "inherit") {
4707
+ const card2 = use(CardContext);
4708
+ assertCardContext(card2), resolvedTone = card2.tone;
4709
+ }
4710
+ const t412 = typeof portalProp == "string" ? portalProp : void 0, t422 = scheme ?? "light";
4711
+ let t43;
4712
+ $[130] !== node_0 || $[131] !== resolvedTone || $[132] !== t422 ? (t43 = /* @__PURE__ */ jsx(CardProvider, { tone: resolvedTone, scheme: t422, children: node_0 }), $[130] = node_0, $[131] = resolvedTone, $[132] = t422, $[133] = t43) : t43 = $[133];
4713
+ let t44;
4714
+ $[134] !== t412 || $[135] !== t43 ? (t44 = /* @__PURE__ */ jsx(Portal, { __unstable_name: t412, children: t43 }), $[134] = t412, $[135] = t43, $[136] = t44) : t44 = $[136], children = t44;
4715
+ }
4716
+ let t41;
4717
+ $[137] !== animate || $[138] !== children ? (t41 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[137] = animate, $[138] = children, $[139] = t41) : t41 = $[139];
4718
+ let t42;
4719
+ return $[140] !== child || $[141] !== t41 ? (t42 = /* @__PURE__ */ jsxs(Fragment, { children: [
4720
+ t41,
4149
4721
  child
4150
- ] });
4722
+ ] }), $[140] = child, $[141] = t41, $[142] = t42) : t42 = $[142], t42;
4723
+ }
4724
+ function useMiddleware(t0) {
4725
+ const $ = c(17), {
4726
+ animate,
4727
+ arrowProp,
4728
+ arrowRef,
4729
+ boundaryElement,
4730
+ fallbackPlacements,
4731
+ rootBoundary
4732
+ } = t0;
4733
+ let ret;
4734
+ if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== boundaryElement || $[4] !== fallbackPlacements || $[5] !== rootBoundary) {
4735
+ ret = [];
4736
+ const t1 = boundaryElement || void 0;
4737
+ let t2;
4738
+ $[7] !== fallbackPlacements || $[8] !== rootBoundary || $[9] !== t1 ? (t2 = flip({
4739
+ boundary: t1,
4740
+ fallbackPlacements,
4741
+ padding: DEFAULT_TOOLTIP_PADDING,
4742
+ rootBoundary
4743
+ }), $[7] = fallbackPlacements, $[8] = rootBoundary, $[9] = t1, $[10] = t2) : t2 = $[10], ret.push(t2);
4744
+ let t3;
4745
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t3 = offset({
4746
+ mainAxis: DEFAULT_TOOLTIP_DISTANCE
4747
+ }), $[11] = t3) : t3 = $[11], ret.push(t3);
4748
+ const t4 = boundaryElement || void 0;
4749
+ let t5;
4750
+ if ($[12] !== rootBoundary || $[13] !== t4 ? (t5 = shift({
4751
+ boundary: t4,
4752
+ rootBoundary,
4753
+ padding: DEFAULT_TOOLTIP_PADDING
4754
+ }), $[12] = rootBoundary, $[13] = t4, $[14] = t5) : t5 = $[14], ret.push(t5), arrowProp) {
4755
+ let t6;
4756
+ $[15] !== arrowRef ? (t6 = arrow({
4757
+ element: arrowRef,
4758
+ padding: DEFAULT_TOOLTIP_PADDING
4759
+ }), $[15] = arrowRef, $[16] = t6) : t6 = $[16], ret.push(t6);
4760
+ }
4761
+ animate && ret.push(origin), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = boundaryElement, $[4] = fallbackPlacements, $[5] = rootBoundary, $[6] = ret;
4762
+ } else
4763
+ ret = $[6];
4764
+ return ret;
4151
4765
  }
4152
4766
  function useCloseOnMouseLeave(t0) {
4153
4767
  const $ = c(10), {
@@ -4173,19 +4787,41 @@ function useCloseOnMouseLeave(t0) {
4173
4787
  let t3;
4174
4788
  $[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], useEffect(t2, t3);
4175
4789
  }
4790
+ function TooltipDelayGroupProvider(props) {
4791
+ const $ = c(9), {
4792
+ children,
4793
+ delay
4794
+ } = 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, t0 = isGroupActive ? 1 : openDelay;
4795
+ let t1;
4796
+ $[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t0 ? (t1 = {
4797
+ setIsGroupActive,
4798
+ openTooltipId,
4799
+ setOpenTooltipId,
4800
+ openDelay: t0,
4801
+ closeDelay
4802
+ }, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t0, $[5] = t1) : t1 = $[5];
4803
+ const value = t1;
4804
+ let t2;
4805
+ return $[6] !== children || $[7] !== value ? (t2 = /* @__PURE__ */ jsx(TooltipDelayGroupContext, { value, children }), $[6] = children, $[7] = value, $[8] = t2) : t2 = $[8], t2;
4806
+ }
4807
+ function useTooltipDelayGroup() {
4808
+ return use(TooltipDelayGroupContext);
4809
+ }
4176
4810
  function BoundaryElementProvider(props) {
4177
- const $ = c(5), {
4811
+ const $ = c(3), {
4178
4812
  children,
4179
4813
  element
4180
4814
  } = props;
4181
- let t0, t1;
4182
- $[0] !== element ? (t1 = {
4815
+ let t0;
4816
+ return $[0] !== children || $[1] !== element ? (t0 = /* @__PURE__ */ jsx(BoundaryElementContext, { value: element, children }), $[0] = children, $[1] = element, $[2] = t0) : t0 = $[2], t0;
4817
+ }
4818
+ function useBoundaryElement() {
4819
+ const $ = c(2), element = use(BoundaryElementContext);
4820
+ let t0;
4821
+ return $[0] !== element ? (t0 = {
4183
4822
  version: 0,
4184
4823
  element
4185
- }, $[0] = element, $[1] = t1) : t1 = $[1], t0 = t1;
4186
- const value = t0;
4187
- let t2;
4188
- return $[2] !== children || $[3] !== value ? (t2 = /* @__PURE__ */ jsx(BoundaryElementContext.Provider, { value, children }), $[2] = children, $[3] = value, $[4] = t2) : t2 = $[4], t2;
4824
+ }, $[0] = element, $[1] = t0) : t0 = $[1], t0;
4189
4825
  }
4190
4826
  function findMaxBreakpoints(media2, width) {
4191
4827
  const ret = [];
@@ -4210,30 +4846,25 @@ function ElementQuery(props) {
4210
4846
  ref: forwardedRef,
4211
4847
  ...rest
4212
4848
  } = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = mediaProp, $[4] = rest, $[5] = t1) : (children = $[1], forwardedRef = $[2], mediaProp = $[3], rest = $[4], t1 = $[5]);
4213
- const Element2 = t1 === void 0 ? DEFAULT_ELEMENT_QUERY_ELEMENT : t1, breakpoints = mediaProp ?? DEFAULT_BREAKPOINTS, [element, setElement] = useState(null), elementSize = useElementSize(element);
4849
+ const Element2 = t1 === void 0 ? DEFAULT_ELEMENT_QUERY_ELEMENT : t1, breakpoints = mediaProp ?? DEFAULT_BREAKPOINTS, [element, setElement] = useState(null), width = useElementSize(element)?.border.width ?? window.innerWidth;
4214
4850
  let t2;
4215
- t2 = elementSize?.border.width ?? window.innerWidth;
4216
- const width = t2;
4217
- let t3, t4;
4218
4851
  if ($[6] !== breakpoints || $[7] !== width) {
4219
4852
  const eq = findMaxBreakpoints(breakpoints, width);
4220
- t4 = eq.length ? eq.join(" ") : void 0, $[6] = breakpoints, $[7] = width, $[8] = t4;
4853
+ t2 = eq.length ? eq.join(" ") : void 0, $[6] = breakpoints, $[7] = width, $[8] = t2;
4221
4854
  } else
4222
- t4 = $[8];
4223
- t3 = t4;
4224
- const max = t3;
4225
- let t5, t6;
4855
+ t2 = $[8];
4856
+ const max = t2;
4857
+ let t3;
4226
4858
  if ($[9] !== breakpoints || $[10] !== width) {
4227
4859
  const eq_0 = findMinBreakpoints(breakpoints, width);
4228
- t6 = eq_0.length ? eq_0.join(" ") : void 0, $[9] = breakpoints, $[10] = width, $[11] = t6;
4860
+ t3 = eq_0.length ? eq_0.join(" ") : void 0, $[9] = breakpoints, $[10] = width, $[11] = t3;
4229
4861
  } else
4230
- t6 = $[11];
4231
- t5 = t6;
4232
- const min = t5;
4233
- let t7, t8;
4234
- $[12] !== element ? (t7 = () => element, t8 = [element], $[12] = element, $[13] = t7, $[14] = t8) : (t7 = $[13], t8 = $[14]), useImperativeHandle(forwardedRef, t7, t8);
4235
- let t9;
4236
- return $[15] !== Element2 || $[16] !== children || $[17] !== max || $[18] !== min || $[19] !== rest ? (t9 = /* @__PURE__ */ jsx(Element2, { "data-ui": "ElementQuery", ...rest, "data-eq-max": max, "data-eq-min": min, ref: setElement, children }), $[15] = Element2, $[16] = children, $[17] = max, $[18] = min, $[19] = rest, $[20] = t9) : t9 = $[20], t9;
4862
+ t3 = $[11];
4863
+ const min = t3;
4864
+ let t4, t5;
4865
+ $[12] !== element ? (t4 = () => element, t5 = [element], $[12] = element, $[13] = t4, $[14] = t5) : (t4 = $[13], t5 = $[14]), useImperativeHandle(forwardedRef, t4, t5);
4866
+ let t6;
4867
+ return $[15] !== Element2 || $[16] !== children || $[17] !== max || $[18] !== min || $[19] !== rest ? (t6 = /* @__PURE__ */ jsx(Element2, { "data-ui": "ElementQuery", ...rest, "data-eq-max": max, "data-eq-min": min, ref: setElement, children }), $[15] = Element2, $[16] = children, $[17] = max, $[18] = min, $[19] = rest, $[20] = t6) : t6 = $[20], t6;
4237
4868
  }
4238
4869
  class ErrorBoundary extends Component {
4239
4870
  state = {
@@ -4266,39 +4897,27 @@ function PortalProvider(props) {
4266
4897
  const $ = c(9), {
4267
4898
  children,
4268
4899
  element,
4269
- __unstable_elements: elementsProp
4270
- } = props, elements = useUnique(elementsProp), parentPortal = useContext(PortalContext);
4900
+ __unstable_elements: elements
4901
+ } = props, parentPortal = use(PortalContext);
4271
4902
  let t0;
4272
4903
  $[0] !== elements || $[1] !== parentPortal ? (t0 = () => elements?.default ?? (parentPortal.element || document.body), $[0] = elements, $[1] = parentPortal, $[2] = t0) : t0 = $[2];
4273
- const fallbackElement = useSyncExternalStore(emptySubscribe, t0, _temp);
4274
- let t1;
4275
- const t2 = element || fallbackElement;
4276
- let t3;
4277
- $[3] !== elements || $[4] !== t2 ? (t3 = {
4904
+ const fallbackElement = useSyncExternalStore(emptySubscribe, t0, _temp), t1 = element || fallbackElement;
4905
+ let t2;
4906
+ $[3] !== elements || $[4] !== t1 ? (t2 = {
4278
4907
  version: 0,
4279
4908
  boundaryElement: null,
4280
- element: t2,
4909
+ element: t1,
4281
4910
  elements
4282
- }, $[3] = elements, $[4] = t2, $[5] = t3) : t3 = $[5], t1 = t3;
4283
- const value = t1;
4284
- let t4;
4285
- return $[6] !== children || $[7] !== value ? (t4 = /* @__PURE__ */ jsx(PortalContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t4) : t4 = $[8], t4;
4911
+ }, $[3] = elements, $[4] = t1, $[5] = t2) : t2 = $[5];
4912
+ const value = t2;
4913
+ let t3;
4914
+ return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsx(PortalContext, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
4286
4915
  }
4287
4916
  function _temp() {
4288
4917
  return null;
4289
4918
  }
4290
4919
  const emptySubscribe = () => () => {
4291
4920
  };
4292
- function useUnique(value) {
4293
- const valueRef = useRef(value);
4294
- return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
4295
- }
4296
- function _isEqual(objA, objB) {
4297
- if (!objA || !objB)
4298
- return objA === objB;
4299
- const keysA = Object.keys(objA), keysB = Object.keys(objB);
4300
- return keysA.length !== keysB.length ? !1 : keysA.every((key2) => objA[key2] === objB[key2]);
4301
- }
4302
4921
  function RootProvider(props) {
4303
4922
  const $ = c(10), {
4304
4923
  boundaryElement: t0,
@@ -4485,7 +5104,6 @@ export {
4485
5104
  VirtualList,
4486
5105
  _ResizeObserver,
4487
5106
  _elementSizeObserver,
4488
- _getArrayProp,
4489
5107
  _getResponsiveProp,
4490
5108
  _hasFocus,
4491
5109
  _isEnterToClickElement,
@@ -4516,7 +5134,6 @@ export {
4516
5134
  usePortal,
4517
5135
  usePrefersDark,
4518
5136
  usePrefersReducedMotion,
4519
- useResponsiveProp,
4520
5137
  useToast,
4521
5138
  useTooltipDelayGroup,
4522
5139
  useTree