@automa8e/ui 0.2.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 (451) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -0
  3. package/dist/_virtual/index.js +6 -0
  4. package/dist/_virtual/index.js.map +1 -0
  5. package/dist/_virtual/index2.js +5 -0
  6. package/dist/_virtual/index2.js.map +1 -0
  7. package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
  8. package/dist/_virtual/use-sync-external-store-shim.development.js.map +1 -0
  9. package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
  10. package/dist/_virtual/use-sync-external-store-shim.production.js.map +1 -0
  11. package/dist/automa8e-ui.css +226 -0
  12. package/dist/components/automation/metric-card.d.ts +19 -0
  13. package/dist/components/automation/metric-card.d.ts.map +1 -0
  14. package/dist/components/automation/metric-card.js +59 -0
  15. package/dist/components/automation/metric-card.js.map +1 -0
  16. package/dist/components/automation/status-badge.d.ts +27 -0
  17. package/dist/components/automation/status-badge.d.ts.map +1 -0
  18. package/dist/components/automation/status-badge.js +112 -0
  19. package/dist/components/automation/status-badge.js.map +1 -0
  20. package/dist/components/automation/task-card.d.ts +14 -0
  21. package/dist/components/automation/task-card.d.ts.map +1 -0
  22. package/dist/components/automation/task-card.js +114 -0
  23. package/dist/components/automation/task-card.js.map +1 -0
  24. package/dist/components/automation/workflow-node.d.ts +20 -0
  25. package/dist/components/automation/workflow-node.d.ts.map +1 -0
  26. package/dist/components/automation/workflow-node.js +132 -0
  27. package/dist/components/automation/workflow-node.js.map +1 -0
  28. package/dist/components/layout/app-shell.d.ts +21 -0
  29. package/dist/components/layout/app-shell.d.ts.map +1 -0
  30. package/dist/components/layout/app-shell.js +35 -0
  31. package/dist/components/layout/app-shell.js.map +1 -0
  32. package/dist/components/layout/header.d.ts +16 -0
  33. package/dist/components/layout/header.d.ts.map +1 -0
  34. package/dist/components/layout/header.js +30 -0
  35. package/dist/components/layout/header.js.map +1 -0
  36. package/dist/components/layout/page-header.d.ts +16 -0
  37. package/dist/components/layout/page-header.d.ts.map +1 -0
  38. package/dist/components/layout/page-header.js +29 -0
  39. package/dist/components/layout/page-header.js.map +1 -0
  40. package/dist/components/layout/sidebar.d.ts +35 -0
  41. package/dist/components/layout/sidebar.d.ts.map +1 -0
  42. package/dist/components/layout/sidebar.js +103 -0
  43. package/dist/components/layout/sidebar.js.map +1 -0
  44. package/dist/components/ui/accordion.d.ts +8 -0
  45. package/dist/components/ui/accordion.d.ts.map +1 -0
  46. package/dist/components/ui/accordion.js +51 -0
  47. package/dist/components/ui/accordion.js.map +1 -0
  48. package/dist/components/ui/alert.d.ts +18 -0
  49. package/dist/components/ui/alert.d.ts.map +1 -0
  50. package/dist/components/ui/alert.js +89 -0
  51. package/dist/components/ui/alert.js.map +1 -0
  52. package/dist/components/ui/avatar.d.ts +20 -0
  53. package/dist/components/ui/avatar.d.ts.map +1 -0
  54. package/dist/components/ui/avatar.js +72 -0
  55. package/dist/components/ui/avatar.js.map +1 -0
  56. package/dist/components/ui/badge.d.ts +13 -0
  57. package/dist/components/ui/badge.d.ts.map +1 -0
  58. package/dist/components/ui/badge.js +54 -0
  59. package/dist/components/ui/badge.js.map +1 -0
  60. package/dist/components/ui/button.d.ts +15 -0
  61. package/dist/components/ui/button.d.ts.map +1 -0
  62. package/dist/components/ui/button.js +96 -0
  63. package/dist/components/ui/button.js.map +1 -0
  64. package/dist/components/ui/card.d.ts +16 -0
  65. package/dist/components/ui/card.d.ts.map +1 -0
  66. package/dist/components/ui/card.js +96 -0
  67. package/dist/components/ui/card.js.map +1 -0
  68. package/dist/components/ui/checkbox.d.ts +9 -0
  69. package/dist/components/ui/checkbox.d.ts.map +1 -0
  70. package/dist/components/ui/checkbox.js +29 -0
  71. package/dist/components/ui/checkbox.js.map +1 -0
  72. package/dist/components/ui/dialog.d.ts +28 -0
  73. package/dist/components/ui/dialog.d.ts.map +1 -0
  74. package/dist/components/ui/dialog.js +105 -0
  75. package/dist/components/ui/dialog.js.map +1 -0
  76. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  77. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  78. package/dist/components/ui/dropdown-menu.js +160 -0
  79. package/dist/components/ui/dropdown-menu.js.map +1 -0
  80. package/dist/components/ui/input.d.ts +14 -0
  81. package/dist/components/ui/input.d.ts.map +1 -0
  82. package/dist/components/ui/input.js +60 -0
  83. package/dist/components/ui/input.js.map +1 -0
  84. package/dist/components/ui/label.d.ts +13 -0
  85. package/dist/components/ui/label.d.ts.map +1 -0
  86. package/dist/components/ui/label.js +26 -0
  87. package/dist/components/ui/label.js.map +1 -0
  88. package/dist/components/ui/popover.d.ts +8 -0
  89. package/dist/components/ui/popover.d.ts.map +1 -0
  90. package/dist/components/ui/popover.js +29 -0
  91. package/dist/components/ui/popover.js.map +1 -0
  92. package/dist/components/ui/progress.d.ts +17 -0
  93. package/dist/components/ui/progress.d.ts.map +1 -0
  94. package/dist/components/ui/progress.js +80 -0
  95. package/dist/components/ui/progress.js.map +1 -0
  96. package/dist/components/ui/scroll-area.d.ts +6 -0
  97. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  98. package/dist/components/ui/scroll-area.js +39 -0
  99. package/dist/components/ui/scroll-area.js.map +1 -0
  100. package/dist/components/ui/select.d.ts +16 -0
  101. package/dist/components/ui/select.d.ts.map +1 -0
  102. package/dist/components/ui/select.js +131 -0
  103. package/dist/components/ui/select.js.map +1 -0
  104. package/dist/components/ui/separator.d.ts +9 -0
  105. package/dist/components/ui/separator.d.ts.map +1 -0
  106. package/dist/components/ui/separator.js +50 -0
  107. package/dist/components/ui/separator.js.map +1 -0
  108. package/dist/components/ui/skeleton.d.ts +10 -0
  109. package/dist/components/ui/skeleton.d.ts.map +1 -0
  110. package/dist/components/ui/skeleton.js +30 -0
  111. package/dist/components/ui/skeleton.js.map +1 -0
  112. package/dist/components/ui/spinner.d.ts +14 -0
  113. package/dist/components/ui/spinner.d.ts.map +1 -0
  114. package/dist/components/ui/spinner.js +44 -0
  115. package/dist/components/ui/spinner.js.map +1 -0
  116. package/dist/components/ui/switch.d.ts +8 -0
  117. package/dist/components/ui/switch.d.ts.map +1 -0
  118. package/dist/components/ui/switch.js +43 -0
  119. package/dist/components/ui/switch.js.map +1 -0
  120. package/dist/components/ui/table.d.ts +11 -0
  121. package/dist/components/ui/table.d.ts.map +1 -0
  122. package/dist/components/ui/table.js +95 -0
  123. package/dist/components/ui/table.js.map +1 -0
  124. package/dist/components/ui/tabs.d.ts +20 -0
  125. package/dist/components/ui/tabs.d.ts.map +1 -0
  126. package/dist/components/ui/tabs.js +92 -0
  127. package/dist/components/ui/tabs.js.map +1 -0
  128. package/dist/components/ui/textarea.d.ts +12 -0
  129. package/dist/components/ui/textarea.d.ts.map +1 -0
  130. package/dist/components/ui/textarea.js +41 -0
  131. package/dist/components/ui/textarea.js.map +1 -0
  132. package/dist/components/ui/toast.d.ts +16 -0
  133. package/dist/components/ui/toast.d.ts.map +1 -0
  134. package/dist/components/ui/toast.js +113 -0
  135. package/dist/components/ui/toast.js.map +1 -0
  136. package/dist/components/ui/tooltip.d.ts +8 -0
  137. package/dist/components/ui/tooltip.d.ts.map +1 -0
  138. package/dist/components/ui/tooltip.js +28 -0
  139. package/dist/components/ui/tooltip.js.map +1 -0
  140. package/dist/hooks/use-debounce.d.ts +15 -0
  141. package/dist/hooks/use-debounce.d.ts.map +1 -0
  142. package/dist/hooks/use-debounce.js +15 -0
  143. package/dist/hooks/use-debounce.js.map +1 -0
  144. package/dist/hooks/use-local-storage.d.ts +9 -0
  145. package/dist/hooks/use-local-storage.d.ts.map +1 -0
  146. package/dist/hooks/use-local-storage.js +49 -0
  147. package/dist/hooks/use-local-storage.js.map +1 -0
  148. package/dist/hooks/use-media-query.d.ts +9 -0
  149. package/dist/hooks/use-media-query.d.ts.map +1 -0
  150. package/dist/hooks/use-media-query.js +20 -0
  151. package/dist/hooks/use-media-query.js.map +1 -0
  152. package/dist/index.d.ts +66 -0
  153. package/dist/index.d.ts.map +1 -0
  154. package/dist/index.js +153 -0
  155. package/dist/index.js.map +1 -0
  156. package/dist/lib/colors.d.ts +73 -0
  157. package/dist/lib/colors.d.ts.map +1 -0
  158. package/dist/lib/colors.js +64 -0
  159. package/dist/lib/colors.js.map +1 -0
  160. package/dist/lib/utils.d.ts +7 -0
  161. package/dist/lib/utils.d.ts.map +1 -0
  162. package/dist/lib/utils.js +9 -0
  163. package/dist/lib/utils.js.map +1 -0
  164. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +729 -0
  165. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
  166. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +630 -0
  167. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
  168. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +325 -0
  169. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -0
  170. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +177 -0
  171. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
  172. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +152 -0
  173. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
  174. package/dist/node_modules/@radix-ui/number/dist/index.js +7 -0
  175. package/dist/node_modules/@radix-ui/number/dist/index.js.map +1 -0
  176. package/dist/node_modules/@radix-ui/primitive/dist/index.js +12 -0
  177. package/dist/node_modules/@radix-ui/primitive/dist/index.js.map +1 -0
  178. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +319 -0
  179. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js.map +1 -0
  180. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +26 -0
  181. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js.map +1 -0
  182. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +124 -0
  183. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js.map +1 -0
  184. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js +66 -0
  185. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js.map +1 -0
  186. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js +40 -0
  187. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
  188. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +280 -0
  189. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js.map +1 -0
  190. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +152 -0
  191. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js.map +1 -0
  192. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +71 -0
  193. package/dist/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -0
  194. package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
  195. package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
  196. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +40 -0
  197. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -0
  198. package/dist/node_modules/@radix-ui/react-context/dist/index.js +82 -0
  199. package/dist/node_modules/@radix-ui/react-context/dist/index.js.map +1 -0
  200. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +342 -0
  201. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js.map +1 -0
  202. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
  203. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
  204. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +11 -0
  205. package/dist/node_modules/@radix-ui/react-direction/dist/index.js.map +1 -0
  206. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +217 -0
  207. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -0
  208. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +299 -0
  209. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map +1 -0
  210. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +30 -0
  211. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -0
  212. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +209 -0
  213. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -0
  214. package/dist/node_modules/@radix-ui/react-id/dist/index.js +15 -0
  215. package/dist/node_modules/@radix-ui/react-id/dist/index.js.map +1 -0
  216. package/dist/node_modules/@radix-ui/react-label/dist/index.js +27 -0
  217. package/dist/node_modules/@radix-ui/react-label/dist/index.js.map +1 -0
  218. package/dist/node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.js +40 -0
  219. package/dist/node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
  220. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +881 -0
  221. package/dist/node_modules/@radix-ui/react-menu/dist/index.js.map +1 -0
  222. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
  223. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
  224. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +314 -0
  225. package/dist/node_modules/@radix-ui/react-popover/dist/index.js.map +1 -0
  226. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
  227. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
  228. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +294 -0
  229. package/dist/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -0
  230. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +19 -0
  231. package/dist/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -0
  232. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +130 -0
  233. package/dist/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -0
  234. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +44 -0
  235. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
  236. package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
  237. package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
  238. package/dist/node_modules/@radix-ui/react-progress/dist/index.js +97 -0
  239. package/dist/node_modules/@radix-ui/react-progress/dist/index.js.map +1 -0
  240. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.js +66 -0
  241. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.js.map +1 -0
  242. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive/dist/index.js +40 -0
  243. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
  244. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +228 -0
  245. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -0
  246. package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +728 -0
  247. package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js.map +1 -0
  248. package/dist/node_modules/@radix-ui/react-select/dist/index.js +1200 -0
  249. package/dist/node_modules/@radix-ui/react-select/dist/index.js.map +1 -0
  250. package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
  251. package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
  252. package/dist/node_modules/@radix-ui/react-separator/dist/index.js +31 -0
  253. package/dist/node_modules/@radix-ui/react-separator/dist/index.js.map +1 -0
  254. package/dist/node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive/dist/index.js +40 -0
  255. package/dist/node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
  256. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +107 -0
  257. package/dist/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
  258. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +156 -0
  259. package/dist/node_modules/@radix-ui/react-switch/dist/index.js.map +1 -0
  260. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +195 -0
  261. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js.map +1 -0
  262. package/dist/node_modules/@radix-ui/react-toast/dist/index.js +645 -0
  263. package/dist/node_modules/@radix-ui/react-toast/dist/index.js.map +1 -0
  264. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +501 -0
  265. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js.map +1 -0
  266. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +16 -0
  267. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
  268. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +15 -0
  269. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -0
  270. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +72 -0
  271. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -0
  272. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +18 -0
  273. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -0
  274. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
  275. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js.map +1 -0
  276. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
  277. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -0
  278. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +15 -0
  279. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js.map +1 -0
  280. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +40 -0
  281. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -0
  282. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +37 -0
  283. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js.map +1 -0
  284. package/dist/node_modules/aria-hidden/dist/es2015/index.js +123 -0
  285. package/dist/node_modules/aria-hidden/dist/es2015/index.js.map +1 -0
  286. package/dist/node_modules/class-variance-authority/dist/index.js +46 -0
  287. package/dist/node_modules/class-variance-authority/dist/index.js.map +1 -0
  288. package/dist/node_modules/clsx/dist/clsx.js +17 -0
  289. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  290. package/dist/node_modules/get-nonce/dist/es2015/index.js +10 -0
  291. package/dist/node_modules/get-nonce/dist/es2015/index.js.map +1 -0
  292. package/dist/node_modules/lucide-react/dist/esm/Icon.js +43 -0
  293. package/dist/node_modules/lucide-react/dist/esm/Icon.js.map +1 -0
  294. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +25 -0
  295. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js.map +1 -0
  296. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +21 -0
  297. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js.map +1 -0
  298. package/dist/node_modules/lucide-react/dist/esm/icons/ban.js +15 -0
  299. package/dist/node_modules/lucide-react/dist/esm/icons/ban.js.map +1 -0
  300. package/dist/node_modules/lucide-react/dist/esm/icons/calendar.js +17 -0
  301. package/dist/node_modules/lucide-react/dist/esm/icons/calendar.js.map +1 -0
  302. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +12 -0
  303. package/dist/node_modules/lucide-react/dist/esm/icons/check.js.map +1 -0
  304. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +14 -0
  305. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js.map +1 -0
  306. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +14 -0
  307. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js.map +1 -0
  308. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +14 -0
  309. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js.map +1 -0
  310. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +12 -0
  311. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js.map +1 -0
  312. package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js +16 -0
  313. package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js.map +1 -0
  314. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.js +15 -0
  315. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.js.map +1 -0
  316. package/dist/node_modules/lucide-react/dist/esm/icons/circle-minus.js +15 -0
  317. package/dist/node_modules/lucide-react/dist/esm/icons/circle-minus.js.map +1 -0
  318. package/dist/node_modules/lucide-react/dist/esm/icons/circle-x.js +16 -0
  319. package/dist/node_modules/lucide-react/dist/esm/icons/circle-x.js.map +1 -0
  320. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +14 -0
  321. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js.map +1 -0
  322. package/dist/node_modules/lucide-react/dist/esm/icons/clock.js +15 -0
  323. package/dist/node_modules/lucide-react/dist/esm/icons/clock.js.map +1 -0
  324. package/dist/node_modules/lucide-react/dist/esm/icons/flag.js +15 -0
  325. package/dist/node_modules/lucide-react/dist/esm/icons/flag.js.map +1 -0
  326. package/dist/node_modules/lucide-react/dist/esm/icons/git-branch.js +17 -0
  327. package/dist/node_modules/lucide-react/dist/esm/icons/git-branch.js.map +1 -0
  328. package/dist/node_modules/lucide-react/dist/esm/icons/info.js +16 -0
  329. package/dist/node_modules/lucide-react/dist/esm/icons/info.js.map +1 -0
  330. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.js +14 -0
  331. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.js.map +1 -0
  332. package/dist/node_modules/lucide-react/dist/esm/icons/minus.js +12 -0
  333. package/dist/node_modules/lucide-react/dist/esm/icons/minus.js.map +1 -0
  334. package/dist/node_modules/lucide-react/dist/esm/icons/pause.js +15 -0
  335. package/dist/node_modules/lucide-react/dist/esm/icons/pause.js.map +1 -0
  336. package/dist/node_modules/lucide-react/dist/esm/icons/play.js +14 -0
  337. package/dist/node_modules/lucide-react/dist/esm/icons/play.js.map +1 -0
  338. package/dist/node_modules/lucide-react/dist/esm/icons/send.js +21 -0
  339. package/dist/node_modules/lucide-react/dist/esm/icons/send.js.map +1 -0
  340. package/dist/node_modules/lucide-react/dist/esm/icons/tag.js +21 -0
  341. package/dist/node_modules/lucide-react/dist/esm/icons/tag.js.map +1 -0
  342. package/dist/node_modules/lucide-react/dist/esm/icons/timer.js +16 -0
  343. package/dist/node_modules/lucide-react/dist/esm/icons/timer.js.map +1 -0
  344. package/dist/node_modules/lucide-react/dist/esm/icons/trending-down.js +15 -0
  345. package/dist/node_modules/lucide-react/dist/esm/icons/trending-down.js.map +1 -0
  346. package/dist/node_modules/lucide-react/dist/esm/icons/trending-up.js +15 -0
  347. package/dist/node_modules/lucide-react/dist/esm/icons/trending-up.js.map +1 -0
  348. package/dist/node_modules/lucide-react/dist/esm/icons/triangle-alert.js +22 -0
  349. package/dist/node_modules/lucide-react/dist/esm/icons/triangle-alert.js.map +1 -0
  350. package/dist/node_modules/lucide-react/dist/esm/icons/x.js +15 -0
  351. package/dist/node_modules/lucide-react/dist/esm/icons/x.js.map +1 -0
  352. package/dist/node_modules/lucide-react/dist/esm/icons/zap.js +20 -0
  353. package/dist/node_modules/lucide-react/dist/esm/icons/zap.js.map +1 -0
  354. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +15 -0
  355. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js.map +1 -0
  356. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +12 -0
  357. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -0
  358. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +181 -0
  359. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -0
  360. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +39 -0
  361. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -0
  362. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +20 -0
  363. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +1 -0
  364. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +103 -0
  365. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -0
  366. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +6 -0
  367. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js.map +1 -0
  368. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +8 -0
  369. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js.map +1 -0
  370. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +48 -0
  371. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -0
  372. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +11 -0
  373. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js.map +1 -0
  374. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +38 -0
  375. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js.map +1 -0
  376. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +14 -0
  377. package/dist/node_modules/react-style-singleton/dist/es2015/component.js.map +1 -0
  378. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +17 -0
  379. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js.map +1 -0
  380. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +49 -0
  381. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js.map +1 -0
  382. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2467 -0
  383. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  384. package/dist/node_modules/tslib/tslib.es6.js +40 -0
  385. package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
  386. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +12 -0
  387. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js.map +1 -0
  388. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +36 -0
  389. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -0
  390. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +30 -0
  391. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -0
  392. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +22 -0
  393. package/dist/node_modules/use-sidecar/dist/es2015/exports.js.map +1 -0
  394. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +89 -0
  395. package/dist/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -0
  396. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +78 -0
  397. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
  398. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +63 -0
  399. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -0
  400. package/dist/node_modules/use-sync-external-store/shim/index.js +18 -0
  401. package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -0
  402. package/dist/types/automation.d.ts +59 -0
  403. package/dist/types/automation.d.ts.map +1 -0
  404. package/dist/types/common.d.ts +38 -0
  405. package/dist/types/common.d.ts.map +1 -0
  406. package/package.json +119 -0
  407. package/registry/registry.json +218 -0
  408. package/src/components/automation/metric-card.tsx +113 -0
  409. package/src/components/automation/status-badge.tsx +136 -0
  410. package/src/components/automation/task-card.tsx +164 -0
  411. package/src/components/automation/workflow-node.tsx +186 -0
  412. package/src/components/layout/app-shell.tsx +58 -0
  413. package/src/components/layout/header.tsx +39 -0
  414. package/src/components/layout/page-header.tsx +42 -0
  415. package/src/components/layout/sidebar.tsx +190 -0
  416. package/src/components/ui/accordion.tsx +57 -0
  417. package/src/components/ui/alert.tsx +93 -0
  418. package/src/components/ui/avatar.tsx +94 -0
  419. package/src/components/ui/badge.tsx +69 -0
  420. package/src/components/ui/button.tsx +106 -0
  421. package/src/components/ui/card.tsx +96 -0
  422. package/src/components/ui/checkbox.tsx +40 -0
  423. package/src/components/ui/dialog.tsx +129 -0
  424. package/src/components/ui/dropdown-menu.tsx +194 -0
  425. package/src/components/ui/input.tsx +80 -0
  426. package/src/components/ui/label.tsx +37 -0
  427. package/src/components/ui/popover.tsx +29 -0
  428. package/src/components/ui/progress.tsx +92 -0
  429. package/src/components/ui/scroll-area.tsx +43 -0
  430. package/src/components/ui/select.tsx +157 -0
  431. package/src/components/ui/separator.tsx +56 -0
  432. package/src/components/ui/skeleton.tsx +41 -0
  433. package/src/components/ui/spinner.tsx +50 -0
  434. package/src/components/ui/switch.tsx +46 -0
  435. package/src/components/ui/table.tsx +117 -0
  436. package/src/components/ui/tabs.tsx +107 -0
  437. package/src/components/ui/textarea.tsx +50 -0
  438. package/src/components/ui/toast.tsx +139 -0
  439. package/src/components/ui/tooltip.tsx +28 -0
  440. package/src/hooks/use-debounce.ts +28 -0
  441. package/src/hooks/use-local-storage.ts +63 -0
  442. package/src/hooks/use-media-query.ts +29 -0
  443. package/src/index.ts +197 -0
  444. package/src/lib/colors.ts +102 -0
  445. package/src/lib/utils.ts +10 -0
  446. package/src/styles/globals.css +230 -0
  447. package/src/types/automation.ts +74 -0
  448. package/src/types/common.ts +48 -0
  449. package/tailwind/preset.cjs +98 -0
  450. package/tailwind/preset.css +5 -0
  451. package/tailwind/preset.ts +159 -0
