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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (829) hide show
  1. package/README.md +7 -6
  2. package/bin/{ui.js → sanity-ui.cjs} +1 -1
  3. package/dist/_chunks-cjs/_visual-editing.cjs +2488 -0
  4. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
  5. package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -2
  6. package/dist/_chunks-cjs/refractor.cjs.map +1 -0
  7. package/dist/_chunks-es/_visual-editing.js +2500 -0
  8. package/dist/_chunks-es/_visual-editing.js.map +1 -0
  9. package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -2
  10. package/dist/_chunks-es/refractor.js.map +1 -0
  11. package/dist/_visual-editing.cjs +30 -0
  12. package/dist/_visual-editing.cjs.map +1 -0
  13. package/dist/_visual-editing.d.cts +893 -0
  14. package/dist/_visual-editing.d.ts +503 -416
  15. package/dist/_visual-editing.js +29 -30
  16. package/dist/_visual-editing.js.map +1 -1
  17. package/dist/css.cjs +598 -0
  18. package/dist/css.cjs.map +1 -0
  19. package/dist/css.d.cts +14884 -0
  20. package/dist/css.d.ts +14379 -1630
  21. package/dist/css.js +480 -4594
  22. package/dist/css.js.map +1 -1
  23. package/dist/index.cjs +2222 -0
  24. package/dist/index.cjs.map +1 -0
  25. package/dist/{index.d.mts → index.d.cts} +1284 -961
  26. package/dist/index.d.ts +1284 -961
  27. package/dist/index.js +1270 -592
  28. package/dist/index.js.map +1 -1
  29. package/dist/{theme.mjs → theme.cjs} +2843 -2571
  30. package/dist/theme.cjs.map +1 -0
  31. package/dist/{theme.d.mts → theme.d.cts} +331 -311
  32. package/dist/theme.d.ts +331 -311
  33. package/dist/theme.js +2843 -2569
  34. package/dist/theme.js.map +1 -1
  35. package/dist/ui.css +22564 -0
  36. package/exports/_visual-editing.ts +0 -1
  37. package/package.json +84 -79
  38. package/src/cli/buildCommand.ts +3 -41
  39. package/src/cli/index.ts +2 -14
  40. package/src/core/_compat/helpers.ts +72 -0
  41. package/src/core/_compat/index.ts +1 -6
  42. package/src/core/_compat/styles/_responsive.ts +1 -1
  43. package/src/core/_compat/theme/theme.test.tsx +4 -5
  44. package/src/core/_compat/theme/themeColorProvider.tsx +4 -10
  45. package/src/core/_compat/theme/themeContext.ts +5 -5
  46. package/src/core/_compat/theme/themeProvider.tsx +19 -13
  47. package/src/core/_compat/theme/types.ts +2 -4
  48. package/src/core/_compat/theme/useRootTheme.ts +2 -4
  49. package/src/core/_compat/theme/useTheme.ts +3 -7
  50. package/src/core/_compat/types.ts +0 -73
  51. package/src/core/components/autocomplete/__workshop__/async.tsx +6 -6
  52. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +11 -18
  53. package/src/core/components/autocomplete/__workshop__/custom.tsx +21 -20
  54. package/src/core/components/autocomplete/__workshop__/example.tsx +17 -17
  55. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +5 -5
  56. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +57 -59
  57. package/src/core/components/autocomplete/autocomplete.tsx +106 -140
  58. package/src/core/components/autocomplete/autocompleteOption.tsx +1 -1
  59. package/src/core/components/autocomplete/autocompleteReducer.ts +1 -1
  60. package/src/core/components/autocomplete/constants.ts +1 -1
  61. package/src/core/components/autocomplete/types.ts +4 -9
  62. package/src/core/components/breadcrumbs/__workshop__/example.tsx +2 -3
  63. package/src/core/components/breadcrumbs/breadcrumbs.tsx +32 -28
  64. package/src/core/components/dialog/__workshop__/activate.tsx +4 -4
  65. package/src/core/components/dialog/__workshop__/autoFocus.tsx +2 -2
  66. package/src/core/components/dialog/__workshop__/onScroll.tsx +16 -4
  67. package/src/core/components/dialog/__workshop__/position.tsx +4 -4
  68. package/src/core/components/dialog/__workshop__/props.tsx +7 -7
  69. package/src/core/components/dialog/__workshop__/wrapped.tsx +2 -2
  70. package/src/core/components/dialog/dialog.tsx +104 -304
  71. package/src/core/components/dialog/dialogCard.tsx +190 -0
  72. package/src/core/components/dialog/dialogContext.ts +5 -3
  73. package/src/core/components/dialog/dialogProvider.tsx +6 -7
  74. package/src/core/components/dialog/isTargetWithinScope.ts +14 -0
  75. package/src/core/components/dialog/useDialog.ts +1 -1
  76. package/src/core/components/hotkeys/hotkeys.tsx +41 -27
  77. package/src/core/components/menu/__workshop__/asComponent.tsx +6 -6
  78. package/src/core/components/menu/__workshop__/closableMenuButton.tsx +5 -4
  79. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +2 -2
  80. package/src/core/components/menu/__workshop__/customMenuItem.tsx +3 -3
  81. package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +1 -1
  82. package/src/core/components/menu/__workshop__/groups.tsx +2 -2
  83. package/src/core/components/menu/__workshop__/menuButton.tsx +4 -4
  84. package/src/core/components/menu/__workshop__/menuGroupRight.tsx +1 -1
  85. package/src/core/components/menu/__workshop__/nestedMenu.tsx +1 -1
  86. package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +13 -4
  87. package/src/core/components/menu/__workshop__/selectedItem.tsx +2 -2
  88. package/src/core/components/menu/__workshop__/tones.tsx +3 -3
  89. package/src/core/components/menu/__workshop__/withoutArrow.tsx +1 -1
  90. package/src/core/components/menu/menu.test.tsx +6 -7
  91. package/src/core/components/menu/menu.tsx +27 -35
  92. package/src/core/components/menu/menuButton.tsx +18 -24
  93. package/src/core/components/menu/menuContext.ts +1 -1
  94. package/src/core/components/menu/menuDivider.tsx +25 -15
  95. package/src/core/components/menu/menuGroup.tsx +39 -33
  96. package/src/core/components/menu/menuItem.tsx +58 -46
  97. package/src/core/components/menu/useMenu.ts +1 -1
  98. package/src/core/components/menu/useMenuController.ts +4 -4
  99. package/src/core/components/skeleton/__workshop__/delay.tsx +3 -3
  100. package/src/core/components/skeleton/__workshop__/skeleton.tsx +4 -4
  101. package/src/core/components/skeleton/codeSkeleton.tsx +49 -0
  102. package/src/core/components/skeleton/headingSkeleton.tsx +48 -0
  103. package/src/core/components/skeleton/index.ts +3 -0
  104. package/src/core/components/skeleton/labelSkeleton.tsx +47 -0
  105. package/src/core/components/skeleton/skeleton.tsx +37 -18
  106. package/src/core/components/skeleton/textSkeleton.tsx +29 -112
  107. package/src/core/components/tab/__workshop__/example.tsx +2 -2
  108. package/src/core/components/tab/tab.tsx +28 -26
  109. package/src/core/components/tab/tabList.tsx +49 -28
  110. package/src/core/components/tab/tabPanel.tsx +29 -22
  111. package/src/core/components/toast/__workshop__/hook.tsx +1 -1
  112. package/src/core/components/toast/__workshop__/toast.tsx +5 -5
  113. package/src/core/components/toast/toast.test.tsx +5 -5
  114. package/src/core/components/toast/toast.tsx +30 -57
  115. package/src/core/components/toast/toastContext.ts +1 -1
  116. package/src/core/components/toast/toastLayer.tsx +29 -13
  117. package/src/core/components/toast/toastProvider.tsx +5 -10
  118. package/src/core/components/toast/types.ts +3 -7
  119. package/src/core/components/toast/useToast.ts +2 -4
  120. package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
  121. package/src/core/components/tree/__workshop__/basic.tsx +1 -1
  122. package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
  123. package/src/core/components/tree/helpers.ts +1 -1
  124. package/src/core/components/tree/tree.tsx +196 -191
  125. package/src/core/components/tree/treeContext.ts +1 -1
  126. package/src/core/components/tree/treeGroup.tsx +24 -6
  127. package/src/core/components/tree/treeItem.tsx +44 -34
  128. package/src/core/components/tree/types.ts +2 -2
  129. package/src/core/components/tree/useTree.ts +1 -1
  130. package/src/core/constants.ts +6 -0
  131. package/src/core/helpers/props.ts +18 -0
  132. package/src/core/hooks/index.ts +1 -0
  133. package/src/core/hooks/useArrayProp.ts +1 -4
  134. package/src/core/hooks/useClickOutside.test.tsx +15 -16
  135. package/src/core/hooks/useClickOutside.ts +2 -6
  136. package/src/core/hooks/useClickOutsideEvent.test.tsx +4 -5
  137. package/src/core/hooks/useClickOutsideEvent.ts +3 -9
  138. package/src/core/hooks/useDelayed.test.ts +6 -7
  139. package/src/core/hooks/useDelayedState.ts +1 -1
  140. package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -1
  141. package/src/core/hooks/useElementSize.ts +1 -1
  142. package/src/core/hooks/useForwardedRef.ts +1 -1
  143. package/src/core/hooks/useMatchMedia.ts +13 -31
  144. package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +1 -1
  145. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +3 -18
  146. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +12 -12
  147. package/src/core/hooks/usePrefersDark.hydration.test.tsx +4 -4
  148. package/src/core/hooks/usePrefersDark.test.tsx +1 -0
  149. package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +4 -4
  150. package/src/core/hooks/usePrefersReducedMotion.test.tsx +1 -0
  151. package/src/core/hooks/useResponsiveProp.ts +28 -0
  152. package/src/core/index.ts +0 -1
  153. package/src/core/lib/isArray.ts +3 -0
  154. package/src/core/middleware/origin.ts +1 -1
  155. package/src/core/primitives/_selectable/selectable.tsx +33 -24
  156. package/src/core/primitives/avatar/__workshop__/asButton.tsx +2 -2
  157. package/src/core/primitives/avatar/__workshop__/stack.tsx +2 -2
  158. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +2 -2
  159. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
  160. package/src/core/primitives/avatar/avatar.tsx +43 -48
  161. package/src/core/primitives/avatar/avatarCounter.tsx +46 -39
  162. package/src/core/primitives/avatar/avatarStack.tsx +44 -45
  163. package/src/core/primitives/avatar/types.ts +3 -3
  164. package/src/core/primitives/badge/__workshop__/props.tsx +6 -17
  165. package/src/core/primitives/badge/__workshop__/tones.tsx +1 -6
  166. package/src/core/primitives/badge/badge.test.tsx +2 -3
  167. package/src/core/primitives/badge/badge.tsx +34 -40
  168. package/src/core/primitives/badge/types.ts +2 -1
  169. package/src/core/primitives/box/__workshop__/props.tsx +2 -2
  170. package/src/core/primitives/box/__workshop__/responsive.tsx +2 -1
  171. package/src/core/primitives/box/box.tsx +153 -88
  172. package/src/core/primitives/button/__workshop__/custom.tsx +19 -42
  173. package/src/core/primitives/button/__workshop__/customIcons.tsx +3 -3
  174. package/src/core/primitives/button/__workshop__/disabled.tsx +9 -9
  175. package/src/core/primitives/button/__workshop__/props.tsx +19 -22
  176. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
  177. package/src/core/primitives/button/__workshop__/stacked.tsx +15 -16
  178. package/src/core/primitives/button/__workshop__/uploadButton.tsx +2 -1
  179. package/src/core/primitives/button/button.test.tsx +3 -18
  180. package/src/core/primitives/button/button.tsx +67 -76
  181. package/src/core/primitives/card/__workshop__/asButton.tsx +14 -14
  182. package/src/core/primitives/card/__workshop__/asComponent.tsx +3 -3
  183. package/src/core/primitives/card/__workshop__/checkered.tsx +1 -1
  184. package/src/core/primitives/card/__workshop__/index.ts +1 -1
  185. package/src/core/primitives/card/__workshop__/interactive.tsx +3 -4
  186. package/src/core/primitives/card/__workshop__/listNavigation.tsx +3 -3
  187. package/src/core/primitives/card/__workshop__/props.tsx +14 -17
  188. package/src/core/primitives/card/__workshop__/selected.tsx +10 -41
  189. package/src/core/primitives/card/__workshop__/{allTones.tsx → tones.tsx} +3 -3
  190. package/src/core/primitives/card/card.tsx +52 -48
  191. package/src/core/primitives/card/cardContext.ts +10 -0
  192. package/src/core/primitives/card/cardProvider.tsx +27 -0
  193. package/src/core/primitives/card/index.ts +2 -0
  194. package/src/core/primitives/card/types.ts +19 -3
  195. package/src/core/primitives/card/useCard.ts +9 -0
  196. package/src/core/primitives/checkbox/__workshop__/props.tsx +6 -4
  197. package/src/core/primitives/checkbox/__workshop__/tones.tsx +11 -20
  198. package/src/core/primitives/checkbox/checkbox.tsx +30 -23
  199. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
  200. package/src/core/primitives/code/__workshop__/props.tsx +4 -7
  201. package/src/core/primitives/code/code.tsx +27 -30
  202. package/src/core/primitives/code/refractor.tsx +0 -2
  203. package/src/core/primitives/container/__workshop__/example.tsx +2 -2
  204. package/src/core/primitives/container/container.tsx +27 -25
  205. package/src/core/primitives/flex/__workshop__/example.tsx +2 -2
  206. package/src/core/primitives/flex/flex.tsx +44 -17
  207. package/src/core/primitives/grid/grid.tsx +20 -17
  208. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +2 -2
  209. package/src/core/primitives/heading/__workshop__/plain.tsx +12 -15
  210. package/src/core/primitives/heading/heading.tsx +51 -33
  211. package/src/core/primitives/inline/__workshop__/plain.tsx +2 -5
  212. package/src/core/primitives/inline/inline.tsx +46 -27
  213. package/src/core/primitives/inline/types.ts +1 -0
  214. package/src/core/primitives/kbd/kbd.tsx +28 -28
  215. package/src/core/primitives/label/__workshop__/plain.tsx +8 -17
  216. package/src/core/primitives/label/label.tsx +49 -39
  217. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +6 -6
  218. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +3 -3
  219. package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
  220. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +3 -3
  221. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -4
  222. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +10 -6
  223. package/src/core/primitives/popover/__workshop__/TestStory.tsx +5 -4
  224. package/src/core/primitives/popover/constants.ts +1 -1
  225. package/src/core/primitives/popover/floating-ui/size.ts +2 -2
  226. package/src/core/primitives/popover/helpers.ts +1 -1
  227. package/src/core/primitives/popover/popover.tsx +299 -335
  228. package/src/core/primitives/popover/popoverLayer.tsx +147 -0
  229. package/src/core/primitives/popover/types.ts +3 -2
  230. package/src/core/primitives/radio/__workshop__/example.tsx +3 -3
  231. package/src/core/primitives/radio/__workshop__/plain.tsx +3 -3
  232. package/src/core/primitives/radio/radio.tsx +34 -19
  233. package/src/core/primitives/select/__workshop__/plain.tsx +15 -6
  234. package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
  235. package/src/core/primitives/select/select.tsx +28 -28
  236. package/src/core/primitives/spinner/__workshop__/Props.tsx +4 -5
  237. package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +7 -9
  238. package/src/core/primitives/spinner/spinner.tsx +27 -15
  239. package/src/core/primitives/stack/__workshop__/plain.tsx +2 -2
  240. package/src/core/primitives/stack/stack.tsx +44 -20
  241. package/src/core/primitives/switch/switch.tsx +31 -17
  242. package/src/core/primitives/text/__workshop__/colored.tsx +6 -6
  243. package/src/core/primitives/text/__workshop__/example.tsx +9 -20
  244. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
  245. package/src/core/primitives/text/text.tsx +52 -44
  246. package/src/core/primitives/textArea/__workshop__/plain.tsx +44 -33
  247. package/src/core/primitives/textArea/textArea.tsx +47 -22
  248. package/src/core/primitives/textInput/__workshop__/customValidity.tsx +2 -2
  249. package/src/core/primitives/textInput/__workshop__/plain.tsx +36 -30
  250. package/src/core/primitives/textInput/__workshop__/states.tsx +5 -5
  251. package/src/core/primitives/textInput/__workshop__/tones.tsx +2 -2
  252. package/src/core/primitives/textInput/__workshop__/typed.tsx +2 -2
  253. package/src/core/primitives/textInput/textInput.tsx +80 -106
  254. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +5 -5
  255. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +2 -2
  256. package/src/core/primitives/tooltip/__workshop__/props.tsx +9 -8
  257. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
  258. package/src/core/primitives/tooltip/constants.ts +1 -1
  259. package/src/core/primitives/tooltip/tooltip.test.tsx +61 -60
  260. package/src/core/primitives/tooltip/tooltip.tsx +107 -90
  261. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +1 -1
  262. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +3 -5
  263. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -1
  264. package/src/core/primitives/tooltip/tooltipLayer.tsx +105 -0
  265. package/src/core/primitives/types.ts +19 -30
  266. package/src/core/types/avatar.ts +3 -6
  267. package/src/core/types/badge.ts +2 -4
  268. package/src/core/types/button.ts +2 -4
  269. package/src/core/types/card.ts +2 -4
  270. package/src/core/types/dialog.ts +1 -3
  271. package/src/core/types/flex.ts +3 -3
  272. package/src/core/types/props.ts +20 -10
  273. package/src/core/types/selectable.ts +1 -1
  274. package/src/core/utils/arrow/arrow.tsx +43 -28
  275. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +5 -5
  276. package/src/core/utils/boundaryElement/boundaryElementContext.ts +1 -1
  277. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +4 -10
  278. package/src/core/utils/boundaryElement/types.ts +1 -3
  279. package/src/core/utils/boundaryElement/useBoundaryElement.ts +2 -4
  280. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +15 -8
  281. package/src/core/utils/elementQuery/elementQuery.tsx +41 -19
  282. package/src/core/utils/errorBoundary.tsx +6 -4
  283. package/src/core/utils/index.ts +0 -1
  284. package/src/core/utils/layer/__workshop__/multipleRoots.tsx +5 -5
  285. package/src/core/utils/layer/__workshop__/nested.tsx +3 -3
  286. package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +9 -5
  287. package/src/core/utils/layer/getLayerContext.test.ts +3 -1
  288. package/src/core/utils/layer/getLayerContext.ts +1 -1
  289. package/src/core/utils/layer/layer.test.tsx +5 -5
  290. package/src/core/utils/layer/layer.tsx +25 -95
  291. package/src/core/utils/layer/layerCard.tsx +90 -0
  292. package/src/core/utils/layer/layerContext.ts +1 -1
  293. package/src/core/utils/layer/layerProvider.tsx +20 -17
  294. package/src/core/utils/layer/useLayer.ts +2 -4
  295. package/src/core/utils/portal/__workshop__/named.tsx +3 -3
  296. package/src/core/utils/portal/portal.test.tsx +5 -5
  297. package/src/core/utils/portal/{portal.ts → portal.tsx} +17 -11
  298. package/src/core/utils/portal/portalContext.ts +1 -1
  299. package/src/core/utils/portal/portalProvider.tsx +4 -10
  300. package/src/core/utils/portal/types.ts +1 -3
  301. package/src/core/utils/portal/usePortal.ts +2 -4
  302. package/src/core/utils/srOnly/srOnly.tsx +25 -27
  303. package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +1 -1
  304. package/src/core/utils/virtualList/virtualList.tsx +71 -55
  305. package/src/css/__theme/index.ts +16 -0
  306. package/src/css/__theme/lib/contract/buildVarContract.ts +78 -0
  307. package/src/css/__theme/lib/contract/index.ts +4 -0
  308. package/src/css/__theme/lib/contract/types.ts +17 -0
  309. package/src/css/__theme/resolveTheme.ts +865 -0
  310. package/src/css/_assign.ts +3 -0
  311. package/src/css/_composeClassNames.ts +12 -0
  312. package/src/css/_fromEntries.ts +3 -0
  313. package/src/css/_getClassNames.ts +9 -0
  314. package/src/css/_responsiveClassName.ts +45 -0
  315. package/src/css/_responsiveStyle.css.ts +34 -0
  316. package/src/css/_style.css.ts +9 -0
  317. package/src/css/components/breadcrumbs/breadcrumbs.css.ts +6 -0
  318. package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -3
  319. package/src/css/components/dialog/dialog.css.ts +81 -0
  320. package/src/css/components/dialog/dialog.ts +20 -11
  321. package/src/css/components/index.ts +6 -0
  322. package/src/css/components/menu/menu.css.ts +14 -0
  323. package/src/css/components/menu/menu.ts +8 -5
  324. package/src/css/components/skeleton/skeleton.css.ts +132 -0
  325. package/src/css/components/skeleton/skeleton.ts +14 -9
  326. package/src/css/components/skeleton/types.ts +13 -5
  327. package/src/css/components/toast/toast.css.ts +16 -0
  328. package/src/css/components/toast/toast.ts +5 -15
  329. package/src/css/components/tree/tree.css.ts +65 -0
  330. package/src/css/components/tree/tree.ts +5 -3
  331. package/src/css/constants.ts +10 -0
  332. package/src/css/defaultTheme.css.ts +468 -0
  333. package/src/css/index.ts +12 -38
  334. package/src/css/layers.css.ts +9 -0
  335. package/src/css/primitives/_arrow/_arrow.css.ts +68 -0
  336. package/src/css/primitives/_arrow/_arrow.ts +18 -6
  337. package/src/css/primitives/_input/_input.css.ts +258 -0
  338. package/src/css/primitives/_input/input.ts +17 -14
  339. package/src/css/primitives/_input/types.ts +3 -3
  340. package/src/css/primitives/_selectable/_selectable.css.ts +121 -0
  341. package/src/css/primitives/_selectable/selectable.ts +5 -5
  342. package/src/css/primitives/_selectable/types.ts +3 -2
  343. package/src/css/primitives/avatar/avatar.css.ts +175 -0
  344. package/src/css/primitives/avatar/avatar.ts +52 -11
  345. package/src/css/primitives/avatar/types.ts +5 -3
  346. package/src/css/primitives/badge/badge.css.ts +26 -0
  347. package/src/css/primitives/badge/badge.ts +4 -4
  348. package/src/css/primitives/badge/types.ts +5 -4
  349. package/src/css/primitives/box/box.css.ts +19 -0
  350. package/src/css/primitives/box/box.ts +52 -16
  351. package/src/css/primitives/box/types.ts +46 -22
  352. package/src/css/primitives/button/button.css.ts +285 -0
  353. package/src/css/primitives/button/button.ts +15 -33
  354. package/src/css/primitives/button/index.ts +1 -0
  355. package/src/css/primitives/button/types.ts +19 -0
  356. package/src/css/primitives/card/card.css.ts +365 -0
  357. package/src/css/primitives/card/card.ts +9 -12
  358. package/src/css/primitives/card/types.ts +4 -6
  359. package/src/css/primitives/checkbox/checkbox.css.ts +193 -0
  360. package/src/css/primitives/checkbox/checkbox.ts +13 -5
  361. package/src/css/primitives/code/code.css.ts +271 -0
  362. package/src/css/primitives/code/code.ts +13 -5
  363. package/src/css/primitives/code/types.ts +4 -3
  364. package/src/css/primitives/container/container.css.ts +4 -0
  365. package/src/css/primitives/container/container.ts +12 -4
  366. package/src/css/primitives/container/types.ts +4 -2
  367. package/src/css/primitives/heading/heading.css.ts +85 -0
  368. package/src/css/primitives/heading/heading.ts +13 -11
  369. package/src/css/primitives/heading/types.ts +6 -3
  370. package/src/css/primitives/index.ts +24 -0
  371. package/src/css/primitives/kbd/kbd.css.ts +16 -0
  372. package/src/css/primitives/kbd/kbd.ts +6 -4
  373. package/src/css/primitives/kbd/types.ts +2 -3
  374. package/src/css/primitives/label/label.css.ts +85 -0
  375. package/src/css/primitives/label/label.ts +13 -10
  376. package/src/css/primitives/label/types.ts +13 -5
  377. package/src/css/primitives/popover/popover.css.ts +6 -0
  378. package/src/css/primitives/popover/popover.ts +10 -3
  379. package/src/css/primitives/radio/radio.css.ts +78 -0
  380. package/src/css/primitives/radio/radio.ts +15 -3
  381. package/src/css/primitives/select/select.css.ts +24 -0
  382. package/src/css/primitives/select/select.ts +7 -4
  383. package/src/css/primitives/select/types.ts +1 -1
  384. package/src/css/primitives/spinner/index.ts +1 -0
  385. package/src/css/primitives/spinner/spinner.css.ts +23 -0
  386. package/src/css/primitives/spinner/spinner.ts +9 -5
  387. package/src/css/primitives/spinner/types.ts +4 -0
  388. package/src/css/primitives/stack/index.ts +1 -0
  389. package/src/css/primitives/stack/stack.css.ts +6 -0
  390. package/src/css/primitives/stack/stack.ts +7 -0
  391. package/src/css/primitives/switch/switch.css.ts +98 -0
  392. package/src/css/primitives/switch/switch.ts +13 -7
  393. package/src/css/primitives/text/text.css.ts +85 -0
  394. package/src/css/primitives/text/text.ts +13 -11
  395. package/src/css/primitives/text/types.ts +9 -3
  396. package/src/css/primitives/textArea/textArea.css.ts +4 -0
  397. package/src/css/primitives/textArea/textArea.ts +5 -3
  398. package/src/css/primitives/textArea/types.ts +5 -3
  399. package/src/css/primitives/textInput/textInput.css.ts +41 -0
  400. package/src/css/primitives/textInput/textInput.ts +20 -4
  401. package/src/css/primitives/textInput/types.ts +3 -7
  402. package/src/css/primitives/tooltip/index.ts +1 -0
  403. package/src/css/primitives/tooltip/tooltip.css.ts +6 -0
  404. package/src/css/primitives/tooltip/tooltip.ts +8 -7
  405. package/src/css/primitives/tooltip/types.ts +4 -0
  406. package/src/css/props/alignItems/alignItems.css.ts +22 -0
  407. package/src/css/props/alignItems/alignItems.ts +8 -0
  408. package/src/css/props/alignItems/index.ts +2 -0
  409. package/src/css/props/alignItems/types.ts +9 -0
  410. package/src/css/props/border/border.css.ts +65 -0
  411. package/src/css/props/border/border.ts +36 -0
  412. package/src/css/props/border/types.ts +13 -0
  413. package/src/css/props/boxSizing/boxSizing.css.ts +11 -0
  414. package/src/css/props/boxSizing/boxSizing.ts +10 -0
  415. package/src/css/props/boxSizing/index.ts +2 -0
  416. package/src/css/props/boxSizing/types.ts +7 -0
  417. package/src/css/props/display/display.css.ts +56 -0
  418. package/src/css/props/display/display.ts +17 -0
  419. package/src/css/{styles → props}/display/types.ts +3 -4
  420. package/src/css/props/flex/flex.css.ts +52 -0
  421. package/src/css/props/flex/flex.ts +8 -0
  422. package/src/css/props/flex/types.ts +9 -0
  423. package/src/css/props/flexDirection/flexDirection.css.ts +19 -0
  424. package/src/css/props/flexDirection/flexDirection.ts +8 -0
  425. package/src/css/props/flexDirection/index.ts +2 -0
  426. package/src/css/props/flexDirection/types.ts +9 -0
  427. package/src/css/props/flexWrap/flexWrap.css.ts +16 -0
  428. package/src/css/props/flexWrap/flexWrap.ts +8 -0
  429. package/src/css/props/flexWrap/index.ts +2 -0
  430. package/src/css/props/flexWrap/types.ts +9 -0
  431. package/src/css/props/font/font.css.ts +93 -0
  432. package/src/css/props/font/font.ts +8 -0
  433. package/src/css/props/font/types.ts +6 -0
  434. package/src/css/props/gap/gap.css.ts +40 -0
  435. package/src/css/props/gap/gap.ts +13 -0
  436. package/src/css/{styles → props}/gap/types.ts +2 -2
  437. package/src/css/props/gridAutoColumns/gridAutoColumns.css.ts +19 -0
  438. package/src/css/props/gridAutoColumns/gridAutoColumns.ts +8 -0
  439. package/src/css/props/gridAutoColumns/index.ts +2 -0
  440. package/src/css/props/gridAutoColumns/types.ts +19 -0
  441. package/src/css/props/gridAutoFlow/gridAutoFlow.css.ts +19 -0
  442. package/src/css/props/gridAutoFlow/gridAutoFlow.ts +8 -0
  443. package/src/css/props/gridAutoFlow/index.ts +2 -0
  444. package/src/css/props/gridAutoFlow/types.ts +13 -0
  445. package/src/css/props/gridAutoRows/gridAutoRows.css.ts +19 -0
  446. package/src/css/props/gridAutoRows/gridAutoRows.ts +8 -0
  447. package/src/css/props/gridAutoRows/index.ts +2 -0
  448. package/src/css/props/gridAutoRows/types.ts +13 -0
  449. package/src/css/props/gridColumn/gridColumn.css.ts +49 -0
  450. package/src/css/props/gridColumn/gridColumn.ts +8 -0
  451. package/src/css/props/gridColumn/index.ts +2 -0
  452. package/src/css/props/gridColumn/types.ts +19 -0
  453. package/src/css/props/gridColumnEnd/gridColumnEnd.css.ts +46 -0
  454. package/src/css/props/gridColumnEnd/gridColumnEnd.ts +8 -0
  455. package/src/css/props/gridColumnEnd/index.ts +2 -0
  456. package/src/css/props/gridColumnEnd/types.ts +19 -0
  457. package/src/css/props/gridColumnStart/gridColumnStart.css.ts +46 -0
  458. package/src/css/props/gridColumnStart/gridColumnStart.ts +11 -0
  459. package/src/css/props/gridColumnStart/index.ts +2 -0
  460. package/src/css/props/gridColumnStart/types.ts +19 -0
  461. package/src/css/props/gridRow/gridRow.css.ts +49 -0
  462. package/src/css/props/gridRow/gridRow.ts +8 -0
  463. package/src/css/props/gridRow/index.ts +2 -0
  464. package/src/css/props/gridRow/types.ts +19 -0
  465. package/src/css/props/gridRowEnd/gridRowEnd.css.ts +46 -0
  466. package/src/css/props/gridRowEnd/gridRowEnd.ts +8 -0
  467. package/src/css/props/gridRowEnd/index.ts +2 -0
  468. package/src/css/props/gridRowEnd/types.ts +19 -0
  469. package/src/css/props/gridRowStart/gridRowStart.css.ts +46 -0
  470. package/src/css/props/gridRowStart/gridRowStart.ts +8 -0
  471. package/src/css/props/gridRowStart/index.ts +2 -0
  472. package/src/css/props/gridRowStart/types.ts +19 -0
  473. package/src/css/props/gridTemplateColumns/gridTemplateColumns.css.ts +43 -0
  474. package/src/css/props/gridTemplateColumns/gridTemplateColumns.ts +8 -0
  475. package/src/css/props/gridTemplateColumns/index.ts +2 -0
  476. package/src/css/props/gridTemplateColumns/types.ts +19 -0
  477. package/src/css/props/gridTemplateRows/gridTemplateRows.css.ts +43 -0
  478. package/src/css/props/gridTemplateRows/gridTemplateRows.ts +8 -0
  479. package/src/css/props/gridTemplateRows/index.ts +2 -0
  480. package/src/css/props/gridTemplateRows/types.ts +19 -0
  481. package/src/css/props/height/height.css.ts +25 -0
  482. package/src/css/props/height/height.ts +8 -0
  483. package/src/css/props/height/index.ts +2 -0
  484. package/src/css/props/height/types.ts +15 -0
  485. package/src/css/props/index.ts +37 -0
  486. package/src/css/props/inset/inset.css.ts +37 -0
  487. package/src/css/props/inset/inset.ts +21 -0
  488. package/src/css/{styles → props}/inset/types.ts +1 -1
  489. package/src/css/props/justifyContent/index.ts +2 -0
  490. package/src/css/props/justifyContent/justifyContent.css.ts +25 -0
  491. package/src/css/props/justifyContent/justifyContent.ts +8 -0
  492. package/src/css/props/justifyContent/types.ts +15 -0
  493. package/src/css/props/margin/margin.css.ts +117 -0
  494. package/src/css/props/margin/margin.ts +25 -0
  495. package/src/css/props/margin/types.ts +17 -0
  496. package/src/css/props/maxWidth/maxWidth.css.ts +32 -0
  497. package/src/css/props/maxWidth/maxWidth.ts +8 -0
  498. package/src/css/props/maxWidth/types.ts +11 -0
  499. package/src/css/props/minHeight/index.ts +2 -0
  500. package/src/css/props/minHeight/minHeight.css.ts +13 -0
  501. package/src/css/props/minHeight/minHeight.ts +8 -0
  502. package/src/css/props/minHeight/types.ts +9 -0
  503. package/src/css/props/minWidth/index.ts +2 -0
  504. package/src/css/props/minWidth/minWidth.css.ts +25 -0
  505. package/src/css/props/minWidth/minWidth.ts +8 -0
  506. package/src/css/props/minWidth/types.ts +9 -0
  507. package/src/css/props/outline/index.ts +2 -0
  508. package/src/css/props/outline/outline.css.ts +10 -0
  509. package/src/css/props/outline/outline.ts +8 -0
  510. package/src/css/props/outline/types.ts +7 -0
  511. package/src/css/props/overflow/overflow.css.ts +16 -0
  512. package/src/css/props/overflow/overflow.ts +8 -0
  513. package/src/css/props/overflow/types.ts +17 -0
  514. package/src/css/props/padding/padding.css.ts +87 -0
  515. package/src/css/props/padding/padding.ts +25 -0
  516. package/src/css/props/padding/types.ts +17 -0
  517. package/src/css/props/pointerEvents/pointerEvents.css.ts +13 -0
  518. package/src/css/props/pointerEvents/pointerEvents.ts +8 -0
  519. package/src/css/props/position/position.css.ts +22 -0
  520. package/src/css/props/position/position.ts +8 -0
  521. package/src/css/{styles → props}/position/types.ts +1 -1
  522. package/src/css/props/radius/radius.css.ts +21 -0
  523. package/src/css/props/radius/radius.ts +8 -0
  524. package/src/css/props/radius/types.ts +8 -0
  525. package/src/css/props/shadow/shadow.css.ts +23 -0
  526. package/src/css/props/shadow/shadow.ts +8 -0
  527. package/src/css/props/shadow/types.ts +8 -0
  528. package/src/css/props/textAlign/index.ts +2 -0
  529. package/src/css/props/textAlign/textAlign.css.ts +22 -0
  530. package/src/css/props/textAlign/textAlign.ts +8 -0
  531. package/src/css/props/textAlign/types.ts +7 -0
  532. package/src/css/props/textOverflow/textOverflow.css.ts +13 -0
  533. package/src/css/props/textOverflow/textOverflow.ts +8 -0
  534. package/src/css/{styles → props}/textOverflow/types.ts +5 -1
  535. package/src/css/props/width/types.ts +11 -0
  536. package/src/css/props/width/width.css.ts +28 -0
  537. package/src/css/props/width/width.ts +8 -0
  538. package/src/css/types.ts +221 -766
  539. package/src/css/util.ts +3 -8
  540. package/src/css/utils/index.ts +1 -0
  541. package/src/css/utils/srOnly/srOnly.css.ts +10 -0
  542. package/src/css/utils/srOnly/srOnly.ts +5 -3
  543. package/src/css/vars.css.ts +676 -0
  544. package/src/theme/getScopedTheme.ts +4 -4
  545. package/src/theme/index.ts +0 -5
  546. package/src/theme/types.ts +6 -10
  547. package/src/theme/v0/color/_generic.ts +1 -1
  548. package/src/theme/v0/color/button.ts +1 -1
  549. package/src/theme/v0/color/card.ts +1 -1
  550. package/src/theme/v0/color/color.ts +11 -11
  551. package/src/theme/v0/color/input.ts +1 -1
  552. package/src/theme/v0/color/muted.ts +1 -1
  553. package/src/theme/v0/color/selectable.ts +1 -1
  554. package/src/theme/v0/color/solid.ts +1 -1
  555. package/src/theme/v0/color/spot.ts +1 -1
  556. package/src/theme/v0/focusRing.ts +1 -3
  557. package/src/theme/v0/font.ts +6 -19
  558. package/src/theme/v0/layer.ts +1 -3
  559. package/src/theme/v0/shadow.ts +2 -6
  560. package/src/theme/v0/styles.ts +1 -1
  561. package/src/theme/v0/theme.ts +7 -7
  562. package/src/theme/v2/avatar.ts +2 -4
  563. package/src/theme/{build → v2/build}/_deprecated/color/_selectable/createSelectableTones.ts +3 -3
  564. package/src/theme/{build → v2/build}/_deprecated/color/_solid/createSolidTones.ts +2 -2
  565. package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonModes.ts +7 -2
  566. package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonTones.ts +4 -4
  567. package/src/theme/{build → v2/build}/_deprecated/color/card/createCardStates.ts +3 -3
  568. package/src/theme/{build → v2/build}/_deprecated/color/color.test.ts +1 -1
  569. package/src/theme/{build → v2/build}/_deprecated/color/defaults.ts +1 -1
  570. package/src/theme/{build → v2/build}/_deprecated/color/factory.ts +3 -3
  571. package/src/theme/{build → v2/build}/_deprecated/color/input/createInputModes.ts +7 -2
  572. package/src/theme/{build → v2/build}/_deprecated/color/muted/createMuted.ts +2 -2
  573. package/src/theme/{build → v2/build}/_deprecated/color/spot/createSpot.ts +2 -2
  574. package/src/theme/{build → v2/build}/buildColorTheme.test.ts +3 -1
  575. package/src/theme/{build → v2/build}/buildColorTheme.ts +24 -24
  576. package/src/theme/{build → v2/build}/buildTheme.test.ts +10 -8
  577. package/src/theme/v2/build/buildTheme.ts +12 -0
  578. package/src/theme/{build → v2/build}/colorToken/colorToken.ts +2 -2
  579. package/src/theme/{build → v2/build}/colorToken/compileColorToken.ts +1 -1
  580. package/src/theme/{build → v2/build}/colorToken/types.ts +2 -2
  581. package/src/theme/{build → v2/build}/lib/color-fns/blend/mix.ts +1 -1
  582. package/src/theme/{build → v2/build}/lib/color-fns/blend/multiply.ts +1 -1
  583. package/src/theme/{build → v2/build}/lib/color-fns/blend/screen.ts +1 -1
  584. package/src/theme/{build → v2/build}/lib/color-fns/color-fns.test.ts +1 -1
  585. package/src/theme/{build → v2/build}/lib/color-fns/contrastRatio.ts +5 -2
  586. package/src/theme/{build → v2/build}/lib/color-fns/convert.ts +1 -1
  587. package/src/theme/{build → v2/build}/lib/color-fns/parse.ts +1 -1
  588. package/src/theme/{build → v2/build}/mixThemeColor.test.ts +2 -0
  589. package/src/theme/{build → v2/build}/mixThemeColor.ts +1 -1
  590. package/src/theme/{build → v2/build}/renderColorTheme.ts +27 -27
  591. package/src/theme/{build → v2/build}/renderColorValue.ts +3 -3
  592. package/src/theme/{build → v2/build}/resolveColorTokens.ts +13 -13
  593. package/src/theme/v2/color/_helpers.ts +2 -2
  594. package/src/theme/v2/color/_system.ts +2 -4
  595. package/src/theme/v2/color/avatar.ts +3 -7
  596. package/src/theme/v2/color/badge.ts +3 -7
  597. package/src/theme/v2/color/button.ts +5 -11
  598. package/src/theme/v2/color/color.ts +10 -16
  599. package/src/theme/v2/color/input.ts +8 -10
  600. package/src/theme/v2/color/kbd.ts +1 -3
  601. package/src/theme/v2/color/selectable.ts +4 -8
  602. package/src/theme/v2/color/state.ts +5 -7
  603. package/src/theme/v2/color/syntax.ts +1 -3
  604. package/src/theme/{config → v2/config}/helpers.ts +6 -13
  605. package/src/theme/{config → v2/config}/system.ts +11 -12
  606. package/src/theme/{config → v2/config}/tokens/color/types.ts +14 -10
  607. package/src/theme/{config → v2/config}/tokens/index.ts +0 -1
  608. package/src/theme/{config → v2/config}/tokens/parseTokenValue.test.ts +2 -0
  609. package/src/theme/{config → v2/config}/tokens/parseTokenValue.ts +2 -2
  610. package/src/theme/{config → v2/config}/tokens/types.ts +3 -3
  611. package/src/theme/{config → v2/config}/types.ts +8 -6
  612. package/src/theme/{defaults → v2/defaults}/colorPalette.ts +1 -1
  613. package/src/theme/{defaults → v2/defaults}/colorTokens.ts +3 -3
  614. package/src/theme/{defaults → v2/defaults}/config.ts +2 -2
  615. package/src/theme/{defaults → v2/defaults}/fonts.ts +5 -6
  616. package/src/theme/v2/index.ts +2 -0
  617. package/src/theme/v2/input.ts +2 -4
  618. package/src/theme/v2/theme.ts +10 -14
  619. package/src/theme/{_constants.ts → v3/_constants.ts} +6 -3
  620. package/src/theme/v3/{color/parseColor.ts → _parseColorToken.ts} +59 -46
  621. package/src/theme/v3/buildTheme_v3.ts +20 -11
  622. package/src/theme/v3/color/_constants.ts +15 -0
  623. package/src/theme/v3/color/avatar.ts +14 -0
  624. package/src/theme/v3/color/card.ts +58 -95
  625. package/src/theme/v3/color/color.ts +75 -71
  626. package/src/theme/v3/color/element.ts +8 -8
  627. package/src/theme/v3/color/index.ts +2 -2
  628. package/src/theme/v3/color/token.ts +19 -4
  629. package/src/theme/v3/color/tokens.ts +2 -2
  630. package/src/theme/v3/defaultFonts.ts +250 -0
  631. package/src/theme/v3/defaultTokens.ts +199 -0
  632. package/src/theme/v3/index.ts +4 -1
  633. package/src/theme/{palette → v3/palette}/constants.ts +3 -3
  634. package/src/theme/v3/palette/types.ts +7 -0
  635. package/src/theme/v3/resolveTokens.ts +70 -65
  636. package/src/theme/v3/tokens.ts +2 -2
  637. package/src/theme/v3/types.ts +97 -12
  638. package/src/theme/versioning/getTheme_v2.ts +3 -3
  639. package/src/theme/versioning/is_v0.ts +2 -2
  640. package/src/theme/versioning/is_v2.ts +2 -2
  641. package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
  642. package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -1
  643. package/src/theme/versioning/themeColor_v3_v2.ts +229 -52
  644. package/src/theme/versioning/v0_v2.ts +3 -3
  645. package/src/theme/versioning/v2_v0.ts +4 -4
  646. package/src/theme/versioning/v3_v2.ts +62 -40
  647. package/dist/_chunks-cjs/_visual-editing.js +0 -3059
  648. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  649. package/dist/_chunks-cjs/buildCommand.js +0 -32
  650. package/dist/_chunks-cjs/buildCommand.js.map +0 -1
  651. package/dist/_chunks-cjs/refractor.js.map +0 -1
  652. package/dist/_chunks-cjs/v3_v2.js +0 -251
  653. package/dist/_chunks-cjs/v3_v2.js.map +0 -1
  654. package/dist/_chunks-es/_visual-editing.mjs +0 -3066
  655. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  656. package/dist/_chunks-es/refractor.mjs.map +0 -1
  657. package/dist/_chunks-es/v3_v2.mjs +0 -252
  658. package/dist/_chunks-es/v3_v2.mjs.map +0 -1
  659. package/dist/_visual-editing.d.mts +0 -806
  660. package/dist/_visual-editing.mjs +0 -31
  661. package/dist/_visual-editing.mjs.map +0 -1
  662. package/dist/cli.d.ts +0 -1
  663. package/dist/cli.js +0 -357
  664. package/dist/cli.js.map +0 -1
  665. package/dist/css.d.mts +0 -2135
  666. package/dist/css.mjs +0 -4713
  667. package/dist/css.mjs.map +0 -1
  668. package/dist/index.mjs +0 -1542
  669. package/dist/index.mjs.map +0 -1
  670. package/dist/sanity-palette.css +0 -9
  671. package/dist/sanity-theme.css +0 -1
  672. package/dist/system.css +0 -3577
  673. package/dist/theme.mjs.map +0 -1
  674. package/src/core/StyleTags.tsx +0 -24
  675. package/src/core/primitives/popover/popoverCard.tsx +0 -148
  676. package/src/core/primitives/tooltip/tooltipCard.tsx +0 -115
  677. package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
  678. package/src/core/utils/conditionalWrapper/index.ts +0 -1
  679. package/src/css/_resp.ts +0 -31
  680. package/src/css/compile/compilePalette.ts +0 -60
  681. package/src/css/compile/compileRule.ts +0 -90
  682. package/src/css/compile/compileRules.test.ts +0 -35
  683. package/src/css/compile/compileRules.ts +0 -40
  684. package/src/css/compile/compileSystem.ts +0 -7
  685. package/src/css/compile/compileTheme.ts +0 -15
  686. package/src/css/compile/compileTheme_v3.ts +0 -410
  687. package/src/css/compile/types.ts +0 -6
  688. package/src/css/components/breadcrumbs/rules.ts +0 -25
  689. package/src/css/components/dialog/rules.ts +0 -76
  690. package/src/css/components/menu/rules.ts +0 -15
  691. package/src/css/components/skeleton/rules.ts +0 -112
  692. package/src/css/components/toast/rules.ts +0 -17
  693. package/src/css/components/tree/rules.ts +0 -168
  694. package/src/css/composeClassNames.ts +0 -13
  695. package/src/css/primitives/_arrow/rules.ts +0 -71
  696. package/src/css/primitives/_input/rules.ts +0 -163
  697. package/src/css/primitives/_selectable/__style.ts +0 -117
  698. package/src/css/primitives/_selectable/_contants.ts +0 -11
  699. package/src/css/primitives/_selectable/rules.ts +0 -129
  700. package/src/css/primitives/avatar/rules.ts +0 -176
  701. package/src/css/primitives/badge/rules.ts +0 -22
  702. package/src/css/primitives/box/rules.ts +0 -28
  703. package/src/css/primitives/button/_constants.ts +0 -17
  704. package/src/css/primitives/button/rules.ts +0 -293
  705. package/src/css/primitives/card/_constants.ts +0 -13
  706. package/src/css/primitives/card/rules.ts +0 -471
  707. package/src/css/primitives/checkbox/__styles.ts +0 -129
  708. package/src/css/primitives/checkbox/rules.ts +0 -152
  709. package/src/css/primitives/code/rules.ts +0 -96
  710. package/src/css/primitives/container/rules.ts +0 -8
  711. package/src/css/primitives/heading/rules.ts +0 -155
  712. package/src/css/primitives/kbd/rules.ts +0 -20
  713. package/src/css/primitives/label/rules.ts +0 -137
  714. package/src/css/primitives/popover/rules.ts +0 -5
  715. package/src/css/primitives/radio/rules.ts +0 -121
  716. package/src/css/primitives/select/rules.ts +0 -22
  717. package/src/css/primitives/spinner/rules.ts +0 -20
  718. package/src/css/primitives/switch/rules.ts +0 -340
  719. package/src/css/primitives/text/rules.ts +0 -164
  720. package/src/css/primitives/textArea/rules.ts +0 -7
  721. package/src/css/primitives/textInput/rules.ts +0 -224
  722. package/src/css/primitives/token/rules.ts +0 -45
  723. package/src/css/primitives/tooltip/rules.ts +0 -19
  724. package/src/css/responsiveRules.ts +0 -25
  725. package/src/css/rules.ts +0 -113
  726. package/src/css/styles/border/border.ts +0 -22
  727. package/src/css/styles/border/rules.ts +0 -24
  728. package/src/css/styles/border/types.ts +0 -10
  729. package/src/css/styles/display/display.ts +0 -7
  730. package/src/css/styles/display/rules.ts +0 -62
  731. package/src/css/styles/flex/flex.ts +0 -20
  732. package/src/css/styles/flex/rules.ts +0 -28
  733. package/src/css/styles/flex/types.ts +0 -35
  734. package/src/css/styles/flexItem/flexItem.ts +0 -8
  735. package/src/css/styles/flexItem/index.ts +0 -2
  736. package/src/css/styles/flexItem/rules.ts +0 -12
  737. package/src/css/styles/flexItem/types.ts +0 -11
  738. package/src/css/styles/font/font.ts +0 -17
  739. package/src/css/styles/font/rules.ts +0 -148
  740. package/src/css/styles/font/types.ts +0 -12
  741. package/src/css/styles/gap/gap.ts +0 -8
  742. package/src/css/styles/gap/rules.ts +0 -34
  743. package/src/css/styles/grid/grid.ts +0 -13
  744. package/src/css/styles/grid/index.ts +0 -2
  745. package/src/css/styles/grid/rules.ts +0 -146
  746. package/src/css/styles/grid/types.ts +0 -29
  747. package/src/css/styles/gridItem/gridItem.ts +0 -15
  748. package/src/css/styles/gridItem/index.ts +0 -2
  749. package/src/css/styles/gridItem/rules.ts +0 -96
  750. package/src/css/styles/gridItem/types.ts +0 -41
  751. package/src/css/styles/height/rules.ts +0 -7
  752. package/src/css/styles/index.ts +0 -19
  753. package/src/css/styles/inset/inset.ts +0 -13
  754. package/src/css/styles/inset/rules.ts +0 -16
  755. package/src/css/styles/margin/margin.ts +0 -15
  756. package/src/css/styles/margin/rules.ts +0 -64
  757. package/src/css/styles/margin/types.ts +0 -11
  758. package/src/css/styles/maxWidth/maxWidth.ts +0 -6
  759. package/src/css/styles/maxWidth/rules.ts +0 -13
  760. package/src/css/styles/maxWidth/types.ts +0 -7
  761. package/src/css/styles/outline/rules.ts +0 -7
  762. package/src/css/styles/overflow/overflow.ts +0 -11
  763. package/src/css/styles/overflow/rules.ts +0 -9
  764. package/src/css/styles/overflow/types.ts +0 -11
  765. package/src/css/styles/padding/padding.ts +0 -15
  766. package/src/css/styles/padding/rules.ts +0 -62
  767. package/src/css/styles/padding/types.ts +0 -14
  768. package/src/css/styles/pointerEvents/pointerEvents.ts +0 -6
  769. package/src/css/styles/pointerEvents/rules.ts +0 -11
  770. package/src/css/styles/position/position.ts +0 -7
  771. package/src/css/styles/position/rules.ts +0 -24
  772. package/src/css/styles/radius/radius.ts +0 -8
  773. package/src/css/styles/radius/rules.ts +0 -13
  774. package/src/css/styles/radius/types.ts +0 -8
  775. package/src/css/styles/shadow/rules.ts +0 -53
  776. package/src/css/styles/shadow/shadow.ts +0 -7
  777. package/src/css/styles/shadow/types.ts +0 -8
  778. package/src/css/styles/textOverflow/rules.ts +0 -17
  779. package/src/css/styles/textOverflow/textOverflow.ts +0 -6
  780. package/src/css/styles/width/rules.ts +0 -7
  781. package/src/css/styles/width/types.ts +0 -9
  782. package/src/css/styles/width/width.ts +0 -6
  783. package/src/css/utils/srOnly/rules.ts +0 -11
  784. package/src/css/varNames.ts +0 -473
  785. package/src/css/vars.ts +0 -443
  786. package/src/theme/_types.ts +0 -41
  787. package/src/theme/build/buildTheme.ts +0 -12
  788. package/src/theme/build/theme.test.ts +0 -27
  789. package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
  790. package/src/theme/config/tokens/parseTokenKey.ts +0 -67
  791. package/src/theme/palette/types.ts +0 -16
  792. package/src/theme/v3/buildTheme_v3.test.ts +0 -40
  793. package/src/theme/v3/color/buildColor_v3.ts +0 -193
  794. package/src/theme/v3/color/parseColor.test.ts +0 -79
  795. package/src/theme/v3/color/renderColor.test.ts +0 -19
  796. package/src/theme/v3/color/renderColor.ts +0 -33
  797. package/src/theme/v3/defaults.ts +0 -205
  798. /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/apiStore.ts +0 -0
  799. /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/countries.ts +0 -0
  800. /package/src/css/{styles → props}/border/index.ts +0 -0
  801. /package/src/css/{styles → props}/display/index.ts +0 -0
  802. /package/src/css/{styles → props}/flex/index.ts +0 -0
  803. /package/src/css/{styles → props}/font/index.ts +0 -0
  804. /package/src/css/{styles → props}/gap/index.ts +0 -0
  805. /package/src/css/{styles → props}/inset/index.ts +0 -0
  806. /package/src/css/{styles → props}/margin/index.ts +0 -0
  807. /package/src/css/{styles → props}/maxWidth/index.ts +0 -0
  808. /package/src/css/{styles → props}/overflow/index.ts +0 -0
  809. /package/src/css/{styles → props}/padding/index.ts +0 -0
  810. /package/src/css/{styles → props}/pointerEvents/index.ts +0 -0
  811. /package/src/css/{styles → props}/pointerEvents/types.ts +0 -0
  812. /package/src/css/{styles → props}/position/index.ts +0 -0
  813. /package/src/css/{styles → props}/radius/index.ts +0 -0
  814. /package/src/css/{styles → props}/shadow/index.ts +0 -0
  815. /package/src/css/{styles → props}/textOverflow/index.ts +0 -0
  816. /package/src/css/{styles → props}/width/index.ts +0 -0
  817. /package/src/theme/{build → v2/build}/_deprecated/color/index.ts +0 -0
  818. /package/src/theme/{build → v2/build}/colorToken/index.ts +0 -0
  819. /package/src/theme/{build → v2/build}/index.ts +0 -0
  820. /package/src/theme/{build → v2/build}/lib/color-fns/blend/index.ts +0 -0
  821. /package/src/theme/{build → v2/build}/lib/color-fns/index.ts +0 -0
  822. /package/src/theme/{build → v2/build}/lib/color-fns/rgba.ts +0 -0
  823. /package/src/theme/{build → v2/build}/lib/color-fns/types.ts +0 -0
  824. /package/src/theme/{build → v2/build}/lib/isRecord.ts +0 -0
  825. /package/src/theme/{build → v2/build}/lib/utils.ts +0 -0
  826. /package/src/theme/{build → v2/build}/merge.ts +0 -0
  827. /package/src/theme/{config → v2/config}/index.ts +0 -0
  828. /package/src/theme/{config → v2/config}/tokens/color/index.ts +0 -0
  829. /package/src/theme/{palette → v3/palette}/index.ts +0 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,2222 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: !0 });
