@bettercms-ai/kit 0.1.0

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 (630) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +27 -0
  3. package/dist/_chunks-cjs/_visual-editing.js +5898 -0
  4. package/dist/_chunks-cjs/refractor.js +22 -0
  5. package/dist/_chunks-es/_visual-editing.mjs +5904 -0
  6. package/dist/_chunks-es/refractor.mjs +25 -0
  7. package/dist/_color.d.mts +119 -0
  8. package/dist/_color.d.ts +119 -0
  9. package/dist/_color.js +1412 -0
  10. package/dist/_color.mjs +1411 -0
  11. package/dist/_visual-editing.d.mts +1126 -0
  12. package/dist/_visual-editing.d.ts +1126 -0
  13. package/dist/_visual-editing.js +30 -0
  14. package/dist/_visual-editing.mjs +30 -0
  15. package/dist/index.d.mts +3140 -0
  16. package/dist/index.d.ts +3140 -0
  17. package/dist/index.js +2036 -0
  18. package/dist/index.mjs +2044 -0
  19. package/dist/theme.d.mts +1506 -0
  20. package/dist/theme.d.ts +1506 -0
  21. package/dist/theme.js +4126 -0
  22. package/dist/theme.mjs +4126 -0
  23. package/exports/_visual-editing.ts +31 -0
  24. package/exports/index.ts +1 -0
  25. package/exports/theme.ts +1 -0
  26. package/package.json +78 -0
  27. package/src/color/index.d.mts +119 -0
  28. package/src/color/index.mjs +1411 -0
  29. package/src/core/__workshop__/constants.ts +293 -0
  30. package/src/core/_compat.ts +264 -0
  31. package/src/core/components/autocomplete/__mocks__/apiStore.ts +49 -0
  32. package/src/core/components/autocomplete/__mocks__/countries.ts +245 -0
  33. package/src/core/components/autocomplete/__workshop__/async.tsx +156 -0
  34. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +137 -0
  35. package/src/core/components/autocomplete/__workshop__/custom.tsx +89 -0
  36. package/src/core/components/autocomplete/__workshop__/example.tsx +79 -0
  37. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +36 -0
  38. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +294 -0
  39. package/src/core/components/autocomplete/__workshop__/index.ts +39 -0
  40. package/src/core/components/autocomplete/__workshop__/types.ts +4 -0
  41. package/src/core/components/autocomplete/autocomplete.styles.tsx +39 -0
  42. package/src/core/components/autocomplete/autocomplete.tsx +767 -0
  43. package/src/core/components/autocomplete/autocompleteOption.tsx +45 -0
  44. package/src/core/components/autocomplete/autocompleteReducer.ts +47 -0
  45. package/src/core/components/autocomplete/constants.ts +28 -0
  46. package/src/core/components/autocomplete/index.ts +2 -0
  47. package/src/core/components/autocomplete/types.ts +108 -0
  48. package/src/core/components/breadcrumbs/__workshop__/example.tsx +62 -0
  49. package/src/core/components/breadcrumbs/__workshop__/index.ts +14 -0
  50. package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +18 -0
  51. package/src/core/components/breadcrumbs/breadcrumbs.test.tsx +51 -0
  52. package/src/core/components/breadcrumbs/breadcrumbs.tsx +133 -0
  53. package/src/core/components/breadcrumbs/index.ts +1 -0
  54. package/src/core/components/dialog/__workshop__/activate.tsx +134 -0
  55. package/src/core/components/dialog/__workshop__/autoFocus.tsx +29 -0
  56. package/src/core/components/dialog/__workshop__/index.ts +19 -0
  57. package/src/core/components/dialog/__workshop__/layering.tsx +41 -0
  58. package/src/core/components/dialog/__workshop__/nested.tsx +72 -0
  59. package/src/core/components/dialog/__workshop__/onScroll.tsx +39 -0
  60. package/src/core/components/dialog/__workshop__/panes.tsx +82 -0
  61. package/src/core/components/dialog/__workshop__/position.tsx +30 -0
  62. package/src/core/components/dialog/__workshop__/props.tsx +75 -0
  63. package/src/core/components/dialog/__workshop__/provider.tsx +11 -0
  64. package/src/core/components/dialog/__workshop__/wrapped.tsx +76 -0
  65. package/src/core/components/dialog/dialog.tsx +430 -0
  66. package/src/core/components/dialog/dialogContext.ts +20 -0
  67. package/src/core/components/dialog/dialogProvider.tsx +35 -0
  68. package/src/core/components/dialog/index.ts +4 -0
  69. package/src/core/components/dialog/styles.ts +77 -0
  70. package/src/core/components/dialog/useDialog.ts +11 -0
  71. package/src/core/components/hotkeys/__workshop__/index.ts +14 -0
  72. package/src/core/components/hotkeys/__workshop__/plain.tsx +9 -0
  73. package/src/core/components/hotkeys/hotkeys.test.tsx +42 -0
  74. package/src/core/components/hotkeys/hotkeys.tsx +66 -0
  75. package/src/core/components/hotkeys/index.ts +1 -0
  76. package/src/core/components/index.ts +9 -0
  77. package/src/core/components/menu/__workshop__/asComponent.tsx +45 -0
  78. package/src/core/components/menu/__workshop__/avatarMenu.tsx +51 -0
  79. package/src/core/components/menu/__workshop__/closableMenuButton.tsx +46 -0
  80. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +134 -0
  81. package/src/core/components/menu/__workshop__/customMenuItem.tsx +45 -0
  82. package/src/core/components/menu/__workshop__/customSelectedState.tsx +39 -0
  83. package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +40 -0
  84. package/src/core/components/menu/__workshop__/groups.tsx +156 -0
  85. package/src/core/components/menu/__workshop__/index.ts +89 -0
  86. package/src/core/components/menu/__workshop__/menuButton.tsx +80 -0
  87. package/src/core/components/menu/__workshop__/menuGroupRight.tsx +58 -0
  88. package/src/core/components/menu/__workshop__/nestedMenu.tsx +22 -0
  89. package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +41 -0
  90. package/src/core/components/menu/__workshop__/selectedItem.tsx +69 -0
  91. package/src/core/components/menu/__workshop__/shouldFocus.tsx +47 -0
  92. package/src/core/components/menu/__workshop__/tones.tsx +25 -0
  93. package/src/core/components/menu/__workshop__/withoutArrow.tsx +32 -0
  94. package/src/core/components/menu/helpers.ts +82 -0
  95. package/src/core/components/menu/index.ts +5 -0
  96. package/src/core/components/menu/menu.spacing.test.tsx +63 -0
  97. package/src/core/components/menu/menu.test.tsx +125 -0
  98. package/src/core/components/menu/menu.tsx +178 -0
  99. package/src/core/components/menu/menuButton.tsx +268 -0
  100. package/src/core/components/menu/menuContext.ts +18 -0
  101. package/src/core/components/menu/menuDivider.ts +23 -0
  102. package/src/core/components/menu/menuGroup.spacing.test.tsx +63 -0
  103. package/src/core/components/menu/menuGroup.tsx +233 -0
  104. package/src/core/components/menu/menuItem.spacing.test.tsx +59 -0
  105. package/src/core/components/menu/menuItem.tsx +197 -0
  106. package/src/core/components/menu/useMenu.ts +21 -0
  107. package/src/core/components/menu/useMenuController.ts +231 -0
  108. package/src/core/components/skeleton/__workshop__/delay.tsx +70 -0
  109. package/src/core/components/skeleton/__workshop__/index.ts +11 -0
  110. package/src/core/components/skeleton/__workshop__/skeleton.tsx +64 -0
  111. package/src/core/components/skeleton/index.ts +2 -0
  112. package/src/core/components/skeleton/skeleton.tsx +57 -0
  113. package/src/core/components/skeleton/styles.ts +50 -0
  114. package/src/core/components/skeleton/textSkeleton.tsx +122 -0
  115. package/src/core/components/tab/__workshop__/example.tsx +79 -0
  116. package/src/core/components/tab/__workshop__/index.ts +14 -0
  117. package/src/core/components/tab/index.ts +3 -0
  118. package/src/core/components/tab/tab.tsx +101 -0
  119. package/src/core/components/tab/tabList.test.tsx +48 -0
  120. package/src/core/components/tab/tabList.tsx +70 -0
  121. package/src/core/components/tab/tabPanel.tsx +39 -0
  122. package/src/core/components/toast/__workshop__/hook.tsx +71 -0
  123. package/src/core/components/toast/__workshop__/index.ts +19 -0
  124. package/src/core/components/toast/__workshop__/toast.tsx +26 -0
  125. package/src/core/components/toast/index.ts +4 -0
  126. package/src/core/components/toast/styles.ts +77 -0
  127. package/src/core/components/toast/toast.test.tsx +101 -0
  128. package/src/core/components/toast/toast.tsx +198 -0
  129. package/src/core/components/toast/toastContext.ts +7 -0
  130. package/src/core/components/toast/toastLayer.tsx +51 -0
  131. package/src/core/components/toast/toastProvider.tsx +113 -0
  132. package/src/core/components/toast/toastState.ts +6 -0
  133. package/src/core/components/toast/types.ts +26 -0
  134. package/src/core/components/toast/useToast.ts +25 -0
  135. package/src/core/components/tree/__workshop__/basic.perf.ts +19 -0
  136. package/src/core/components/tree/__workshop__/basic.tsx +105 -0
  137. package/src/core/components/tree/__workshop__/index.ts +21 -0
  138. package/src/core/components/tree/__workshop__/tabFromElement.tsx +84 -0
  139. package/src/core/components/tree/helpers.ts +105 -0
  140. package/src/core/components/tree/index.ts +4 -0
  141. package/src/core/components/tree/style.ts +105 -0
  142. package/src/core/components/tree/tree.test.tsx +55 -0
  143. package/src/core/components/tree/tree.tsx +240 -0
  144. package/src/core/components/tree/treeContext.ts +10 -0
  145. package/src/core/components/tree/treeGroup.tsx +28 -0
  146. package/src/core/components/tree/treeItem.test.tsx +65 -0
  147. package/src/core/components/tree/treeItem.tsx +224 -0
  148. package/src/core/components/tree/types.ts +25 -0
  149. package/src/core/components/tree/useTree.ts +17 -0
  150. package/src/core/constants.ts +79 -0
  151. package/src/core/helpers/animation.ts +27 -0
  152. package/src/core/helpers/element.ts +55 -0
  153. package/src/core/helpers/focus.ts +100 -0
  154. package/src/core/helpers/index.ts +4 -0
  155. package/src/core/helpers/scroll.ts +15 -0
  156. package/src/core/hooks/index.ts +12 -0
  157. package/src/core/hooks/useArrayProp.ts +17 -0
  158. package/src/core/hooks/useClickOutside.test.tsx +482 -0
  159. package/src/core/hooks/useClickOutside.ts +118 -0
  160. package/src/core/hooks/useClickOutsideEvent.test.tsx +115 -0
  161. package/src/core/hooks/useClickOutsideEvent.ts +73 -0
  162. package/src/core/hooks/useCustomValidity.ts +13 -0
  163. package/src/core/hooks/useDelayed.test.ts +88 -0
  164. package/src/core/hooks/useDelayedState.ts +36 -0
  165. package/src/core/hooks/useElementRect/__workshop__/example.tsx +32 -0
  166. package/src/core/hooks/useElementRect/__workshop__/index.ts +14 -0
  167. package/src/core/hooks/useElementRect/index.ts +1 -0
  168. package/src/core/hooks/useElementRect/useElementRect.ts +13 -0
  169. package/src/core/hooks/useElementSize.ts +19 -0
  170. package/src/core/hooks/useForwardedRef.ts +19 -0
  171. package/src/core/hooks/useGlobalKeyDown.ts +24 -0
  172. package/src/core/hooks/useIsomorphicEffect.ts +7 -0
  173. package/src/core/hooks/useMatchMedia.ts +28 -0
  174. package/src/core/hooks/useMediaIndex/__workshop__/index.ts +14 -0
  175. package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +14 -0
  176. package/src/core/hooks/useMediaIndex/index.ts +1 -0
  177. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +36 -0
  178. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +102 -0
  179. package/src/core/hooks/useMounted.ts +15 -0
  180. package/src/core/hooks/usePrefersDark.hydration.test.tsx +56 -0
  181. package/src/core/hooks/usePrefersDark.test.tsx +19 -0
  182. package/src/core/hooks/usePrefersDark.ts +16 -0
  183. package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +56 -0
  184. package/src/core/hooks/usePrefersReducedMotion.test.tsx +19 -0
  185. package/src/core/hooks/usePrefersReducedMotion.ts +16 -0
  186. package/src/core/index.ts +10 -0
  187. package/src/core/lib/createGlobalScopedContext.ts +36 -0
  188. package/src/core/lib/globalScope.ts +19 -0
  189. package/src/core/lib/isRecord.ts +3 -0
  190. package/src/core/middleware/origin.ts +47 -0
  191. package/src/core/observers/elementSizeObserver.ts +116 -0
  192. package/src/core/observers/index.ts +2 -0
  193. package/src/core/observers/resizeObserver.ts +9 -0
  194. package/src/core/primitives/_selectable/index.ts +1 -0
  195. package/src/core/primitives/_selectable/selectable.tsx +15 -0
  196. package/src/core/primitives/_selectable/style.ts +115 -0
  197. package/src/core/primitives/avatar/__workshop__/asButton.tsx +14 -0
  198. package/src/core/primitives/avatar/__workshop__/index.ts +29 -0
  199. package/src/core/primitives/avatar/__workshop__/stack.tsx +25 -0
  200. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +63 -0
  201. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +70 -0
  202. package/src/core/primitives/avatar/avatar.tsx +200 -0
  203. package/src/core/primitives/avatar/avatarCounter.tsx +91 -0
  204. package/src/core/primitives/avatar/avatarStack.tsx +100 -0
  205. package/src/core/primitives/avatar/index.ts +4 -0
  206. package/src/core/primitives/avatar/styles.ts +167 -0
  207. package/src/core/primitives/avatar/types.ts +17 -0
  208. package/src/core/primitives/badge/__workshop__/index.ts +19 -0
  209. package/src/core/primitives/badge/__workshop__/props.tsx +30 -0
  210. package/src/core/primitives/badge/__workshop__/tones.tsx +21 -0
  211. package/src/core/primitives/badge/badge.test.tsx +16 -0
  212. package/src/core/primitives/badge/badge.tsx +70 -0
  213. package/src/core/primitives/badge/index.ts +1 -0
  214. package/src/core/primitives/badge/styles.ts +20 -0
  215. package/src/core/primitives/badge/types.ts +8 -0
  216. package/src/core/primitives/box/__workshop__/asComponent.tsx +31 -0
  217. package/src/core/primitives/box/__workshop__/index.ts +24 -0
  218. package/src/core/primitives/box/__workshop__/props.tsx +20 -0
  219. package/src/core/primitives/box/__workshop__/responsive.tsx +20 -0
  220. package/src/core/primitives/box/box.test.tsx +142 -0
  221. package/src/core/primitives/box/box.tsx +154 -0
  222. package/src/core/primitives/box/index.ts +1 -0
  223. package/src/core/primitives/button/__workshop__/custom.tsx +51 -0
  224. package/src/core/primitives/button/__workshop__/customIcons.tsx +30 -0
  225. package/src/core/primitives/button/__workshop__/disabled.tsx +74 -0
  226. package/src/core/primitives/button/__workshop__/index.ts +59 -0
  227. package/src/core/primitives/button/__workshop__/labelUploadButton.tsx +36 -0
  228. package/src/core/primitives/button/__workshop__/mixedChildren.tsx +12 -0
  229. package/src/core/primitives/button/__workshop__/props.tsx +55 -0
  230. package/src/core/primitives/button/__workshop__/stacked.tsx +58 -0
  231. package/src/core/primitives/button/__workshop__/styled1.tsx +17 -0
  232. package/src/core/primitives/button/__workshop__/styled2.tsx +19 -0
  233. package/src/core/primitives/button/__workshop__/uploadButton.tsx +28 -0
  234. package/src/core/primitives/button/button.test.tsx +82 -0
  235. package/src/core/primitives/button/button.tsx +210 -0
  236. package/src/core/primitives/button/index.ts +1 -0
  237. package/src/core/primitives/button/styles.ts +117 -0
  238. package/src/core/primitives/card/__workshop__/allTones.tsx +25 -0
  239. package/src/core/primitives/card/__workshop__/asButton.tsx +107 -0
  240. package/src/core/primitives/card/__workshop__/asComponent.tsx +27 -0
  241. package/src/core/primitives/card/__workshop__/checkered.tsx +26 -0
  242. package/src/core/primitives/card/__workshop__/index.ts +18 -0
  243. package/src/core/primitives/card/__workshop__/interactive.tsx +30 -0
  244. package/src/core/primitives/card/__workshop__/listNavigation.tsx +80 -0
  245. package/src/core/primitives/card/__workshop__/props.tsx +53 -0
  246. package/src/core/primitives/card/__workshop__/selected.tsx +94 -0
  247. package/src/core/primitives/card/__workshop__/styled.tsx +14 -0
  248. package/src/core/primitives/card/card.tsx +128 -0
  249. package/src/core/primitives/card/index.ts +2 -0
  250. package/src/core/primitives/card/styles.ts +147 -0
  251. package/src/core/primitives/card/types.ts +11 -0
  252. package/src/core/primitives/checkbox/__workshop__/example.tsx +25 -0
  253. package/src/core/primitives/checkbox/__workshop__/index.ts +13 -0
  254. package/src/core/primitives/checkbox/__workshop__/props.tsx +33 -0
  255. package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +16 -0
  256. package/src/core/primitives/checkbox/__workshop__/tones.tsx +28 -0
  257. package/src/core/primitives/checkbox/checkbox.tsx +73 -0
  258. package/src/core/primitives/checkbox/index.ts +1 -0
  259. package/src/core/primitives/checkbox/styles.ts +128 -0
  260. package/src/core/primitives/code/__workshop__/index.ts +19 -0
  261. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +48 -0
  262. package/src/core/primitives/code/__workshop__/props.tsx +21 -0
  263. package/src/core/primitives/code/code.tsx +55 -0
  264. package/src/core/primitives/code/index.ts +1 -0
  265. package/src/core/primitives/code/refractor.tsx +20 -0
  266. package/src/core/primitives/code/styles.ts +77 -0
  267. package/src/core/primitives/container/__workshop__/example.tsx +20 -0
  268. package/src/core/primitives/container/__workshop__/index.ts +8 -0
  269. package/src/core/primitives/container/container.tsx +54 -0
  270. package/src/core/primitives/container/index.ts +2 -0
  271. package/src/core/primitives/container/styles.ts +23 -0
  272. package/src/core/primitives/container/types.ts +6 -0
  273. package/src/core/primitives/flex/__workshop__/example.tsx +34 -0
  274. package/src/core/primitives/flex/__workshop__/gap.tsx +25 -0
  275. package/src/core/primitives/flex/__workshop__/index.ts +11 -0
  276. package/src/core/primitives/flex/flex.tsx +64 -0
  277. package/src/core/primitives/flex/index.ts +1 -0
  278. package/src/core/primitives/grid/__workshop__/index.ts +10 -0
  279. package/src/core/primitives/grid/__workshop__/responsive.tsx +54 -0
  280. package/src/core/primitives/grid/grid.test.tsx +80 -0
  281. package/src/core/primitives/grid/grid.tsx +74 -0
  282. package/src/core/primitives/grid/index.ts +1 -0
  283. package/src/core/primitives/heading/__workshop__/index.ts +19 -0
  284. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +54 -0
  285. package/src/core/primitives/heading/__workshop__/plain.tsx +32 -0
  286. package/src/core/primitives/heading/heading.tsx +88 -0
  287. package/src/core/primitives/heading/index.ts +1 -0
  288. package/src/core/primitives/heading/styles.ts +64 -0
  289. package/src/core/primitives/heading/types.ts +7 -0
  290. package/src/core/primitives/index.ts +27 -0
  291. package/src/core/primitives/inline/__workshop__/index.ts +8 -0
  292. package/src/core/primitives/inline/__workshop__/plain.tsx +27 -0
  293. package/src/core/primitives/inline/index.ts +1 -0
  294. package/src/core/primitives/inline/inline.test.tsx +51 -0
  295. package/src/core/primitives/inline/inline.tsx +63 -0
  296. package/src/core/primitives/inline/styles.ts +32 -0
  297. package/src/core/primitives/inline/types.ts +6 -0
  298. package/src/core/primitives/kbd/__workshop__/index.ts +8 -0
  299. package/src/core/primitives/kbd/__workshop__/plain.tsx +9 -0
  300. package/src/core/primitives/kbd/index.ts +1 -0
  301. package/src/core/primitives/kbd/kbd.tsx +69 -0
  302. package/src/core/primitives/label/__workshop__/index.ts +19 -0
  303. package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +48 -0
  304. package/src/core/primitives/label/__workshop__/plain.tsx +24 -0
  305. package/src/core/primitives/label/index.ts +1 -0
  306. package/src/core/primitives/label/label.tsx +87 -0
  307. package/src/core/primitives/label/styles.ts +45 -0
  308. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +77 -0
  309. package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +31 -0
  310. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +32 -0
  311. package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +11 -0
  312. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +71 -0
  313. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +71 -0
  314. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +89 -0
  315. package/src/core/primitives/popover/__workshop__/TestStory.tsx +97 -0
  316. package/src/core/primitives/popover/__workshop__/index.ts +49 -0
  317. package/src/core/primitives/popover/constants.ts +22 -0
  318. package/src/core/primitives/popover/floating-ui/size.ts +99 -0
  319. package/src/core/primitives/popover/helpers.ts +31 -0
  320. package/src/core/primitives/popover/index.ts +2 -0
  321. package/src/core/primitives/popover/popover.tsx +511 -0
  322. package/src/core/primitives/popover/popoverCard.tsx +166 -0
  323. package/src/core/primitives/popover/types.ts +7 -0
  324. package/src/core/primitives/radio/__workshop__/example.tsx +63 -0
  325. package/src/core/primitives/radio/__workshop__/index.ts +11 -0
  326. package/src/core/primitives/radio/__workshop__/plain.tsx +28 -0
  327. package/src/core/primitives/radio/index.ts +1 -0
  328. package/src/core/primitives/radio/radio.tsx +51 -0
  329. package/src/core/primitives/radio/styles.ts +117 -0
  330. package/src/core/primitives/select/__workshop__/index.ts +11 -0
  331. package/src/core/primitives/select/__workshop__/plain.tsx +27 -0
  332. package/src/core/primitives/select/__workshop__/readOnly.tsx +23 -0
  333. package/src/core/primitives/select/index.ts +1 -0
  334. package/src/core/primitives/select/select.test.tsx +52 -0
  335. package/src/core/primitives/select/select.tsx +94 -0
  336. package/src/core/primitives/select/styles.ts +166 -0
  337. package/src/core/primitives/spinner/__workshop__/Props.tsx +15 -0
  338. package/src/core/primitives/spinner/__workshop__/index.ts +14 -0
  339. package/src/core/primitives/spinner/index.ts +1 -0
  340. package/src/core/primitives/spinner/spinner.tsx +46 -0
  341. package/src/core/primitives/stack/__workshop__/index.ts +14 -0
  342. package/src/core/primitives/stack/__workshop__/plain.tsx +32 -0
  343. package/src/core/primitives/stack/index.ts +1 -0
  344. package/src/core/primitives/stack/stack.test.tsx +57 -0
  345. package/src/core/primitives/stack/stack.tsx +57 -0
  346. package/src/core/primitives/stack/styles.ts +32 -0
  347. package/src/core/primitives/switch/__workshop__/example.tsx +23 -0
  348. package/src/core/primitives/switch/__workshop__/index.ts +11 -0
  349. package/src/core/primitives/switch/__workshop__/props.tsx +21 -0
  350. package/src/core/primitives/switch/index.ts +1 -0
  351. package/src/core/primitives/switch/styles.ts +173 -0
  352. package/src/core/primitives/switch/switch.tsx +68 -0
  353. package/src/core/primitives/text/__workshop__/colored.tsx +30 -0
  354. package/src/core/primitives/text/__workshop__/example.tsx +39 -0
  355. package/src/core/primitives/text/__workshop__/index.ts +24 -0
  356. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +48 -0
  357. package/src/core/primitives/text/index.ts +1 -0
  358. package/src/core/primitives/text/styles.ts +74 -0
  359. package/src/core/primitives/text/text.tsx +89 -0
  360. package/src/core/primitives/textArea/__workshop__/index.ts +14 -0
  361. package/src/core/primitives/textArea/__workshop__/plain.tsx +50 -0
  362. package/src/core/primitives/textArea/index.ts +1 -0
  363. package/src/core/primitives/textArea/textArea.tsx +120 -0
  364. package/src/core/primitives/textInput/__workshop__/clearButton.tsx +30 -0
  365. package/src/core/primitives/textInput/__workshop__/customValidity.tsx +17 -0
  366. package/src/core/primitives/textInput/__workshop__/index.ts +44 -0
  367. package/src/core/primitives/textInput/__workshop__/plain.tsx +98 -0
  368. package/src/core/primitives/textInput/__workshop__/readOnly.tsx +9 -0
  369. package/src/core/primitives/textInput/__workshop__/states.tsx +53 -0
  370. package/src/core/primitives/textInput/__workshop__/tones.tsx +277 -0
  371. package/src/core/primitives/textInput/__workshop__/typed.tsx +23 -0
  372. package/src/core/primitives/textInput/index.ts +1 -0
  373. package/src/core/primitives/textInput/textInput.test.tsx +48 -0
  374. package/src/core/primitives/textInput/textInput.tsx +395 -0
  375. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +102 -0
  376. package/src/core/primitives/tooltip/__workshop__/index.ts +29 -0
  377. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +74 -0
  378. package/src/core/primitives/tooltip/__workshop__/props.tsx +107 -0
  379. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +86 -0
  380. package/src/core/primitives/tooltip/constants.ts +23 -0
  381. package/src/core/primitives/tooltip/index.ts +2 -0
  382. package/src/core/primitives/tooltip/tooltip.test.tsx +452 -0
  383. package/src/core/primitives/tooltip/tooltip.tsx +495 -0
  384. package/src/core/primitives/tooltip/tooltipCard.tsx +109 -0
  385. package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +4 -0
  386. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +11 -0
  387. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +57 -0
  388. package/src/core/primitives/tooltip/tooltipDelayGroup/types.ts +10 -0
  389. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +13 -0
  390. package/src/core/primitives/types.ts +179 -0
  391. package/src/core/styles/border/borderStyle.ts +56 -0
  392. package/src/core/styles/border/index.ts +2 -0
  393. package/src/core/styles/border/types.ts +10 -0
  394. package/src/core/styles/box/boxStyle.ts +69 -0
  395. package/src/core/styles/box/index.ts +2 -0
  396. package/src/core/styles/box/types.ts +11 -0
  397. package/src/core/styles/card/_cardColorStyle.ts +108 -0
  398. package/src/core/styles/card/index.ts +1 -0
  399. package/src/core/styles/flex/flexItemStyle.ts +27 -0
  400. package/src/core/styles/flex/flexStyle.ts +70 -0
  401. package/src/core/styles/flex/index.ts +3 -0
  402. package/src/core/styles/flex/types.ts +25 -0
  403. package/src/core/styles/focusRing/index.ts +25 -0
  404. package/src/core/styles/font/codeFontStyle.ts +13 -0
  405. package/src/core/styles/font/headingFontStyle.ts +13 -0
  406. package/src/core/styles/font/index.ts +6 -0
  407. package/src/core/styles/font/labelFontStyle.ts +13 -0
  408. package/src/core/styles/font/responsiveFont.ts +103 -0
  409. package/src/core/styles/font/textAlignStyle.ts +19 -0
  410. package/src/core/styles/font/textFontStyle.ts +13 -0
  411. package/src/core/styles/font/types.ts +35 -0
  412. package/src/core/styles/grid/gridItemStyle.ts +82 -0
  413. package/src/core/styles/grid/gridStyle.ts +108 -0
  414. package/src/core/styles/grid/index.ts +3 -0
  415. package/src/core/styles/grid/types.ts +37 -0
  416. package/src/core/styles/helpers.ts +72 -0
  417. package/src/core/styles/index.ts +5 -0
  418. package/src/core/styles/input/index.ts +2 -0
  419. package/src/core/styles/input/responsiveInputPaddingStyle.ts +78 -0
  420. package/src/core/styles/input/textInputStyle.ts +263 -0
  421. package/src/core/styles/internal.ts +12 -0
  422. package/src/core/styles/margin/index.ts +2 -0
  423. package/src/core/styles/margin/marginStyle.ts +21 -0
  424. package/src/core/styles/margin/marginsStyle.test.ts +33 -0
  425. package/src/core/styles/margin/types.ts +9 -0
  426. package/src/core/styles/padding/index.ts +2 -0
  427. package/src/core/styles/padding/paddingStyle.test.ts +33 -0
  428. package/src/core/styles/padding/paddingStyle.ts +21 -0
  429. package/src/core/styles/padding/types.ts +12 -0
  430. package/src/core/styles/radius/index.ts +2 -0
  431. package/src/core/styles/radius/radiusStyle.ts +23 -0
  432. package/src/core/styles/radius/types.ts +8 -0
  433. package/src/core/styles/shadow/index.ts +2 -0
  434. package/src/core/styles/shadow/shadowStyle.ts +29 -0
  435. package/src/core/styles/shadow/types.ts +6 -0
  436. package/src/core/styles/types.ts +8 -0
  437. package/src/core/theme/__workshop__/build/Root.tsx +367 -0
  438. package/src/core/theme/__workshop__/build/helpers.ts +46 -0
  439. package/src/core/theme/__workshop__/build/story.tsx +465 -0
  440. package/src/core/theme/__workshop__/canvas.tsx +352 -0
  441. package/src/core/theme/__workshop__/color.tsx +62 -0
  442. package/src/core/theme/__workshop__/debug/story.tsx +408 -0
  443. package/src/core/theme/__workshop__/index.ts +39 -0
  444. package/src/core/theme/__workshop__/layer.tsx +78 -0
  445. package/src/core/theme/__workshop__/nestedProvider.tsx +15 -0
  446. package/src/core/theme/index.ts +5 -0
  447. package/src/core/theme/theme.test.tsx +73 -0
  448. package/src/core/theme/themeColorProvider.tsx +29 -0
  449. package/src/core/theme/themeContext.ts +10 -0
  450. package/src/core/theme/themeProvider.tsx +62 -0
  451. package/src/core/theme/types.ts +12 -0
  452. package/src/core/theme/useRootTheme.ts +17 -0
  453. package/src/core/theme/useTheme.ts +16 -0
  454. package/src/core/types/avatar.ts +14 -0
  455. package/src/core/types/badge.ts +12 -0
  456. package/src/core/types/box.ts +19 -0
  457. package/src/core/types/button.ts +21 -0
  458. package/src/core/types/card.ts +6 -0
  459. package/src/core/types/component.ts +32 -0
  460. package/src/core/types/dialog.ts +4 -0
  461. package/src/core/types/flex.ts +30 -0
  462. package/src/core/types/grid.ts +14 -0
  463. package/src/core/types/gridItem.ts +29 -0
  464. package/src/core/types/index.ts +15 -0
  465. package/src/core/types/placement.ts +18 -0
  466. package/src/core/types/popover.ts +4 -0
  467. package/src/core/types/radius.ts +4 -0
  468. package/src/core/types/selectable.ts +6 -0
  469. package/src/core/types/text.ts +4 -0
  470. package/src/core/utils/arrow/arrow.tsx +123 -0
  471. package/src/core/utils/arrow/cmds.ts +91 -0
  472. package/src/core/utils/arrow/index.ts +1 -0
  473. package/src/core/utils/boundaryElement/__workshop__/index.ts +14 -0
  474. package/src/core/utils/boundaryElement/__workshop__/plain.tsx +19 -0
  475. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +100 -0
  476. package/src/core/utils/boundaryElement/boundaryElementContext.ts +7 -0
  477. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +24 -0
  478. package/src/core/utils/boundaryElement/index.ts +3 -0
  479. package/src/core/utils/boundaryElement/types.ts +7 -0
  480. package/src/core/utils/boundaryElement/useBoundaryElement.ts +26 -0
  481. package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +21 -0
  482. package/src/core/utils/conditionalWrapper/index.ts +1 -0
  483. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +30 -0
  484. package/src/core/utils/elementQuery/__workshop__/index.ts +14 -0
  485. package/src/core/utils/elementQuery/elementQuery.tsx +53 -0
  486. package/src/core/utils/elementQuery/helpers.ts +27 -0
  487. package/src/core/utils/elementQuery/index.ts +1 -0
  488. package/src/core/utils/errorBoundary.tsx +48 -0
  489. package/src/core/utils/getElementRef.ts +26 -0
  490. package/src/core/utils/index.ts +9 -0
  491. package/src/core/utils/layer/__workshop__/_debug.tsx +17 -0
  492. package/src/core/utils/layer/__workshop__/index.ts +24 -0
  493. package/src/core/utils/layer/__workshop__/multipleRoots.tsx +49 -0
  494. package/src/core/utils/layer/__workshop__/nested.tsx +98 -0
  495. package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +13 -0
  496. package/src/core/utils/layer/getLayerContext.test.ts +30 -0
  497. package/src/core/utils/layer/getLayerContext.ts +21 -0
  498. package/src/core/utils/layer/index.ts +4 -0
  499. package/src/core/utils/layer/layer.test.tsx +108 -0
  500. package/src/core/utils/layer/layer.tsx +98 -0
  501. package/src/core/utils/layer/layerContext.ts +7 -0
  502. package/src/core/utils/layer/layerProvider.tsx +111 -0
  503. package/src/core/utils/layer/types.ts +9 -0
  504. package/src/core/utils/layer/useLayer.ts +26 -0
  505. package/src/core/utils/portal/__workshop__/index.ts +14 -0
  506. package/src/core/utils/portal/__workshop__/named.tsx +63 -0
  507. package/src/core/utils/portal/index.ts +4 -0
  508. package/src/core/utils/portal/portal.test.tsx +103 -0
  509. package/src/core/utils/portal/portal.ts +32 -0
  510. package/src/core/utils/portal/portalContext.ts +31 -0
  511. package/src/core/utils/portal/portalProvider.tsx +47 -0
  512. package/src/core/utils/portal/types.ts +9 -0
  513. package/src/core/utils/portal/usePortal.ts +25 -0
  514. package/src/core/utils/spanWithTextOverflow.tsx +10 -0
  515. package/src/core/utils/srOnly/index.ts +1 -0
  516. package/src/core/utils/srOnly/srOnly.tsx +36 -0
  517. package/src/core/utils/virtualList/__workshop__/changingProps.tsx +36 -0
  518. package/src/core/utils/virtualList/__workshop__/elementScroll.tsx +24 -0
  519. package/src/core/utils/virtualList/__workshop__/index.ts +29 -0
  520. package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +48 -0
  521. package/src/core/utils/virtualList/__workshop__/windowScrolll.tsx +22 -0
  522. package/src/core/utils/virtualList/index.ts +1 -0
  523. package/src/core/utils/virtualList/virtualList.tsx +200 -0
  524. package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +76 -0
  525. package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +54 -0
  526. package/src/theme/build/_deprecated/color/button/createButtonModes.ts +22 -0
  527. package/src/theme/build/_deprecated/color/button/createButtonTones.ts +55 -0
  528. package/src/theme/build/_deprecated/color/card/createCardStates.ts +60 -0
  529. package/src/theme/build/_deprecated/color/color.test.ts +63 -0
  530. package/src/theme/build/_deprecated/color/defaults.ts +390 -0
  531. package/src/theme/build/_deprecated/color/factory.ts +142 -0
  532. package/src/theme/build/_deprecated/color/index.ts +1 -0
  533. package/src/theme/build/_deprecated/color/input/createInputModes.ts +81 -0
  534. package/src/theme/build/_deprecated/color/muted/createMuted.ts +54 -0
  535. package/src/theme/build/_deprecated/color/spot/createSpot.ts +20 -0
  536. package/src/theme/build/buildColorTheme.test.ts +183 -0
  537. package/src/theme/build/buildColorTheme.ts +499 -0
  538. package/src/theme/build/buildTheme.test.ts +87 -0
  539. package/src/theme/build/buildTheme.ts +36 -0
  540. package/src/theme/build/colorToken/colorToken.ts +19 -0
  541. package/src/theme/build/colorToken/compileColorToken.ts +21 -0
  542. package/src/theme/build/colorToken/index.ts +2 -0
  543. package/src/theme/build/colorToken/types.ts +6 -0
  544. package/src/theme/build/index.ts +3 -0
  545. package/src/theme/build/lib/color-fns/blend/index.ts +3 -0
  546. package/src/theme/build/lib/color-fns/blend/mix.ts +21 -0
  547. package/src/theme/build/lib/color-fns/blend/multiply.ts +18 -0
  548. package/src/theme/build/lib/color-fns/blend/screen.ts +18 -0
  549. package/src/theme/build/lib/color-fns/color-fns.test.ts +68 -0
  550. package/src/theme/build/lib/color-fns/contrastRatio.ts +31 -0
  551. package/src/theme/build/lib/color-fns/convert.ts +150 -0
  552. package/src/theme/build/lib/color-fns/index.ts +6 -0
  553. package/src/theme/build/lib/color-fns/parse.ts +60 -0
  554. package/src/theme/build/lib/color-fns/rgba.ts +10 -0
  555. package/src/theme/build/lib/color-fns/types.ts +28 -0
  556. package/src/theme/build/lib/isRecord.ts +3 -0
  557. package/src/theme/build/lib/lazy.ts +30 -0
  558. package/src/theme/build/lib/utils.ts +19 -0
  559. package/src/theme/build/merge.ts +26 -0
  560. package/src/theme/build/mixThemeColor.test.ts +21 -0
  561. package/src/theme/build/mixThemeColor.ts +53 -0
  562. package/src/theme/build/renderColorTheme.ts +532 -0
  563. package/src/theme/build/renderColorValue.ts +85 -0
  564. package/src/theme/build/resolveColorTokens.ts +268 -0
  565. package/src/theme/build/theme.test.ts +27 -0
  566. package/src/theme/config/helpers.ts +55 -0
  567. package/src/theme/config/index.ts +4 -0
  568. package/src/theme/config/system.ts +115 -0
  569. package/src/theme/config/tokens/color/index.ts +1 -0
  570. package/src/theme/config/tokens/color/types.ts +133 -0
  571. package/src/theme/config/tokens/index.ts +4 -0
  572. package/src/theme/config/tokens/parseTokenKey.test.ts +64 -0
  573. package/src/theme/config/tokens/parseTokenKey.ts +67 -0
  574. package/src/theme/config/tokens/parseTokenValue.test.ts +42 -0
  575. package/src/theme/config/tokens/parseTokenValue.ts +133 -0
  576. package/src/theme/config/tokens/types.ts +53 -0
  577. package/src/theme/config/types.ts +46 -0
  578. package/src/theme/defaults/colorPalette.ts +5 -0
  579. package/src/theme/defaults/colorTokens.ts +648 -0
  580. package/src/theme/defaults/config.ts +84 -0
  581. package/src/theme/defaults/fonts.ts +227 -0
  582. package/src/theme/getScopedTheme.ts +98 -0
  583. package/src/theme/index.ts +5 -0
  584. package/src/theme/system/avatar.ts +14 -0
  585. package/src/theme/system/color/_constants.ts +45 -0
  586. package/src/theme/system/color/_helpers.ts +24 -0
  587. package/src/theme/system/color/_system.ts +40 -0
  588. package/src/theme/system/color/avatar.ts +15 -0
  589. package/src/theme/system/color/badge.ts +16 -0
  590. package/src/theme/system/color/button.ts +17 -0
  591. package/src/theme/system/color/color.ts +34 -0
  592. package/src/theme/system/color/index.ts +13 -0
  593. package/src/theme/system/color/input.ts +25 -0
  594. package/src/theme/system/color/kbd.ts +8 -0
  595. package/src/theme/system/color/selectable.ts +12 -0
  596. package/src/theme/system/color/shadow.ts +7 -0
  597. package/src/theme/system/color/state.ts +43 -0
  598. package/src/theme/system/color/syntax.ts +41 -0
  599. package/src/theme/system/css.ts +14 -0
  600. package/src/theme/system/focusRing.ts +7 -0
  601. package/src/theme/system/font.ts +52 -0
  602. package/src/theme/system/index.ts +11 -0
  603. package/src/theme/system/input.ts +33 -0
  604. package/src/theme/system/layer.ts +8 -0
  605. package/src/theme/system/shadow.ts +19 -0
  606. package/src/theme/system/styles.ts +13 -0
  607. package/src/theme/system/theme.ts +138 -0
  608. package/src/theme/system/v0/avatar.ts +10 -0
  609. package/src/theme/system/v0/color/_generic.ts +35 -0
  610. package/src/theme/system/v0/color/_system.ts +17 -0
  611. package/src/theme/system/v0/color/base.ts +21 -0
  612. package/src/theme/system/v0/color/button.ts +42 -0
  613. package/src/theme/system/v0/color/card.ts +19 -0
  614. package/src/theme/system/v0/color/color.ts +40 -0
  615. package/src/theme/system/v0/color/index.ts +11 -0
  616. package/src/theme/system/v0/color/input.ts +34 -0
  617. package/src/theme/system/v0/color/muted.ts +26 -0
  618. package/src/theme/system/v0/color/selectable.ts +31 -0
  619. package/src/theme/system/v0/color/solid.ts +26 -0
  620. package/src/theme/system/v0/color/spot.ts +13 -0
  621. package/src/theme/system/v0/index.ts +3 -0
  622. package/src/theme/system/v0/input.ts +23 -0
  623. package/src/theme/versioning/getTheme_v2.ts +57 -0
  624. package/src/theme/versioning/index.ts +5 -0
  625. package/src/theme/versioning/is_v0.ts +6 -0
  626. package/src/theme/versioning/is_v2.ts +6 -0
  627. package/src/theme/versioning/themeColor_v0_v2.ts +243 -0
  628. package/src/theme/versioning/themeColor_v2_v2_9.ts +49 -0
  629. package/src/theme/versioning/v0_v2.ts +94 -0
  630. package/src/theme/versioning/v2_v0.ts +135 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,2044 @@