@@ -0,0 +1,881 @@
1
+ import * as React from "react";
2
+ import { composeEventHandlers } from "../../primitive/dist/index.js";
3
+ import { createCollection } from "../../react-collection/dist/index.js";
4
+ import { useComposedRefs, composeRefs } from "../../react-compose-refs/dist/index.js";
5
+ import { createContextScope } from "../../react-context/dist/index.js";
6
+ import { useDirection } from "../../react-direction/dist/index.js";
7
+ import { DismissableLayer } from "../../react-dismissable-layer/dist/index.js";
8
+ import { useFocusGuards } from "../../react-focus-guards/dist/index.js";
9
+ import { FocusScope } from "../../react-focus-scope/dist/index.js";
10
+ import { useId } from "../../react-id/dist/index.js";
11
+ import { Root as Root2, Anchor, createPopperScope, Content, Arrow } from "../../react-popper/dist/index.js";
12
+ import { Portal as Portal$1 } from "../../react-portal/dist/index.js";
13
+ import { Presence } from "../../react-presence/dist/index.js";
14
+ import { Primitive, dispatchDiscreteCustomEvent } from "../../react-primitive/dist/index.js";
15
+ import { createRovingFocusGroupScope, Item, Root } from "../../react-roving-focus/dist/index.js";
16
+ import { createSlot } from "../node_modules/@radix-ui/react-slot/dist/index.js";
17
+ import { useCallbackRef } from "../../react-use-callback-ref/dist/index.js";
18
+ import { hideOthers } from "../../../aria-hidden/dist/es2015/index.js";
19
+ import ReactRemoveScroll from "../../../react-remove-scroll/dist/es2015/Combination.js";
20
+ import { jsx } from "react/jsx-runtime";
21
+ var SELECTION_KEYS = ["Enter", " "];
22
+ var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"];
23
+ var LAST_KEYS = ["ArrowUp", "PageDown", "End"];
24
+ var FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
25
+ var SUB_OPEN_KEYS = {
26
+ ltr: [...SELECTION_KEYS, "ArrowRight"],
27
+ rtl: [...SELECTION_KEYS, "ArrowLeft"]
28
+ };
29
+ var SUB_CLOSE_KEYS = {
30
+ ltr: ["ArrowLeft"],
31
+ rtl: ["ArrowRight"]
32
+ };
33
+ var MENU_NAME = "Menu";
34
+ var [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);
35
+ var [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [
36
+ createCollectionScope,
37
+ createPopperScope,
38
+ createRovingFocusGroupScope
39
+ ]);
40
+ var usePopperScope = createPopperScope();
41
+ var useRovingFocusGroupScope = createRovingFocusGroupScope();
42
+ var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
43
+ var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
44
+ var Menu = (props) => {
45
+ const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
46
+ const popperScope = usePopperScope(__scopeMenu);
47
+ const [content, setContent] = React.useState(null);
48
+ const isUsingKeyboardRef = React.useRef(false);
49
+ const handleOpenChange = useCallbackRef(onOpenChange);
50
+ const direction = useDirection(dir);
51
+ React.useEffect(() => {
52
+ const handleKeyDown = () => {
53
+ isUsingKeyboardRef.current = true;
54
+ document.addEventListener("pointerdown", handlePointer, { capture: true, once: true });
55
+ document.addEventListener("pointermove", handlePointer, { capture: true, once: true });
56
+ };
57
+ const handlePointer = () => isUsingKeyboardRef.current = false;
58
+ document.addEventListener("keydown", handleKeyDown, { capture: true });
59
+ return () => {
60
+ document.removeEventListener("keydown", handleKeyDown, { capture: true });
61
+ document.removeEventListener("pointerdown", handlePointer, { capture: true });
62
+ document.removeEventListener("pointermove", handlePointer, { capture: true });
63
+ };
64
+ }, []);
65
+ return /* @__PURE__ */ jsx(Root2, { ...popperScope, children: /* @__PURE__ */ jsx(
66
+ MenuProvider,
67
+ {
68
+ scope: __scopeMenu,
69
+ open,
70
+ onOpenChange: handleOpenChange,
71
+ content,
72
+ onContentChange: setContent,
73
+ children: /* @__PURE__ */ jsx(
74
+ MenuRootProvider,
75
+ {
76
+ scope: __scopeMenu,
77
+ onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]),
78
+ isUsingKeyboardRef,
79
+ dir: direction,
80
+ modal,
81
+ children
82
+ }
83
+ )
84
+ }
85
+ ) });
86
+ };
87
+ Menu.displayName = MENU_NAME;
88
+ var ANCHOR_NAME = "MenuAnchor";
89
+ var MenuAnchor = React.forwardRef(
90
+ (props, forwardedRef) => {
91
+ const { __scopeMenu, ...anchorProps } = props;
92
+ const popperScope = usePopperScope(__scopeMenu);
93
+ return /* @__PURE__ */ jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
94
+ }
95
+ );
96
+ MenuAnchor.displayName = ANCHOR_NAME;
97
+ var PORTAL_NAME = "MenuPortal";
98
+ var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {
99
+ forceMount: void 0
100
+ });
101
+ var MenuPortal = (props) => {
102
+ const { __scopeMenu, forceMount, children, container } = props;
103
+ const context = useMenuContext(PORTAL_NAME, __scopeMenu);
104
+ return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$1, { asChild: true, container, children }) }) });
105
+ };
106
+ MenuPortal.displayName = PORTAL_NAME;
107
+ var CONTENT_NAME = "MenuContent";
108
+ var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME);
109
+ var MenuContent = React.forwardRef(
110
+ (props, forwardedRef) => {
111
+ const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);
112
+ const { forceMount = portalContext.forceMount, ...contentProps } = props;
113
+ const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
114
+ const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);
115
+ return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
116
+ }
117
+ );
118
+ var MenuRootContentModal = React.forwardRef(
119
+ (props, forwardedRef) => {
120
+ const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
121
+ const ref = React.useRef(null);
122
+ const composedRefs = useComposedRefs(forwardedRef, ref);
123
+ React.useEffect(() => {
124
+ const content = ref.current;
125
+ if (content) return hideOthers(content);
126
+ }, []);
127
+ return /* @__PURE__ */ jsx(
128
+ MenuContentImpl,
129
+ {
130
+ ...props,
131
+ ref: composedRefs,
132
+ trapFocus: context.open,
133
+ disableOutsidePointerEvents: context.open,
134
+ disableOutsideScroll: true,
135
+ onFocusOutside: composeEventHandlers(
136
+ props.onFocusOutside,
137
+ (event) => event.preventDefault(),
138
+ { checkForDefaultPrevented: false }
139
+ ),
140
+ onDismiss: () => context.onOpenChange(false)
141
+ }
142
+ );
143
+ }
144
+ );
145
+ var MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {
146
+ const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
147
+ return /* @__PURE__ */ jsx(
148
+ MenuContentImpl,
149
+ {
150
+ ...props,
151
+ ref: forwardedRef,
152
+ trapFocus: false,
153
+ disableOutsidePointerEvents: false,
154
+ disableOutsideScroll: false,
155
+ onDismiss: () => context.onOpenChange(false)
156
+ }
157
+ );
158
+ });
159
+ var Slot = createSlot("MenuContent.ScrollLock");
160
+ var MenuContentImpl = React.forwardRef(
161
+ (props, forwardedRef) => {
162
+ const {
163
+ __scopeMenu,
164
+ loop = false,
165
+ trapFocus,
166
+ onOpenAutoFocus,
167
+ onCloseAutoFocus,
168
+ disableOutsidePointerEvents,
169
+ onEntryFocus,
170
+ onEscapeKeyDown,
171
+ onPointerDownOutside,
172
+ onFocusOutside,
173
+ onInteractOutside,
174
+ onDismiss,
175
+ disableOutsideScroll,
176
+ ...contentProps
177
+ } = props;
178
+ const context = useMenuContext(CONTENT_NAME, __scopeMenu);
179
+ const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);
180
+ const popperScope = usePopperScope(__scopeMenu);
181
+ const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
182
+ const getItems = useCollection(__scopeMenu);
183
+ const [currentItemId, setCurrentItemId] = React.useState(null);
184
+ const contentRef = React.useRef(null);
185
+ const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
186
+ const timerRef = React.useRef(0);
187
+ const searchRef = React.useRef("");
188
+ const pointerGraceTimerRef = React.useRef(0);
189
+ const pointerGraceIntentRef = React.useRef(null);
190
+ const pointerDirRef = React.useRef("right");
191
+ const lastPointerXRef = React.useRef(0);
192
+ const ScrollLockWrapper = disableOutsideScroll ? ReactRemoveScroll : React.Fragment;
193
+ const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;
194
+ const handleTypeaheadSearch = (key) => {
195
+ var _a, _b;
196
+ const search = searchRef.current + key;
197
+ const items = getItems().filter((item) => !item.disabled);
198
+ const currentItem = document.activeElement;
199
+ const currentMatch = (_a = items.find((item) => item.ref.current === currentItem)) == null ? void 0 : _a.textValue;
200
+ const values = items.map((item) => item.textValue);
201
+ const nextMatch = getNextMatch(values, search, currentMatch);
202
+ const newItem = (_b = items.find((item) => item.textValue === nextMatch)) == null ? void 0 : _b.ref.current;
203
+ (function updateSearch(value) {
204
+ searchRef.current = value;
205
+ window.clearTimeout(timerRef.current);
206
+ if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3);
207
+ })(search);
208
+ if (newItem) {
209
+ setTimeout(() => newItem.focus());
210
+ }
211
+ };
212
+ React.useEffect(() => {
213
+ return () => window.clearTimeout(timerRef.current);
214
+ }, []);
215
+ useFocusGuards();
216
+ const isPointerMovingToSubmenu = React.useCallback((event) => {
217
+ var _a, _b;
218
+ const isMovingTowards = pointerDirRef.current === ((_a = pointerGraceIntentRef.current) == null ? void 0 : _a.side);
219
+ return isMovingTowards && isPointerInGraceArea(event, (_b = pointerGraceIntentRef.current) == null ? void 0 : _b.area);
220
+ }, []);
221
+ return /* @__PURE__ */ jsx(
222
+ MenuContentProvider,
223
+ {
224
+ scope: __scopeMenu,
225
+ searchRef,
226
+ onItemEnter: React.useCallback(
227
+ (event) => {
228
+ if (isPointerMovingToSubmenu(event)) event.preventDefault();
229
+ },
230
+ [isPointerMovingToSubmenu]
231
+ ),
232
+ onItemLeave: React.useCallback(
233
+ (event) => {
234
+ var _a;
235
+ if (isPointerMovingToSubmenu(event)) return;
236
+ (_a = contentRef.current) == null ? void 0 : _a.focus();
237
+ setCurrentItemId(null);
238
+ },
239
+ [isPointerMovingToSubmenu]
240
+ ),
241
+ onTriggerLeave: React.useCallback(
242
+ (event) => {
243
+ if (isPointerMovingToSubmenu(event)) event.preventDefault();
244
+ },
245
+ [isPointerMovingToSubmenu]
246
+ ),
247
+ pointerGraceTimerRef,
248
+ onPointerGraceIntentChange: React.useCallback((intent) => {
249
+ pointerGraceIntentRef.current = intent;
250
+ }, []),
251
+ children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(
252
+ FocusScope,
253
+ {
254
+ asChild: true,
255
+ trapped: trapFocus,
256
+ onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {
257
+ var _a;
258
+ event.preventDefault();
259
+ (_a = contentRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
260
+ }),
261
+ onUnmountAutoFocus: onCloseAutoFocus,
262
+ children: /* @__PURE__ */ jsx(
263
+ DismissableLayer,
264
+ {
265
+ asChild: true,
266
+ disableOutsidePointerEvents,
267
+ onEscapeKeyDown,
268
+ onPointerDownOutside,
269
+ onFocusOutside,
270
+ onInteractOutside,
271
+ onDismiss,
272
+ children: /* @__PURE__ */ jsx(
273
+ Root,
274
+ {
275
+ asChild: true,
276
+ ...rovingFocusGroupScope,
277
+ dir: rootContext.dir,
278
+ orientation: "vertical",
279
+ loop,
280
+ currentTabStopId: currentItemId,
281
+ onCurrentTabStopIdChange: setCurrentItemId,
282
+ onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {
283
+ if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
284
+ }),
285
+ preventScrollOnEntryFocus: true,
286
+ children: /* @__PURE__ */ jsx(
287
+ Content,
288
+ {
289
+ role: "menu",
290
+ "aria-orientation": "vertical",
291
+ "data-state": getOpenState(context.open),
292
+ "data-radix-menu-content": "",
293
+ dir: rootContext.dir,
294
+ ...popperScope,
295
+ ...contentProps,
296
+ ref: composedRefs,
297
+ style: { outline: "none", ...contentProps.style },
298
+ onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {
299
+ const target = event.target;
300
+ const isKeyDownInside = target.closest("[data-radix-menu-content]") === event.currentTarget;
301
+ const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
302
+ const isCharacterKey = event.key.length === 1;
303
+ if (isKeyDownInside) {
304
+ if (event.key === "Tab") event.preventDefault();
305
+ if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);
306
+ }
307
+ const content = contentRef.current;
308
+ if (event.target !== content) return;
309
+ if (!FIRST_LAST_KEYS.includes(event.key)) return;
310
+ event.preventDefault();
311
+ const items = getItems().filter((item) => !item.disabled);
312
+ const candidateNodes = items.map((item) => item.ref.current);
313
+ if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();
314
+ focusFirst(candidateNodes);
315
+ }),
316
+ onBlur: composeEventHandlers(props.onBlur, (event) => {
317
+ if (!event.currentTarget.contains(event.target)) {
318
+ window.clearTimeout(timerRef.current);
319
+ searchRef.current = "";
320
+ }
321
+ }),
322
+ onPointerMove: composeEventHandlers(
323
+ props.onPointerMove,
324
+ whenMouse((event) => {
325
+ const target = event.target;
326
+ const pointerXHasChanged = lastPointerXRef.current !== event.clientX;
327
+ if (event.currentTarget.contains(target) && pointerXHasChanged) {
328
+ const newDir = event.clientX > lastPointerXRef.current ? "right" : "left";
329
+ pointerDirRef.current = newDir;
330
+ lastPointerXRef.current = event.clientX;
331
+ }
332
+ })
333
+ )
334
+ }
335
+ )
336
+ }
337
+ )
338
+ }
339
+ )
340
+ }
341
+ ) })
342
+ }
343
+ );
344
+ }
345
+ );
346
+ MenuContent.displayName = CONTENT_NAME;
347
+ var GROUP_NAME = "MenuGroup";
348
+ var MenuGroup = React.forwardRef(
349
+ (props, forwardedRef) => {
350
+ const { __scopeMenu, ...groupProps } = props;
351
+ return /* @__PURE__ */ jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
352
+ }
353
+ );
354
+ MenuGroup.displayName = GROUP_NAME;
355
+ var LABEL_NAME = "MenuLabel";
356
+ var MenuLabel = React.forwardRef(
357
+ (props, forwardedRef) => {
358
+ const { __scopeMenu, ...labelProps } = props;
359
+ return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
360
+ }
361
+ );
362
+ MenuLabel.displayName = LABEL_NAME;
363
+ var ITEM_NAME = "MenuItem";
364
+ var ITEM_SELECT = "menu.itemSelect";
365
+ var MenuItem = React.forwardRef(
366
+ (props, forwardedRef) => {
367
+ const { disabled = false, onSelect, ...itemProps } = props;
368
+ const ref = React.useRef(null);
369
+ const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);
370
+ const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);
371
+ const composedRefs = useComposedRefs(forwardedRef, ref);
372
+ const isPointerDownRef = React.useRef(false);
373
+ const handleSelect = () => {
374
+ const menuItem = ref.current;
375
+ if (!disabled && menuItem) {
376
+ const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });
377
+ menuItem.addEventListener(ITEM_SELECT, (event) => onSelect == null ? void 0 : onSelect(event), { once: true });
378
+ dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);
379
+ if (itemSelectEvent.defaultPrevented) {
380
+ isPointerDownRef.current = false;
381
+ } else {
382
+ rootContext.onClose();
383
+ }
384
+ }
385
+ };
386
+ return /* @__PURE__ */ jsx(
387
+ MenuItemImpl,
388
+ {
389
+ ...itemProps,
390
+ ref: composedRefs,
391
+ disabled,
392
+ onClick: composeEventHandlers(props.onClick, handleSelect),
393
+ onPointerDown: (event) => {
394
+ var _a;
395
+ (_a = props.onPointerDown) == null ? void 0 : _a.call(props, event);
396
+ isPointerDownRef.current = true;
397
+ },
398
+ onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
399
+ var _a;
400
+ if (!isPointerDownRef.current) (_a = event.currentTarget) == null ? void 0 : _a.click();
401
+ }),
402
+ onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
403
+ const isTypingAhead = contentContext.searchRef.current !== "";
404
+ if (disabled || isTypingAhead && event.key === " ") return;
405
+ if (SELECTION_KEYS.includes(event.key)) {
406
+ event.currentTarget.click();
407
+ event.preventDefault();
408
+ }
409
+ })
410
+ }
411
+ );
412
+ }
413
+ );
414
+ MenuItem.displayName = ITEM_NAME;
415
+ var MenuItemImpl = React.forwardRef(
416
+ (props, forwardedRef) => {
417
+ const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
418
+ const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);
419
+ const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
420
+ const ref = React.useRef(null);
421
+ const composedRefs = useComposedRefs(forwardedRef, ref);
422
+ const [isFocused, setIsFocused] = React.useState(false);
423
+ const [textContent, setTextContent] = React.useState("");
424
+ React.useEffect(() => {
425
+ const menuItem = ref.current;
426
+ if (menuItem) {
427
+ setTextContent((menuItem.textContent ?? "").trim());
428
+ }
429
+ }, [itemProps.children]);
430
+ return /* @__PURE__ */ jsx(
431
+ Collection.ItemSlot,
432
+ {
433
+ scope: __scopeMenu,
434
+ disabled,
435
+ textValue: textValue ?? textContent,
436
+ children: /* @__PURE__ */ jsx(Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(
437
+ Primitive.div,
438
+ {
439
+ role: "menuitem",
440
+ "data-highlighted": isFocused ? "" : void 0,
441
+ "aria-disabled": disabled || void 0,
442
+ "data-disabled": disabled ? "" : void 0,
443
+ ...itemProps,
444
+ ref: composedRefs,
445
+ onPointerMove: composeEventHandlers(
446
+ props.onPointerMove,
447
+ whenMouse((event) => {
448
+ if (disabled) {
449
+ contentContext.onItemLeave(event);
450
+ } else {
451
+ contentContext.onItemEnter(event);
452
+ if (!event.defaultPrevented) {
453
+ const item = event.currentTarget;
454
+ item.focus({ preventScroll: true });
455
+ }
456
+ }
457
+ })
458
+ ),
459
+ onPointerLeave: composeEventHandlers(
460
+ props.onPointerLeave,
461
+ whenMouse((event) => contentContext.onItemLeave(event))
462
+ ),
463
+ onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),
464
+ onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))
465
+ }
466
+ ) })
467
+ }
468
+ );
469
+ }
470
+ );
471
+ var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
472
+ var MenuCheckboxItem = React.forwardRef(
473
+ (props, forwardedRef) => {
474
+ const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
475
+ return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(
476
+ MenuItem,
477
+ {
478
+ role: "menuitemcheckbox",
479
+ "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
480
+ ...checkboxItemProps,
481
+ ref: forwardedRef,
482
+ "data-state": getCheckedState(checked),
483
+ onSelect: composeEventHandlers(
484
+ checkboxItemProps.onSelect,
485
+ () => onCheckedChange == null ? void 0 : onCheckedChange(isIndeterminate(checked) ? true : !checked),
486
+ { checkForDefaultPrevented: false }
487
+ )
488
+ }
489
+ ) });
490
+ }
491
+ );
492
+ MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
493
+ var RADIO_GROUP_NAME = "MenuRadioGroup";
494
+ var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
495
+ RADIO_GROUP_NAME,
496
+ { value: void 0, onValueChange: () => {
497
+ } }
498
+ );
499
+ var MenuRadioGroup = React.forwardRef(
500
+ (props, forwardedRef) => {
501
+ const { value, onValueChange, ...groupProps } = props;
502
+ const handleValueChange = useCallbackRef(onValueChange);
503
+ return /* @__PURE__ */ jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });
504
+ }
505
+ );
506
+ MenuRadioGroup.displayName = RADIO_GROUP_NAME;
507
+ var RADIO_ITEM_NAME = "MenuRadioItem";
508
+ var MenuRadioItem = React.forwardRef(
509
+ (props, forwardedRef) => {
510
+ const { value, ...radioItemProps } = props;
511
+ const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
512
+ const checked = value === context.value;
513
+ return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(
514
+ MenuItem,
515
+ {
516
+ role: "menuitemradio",
517
+ "aria-checked": checked,
518
+ ...radioItemProps,
519
+ ref: forwardedRef,
520
+ "data-state": getCheckedState(checked),
521
+ onSelect: composeEventHandlers(
522
+ radioItemProps.onSelect,
523
+ () => {
524
+ var _a;
525
+ return (_a = context.onValueChange) == null ? void 0 : _a.call(context, value);
526
+ },
527
+ { checkForDefaultPrevented: false }
528
+ )
529
+ }
530
+ ) });
531
+ }
532
+ );
533
+ MenuRadioItem.displayName = RADIO_ITEM_NAME;
534
+ var ITEM_INDICATOR_NAME = "MenuItemIndicator";
535
+ var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
536
+ ITEM_INDICATOR_NAME,
537
+ { checked: false }
538
+ );
539
+ var MenuItemIndicator = React.forwardRef(
540
+ (props, forwardedRef) => {
541
+ const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
542
+ const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
543
+ return /* @__PURE__ */ jsx(
544
+ Presence,
545
+ {
546
+ present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
547
+ children: /* @__PURE__ */ jsx(
548
+ Primitive.span,
549
+ {
550
+ ...itemIndicatorProps,
551
+ ref: forwardedRef,
552
+ "data-state": getCheckedState(indicatorContext.checked)
553
+ }
554
+ )
555
+ }
556
+ );
557
+ }
558
+ );
559
+ MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
560
+ var SEPARATOR_NAME = "MenuSeparator";
561
+ var MenuSeparator = React.forwardRef(
562
+ (props, forwardedRef) => {
563
+ const { __scopeMenu, ...separatorProps } = props;
564
+ return /* @__PURE__ */ jsx(
565
+ Primitive.div,
566
+ {
567
+ role: "separator",
568
+ "aria-orientation": "horizontal",
569
+ ...separatorProps,
570
+ ref: forwardedRef
571
+ }
572
+ );
573
+ }
574
+ );
575
+ MenuSeparator.displayName = SEPARATOR_NAME;
576
+ var ARROW_NAME = "MenuArrow";
577
+ var MenuArrow = React.forwardRef(
578
+ (props, forwardedRef) => {
579
+ const { __scopeMenu, ...arrowProps } = props;
580
+ const popperScope = usePopperScope(__scopeMenu);
581
+ return /* @__PURE__ */ jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
582
+ }
583
+ );
584
+ MenuArrow.displayName = ARROW_NAME;
585
+ var SUB_NAME = "MenuSub";
586
+ var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
587
+ var MenuSub = (props) => {
588
+ const { __scopeMenu, children, open = false, onOpenChange } = props;
589
+ const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);
590
+ const popperScope = usePopperScope(__scopeMenu);
591
+ const [trigger, setTrigger] = React.useState(null);
592
+ const [content, setContent] = React.useState(null);
593
+ const handleOpenChange = useCallbackRef(onOpenChange);
594
+ React.useEffect(() => {
595
+ if (parentMenuContext.open === false) handleOpenChange(false);
596
+ return () => handleOpenChange(false);
597
+ }, [parentMenuContext.open, handleOpenChange]);
598
+ return /* @__PURE__ */ jsx(Root2, { ...popperScope, children: /* @__PURE__ */ jsx(
599
+ MenuProvider,
600
+ {
601
+ scope: __scopeMenu,
602
+ open,
603
+ onOpenChange: handleOpenChange,
604
+ content,
605
+ onContentChange: setContent,
606
+ children: /* @__PURE__ */ jsx(
607
+ MenuSubProvider,
608
+ {
609
+ scope: __scopeMenu,
610
+ contentId: useId(),
611
+ triggerId: useId(),
612
+ trigger,
613
+ onTriggerChange: setTrigger,
614
+ children
615
+ }
616
+ )
617
+ }
618
+ ) });
619
+ };
620
+ MenuSub.displayName = SUB_NAME;
621
+ var SUB_TRIGGER_NAME = "MenuSubTrigger";
622
+ var MenuSubTrigger = React.forwardRef(
623
+ (props, forwardedRef) => {
624
+ const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
625
+ const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
626
+ const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
627
+ const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
628
+ const openTimerRef = React.useRef(null);
629
+ const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
630
+ const scope = { __scopeMenu: props.__scopeMenu };
631
+ const clearOpenTimer = React.useCallback(() => {
632
+ if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
633
+ openTimerRef.current = null;
634
+ }, []);
635
+ React.useEffect(() => clearOpenTimer, [clearOpenTimer]);
636
+ React.useEffect(() => {
637
+ const pointerGraceTimer = pointerGraceTimerRef.current;
638
+ return () => {
639
+ window.clearTimeout(pointerGraceTimer);
640
+ onPointerGraceIntentChange(null);
641
+ };
642
+ }, [pointerGraceTimerRef, onPointerGraceIntentChange]);
643
+ return /* @__PURE__ */ jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx(
644
+ MenuItemImpl,
645
+ {
646
+ id: subContext.triggerId,
647
+ "aria-haspopup": "menu",
648
+ "aria-expanded": context.open,
649
+ "aria-controls": subContext.contentId,
650
+ "data-state": getOpenState(context.open),
651
+ ...props,
652
+ ref: composeRefs(forwardedRef, subContext.onTriggerChange),
653
+ onClick: (event) => {
654
+ var _a;
655
+ (_a = props.onClick) == null ? void 0 : _a.call(props, event);
656
+ if (props.disabled || event.defaultPrevented) return;
657
+ event.currentTarget.focus();
658
+ if (!context.open) context.onOpenChange(true);
659
+ },
660
+ onPointerMove: composeEventHandlers(
661
+ props.onPointerMove,
662
+ whenMouse((event) => {
663
+ contentContext.onItemEnter(event);
664
+ if (event.defaultPrevented) return;
665
+ if (!props.disabled && !context.open && !openTimerRef.current) {
666
+ contentContext.onPointerGraceIntentChange(null);
667
+ openTimerRef.current = window.setTimeout(() => {
668
+ context.onOpenChange(true);
669
+ clearOpenTimer();
670
+ }, 100);
671
+ }
672
+ })
673
+ ),
674
+ onPointerLeave: composeEventHandlers(
675
+ props.onPointerLeave,
676
+ whenMouse((event) => {
677
+ var _a, _b;
678
+ clearOpenTimer();
679
+ const contentRect = (_a = context.content) == null ? void 0 : _a.getBoundingClientRect();
680
+ if (contentRect) {
681
+ const side = (_b = context.content) == null ? void 0 : _b.dataset.side;
682
+ const rightSide = side === "right";
683
+ const bleed = rightSide ? -5 : 5;
684
+ const contentNearEdge = contentRect[rightSide ? "left" : "right"];
685
+ const contentFarEdge = contentRect[rightSide ? "right" : "left"];
686
+ contentContext.onPointerGraceIntentChange({
687
+ area: [
688
+ // Apply a bleed on clientX to ensure that our exit point is
689
+ // consistently within polygon bounds
690
+ { x: event.clientX + bleed, y: event.clientY },
691
+ { x: contentNearEdge, y: contentRect.top },
692
+ { x: contentFarEdge, y: contentRect.top },
693
+ { x: contentFarEdge, y: contentRect.bottom },
694
+ { x: contentNearEdge, y: contentRect.bottom }
695
+ ],
696
+ side
697
+ });
698
+ window.clearTimeout(pointerGraceTimerRef.current);
699
+ pointerGraceTimerRef.current = window.setTimeout(
700
+ () => contentContext.onPointerGraceIntentChange(null),
701
+ 300
702
+ );
703
+ } else {
704
+ contentContext.onTriggerLeave(event);
705
+ if (event.defaultPrevented) return;
706
+ contentContext.onPointerGraceIntentChange(null);
707
+ }
708
+ })
709
+ ),
710
+ onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
711
+ var _a;
712
+ const isTypingAhead = contentContext.searchRef.current !== "";
713
+ if (props.disabled || isTypingAhead && event.key === " ") return;
714
+ if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {
715
+ context.onOpenChange(true);
716
+ (_a = context.content) == null ? void 0 : _a.focus();
717
+ event.preventDefault();
718
+ }
719
+ })
720
+ }
721
+ ) });
722
+ }
723
+ );
724
+ MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
725
+ var SUB_CONTENT_NAME = "MenuSubContent";
726
+ var MenuSubContent = React.forwardRef(
727
+ (props, forwardedRef) => {
728
+ const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);
729
+ const { forceMount = portalContext.forceMount, ...subContentProps } = props;
730
+ const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
731
+ const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);
732
+ const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
733
+ const ref = React.useRef(null);
734
+ const composedRefs = useComposedRefs(forwardedRef, ref);
735
+ return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(
736
+ MenuContentImpl,
737
+ {
738
+ id: subContext.contentId,
739
+ "aria-labelledby": subContext.triggerId,
740
+ ...subContentProps,
741
+ ref: composedRefs,
742
+ align: "start",
743
+ side: rootContext.dir === "rtl" ? "left" : "right",
744
+ disableOutsidePointerEvents: false,
745
+ disableOutsideScroll: false,
746
+ trapFocus: false,
747
+ onOpenAutoFocus: (event) => {
748
+ var _a;
749
+ if (rootContext.isUsingKeyboardRef.current) (_a = ref.current) == null ? void 0 : _a.focus();
750
+ event.preventDefault();
751
+ },
752
+ onCloseAutoFocus: (event) => event.preventDefault(),
753
+ onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {
754
+ if (event.target !== subContext.trigger) context.onOpenChange(false);
755
+ }),
756
+ onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => {
757
+ rootContext.onClose();
758
+ event.preventDefault();
759
+ }),
760
+ onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
761
+ var _a;
762
+ const isKeyDownInside = event.currentTarget.contains(event.target);
763
+ const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);
764
+ if (isKeyDownInside && isCloseKey) {
765
+ context.onOpenChange(false);
766
+ (_a = subContext.trigger) == null ? void 0 : _a.focus();
767
+ event.preventDefault();
768
+ }
769
+ })
770
+ }
771
+ ) }) }) });
772
+ }
773
+ );
774
+ MenuSubContent.displayName = SUB_CONTENT_NAME;
775
+ function getOpenState(open) {
776
+ return open ? "open" : "closed";
777
+ }
778
+ function isIndeterminate(checked) {
779
+ return checked === "indeterminate";
780
+ }
781
+ function getCheckedState(checked) {
782
+ return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
783
+ }
784
+ function focusFirst(candidates) {
785
+ const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
786
+ for (const candidate of candidates) {
787
+ if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
788
+ candidate.focus();
789
+ if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
790
+ }
791
+ }
792
+ function wrapArray(array, startIndex) {
793
+ return array.map((_, index) => array[(startIndex + index) % array.length]);
794
+ }
795
+ function getNextMatch(values, search, currentMatch) {
796
+ const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
797
+ const normalizedSearch = isRepeated ? search[0] : search;
798
+ const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;
799
+ let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));
800
+ const excludeCurrentMatch = normalizedSearch.length === 1;
801
+ if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);
802
+ const nextMatch = wrappedValues.find(
803
+ (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())
804
+ );
805
+ return nextMatch !== currentMatch ? nextMatch : void 0;
806
+ }
807
+ function isPointInPolygon(point, polygon) {
808
+ const { x, y } = point;
809
+ let inside = false;
810
+ for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
811
+ const ii = polygon[i];
812
+ const jj = polygon[j];
813
+ const xi = ii.x;
814
+ const yi = ii.y;
815
+ const xj = jj.x;
816
+ const yj = jj.y;
817
+ const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
818
+ if (intersect) inside = !inside;
819
+ }
820
+ return inside;
821
+ }
822
+ function isPointerInGraceArea(event, area) {
823
+ if (!area) return false;
824
+ const cursorPos = { x: event.clientX, y: event.clientY };
825
+ return isPointInPolygon(cursorPos, area);
826
+ }
827
+ function whenMouse(handler) {
828
+ return (event) => event.pointerType === "mouse" ? handler(event) : void 0;
829
+ }
830
+ var Root3 = Menu;
831
+ var Anchor2 = MenuAnchor;
832
+ var Portal = MenuPortal;
833
+ var Content2 = MenuContent;
834
+ var Group = MenuGroup;
835
+ var Label = MenuLabel;
836
+ var Item2 = MenuItem;
837
+ var CheckboxItem = MenuCheckboxItem;
838
+ var RadioGroup = MenuRadioGroup;
839
+ var RadioItem = MenuRadioItem;
840
+ var ItemIndicator = MenuItemIndicator;
841
+ var Separator = MenuSeparator;
842
+ var Arrow2 = MenuArrow;
843
+ var Sub = MenuSub;
844
+ var SubTrigger = MenuSubTrigger;
845
+ var SubContent = MenuSubContent;
846
+ export {
847
+ Anchor2 as Anchor,
848
+ Arrow2 as Arrow,
849
+ CheckboxItem,
850
+ Content2 as Content,
851
+ Group,
852
+ Item2 as Item,
853
+ ItemIndicator,
854
+ Label,
855
+ Menu,
856
+ MenuAnchor,
857
+ MenuArrow,
858
+ MenuCheckboxItem,
859
+ MenuContent,
860
+ MenuGroup,
861
+ MenuItem,
862
+ MenuItemIndicator,
863
+ MenuLabel,
864
+ MenuPortal,
865
+ MenuRadioGroup,
866
+ MenuRadioItem,
867
+ MenuSeparator,
868
+ MenuSub,
869
+ MenuSubContent,
870
+ MenuSubTrigger,
871
+ Portal,
872
+ RadioGroup,
873
+ RadioItem,
874
+ Root3 as Root,
875
+ Separator,
876
+ Sub,
877
+ SubContent,
878
+ SubTrigger,
879
+ createMenuScope
880
+ };
881
+ //# sourceMappingURL=index.js.map