3
+ var theme = require("@sanity/ui/theme"), _visualEditing = require("./_chunks-cjs/_visual-editing.cjs"), jsxRuntime = require("react/jsx-runtime"), icons = require("@sanity/icons"), react = require("react"), reactCompilerRuntime = require("react-compiler-runtime"), css = require("@sanity/ui/css"), framerMotion = require("framer-motion");
4
+ const createColorTheme = theme.createColorTheme, hexToRgb = theme.hexToRgb, hslToRgb = theme.hslToRgb, multiply = theme.multiply, parseColor = theme.parseColor, rgbToHex = theme.rgbToHex, rgbToHsl = theme.rgbToHsl, rgba = theme.rgba, screen = theme.screen;
5
+ function _responsive(media, values, callback) {
6
+ return (values?.map(callback) || []).map((statement, mediaIndex) => mediaIndex === 0 ? statement : {
7
+ [`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
8
+ });
9
+ }
10
+ function _raf(fn) {
11
+ const frameId = requestAnimationFrame(fn);
12
+ return () => {
13
+ cancelAnimationFrame(frameId);
14
+ };
15
+ }
16
+ function _raf2(fn) {
17
+ let innerDispose = null;
18
+ const outerDispose = _raf(() => {
19
+ innerDispose = _raf(fn);
20
+ });
21
+ return () => {
22
+ innerDispose && innerDispose(), outerDispose();
23
+ };
24
+ }
25
+ function _hasFocus(element) {
26
+ return !!document.activeElement && element.contains(document.activeElement);
27
+ }
28
+ function isFocusable(element) {
29
+ return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 : _visualEditing.isHTMLAnchorElement(element) ? !!element.href && element.rel !== "ignore" : _visualEditing.isHTMLInputElement(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : _visualEditing.isHTMLButtonElement(element) || _visualEditing.isHTMLSelectElement(element) || _visualEditing.isHTMLTextAreaElement(element) ? !element.disabled : !1;
30
+ }
31
+ function attemptFocus(element) {
32
+ if (!isFocusable(element))
33
+ return !1;
34
+ try {
35
+ element.focus();
36
+ } catch {
37
+ }
38
+ return document.activeElement === element;
39
+ }
40
+ function focusFirstDescendant(element) {
41
+ for (let i = 0; i < element.childNodes.length; i++) {
42
+ const child = element.childNodes[i];
43
+ if (_visualEditing.isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
44
+ return !0;
45
+ }
46
+ return !1;
47
+ }
48
+ function focusLastDescendant(element) {
49
+ for (let i = element.childNodes.length - 1; i >= 0; i--) {
50
+ const child = element.childNodes[i];
51
+ if (_visualEditing.isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
52
+ return !0;
53
+ }
54
+ return !1;
55
+ }
56
+ function _isScrollable(el) {
57
+ if (!(el instanceof Element)) return !1;
58
+ const style = window.getComputedStyle(el);
59
+ return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
60
+ }
61
+ function useArrayProp(val, defaultVal) {
62
+ const $ = reactCompilerRuntime.c(3);
63
+ let t0;
64
+ $[0] !== defaultVal || $[1] !== val ? (t0 = () => [_visualEditing._getArrayProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2];
65
+ const [t1, setCache] = react.useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
66
+ return hash !== cachedHash && setCache([_visualEditing._getArrayProp(val, defaultVal), hash]), cachedVal;
67
+ }
68
+ function _getElements(element, elementsArg) {
69
+ const ret = [element];
70
+ for (const el of elementsArg)
71
+ Array.isArray(el) ? ret.push(...el) : ret.push(el);
72
+ return ret.filter(Boolean);
73
+ }
74
+ function useClickOutside(listener, t0, boundaryElement) {
75
+ const $ = reactCompilerRuntime.c(12), elementsArg = t0 === void 0 ? _visualEditing.EMPTY_ARRAY : t0, [element, setElement] = react.useState(null);
76
+ let t1;
77
+ $[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
78
+ const [elements, setElements] = react.useState(t1), elementsRef = react.useRef(elements);
79
+ let t2, t3;
80
+ $[3] !== element || $[4] !== elementsArg ? (t2 = () => {
81
+ const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
82
+ if (prevElements.length !== nextElements.length) {
83
+ setElements(nextElements), elementsRef.current = nextElements;
84
+ return;
85
+ }
86
+ for (const el of prevElements)
87
+ if (!nextElements.includes(el)) {
88
+ setElements(nextElements), elementsRef.current = nextElements;
89
+ return;
90
+ }
91
+ for (const el_0 of nextElements)
92
+ if (!prevElements.includes(el_0)) {
93
+ setElements(nextElements), elementsRef.current = nextElements;
94
+ return;
95
+ }
96
+ }, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), react.useEffect(t2, t3);
97
+ let t4, t5;
98
+ return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
99
+ if (!listener)
100
+ return;
101
+ const handleWindowMouseDown = (evt) => {
102
+ const target = evt.target;
103
+ if (target instanceof Node && !(boundaryElement && !boundaryElement.contains(target))) {
104
+ for (const el_1 of elements)
105
+ if (target === el_1 || el_1.contains(target))
106
+ return;
107
+ listener(evt);
108
+ }
109
+ };
110
+ return window.addEventListener("mousedown", handleWindowMouseDown), () => {
111
+ window.removeEventListener("mousedown", handleWindowMouseDown);
112
+ };
113
+ }, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), react.useEffect(t4, t5), setElement;
114
+ }
115
+ function useElementRect(element) {
116
+ return _visualEditing.useElementSize(element)?._contentRect || null;
117
+ }
118
+ function useForwardedRef(ref) {
119
+ const $ = reactCompilerRuntime.c(1), innerRef = react.useRef(null);
120
+ let t0;
121
+ return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], react.useImperativeHandle(ref, t0), innerRef;
122
+ }
123
+ const DEFAULT_LABEL_ELEMENT = "div";
124
+ function Label(props) {
125
+ const $ = reactCompilerRuntime.c(28);
126
+ let accent, align, children, className, rest, t0, t1, t2, t3, textOverflowProp;
127
+ $[0] !== props ? ({
128
+ accent,
129
+ align,
130
+ as: t0,
131
+ children,
132
+ className,
133
+ muted: t1,
134
+ size: t2,
135
+ textOverflow: textOverflowProp,
136
+ weight: t3,
137
+ ...rest
138
+ } = props, $[0] = props, $[1] = accent, $[2] = align, $[3] = children, $[4] = className, $[5] = rest, $[6] = t0, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = textOverflowProp) : (accent = $[1], align = $[2], children = $[3], className = $[4], rest = $[5], t0 = $[6], t1 = $[7], t2 = $[8], t3 = $[9], textOverflowProp = $[10]);
139
+ const Element2 = t0 === void 0 ? DEFAULT_LABEL_ELEMENT : t0, muted = t1 === void 0 ? !1 : t1, size = t2 === void 0 ? 1 : t2, weight = t3 === void 0 ? "regular" : t3;
140
+ let t4;
141
+ $[11] !== accent || $[12] !== align || $[13] !== className || $[14] !== muted || $[15] !== size || $[16] !== weight ? (t4 = css.label({
142
+ className,
143
+ accent,
144
+ align,
145
+ muted,
146
+ size,
147
+ weight
148
+ }), $[11] = accent, $[12] = align, $[13] = className, $[14] = muted, $[15] = size, $[16] = weight, $[17] = t4) : t4 = $[17];
149
+ let t5;
150
+ $[18] !== textOverflowProp ? (t5 = css.textOverflow({
151
+ textOverflow: textOverflowProp
152
+ }), $[18] = textOverflowProp, $[19] = t5) : t5 = $[19];
153
+ let t6;
154
+ $[20] !== children || $[21] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t5, children }), $[20] = children, $[21] = t5, $[22] = t6) : t6 = $[22];
155
+ let t7;
156
+ return $[23] !== Element2 || $[24] !== rest || $[25] !== t4 || $[26] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "Label", ...rest, className: t4, children: t6 }), $[23] = Element2, $[24] = rest, $[25] = t4, $[26] = t6, $[27] = t7) : t7 = $[27], t7;
157
+ }
158
+ const DEFAULT_AVATAR_ELEMENT = "span";
159
+ function Avatar(props) {
160
+ const $ = reactCompilerRuntime.c(51), t0 = props;
161
+ let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, className, initials, onImageLoadError, rest, src, t1, t2, t3, t4, title;
162
+ $[0] !== t0 ? ({
163
+ __unstable_hideInnerStroke,
164
+ as: t1,
165
+ className,
166
+ color: t2,
167
+ src,
168
+ title,
169
+ initials,
170
+ onImageLoadError,
171
+ arrowPosition: arrowPositionProp,
172
+ animateArrowFrom,
173
+ status: t3,
174
+ size: t4,
175
+ ...rest
176
+ } = 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] = t4, $[13] = title) : (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], className = $[4], initials = $[5], onImageLoadError = $[6], rest = $[7], src = $[8], t1 = $[9], t2 = $[10], t3 = $[11], t4 = $[12], title = $[13]);
177
+ const Element2 = t1 === void 0 ? DEFAULT_AVATAR_ELEMENT : t1, color = t2 === void 0 ? "magenta" : t2, sizeProp = t4 === void 0 ? 1 : t4, size = _visualEditing.useResponsiveProp(sizeProp), [arrowPosition, setArrowPosition] = react.useState(animateArrowFrom || arrowPositionProp || "inside"), [imageError, setImageError] = react.useState(!1);
178
+ let t5, t6;
179
+ $[14] !== arrowPosition || $[15] !== arrowPositionProp ? (t5 = () => {
180
+ if (arrowPosition === arrowPositionProp)
181
+ return;
182
+ const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
183
+ return () => cancelAnimationFrame(raf);
184
+ }, t6 = [arrowPosition, arrowPositionProp], $[14] = arrowPosition, $[15] = arrowPositionProp, $[16] = t5, $[17] = t6) : (t5 = $[16], t6 = $[17]), react.useEffect(t5, t6);
185
+ let t7, t8;
186
+ $[18] !== src ? (t7 = () => {
187
+ src && setImageError(!1);
188
+ }, t8 = [src], $[18] = src, $[19] = t7, $[20] = t8) : (t7 = $[19], t8 = $[20]), react.useEffect(t7, t8);
189
+ let t9;
190
+ $[21] !== onImageLoadError ? (t9 = () => {
191
+ setImageError(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
192
+ }, $[21] = onImageLoadError, $[22] = t9) : t9 = $[22];
193
+ const handleImageError = t9;
194
+ let t10, t11;
195
+ $[23] !== size ? (t11 = Object.values(size).map(_temp$4), $[23] = size, $[24] = t11) : t11 = $[24], t10 = t11;
196
+ const initialsSize = t10, t12 = __unstable_hideInnerStroke ? "" : void 0;
197
+ let t13;
198
+ $[25] !== className || $[26] !== color || $[27] !== sizeProp ? (t13 = css.avatar({
199
+ className,
200
+ color,
201
+ size: sizeProp
202
+ }), $[25] = className, $[26] = color, $[27] = sizeProp, $[28] = t13) : t13 = $[28];
203
+ const t14 = imageError ? "" : void 0;
204
+ let t15;
205
+ $[29] === Symbol.for("react.memo_cache_sentinel") ? (t15 = css.avatarArrow(), $[29] = t15) : t15 = $[29];
206
+ let t16;
207
+ $[30] !== color ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t15, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[30] = color, $[31] = t16) : t16 = $[31];
208
+ let t17;
209
+ $[32] === Symbol.for("react.memo_cache_sentinel") ? (t17 = css.avatarInitials(), $[32] = t17) : t17 = $[32];
210
+ let t18;
211
+ $[33] !== initials || $[34] !== initialsSize ? (t18 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { alignItems: "center", as: "span", className: t17, display: "flex", justifyContent: "center", position: "absolute", inset: 0, children: /* @__PURE__ */ jsxRuntime.jsx(Label, { align: "center", as: "span", size: initialsSize, weight: "medium", children: initials }) }), $[33] = initials, $[34] = initialsSize, $[35] = t18) : t18 = $[35];
212
+ let t19;
213
+ $[36] !== handleImageError || $[37] !== initials || $[38] !== src ? (t19 = src && /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { className: css.avatarImage(), inset: 0, position: "absolute", children: [
214
+ /* @__PURE__ */ jsxRuntime.jsx("img", { alt: initials, onError: handleImageError, src }),
215
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: css.avatarImageOutline() })
216
+ ] }), $[36] = handleImageError, $[37] = initials, $[38] = src, $[39] = t19) : t19 = $[39];
217
+ let t20;
218
+ return $[40] !== Element2 || $[41] !== arrowPosition || $[42] !== rest || $[43] !== t12 || $[44] !== t13 || $[45] !== t14 || $[46] !== t16 || $[47] !== t18 || $[48] !== t19 || $[49] !== title ? (t20 = /* @__PURE__ */ jsxRuntime.jsxs(Element2, { "data-hide-inner-stroke": t12, "data-ui": "Avatar", ...rest, "aria-label": title, className: t13, "data-arrow-position": arrowPosition, "data-image-error": t14, title, children: [
219
+ t16,
220
+ t18,
221
+ t19
222
+ ] }), $[40] = Element2, $[41] = arrowPosition, $[42] = rest, $[43] = t12, $[44] = t13, $[45] = t14, $[46] = t16, $[47] = t18, $[48] = t19, $[49] = title, $[50] = t20) : t20 = $[50], t20;
223
+ }
224
+ function _temp$4(s) {
225
+ return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
226
+ }
227
+ const DEFAULT_AVATAR_COUNTER_ELEMENT = "div";
228
+ function AvatarCounter(props) {
229
+ const $ = reactCompilerRuntime.c(19), t0 = props;
230
+ let className, count, rest, t1, t2;
231
+ $[0] !== t0 ? ({
232
+ as: t1,
233
+ className,
234
+ count,
235
+ size: t2,
236
+ ...rest
237
+ } = t0, $[0] = t0, $[1] = className, $[2] = count, $[3] = rest, $[4] = t1, $[5] = t2) : (className = $[1], count = $[2], rest = $[3], t1 = $[4], t2 = $[5]);
238
+ const as = t1 === void 0 ? DEFAULT_AVATAR_COUNTER_ELEMENT : t1, size = _visualEditing.useResponsiveProp(t2 === void 0 ? 1 : t2);
239
+ let t3, t4;
240
+ $[6] !== size ? (t4 = Object.values(size).map(_temp$3), $[6] = size, $[7] = t4) : t4 = $[7], t3 = t4;
241
+ const labelSize = t3;
242
+ let t5;
243
+ $[8] !== className || $[9] !== size ? (t5 = css.avatarCounter({
244
+ className,
245
+ size
246
+ }), $[8] = className, $[9] = size, $[10] = t5) : t5 = $[10];
247
+ let t6;
248
+ $[11] !== count || $[12] !== labelSize ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(Label, { align: "center", as: "span", size: labelSize, weight: "medium", children: count }), $[11] = count, $[12] = labelSize, $[13] = t6) : t6 = $[13];
249
+ let t7;
250
+ return $[14] !== as || $[15] !== rest || $[16] !== t5 || $[17] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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;
251
+ }
252
+ function _temp$3(s) {
253
+ return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
254
+ }
255
+ const DEFAULT_AVATAR_STACK_ELEMENT = "div";
256
+ function AvatarStack(props) {
257
+ const $ = reactCompilerRuntime.c(20), t0 = props;
258
+ let childrenProp, className, rest, t1, t2, t3;
259
+ $[0] !== t0 ? ({
260
+ as: t1,
261
+ children: childrenProp,
262
+ className,
263
+ maxLength: t2,
264
+ size: t3,
265
+ ...rest
266
+ } = t0, $[0] = t0, $[1] = childrenProp, $[2] = className, $[3] = rest, $[4] = t1, $[5] = t2, $[6] = t3) : (childrenProp = $[1], className = $[2], rest = $[3], t1 = $[4], t2 = $[5], t3 = $[6]);
267
+ const as = t1 === void 0 ? DEFAULT_AVATAR_STACK_ELEMENT : t1, maxLengthProp = t2 === void 0 ? 4 : t2, sizeProp = t3 === void 0 ? 1 : t3, children = react.Children.toArray(childrenProp).filter(react.isValidElement), maxLength = Math.max(maxLengthProp, 0), size = _visualEditing.useResponsiveProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children, T0 = _visualEditing.Box, t4 = "AvatarStack", t5 = "center";
268
+ let t6;
269
+ $[7] !== className || $[8] !== size ? (t6 = css.avatarStack({
270
+ className,
271
+ size
272
+ }), $[7] = className, $[8] = size, $[9] = t6) : t6 = $[9];
273
+ const t7 = "flex", t8 = "flex-start", t9 = len === 0 && /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: len, size }), t10 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: extraCount, size });
274
+ let t11;
275
+ $[10] !== size ? (t11 = (child, childIndex) => /* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: react.cloneElement(child, {
276
+ size
277
+ }) }, String(childIndex)), $[10] = size, $[11] = t11) : t11 = $[11];
278
+ const t12 = visibleChildren.map(t11);
279
+ let t13;
280
+ return $[12] !== T0 || $[13] !== as || $[14] !== rest || $[15] !== t10 || $[16] !== t12 || $[17] !== t6 || $[18] !== t9 ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(T0, { "data-ui": t4, ...rest, alignItems: t5, as, className: t6, display: t7, justifyContent: t8, children: [
281
+ t9,
282
+ t10,
283
+ t12
284
+ ] }), $[12] = T0, $[13] = as, $[14] = rest, $[15] = t10, $[16] = t12, $[17] = t6, $[18] = t9, $[19] = t13) : t13 = $[19], t13;
285
+ }
286
+ const DEFAULT_BADGE_ELEMENT = "span";
287
+ function Badge(props) {
288
+ const $ = reactCompilerRuntime.c(22), t0 = props;
289
+ let children, className, rest, t1, t2, t3, t4, t5;
290
+ $[0] !== t0 ? ({
291
+ as: t1,
292
+ children,
293
+ className,
294
+ fontSize: t2,
295
+ padding: t3,
296
+ radius: t4,
297
+ tone: t5,
298
+ ...rest
299
+ } = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = rest, $[4] = t1, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5) : (children = $[1], className = $[2], rest = $[3], t1 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8]);
300
+ const as = t1 === void 0 ? DEFAULT_BADGE_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, padding = t3 === void 0 ? 1 : t3, radius = t4 === void 0 ? 2 : t4, tone = t5 === void 0 ? "default" : t5;
301
+ let t6;
302
+ $[9] !== className || $[10] !== tone ? (t6 = css.badge({
303
+ className,
304
+ tone
305
+ }), $[9] = className, $[10] = tone, $[11] = t6) : t6 = $[11];
306
+ let t7;
307
+ $[12] !== children || $[13] !== fontSize ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, children }), $[12] = children, $[13] = fontSize, $[14] = t7) : t7 = $[14];
308
+ let t8;
309
+ return $[15] !== as || $[16] !== padding || $[17] !== radius || $[18] !== rest || $[19] !== t6 || $[20] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "Badge", ...rest, as, className: t6, display: "inline-flex", maxWidth: "fill", padding, radius, children: t7 }), $[15] = as, $[16] = padding, $[17] = radius, $[18] = rest, $[19] = t6, $[20] = t7, $[21] = t8) : t8 = $[21], t8;
310
+ }
311
+ const DEFAULT_CHECKBOX_ELEMENT = "input";
312
+ function Checkbox(props) {
313
+ const $ = reactCompilerRuntime.c(30), t0 = props;
314
+ let checked, className, customValidity, disabled, forwardedRef, indeterminate, readOnly, rest, style, t1;
315
+ $[0] !== t0 ? ({
316
+ as: t1,
317
+ checked,
318
+ className,
319
+ disabled,
320
+ indeterminate,
321
+ customValidity,
322
+ readOnly,
323
+ ref: forwardedRef,
324
+ style,
325
+ ...rest
326
+ } = t0, $[0] = t0, $[1] = checked, $[2] = className, $[3] = customValidity, $[4] = disabled, $[5] = forwardedRef, $[6] = indeterminate, $[7] = readOnly, $[8] = rest, $[9] = style, $[10] = t1) : (checked = $[1], className = $[2], customValidity = $[3], disabled = $[4], forwardedRef = $[5], indeterminate = $[6], readOnly = $[7], rest = $[8], style = $[9], t1 = $[10]);
327
+ const Element2 = t1 === void 0 ? DEFAULT_CHECKBOX_ELEMENT : t1, ref = react.useRef(null);
328
+ let t2;
329
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[11] = t2) : t2 = $[11], react.useImperativeHandle(forwardedRef, t2);
330
+ let t3, t4;
331
+ $[12] !== indeterminate ? (t3 = () => {
332
+ ref.current && (ref.current.indeterminate = indeterminate || !1);
333
+ }, t4 = [indeterminate], $[12] = indeterminate, $[13] = t3, $[14] = t4) : (t3 = $[13], t4 = $[14]), react.useEffect(t3, t4), _visualEditing.useCustomValidity(ref, customValidity);
334
+ let t5;
335
+ $[15] !== className ? (t5 = css.checkbox({
336
+ className
337
+ }), $[15] = className, $[16] = t5) : t5 = $[16];
338
+ let t6;
339
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t6 = css.checkboxInput(), $[17] = t6) : t6 = $[17];
340
+ const t7 = customValidity ? "" : void 0, t8 = disabled || readOnly;
341
+ let t9;
342
+ $[18] !== Element2 || $[19] !== checked || $[20] !== readOnly || $[21] !== rest || $[22] !== t7 || $[23] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, checked, className: t6, "data-invalid": t7, disabled: t8, type: "checkbox", readOnly, ref }), $[18] = Element2, $[19] = checked, $[20] = readOnly, $[21] = rest, $[22] = t7, $[23] = t8, $[24] = t9) : t9 = $[24];
343
+ let t10;
344
+ $[25] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: css.checkboxPresentation(), children: [
345
+ /* @__PURE__ */ jsxRuntime.jsx(icons.CheckmarkIcon, {}),
346
+ /* @__PURE__ */ jsxRuntime.jsx(icons.RemoveIcon, {})
347
+ ] }), $[25] = t10) : t10 = $[25];
348
+ let t11;
349
+ return $[26] !== style || $[27] !== t5 || $[28] !== t9 ? (t11 = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: t5, "data-ui": "Checkbox", style, children: [
350
+ t9,
351
+ t10
352
+ ] }), $[26] = style, $[27] = t5, $[28] = t9, $[29] = t11) : t11 = $[29], t11;
353
+ }
354
+ const DEFAULT_CONTAINER_ELEMENT = "div";
355
+ function Container(props) {
356
+ const $ = reactCompilerRuntime.c(12), t0 = props;
357
+ let className, rest, t1, t2;
358
+ $[0] !== t0 ? ({
359
+ as: t1,
360
+ className,
361
+ width: t2,
362
+ ...rest
363
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1, $[4] = t2) : (className = $[1], rest = $[2], t1 = $[3], t2 = $[4]);
364
+ const as = t1 === void 0 ? DEFAULT_CONTAINER_ELEMENT : t1, width = t2 === void 0 ? 2 : t2;
365
+ let t3;
366
+ $[5] !== className || $[6] !== width ? (t3 = css.container({
367
+ className,
368
+ width
369
+ }), $[5] = className, $[6] = width, $[7] = t3) : t3 = $[7];
370
+ let t4;
371
+ return $[8] !== as || $[9] !== rest || $[10] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "Container", ...rest, as, className: t3 }), $[8] = as, $[9] = rest, $[10] = t3, $[11] = t4) : t4 = $[11], t4;
372
+ }
373
+ const DEFAULT_HEADING_ELEMENT = "div";
374
+ function Heading(props) {
375
+ const $ = reactCompilerRuntime.c(30), t0 = props;
376
+ let align, children, className, flex, rest, t1, t2, t3, t4, t5, textOverflowProp;
377
+ $[0] !== t0 ? ({
378
+ accent: t1,
379
+ align,
380
+ as: t2,
381
+ children,
382
+ className,
383
+ flex,
384
+ muted: t3,
385
+ size: t4,
386
+ textOverflow: textOverflowProp,
387
+ weight: t5,
388
+ ...rest
389
+ } = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = rest, $[6] = t1, $[7] = t2, $[8] = t3, $[9] = t4, $[10] = t5, $[11] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], flex = $[4], rest = $[5], t1 = $[6], t2 = $[7], t3 = $[8], t4 = $[9], t5 = $[10], textOverflowProp = $[11]);
390
+ const accent = t1 === void 0 ? !1 : t1, Element2 = t2 === void 0 ? DEFAULT_HEADING_ELEMENT : t2, muted = t3 === void 0 ? !1 : t3, size = t4 === void 0 ? 2 : t4, weight = t5 === void 0 ? "regular" : t5;
391
+ let t6;
392
+ $[12] !== accent || $[13] !== align || $[14] !== className || $[15] !== flex || $[16] !== muted || $[17] !== size || $[18] !== weight ? (t6 = css.heading({
393
+ className,
394
+ accent,
395
+ align,
396
+ flex,
397
+ muted,
398
+ size,
399
+ weight
400
+ }), $[12] = accent, $[13] = align, $[14] = className, $[15] = flex, $[16] = muted, $[17] = size, $[18] = weight, $[19] = t6) : t6 = $[19];
401
+ let t7;
402
+ $[20] !== textOverflowProp ? (t7 = css.textOverflow({
403
+ textOverflow: textOverflowProp
404
+ }), $[20] = textOverflowProp, $[21] = t7) : t7 = $[21];
405
+ let t8;
406
+ $[22] !== children || $[23] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t7, children }), $[22] = children, $[23] = t7, $[24] = t8) : t8 = $[24];
407
+ let t9;
408
+ return $[25] !== Element2 || $[26] !== rest || $[27] !== t6 || $[28] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "Heading", ...rest, className: t6, children: t8 }), $[25] = Element2, $[26] = rest, $[27] = t6, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
409
+ }
410
+ const DEFAULT_INLINE_ELEMENT = "div";
411
+ function Inline(props) {
412
+ const $ = reactCompilerRuntime.c(11), t0 = props;
413
+ let children, gap, rest, space, t1;
414
+ $[0] !== t0 ? ({
415
+ as: t1,
416
+ children,
417
+ gap,
418
+ space,
419
+ ...rest
420
+ } = t0, $[0] = t0, $[1] = children, $[2] = gap, $[3] = rest, $[4] = space, $[5] = t1) : (children = $[1], gap = $[2], rest = $[3], space = $[4], t1 = $[5]);
421
+ const as = t1 === void 0 ? DEFAULT_INLINE_ELEMENT : t1, t2 = gap ?? space;
422
+ let t3;
423
+ return $[6] !== as || $[7] !== children || $[8] !== rest || $[9] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "Inline", ...rest, alignItems: "center", as, display: "flex", gap: t2, flexWrap: "wrap", children }), $[6] = as, $[7] = children, $[8] = rest, $[9] = t2, $[10] = t3) : t3 = $[10], t3;
424
+ }
425
+ function BoundaryElementProvider(props) {
426
+ const $ = reactCompilerRuntime.c(5), {
427
+ children,
428
+ element
429
+ } = props;
430
+ let t0, t1;
431
+ $[0] !== element ? (t1 = {
432
+ version: 0,
433
+ element
434
+ }, $[0] = element, $[1] = t1) : t1 = $[1], t0 = t1;
435
+ const value = t0;
436
+ let t2;
437
+ return $[2] !== children || $[3] !== value ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.BoundaryElementContext.Provider, { value, children }), $[2] = children, $[3] = value, $[4] = t2) : t2 = $[4], t2;
438
+ }
439
+ class ErrorBoundary extends react.Component {
440
+ state = {
441
+ error: null
442
+ };
443
+ static displayName = "ErrorBoundary";
444
+ static getDerivedStateFromError(error) {
445
+ return {
446
+ error
447
+ };
448
+ }
449
+ componentDidCatch(error, info) {
450
+ this.props.onCatch({
451
+ error,
452
+ info
453
+ });
454
+ }
455
+ render() {
456
+ const {
457
+ error
458
+ } = this.state;
459
+ if (error) {
460
+ const message = typeof error?.message == "string" ? error.message : "Error";
461
+ return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Code, { children: message });
462
+ }
463
+ return this.props.children;
464
+ }
465
+ }
466
+ const DEFAULT_SR_ONLY_ELEMENT = "span";
467
+ function SrOnly(props) {
468
+ const $ = reactCompilerRuntime.c(12), t0 = props;
469
+ let children, className, rest, t1;
470
+ $[0] !== t0 ? ({
471
+ as: t1,
472
+ children,
473
+ className,
474
+ ...rest
475
+ } = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = rest, $[4] = t1) : (children = $[1], className = $[2], rest = $[3], t1 = $[4]);
476
+ const Element2 = t1 === void 0 ? DEFAULT_SR_ONLY_ELEMENT : t1;
477
+ let t2;
478
+ $[5] !== className ? (t2 = css.srOnly({
479
+ className
480
+ }), $[5] = className, $[6] = t2) : t2 = $[6];
481
+ let t3;
482
+ return $[7] !== Element2 || $[8] !== children || $[9] !== rest || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "SrOnly", ...rest, "aria-hidden": !0, className: t2, children }), $[7] = Element2, $[8] = children, $[9] = rest, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
483
+ }
484
+ const DEFAULT_VIRTUAL_LIST_ELEMENT = "div";
485
+ function VirtualList(props) {
486
+ const $ = reactCompilerRuntime.c(58), t0 = props;
487
+ let forwardedRef, getItemKey, onChange, renderItem, rest, t1, t2, t3;
488
+ $[0] !== t0 ? ({
489
+ as: t1,
490
+ gap: t2,
491
+ getItemKey,
492
+ items: t3,
493
+ onChange,
494
+ renderItem,
495
+ ref: forwardedRef,
496
+ ...rest
497
+ } = t0, $[0] = t0, $[1] = forwardedRef, $[2] = getItemKey, $[3] = onChange, $[4] = renderItem, $[5] = rest, $[6] = t1, $[7] = t2, $[8] = t3) : (forwardedRef = $[1], getItemKey = $[2], onChange = $[3], renderItem = $[4], rest = $[5], t1 = $[6], t2 = $[7], t3 = $[8]);
498
+ const as = t1 === void 0 ? DEFAULT_VIRTUAL_LIST_ELEMENT : t1, gap = t2 === void 0 ? 0 : t2;
499
+ let t4;
500
+ $[9] !== t3 ? (t4 = t3 === void 0 ? [] : t3, $[9] = t3, $[10] = t4) : t4 = $[10];
501
+ const items = t4, ref = react.useRef(null), wrapperRef = react.useRef(null), [scrollTop, setScrollTop] = react.useState(0), [scrollHeight, setScrollHeight] = react.useState(0), [itemHeight, setItemHeight] = react.useState(-1), [gapValue, setGapValue] = react.useState(0);
502
+ let t5;
503
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[11] = t5) : t5 = $[11], react.useImperativeHandle(forwardedRef, t5);
504
+ let t6, t7;
505
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => {
506
+ if (!ref.current)
507
+ return;
508
+ const scrollEl = findScrollable(ref.current.parentNode);
509
+ if (scrollEl) {
510
+ if (!(scrollEl instanceof HTMLElement))
511
+ return;
512
+ const handleScroll = () => {
513
+ setScrollTop(scrollEl.scrollTop);
514
+ };
515
+ scrollEl.addEventListener("scroll", handleScroll, {
516
+ passive: !0
517
+ });
518
+ const ro = new _visualEditing._ResizeObserver((entries) => {
519
+ setScrollHeight(entries[0].contentRect.height);
520
+ });
521
+ return ro.observe(scrollEl), handleScroll(), () => {
522
+ scrollEl.removeEventListener("scroll", handleScroll), ro.unobserve(scrollEl), ro.disconnect();
523
+ };
524
+ }
525
+ const handleScroll_0 = () => {
526
+ setScrollTop(window.scrollY);
527
+ }, handleResize = () => {
528
+ setScrollHeight(window.innerHeight);
529
+ };
530
+ return window.addEventListener("scroll", handleScroll_0, {
531
+ passive: !0
532
+ }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
533
+ window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
534
+ };
535
+ }, t7 = [], $[12] = t6, $[13] = t7) : (t6 = $[12], t7 = $[13]), react.useEffect(t6, t7);
536
+ const len = items.length, height = itemHeight ? len * (itemHeight + gapValue) - gapValue : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0;
537
+ let t8, t9;
538
+ $[14] !== fromIndex || $[15] !== gapValue || $[16] !== itemHeight || $[17] !== onChange || $[18] !== scrollHeight || $[19] !== scrollTop || $[20] !== toIndex ? (t8 = () => {
539
+ onChange?.({
540
+ fromIndex,
541
+ gap: gapValue,
542
+ itemHeight,
543
+ scrollHeight,
544
+ scrollTop,
545
+ toIndex
546
+ });
547
+ }, 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]), react.useEffect(t8, t9);
548
+ let t10;
549
+ bb0: {
550
+ if (!renderItem || items.length === 0) {
551
+ t10 = null;
552
+ break bb0;
553
+ }
554
+ if (itemHeight === -1) {
555
+ let t113;
556
+ $[23] === Symbol.for("react.memo_cache_sentinel") ? (t113 = (el) => el ? setItemHeight(el.offsetHeight) : void 0, $[23] = t113) : t113 = $[23];
557
+ let t122;
558
+ $[24] !== items[0] || $[25] !== renderItem ? (t122 = renderItem(items[0]), $[24] = items[0], $[25] = renderItem, $[26] = t122) : t122 = $[26];
559
+ let t132;
560
+ $[27] !== t122 ? (t132 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { ref: t113, insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t122 }, 0), $[27] = t122, $[28] = t132) : t132 = $[28];
561
+ let t142;
562
+ $[29] === Symbol.for("react.memo_cache_sentinel") ? (t142 = (el_0) => el_0 ? setGapValue(el_0.offsetHeight) : void 0, $[29] = t142) : t142 = $[29];
563
+ const t15 = css.vars.space[gap];
564
+ let t16;
565
+ $[30] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: t142, style: {
566
+ height: t15
567
+ } }), $[30] = t15, $[31] = t16) : t16 = $[31];
568
+ let t17;
569
+ $[32] !== t132 || $[33] !== t16 ? (t17 = [/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
570
+ t132,
571
+ t16
572
+ ] })], $[32] = t132, $[33] = t16, $[34] = t17) : t17 = $[34], t10 = t17;
573
+ break bb0;
574
+ }
575
+ let t112;
576
+ if ($[35] !== fromIndex || $[36] !== gapValue || $[37] !== getItemKey || $[38] !== itemHeight || $[39] !== items || $[40] !== renderItem || $[41] !== toIndex) {
577
+ let t122;
578
+ $[43] !== fromIndex || $[44] !== gapValue || $[45] !== getItemKey || $[46] !== itemHeight || $[47] !== renderItem ? (t122 = (item, _itemIndex) => {
579
+ const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
580
+ return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { insetLeft: 0, insetRight: 0, position: "absolute", style: {
581
+ top: itemIndex * (itemHeight + gapValue) - gapValue
582
+ }, children: node }, key);
583
+ }, $[43] = fromIndex, $[44] = gapValue, $[45] = getItemKey, $[46] = itemHeight, $[47] = renderItem, $[48] = t122) : t122 = $[48], t112 = items.slice(fromIndex, toIndex).map(t122), $[35] = fromIndex, $[36] = gapValue, $[37] = getItemKey, $[38] = itemHeight, $[39] = items, $[40] = renderItem, $[41] = toIndex, $[42] = t112;
584
+ } else
585
+ t112 = $[42];
586
+ t10 = t112;
587
+ }
588
+ const children = t10;
589
+ let t11, t12;
590
+ $[49] !== height ? (t12 = {
591
+ height
592
+ }, $[49] = height, $[50] = t12) : t12 = $[50], t11 = t12;
593
+ const wrapperStyle = t11;
594
+ let t13;
595
+ $[51] !== children || $[52] !== wrapperStyle ? (t13 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[51] = children, $[52] = wrapperStyle, $[53] = t13) : t13 = $[53];
596
+ let t14;
597
+ return $[54] !== as || $[55] !== rest || $[56] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "VirtualList", ...rest, as, position: "relative", ref, children: t13 }), $[54] = as, $[55] = rest, $[56] = t13, $[57] = t14) : t14 = $[57], t14;
598
+ }
599
+ function findScrollable(parentNode) {
600
+ let _scrollEl = parentNode;
601
+ for (; _scrollEl && !_isScrollable(_scrollEl); )
602
+ _scrollEl = _scrollEl.parentNode;
603
+ return _scrollEl;
604
+ }
605
+ const DEFAULT_RADIO_ELEMENT = "input";
606
+ function Radio(props) {
607
+ const $ = reactCompilerRuntime.c(25), t0 = props;
608
+ let className, customValidity, disabled, forwardedRef, readOnly, rest, style, t1;
609
+ $[0] !== t0 ? ({
610
+ as: t1,
611
+ className,
612
+ disabled,
613
+ style,
614
+ customValidity,
615
+ readOnly,
616
+ ref: forwardedRef,
617
+ ...rest
618
+ } = t0, $[0] = t0, $[1] = className, $[2] = customValidity, $[3] = disabled, $[4] = forwardedRef, $[5] = readOnly, $[6] = rest, $[7] = style, $[8] = t1) : (className = $[1], customValidity = $[2], disabled = $[3], forwardedRef = $[4], readOnly = $[5], rest = $[6], style = $[7], t1 = $[8]);
619
+ const Element2 = t1 === void 0 ? DEFAULT_RADIO_ELEMENT : t1, ref = react.useRef(null);
620
+ let t2;
621
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[9] = t2) : t2 = $[9], react.useImperativeHandle(forwardedRef, t2), _visualEditing.useCustomValidity(ref, customValidity);
622
+ let t3;
623
+ $[10] !== className ? (t3 = css.radio({
624
+ className
625
+ }), $[10] = className, $[11] = t3) : t3 = $[11];
626
+ let t4;
627
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t4 = css.radioInput(), $[12] = t4) : t4 = $[12];
628
+ const t5 = customValidity ? "" : void 0, t6 = !disabled && readOnly ? "" : void 0, t7 = disabled || readOnly;
629
+ let t8;
630
+ $[13] !== Element2 || $[14] !== readOnly || $[15] !== rest || $[16] !== t5 || $[17] !== t6 || $[18] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t4, "data-invalid": t5, "data-read-only": t6, disabled: t7, readOnly, ref, type: "radio" }), $[13] = Element2, $[14] = readOnly, $[15] = rest, $[16] = t5, $[17] = t6, $[18] = t7, $[19] = t8) : t8 = $[19];
631
+ let t9;
632
+ $[20] === Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: css.radioPresentation() }), $[20] = t9) : t9 = $[20];
633
+ let t10;
634
+ return $[21] !== style || $[22] !== t3 || $[23] !== t8 ? (t10 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t3, "data-ui": "Radio", style, children: [
635
+ t8,
636
+ t9
637
+ ] }), $[21] = style, $[22] = t3, $[23] = t8, $[24] = t10) : t10 = $[24], t10;
638
+ }
639
+ const DEFAULT_SELECT_ELEMENT = "select";
640
+ function Select(props) {
641
+ const $ = reactCompilerRuntime.c(38), t0 = props;
642
+ let children, customValidity, disabled, forwardedRef, gap, readOnly, rest, t1, t2, t3, t4, t5, t6;
643
+ $[0] !== t0 ? ({
644
+ as: t1,
645
+ border: t2,
646
+ children,
647
+ customValidity,
648
+ disabled,
649
+ fontSize: t3,
650
+ gap,
651
+ padding: t4,
652
+ radius: t5,
653
+ readOnly,
654
+ ref: forwardedRef,
655
+ space: t6,
656
+ ...rest
657
+ } = t0, $[0] = t0, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = forwardedRef, $[5] = gap, $[6] = readOnly, $[7] = rest, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5, $[13] = t6) : (children = $[1], customValidity = $[2], disabled = $[3], forwardedRef = $[4], gap = $[5], readOnly = $[6], rest = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12], t6 = $[13]);
658
+ const Element2 = t1 === void 0 ? DEFAULT_SELECT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, fontSize = t3 === void 0 ? 2 : t3, padding = t4 === void 0 ? 3 : t4, radius = t5 === void 0 ? 1 : t5, space = t6 === void 0 ? 2 : t6, ref = react.useRef(null);
659
+ let t7;
660
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[14] = t7) : t7 = $[14], react.useImperativeHandle(forwardedRef, t7), _visualEditing.useCustomValidity(ref, customValidity);
661
+ const t8 = gap ?? space;
662
+ let t9;
663
+ $[15] !== border || $[16] !== fontSize || $[17] !== padding || $[18] !== radius || $[19] !== t8 ? (t9 = css.select({
664
+ border,
665
+ fontSize,
666
+ padding,
667
+ radius,
668
+ gap: t8
669
+ }), $[15] = border, $[16] = fontSize, $[17] = padding, $[18] = radius, $[19] = t8, $[20] = t9) : t9 = $[20];
670
+ let t10;
671
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css._inputElement(), $[21] = t10) : t10 = $[21];
672
+ const t11 = disabled || readOnly;
673
+ let t12;
674
+ $[22] !== Element2 || $[23] !== children || $[24] !== rest || $[25] !== t11 ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t10, disabled: t11, ref, children }), $[22] = Element2, $[23] = children, $[24] = rest, $[25] = t11, $[26] = t12) : t12 = $[26];
675
+ let t13;
676
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css.selectPresentation(), $[27] = t13) : t13 = $[27];
677
+ let t14;
678
+ $[28] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, {}), $[28] = t14) : t14 = $[28];
679
+ let t15;
680
+ $[29] !== fontSize ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, children: t14 }), $[29] = fontSize, $[30] = t15) : t15 = $[30];
681
+ let t16;
682
+ $[31] !== padding || $[32] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t13, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "span", display: "inline-block", padding, children: t15 }) }), $[31] = padding, $[32] = t15, $[33] = t16) : t16 = $[33];
683
+ let t17;
684
+ return $[34] !== t12 || $[35] !== t16 || $[36] !== t9 ? (t17 = /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-ui": "Select", className: t9, "data-icon-right": "", children: [
685
+ t12,
686
+ t16
687
+ ] }), $[34] = t12, $[35] = t16, $[36] = t9, $[37] = t17) : t17 = $[37], t17;
688
+ }
689
+ const DEFAULT_SWITCH_ELEMENT = "input";
690
+ function Switch(props) {
691
+ const $ = reactCompilerRuntime.c(31), t0 = props;
692
+ let checked, className, disabled, forwardedRef, indeterminate, readOnly, rest, style, t1;
693
+ $[0] !== t0 ? ({
694
+ as: t1,
695
+ checked,
696
+ className,
697
+ disabled,
698
+ indeterminate,
699
+ readOnly,
700
+ ref: forwardedRef,
701
+ style,
702
+ ...rest
703
+ } = t0, $[0] = t0, $[1] = checked, $[2] = className, $[3] = disabled, $[4] = forwardedRef, $[5] = indeterminate, $[6] = readOnly, $[7] = rest, $[8] = style, $[9] = t1) : (checked = $[1], className = $[2], disabled = $[3], forwardedRef = $[4], indeterminate = $[5], readOnly = $[6], rest = $[7], style = $[8], t1 = $[9]);
704
+ const Element2 = t1 === void 0 ? DEFAULT_SWITCH_ELEMENT : t1, ref = react.useRef(null);
705
+ let t2;
706
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[10] = t2) : t2 = $[10], react.useImperativeHandle(forwardedRef, t2);
707
+ let t3, t4;
708
+ $[11] !== indeterminate ? (t3 = () => {
709
+ ref.current && (ref.current.indeterminate = indeterminate || !1);
710
+ }, t4 = [indeterminate], $[11] = indeterminate, $[12] = t3, $[13] = t4) : (t3 = $[12], t4 = $[13]), react.useEffect(t3, t4);
711
+ let t5;
712
+ $[14] !== className ? (t5 = css._switch({
713
+ className
714
+ }), $[14] = className, $[15] = t5) : t5 = $[15];
715
+ const t6 = checked ? "" : void 0, t7 = indeterminate ? "" : void 0, t8 = indeterminate !== !0 && checked;
716
+ let t9;
717
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css._switchElement(), $[16] = t9) : t9 = $[16];
718
+ const t10 = disabled ? "" : void 0, t11 = !disabled && readOnly ? "" : void 0, t12 = disabled || readOnly;
719
+ let t13;
720
+ $[17] !== Element2 || $[18] !== rest || $[19] !== t10 || $[20] !== t11 || $[21] !== t12 || $[22] !== t8 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, checked: t8, className: t9, "data-disabled": t10, "data-read-only": t11, disabled: t12, type: "checkbox", ref }), $[17] = Element2, $[18] = rest, $[19] = t10, $[20] = t11, $[21] = t12, $[22] = t8, $[23] = t13) : t13 = $[23];
721
+ let t14;
722
+ $[24] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsxRuntime.jsxs("span", { "aria-hidden": !0, className: css._switchPresentation(), children: [
723
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: css._switchTrack() }),
724
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: css._switchThumb() })
725
+ ] }), $[24] = t14) : t14 = $[24];
726
+ let t15;
727
+ return $[25] !== style || $[26] !== t13 || $[27] !== t5 || $[28] !== t6 || $[29] !== t7 ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { className: t5, "data-checked": t6, "data-indeterminate": t7, "data-ui": "Switch", display: "inline-block", position: "relative", style, children: [
728
+ t13,
729
+ t14
730
+ ] }), $[25] = style, $[26] = t13, $[27] = t5, $[28] = t6, $[29] = t7, $[30] = t15) : t15 = $[30], t15;
731
+ }
732
+ const DEFAULT_TEXT_AREA_ELEMENT = "textarea";
733
+ function TextArea(props) {
734
+ const $ = reactCompilerRuntime.c(34), t0 = props;
735
+ let __unstable_disableFocusRing, customValidity, forwardedRef, gap, readOnly, rest, t1, t2, t3, t4, t5, t6, t7;
736
+ $[0] !== t0 ? ({
737
+ __unstable_disableFocusRing,
738
+ as: t1,
739
+ border: t2,
740
+ customValidity,
741
+ disabled: t3,
742
+ fontSize: t4,
743
+ gap,
744
+ padding: t5,
745
+ radius: t6,
746
+ readOnly,
747
+ ref: forwardedRef,
748
+ space: t7,
749
+ ...rest
750
+ } = t0, $[0] = t0, $[1] = __unstable_disableFocusRing, $[2] = customValidity, $[3] = forwardedRef, $[4] = gap, $[5] = readOnly, $[6] = rest, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = t5, $[12] = t6, $[13] = t7) : (__unstable_disableFocusRing = $[1], customValidity = $[2], forwardedRef = $[3], gap = $[4], readOnly = $[5], rest = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10], t5 = $[11], t6 = $[12], t7 = $[13]);
751
+ 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, padding = t5 === void 0 ? 3 : t5, radius = t6 === void 0 ? 2 : t6, space = t7 === void 0 ? 3 : t7, ref = react.useRef(null);
752
+ let t8;
753
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[14] = t8) : t8 = $[14], react.useImperativeHandle(forwardedRef, t8), _visualEditing.useCustomValidity(ref, customValidity);
754
+ const t9 = gap ?? space;
755
+ let t10;
756
+ $[15] !== border || $[16] !== fontSize || $[17] !== padding || $[18] !== radius || $[19] !== t9 ? (t10 = css.textArea({
757
+ border,
758
+ fontSize,
759
+ padding,
760
+ radius,
761
+ gap: t9
762
+ }), $[15] = border, $[16] = fontSize, $[17] = padding, $[18] = radius, $[19] = t9, $[20] = t10) : t10 = $[20];
763
+ const t11 = customValidity ? "" : void 0, t12 = !disabled && readOnly ? "" : void 0;
764
+ let t13;
765
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css._inputElement(), $[21] = t13) : t13 = $[21];
766
+ const t14 = __unstable_disableFocusRing ? "" : void 0;
767
+ let t15;
768
+ $[22] !== Element2 || $[23] !== disabled || $[24] !== readOnly || $[25] !== rest || $[26] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t13, "data-no-focus-ring": t14, disabled, readOnly, ref }), $[22] = Element2, $[23] = disabled, $[24] = readOnly, $[25] = rest, $[26] = t14, $[27] = t15) : t15 = $[27];
769
+ let t16;
770
+ $[28] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: css._inputPresentation() }), $[28] = t16) : t16 = $[28];
771
+ let t17;
772
+ return $[29] !== t10 || $[30] !== t11 || $[31] !== t12 || $[32] !== t15 ? (t17 = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: t10, "data-invalid": t11, "data-read-only": t12, "data-ui": "TextArea", children: [
773
+ t15,
774
+ t16
775
+ ] }), $[29] = t10, $[30] = t11, $[31] = t12, $[32] = t15, $[33] = t17) : t17 = $[33], t17;
776
+ }
777
+ function TooltipDelayGroupProvider(props) {
778
+ const $ = reactCompilerRuntime.c(9), {
779
+ children,
780
+ delay
781
+ } = props, [isGroupActive, setIsGroupActive] = _visualEditing.useDelayedState(!1), [openTooltipId, setOpenTooltipId] = _visualEditing.useDelayedState(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0;
782
+ let t0;
783
+ const t1 = isGroupActive ? 1 : openDelay;
784
+ let t2;
785
+ $[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t1 ? (t2 = {
786
+ setIsGroupActive,
787
+ openTooltipId,
788
+ setOpenTooltipId,
789
+ openDelay: t1,
790
+ closeDelay
791
+ }, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t1, $[5] = t2) : t2 = $[5], t0 = t2;
792
+ const value = t0;
793
+ let t3;
794
+ return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
795
+ }
796
+ function AutocompleteOption(props) {
797
+ const $ = reactCompilerRuntime.c(11), {
798
+ children,
799
+ id,
800
+ onSelect,
801
+ selected,
802
+ value
803
+ } = props;
804
+ let t0;
805
+ $[0] !== onSelect || $[1] !== value ? (t0 = () => {
806
+ setTimeout(() => {
807
+ onSelect(value);
808
+ }, 0);
809
+ }, $[0] = onSelect, $[1] = value, $[2] = t0) : t0 = $[2];
810
+ const handleClick = t0;
811
+ let t1;
812
+ $[3] !== handleClick ? (t1 = (event) => {
813
+ event.key === "Enter" && !_visualEditing._isEnterToClickElement(event.currentTarget) && handleClick();
814
+ }, $[3] = handleClick, $[4] = t1) : t1 = $[4];
815
+ const handleKeyDown = t1;
816
+ let t2;
817
+ return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsxRuntime.jsx("li", { "aria-selected": selected, "data-ui": "AutocompleteOption", id, role: "option", onClick: handleClick, onKeyDown: handleKeyDown, children }), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
818
+ }
819
+ function autocompleteReducer(state, msg) {
820
+ return msg.type === "input/change" ? {
821
+ ...state,
822
+ activeValue: null,
823
+ focused: !0,
824
+ query: msg.query
825
+ } : msg.type === "input/focus" ? {
826
+ ...state,
827
+ focused: !0
828
+ } : msg.type === "root/blur" ? {
829
+ ...state,
830
+ focused: !1,
831
+ query: null
832
+ } : msg.type === "root/clear" ? {
833
+ ...state,
834
+ activeValue: null,
835
+ query: null,
836
+ value: null
837
+ } : msg.type === "root/escape" ? {
838
+ ...state,
839
+ focused: !1,
840
+ query: null
841
+ } : msg.type === "root/open" ? {
842
+ ...state,
843
+ query: state.query || msg.query
844
+ } : msg.type === "root/setActiveValue" ? {
845
+ ...state,
846
+ activeValue: msg.value,
847
+ listFocused: msg.listFocused || state.listFocused
848
+ } : msg.type === "root/setListFocused" ? {
849
+ ...state,
850
+ listFocused: msg.listFocused
851
+ } : msg.type === "value/change" ? {
852
+ ...state,
853
+ activeValue: msg.value,
854
+ query: null,
855
+ value: msg.value
856
+ } : state;
857
+ }
858
+ 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;
859
+ function Autocomplete(props) {
860
+ const {
861
+ as = DEFAULT_AUTOCOMPLETE_ELEMENT,
862
+ border = !0,
863
+ customValidity,
864
+ disabled,
865
+ filterOption: filterOptionProp,
866
+ fontSize = 2,
867
+ icon,
868
+ id,
869
+ listBox = _visualEditing.EMPTY_RECORD,
870
+ loading,
871
+ onBlur,
872
+ onChange,
873
+ onFocus,
874
+ onQueryChange,
875
+ onSelect,
876
+ openButton,
877
+ openOnFocus,
878
+ options: optionsProp,
879
+ padding: paddingProp = 3,
880
+ popover = _visualEditing.EMPTY_RECORD,
881
+ prefix,
882
+ radius = 2,
883
+ readOnly,
884
+ ref: forwardedRef,
885
+ relatedElements,
886
+ renderOption: renderOptionProp,
887
+ renderPopover,
888
+ renderValue = DEFAULT_RENDER_VALUE,
889
+ suffix,
890
+ value: valueProp,
891
+ ...rest
892
+ } = props, [state, dispatch] = react.useReducer(autocompleteReducer, {
893
+ activeValue: valueProp || null,
894
+ focused: !1,
895
+ listFocused: !1,
896
+ query: null,
897
+ value: valueProp || null
898
+ }), {
899
+ activeValue,
900
+ focused,
901
+ listFocused,
902
+ query,
903
+ value
904
+ } = state, defaultRenderOption = react.useCallback(({
905
+ value: value_0
906
+ }) => /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { as: "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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 = react.useRef(null), resultsPopoverElementRef = react.useRef(null), inputElementRef = react.useRef(null), listBoxElementRef = react.useRef(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
907
+ react.useImperativeHandle(forwardedRef, () => inputElementRef.current);
908
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing.useResponsiveProp(paddingProp), currentOption = react.useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = react.useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = react.useCallback((event) => {
909
+ setTimeout(() => {
910
+ if (popoverMouseWithinRef.current)
911
+ return;
912
+ const elements = (relatedElements || []).concat(rootElementRef.current ? [rootElementRef.current] : [], resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : []);
913
+ let focusInside = !1;
914
+ if (document.activeElement) {
915
+ for (const e of elements)
916
+ if (e === document.activeElement || e.contains(document.activeElement)) {
917
+ focusInside = !0;
918
+ break;
919
+ }
920
+ }
921
+ focusInside === !1 && (dispatch({
922
+ type: "root/blur"
923
+ }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
924
+ }, 0);
925
+ }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = react.useCallback((event_0) => {
926
+ const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
927
+ listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
928
+ type: "root/setListFocused",
929
+ listFocused: listFocused_0
930
+ }));
931
+ }, []), handleOptionSelect = react.useCallback((v) => {
932
+ dispatch({
933
+ type: "value/change",
934
+ value: v
935
+ }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
936
+ }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = react.useCallback((event_1) => {
937
+ if (event_1.key === "ArrowDown") {
938
+ if (event_1.preventDefault(), !filteredOptionsLen) return;
939
+ const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
940
+ nextActiveOption && dispatch({
941
+ type: "root/setActiveValue",
942
+ value: nextActiveOption.value,
943
+ listFocused: !0
944
+ });
945
+ return;
946
+ }
947
+ if (event_1.key === "ArrowUp") {
948
+ if (event_1.preventDefault(), !filteredOptionsLen) return;
949
+ 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];
950
+ nextActiveOption_0 && dispatch({
951
+ type: "root/setActiveValue",
952
+ value: nextActiveOption_0.value,
953
+ listFocused: !0
954
+ });
955
+ return;
956
+ }
957
+ if (event_1.key === "Escape") {
958
+ dispatch({
959
+ type: "root/escape"
960
+ }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
961
+ return;
962
+ }
963
+ const target = event_1.target, listEl = listBoxElementRef.current;
964
+ if ((listEl === target || listEl?.contains(target)) && !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)) {
965
+ inputElementRef.current?.focus();
966
+ return;
967
+ }
968
+ }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = react.useCallback((event_2) => {
969
+ const nextQuery = event_2.currentTarget.value;
970
+ dispatch({
971
+ type: "input/change",
972
+ query: nextQuery
973
+ }), onQueryChange && onQueryChange(nextQuery);
974
+ }, [onQueryChange]), dispatchOpen = react.useCallback(() => {
975
+ dispatch({
976
+ type: "root/open",
977
+ query: value ? renderValue(value, currentOption) : ""
978
+ });
979
+ }, [currentOption, renderValue, value]), handleInputFocus = react.useCallback((event_3) => {
980
+ focused || (dispatch({
981
+ type: "input/focus"
982
+ }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
983
+ }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = react.useCallback(() => {
984
+ popoverMouseWithinRef.current = !0;
985
+ }, []), handlePopoverMouseLeave = react.useCallback(() => {
986
+ popoverMouseWithinRef.current = !1;
987
+ }, []), handleClearButtonClick = react.useCallback(() => {
988
+ dispatch({
989
+ type: "root/clear"
990
+ }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
991
+ }, [onChange, onQueryChange]), handleClearButtonFocus = react.useCallback(() => {
992
+ dispatch({
993
+ type: "input/focus"
994
+ });
995
+ }, []);
996
+ react.useEffect(() => {
997
+ if (valueProp !== valuePropRef.current) {
998
+ valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
999
+ type: "value/change",
1000
+ value: valueProp
1001
+ }), valueRef.current = valueProp);
1002
+ return;
1003
+ }
1004
+ valueProp !== valueRef.current && (valueRef.current = valueProp || null, dispatch({
1005
+ type: "value/change",
1006
+ value: valueProp || null
1007
+ }));
1008
+ }, [valueProp]), react.useEffect(() => {
1009
+ !focused && valueRef.current && dispatch({
1010
+ type: "root/setActiveValue",
1011
+ value: valueRef.current
1012
+ });
1013
+ }, [focused]), react.useEffect(() => {
1014
+ const listElement = listBoxElementRef.current;
1015
+ if (!listElement) return;
1016
+ const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
1017
+ if (activeOption_1) {
1018
+ const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
1019
+ if (activeItemElement) {
1020
+ if (_hasFocus(activeItemElement))
1021
+ return;
1022
+ focusFirstDescendant(activeItemElement);
1023
+ }
1024
+ }
1025
+ }, [activeValue, filteredOptions]);
1026
+ const clearButton = react.useMemo(() => {
1027
+ if (!loading && !disabled && value)
1028
+ return {
1029
+ "aria-label": "Clear",
1030
+ onFocus: handleClearButtonFocus
1031
+ };
1032
+ }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = react.useMemo(() => Object.fromEntries(Object.entries(padding).map(([key, value_1]) => value_1 === 0 ? [key, 0] : value_1 === 1 ? [key, 1] : value_1 === 2 ? [key, 1] : [key, value_1 - 2])), [padding]), openButtonPadding = react.useMemo(() => Object.values(padding).map((v_0) => Math.max(v_0 - 1, 0)), [padding]), openButtonProps = react.useMemo(() => typeof openButton == "object" ? openButton : _visualEditing.EMPTY_RECORD, [openButton]), handleOpenClick = react.useCallback((event_4) => {
1033
+ dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
1034
+ }, [openButtonProps, dispatchOpen]), openButtonNode = react.useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = react.useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.TextInput, { ...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 && _visualEditing.AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = react.useCallback((event_5) => {
1035
+ event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
1036
+ }, [listFocused]), content2 = react.useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", gap: 1, id: listBoxId, ref: listBoxElementRef, role: "listbox", children: filteredOptions.map((option_0) => {
1037
+ const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
1038
+ return /* @__PURE__ */ jsxRuntime.jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: react.cloneElement(renderOption(option_0), {
1039
+ disabled: loading,
1040
+ selected: active,
1041
+ tabIndex: listFocused && active ? 0 : -1
1042
+ }) }, option_0.value);
1043
+ }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = react.useMemo(() => renderPopover ? renderPopover({
1044
+ content: content2,
1045
+ hidden: !expanded,
1046
+ inputElement: inputElementRef.current,
1047
+ onMouseEnter: handlePopoverMouseEnter,
1048
+ onMouseLeave: handlePopoverMouseLeave
1049
+ }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius: 3, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, renderPopover]);
1050
+ return (
1051
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
1052
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
1053
+ input,
1054
+ results
1055
+ ] })
1056
+ );
1057
+ }
1058
+ const DEFAULT_BREADCRUMBS_ELEMENT = "nav";
1059
+ function Breadcrumbs(props) {
1060
+ const {
1061
+ as = DEFAULT_BREADCRUMBS_ELEMENT,
1062
+ children,
1063
+ className,
1064
+ expandButton: expandButtonProps,
1065
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1066
+ gap: _gapProp,
1067
+ gapX = props.gap ?? props.space ?? 2,
1068
+ gapY = props.gap ?? props.space ?? 2,
1069
+ maxLength,
1070
+ separator,
1071
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1072
+ space: _spaceProp,
1073
+ ...rest
1074
+ } = props, [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null), collapse = react.useCallback(() => setOpen(!1), []), expand = react.useCallback(() => setOpen(!0), []);
1075
+ _visualEditing.useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
1076
+ const rawItems = react.useMemo(() => react.Children.toArray(children).filter(react.isValidElement), [children]), items = react.useMemo(() => {
1077
+ const len = rawItems.length;
1078
+ if (maxLength && len > maxLength) {
1079
+ const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
1080
+ return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { constrainSize: !0, content: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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__ */ jsxRuntime.jsx(_visualEditing.Button, { mode: "bleed", padding: 0, text: "\u2026", ...expandButtonProps, onClick: open ? collapse : expand, ref: expandElementRef, selected: open }) }, "button"), ...rawItems.slice(len - afterLength)];
1081
+ }
1082
+ return rawItems;
1083
+ }, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
1084
+ return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Flex, { as, "data-ui": "Breadcrumbs", ...rest, className: css.breadcrumbs({
1085
+ className
1086
+ }), gapX, gapY, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
1087
+ itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted: !0, children: "/" }) }),
1088
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "li", children: item })
1089
+ ] }, itemIndex)) });
1090
+ }
1091
+ function isTargetWithinScope(boundaryElement, portalElement, target) {
1092
+ return !boundaryElement || !portalElement ? !0 : _visualEditing.containsOrEqualsElement(boundaryElement, target) || _visualEditing.containsOrEqualsElement(portalElement, target);
1093
+ }
1094
+ const DEFAULT_DIALOG_CARD_ELEMENT = "div";
1095
+ function DialogCard(props) {
1096
+ const $ = reactCompilerRuntime.c(51), t0 = props;
1097
+ let autoFocus, children, footer, forwardedContentRef, forwardedRef, header, hideCloseButton, id, onClickOutside, onClose, portalProp, rest, t1;
1098
+ $[0] !== t0 ? ({
1099
+ __unstable_autoFocus: autoFocus,
1100
+ __unstable_hideCloseButton: hideCloseButton,
1101
+ as: t1,
1102
+ children,
1103
+ contentRef: forwardedContentRef,
1104
+ footer,
1105
+ header,
1106
+ id,
1107
+ onClickOutside,
1108
+ onClose,
1109
+ portal: portalProp,
1110
+ ref: forwardedRef,
1111
+ ...rest
1112
+ } = 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]);
1113
+ const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, ref = react.useRef(null), contentRef = react.useRef(null), layer = _visualEditing.useLayer(), {
1114
+ isTopLayer
1115
+ } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
1116
+ let t2;
1117
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], react.useImperativeHandle(forwardedRef, t2);
1118
+ let t3;
1119
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => contentRef.current, $[15] = t3) : t3 = $[15], react.useImperativeHandle(forwardedContentRef, t3);
1120
+ let t4, t5;
1121
+ $[16] !== autoFocus ? (t4 = () => {
1122
+ autoFocus && ref.current && focusFirstDescendant(ref.current);
1123
+ }, t5 = [autoFocus, ref], $[16] = autoFocus, $[17] = t4, $[18] = t5) : (t4 = $[17], t5 = $[18]), react.useEffect(t4, t5);
1124
+ let t6;
1125
+ $[19] !== boundaryElement || $[20] !== isTopLayer || $[21] !== onClose || $[22] !== portalElement ? (t6 = (event) => {
1126
+ if (!isTopLayer || !onClose)
1127
+ return;
1128
+ const target = document.activeElement;
1129
+ target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
1130
+ }, $[19] = boundaryElement, $[20] = isTopLayer, $[21] = onClose, $[22] = portalElement, $[23] = t6) : t6 = $[23], _visualEditing.useGlobalKeyDown(t6);
1131
+ let t7;
1132
+ $[24] !== boundaryElement || $[25] !== isTopLayer || $[26] !== onClickOutside || $[27] !== portalElement ? (t7 = isTopLayer && onClickOutside && ((event_0) => {
1133
+ const target_0 = event_0.target;
1134
+ target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
1135
+ }), $[24] = boundaryElement, $[25] = isTopLayer, $[26] = onClickOutside, $[27] = portalElement, $[28] = t7) : t7 = $[28];
1136
+ let t8;
1137
+ $[29] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => [ref.current], $[29] = t8) : t8 = $[29], _visualEditing.useClickOutsideEvent(t7, t8);
1138
+ let t9;
1139
+ $[30] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css.dialogCard(), $[30] = t9) : t9 = $[30];
1140
+ let t10;
1141
+ $[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css.dialogLayout(), $[31] = t10) : t10 = $[31];
1142
+ let t11;
1143
+ $[32] !== header || $[33] !== labelId || $[34] !== onClose || $[35] !== showCloseButton || $[36] !== showHeader ? (t11 = showHeader && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: css.dialogHeader(), position: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { align: "flex-start", padding: 3, children: [
1144
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
1145
+ showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Close dialog", disabled: !onClose, icon: icons.CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
1146
+ ] }) }), $[32] = header, $[33] = labelId, $[34] = onClose, $[35] = showCloseButton, $[36] = showHeader, $[37] = t11) : t11 = $[37];
1147
+ let t12;
1148
+ $[38] === Symbol.for("react.memo_cache_sentinel") ? (t12 = css.dialogContent(), $[38] = t12) : t12 = $[38];
1149
+ let t13;
1150
+ $[39] !== children ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: t12, flex: 1, overflow: "auto", position: "relative", ref: contentRef, tabIndex: -1, children }), $[39] = children, $[40] = t13) : t13 = $[40];
1151
+ let t14;
1152
+ $[41] !== footer ? (t14 = footer && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: css.dialogFooter(), position: "relative", children: footer }), $[41] = footer, $[42] = t14) : t14 = $[42];
1153
+ let t15;
1154
+ $[43] !== t11 || $[44] !== t13 || $[45] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { className: t10, direction: "column", flex: 1, children: [
1155
+ t11,
1156
+ t13,
1157
+ t14
1158
+ ] }), $[43] = t11, $[44] = t13, $[45] = t14, $[46] = t15) : t15 = $[46];
1159
+ let t16;
1160
+ return $[47] !== as || $[48] !== rest || $[49] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { ...rest, as, className: t9, display: "flex", ref, children: t15 }), $[47] = as, $[48] = rest, $[49] = t15, $[50] = t16) : t16 = $[50], t16;
1161
+ }
1162
+ const DialogContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/dialog", {
1163
+ version: 0
1164
+ });
1165
+ function useDialog() {
1166
+ return react.useContext(DialogContext);
1167
+ }
1168
+ const DEFAULT_DIALOG_ELEMENT = "div";
1169
+ function Dialog(props) {
1170
+ const $ = reactCompilerRuntime.c(69), context = useDialog(), t0 = props;
1171
+ let _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, tone;
1172
+ $[0] !== t0 ? ({
1173
+ __unstable_autoFocus: t1,
1174
+ __unstable_hideCloseButton: t2,
1175
+ animate: t3,
1176
+ cardRadius: t4,
1177
+ children,
1178
+ className,
1179
+ contentRef,
1180
+ footer,
1181
+ header,
1182
+ id,
1183
+ onActivate,
1184
+ onClickOutside,
1185
+ onClose,
1186
+ onFocus,
1187
+ padding: t5,
1188
+ portal: portalProp,
1189
+ position: _positionProp,
1190
+ scheme,
1191
+ shadow: t6,
1192
+ width: t7,
1193
+ zOffset: _zOffsetProp,
1194
+ tone,
1195
+ ...rest
1196
+ } = 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]);
1197
+ 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 ?? _visualEditing.Z_OFFSETS.dialog, animate = _visualEditing.usePrefersReducedMotion() ? !1 : _animate, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, cardRadius = _visualEditing.useResponsiveProp(cardRadiusProp), position = _visualEditing.useResponsiveProp(positionProp), zOffset = _visualEditing.useResponsiveProp(zOffsetProp), preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null);
1198
+ let t8;
1199
+ $[24] !== onFocus ? (t8 = (event) => {
1200
+ onFocus?.(event);
1201
+ const target = event.target, cardElement = cardRef.current;
1202
+ if (cardElement && target === preDivRef.current) {
1203
+ focusLastDescendant(cardElement);
1204
+ return;
1205
+ }
1206
+ if (cardElement && target === postDivRef.current) {
1207
+ focusFirstDescendant(cardElement);
1208
+ return;
1209
+ }
1210
+ _visualEditing.isHTMLElement(event.target) && (focusedElementRef.current = event.target);
1211
+ }, $[24] = onFocus, $[25] = t8) : t8 = $[25];
1212
+ const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef = react.useRef(void 0);
1213
+ let t9;
1214
+ $[26] !== boundaryElement || $[27] !== portalElement ? (t9 = () => {
1215
+ rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
1216
+ const activeElement = document.activeElement;
1217
+ if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
1218
+ const target_0 = focusedElementRef.current;
1219
+ if (!target_0 || !document.body.contains(target_0)) {
1220
+ const cardElement_0 = cardRef.current;
1221
+ cardElement_0 && focusFirstDescendant(cardElement_0);
1222
+ return;
1223
+ }
1224
+ target_0.focus();
1225
+ }
1226
+ }, 0);
1227
+ }, $[26] = boundaryElement, $[27] = portalElement, $[28] = t9) : t9 = $[28];
1228
+ const handleRootClick = t9;
1229
+ let t10;
1230
+ $[29] !== className ? (t10 = css.dialog({
1231
+ className
1232
+ }), $[29] = className, $[30] = t10) : t10 = $[30];
1233
+ const t11 = animate ? "" : void 0;
1234
+ let t12;
1235
+ $[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
1236
+ let t13;
1237
+ $[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css.dialogContainer(), $[32] = t13) : t13 = $[32];
1238
+ let t14;
1239
+ $[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__ */ jsxRuntime.jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[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];
1240
+ let t15;
1241
+ $[49] !== t14 || $[50] !== width ? (t15 = /* @__PURE__ */ jsxRuntime.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];
1242
+ let t16;
1243
+ $[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 }), $[52] = t16) : t16 = $[52];
1244
+ let t17;
1245
+ $[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__ */ jsxRuntime.jsxs(_visualEditing.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: [
1246
+ t12,
1247
+ t15,
1248
+ t16
1249
+ ] }), $[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];
1250
+ let t18;
1251
+ return $[66] !== portalProp || $[67] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Portal, { __unstable_name: portalProp, children: t17 }), $[66] = portalProp, $[67] = t17, $[68] = t18) : t18 = $[68], t18;
1252
+ }
1253
+ function DialogProvider(props) {
1254
+ const $ = reactCompilerRuntime.c(6), {
1255
+ children,
1256
+ position,
1257
+ zOffset
1258
+ } = props;
1259
+ let t0, t1;
1260
+ $[0] !== position || $[1] !== zOffset ? (t1 = {
1261
+ version: 0,
1262
+ position,
1263
+ zOffset
1264
+ }, $[0] = position, $[1] = zOffset, $[2] = t1) : t1 = $[2], t0 = t1;
1265
+ const contextValue = t0;
1266
+ let t2;
1267
+ return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
1268
+ }
1269
+ function MenuButton(props) {
1270
+ const $ = reactCompilerRuntime.c(63), {
1271
+ __unstable_disableRestoreFocusOnClose: t0,
1272
+ boundaryElement: deprecated_boundaryElement,
1273
+ button: buttonProp,
1274
+ id,
1275
+ menu: menuProp,
1276
+ onClose,
1277
+ onOpen,
1278
+ placement: deprecated_placement,
1279
+ popoverScheme: deprecated_popoverScheme,
1280
+ portal: t1,
1281
+ popover,
1282
+ popoverRadius: deprecated_popoverRadius,
1283
+ preventOverflow: deprecated_preventOverflow,
1284
+ ref: forwardedRef
1285
+ } = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), [buttonElement, setButtonElement] = react.useState(null);
1286
+ let t2;
1287
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
1288
+ const [menuElements, setChildMenuElements] = react.useState(t2), openRef = react.useRef(open);
1289
+ let t3, t4;
1290
+ $[1] !== onOpen || $[2] !== open ? (t3 = () => {
1291
+ onOpen && open && !openRef.current && onOpen();
1292
+ }, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), react.useEffect(t3, t4);
1293
+ let t5, t6;
1294
+ $[5] !== onClose || $[6] !== open ? (t5 = () => {
1295
+ onClose && !open && openRef.current && onClose();
1296
+ }, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), react.useEffect(t5, t6);
1297
+ let t7, t8;
1298
+ $[9] !== open ? (t7 = () => {
1299
+ openRef.current = open;
1300
+ }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), react.useEffect(t7, t8);
1301
+ let t9;
1302
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
1303
+ setOpen(_temp$2), setShouldFocus(null);
1304
+ }, $[12] = t9) : t9 = $[12];
1305
+ const handleButtonClick = t9;
1306
+ let t10;
1307
+ $[13] !== open ? (t10 = (event) => {
1308
+ open && event.preventDefault();
1309
+ }, $[13] = open, $[14] = t10) : t10 = $[14];
1310
+ const handleMouseDown = t10;
1311
+ let t11;
1312
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (event_0) => {
1313
+ if (event_0.key === "ArrowDown" || event_0.key === "Enter" || event_0.key === " ") {
1314
+ event_0.preventDefault(), setOpen(!0), setShouldFocus("first");
1315
+ return;
1316
+ }
1317
+ if (event_0.key === "ArrowUp") {
1318
+ event_0.preventDefault(), setOpen(!0), setShouldFocus("last");
1319
+ return;
1320
+ }
1321
+ }, $[15] = t11) : t11 = $[15];
1322
+ const handleButtonKeyDown = t11;
1323
+ let t12;
1324
+ $[16] !== buttonElement || $[17] !== menuElements ? (t12 = (event_1) => {
1325
+ const target = event_1.target;
1326
+ if (target instanceof Node && !(buttonElement && (target === buttonElement || buttonElement.contains(target)))) {
1327
+ for (const el of menuElements)
1328
+ if (target === el || el.contains(target))
1329
+ return;
1330
+ setOpen(!1);
1331
+ }
1332
+ }, $[16] = buttonElement, $[17] = menuElements, $[18] = t12) : t12 = $[18];
1333
+ const handleMenuClickOutside = t12;
1334
+ let t13;
1335
+ $[19] !== buttonElement || $[20] !== disableRestoreFocusOnClose ? (t13 = () => {
1336
+ setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
1337
+ }, $[19] = buttonElement, $[20] = disableRestoreFocusOnClose, $[21] = t13) : t13 = $[21];
1338
+ const handleMenuEscape = t13;
1339
+ let t14;
1340
+ $[22] !== menuElements ? (t14 = (event_2) => {
1341
+ const target_0 = event_2.relatedTarget;
1342
+ if (target_0 instanceof Node) {
1343
+ for (const el_0 of menuElements)
1344
+ if (el_0 === target_0 || el_0.contains(target_0))
1345
+ return;
1346
+ setOpen(!1);
1347
+ }
1348
+ }, $[22] = menuElements, $[23] = t14) : t14 = $[23];
1349
+ const handleBlur = t14;
1350
+ let t15;
1351
+ $[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t15 = () => {
1352
+ setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
1353
+ }, $[24] = buttonElement, $[25] = disableRestoreFocusOnClose, $[26] = t15) : t15 = $[26];
1354
+ const handleItemClick = t15;
1355
+ let t16;
1356
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t16 = (el_1) => (setChildMenuElements((els) => els.concat([el_1])), () => setChildMenuElements((els_0) => els_0.filter((_el) => _el !== el_1))), $[27] = t16) : t16 = $[27];
1357
+ const registerElement = t16;
1358
+ let t17;
1359
+ $[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && react.cloneElement(menuProp, {
1360
+ "aria-labelledby": id,
1361
+ onBlurCapture: handleBlur,
1362
+ onClickOutside: handleMenuClickOutside,
1363
+ onEscape: handleMenuEscape,
1364
+ onItemClick: handleItemClick,
1365
+ originElement: buttonElement,
1366
+ registerElement,
1367
+ shouldFocus
1368
+ }), $[28] = buttonElement, $[29] = handleBlur, $[30] = handleItemClick, $[31] = handleMenuClickOutside, $[32] = handleMenuEscape, $[33] = id, $[34] = menuProp, $[35] = shouldFocus, $[36] = t17) : t17 = $[36];
1369
+ const menu = t17;
1370
+ let t18;
1371
+ bb0: {
1372
+ if (!buttonProp) {
1373
+ t18 = null;
1374
+ break bb0;
1375
+ }
1376
+ const t192 = buttonProp.props.selected ?? open;
1377
+ let t202;
1378
+ $[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open || $[41] !== t192 ? (t202 = react.cloneElement(buttonProp, {
1379
+ "data-ui": "MenuButton",
1380
+ id,
1381
+ onClick: handleButtonClick,
1382
+ onKeyDown: handleButtonKeyDown,
1383
+ onMouseDown: handleMouseDown,
1384
+ "aria-haspopup": !0,
1385
+ "aria-expanded": open,
1386
+ ref: setButtonElement,
1387
+ selected: t192
1388
+ }), $[37] = buttonProp, $[38] = handleMouseDown, $[39] = id, $[40] = open, $[41] = t192, $[42] = t202) : t202 = $[42], t18 = t202;
1389
+ }
1390
+ const button = t18;
1391
+ let t19, t20;
1392
+ $[43] !== buttonElement ? (t19 = () => buttonElement, t20 = [buttonElement], $[43] = buttonElement, $[44] = t19, $[45] = t20) : (t19 = $[44], t20 = $[45]), react.useImperativeHandle(forwardedRef, t19, t20);
1393
+ let t21, t22;
1394
+ $[46] !== popover ? (t22 = popover || {}, $[46] = popover, $[47] = t22) : t22 = $[47];
1395
+ let t23;
1396
+ $[48] !== deprecated_boundaryElement || $[49] !== deprecated_placement || $[50] !== deprecated_popoverRadius || $[51] !== deprecated_popoverScheme || $[52] !== deprecated_portal || $[53] !== deprecated_preventOverflow || $[54] !== t22 ? (t23 = {
1397
+ boundaryElement: deprecated_boundaryElement,
1398
+ overflow: "auto",
1399
+ placement: deprecated_placement,
1400
+ portal: deprecated_portal,
1401
+ preventOverflow: deprecated_preventOverflow,
1402
+ radius: deprecated_popoverRadius,
1403
+ scheme: deprecated_popoverScheme,
1404
+ ...t22
1405
+ }, $[48] = deprecated_boundaryElement, $[49] = deprecated_placement, $[50] = deprecated_popoverRadius, $[51] = deprecated_popoverScheme, $[52] = deprecated_portal, $[53] = deprecated_preventOverflow, $[54] = t22, $[55] = t23) : t23 = $[55], t21 = t23;
1406
+ const popoverProps = t21;
1407
+ let t24;
1408
+ $[56] !== button ? (t24 = button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[56] = button, $[57] = t24) : t24 = $[57];
1409
+ let t25;
1410
+ return $[58] !== menu || $[59] !== open || $[60] !== popoverProps || $[61] !== t24 ? (t25 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t24 }), $[58] = menu, $[59] = open, $[60] = popoverProps, $[61] = t24, $[62] = t25) : t25 = $[62], t25;
1411
+ }
1412
+ function _temp$2(v) {
1413
+ return !v;
1414
+ }
1415
+ const DEFAULT_SKELETON_ELEMENT = "div";
1416
+ function Skeleton(props) {
1417
+ const $ = reactCompilerRuntime.c(17), t0 = props;
1418
+ let className, delay, radius, rest, t1;
1419
+ $[0] !== t0 ? ({
1420
+ animated: t1,
1421
+ className,
1422
+ delay,
1423
+ radius,
1424
+ ...rest
1425
+ } = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] = radius, $[4] = rest, $[5] = t1) : (className = $[1], delay = $[2], radius = $[3], rest = $[4], t1 = $[5]);
1426
+ const animated = t1 === void 0 ? !1 : t1, [visible, setVisible] = react.useState(!delay);
1427
+ let t2, t3;
1428
+ $[6] !== delay ? (t2 = () => {
1429
+ if (!delay)
1430
+ return setVisible(!0);
1431
+ const timeout = setTimeout(() => {
1432
+ setVisible(!0);
1433
+ }, delay);
1434
+ return () => {
1435
+ clearTimeout(timeout);
1436
+ };
1437
+ }, t3 = [delay], $[6] = delay, $[7] = t2, $[8] = t3) : (t2 = $[7], t3 = $[8]), react.useEffect(t2, t3);
1438
+ let t4;
1439
+ $[9] !== className || $[10] !== radius ? (t4 = css.skeleton({
1440
+ className,
1441
+ radius
1442
+ }), $[9] = className, $[10] = radius, $[11] = t4) : t4 = $[11];
1443
+ const t5 = animated ? "" : void 0, t6 = visible ? "" : void 0;
1444
+ let t7;
1445
+ return $[12] !== rest || $[13] !== t4 || $[14] !== t5 || $[15] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "Skeleton", ...rest, className: t4, "data-animated": t5, "data-visible": t6 }), $[12] = rest, $[13] = t4, $[14] = t5, $[15] = t6, $[16] = t7) : t7 = $[16], t7;
1446
+ }
1447
+ const DEFAULT_CODE_SKELETON_ELEMENT = "div";
1448
+ function CodeSkeleton(props) {
1449
+ const $ = reactCompilerRuntime.c(10), t0 = props;
1450
+ let className, rest, t1;
1451
+ $[0] !== t0 ? ({
1452
+ className,
1453
+ size: t1,
1454
+ ...rest
1455
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
1456
+ const size = t1 === void 0 ? 2 : t1;
1457
+ let t2;
1458
+ $[4] !== className || $[5] !== size ? (t2 = css.codeSkeleton({
1459
+ className,
1460
+ size
1461
+ }), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
1462
+ let t3;
1463
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
1464
+ }
1465
+ const DEFAULT_HEADING_SKELETON_ELEMENT = "div";
1466
+ function HeadingSkeleton(props) {
1467
+ const $ = reactCompilerRuntime.c(10), t0 = props;
1468
+ let className, rest, t1;
1469
+ $[0] !== t0 ? ({
1470
+ className,
1471
+ size: t1,
1472
+ ...rest
1473
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
1474
+ const size = t1 === void 0 ? 2 : t1;
1475
+ let t2;
1476
+ $[4] !== className || $[5] !== size ? (t2 = css.headingSkeleton({
1477
+ className,
1478
+ size
1479
+ }), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
1480
+ let t3;
1481
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
1482
+ }
1483
+ const DEFAULT_LABEL_SKELETON_ELEMENT = "div";
1484
+ function LabelSkeleton(props) {
1485
+ const $ = reactCompilerRuntime.c(10), t0 = props;
1486
+ let className, rest, t1;
1487
+ $[0] !== t0 ? ({
1488
+ className,
1489
+ size: t1,
1490
+ ...rest
1491
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
1492
+ const size = t1 === void 0 ? 2 : t1;
1493
+ let t2;
1494
+ $[4] !== className || $[5] !== size ? (t2 = css.labelSkeleton({
1495
+ className,
1496
+ size
1497
+ }), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
1498
+ let t3;
1499
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
1500
+ }
1501
+ const DEFAULT_TEXT_SKELETON_ELEMENT = "div";
1502
+ function TextSkeleton(props) {
1503
+ const $ = reactCompilerRuntime.c(10), t0 = props;
1504
+ let className, rest, t1;
1505
+ $[0] !== t0 ? ({
1506
+ className,
1507
+ size: t1,
1508
+ ...rest
1509
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
1510
+ const size = t1 === void 0 ? 2 : t1;
1511
+ let t2;
1512
+ $[4] !== className || $[5] !== size ? (t2 = css.textSkeleton({
1513
+ className,
1514
+ size
1515
+ }), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
1516
+ let t3;
1517
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
1518
+ }
1519
+ const DEFAULT_TAB_PANEL_ELEMENT = "div";
1520
+ function TabPanel(props) {
1521
+ const $ = reactCompilerRuntime.c(10), t0 = props;
1522
+ let children, rest, t1, tabIndex;
1523
+ $[0] !== t0 ? ({
1524
+ as: t1,
1525
+ children,
1526
+ tabIndex,
1527
+ ...rest
1528
+ } = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1, $[4] = tabIndex) : (children = $[1], rest = $[2], t1 = $[3], tabIndex = $[4]);
1529
+ const as = t1 === void 0 ? DEFAULT_TAB_PANEL_ELEMENT : t1, t2 = tabIndex === void 0 ? 0 : tabIndex;
1530
+ let t3;
1531
+ return $[5] !== as || $[6] !== children || $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "TabPanel", ...rest, as, role: "tabpanel", tabIndex: t2, children }), $[5] = as, $[6] = children, $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
1532
+ }
1533
+ const DEFAULT_TOAST_ELEMENT = "li", ROLES = {
1534
+ error: "alert",
1535
+ warning: "alert",
1536
+ success: "alert",
1537
+ info: "alert"
1538
+ }, STATUS_CARD_TONE = {
1539
+ error: "critical",
1540
+ warning: "caution",
1541
+ success: "positive",
1542
+ info: "neutral"
1543
+ }, BUTTON_TONE = {
1544
+ error: "critical",
1545
+ warning: "caution",
1546
+ success: "positive",
1547
+ info: "neutral"
1548
+ };
1549
+ function Toast(props) {
1550
+ const $ = reactCompilerRuntime.c(40), t0 = props;
1551
+ let closable, description, onClose, rest, status, t1, t2, title;
1552
+ if ($[0] !== t0) {
1553
+ const {
1554
+ as: t32,
1555
+ closable: t42,
1556
+ description: t52,
1557
+ duration,
1558
+ onClose: t62,
1559
+ radius: t72,
1560
+ title: t82,
1561
+ status: t92,
1562
+ updatedAt,
1563
+ ...t102
1564
+ } = t0;
1565
+ t1 = t32, closable = t42, description = t52, onClose = t62, t2 = t72, title = t82, status = t92, rest = t102, $[0] = t0, $[1] = closable, $[2] = description, $[3] = onClose, $[4] = rest, $[5] = status, $[6] = t1, $[7] = t2, $[8] = title;
1566
+ } else
1567
+ closable = $[1], description = $[2], onClose = $[3], rest = $[4], status = $[5], t1 = $[6], t2 = $[7], title = $[8];
1568
+ const as = t1 === void 0 ? DEFAULT_TOAST_ELEMENT : t1, radius = t2 === void 0 ? 3 : t2, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = _visualEditing.usePrefersReducedMotion() ? 0 : 0.26;
1569
+ let t3;
1570
+ $[9] !== visualDuration ? (t3 = visualDuration ? {
1571
+ type: "spring",
1572
+ visualDuration,
1573
+ bounce: 0.25
1574
+ } : {
1575
+ duration: 0
1576
+ }, $[9] = visualDuration, $[10] = t3) : t3 = $[10];
1577
+ const transition = t3;
1578
+ let t4;
1579
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "initial"], $[11] = t4) : t4 = $[11];
1580
+ const initial = t4;
1581
+ let t5;
1582
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t5 = ["visible", "slideIn"], $[12] = t5) : t5 = $[12];
1583
+ const animate = t5;
1584
+ let t6;
1585
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t6 = ["hidden", "slideOut"], $[13] = t6) : t6 = $[13];
1586
+ const exit = t6;
1587
+ let t7;
1588
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = css.toast(), $[14] = t7) : t7 = $[14];
1589
+ let t8;
1590
+ $[15] !== title ? (t8 = title && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: 1, weight: "medium", children: title }), $[15] = title, $[16] = t8) : t8 = $[16];
1591
+ let t9;
1592
+ $[17] !== description || $[18] !== transition ? (t9 = description && /* @__PURE__ */ jsxRuntime.jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[17] = description, $[18] = transition, $[19] = t9) : t9 = $[19];
1593
+ let t10;
1594
+ $[20] !== t8 || $[21] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Stack, { gap: 3, children: [
1595
+ t8,
1596
+ t9
1597
+ ] }) }), $[20] = t8, $[21] = t9, $[22] = t10) : t10 = $[22];
1598
+ let t11;
1599
+ $[23] !== buttonTone || $[24] !== closable || $[25] !== onClose ? (t11 = closable && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { padding: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { as: "button", icon: icons.CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
1600
+ verticalAlign: "top"
1601
+ } }) }), $[23] = buttonTone, $[24] = closable, $[25] = onClose, $[26] = t11) : t11 = $[26];
1602
+ let t12;
1603
+ $[27] !== t10 || $[28] !== t11 || $[29] !== transition ? (t12 = /* @__PURE__ */ jsxRuntime.jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
1604
+ t10,
1605
+ t11
1606
+ ] }), $[27] = t10, $[28] = t11, $[29] = transition, $[30] = t12) : t12 = $[30];
1607
+ let t13;
1608
+ return $[31] !== as || $[32] !== cardTone || $[33] !== radius || $[34] !== rest || $[35] !== role || $[36] !== t12 || $[37] !== transition || $[38] !== visualDuration ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(MotionCard, { as, className: t7, "data-ui": "Toast", role, ...rest, custom: visualDuration, radius, shadow: 2, tone: cardTone, layout: "position", variants: container, initial, animate, exit, transition, position: "relative", children: t12 }), $[31] = as, $[32] = cardTone, $[33] = radius, $[34] = rest, $[35] = role, $[36] = t12, $[37] = transition, $[38] = visualDuration, $[39] = t13) : t13 = $[39], t13;
1609
+ }
1610
+ const container = {
1611
+ initial: {
1612
+ y: 32,
1613
+ scale: 0.5,
1614
+ zIndex: 1
1615
+ },
1616
+ hidden: {
1617
+ opacity: 0
1618
+ },
1619
+ visible: (visualDuration) => visualDuration ? {
1620
+ opacity: 1,
1621
+ transition: {
1622
+ when: "beforeChildren",
1623
+ staggerChildren: visualDuration / 3,
1624
+ duration: visualDuration / 3
1625
+ }
1626
+ } : {
1627
+ opacity: 1
1628
+ },
1629
+ slideIn: {
1630
+ y: 0,
1631
+ scale: 1
1632
+ },
1633
+ slideOut: {
1634
+ zIndex: 0,
1635
+ scale: 0.75
1636
+ }
1637
+ }, content = {
1638
+ initial: {
1639
+ willChange: "transform"
1640
+ },
1641
+ hidden: {
1642
+ opacity: 0
1643
+ },
1644
+ visible: {
1645
+ opacity: 1
1646
+ }
1647
+ }, MotionCard = framerMotion.motion.create(_visualEditing.Card), MotionFlex = framerMotion.motion.create(_visualEditing.Flex), MotionText = framerMotion.motion.create(_visualEditing.Text);
1648
+ function useMounted() {
1649
+ return react.useSyncExternalStore(subscribe, _temp$1, _temp2);
1650
+ }
1651
+ function _temp2() {
1652
+ return !1;
1653
+ }
1654
+ function _temp$1() {
1655
+ return !0;
1656
+ }
1657
+ const subscribe = () => () => {
1658
+ }, ToastContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/toast", null), DEFAULT_TOAST_LAYER_ELEMENT = "ul";
1659
+ function ToastLayer(props) {
1660
+ const $ = reactCompilerRuntime.c(11), {
1661
+ as: t0,
1662
+ children,
1663
+ padding: t1,
1664
+ paddingX,
1665
+ paddingY,
1666
+ gap: t2
1667
+ } = props, as = t0 === void 0 ? DEFAULT_TOAST_LAYER_ELEMENT : t0, padding = t1 === void 0 ? 4 : t1, gap = t2 === void 0 ? 3 : t2, {
1668
+ zIndex
1669
+ } = _visualEditing.useLayer();
1670
+ let t3;
1671
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = css.toastLayer(), $[0] = t3) : t3 = $[0];
1672
+ let t4;
1673
+ $[1] !== zIndex ? (t4 = {
1674
+ zIndex
1675
+ }, $[1] = zIndex, $[2] = t4) : t4 = $[2];
1676
+ let t5;
1677
+ return $[3] !== as || $[4] !== children || $[5] !== gap || $[6] !== padding || $[7] !== paddingX || $[8] !== paddingY || $[9] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Grid, { as, className: t3, "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t4, children }), $[3] = as, $[4] = children, $[5] = gap, $[6] = padding, $[7] = paddingX, $[8] = paddingY, $[9] = t4, $[10] = t5) : t5 = $[10], t5;
1678
+ }
1679
+ let toastId = 0;
1680
+ function generateToastId() {
1681
+ return String(toastId++);
1682
+ }
1683
+ function ToastProvider(props) {
1684
+ const $ = reactCompilerRuntime.c(13), {
1685
+ children,
1686
+ padding,
1687
+ paddingX,
1688
+ paddingY,
1689
+ gap,
1690
+ zOffset: t0
1691
+ } = props, zOffset = t0 === void 0 ? 1 : t0;
1692
+ let t1;
1693
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
1694
+ const [state, setState] = react.useState(t1), mounted = useMounted();
1695
+ let t2, t3;
1696
+ $[1] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
1697
+ version: 0,
1698
+ push: (params) => {
1699
+ const id = params.id || generateToastId(), duration = params.duration || 5e3;
1700
+ return react.startTransition(() => {
1701
+ setState((prevState) => {
1702
+ if (duration === 0.01)
1703
+ return prevState.filter((toast) => toast.id !== id);
1704
+ const dismiss = () => react.startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
1705
+ return [...prevState.filter((toast_1) => toast_1.id !== id), {
1706
+ dismiss,
1707
+ id,
1708
+ updatedAt: Date.now(),
1709
+ params: {
1710
+ ...params,
1711
+ duration
1712
+ }
1713
+ }];
1714
+ });
1715
+ }), id;
1716
+ }
1717
+ }, $[1] = t3) : t3 = $[1], t2 = t3;
1718
+ const value = t2;
1719
+ let t4;
1720
+ $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
1721
+ let t5;
1722
+ return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
1723
+ children,
1724
+ t4
1725
+ ] }), $[10] = children, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
1726
+ }
1727
+ function _temp(t0) {
1728
+ const {
1729
+ dismiss: dismiss_0,
1730
+ id: id_0,
1731
+ params: params_0,
1732
+ updatedAt
1733
+ } = t0;
1734
+ return /* @__PURE__ */ jsxRuntime.jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration, updatedAt }, id_0);
1735
+ }
1736
+ function useToast() {
1737
+ const value = react.useContext(ToastContext);
1738
+ if (!value)
1739
+ throw new Error("useToast(): missing context value");
1740
+ if (!_visualEditing.isRecord(value) || value.version !== 0)
1741
+ throw new Error("useToast(): the context value is not compatible");
1742
+ return value;
1743
+ }
1744
+ function _findPrevItemElement(state, itemElements, focusedElement) {
1745
+ const idx = itemElements.indexOf(focusedElement), els = itemElements.slice(0, idx), len = els.length;
1746
+ for (let i = len - 1; i >= 0; i -= 1) {
1747
+ const itemKey = els[i].getAttribute("data-tree-key");
1748
+ if (!itemKey)
1749
+ continue;
1750
+ const segments = itemKey.split("/");
1751
+ segments.pop();
1752
+ const p = [];
1753
+ let expanded = !0;
1754
+ for (let j = 0; j < segments.length; j += 1) {
1755
+ p.push(segments[j]);
1756
+ const k = p.join("/");
1757
+ if (!state[k]?.expanded) {
1758
+ expanded = !1;
1759
+ break;
1760
+ }
1761
+ }
1762
+ if (expanded)
1763
+ return els[i];
1764
+ }
1765
+ return null;
1766
+ }
1767
+ function _findNextItemElement(state, itemElements, focusedElement) {
1768
+ const idx = itemElements.indexOf(focusedElement), els = itemElements.slice(idx), len = itemElements.length;
1769
+ for (let i = 1; i < len; i += 1) {
1770
+ if (!els[i])
1771
+ continue;
1772
+ const itemKey = els[i].getAttribute("data-tree-key");
1773
+ if (!itemKey)
1774
+ continue;
1775
+ const segments = itemKey.split("/");
1776
+ segments.pop();
1777
+ const p = [];
1778
+ let expanded = !0;
1779
+ for (let j = 0; j < segments.length; j += 1) {
1780
+ p.push(segments[j]);
1781
+ const k = p.join("/");
1782
+ if (!state[k]?.expanded) {
1783
+ expanded = !1;
1784
+ break;
1785
+ }
1786
+ }
1787
+ if (expanded)
1788
+ return els[i];
1789
+ }
1790
+ return null;
1791
+ }
1792
+ function _focusItemElement(el) {
1793
+ if (el.getAttribute("role") === "treeitem" && el.focus(), el.getAttribute("role") === "none") {
1794
+ const firstChild = el.firstChild;
1795
+ firstChild && firstChild instanceof HTMLElement && firstChild.focus();
1796
+ }
1797
+ }
1798
+ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/tree", null), DEFAULT_TREE_ELEMENT = "div";
1799
+ function Tree(props) {
1800
+ const $ = reactCompilerRuntime.c(39), t0 = props;
1801
+ let children, forwardedRef, gap, onFocus, rest, t1;
1802
+ $[0] !== t0 ? ({
1803
+ children,
1804
+ gap,
1805
+ space: t1,
1806
+ onFocus,
1807
+ ref: forwardedRef,
1808
+ ...rest
1809
+ } = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = gap, $[4] = onFocus, $[5] = rest, $[6] = t1) : (children = $[1], forwardedRef = $[2], gap = $[3], onFocus = $[4], rest = $[5], t1 = $[6]);
1810
+ const space = t1 === void 0 ? 1 : t1, ref = react.useRef(null), [focusedElement, setFocusedElement] = react.useState(null), focusedElementRef = react.useRef(focusedElement);
1811
+ let t2, t3;
1812
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7], t2 = t3;
1813
+ const path = t2;
1814
+ let t4;
1815
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [], $[8] = t4) : t4 = $[8];
1816
+ const [itemElements, setItemElements] = react.useState(t4);
1817
+ let t5;
1818
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = {}, $[9] = t5) : t5 = $[9];
1819
+ const [state, setState] = react.useState(t5), stateRef = react.useRef(state);
1820
+ let t6;
1821
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10], react.useImperativeHandle(forwardedRef, t6);
1822
+ let t7, t8;
1823
+ $[11] !== focusedElement ? (t7 = () => {
1824
+ focusedElementRef.current = focusedElement;
1825
+ }, t8 = [focusedElement], $[11] = focusedElement, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]), react.useEffect(t7, t8);
1826
+ let t10, t9;
1827
+ $[14] !== state ? (t9 = () => {
1828
+ stateRef.current = state;
1829
+ }, t10 = [state], $[14] = state, $[15] = t10, $[16] = t9) : (t10 = $[15], t9 = $[16]), react.useEffect(t9, t10);
1830
+ let t11;
1831
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (element, path_0, expanded, selected) => (setState((s) => ({
1832
+ ...s,
1833
+ [path_0]: {
1834
+ element,
1835
+ expanded
1836
+ }
1837
+ })), selected && setFocusedElement(element), () => {
1838
+ setState((s_0) => {
1839
+ const newState = {
1840
+ ...s_0
1841
+ };
1842
+ return delete newState[path_0], newState;
1843
+ });
1844
+ }), $[17] = t11) : t11 = $[17];
1845
+ const registerItem = t11;
1846
+ let t12;
1847
+ $[18] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (path_1, expanded_0) => {
1848
+ setState((s_1) => {
1849
+ const itemState = s_1[path_1];
1850
+ return itemState ? {
1851
+ ...s_1,
1852
+ [path_1]: {
1853
+ ...itemState,
1854
+ expanded: expanded_0
1855
+ }
1856
+ } : s_1;
1857
+ });
1858
+ }, $[18] = t12) : t12 = $[18];
1859
+ const setExpanded = t12;
1860
+ let t13;
1861
+ const t14 = focusedElement || itemElements[0] || null;
1862
+ let t15;
1863
+ $[19] !== space || $[20] !== state || $[21] !== t14 ? (t15 = {
1864
+ version: 0,
1865
+ focusedElement: t14,
1866
+ level: 0,
1867
+ path,
1868
+ registerItem,
1869
+ setExpanded,
1870
+ setFocusedElement,
1871
+ space,
1872
+ state
1873
+ }, $[19] = space, $[20] = state, $[21] = t14, $[22] = t15) : t15 = $[22], t13 = t15;
1874
+ const contextValue = t13;
1875
+ let t16;
1876
+ $[23] !== itemElements ? (t16 = (event) => {
1877
+ if (focusedElementRef.current) {
1878
+ if (event.key === "ArrowDown") {
1879
+ event.preventDefault();
1880
+ const nextEl = _findNextItemElement(stateRef.current, itemElements, focusedElementRef.current);
1881
+ nextEl && (_focusItemElement(nextEl), setFocusedElement(nextEl));
1882
+ return;
1883
+ }
1884
+ if (event.key === "ArrowUp") {
1885
+ event.preventDefault();
1886
+ const prevEl = _findPrevItemElement(stateRef.current, itemElements, focusedElementRef.current);
1887
+ prevEl && (_focusItemElement(prevEl), setFocusedElement(prevEl));
1888
+ return;
1889
+ }
1890
+ if (event.key === "ArrowLeft") {
1891
+ event.preventDefault();
1892
+ const itemKey = focusedElementRef.current.getAttribute("data-tree-key");
1893
+ if (!itemKey)
1894
+ return;
1895
+ const itemState_0 = stateRef.current[itemKey];
1896
+ if (!itemState_0)
1897
+ return;
1898
+ if (itemState_0.expanded)
1899
+ setState((s_2) => {
1900
+ const itemState_1 = s_2[itemKey];
1901
+ return itemState_1 ? {
1902
+ ...s_2,
1903
+ [itemKey]: {
1904
+ ...itemState_1,
1905
+ expanded: !1
1906
+ }
1907
+ } : s_2;
1908
+ });
1909
+ else {
1910
+ const itemPath = itemKey.split("/");
1911
+ itemPath.pop();
1912
+ const parentKey = itemPath.join("/"), parentState = parentKey && stateRef.current[parentKey];
1913
+ parentState && (parentState.element.focus(), setFocusedElement(parentState.element));
1914
+ }
1915
+ return;
1916
+ }
1917
+ if (event.key === "ArrowRight") {
1918
+ event.preventDefault();
1919
+ const focusedKey = focusedElementRef.current.getAttribute("data-tree-key");
1920
+ if (!focusedKey)
1921
+ return;
1922
+ stateRef.current[focusedKey]?.expanded || setState((s_3) => {
1923
+ const itemState_2 = s_3[focusedKey];
1924
+ return itemState_2 ? {
1925
+ ...s_3,
1926
+ [focusedKey]: {
1927
+ ...itemState_2,
1928
+ expanded: !0
1929
+ }
1930
+ } : s_3;
1931
+ });
1932
+ return;
1933
+ }
1934
+ }
1935
+ }, $[23] = itemElements, $[24] = t16) : t16 = $[24];
1936
+ const handleKeyDown = t16;
1937
+ let t17;
1938
+ $[25] !== onFocus ? (t17 = (event_0) => {
1939
+ setFocusedElement(event_0.target), onFocus?.(event_0);
1940
+ }, $[25] = onFocus, $[26] = t17) : t17 = $[26];
1941
+ const handleFocus = t17;
1942
+ let t18;
1943
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t18 = () => {
1944
+ if (!ref.current)
1945
+ return;
1946
+ const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
1947
+ setItemElements(_itemElements);
1948
+ }, $[27] = t18) : t18 = $[27];
1949
+ let t19;
1950
+ $[28] !== children ? (t19 = [children], $[28] = children, $[29] = t19) : t19 = $[29], react.useEffect(t18, t19);
1951
+ const t20 = gap ?? space;
1952
+ let t21;
1953
+ $[30] !== children || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest || $[34] !== t20 ? (t21 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "Tree", ...rest, gap: t20, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[30] = children, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = rest, $[34] = t20, $[35] = t21) : t21 = $[35];
1954
+ let t22;
1955
+ return $[36] !== contextValue || $[37] !== t21 ? (t22 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t21 }), $[36] = contextValue, $[37] = t21, $[38] = t22) : t22 = $[38], t22;
1956
+ }
1957
+ function useTree() {
1958
+ const tree = react.useContext(TreeContext);
1959
+ if (!tree)
1960
+ throw new Error("Tree: missing context value");
1961
+ return tree;
1962
+ }
1963
+ const TreeGroup = react.memo(function(props) {
1964
+ const $ = reactCompilerRuntime.c(9), t0 = props;
1965
+ let children, rest, t1;
1966
+ $[0] !== t0 ? ({
1967
+ children,
1968
+ expanded: t1,
1969
+ ...rest
1970
+ } = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1) : (children = $[1], rest = $[2], t1 = $[3]);
1971
+ const expanded = t1 === void 0 ? !1 : t1, tree = useTree(), t2 = !expanded;
1972
+ let t3;
1973
+ return $[4] !== children || $[5] !== rest || $[6] !== t2 || $[7] !== tree.space ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "TreeGroup", ...rest, hidden: t2, marginTop: tree.space, role: "group", gap: tree.space, children }), $[4] = children, $[5] = rest, $[6] = t2, $[7] = tree.space, $[8] = t3) : t3 = $[8], t3;
1974
+ }), DEFAULT_TREE_ITEM_ELEMENT = "a";
1975
+ function TreeItem(props) {
1976
+ const {
1977
+ children,
1978
+ className,
1979
+ expanded: expandedProp = !1,
1980
+ fontSize = 1,
1981
+ href,
1982
+ icon: IconComponent,
1983
+ id: idProp,
1984
+ linkAs = "a",
1985
+ muted,
1986
+ onClick,
1987
+ padding = 2,
1988
+ radius = 2,
1989
+ selected = !1,
1990
+ space = 2,
1991
+ text,
1992
+ weight,
1993
+ ...rest
1994
+ } = props, rootRef = react.useRef(null), treeitemRef = react.useRef(null), tree = useTree(), {
1995
+ path,
1996
+ registerItem,
1997
+ setExpanded,
1998
+ setFocusedElement
1999
+ } = tree, _id = react.useId(), id = idProp || _id, itemPath = react.useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = react.useMemo(() => ({
2000
+ ...tree,
2001
+ level: tree.level + 1,
2002
+ path: itemPath
2003
+ }), [itemPath, tree]), handleClick = react.useCallback((event) => {
2004
+ onClick && onClick(event);
2005
+ const target = event.target;
2006
+ target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
2007
+ }, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = react.useCallback((event_0) => {
2008
+ focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
2009
+ }, [focused]);
2010
+ react.useEffect(() => {
2011
+ if (rootRef.current)
2012
+ return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
2013
+ }, [expanded, itemPath, registerItem, selected]);
2014
+ const content2 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { gap: space, padding, children: [
2015
+ /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { style: {
2016
+ visibility: IconComponent || children ? "visible" : "hidden",
2017
+ pointerEvents: "none"
2018
+ }, children: [
2019
+ IconComponent && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {}) }),
2020
+ !IconComponent && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ToggleArrowRightIcon, { style: {
2021
+ transform: expanded ? "rotate(90deg)" : void 0
2022
+ } }) })
2023
+ ] }),
2024
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
2025
+ ] });
2026
+ return href ? /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...rest, as: "li", className: css.treeItem({
2027
+ className
2028
+ }), onClick: handleClick, ref: rootRef, role: "none", children: [
2029
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Selectable, { "aria-expanded": expanded, as: linkAs, "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", href, radius, ref: treeitemRef, role: "treeitem", tabIndex, style: {
2030
+ paddingLeft: `calc(${css.vars.space[2]} * ${tree.level})`
2031
+ }, children: content2 }),
2032
+ /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { hidden: !expanded, children }) })
2033
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...rest, "aria-expanded": expanded, className: css.treeItem({
2034
+ className
2035
+ }), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
2036
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
2037
+ paddingLeft: `calc(${css.vars.space[2]} * ${tree.level})`
2038
+ }, children: content2 }),
2039
+ /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }) })
2040
+ ] });
2041
+ }
2042
+ exports.Arrow = _visualEditing.Arrow;
2043
+ exports.Box = _visualEditing.Box;
2044
+ exports.Button = _visualEditing.Button;
2045
+ exports.Card = _visualEditing.Card;
2046
+ exports.CardProvider = _visualEditing.CardProvider;
2047
+ exports.Code = _visualEditing.Code;
2048
+ exports.DEFAULT_ARROW_ELEMENT = _visualEditing.DEFAULT_ARROW_ELEMENT;
2049
+ exports.DEFAULT_BOX_ELEMENT = _visualEditing.DEFAULT_BOX_ELEMENT;
2050
+ exports.DEFAULT_BUTTON_ELEMENT = _visualEditing.DEFAULT_BUTTON_ELEMENT;
2051
+ exports.DEFAULT_CARD_ELEMENT = _visualEditing.DEFAULT_CARD_ELEMENT;
2052
+ exports.DEFAULT_CODE_ELEMENT = _visualEditing.DEFAULT_CODE_ELEMENT;
2053
+ exports.DEFAULT_ELEMENT_QUERY_ELEMENT = _visualEditing.DEFAULT_ELEMENT_QUERY_ELEMENT;
2054
+ exports.DEFAULT_FLEX_ELEMENT = _visualEditing.DEFAULT_FLEX_ELEMENT;
2055
+ exports.DEFAULT_GRID_ELEMENT = _visualEditing.DEFAULT_GRID_ELEMENT;
2056
+ exports.DEFAULT_HOTKEYS_ELEMENT = _visualEditing.DEFAULT_HOTKEYS_ELEMENT;
2057
+ exports.DEFAULT_KBD_ELEMENT = _visualEditing.DEFAULT_KBD_ELEMENT;
2058
+ exports.DEFAULT_LAYER_ELEMENT = _visualEditing.DEFAULT_LAYER_ELEMENT;
2059
+ exports.DEFAULT_MENU_DIVIDER_ELEMENT = _visualEditing.DEFAULT_MENU_DIVIDER_ELEMENT;
2060
+ exports.DEFAULT_MENU_ELEMENT = _visualEditing.DEFAULT_MENU_ELEMENT;
2061
+ exports.DEFAULT_MENU_GROUP_ELEMENT = _visualEditing.DEFAULT_MENU_GROUP_ELEMENT;
2062
+ exports.DEFAULT_MENU_ITEM_ELEMENT = _visualEditing.DEFAULT_MENU_ITEM_ELEMENT;
2063
+ exports.DEFAULT_POPOVER_ELEMENT = _visualEditing.DEFAULT_POPOVER_ELEMENT;
2064
+ exports.DEFAULT_SPINNER_ELEMENT = _visualEditing.DEFAULT_SPINNER_ELEMENT;
2065
+ exports.DEFAULT_STACK_ELEMENT = _visualEditing.DEFAULT_STACK_ELEMENT;
2066
+ exports.DEFAULT_TAB_ELEMENT = _visualEditing.DEFAULT_TAB_ELEMENT;
2067
+ exports.DEFAULT_TAB_LIST_ELEMENT = _visualEditing.DEFAULT_TAB_LIST_ELEMENT;
2068
+ exports.DEFAULT_TEXT_ELEMENT = _visualEditing.DEFAULT_TEXT_ELEMENT;
2069
+ exports.DEFAULT_TEXT_INPUT_ELEMENT = _visualEditing.DEFAULT_TEXT_INPUT_ELEMENT;
2070
+ exports.DEFAULT_TOOLTIP_ELEMENT = _visualEditing.DEFAULT_TOOLTIP_ELEMENT;
2071
+ exports.ElementQuery = _visualEditing.ElementQuery;
2072
+ exports.Flex = _visualEditing.Flex;
2073
+ exports.Grid = _visualEditing.Grid;
2074
+ exports.Hotkeys = _visualEditing.Hotkeys;
2075
+ exports.KBD = _visualEditing.KBD;
2076
+ exports.Layer = _visualEditing.Layer;
2077
+ exports.LayerProvider = _visualEditing.LayerProvider;
2078
+ exports.Menu = _visualEditing.Menu;
2079
+ exports.MenuDivider = _visualEditing.MenuDivider;
2080
+ exports.MenuGroup = _visualEditing.MenuGroup;
2081
+ exports.MenuItem = _visualEditing.MenuItem;
2082
+ exports.Popover = _visualEditing.Popover;
2083
+ exports.Portal = _visualEditing.Portal;
2084
+ exports.PortalProvider = _visualEditing.PortalProvider;
2085
+ exports.Spinner = _visualEditing.Spinner;
2086
+ exports.Stack = _visualEditing.Stack;
2087
+ exports.Tab = _visualEditing.Tab;
2088
+ exports.TabList = _visualEditing.TabList;
2089
+ exports.Text = _visualEditing.Text;
2090
+ exports.TextInput = _visualEditing.TextInput;
2091
+ exports.ThemeColorProvider = _visualEditing.ThemeColorProvider;
2092
+ exports.ThemeProvider = _visualEditing.ThemeProvider;
2093
+ exports.Tooltip = _visualEditing.Tooltip;
2094
+ exports.TooltipDelayGroupContext = _visualEditing.TooltipDelayGroupContext;
2095
+ exports._ResizeObserver = _visualEditing._ResizeObserver;
2096
+ exports._elementSizeObserver = _visualEditing._elementSizeObserver;
2097
+ exports._getArrayProp = _visualEditing._getArrayProp;
2098
+ exports._getResponsiveProp = _visualEditing._getResponsiveProp;
2099
+ exports._isEnterToClickElement = _visualEditing._isEnterToClickElement;
2100
+ exports.containsOrEqualsElement = _visualEditing.containsOrEqualsElement;
2101
+ exports.isHTMLAnchorElement = _visualEditing.isHTMLAnchorElement;
2102
+ exports.isHTMLButtonElement = _visualEditing.isHTMLButtonElement;
2103
+ exports.isHTMLElement = _visualEditing.isHTMLElement;
2104
+ exports.isHTMLInputElement = _visualEditing.isHTMLInputElement;
2105
+ exports.isHTMLSelectElement = _visualEditing.isHTMLSelectElement;
2106
+ exports.isHTMLTextAreaElement = _visualEditing.isHTMLTextAreaElement;
2107
+ exports.useBoundaryElement = _visualEditing.useBoundaryElement;
2108
+ exports.useCard = _visualEditing.useCard;
2109
+ exports.useClickOutsideEvent = _visualEditing.useClickOutsideEvent;
2110
+ exports.useCustomValidity = _visualEditing.useCustomValidity;
2111
+ exports.useElementSize = _visualEditing.useElementSize;
2112
+ exports.useGlobalKeyDown = _visualEditing.useGlobalKeyDown;
2113
+ exports.useLayer = _visualEditing.useLayer;
2114
+ exports.useMatchMedia = _visualEditing.useMatchMedia;
2115
+ exports.useMediaIndex = _visualEditing.useMediaIndex;
2116
+ exports.usePortal = _visualEditing.usePortal;
2117
+ exports.usePrefersDark = _visualEditing.usePrefersDark;
2118
+ exports.usePrefersReducedMotion = _visualEditing.usePrefersReducedMotion;
2119
+ exports.useResponsiveProp = _visualEditing.useResponsiveProp;
2120
+ exports.useRootTheme = _visualEditing.useRootTheme;
2121
+ exports.useTheme = _visualEditing.useTheme;
2122
+ exports.useTheme_v2 = _visualEditing.useTheme_v2;
2123
+ exports.useTooltipDelayGroup = _visualEditing.useTooltipDelayGroup;
2124
+ Object.defineProperty(exports, "px", {
2125
+ enumerable: !0,
2126
+ get: function() {
2127
+ return css.px;
2128
+ }
2129
+ });
2130
+ Object.defineProperty(exports, "rem", {
2131
+ enumerable: !0,
2132
+ get: function() {
2133
+ return css.rem;
2134
+ }
2135
+ });
2136
+ exports.Autocomplete = Autocomplete;
2137
+ exports.Avatar = Avatar;
2138
+ exports.AvatarCounter = AvatarCounter;
2139
+ exports.AvatarStack = AvatarStack;
2140
+ exports.Badge = Badge;
2141
+ exports.BoundaryElementProvider = BoundaryElementProvider;
2142
+ exports.Breadcrumbs = Breadcrumbs;
2143
+ exports.Checkbox = Checkbox;
2144
+ exports.CodeSkeleton = CodeSkeleton;
2145
+ exports.Container = Container;
2146
+ exports.DEFAULT_AUTOCOMPLETE_ELEMENT = DEFAULT_AUTOCOMPLETE_ELEMENT;
2147
+ exports.DEFAULT_AVATAR_COUNTER_ELEMENT = DEFAULT_AVATAR_COUNTER_ELEMENT;
2148
+ exports.DEFAULT_AVATAR_ELEMENT = DEFAULT_AVATAR_ELEMENT;
2149
+ exports.DEFAULT_AVATAR_STACK_ELEMENT = DEFAULT_AVATAR_STACK_ELEMENT;
2150
+ exports.DEFAULT_BADGE_ELEMENT = DEFAULT_BADGE_ELEMENT;
2151
+ exports.DEFAULT_BREADCRUMBS_ELEMENT = DEFAULT_BREADCRUMBS_ELEMENT;
2152
+ exports.DEFAULT_CHECKBOX_ELEMENT = DEFAULT_CHECKBOX_ELEMENT;
2153
+ exports.DEFAULT_CODE_SKELETON_ELEMENT = DEFAULT_CODE_SKELETON_ELEMENT;
2154
+ exports.DEFAULT_CONTAINER_ELEMENT = DEFAULT_CONTAINER_ELEMENT;
2155
+ exports.DEFAULT_DIALOG_ELEMENT = DEFAULT_DIALOG_ELEMENT;
2156
+ exports.DEFAULT_HEADING_ELEMENT = DEFAULT_HEADING_ELEMENT;
2157
+ exports.DEFAULT_HEADING_SKELETON_ELEMENT = DEFAULT_HEADING_SKELETON_ELEMENT;
2158
+ exports.DEFAULT_INLINE_ELEMENT = DEFAULT_INLINE_ELEMENT;
2159
+ exports.DEFAULT_LABEL_ELEMENT = DEFAULT_LABEL_ELEMENT;
2160
+ exports.DEFAULT_LABEL_SKELETON_ELEMENT = DEFAULT_LABEL_SKELETON_ELEMENT;
2161
+ exports.DEFAULT_RADIO_ELEMENT = DEFAULT_RADIO_ELEMENT;
2162
+ exports.DEFAULT_SELECT_ELEMENT = DEFAULT_SELECT_ELEMENT;
2163
+ exports.DEFAULT_SKELETON_ELEMENT = DEFAULT_SKELETON_ELEMENT;
2164
+ exports.DEFAULT_SR_ONLY_ELEMENT = DEFAULT_SR_ONLY_ELEMENT;
2165
+ exports.DEFAULT_SWITCH_ELEMENT = DEFAULT_SWITCH_ELEMENT;
2166
+ exports.DEFAULT_TAB_PANEL_ELEMENT = DEFAULT_TAB_PANEL_ELEMENT;
2167
+ exports.DEFAULT_TEXT_AREA_ELEMENT = DEFAULT_TEXT_AREA_ELEMENT;
2168
+ exports.DEFAULT_TEXT_SKELETON_ELEMENT = DEFAULT_TEXT_SKELETON_ELEMENT;
2169
+ exports.DEFAULT_TOAST_ELEMENT = DEFAULT_TOAST_ELEMENT;
2170
+ exports.DEFAULT_TREE_ELEMENT = DEFAULT_TREE_ELEMENT;
2171
+ exports.DEFAULT_TREE_ITEM_ELEMENT = DEFAULT_TREE_ITEM_ELEMENT;
2172
+ exports.DEFAULT_VIRTUAL_LIST_ELEMENT = DEFAULT_VIRTUAL_LIST_ELEMENT;
2173
+ exports.Dialog = Dialog;
2174
+ exports.DialogContext = DialogContext;
2175
+ exports.DialogProvider = DialogProvider;
2176
+ exports.ErrorBoundary = ErrorBoundary;
2177
+ exports.Heading = Heading;
2178
+ exports.HeadingSkeleton = HeadingSkeleton;
2179
+ exports.Inline = Inline;
2180
+ exports.Label = Label;
2181
+ exports.LabelSkeleton = LabelSkeleton;
2182
+ exports.MenuButton = MenuButton;
2183
+ exports.Radio = Radio;
2184
+ exports.Select = Select;
2185
+ exports.Skeleton = Skeleton;
2186
+ exports.SrOnly = SrOnly;
2187
+ exports.Switch = Switch;
2188
+ exports.TabPanel = TabPanel;
2189
+ exports.TextArea = TextArea;
2190
+ exports.TextSkeleton = TextSkeleton;
2191
+ exports.Toast = Toast;
2192
+ exports.ToastProvider = ToastProvider;
2193
+ exports.TooltipDelayGroupProvider = TooltipDelayGroupProvider;
2194
+ exports.Tree = Tree;
2195
+ exports.TreeItem = TreeItem;
2196
+ exports.VirtualList = VirtualList;
2197
+ exports._hasFocus = _hasFocus;
2198
+ exports._isScrollable = _isScrollable;
2199
+ exports._raf = _raf;
2200
+ exports._raf2 = _raf2;
2201
+ exports._responsive = _responsive;
2202
+ exports.attemptFocus = attemptFocus;
2203
+ exports.createColorTheme = createColorTheme;
2204
+ exports.focusFirstDescendant = focusFirstDescendant;
2205
+ exports.focusLastDescendant = focusLastDescendant;
2206
+ exports.hexToRgb = hexToRgb;
2207
+ exports.hslToRgb = hslToRgb;
2208
+ exports.isFocusable = isFocusable;
2209
+ exports.multiply = multiply;
2210
+ exports.parseColor = parseColor;
2211
+ exports.rgbToHex = rgbToHex;
2212
+ exports.rgbToHsl = rgbToHsl;
2213
+ exports.rgba = rgba;
2214
+ exports.screen = screen;
2215
+ exports.useArrayProp = useArrayProp;
2216
+ exports.useClickOutside = useClickOutside;
2217
+ exports.useDialog = useDialog;
2218
+ exports.useElementRect = useElementRect;
2219
+ exports.useForwardedRef = useForwardedRef;
2220
+ exports.useToast = useToast;
2221
+ exports.useTree = useTree;
2222
+ //# sourceMappingURL=index.cjs.map