1
+ import { isHTMLElement, isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, _getArrayProp, EMPTY_ARRAY, useElementSize, Code, Box, _isEnterToClickElement, EMPTY_RECORD, Card, Text, Button, Stack, Popover, TextInput, useClickOutsideEvent, _responsive, createGlobalScopedContext, Container, Flex, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, useTheme_v2, usePrefersReducedMotion, Portal, containsOrEqualsElement, Layer, responsivePaddingStyle, responsiveRadiusStyle, Grid, LayerProvider, isRecord, _cardColorStyle, rem } from "./_chunks-es/_visual-editing.mjs";
2
+ import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Checkbox, ConditionalWrapper, ElementQuery, Heading, Hotkeys, Inline, KBD, Label, Menu, MenuDivider, MenuGroup, MenuItem, PortalProvider, Radio, Select, Spinner, SrOnly, Switch, Tab, TabList, TextArea, ThemeColorProvider, ThemeProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getResponsiveSpace, _isScrollable, createColorTheme, hexToRgb, hslToRgb, multiply, parseColor, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, screen, studioTheme, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.mjs";
3
+ import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
4
+ import { c } from "react-compiler-runtime";
5
+ import {SpinnerIcon, ChevronDownIcon, CloseIcon, ToggleArrowRightIcon} from "@bettercms-ai/icons";
6
+ import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, startTransition, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, useId } from "react";
7
+ import { styled, keyframes, css } from "styled-components";
8
+ import { getTheme_v2 } from "@bettercms-ai/kit/theme";
9
+ import { motion, AnimatePresence } from "motion/react";
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 : isHTMLAnchorElement(element) ? !!element.href && element.rel !== "ignore" : isHTMLInputElement(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : isHTMLButtonElement(element) || isHTMLSelectElement(element) || isHTMLTextAreaElement(element) ? !element.disabled : !1;
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 (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 (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
52
+ return !0;
53
+ }
54
+ return !1;
55
+ }
56
+ function useArrayProp(val, defaultVal) {
57
+ const $ = c(3);
58
+ let t0;
59
+ return $[0] !== defaultVal || $[1] !== val ? (t0 = _getArrayProp(val, defaultVal), $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2], t0;
60
+ }
61
+ function _getElements(element, elementsArg) {
62
+ const ret = [element];
63
+ for (const el of elementsArg)
64
+ Array.isArray(el) ? ret.push(...el) : ret.push(el);
65
+ return ret.filter(Boolean);
66
+ }
67
+ function useClickOutside(listener, t0, boundaryElement) {
68
+ const $ = c(12), elementsArg = t0 === void 0 ? EMPTY_ARRAY : t0, [element, setElement] = useState(null);
69
+ let t1;
70
+ $[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
71
+ const [elements, setElements] = useState(t1), elementsRef = useRef(elements);
72
+ let t2, t3;
73
+ $[3] !== element || $[4] !== elementsArg ? (t2 = () => {
74
+ const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
75
+ if (prevElements.length !== nextElements.length) {
76
+ setElements(nextElements), elementsRef.current = nextElements;
77
+ return;
78
+ }
79
+ for (const el of prevElements)
80
+ if (!nextElements.includes(el)) {
81
+ setElements(nextElements), elementsRef.current = nextElements;
82
+ return;
83
+ }
84
+ for (const el_0 of nextElements)
85
+ if (!prevElements.includes(el_0)) {
86
+ setElements(nextElements), elementsRef.current = nextElements;
87
+ return;
88
+ }
89
+ }, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), useEffect(t2, t3);
90
+ let t4, t5;
91
+ return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
92
+ if (!listener)
93
+ return;
94
+ const handleWindowMouseDown = (evt) => {
95
+ const target = evt.target;
96
+ if (target instanceof Node && !(boundaryElement && !boundaryElement.contains(target))) {
97
+ for (const el_1 of elements)
98
+ if (target === el_1 || el_1.contains(target))
99
+ return;
100
+ listener(evt);
101
+ }
102
+ };
103
+ return window.addEventListener("mousedown", handleWindowMouseDown), () => {
104
+ window.removeEventListener("mousedown", handleWindowMouseDown);
105
+ };
106
+ }, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
107
+ }
108
+ function useElementRect(element) {
109
+ return useElementSize(element)?._contentRect || null;
110
+ }
111
+ function useForwardedRef(ref) {
112
+ const $ = c(1), innerRef = useRef(null);
113
+ let t0;
114
+ return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], useImperativeHandle(ref, t0), innerRef;
115
+ }
116
+ class ErrorBoundary extends Component {
117
+ state = {
118
+ error: null
119
+ };
120
+ static getDerivedStateFromError(error) {
121
+ return {
122
+ error
123
+ };
124
+ }
125
+ componentDidCatch(error, info) {
126
+ this.props.onCatch({
127
+ error,
128
+ info
129
+ });
130
+ }
131
+ render() {
132
+ const {
133
+ error
134
+ } = this.state;
135
+ if (error) {
136
+ const message = typeof error?.message == "string" ? error.message : "Error";
137
+ return /* @__PURE__ */ jsx(Code, { children: message });
138
+ }
139
+ return this.props.children;
140
+ }
141
+ }
142
+ const StyledAutocomplete = styled.div.withConfig({
143
+ displayName: "StyledAutocomplete",
144
+ componentId: "sc-1igauft-0"
145
+ })`line-height:0;`, ListBox = styled(Box).withConfig({
146
+ displayName: "ListBox",
147
+ componentId: "sc-1igauft-1"
148
+ })`& > ul{list-style:none;padding:0;margin:0;}`, rotate = keyframes`
149
+ from {
150
+ transform: rotate(0deg);
151
+ }
152
+
153
+ to {
154
+ transform: rotate(360deg);
155
+ }
156
+ `, AnimatedSpinnerIcon = styled(SpinnerIcon).withConfig({
157
+ displayName: "AnimatedSpinnerIcon",
158
+ componentId: "sc-1igauft-2"
159
+ })`animation:${rotate} 500ms linear infinite;`;
160
+ function AutocompleteOption(props) {
161
+ const $ = c(11), {
162
+ children,
163
+ id,
164
+ onSelect,
165
+ selected,
166
+ value
167
+ } = props;
168
+ let t0;
169
+ $[0] !== onSelect || $[1] !== value ? (t0 = () => {
170
+ setTimeout(() => {
171
+ onSelect(value);
172
+ }, 0);
173
+ }, $[0] = onSelect, $[1] = value, $[2] = t0) : t0 = $[2];
174
+ const handleClick = t0;
175
+ let t1;
176
+ $[3] !== handleClick ? (t1 = (event) => {
177
+ event.key === "Enter" && !_isEnterToClickElement(event.currentTarget) && handleClick();
178
+ }, $[3] = handleClick, $[4] = t1) : t1 = $[4];
179
+ const handleKeyDown = t1;
180
+ let t2;
181
+ return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsx("li", { "aria-selected": selected, "data-ui": "AutocompleteOption", id, role: "option", onClick: handleClick, onKeyDown: handleKeyDown, children }), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
182
+ }
183
+ function autocompleteReducer(state, msg) {
184
+ return msg.type === "input/change" ? {
185
+ ...state,
186
+ activeValue: null,
187
+ focused: !0,
188
+ query: msg.query
189
+ } : msg.type === "input/focus" ? {
190
+ ...state,
191
+ focused: !0
192
+ } : msg.type === "root/blur" ? {
193
+ ...state,
194
+ focused: !1,
195
+ query: null
196
+ } : msg.type === "root/clear" ? {
197
+ ...state,
198
+ activeValue: null,
199
+ query: null,
200
+ value: null
201
+ } : msg.type === "root/escape" ? {
202
+ ...state,
203
+ focused: !1,
204
+ query: null
205
+ } : msg.type === "root/open" ? {
206
+ ...state,
207
+ query: state.query || msg.query
208
+ } : msg.type === "root/setActiveValue" ? {
209
+ ...state,
210
+ activeValue: msg.value,
211
+ listFocused: msg.listFocused || state.listFocused
212
+ } : msg.type === "root/setListFocused" ? {
213
+ ...state,
214
+ listFocused: msg.listFocused
215
+ } : msg.type === "value/change" ? {
216
+ ...state,
217
+ activeValue: msg.value,
218
+ query: null,
219
+ value: msg.value
220
+ } : state;
221
+ }
222
+ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1, InnerAutocomplete = forwardRef(function(props, forwardedRef) {
223
+ const $ = c(181);
224
+ let customValidity, disabled, filterOptionProp, icon, id, loading, onBlur, onChange, onFocus, onQueryChange, onSelect, openButton, openOnFocus, optionsProp, prefix, readOnly, relatedElements, renderOptionProp, renderPopover, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, valueProp;
225
+ $[0] !== props ? ({
226
+ border: t0,
227
+ customValidity,
228
+ disabled,
229
+ filterOption: filterOptionProp,
230
+ fontSize: t1,
231
+ icon,
232
+ id,
233
+ listBox: t2,
234
+ loading,
235
+ onBlur,
236
+ onChange,
237
+ onFocus,
238
+ onQueryChange,
239
+ onSelect,
240
+ openButton,
241
+ openOnFocus,
242
+ options: optionsProp,
243
+ padding: t3,
244
+ popover: t4,
245
+ prefix,
246
+ radius: t5,
247
+ readOnly,
248
+ relatedElements,
249
+ renderOption: renderOptionProp,
250
+ renderPopover,
251
+ renderValue: t6,
252
+ suffix,
253
+ value: valueProp,
254
+ ...restProps
255
+ } = props, $[0] = props, $[1] = customValidity, $[2] = disabled, $[3] = filterOptionProp, $[4] = icon, $[5] = id, $[6] = loading, $[7] = onBlur, $[8] = onChange, $[9] = onFocus, $[10] = onQueryChange, $[11] = onSelect, $[12] = openButton, $[13] = openOnFocus, $[14] = optionsProp, $[15] = prefix, $[16] = readOnly, $[17] = relatedElements, $[18] = renderOptionProp, $[19] = renderPopover, $[20] = restProps, $[21] = suffix, $[22] = t0, $[23] = t1, $[24] = t2, $[25] = t3, $[26] = t4, $[27] = t5, $[28] = t6, $[29] = valueProp) : (customValidity = $[1], disabled = $[2], filterOptionProp = $[3], icon = $[4], id = $[5], loading = $[6], onBlur = $[7], onChange = $[8], onFocus = $[9], onQueryChange = $[10], onSelect = $[11], openButton = $[12], openOnFocus = $[13], optionsProp = $[14], prefix = $[15], readOnly = $[16], relatedElements = $[17], renderOptionProp = $[18], renderPopover = $[19], restProps = $[20], suffix = $[21], t0 = $[22], t1 = $[23], t2 = $[24], t3 = $[25], t4 = $[26], t5 = $[27], t6 = $[28], valueProp = $[29]);
256
+ const border = t0 === void 0 ? !0 : t0, fontSize = t1 === void 0 ? 2 : t1, listBox = t2 === void 0 ? EMPTY_RECORD : t2, paddingProp = t3 === void 0 ? 3 : t3, popover = t4 === void 0 ? EMPTY_RECORD : t4, radius = t5 === void 0 ? 2 : t5, renderValue = t6 === void 0 ? DEFAULT_RENDER_VALUE : t6, t7 = valueProp || null, t8 = valueProp || null;
257
+ let t9;
258
+ $[30] !== t7 || $[31] !== t8 ? (t9 = {
259
+ activeValue: t7,
260
+ focused: !1,
261
+ listFocused: !1,
262
+ query: null,
263
+ value: t8
264
+ }, $[30] = t7, $[31] = t8, $[32] = t9) : t9 = $[32];
265
+ const [state, dispatch] = useReducer(autocompleteReducer, t9), {
266
+ activeValue,
267
+ focused,
268
+ listFocused,
269
+ query,
270
+ value
271
+ } = state;
272
+ let t10;
273
+ $[33] !== fontSize || $[34] !== paddingProp ? (t10 = (t112) => {
274
+ const {
275
+ value: value_0
276
+ } = t112;
277
+ return /* @__PURE__ */ jsx(Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) });
278
+ }, $[33] = fontSize, $[34] = paddingProp, $[35] = t10) : t10 = $[35];
279
+ const renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t10, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), [inputElement, _setInputElement] = useState(null);
280
+ let t11;
281
+ $[36] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (node) => {
282
+ startTransition(() => _setInputElement(node));
283
+ }, $[36] = t11) : t11 = $[36];
284
+ const setInputElement = t11, listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
285
+ let t12, t13;
286
+ $[37] !== inputElement ? (t12 = () => inputElement, t13 = [inputElement], $[37] = inputElement, $[38] = t12, $[39] = t13) : (t12 = $[38], t13 = $[39]), useImperativeHandle(inputElementRef, t12, t13);
287
+ let t14, t15;
288
+ $[40] !== inputElement ? (t14 = () => inputElement, t15 = [inputElement], $[40] = inputElement, $[41] = t14, $[42] = t15) : (t14 = $[41], t15 = $[42]), useImperativeHandle(forwardedRef, t14, t15);
289
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = _getArrayProp(paddingProp);
290
+ let t16;
291
+ $[43] !== options || $[44] !== value ? (t16 = value !== null ? options.find((o) => o.value === value) : void 0, $[43] = options, $[44] = value, $[45] = t16) : t16 = $[45];
292
+ const currentOption = t16;
293
+ let t17;
294
+ if ($[46] !== filterOption || $[47] !== options || $[48] !== query) {
295
+ let t182;
296
+ $[50] !== filterOption || $[51] !== query ? (t182 = (option) => query ? filterOption(query, option) : !0, $[50] = filterOption, $[51] = query, $[52] = t182) : t182 = $[52], t17 = options.filter(t182), $[46] = filterOption, $[47] = options, $[48] = query, $[49] = t17;
297
+ } else
298
+ t17 = $[49];
299
+ const filteredOptions = t17, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null;
300
+ let t18;
301
+ $[53] !== onBlur || $[54] !== onQueryChange || $[55] !== relatedElements ? (t18 = (event) => {
302
+ setTimeout(() => {
303
+ if (popoverMouseWithinRef.current)
304
+ return;
305
+ const elements = (relatedElements || []).concat(rootElementRef.current ? [rootElementRef.current] : [], resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : []);
306
+ let focusInside = !1;
307
+ if (document.activeElement) {
308
+ for (const e of elements)
309
+ if (e === document.activeElement || e.contains(document.activeElement)) {
310
+ focusInside = !0;
311
+ break;
312
+ }
313
+ }
314
+ focusInside === !1 && (dispatch({
315
+ type: "root/blur"
316
+ }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
317
+ }, 0);
318
+ }, $[53] = onBlur, $[54] = onQueryChange, $[55] = relatedElements, $[56] = t18) : t18 = $[56];
319
+ const handleRootBlur = t18;
320
+ let t19;
321
+ $[57] === Symbol.for("react.memo_cache_sentinel") ? (t19 = (event_0) => {
322
+ const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
323
+ listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
324
+ type: "root/setListFocused",
325
+ listFocused: listFocused_0
326
+ }));
327
+ }, $[57] = t19) : t19 = $[57];
328
+ const handleRootFocus = t19;
329
+ let t20;
330
+ $[58] !== onChange || $[59] !== onQueryChange || $[60] !== onSelect ? (t20 = (v) => {
331
+ dispatch({
332
+ type: "value/change",
333
+ value: v
334
+ }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
335
+ }, $[58] = onChange, $[59] = onQueryChange, $[60] = onSelect, $[61] = t20) : t20 = $[61];
336
+ const handleOptionSelect = t20;
337
+ let t21;
338
+ $[62] !== activeValue || $[63] !== filteredOptions || $[64] !== filteredOptionsLen || $[65] !== onQueryChange ? (t21 = (event_1) => {
339
+ if (event_1.key === "ArrowDown") {
340
+ if (event_1.preventDefault(), !filteredOptionsLen)
341
+ return;
342
+ const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
343
+ nextActiveOption && dispatch({
344
+ type: "root/setActiveValue",
345
+ value: nextActiveOption.value,
346
+ listFocused: !0
347
+ });
348
+ return;
349
+ }
350
+ if (event_1.key === "ArrowUp") {
351
+ if (event_1.preventDefault(), !filteredOptionsLen)
352
+ return;
353
+ 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];
354
+ nextActiveOption_0 && dispatch({
355
+ type: "root/setActiveValue",
356
+ value: nextActiveOption_0.value,
357
+ listFocused: !0
358
+ });
359
+ return;
360
+ }
361
+ if (event_1.key === "Escape") {
362
+ dispatch({
363
+ type: "root/escape"
364
+ }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
365
+ return;
366
+ }
367
+ const target = event_1.target, listEl = listBoxElementRef.current;
368
+ if ((listEl === target || listEl?.contains(target)) && !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)) {
369
+ inputElementRef.current?.focus();
370
+ return;
371
+ }
372
+ }, $[62] = activeValue, $[63] = filteredOptions, $[64] = filteredOptionsLen, $[65] = onQueryChange, $[66] = t21) : t21 = $[66];
373
+ const handleRootKeyDown = t21;
374
+ let t22;
375
+ $[67] !== onQueryChange ? (t22 = (event_2) => {
376
+ const nextQuery = event_2.currentTarget.value;
377
+ dispatch({
378
+ type: "input/change",
379
+ query: nextQuery
380
+ }), onQueryChange && onQueryChange(nextQuery);
381
+ }, $[67] = onQueryChange, $[68] = t22) : t22 = $[68];
382
+ const handleInputChange = t22;
383
+ let t23;
384
+ $[69] !== currentOption || $[70] !== renderValue || $[71] !== value ? (t23 = () => {
385
+ dispatch({
386
+ type: "root/open",
387
+ query: value ? renderValue(value, currentOption) : ""
388
+ });
389
+ }, $[69] = currentOption, $[70] = renderValue, $[71] = value, $[72] = t23) : t23 = $[72];
390
+ const dispatchOpen = t23;
391
+ let t24;
392
+ $[73] !== dispatchOpen || $[74] !== focused || $[75] !== onFocus || $[76] !== openOnFocus ? (t24 = (event_3) => {
393
+ focused || (dispatch({
394
+ type: "input/focus"
395
+ }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
396
+ }, $[73] = dispatchOpen, $[74] = focused, $[75] = onFocus, $[76] = openOnFocus, $[77] = t24) : t24 = $[77];
397
+ const handleInputFocus = t24;
398
+ let t25;
399
+ $[78] === Symbol.for("react.memo_cache_sentinel") ? (t25 = () => {
400
+ popoverMouseWithinRef.current = !0;
401
+ }, $[78] = t25) : t25 = $[78];
402
+ const handlePopoverMouseEnter = t25;
403
+ let t26;
404
+ $[79] === Symbol.for("react.memo_cache_sentinel") ? (t26 = () => {
405
+ popoverMouseWithinRef.current = !1;
406
+ }, $[79] = t26) : t26 = $[79];
407
+ const handlePopoverMouseLeave = t26;
408
+ let t27;
409
+ $[80] !== onChange || $[81] !== onQueryChange ? (t27 = () => {
410
+ dispatch({
411
+ type: "root/clear"
412
+ }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
413
+ }, $[80] = onChange, $[81] = onQueryChange, $[82] = t27) : t27 = $[82];
414
+ const handleClearButtonClick = t27;
415
+ let t28;
416
+ $[83] === Symbol.for("react.memo_cache_sentinel") ? (t28 = () => {
417
+ dispatch({
418
+ type: "input/focus"
419
+ });
420
+ }, $[83] = t28) : t28 = $[83];
421
+ const handleClearButtonFocus = t28;
422
+ let t29, t30;
423
+ $[84] !== valueProp ? (t29 = () => {
424
+ if (valueProp !== valuePropRef.current) {
425
+ valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
426
+ type: "value/change",
427
+ value: valueProp
428
+ }), valueRef.current = valueProp);
429
+ return;
430
+ }
431
+ valueProp !== valueRef.current && (valueRef.current = valueProp || null, dispatch({
432
+ type: "value/change",
433
+ value: valueProp || null
434
+ }));
435
+ }, t30 = [valueProp], $[84] = valueProp, $[85] = t29, $[86] = t30) : (t29 = $[85], t30 = $[86]), useEffect(t29, t30);
436
+ let t31, t32;
437
+ $[87] !== focused ? (t31 = () => {
438
+ !focused && valueRef.current && dispatch({
439
+ type: "root/setActiveValue",
440
+ value: valueRef.current
441
+ });
442
+ }, t32 = [focused], $[87] = focused, $[88] = t31, $[89] = t32) : (t31 = $[88], t32 = $[89]), useEffect(t31, t32);
443
+ let t33, t34;
444
+ $[90] !== activeValue || $[91] !== filteredOptions ? (t33 = () => {
445
+ const listElement = listBoxElementRef.current;
446
+ if (!listElement)
447
+ return;
448
+ const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
449
+ if (activeOption_1) {
450
+ const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
451
+ if (activeItemElement) {
452
+ if (_hasFocus(activeItemElement))
453
+ return;
454
+ focusFirstDescendant(activeItemElement);
455
+ }
456
+ }
457
+ }, t34 = [activeValue, filteredOptions], $[90] = activeValue, $[91] = filteredOptions, $[92] = t33, $[93] = t34) : (t33 = $[92], t34 = $[93]), useEffect(t33, t34);
458
+ let t35;
459
+ bb0: {
460
+ if (!loading && !disabled && value) {
461
+ let t362;
462
+ $[94] === Symbol.for("react.memo_cache_sentinel") ? (t362 = {
463
+ "aria-label": "Clear",
464
+ onFocus: handleClearButtonFocus
465
+ }, $[94] = t362) : t362 = $[94], t35 = t362;
466
+ break bb0;
467
+ }
468
+ t35 = void 0;
469
+ }
470
+ const clearButton = t35, openButtonBoxPadding = padding.map(_temp$3), openButtonPadding = padding.map(_temp2$1), openButtonProps = typeof openButton == "object" ? openButton : EMPTY_RECORD;
471
+ let t36;
472
+ $[95] !== dispatchOpen || $[96] !== openButtonProps ? (t36 = (event_4) => {
473
+ dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
474
+ }, $[95] = dispatchOpen, $[96] = openButtonProps, $[97] = t36) : t36 = $[97];
475
+ const handleOpenClick = t36;
476
+ let t37;
477
+ $[98] !== disabled || $[99] !== expanded || $[100] !== fontSize || $[101] !== handleOpenClick || $[102] !== openButton || $[103] !== openButtonBoxPadding || $[104] !== openButtonPadding || $[105] !== openButtonProps || $[106] !== readOnly ? (t37 = !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, fontSize, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, $[98] = disabled, $[99] = expanded, $[100] = fontSize, $[101] = handleOpenClick, $[102] = openButton, $[103] = openButtonBoxPadding, $[104] = openButtonPadding, $[105] = openButtonProps, $[106] = readOnly, $[107] = t37) : t37 = $[107];
478
+ const openButtonNode = t37;
479
+ let t38;
480
+ bb1: {
481
+ if (query === null) {
482
+ if (value !== null) {
483
+ let t392;
484
+ $[108] !== currentOption || $[109] !== renderValue || $[110] !== value ? (t392 = renderValue(value, currentOption), $[108] = currentOption, $[109] = renderValue, $[110] = value, $[111] = t392) : t392 = $[111], t38 = t392;
485
+ break bb1;
486
+ }
487
+ t38 = "";
488
+ break bb1;
489
+ }
490
+ t38 = query;
491
+ }
492
+ const inputValue = t38;
493
+ let t39;
494
+ $[112] !== listFocused ? (t39 = (event_5) => {
495
+ event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
496
+ }, $[112] = listFocused, $[113] = t39) : t39 = $[113];
497
+ const handleListBoxKeyDown = t39;
498
+ let t40;
499
+ bb2: {
500
+ if (filteredOptions.length === 0) {
501
+ t40 = null;
502
+ break bb2;
503
+ }
504
+ let t412;
505
+ if ($[114] !== activeValue || $[115] !== currentOption || $[116] !== filteredOptions || $[117] !== handleOptionSelect || $[118] !== id || $[119] !== listFocused || $[120] !== loading || $[121] !== renderOption) {
506
+ let t423;
507
+ $[123] !== activeValue || $[124] !== currentOption || $[125] !== handleOptionSelect || $[126] !== id || $[127] !== listFocused || $[128] !== loading || $[129] !== renderOption ? (t423 = (option_0) => {
508
+ const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
509
+ return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
510
+ disabled: loading,
511
+ selected: active,
512
+ tabIndex: listFocused && active ? 0 : -1
513
+ }) }, option_0.value);
514
+ }, $[123] = activeValue, $[124] = currentOption, $[125] = handleOptionSelect, $[126] = id, $[127] = listFocused, $[128] = loading, $[129] = renderOption, $[130] = t423) : t423 = $[130], t412 = filteredOptions.map(t423), $[114] = activeValue, $[115] = currentOption, $[116] = filteredOptions, $[117] = handleOptionSelect, $[118] = id, $[119] = listFocused, $[120] = loading, $[121] = renderOption, $[122] = t412;
515
+ } else
516
+ t412 = $[122];
517
+ let t422;
518
+ $[131] !== listBoxId || $[132] !== t412 ? (t422 = /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: t412 }), $[131] = listBoxId, $[132] = t412, $[133] = t422) : t422 = $[133];
519
+ let t432;
520
+ $[134] !== handleListBoxKeyDown || $[135] !== listBox || $[136] !== t422 ? (t432 = /* @__PURE__ */ jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: t422 }), $[134] = handleListBoxKeyDown, $[135] = listBox, $[136] = t422, $[137] = t432) : t432 = $[137], t40 = t432;
521
+ }
522
+ const content2 = t40;
523
+ let t41;
524
+ bb3: {
525
+ if (renderPopover) {
526
+ const t423 = !expanded;
527
+ let t432;
528
+ $[138] !== content2 || $[139] !== handlePopoverMouseEnter || $[140] !== handlePopoverMouseLeave || $[141] !== inputElement || $[142] !== renderPopover || $[143] !== t423 ? (t432 = /* @__PURE__ */ jsx(RenderPopover, { content: content2, hidden: t423, inputElement, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, resultsPopoverElementRef, renderPopover }), $[138] = content2, $[139] = handlePopoverMouseEnter, $[140] = handlePopoverMouseLeave, $[141] = inputElement, $[142] = renderPopover, $[143] = t423, $[144] = t432) : t432 = $[144], t41 = t432;
529
+ break bb3;
530
+ }
531
+ if (filteredOptionsLen === 0) {
532
+ t41 = null;
533
+ break bb3;
534
+ }
535
+ let t422;
536
+ $[145] !== content2 || $[146] !== expanded || $[147] !== handlePopoverMouseEnter || $[148] !== handlePopoverMouseLeave || $[149] !== inputElement || $[150] !== popover || $[151] !== radius ? (t422 = /* @__PURE__ */ jsx(Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius, ref: resultsPopoverElementRef, referenceElement: inputElement, ...popover }), $[145] = content2, $[146] = expanded, $[147] = handlePopoverMouseEnter, $[148] = handlePopoverMouseLeave, $[149] = inputElement, $[150] = popover, $[151] = radius, $[152] = t422) : t422 = $[152], t41 = t422;
537
+ }
538
+ const results = t41, t42 = loading && AnimatedSpinnerIcon, t43 = suffix || openButtonNode;
539
+ let t44;
540
+ $[153] !== activeItemId || $[154] !== border || $[155] !== clearButton || $[156] !== customValidity || $[157] !== disabled || $[158] !== expanded || $[159] !== fontSize || $[160] !== handleClearButtonClick || $[161] !== handleInputChange || $[162] !== handleInputFocus || $[163] !== icon || $[164] !== id || $[165] !== inputValue || $[166] !== listBoxId || $[167] !== padding || $[168] !== prefix || $[169] !== radius || $[170] !== readOnly || $[171] !== restProps || $[172] !== t42 || $[173] !== t43 ? (t44 = /* @__PURE__ */ jsx(TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: t42, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: t43, value: inputValue }), $[153] = activeItemId, $[154] = border, $[155] = clearButton, $[156] = customValidity, $[157] = disabled, $[158] = expanded, $[159] = fontSize, $[160] = handleClearButtonClick, $[161] = handleInputChange, $[162] = handleInputFocus, $[163] = icon, $[164] = id, $[165] = inputValue, $[166] = listBoxId, $[167] = padding, $[168] = prefix, $[169] = radius, $[170] = readOnly, $[171] = restProps, $[172] = t42, $[173] = t43, $[174] = t44) : t44 = $[174];
541
+ let t45;
542
+ return $[175] !== handleRootBlur || $[176] !== handleRootFocus || $[177] !== handleRootKeyDown || $[178] !== results || $[179] !== t44 ? (t45 = /* @__PURE__ */ jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
543
+ t44,
544
+ results
545
+ ] }), $[175] = handleRootBlur, $[176] = handleRootFocus, $[177] = handleRootKeyDown, $[178] = results, $[179] = t44, $[180] = t45) : t45 = $[180], t45;
546
+ });
547
+ function RenderPopover({
548
+ renderPopover,
549
+ content: content2,
550
+ hidden,
551
+ inputElement,
552
+ onMouseEnter,
553
+ onMouseLeave,
554
+ resultsPopoverElementRef
555
+ }) {
556
+ return renderPopover({
557
+ content: content2,
558
+ hidden,
559
+ inputElement,
560
+ onMouseEnter,
561
+ onMouseLeave
562
+ }, resultsPopoverElementRef);
563
+ }
564
+ InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
565
+ const Autocomplete = InnerAutocomplete;
566
+ function _temp$3(v_0) {
567
+ return v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2;
568
+ }
569
+ function _temp2$1(v_1) {
570
+ return Math.max(v_1 - 1, 0);
571
+ }
572
+ const StyledBreadcrumbs = styled.ol.withConfig({
573
+ displayName: "StyledBreadcrumbs",
574
+ componentId: "sc-1es8h8q-0"
575
+ })`margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;`, ExpandButton = styled(Button).withConfig({
576
+ displayName: "ExpandButton",
577
+ componentId: "sc-1es8h8q-1"
578
+ })`appearance:none;margin:-4px;`, Breadcrumbs = forwardRef(function(props, ref) {
579
+ const $ = c(30);
580
+ let children, gap, maxLength, restProps, separator, t0;
581
+ $[0] !== props ? ({
582
+ children,
583
+ gap,
584
+ maxLength,
585
+ separator,
586
+ space: t0,
587
+ ...restProps
588
+ } = props, $[0] = props, $[1] = children, $[2] = gap, $[3] = maxLength, $[4] = restProps, $[5] = separator, $[6] = t0) : (children = $[1], gap = $[2], maxLength = $[3], restProps = $[4], separator = $[5], t0 = $[6]);
589
+ const t1 = gap === void 0 ? t0 === void 0 ? 2 : t0 : gap;
590
+ let t2;
591
+ $[7] !== t1 ? (t2 = _getArrayProp(t1), $[7] = t1, $[8] = t2) : t2 = $[8];
592
+ const space = t2, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null);
593
+ let t3;
594
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => setOpen(!1), $[9] = t3) : t3 = $[9];
595
+ const collapse = t3;
596
+ let t4;
597
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => setOpen(!0), $[10] = t4) : t4 = $[10];
598
+ const expand = t4;
599
+ let t5;
600
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => [expandElementRef.current, popoverElementRef.current], $[11] = t5) : t5 = $[11], useClickOutsideEvent(collapse, t5);
601
+ let t6;
602
+ $[12] !== children ? (t6 = Children.toArray(children).filter(isValidElement), $[12] = children, $[13] = t6) : t6 = $[13];
603
+ const rawItems = t6;
604
+ let t7;
605
+ $[14] !== maxLength || $[15] !== open || $[16] !== rawItems || $[17] !== space ? (t7 = {
606
+ collapse,
607
+ expand,
608
+ expandElementRef,
609
+ maxLength,
610
+ open,
611
+ popoverElementRef,
612
+ rawItems,
613
+ space
614
+ }, $[14] = maxLength, $[15] = open, $[16] = rawItems, $[17] = space, $[18] = t7) : t7 = $[18];
615
+ const items = useItems(t7);
616
+ let t8;
617
+ if ($[19] !== items || $[20] !== separator || $[21] !== space) {
618
+ let t92;
619
+ $[23] !== separator || $[24] !== space ? (t92 = (item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
620
+ itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
621
+ /* @__PURE__ */ jsx(Box, { as: "li", children: item })
622
+ ] }, itemIndex), $[23] = separator, $[24] = space, $[25] = t92) : t92 = $[25], t8 = items.map(t92), $[19] = items, $[20] = separator, $[21] = space, $[22] = t8;
623
+ } else
624
+ t8 = $[22];
625
+ let t9;
626
+ return $[26] !== ref || $[27] !== restProps || $[28] !== t8 ? (t9 = /* @__PURE__ */ jsx(StyledBreadcrumbs, { "data-ui": "Breadcrumbs", ...restProps, ref, children: t8 }), $[26] = ref, $[27] = restProps, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
627
+ });
628
+ Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
629
+ function useItems(t0) {
630
+ const $ = c(28), {
631
+ collapse,
632
+ expand,
633
+ expandElementRef,
634
+ maxLength,
635
+ open,
636
+ popoverElementRef,
637
+ rawItems,
638
+ space
639
+ } = t0, len = rawItems.length;
640
+ if (maxLength && len > maxLength) {
641
+ const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
642
+ let t1;
643
+ if ($[0] !== afterLength || $[1] !== beforeLength || $[2] !== collapse || $[3] !== expand || $[4] !== expandElementRef || $[5] !== len || $[6] !== open || $[7] !== popoverElementRef || $[8] !== rawItems || $[9] !== space) {
644
+ const t2 = rawItems.slice(0, beforeLength - 1);
645
+ let t3;
646
+ $[11] !== afterLength || $[12] !== beforeLength || $[13] !== len || $[14] !== rawItems ? (t3 = rawItems.slice(beforeLength - 1, len - afterLength), $[11] = afterLength, $[12] = beforeLength, $[13] = len, $[14] = rawItems, $[15] = t3) : t3 = $[15];
647
+ let t4;
648
+ $[16] !== space || $[17] !== t3 ? (t4 = /* @__PURE__ */ jsx(Stack, { as: "ol", overflow: "auto", padding: space, gap: space, children: t3 }), $[16] = space, $[17] = t3, $[18] = t4) : t4 = $[18];
649
+ const t5 = open ? collapse : expand;
650
+ let t6;
651
+ $[19] !== expandElementRef || $[20] !== open || $[21] !== t5 ? (t6 = /* @__PURE__ */ jsx(ExpandButton, { fontSize: 1, mode: "bleed", onClick: t5, padding: 1, ref: expandElementRef, selected: open, text: "\u2026" }), $[19] = expandElementRef, $[20] = open, $[21] = t5, $[22] = t6) : t6 = $[22];
652
+ let t7;
653
+ $[23] !== open || $[24] !== popoverElementRef || $[25] !== t4 || $[26] !== t6 ? (t7 = /* @__PURE__ */ jsx(Popover, { constrainSize: !0, content: t4, open, placement: "top", portal: !0, ref: popoverElementRef, children: t6 }, "button"), $[23] = open, $[24] = popoverElementRef, $[25] = t4, $[26] = t6, $[27] = t7) : t7 = $[27], t1 = [...t2, t7, ...rawItems.slice(len - afterLength)], $[0] = afterLength, $[1] = beforeLength, $[2] = collapse, $[3] = expand, $[4] = expandElementRef, $[5] = len, $[6] = open, $[7] = popoverElementRef, $[8] = rawItems, $[9] = space, $[10] = t1;
654
+ } else
655
+ t1 = $[10];
656
+ return t1;
657
+ }
658
+ return rawItems;
659
+ }
660
+ function dialogStyle({
661
+ theme
662
+ }) {
663
+ const {
664
+ color
665
+ } = getTheme_v2(theme);
666
+ return {
667
+ "&:not([hidden])": {
668
+ display: "flex"
669
+ },
670
+ top: 0,
671
+ left: 0,
672
+ right: 0,
673
+ bottom: 0,
674
+ alignItems: "center",
675
+ justifyContent: "center",
676
+ outline: "none",
677
+ background: color.backdrop
678
+ };
679
+ }
680
+ function responsiveDialogPositionStyle(props) {
681
+ const {
682
+ media
683
+ } = getTheme_v2(props.theme);
684
+ return _responsive(media, props.$position, (position) => ({
685
+ "&&": {
686
+ position
687
+ }
688
+ }));
689
+ }
690
+ function animationDialogStyle(props) {
691
+ return props.$animate ? css`
692
+ @keyframes zoomIn {
693
+ from {
694
+ opacity: 0;
695
+ transform: scale(0.95);
696
+ }
697
+ to {
698
+ opacity: 1;
699
+ transform: scale(1);
700
+ }
701
+ }
702
+ @keyframes fadeIn {
703
+ from {
704
+ opacity: 0;
705
+ }
706
+ to {
707
+ opacity: 1;
708
+ }
709
+ }
710
+
711
+ animation: fadeIn 200ms ease-out;
712
+ // Animates the dialog card.
713
+ & > [data-ui='DialogCard'] {
714
+ animation: zoomIn 200ms ease-out;
715
+ }
716
+ ` : css``;
717
+ }
718
+ const DialogContext = createGlobalScopedContext("@bettercms-ai/kit/context/dialog", {
719
+ version: 0
720
+ });
721
+ function useDialog() {
722
+ return useContext(DialogContext);
723
+ }
724
+ function isTargetWithinScope(boundaryElement, portalElement, target) {
725
+ return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
726
+ }
727
+ const StyledDialog = /* @__PURE__ */ styled(Layer).withConfig({
728
+ displayName: "StyledDialog",
729
+ componentId: "sc-4n4xb3-0"
730
+ })(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle, animationDialogStyle), DialogContainer = styled(Container).withConfig({
731
+ displayName: "DialogContainer",
732
+ componentId: "sc-4n4xb3-1"
733
+ })`&:not([hidden]){display:flex;}width:100%;height:100%;flex-direction:column;align-items:center;justify-content:center;`, DialogCardRoot = styled(Card).withConfig({
734
+ displayName: "DialogCardRoot",
735
+ componentId: "sc-4n4xb3-2"
736
+ })`&:not([hidden]){display:flex;}width:100%;min-height:0;max-height:100%;overflow:hidden;overflow:clip;`, DialogLayout = styled(Flex).withConfig({
737
+ displayName: "DialogLayout",
738
+ componentId: "sc-4n4xb3-3"
739
+ })`flex:1;min-height:0;width:100%;`, DialogHeader = styled(Box).withConfig({
740
+ displayName: "DialogHeader",
741
+ componentId: "sc-4n4xb3-4"
742
+ })`position:relative;z-index:2;`, DialogContent = styled(Box).withConfig({
743
+ displayName: "DialogContent",
744
+ componentId: "sc-4n4xb3-5"
745
+ })`position:relative;z-index:1;overflow:auto;outline:none;`, DialogFooter = styled(Box).withConfig({
746
+ displayName: "DialogFooter",
747
+ componentId: "sc-4n4xb3-6"
748
+ })`position:relative;z-index:3;`, DialogCard = forwardRef(function(props, forwardedRef) {
749
+ const $ = c(44), {
750
+ __unstable_autoFocus: autoFocus,
751
+ __unstable_hideCloseButton: hideCloseButton,
752
+ children,
753
+ contentRef: forwardedContentRef,
754
+ footer,
755
+ header,
756
+ id,
757
+ onClickOutside,
758
+ onClose,
759
+ portal: portalProp,
760
+ radius: radiusProp,
761
+ scheme,
762
+ shadow: shadowProp,
763
+ width: widthProp
764
+ } = props, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element;
765
+ let t0;
766
+ $[0] !== radiusProp ? (t0 = _getArrayProp(radiusProp), $[0] = radiusProp, $[1] = t0) : t0 = $[1];
767
+ const radius = t0;
768
+ let t1;
769
+ $[2] !== shadowProp ? (t1 = _getArrayProp(shadowProp), $[2] = shadowProp, $[3] = t1) : t1 = $[3];
770
+ const shadow = t1;
771
+ let t2;
772
+ $[4] !== widthProp ? (t2 = _getArrayProp(widthProp), $[4] = widthProp, $[5] = t2) : t2 = $[5];
773
+ const width = t2, ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
774
+ isTopLayer
775
+ } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
776
+ let t3;
777
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => ref.current, $[6] = t3) : t3 = $[6], useImperativeHandle(forwardedRef, t3);
778
+ let t4;
779
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => contentRef.current, $[7] = t4) : t4 = $[7], useImperativeHandle(forwardedContentRef, t4);
780
+ let t5, t6;
781
+ $[8] !== autoFocus ? (t5 = () => {
782
+ autoFocus && ref.current && focusFirstDescendant(ref.current);
783
+ }, t6 = [autoFocus, ref], $[8] = autoFocus, $[9] = t5, $[10] = t6) : (t5 = $[9], t6 = $[10]), useEffect(t5, t6);
784
+ let t7;
785
+ $[11] !== boundaryElement || $[12] !== isTopLayer || $[13] !== onClose || $[14] !== portalElement ? (t7 = (event) => {
786
+ if (!isTopLayer || !onClose)
787
+ return;
788
+ const target = document.activeElement;
789
+ target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
790
+ }, $[11] = boundaryElement, $[12] = isTopLayer, $[13] = onClose, $[14] = portalElement, $[15] = t7) : t7 = $[15], useGlobalKeyDown(t7);
791
+ let t8;
792
+ $[16] !== boundaryElement || $[17] !== isTopLayer || $[18] !== onClickOutside || $[19] !== portalElement ? (t8 = isTopLayer && onClickOutside && ((event_0) => {
793
+ const target_0 = event_0.target;
794
+ target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
795
+ }), $[16] = boundaryElement, $[17] = isTopLayer, $[18] = onClickOutside, $[19] = portalElement, $[20] = t8) : t8 = $[20];
796
+ let t9;
797
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[21] = t9) : t9 = $[21], useClickOutsideEvent(t8, t9);
798
+ let t10;
799
+ $[22] !== header || $[23] !== labelId || $[24] !== onClose || $[25] !== showCloseButton || $[26] !== showHeader ? (t10 = showHeader && /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", padding: 3, children: [
800
+ /* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
801
+ showCloseButton && /* @__PURE__ */ jsx(Box, { flex: "none", children: /* @__PURE__ */ jsx(Button, { "aria-label": "Close dialog", disabled: !onClose, icon: CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
802
+ ] }) }), $[22] = header, $[23] = labelId, $[24] = onClose, $[25] = showCloseButton, $[26] = showHeader, $[27] = t10) : t10 = $[27];
803
+ let t11;
804
+ $[28] !== children ? (t11 = /* @__PURE__ */ jsx(DialogContent, { flex: 1, ref: contentRef, tabIndex: -1, children }), $[28] = children, $[29] = t11) : t11 = $[29];
805
+ let t12;
806
+ $[30] !== footer ? (t12 = footer && /* @__PURE__ */ jsx(DialogFooter, { children: footer }), $[30] = footer, $[31] = t12) : t12 = $[31];
807
+ let t13;
808
+ $[32] !== t10 || $[33] !== t11 || $[34] !== t12 ? (t13 = /* @__PURE__ */ jsxs(DialogLayout, { direction: "column", children: [
809
+ t10,
810
+ t11,
811
+ t12
812
+ ] }), $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13) : t13 = $[35];
813
+ let t14;
814
+ $[36] !== radius || $[37] !== scheme || $[38] !== shadow || $[39] !== t13 ? (t14 = /* @__PURE__ */ jsx(DialogCardRoot, { radius, ref, scheme, shadow, children: t13 }), $[36] = radius, $[37] = scheme, $[38] = shadow, $[39] = t13, $[40] = t14) : t14 = $[40];
815
+ let t15;
816
+ return $[41] !== t14 || $[42] !== width ? (t15 = /* @__PURE__ */ jsx(DialogContainer, { "data-ui": "DialogCard", width, children: t14 }), $[41] = t14, $[42] = width, $[43] = t15) : t15 = $[43], t15;
817
+ });
818
+ DialogCard.displayName = "ForwardRef(DialogCard)";
819
+ const Dialog = forwardRef(function(props, ref) {
820
+ const $ = c(70), dialog = useDialog(), {
821
+ layer
822
+ } = useTheme_v2();
823
+ let _positionProp, _zOffsetProp, children, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, t6;
824
+ $[0] !== props ? ({
825
+ __unstable_autoFocus: t0,
826
+ __unstable_hideCloseButton: t1,
827
+ cardRadius: t2,
828
+ cardShadow: t3,
829
+ children,
830
+ contentRef,
831
+ footer,
832
+ header,
833
+ id,
834
+ onActivate,
835
+ onClickOutside,
836
+ onClose,
837
+ onFocus,
838
+ padding: t4,
839
+ portal: portalProp,
840
+ position: _positionProp,
841
+ scheme,
842
+ width: t5,
843
+ zOffset: _zOffsetProp,
844
+ animate: t6,
845
+ ...restProps
846
+ } = props, $[0] = props, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = contentRef, $[5] = footer, $[6] = header, $[7] = id, $[8] = onActivate, $[9] = onClickOutside, $[10] = onClose, $[11] = onFocus, $[12] = portalProp, $[13] = restProps, $[14] = scheme, $[15] = t0, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], contentRef = $[4], footer = $[5], header = $[6], id = $[7], onActivate = $[8], onClickOutside = $[9], onClose = $[10], onFocus = $[11], portalProp = $[12], restProps = $[13], scheme = $[14], t0 = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21]);
847
+ const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 === void 0 ? !1 : t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element;
848
+ let t7;
849
+ $[22] !== cardRadiusProp ? (t7 = _getArrayProp(cardRadiusProp), $[22] = cardRadiusProp, $[23] = t7) : t7 = $[23];
850
+ const cardRadius = t7;
851
+ let t8;
852
+ $[24] !== paddingProp ? (t8 = _getArrayProp(paddingProp), $[24] = paddingProp, $[25] = t8) : t8 = $[25];
853
+ const padding = t8;
854
+ let t9;
855
+ $[26] !== positionProp ? (t9 = _getArrayProp(positionProp), $[26] = positionProp, $[27] = t9) : t9 = $[27];
856
+ const position = t9;
857
+ let t10;
858
+ $[28] !== widthProp ? (t10 = _getArrayProp(widthProp), $[28] = widthProp, $[29] = t10) : t10 = $[29];
859
+ const width = t10;
860
+ let t11;
861
+ $[30] !== zOffsetProp ? (t11 = _getArrayProp(zOffsetProp), $[30] = zOffsetProp, $[31] = t11) : t11 = $[31];
862
+ const zOffset = t11, preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
863
+ let t12;
864
+ $[32] !== onFocus ? (t12 = (event) => {
865
+ onFocus?.(event);
866
+ const target = event.target, cardElement = cardRef.current;
867
+ if (cardElement && target === preDivRef.current) {
868
+ focusLastDescendant(cardElement);
869
+ return;
870
+ }
871
+ if (cardElement && target === postDivRef.current) {
872
+ focusFirstDescendant(cardElement);
873
+ return;
874
+ }
875
+ isHTMLElement(event.target) && (focusedElementRef.current = event.target);
876
+ }, $[32] = onFocus, $[33] = t12) : t12 = $[33];
877
+ const handleFocus = t12, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
878
+ let t13;
879
+ $[34] !== boundaryElement || $[35] !== portalElement ? (t13 = () => {
880
+ rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
881
+ const activeElement = document.activeElement;
882
+ if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
883
+ const target_0 = focusedElementRef.current;
884
+ if (!target_0 || !document.body.contains(target_0)) {
885
+ const cardElement_0 = cardRef.current;
886
+ cardElement_0 && focusFirstDescendant(cardElement_0);
887
+ return;
888
+ }
889
+ target_0.focus();
890
+ }
891
+ }, 0);
892
+ }, $[34] = boundaryElement, $[35] = portalElement, $[36] = t13) : t13 = $[36];
893
+ const handleRootClick = t13;
894
+ let t14;
895
+ $[37] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[37] = t14) : t14 = $[37];
896
+ let t15;
897
+ $[38] !== autoFocus || $[39] !== cardRadius || $[40] !== cardShadow || $[41] !== children || $[42] !== contentRef || $[43] !== footer || $[44] !== header || $[45] !== hideCloseButton || $[46] !== id || $[47] !== onClickOutside || $[48] !== onClose || $[49] !== portalProp || $[50] !== scheme || $[51] !== width ? (t15 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, width, children }), $[38] = autoFocus, $[39] = cardRadius, $[40] = cardShadow, $[41] = children, $[42] = contentRef, $[43] = footer, $[44] = header, $[45] = hideCloseButton, $[46] = id, $[47] = onClickOutside, $[48] = onClose, $[49] = portalProp, $[50] = scheme, $[51] = width, $[52] = t15) : t15 = $[52];
898
+ let t16;
899
+ $[53] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[53] = t16) : t16 = $[53];
900
+ let t17;
901
+ $[54] !== animate || $[55] !== handleFocus || $[56] !== handleRootClick || $[57] !== id || $[58] !== labelId || $[59] !== onActivate || $[60] !== padding || $[61] !== position || $[62] !== ref || $[63] !== restProps || $[64] !== t15 || $[65] !== zOffset ? (t17 = /* @__PURE__ */ jsxs(StyledDialog, { ...restProps, $animate: animate, $padding: padding, $position: position, "aria-labelledby": labelId, "aria-modal": !0, "data-ui": "Dialog", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, ref, role: "dialog", zOffset, children: [
902
+ t14,
903
+ t15,
904
+ t16
905
+ ] }), $[54] = animate, $[55] = handleFocus, $[56] = handleRootClick, $[57] = id, $[58] = labelId, $[59] = onActivate, $[60] = padding, $[61] = position, $[62] = ref, $[63] = restProps, $[64] = t15, $[65] = zOffset, $[66] = t17) : t17 = $[66];
906
+ let t18;
907
+ return $[67] !== portalProp || $[68] !== t17 ? (t18 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t17 }), $[67] = portalProp, $[68] = t17, $[69] = t18) : t18 = $[69], t18;
908
+ });
909
+ Dialog.displayName = "ForwardRef(Dialog)";
910
+ function DialogProvider(props) {
911
+ const $ = c(6), {
912
+ children,
913
+ position,
914
+ zOffset
915
+ } = props;
916
+ let t0;
917
+ $[0] !== position || $[1] !== zOffset ? (t0 = {
918
+ version: 0,
919
+ position,
920
+ zOffset
921
+ }, $[0] = position, $[1] = zOffset, $[2] = t0) : t0 = $[2];
922
+ const contextValue = t0;
923
+ let t1;
924
+ return $[3] !== children || $[4] !== contextValue ? (t1 = /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t1) : t1 = $[5], t1;
925
+ }
926
+ DialogProvider.displayName = "DialogProvider";
927
+ const MenuButton = forwardRef(function(props, forwardedRef) {
928
+ const $ = c(62), {
929
+ __unstable_disableRestoreFocusOnClose: t0,
930
+ boundaryElement: deprecated_boundaryElement,
931
+ button: buttonProp,
932
+ id,
933
+ menu: menuProp,
934
+ onClose,
935
+ onOpen,
936
+ placement: deprecated_placement,
937
+ popoverScheme: deprecated_popoverScheme,
938
+ portal: t1,
939
+ popover,
940
+ popoverRadius: deprecated_popoverRadius,
941
+ preventOverflow: deprecated_preventOverflow
942
+ } = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), [buttonElement, setButtonElement] = useState(null);
943
+ let t2;
944
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
945
+ const [menuElements, setChildMenuElements] = useState(t2), openRef = useRef(open);
946
+ let t3, t4;
947
+ $[1] !== onOpen || $[2] !== open ? (t3 = () => {
948
+ onOpen && open && !openRef.current && onOpen();
949
+ }, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), useEffect(t3, t4);
950
+ let t5, t6;
951
+ $[5] !== onClose || $[6] !== open ? (t5 = () => {
952
+ onClose && !open && openRef.current && onClose();
953
+ }, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), useEffect(t5, t6);
954
+ let t7, t8;
955
+ $[9] !== open ? (t7 = () => {
956
+ openRef.current = open;
957
+ }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
958
+ let t9;
959
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
960
+ setOpen(_temp$2), setShouldFocus(null);
961
+ }, $[12] = t9) : t9 = $[12];
962
+ const handleButtonClick = t9;
963
+ let t10;
964
+ $[13] !== open ? (t10 = (event) => {
965
+ open && event.preventDefault();
966
+ }, $[13] = open, $[14] = t10) : t10 = $[14];
967
+ const handleMouseDown = t10;
968
+ let t11;
969
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (event_0) => {
970
+ if (event_0.key === "ArrowDown" || event_0.key === "Enter" || event_0.key === " ") {
971
+ event_0.preventDefault(), setOpen(!0), setShouldFocus("first");
972
+ return;
973
+ }
974
+ if (event_0.key === "ArrowUp") {
975
+ event_0.preventDefault(), setOpen(!0), setShouldFocus("last");
976
+ return;
977
+ }
978
+ }, $[15] = t11) : t11 = $[15];
979
+ const handleButtonKeyDown = t11;
980
+ let t12;
981
+ $[16] !== buttonElement || $[17] !== menuElements ? (t12 = (event_1) => {
982
+ const target = event_1.target;
983
+ if (target instanceof Node && !(buttonElement && (target === buttonElement || buttonElement.contains(target)))) {
984
+ for (const el of menuElements)
985
+ if (target === el || el.contains(target))
986
+ return;
987
+ setOpen(!1);
988
+ }
989
+ }, $[16] = buttonElement, $[17] = menuElements, $[18] = t12) : t12 = $[18];
990
+ const handleMenuClickOutside = t12;
991
+ let t13;
992
+ $[19] !== buttonElement || $[20] !== disableRestoreFocusOnClose ? (t13 = () => {
993
+ setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
994
+ }, $[19] = buttonElement, $[20] = disableRestoreFocusOnClose, $[21] = t13) : t13 = $[21];
995
+ const handleMenuEscape = t13;
996
+ let t14;
997
+ $[22] !== menuElements ? (t14 = (event_2) => {
998
+ const target_0 = event_2.relatedTarget;
999
+ if (target_0 instanceof Node) {
1000
+ for (const el_0 of menuElements)
1001
+ if (el_0 === target_0 || el_0.contains(target_0))
1002
+ return;
1003
+ setOpen(!1);
1004
+ }
1005
+ }, $[22] = menuElements, $[23] = t14) : t14 = $[23];
1006
+ const handleBlur = t14;
1007
+ let t15;
1008
+ $[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t15 = () => {
1009
+ setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
1010
+ }, $[24] = buttonElement, $[25] = disableRestoreFocusOnClose, $[26] = t15) : t15 = $[26];
1011
+ const handleItemClick = t15;
1012
+ let t16;
1013
+ $[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];
1014
+ const registerElement = t16;
1015
+ let t17;
1016
+ $[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && cloneElement(menuProp, {
1017
+ "aria-labelledby": id,
1018
+ onBlurCapture: handleBlur,
1019
+ onClickOutside: handleMenuClickOutside,
1020
+ onEscape: handleMenuEscape,
1021
+ onItemClick: handleItemClick,
1022
+ originElement: buttonElement,
1023
+ registerElement,
1024
+ shouldFocus
1025
+ }), $[28] = buttonElement, $[29] = handleBlur, $[30] = handleItemClick, $[31] = handleMenuClickOutside, $[32] = handleMenuEscape, $[33] = id, $[34] = menuProp, $[35] = shouldFocus, $[36] = t17) : t17 = $[36];
1026
+ const menu = t17;
1027
+ let t18;
1028
+ $[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open ? (t18 = buttonProp && cloneElement(buttonProp, {
1029
+ "data-ui": "MenuButton",
1030
+ id,
1031
+ onClick: handleButtonClick,
1032
+ onKeyDown: handleButtonKeyDown,
1033
+ onMouseDown: handleMouseDown,
1034
+ "aria-haspopup": !0,
1035
+ "aria-expanded": open,
1036
+ ref: setButtonElement,
1037
+ selected: buttonProp.props.selected ?? open
1038
+ }), $[37] = buttonProp, $[38] = handleMouseDown, $[39] = id, $[40] = open, $[41] = t18) : t18 = $[41];
1039
+ const button = t18;
1040
+ let t19, t20;
1041
+ $[42] !== buttonElement ? (t19 = () => buttonElement, t20 = [buttonElement], $[42] = buttonElement, $[43] = t19, $[44] = t20) : (t19 = $[43], t20 = $[44]), useImperativeHandle(forwardedRef, t19, t20);
1042
+ let t21;
1043
+ $[45] !== popover ? (t21 = popover || {}, $[45] = popover, $[46] = t21) : t21 = $[46];
1044
+ let t22;
1045
+ $[47] !== deprecated_boundaryElement || $[48] !== deprecated_placement || $[49] !== deprecated_popoverRadius || $[50] !== deprecated_popoverScheme || $[51] !== deprecated_portal || $[52] !== deprecated_preventOverflow || $[53] !== t21 ? (t22 = {
1046
+ boundaryElement: deprecated_boundaryElement,
1047
+ overflow: "auto",
1048
+ placement: deprecated_placement,
1049
+ portal: deprecated_portal,
1050
+ preventOverflow: deprecated_preventOverflow,
1051
+ radius: deprecated_popoverRadius,
1052
+ scheme: deprecated_popoverScheme,
1053
+ ...t21
1054
+ }, $[47] = deprecated_boundaryElement, $[48] = deprecated_placement, $[49] = deprecated_popoverRadius, $[50] = deprecated_popoverScheme, $[51] = deprecated_portal, $[52] = deprecated_preventOverflow, $[53] = t21, $[54] = t22) : t22 = $[54];
1055
+ const popoverProps = t22;
1056
+ let t23;
1057
+ $[55] !== button ? (t23 = button || /* @__PURE__ */ jsx(Fragment$1, {}), $[55] = button, $[56] = t23) : t23 = $[56];
1058
+ let t24;
1059
+ return $[57] !== menu || $[58] !== open || $[59] !== popoverProps || $[60] !== t23 ? (t24 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t23 }), $[57] = menu, $[58] = open, $[59] = popoverProps, $[60] = t23, $[61] = t24) : t24 = $[61], t24;
1060
+ });
1061
+ MenuButton.displayName = "ForwardRef(MenuButton)";
1062
+ function _temp$2(v) {
1063
+ return !v;
1064
+ }
1065
+ const keyframe = keyframes`
1066
+ 0% {
1067
+ background-position: 100%;
1068
+ }
1069
+ 100% {
1070
+ background-position: -100%;
1071
+ }
1072
+ `, animation = css`
1073
+ background-image: linear-gradient(
1074
+ to right,
1075
+ var(--card-skeleton-color-from),
1076
+ var(--card-skeleton-color-to),
1077
+ var(--card-skeleton-color-from),
1078
+ var(--card-skeleton-color-from),
1079
+ var(--card-skeleton-color-from)
1080
+ );
1081
+ background-position: 100%;
1082
+ background-size: 200% 100%;
1083
+ background-attachment: fixed;
1084
+ animation-name: ${keyframe};
1085
+ animation-timing-function: ease-in-out;
1086
+ animation-iteration-count: infinite;
1087
+ animation-duration: 2000ms;
1088
+ `, skeletonStyle = css`
1089
+ opacity: ${({
1090
+ $visible
1091
+ }) => $visible ? 1 : 0};
1092
+ transition: opacity 200ms ease-in;
1093
+
1094
+ @media screen and (prefers-reduced-motion: no-preference) {
1095
+ ${({
1096
+ $animated
1097
+ }) => $animated ? animation : css`
1098
+ background-color: var(--card-skeleton-color-from);
1099
+ `}
1100
+ }
1101
+
1102
+ @media screen and (prefers-reduced-motion: reduce) {
1103
+ background-color: var(--card-skeleton-color-from);
1104
+ }
1105
+ `, StyledSkeleton$1 = /* @__PURE__ */ styled(Box).withConfig({
1106
+ displayName: "StyledSkeleton",
1107
+ componentId: "sc-ebtpni-0"
1108
+ })(responsiveRadiusStyle, skeletonStyle), Skeleton = forwardRef(function(props, ref) {
1109
+ const $ = c(16);
1110
+ let delay, radius, restProps, t0;
1111
+ $[0] !== props ? ({
1112
+ animated: t0,
1113
+ delay,
1114
+ radius,
1115
+ ...restProps
1116
+ } = props, $[0] = props, $[1] = delay, $[2] = radius, $[3] = restProps, $[4] = t0) : (delay = $[1], radius = $[2], restProps = $[3], t0 = $[4]);
1117
+ const animated = t0 === void 0 ? !1 : t0, [visible, setVisible] = useState(!delay);
1118
+ let t1, t2;
1119
+ $[5] !== delay ? (t1 = () => {
1120
+ if (!delay)
1121
+ return;
1122
+ const timeout = setTimeout(() => {
1123
+ setVisible(!0);
1124
+ }, delay);
1125
+ return () => {
1126
+ clearTimeout(timeout);
1127
+ };
1128
+ }, t2 = [delay], $[5] = delay, $[6] = t1, $[7] = t2) : (t1 = $[6], t2 = $[7]), useEffect(t1, t2);
1129
+ let t3;
1130
+ $[8] !== radius ? (t3 = _getArrayProp(radius), $[8] = radius, $[9] = t3) : t3 = $[9];
1131
+ const t4 = delay ? visible : !0;
1132
+ let t5;
1133
+ return $[10] !== animated || $[11] !== ref || $[12] !== restProps || $[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */ jsx(StyledSkeleton$1, { ...restProps, $animated: animated, $radius: t3, $visible: t4, ref }), $[10] = animated, $[11] = ref, $[12] = restProps, $[13] = t3, $[14] = t4, $[15] = t5) : t5 = $[15], t5;
1134
+ });
1135
+ Skeleton.displayName = "ForwardRef(Skeleton)";
1136
+ const StyledSkeleton = /* @__PURE__ */ styled(Skeleton).withConfig({
1137
+ displayName: "StyledSkeleton",
1138
+ componentId: "sc-2p7a1v-0"
1139
+ })((props) => {
1140
+ const {
1141
+ $size,
1142
+ $style
1143
+ } = props, {
1144
+ font,
1145
+ media
1146
+ } = getTheme_v2(props.theme), fontStyle = font[$style];
1147
+ return _responsive(media, $size, (sizeIndex) => {
1148
+ const fontSize = fontStyle.sizes[sizeIndex];
1149
+ return {
1150
+ height: fontSize.lineHeight - fontSize.ascenderHeight - fontSize.descenderHeight
1151
+ };
1152
+ });
1153
+ }), TextSkeleton = forwardRef(function(props, ref) {
1154
+ const $ = c(9);
1155
+ let restProps, t0;
1156
+ $[0] !== props ? ({
1157
+ size: t0,
1158
+ ...restProps
1159
+ } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1160
+ const size = t0 === void 0 ? 2 : t0;
1161
+ let t1;
1162
+ $[3] !== size ? (t1 = _getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1163
+ const $size = t1;
1164
+ let t2;
1165
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "text" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1166
+ });
1167
+ TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
1168
+ const LabelSkeleton = forwardRef(function(props, ref) {
1169
+ const $ = c(9);
1170
+ let restProps, t0;
1171
+ $[0] !== props ? ({
1172
+ size: t0,
1173
+ ...restProps
1174
+ } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1175
+ const size = t0 === void 0 ? 2 : t0;
1176
+ let t1;
1177
+ $[3] !== size ? (t1 = _getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1178
+ const $size = t1;
1179
+ let t2;
1180
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "label" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1181
+ });
1182
+ LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
1183
+ const HeadingSkeleton = forwardRef(function(props, ref) {
1184
+ const $ = c(9);
1185
+ let restProps, t0;
1186
+ $[0] !== props ? ({
1187
+ size: t0,
1188
+ ...restProps
1189
+ } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1190
+ const size = t0 === void 0 ? 2 : t0;
1191
+ let t1;
1192
+ $[3] !== size ? (t1 = _getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1193
+ const $size = t1;
1194
+ let t2;
1195
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "heading" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1196
+ });
1197
+ HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
1198
+ const CodeSkeleton = forwardRef(function(props, ref) {
1199
+ const $ = c(9);
1200
+ let restProps, t0;
1201
+ $[0] !== props ? ({
1202
+ size: t0,
1203
+ ...restProps
1204
+ } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1205
+ const size = t0 === void 0 ? 2 : t0;
1206
+ let t1;
1207
+ $[3] !== size ? (t1 = _getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1208
+ const $size = t1;
1209
+ let t2;
1210
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "code" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1211
+ });
1212
+ CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
1213
+ const TabPanel = forwardRef(function(props, ref) {
1214
+ const $ = c(9);
1215
+ let flex, restProps;
1216
+ $[0] !== props ? ({
1217
+ flex,
1218
+ ...restProps
1219
+ } = props, $[0] = props, $[1] = flex, $[2] = restProps) : (flex = $[1], restProps = $[2]);
1220
+ const t0 = props.tabIndex === void 0 ? 0 : props.tabIndex;
1221
+ let t1;
1222
+ return $[3] !== flex || $[4] !== props.children || $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */ jsx(Box, { "data-ui": "TabPanel", ...restProps, flex, ref, role: "tabpanel", tabIndex: t0, children: props.children }), $[3] = flex, $[4] = props.children, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1) : t1 = $[8], t1;
1223
+ });
1224
+ TabPanel.displayName = "ForwardRef(TabPanel)";
1225
+ const LOADING_BAR_HEIGHT = 2, STATUS_CARD_TONE = {
1226
+ error: "critical",
1227
+ warning: "caution",
1228
+ success: "positive",
1229
+ info: "neutral"
1230
+ }, BUTTON_TONE = {
1231
+ error: "critical",
1232
+ warning: "caution",
1233
+ success: "positive",
1234
+ info: "neutral"
1235
+ }, TextBox = styled(Flex).withConfig({
1236
+ displayName: "TextBox",
1237
+ componentId: "sc-1rr7rxo-0"
1238
+ })`overflow-x:auto;`, StyledToast = styled(Card).withConfig({
1239
+ displayName: "StyledToast",
1240
+ componentId: "sc-1rr7rxo-1"
1241
+ })`pointer-events:all;width:100%;position:relative;overflow:hidden;overflow:clip;&[data-has-duration]{padding-bottom:calc(${LOADING_BAR_HEIGHT}px / 2);}`, LoadingBar = styled.div.withConfig({
1242
+ displayName: "LoadingBar",
1243
+ componentId: "sc-1rr7rxo-2"
1244
+ })`display:flex;position:absolute;bottom:0px;top:0px;left:0px;right:0px;pointer-events:none;z-index:-1;overflow:hidden;overflow:clip;background:transparent;align-items:flex-end;will-change:opacity;`, LoadingBarMask = styled(Card).withConfig({
1245
+ displayName: "LoadingBarMask",
1246
+ componentId: "sc-1rr7rxo-3"
1247
+ })`position:absolute;top:0;left:-${LOADING_BAR_HEIGHT}px;right:-${LOADING_BAR_HEIGHT}px;bottom:${LOADING_BAR_HEIGHT}px;z-index:1;`, LoadingBarProgress = styled(Card).withConfig({
1248
+ displayName: "LoadingBarProgress",
1249
+ componentId: "sc-1rr7rxo-4"
1250
+ })`display:block;height:100%;width:100%;transform-origin:0% 50%;background-color:${(props) => {
1251
+ const {
1252
+ color
1253
+ } = getTheme_v2(props.theme);
1254
+ return color.button.default[props.tone].enabled.bg;
1255
+ }};`, ROLES = {
1256
+ error: "alert",
1257
+ warning: "alert",
1258
+ success: "alert",
1259
+ info: "alert"
1260
+ }, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
1261
+ function Toast(props) {
1262
+ const $ = c(50);
1263
+ let closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
1264
+ $[0] !== props ? ({
1265
+ closable,
1266
+ description,
1267
+ duration,
1268
+ onClose,
1269
+ radius: t0,
1270
+ title,
1271
+ status,
1272
+ updatedAt,
1273
+ ...restProps
1274
+ } = props, $[0] = props, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = restProps, $[6] = status, $[7] = t0, $[8] = title, $[9] = updatedAt) : (closable = $[1], description = $[2], duration = $[3], onClose = $[4], restProps = $[5], status = $[6], t0 = $[7], title = $[8], updatedAt = $[9]);
1275
+ const radius = t0 === void 0 ? 3 : t0, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = usePrefersReducedMotion() ? 0 : 0.26;
1276
+ let t1;
1277
+ $[10] !== visualDuration ? (t1 = visualDuration ? {
1278
+ type: "spring",
1279
+ visualDuration,
1280
+ bounce: 0.25
1281
+ } : {
1282
+ duration: 0
1283
+ }, $[10] = visualDuration, $[11] = t1) : t1 = $[11];
1284
+ const transition = t1, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
1285
+ let t2;
1286
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
1287
+ const initial = t2;
1288
+ let t3;
1289
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
1290
+ const animate = t3;
1291
+ let t4;
1292
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "slideOut"], $[14] = t4) : t4 = $[14];
1293
+ const exit = t4, t5 = hasDuration ? "" : void 0;
1294
+ let t6;
1295
+ $[15] !== title ? (t6 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[15] = title, $[16] = t6) : t6 = $[16];
1296
+ let t7;
1297
+ $[17] !== description || $[18] !== transition ? (t7 = description && /* @__PURE__ */ jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[17] = description, $[18] = transition, $[19] = t7) : t7 = $[19];
1298
+ let t8;
1299
+ $[20] !== t6 || $[21] !== t7 ? (t8 = /* @__PURE__ */ jsx(TextBox, { flex: 1, padding: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
1300
+ t6,
1301
+ t7
1302
+ ] }) }), $[20] = t6, $[21] = t7, $[22] = t8) : t8 = $[22];
1303
+ let t9;
1304
+ $[23] !== buttonTone || $[24] !== closable || $[25] !== onClose ? (t9 = closable && /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "button", icon: CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
1305
+ verticalAlign: "top"
1306
+ } }) }), $[23] = buttonTone, $[24] = closable, $[25] = onClose, $[26] = t9) : t9 = $[26];
1307
+ let t10;
1308
+ $[27] !== t8 || $[28] !== t9 || $[29] !== transition ? (t10 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
1309
+ t8,
1310
+ t9
1311
+ ] }), $[27] = t8, $[28] = t9, $[29] = transition, $[30] = t10) : t10 = $[30];
1312
+ let t11;
1313
+ $[31] !== cardTone || $[32] !== duration || $[33] !== hasDuration || $[34] !== onClose || $[35] !== radius || $[36] !== transition || $[37] !== updatedAt || $[38] !== visualDuration ? (t11 = hasDuration && /* @__PURE__ */ jsxs(MotionLoadingBar, { variants: content, transition, children: [
1314
+ /* @__PURE__ */ jsx(LoadingBarMask, { tone: cardTone, radius }),
1315
+ /* @__PURE__ */ jsx(MotionLoadingBarProgress, { tone: cardTone, initial: {
1316
+ scaleX: 0
1317
+ }, animate: {
1318
+ scaleX: 1
1319
+ }, transition: {
1320
+ delay: visualDuration,
1321
+ duration: duration / 1e3,
1322
+ ease: "linear"
1323
+ }, onAnimationComplete: onClose }, `progress-${updatedAt}`)
1324
+ ] }), $[31] = cardTone, $[32] = duration, $[33] = hasDuration, $[34] = onClose, $[35] = radius, $[36] = transition, $[37] = updatedAt, $[38] = visualDuration, $[39] = t11) : t11 = $[39];
1325
+ let t12;
1326
+ return $[40] !== cardTone || $[41] !== radius || $[42] !== restProps || $[43] !== role || $[44] !== t10 || $[45] !== t11 || $[46] !== t5 || $[47] !== transition || $[48] !== visualDuration ? (t12 = /* @__PURE__ */ jsxs(MotionToast, { "data-ui": "Toast", role, ...restProps, "data-has-duration": t5, custom: visualDuration, radius, shadow: 2, tone: cardTone, forwardedAs: "li", layout: "position", variants: container, initial, animate, exit, transition, children: [
1327
+ t10,
1328
+ t11
1329
+ ] }), $[40] = cardTone, $[41] = radius, $[42] = restProps, $[43] = role, $[44] = t10, $[45] = t11, $[46] = t5, $[47] = transition, $[48] = visualDuration, $[49] = t12) : t12 = $[49], t12;
1330
+ }
1331
+ Toast.displayName = "Toast";
1332
+ const container = {
1333
+ initial: {
1334
+ y: 32,
1335
+ scale: 0.5,
1336
+ zIndex: 1
1337
+ },
1338
+ hidden: {
1339
+ opacity: 0
1340
+ },
1341
+ visible: (visualDuration) => visualDuration ? {
1342
+ opacity: 1,
1343
+ transition: {
1344
+ when: "beforeChildren",
1345
+ staggerChildren: visualDuration / 3,
1346
+ duration: visualDuration / 3
1347
+ }
1348
+ } : {
1349
+ opacity: 1
1350
+ },
1351
+ slideIn: {
1352
+ y: 0,
1353
+ scale: 1
1354
+ },
1355
+ slideOut: {
1356
+ zIndex: 0,
1357
+ scale: 0.75
1358
+ }
1359
+ }, content = {
1360
+ initial: {
1361
+ willChange: "transform"
1362
+ },
1363
+ hidden: {
1364
+ opacity: 0
1365
+ },
1366
+ visible: {
1367
+ opacity: 1
1368
+ }
1369
+ }, MotionToast = motion.create(StyledToast), MotionFlex = motion.create(Flex), MotionText = motion.create(Text), MotionLoadingBar = motion.create(LoadingBar), MotionLoadingBarProgress = motion.create(LoadingBarProgress);
1370
+ function useMounted() {
1371
+ return useSyncExternalStore(subscribe, _temp$1, _temp2);
1372
+ }
1373
+ function _temp2() {
1374
+ return !1;
1375
+ }
1376
+ function _temp$1() {
1377
+ return !0;
1378
+ }
1379
+ const subscribe = () => () => {
1380
+ }, ToastContext = createGlobalScopedContext("@bettercms-ai/kit/context/toast", null);
1381
+ function ToastLayer(props) {
1382
+ const $ = c(9), {
1383
+ children,
1384
+ padding: t0,
1385
+ paddingX,
1386
+ paddingY,
1387
+ gap: t1
1388
+ } = props, padding = t0 === void 0 ? 4 : t0, gap = t1 === void 0 ? 3 : t1, {
1389
+ zIndex
1390
+ } = useLayer();
1391
+ let t2;
1392
+ $[0] !== zIndex ? (t2 = {
1393
+ zIndex
1394
+ }, $[0] = zIndex, $[1] = t2) : t2 = $[1];
1395
+ let t3;
1396
+ return $[2] !== children || $[3] !== gap || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== t2 ? (t3 = /* @__PURE__ */ jsx(StyledLayer, { forwardedAs: "ul", "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t2, children }), $[2] = children, $[3] = gap, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = t2, $[8] = t3) : t3 = $[8], t3;
1397
+ }
1398
+ ToastLayer.displayName = "ToastLayer";
1399
+ const StyledLayer = styled(Grid).withConfig({
1400
+ displayName: "StyledLayer",
1401
+ componentId: "sc-1tbwn58-0"
1402
+ })`box-sizing:border-box;position:fixed;right:0;bottom:0;list-style:none;pointer-events:none;max-width:420px;width:100%;`;
1403
+ let toastId = 0;
1404
+ function generateToastId() {
1405
+ return String(toastId++);
1406
+ }
1407
+ function ToastProvider(props) {
1408
+ const $ = c(13), {
1409
+ children,
1410
+ padding,
1411
+ paddingX,
1412
+ paddingY,
1413
+ gap,
1414
+ zOffset: t0
1415
+ } = props, zOffset = t0 === void 0 ? 1 : t0;
1416
+ let t1;
1417
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
1418
+ const [state, setState] = useState(t1), mounted = useMounted();
1419
+ let t2;
1420
+ $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {
1421
+ version: 0,
1422
+ push: (params) => {
1423
+ const id = params.id || generateToastId(), duration = params.duration || 5e3;
1424
+ return startTransition(() => {
1425
+ setState((prevState) => {
1426
+ if (duration === 0.01)
1427
+ return prevState.filter((toast) => toast.id !== id);
1428
+ const dismiss = () => startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
1429
+ return [...prevState.filter((toast_1) => toast_1.id !== id), {
1430
+ dismiss,
1431
+ id,
1432
+ updatedAt: Date.now(),
1433
+ params: {
1434
+ ...params,
1435
+ duration
1436
+ }
1437
+ }];
1438
+ });
1439
+ }), id;
1440
+ }
1441
+ }, $[1] = t2) : t2 = $[1];
1442
+ const value = t2;
1443
+ let t3;
1444
+ $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t3 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t3) : t3 = $[9];
1445
+ let t4;
1446
+ return $[10] !== children || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
1447
+ children,
1448
+ t3
1449
+ ] }), $[10] = children, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
1450
+ }
1451
+ function _temp(t0) {
1452
+ const {
1453
+ dismiss: dismiss_0,
1454
+ id: id_0,
1455
+ params: params_0,
1456
+ updatedAt
1457
+ } = t0;
1458
+ return /* @__PURE__ */ jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration, updatedAt }, id_0);
1459
+ }
1460
+ ToastProvider.displayName = "ToastProvider";
1461
+ function useToast() {
1462
+ const value = useContext(ToastContext);
1463
+ if (!value)
1464
+ throw new Error("useToast(): missing context value");
1465
+ if (!isRecord(value) || value.version !== 0)
1466
+ throw new Error("useToast(): the context value is not compatible");
1467
+ return value;
1468
+ }
1469
+ function _findPrevItemElement(state, itemElements, focusedElement) {
1470
+ const idx = itemElements.indexOf(focusedElement), els = itemElements.slice(0, idx), len = els.length;
1471
+ for (let i = len - 1; i >= 0; i -= 1) {
1472
+ const itemKey = els[i].getAttribute("data-tree-key");
1473
+ if (!itemKey)
1474
+ continue;
1475
+ const segments = itemKey.split("/");
1476
+ segments.pop();
1477
+ const p = [];
1478
+ let expanded = !0;
1479
+ for (let j = 0; j < segments.length; j += 1) {
1480
+ p.push(segments[j]);
1481
+ const k = p.join("/");
1482
+ if (!state[k]?.expanded) {
1483
+ expanded = !1;
1484
+ break;
1485
+ }
1486
+ }
1487
+ if (expanded)
1488
+ return els[i];
1489
+ }
1490
+ return null;
1491
+ }
1492
+ function _findNextItemElement(state, itemElements, focusedElement) {
1493
+ const idx = itemElements.indexOf(focusedElement), els = itemElements.slice(idx), len = itemElements.length;
1494
+ for (let i = 1; i < len; i += 1) {
1495
+ if (!els[i])
1496
+ continue;
1497
+ const itemKey = els[i].getAttribute("data-tree-key");
1498
+ if (!itemKey)
1499
+ continue;
1500
+ const segments = itemKey.split("/");
1501
+ segments.pop();
1502
+ const p = [];
1503
+ let expanded = !0;
1504
+ for (let j = 0; j < segments.length; j += 1) {
1505
+ p.push(segments[j]);
1506
+ const k = p.join("/");
1507
+ if (!state[k]?.expanded) {
1508
+ expanded = !1;
1509
+ break;
1510
+ }
1511
+ }
1512
+ if (expanded)
1513
+ return els[i];
1514
+ }
1515
+ return null;
1516
+ }
1517
+ function _focusItemElement(el) {
1518
+ if (el.getAttribute("role") === "treeitem" && el.focus(), el.getAttribute("role") === "none") {
1519
+ const firstChild = el.firstChild;
1520
+ firstChild && firstChild instanceof HTMLElement && firstChild.focus();
1521
+ }
1522
+ }
1523
+ const TreeContext = createGlobalScopedContext("@bettercms-ai/kit/context/tree", null), Tree = forwardRef(function(props, forwardedRef) {
1524
+ const $ = c(38);
1525
+ let children, gap, onFocus, restProps, t0;
1526
+ $[0] !== props ? ({
1527
+ children,
1528
+ gap,
1529
+ space: t0,
1530
+ onFocus,
1531
+ ...restProps
1532
+ } = props, $[0] = props, $[1] = children, $[2] = gap, $[3] = onFocus, $[4] = restProps, $[5] = t0) : (children = $[1], gap = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]);
1533
+ const spacing = gap === void 0 ? t0 === void 0 ? 1 : t0 : gap, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
1534
+ let t1;
1535
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[6] = t1) : t1 = $[6];
1536
+ const path = t1;
1537
+ let t2;
1538
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[7] = t2) : t2 = $[7];
1539
+ const [itemElements, setItemElements] = useState(t2);
1540
+ let t3;
1541
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[8] = t3) : t3 = $[8];
1542
+ const [state, setState] = useState(t3), stateRef = useRef(state);
1543
+ let t4;
1544
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[9] = t4) : t4 = $[9], useImperativeHandle(forwardedRef, t4);
1545
+ let t5, t6;
1546
+ $[10] !== focusedElement ? (t5 = () => {
1547
+ focusedElementRef.current = focusedElement;
1548
+ }, t6 = [focusedElement], $[10] = focusedElement, $[11] = t5, $[12] = t6) : (t5 = $[11], t6 = $[12]), useEffect(t5, t6);
1549
+ let t7, t8;
1550
+ $[13] !== state ? (t7 = () => {
1551
+ stateRef.current = state;
1552
+ }, t8 = [state], $[13] = state, $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]), useEffect(t7, t8);
1553
+ let t9;
1554
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t9 = (element, path_0, expanded, selected) => (setState((s) => ({
1555
+ ...s,
1556
+ [path_0]: {
1557
+ element,
1558
+ expanded
1559
+ }
1560
+ })), selected && setFocusedElement(element), () => {
1561
+ setState((s_0) => {
1562
+ const newState = {
1563
+ ...s_0
1564
+ };
1565
+ return delete newState[path_0], newState;
1566
+ });
1567
+ }), $[16] = t9) : t9 = $[16];
1568
+ const registerItem = t9;
1569
+ let t10;
1570
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (path_1, expanded_0) => {
1571
+ setState((s_1) => {
1572
+ const itemState = s_1[path_1];
1573
+ return itemState ? {
1574
+ ...s_1,
1575
+ [path_1]: {
1576
+ ...itemState,
1577
+ expanded: expanded_0
1578
+ }
1579
+ } : s_1;
1580
+ });
1581
+ }, $[17] = t10) : t10 = $[17];
1582
+ const setExpanded = t10, t11 = focusedElement || itemElements[0] || null;
1583
+ let t12;
1584
+ $[18] !== spacing || $[19] !== state || $[20] !== t11 ? (t12 = {
1585
+ version: 0,
1586
+ focusedElement: t11,
1587
+ level: 0,
1588
+ path,
1589
+ registerItem,
1590
+ setExpanded,
1591
+ setFocusedElement,
1592
+ gap: spacing,
1593
+ space: spacing,
1594
+ state
1595
+ }, $[18] = spacing, $[19] = state, $[20] = t11, $[21] = t12) : t12 = $[21];
1596
+ const contextValue = t12;
1597
+ let t13;
1598
+ $[22] !== itemElements ? (t13 = (event) => {
1599
+ if (focusedElementRef.current) {
1600
+ if (event.key === "ArrowDown") {
1601
+ event.preventDefault();
1602
+ const nextEl = _findNextItemElement(stateRef.current, itemElements, focusedElementRef.current);
1603
+ nextEl && (_focusItemElement(nextEl), setFocusedElement(nextEl));
1604
+ return;
1605
+ }
1606
+ if (event.key === "ArrowUp") {
1607
+ event.preventDefault();
1608
+ const prevEl = _findPrevItemElement(stateRef.current, itemElements, focusedElementRef.current);
1609
+ prevEl && (_focusItemElement(prevEl), setFocusedElement(prevEl));
1610
+ return;
1611
+ }
1612
+ if (event.key === "ArrowLeft") {
1613
+ event.preventDefault();
1614
+ const itemKey = focusedElementRef.current.getAttribute("data-tree-key");
1615
+ if (!itemKey)
1616
+ return;
1617
+ const itemState_0 = stateRef.current[itemKey];
1618
+ if (!itemState_0)
1619
+ return;
1620
+ if (itemState_0.expanded)
1621
+ setState((s_2) => {
1622
+ const itemState_1 = s_2[itemKey];
1623
+ return itemState_1 ? {
1624
+ ...s_2,
1625
+ [itemKey]: {
1626
+ ...itemState_1,
1627
+ expanded: !1
1628
+ }
1629
+ } : s_2;
1630
+ });
1631
+ else {
1632
+ const itemPath = itemKey.split("/");
1633
+ itemPath.pop();
1634
+ const parentKey = itemPath.join("/"), parentState = parentKey && stateRef.current[parentKey];
1635
+ parentState && (parentState.element.focus(), setFocusedElement(parentState.element));
1636
+ }
1637
+ return;
1638
+ }
1639
+ if (event.key === "ArrowRight") {
1640
+ event.preventDefault();
1641
+ const focusedKey = focusedElementRef.current.getAttribute("data-tree-key");
1642
+ if (!focusedKey)
1643
+ return;
1644
+ stateRef.current[focusedKey]?.expanded || setState((s_3) => {
1645
+ const itemState_2 = s_3[focusedKey];
1646
+ return itemState_2 ? {
1647
+ ...s_3,
1648
+ [focusedKey]: {
1649
+ ...itemState_2,
1650
+ expanded: !0
1651
+ }
1652
+ } : s_3;
1653
+ });
1654
+ return;
1655
+ }
1656
+ }
1657
+ }, $[22] = itemElements, $[23] = t13) : t13 = $[23];
1658
+ const handleKeyDown = t13;
1659
+ let t14;
1660
+ $[24] !== onFocus ? (t14 = (event_0) => {
1661
+ setFocusedElement(event_0.target), onFocus?.(event_0);
1662
+ }, $[24] = onFocus, $[25] = t14) : t14 = $[25];
1663
+ const handleFocus = t14;
1664
+ let t15;
1665
+ $[26] === Symbol.for("react.memo_cache_sentinel") ? (t15 = () => {
1666
+ if (!ref.current)
1667
+ return;
1668
+ const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
1669
+ setItemElements(_itemElements);
1670
+ }, $[26] = t15) : t15 = $[26];
1671
+ let t16;
1672
+ $[27] !== children ? (t16 = [children], $[27] = children, $[28] = t16) : t16 = $[28], useEffect(t15, t16);
1673
+ let t17;
1674
+ $[29] !== children || $[30] !== handleFocus || $[31] !== handleKeyDown || $[32] !== restProps || $[33] !== spacing ? (t17 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...restProps, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", gap: spacing, children }), $[29] = children, $[30] = handleFocus, $[31] = handleKeyDown, $[32] = restProps, $[33] = spacing, $[34] = t17) : t17 = $[34];
1675
+ let t18;
1676
+ return $[35] !== contextValue || $[36] !== t17 ? (t18 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t17 }), $[35] = contextValue, $[36] = t17, $[37] = t18) : t18 = $[37], t18;
1677
+ });
1678
+ Tree.displayName = "ForwardRef(Tree)";
1679
+ function treeItemRootStyle() {
1680
+ return css`
1681
+ &[role='none'] > [role='treeitem'] {
1682
+ outline: none;
1683
+ cursor: default;
1684
+ border-radius: 3px;
1685
+
1686
+ background-color: var(--card-bg-color);
1687
+ color: var(--treeitem-fg-color);
1688
+
1689
+ &:focus {
1690
+ position: relative;
1691
+ }
1692
+ }
1693
+
1694
+ &[role='treeitem'] {
1695
+ outline: none;
1696
+
1697
+ & > div {
1698
+ cursor: default;
1699
+ border-radius: 3px;
1700
+
1701
+ background-color: var(--card-bg-color);
1702
+ color: var(--treeitem-fg-color);
1703
+ }
1704
+
1705
+ &:focus > div {
1706
+ position: relative;
1707
+ }
1708
+ }
1709
+ `;
1710
+ }
1711
+ function treeItemRootColorStyle(props) {
1712
+ const $tone = "default", {
1713
+ color
1714
+ } = getTheme_v2(props.theme), tone = color.selectable[$tone];
1715
+ return css`
1716
+ &[role='none'] {
1717
+ & > [role='treeitem'] {
1718
+ ${_cardColorStyle(color, tone.enabled)}
1719
+ }
1720
+
1721
+ &[data-selected] > [role='treeitem'] {
1722
+ ${_cardColorStyle(color, tone.pressed)}
1723
+ }
1724
+
1725
+ @media (hover: hover) {
1726
+ &:not([data-selected]) > [role='treeitem']:not(:focus):hover {
1727
+ ${_cardColorStyle(color, tone.hovered)}
1728
+ }
1729
+
1730
+ & > [role='treeitem']:focus {
1731
+ ${_cardColorStyle(color, tone.selected)}
1732
+ }
1733
+ }
1734
+ }
1735
+
1736
+ &[role='treeitem'] {
1737
+ & > [data-ui='TreeItem__box'] {
1738
+ ${_cardColorStyle(color, tone.enabled)}
1739
+ }
1740
+
1741
+ &[data-selected] > [data-ui='TreeItem__box'] {
1742
+ ${_cardColorStyle(color, tone.pressed)}
1743
+ }
1744
+
1745
+ @media (hover: hover) {
1746
+ &:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {
1747
+ ${_cardColorStyle(color, tone.hovered)}
1748
+ }
1749
+
1750
+ &:focus > [data-ui='TreeItem__box'] {
1751
+ ${_cardColorStyle(color, tone.selected)}
1752
+ }
1753
+ }
1754
+ }
1755
+ `;
1756
+ }
1757
+ function treeItemBoxStyle(props) {
1758
+ const {
1759
+ $level
1760
+ } = props, {
1761
+ space
1762
+ } = getTheme_v2(props.theme);
1763
+ return css`
1764
+ padding-left: ${rem(space[2] * $level)};
1765
+
1766
+ &[data-as='a'] {
1767
+ text-decoration: none;
1768
+ }
1769
+ `;
1770
+ }
1771
+ function useTree() {
1772
+ const tree = useContext(TreeContext);
1773
+ if (!tree)
1774
+ throw new Error("Tree: missing context value");
1775
+ return tree;
1776
+ }
1777
+ function TreeGroup(props) {
1778
+ const $ = c(9);
1779
+ let children, restProps, t0;
1780
+ $[0] !== props ? ({
1781
+ children,
1782
+ expanded: t0,
1783
+ ...restProps
1784
+ } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
1785
+ const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
1786
+ let t2;
1787
+ return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.gap ? (t2 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.gap, role: "group", gap: tree.gap, children }), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.gap, $[8] = t2) : t2 = $[8], t2;
1788
+ }
1789
+ const StyledTreeItem = /* @__PURE__ */ styled.li.withConfig({
1790
+ displayName: "StyledTreeItem",
1791
+ componentId: "sc-iiskig-0"
1792
+ })(treeItemRootStyle, treeItemRootColorStyle), TreeItemBox = /* @__PURE__ */ styled(Box).attrs({
1793
+ forwardedAs: "a"
1794
+ }).withConfig({
1795
+ displayName: "TreeItemBox",
1796
+ componentId: "sc-iiskig-1"
1797
+ })(treeItemBoxStyle), ToggleArrowText = styled(Text).withConfig({
1798
+ displayName: "ToggleArrowText",
1799
+ componentId: "sc-iiskig-2"
1800
+ })`& > svg{transition:transform 100ms;}`;
1801
+ function TreeItem(props) {
1802
+ const $ = c(114);
1803
+ let IconComponent, children, gap, href, idProp, linkAs, muted, onClick, restProps, t0, t1, t2, t3, t4, text, weight;
1804
+ $[0] !== props ? ({
1805
+ children,
1806
+ expanded: t0,
1807
+ fontSize: t1,
1808
+ href,
1809
+ icon: IconComponent,
1810
+ id: idProp,
1811
+ linkAs,
1812
+ muted,
1813
+ onClick,
1814
+ padding: t2,
1815
+ selected: t3,
1816
+ gap,
1817
+ space: t4,
1818
+ text,
1819
+ weight,
1820
+ ...restProps
1821
+ } = props, $[0] = props, $[1] = IconComponent, $[2] = children, $[3] = gap, $[4] = href, $[5] = idProp, $[6] = linkAs, $[7] = muted, $[8] = onClick, $[9] = restProps, $[10] = t0, $[11] = t1, $[12] = t2, $[13] = t3, $[14] = t4, $[15] = text, $[16] = weight) : (IconComponent = $[1], children = $[2], gap = $[3], href = $[4], idProp = $[5], linkAs = $[6], muted = $[7], onClick = $[8], restProps = $[9], t0 = $[10], t1 = $[11], t2 = $[12], t3 = $[13], t4 = $[14], text = $[15], weight = $[16]);
1822
+ const expandedProp = t0 === void 0 ? !1 : t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 === void 0 ? !1 : t3, spacing = gap === void 0 ? t4 === void 0 ? 2 : t4 : gap, [rootElement, _setRootElement] = useState(null);
1823
+ let t5;
1824
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t5 = (node) => {
1825
+ startTransition(() => _setRootElement(node));
1826
+ }, $[17] = t5) : t5 = $[17];
1827
+ const setRootElement = t5, treeitemRef = useRef(null), tree = useTree(), {
1828
+ path,
1829
+ registerItem,
1830
+ setExpanded,
1831
+ setFocusedElement
1832
+ } = tree, _id = useId(), id = idProp || _id;
1833
+ let t6, t7;
1834
+ if ($[18] !== id || $[19] !== path) {
1835
+ const itemPath = path.concat([id || ""]);
1836
+ t6 = itemPath, t7 = itemPath.join("/"), $[18] = id, $[19] = path, $[20] = t6, $[21] = t7;
1837
+ } else
1838
+ t6 = $[20], t7 = $[21];
1839
+ let t8;
1840
+ $[22] !== t6 || $[23] !== t7 ? (t8 = [t6, t7], $[22] = t6, $[23] = t7, $[24] = t8) : t8 = $[24];
1841
+ const [itemPath_0, itemKey] = t8, itemState = tree.state[itemKey], focused = tree.focusedElement === rootElement, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootElement ? 0 : -1, t9 = tree.level + 1;
1842
+ let t10;
1843
+ $[25] !== itemPath_0 || $[26] !== t9 || $[27] !== tree ? (t10 = {
1844
+ ...tree,
1845
+ level: t9,
1846
+ path: itemPath_0
1847
+ }, $[25] = itemPath_0, $[26] = t9, $[27] = tree, $[28] = t10) : t10 = $[28];
1848
+ const contextValue = t10;
1849
+ let t11;
1850
+ $[29] !== expanded || $[30] !== itemKey || $[31] !== onClick || $[32] !== rootElement || $[33] !== setExpanded || $[34] !== setFocusedElement ? (t11 = (event) => {
1851
+ onClick && onClick(event);
1852
+ const target = event.target;
1853
+ target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
1854
+ }, $[29] = expanded, $[30] = itemKey, $[31] = onClick, $[32] = rootElement, $[33] = setExpanded, $[34] = setFocusedElement, $[35] = t11) : t11 = $[35];
1855
+ const handleClick = t11;
1856
+ let t12;
1857
+ $[36] !== focused || $[37] !== rootElement ? (t12 = (event_0) => {
1858
+ focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
1859
+ }, $[36] = focused, $[37] = rootElement, $[38] = t12) : t12 = $[38];
1860
+ const handleKeyDown = t12;
1861
+ let t13, t14;
1862
+ $[39] !== expanded || $[40] !== itemKey || $[41] !== registerItem || $[42] !== rootElement || $[43] !== selected ? (t13 = () => {
1863
+ if (rootElement)
1864
+ return registerItem(rootElement, itemKey, expanded, selected);
1865
+ }, t14 = [expanded, itemKey, registerItem, rootElement, selected], $[39] = expanded, $[40] = itemKey, $[41] = registerItem, $[42] = rootElement, $[43] = selected, $[44] = t13, $[45] = t14) : (t13 = $[44], t14 = $[45]), useEffect(t13, t14);
1866
+ const t15 = IconComponent || children ? "visible" : "hidden";
1867
+ let t16;
1868
+ $[46] !== t15 ? (t16 = {
1869
+ visibility: t15,
1870
+ pointerEvents: "none"
1871
+ }, $[46] = t15, $[47] = t16) : t16 = $[47];
1872
+ let t17;
1873
+ $[48] !== IconComponent || $[49] !== fontSize || $[50] !== muted || $[51] !== weight ? (t17 = IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }), $[48] = IconComponent, $[49] = fontSize, $[50] = muted, $[51] = weight, $[52] = t17) : t17 = $[52];
1874
+ let t18;
1875
+ $[53] !== IconComponent || $[54] !== expanded || $[55] !== fontSize || $[56] !== muted || $[57] !== weight ? (t18 = !IconComponent && /* @__PURE__ */ jsx(ToggleArrowText, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
1876
+ transform: expanded ? "rotate(90deg)" : void 0
1877
+ } }) }), $[53] = IconComponent, $[54] = expanded, $[55] = fontSize, $[56] = muted, $[57] = weight, $[58] = t18) : t18 = $[58];
1878
+ let t19;
1879
+ $[59] !== spacing || $[60] !== t16 || $[61] !== t17 || $[62] !== t18 ? (t19 = /* @__PURE__ */ jsxs(Box, { marginRight: spacing, style: t16, children: [
1880
+ t17,
1881
+ t18
1882
+ ] }), $[59] = spacing, $[60] = t16, $[61] = t17, $[62] = t18, $[63] = t19) : t19 = $[63];
1883
+ let t20;
1884
+ $[64] !== fontSize || $[65] !== muted || $[66] !== text || $[67] !== weight ? (t20 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) }), $[64] = fontSize, $[65] = muted, $[66] = text, $[67] = weight, $[68] = t20) : t20 = $[68];
1885
+ let t21;
1886
+ $[69] !== padding || $[70] !== t19 || $[71] !== t20 ? (t21 = /* @__PURE__ */ jsxs(Flex, { padding, children: [
1887
+ t19,
1888
+ t20
1889
+ ] }), $[69] = padding, $[70] = t19, $[71] = t20, $[72] = t21) : t21 = $[72];
1890
+ const content2 = t21;
1891
+ if (href) {
1892
+ const t222 = selected ? "" : void 0;
1893
+ let t232;
1894
+ $[73] !== content2 || $[74] !== expanded || $[75] !== href || $[76] !== linkAs || $[77] !== tabIndex || $[78] !== tree.level ? (t232 = /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content2 }), $[73] = content2, $[74] = expanded, $[75] = href, $[76] = linkAs, $[77] = tabIndex, $[78] = tree.level, $[79] = t232) : t232 = $[79];
1895
+ let t242;
1896
+ $[80] !== children || $[81] !== expanded ? (t242 = children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }), $[80] = children, $[81] = expanded, $[82] = t242) : t242 = $[82];
1897
+ let t252;
1898
+ $[83] !== contextValue || $[84] !== t242 ? (t252 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t242 }), $[83] = contextValue, $[84] = t242, $[85] = t252) : t252 = $[85];
1899
+ let t262;
1900
+ return $[86] !== handleClick || $[87] !== id || $[88] !== itemKey || $[89] !== restProps || $[90] !== t222 || $[91] !== t232 || $[92] !== t252 ? (t262 = /* @__PURE__ */ jsxs(StyledTreeItem, { "data-selected": t222, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: setRootElement, role: "none", children: [
1901
+ t232,
1902
+ t252
1903
+ ] }), $[86] = handleClick, $[87] = id, $[88] = itemKey, $[89] = restProps, $[90] = t222, $[91] = t232, $[92] = t252, $[93] = t262) : t262 = $[93], t262;
1904
+ }
1905
+ const t22 = selected ? "" : void 0;
1906
+ let t23;
1907
+ $[94] !== content2 || $[95] !== tree.level ? (t23 = /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content2 }), $[94] = content2, $[95] = tree.level, $[96] = t23) : t23 = $[96];
1908
+ let t24;
1909
+ $[97] !== children || $[98] !== expanded ? (t24 = children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }), $[97] = children, $[98] = expanded, $[99] = t24) : t24 = $[99];
1910
+ let t25;
1911
+ $[100] !== contextValue || $[101] !== t24 ? (t25 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t24 }), $[100] = contextValue, $[101] = t24, $[102] = t25) : t25 = $[102];
1912
+ let t26;
1913
+ return $[103] !== expanded || $[104] !== handleClick || $[105] !== handleKeyDown || $[106] !== id || $[107] !== itemKey || $[108] !== restProps || $[109] !== t22 || $[110] !== t23 || $[111] !== t25 || $[112] !== tabIndex ? (t26 = /* @__PURE__ */ jsxs(StyledTreeItem, { "data-selected": t22, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, onClick: handleClick, onKeyDown: handleKeyDown, ref: setRootElement, role: "treeitem", tabIndex, children: [
1914
+ t23,
1915
+ t25
1916
+ ] }), $[103] = expanded, $[104] = handleClick, $[105] = handleKeyDown, $[106] = id, $[107] = itemKey, $[108] = restProps, $[109] = t22, $[110] = t23, $[111] = t25, $[112] = tabIndex, $[113] = t26) : t26 = $[113], t26;
1917
+ }
1918
+ TreeItem.displayName = "TreeItem";
1919
+ export {
1920
+ Arrow,
1921
+ Autocomplete,
1922
+ Avatar,
1923
+ AvatarCounter,
1924
+ AvatarStack,
1925
+ Badge,
1926
+ BoundaryElementProvider,
1927
+ Box,
1928
+ Breadcrumbs,
1929
+ Button,
1930
+ Card,
1931
+ Checkbox,
1932
+ Code,
1933
+ CodeSkeleton,
1934
+ ConditionalWrapper,
1935
+ Container,
1936
+ Dialog,
1937
+ DialogContext,
1938
+ DialogProvider,
1939
+ ElementQuery,
1940
+ ErrorBoundary,
1941
+ Flex,
1942
+ Grid,
1943
+ Heading,
1944
+ HeadingSkeleton,
1945
+ Hotkeys,
1946
+ Inline,
1947
+ KBD,
1948
+ Label,
1949
+ LabelSkeleton,
1950
+ Layer,
1951
+ LayerProvider,
1952
+ Menu,
1953
+ MenuButton,
1954
+ MenuDivider,
1955
+ MenuGroup,
1956
+ MenuItem,
1957
+ Popover,
1958
+ Portal,
1959
+ PortalProvider,
1960
+ Radio,
1961
+ Select,
1962
+ Skeleton,
1963
+ Spinner,
1964
+ SrOnly,
1965
+ Stack,
1966
+ Switch,
1967
+ Tab,
1968
+ TabList,
1969
+ TabPanel,
1970
+ Text,
1971
+ TextArea,
1972
+ TextInput,
1973
+ TextSkeleton,
1974
+ ThemeColorProvider,
1975
+ ThemeProvider,
1976
+ Toast,
1977
+ ToastProvider,
1978
+ Tooltip,
1979
+ TooltipDelayGroupContext,
1980
+ TooltipDelayGroupProvider,
1981
+ Tree,
1982
+ TreeItem,
1983
+ VirtualList,
1984
+ _ResizeObserver,
1985
+ _elementSizeObserver,
1986
+ _fillCSSObject,
1987
+ _getArrayProp,
1988
+ _getResponsiveSpace,
1989
+ _hasFocus,
1990
+ _isEnterToClickElement,
1991
+ _isScrollable,
1992
+ _raf,
1993
+ _raf2,
1994
+ _responsive,
1995
+ attemptFocus,
1996
+ containsOrEqualsElement,
1997
+ createColorTheme,
1998
+ focusFirstDescendant,
1999
+ focusLastDescendant,
2000
+ hexToRgb,
2001
+ hslToRgb,
2002
+ isFocusable,
2003
+ isHTMLAnchorElement,
2004
+ isHTMLButtonElement,
2005
+ isHTMLElement,
2006
+ isHTMLInputElement,
2007
+ isHTMLSelectElement,
2008
+ isHTMLTextAreaElement,
2009
+ multiply,
2010
+ parseColor,
2011
+ rem,
2012
+ responsiveCodeFontStyle,
2013
+ responsiveHeadingFont,
2014
+ responsiveLabelFont,
2015
+ responsiveTextAlignStyle,
2016
+ responsiveTextFont,
2017
+ rgbToHex,
2018
+ rgbToHsl,
2019
+ rgba,
2020
+ screen,
2021
+ studioTheme,
2022
+ useArrayProp,
2023
+ useBoundaryElement,
2024
+ useClickOutside,
2025
+ useClickOutsideEvent,
2026
+ useCustomValidity,
2027
+ useDialog,
2028
+ useElementRect,
2029
+ useElementSize,
2030
+ useForwardedRef,
2031
+ useGlobalKeyDown,
2032
+ useLayer,
2033
+ useMatchMedia,
2034
+ useMediaIndex,
2035
+ usePortal,
2036
+ usePrefersDark,
2037
+ usePrefersReducedMotion,
2038
+ useRootTheme,
2039
+ useTheme,
2040
+ useTheme_v2,
2041
+ useToast,
2042
+ useTooltipDelayGroup,
2043
+ useTree
2044
+ };