@arolariu/components 1.1.0 → 2.0.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 (325) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/components/ui/accordion.js +3 -3
  3. package/dist/components/ui/accordion.js.map +1 -1
  4. package/dist/components/ui/accordion_module.css.map +1 -1
  5. package/dist/components/ui/alert-dialog.js +8 -8
  6. package/dist/components/ui/alert-dialog.js.map +1 -1
  7. package/dist/components/ui/alert-dialog_module.css +1 -1
  8. package/dist/components/ui/alert-dialog_module.css.map +1 -1
  9. package/dist/components/ui/alert.js +4 -4
  10. package/dist/components/ui/alert.js.map +1 -1
  11. package/dist/components/ui/alert_module.css.map +1 -1
  12. package/dist/components/ui/aspect-ratio.js +2 -2
  13. package/dist/components/ui/aspect-ratio.js.map +1 -1
  14. package/dist/components/ui/aspect-ratio_module.css.map +1 -1
  15. package/dist/components/ui/async-boundary.js +2 -2
  16. package/dist/components/ui/async-boundary.js.map +1 -1
  17. package/dist/components/ui/avatar.js +4 -4
  18. package/dist/components/ui/avatar.js.map +1 -1
  19. package/dist/components/ui/avatar_module.css.map +1 -1
  20. package/dist/components/ui/background-beams.js +3 -3
  21. package/dist/components/ui/background-beams.js.map +1 -1
  22. package/dist/components/ui/background-beams_module.css.map +1 -1
  23. package/dist/components/ui/badge.js +2 -2
  24. package/dist/components/ui/badge.js.map +1 -1
  25. package/dist/components/ui/badge_module.css.map +1 -1
  26. package/dist/components/ui/breadcrumb.js +10 -10
  27. package/dist/components/ui/breadcrumb.js.map +1 -1
  28. package/dist/components/ui/breadcrumb_module.css.map +1 -1
  29. package/dist/components/ui/bubble-background.js +5 -5
  30. package/dist/components/ui/bubble-background.js.map +1 -1
  31. package/dist/components/ui/bubble-background_module.css.map +1 -1
  32. package/dist/components/ui/button-group.js +6 -6
  33. package/dist/components/ui/button-group.js.map +1 -1
  34. package/dist/components/ui/button-group_module.css.map +1 -1
  35. package/dist/components/ui/button.js +4 -4
  36. package/dist/components/ui/button.js.map +1 -1
  37. package/dist/components/ui/button_module.css.map +1 -1
  38. package/dist/components/ui/calendar.d.ts +2 -1
  39. package/dist/components/ui/calendar.d.ts.map +1 -1
  40. package/dist/components/ui/calendar.js +4 -4
  41. package/dist/components/ui/calendar.js.map +1 -1
  42. package/dist/components/ui/calendar_module.css.map +1 -1
  43. package/dist/components/ui/card-skeleton.js +2 -2
  44. package/dist/components/ui/card-skeleton.js.map +1 -1
  45. package/dist/components/ui/card-skeleton_module.css.map +1 -1
  46. package/dist/components/ui/card.js +8 -8
  47. package/dist/components/ui/card.js.map +1 -1
  48. package/dist/components/ui/card_module.css.map +1 -1
  49. package/dist/components/ui/carousel.js +16 -16
  50. package/dist/components/ui/carousel.js.map +1 -1
  51. package/dist/components/ui/carousel_module.css +1 -1
  52. package/dist/components/ui/carousel_module.css.map +1 -1
  53. package/dist/components/ui/chart.d.ts +6 -3
  54. package/dist/components/ui/chart.d.ts.map +1 -1
  55. package/dist/components/ui/chart.js +70 -136
  56. package/dist/components/ui/chart.js.map +1 -1
  57. package/dist/components/ui/chart_module.css.map +1 -1
  58. package/dist/components/ui/checkbox-group.js +2 -2
  59. package/dist/components/ui/checkbox-group.js.map +1 -1
  60. package/dist/components/ui/checkbox-group_module.css.map +1 -1
  61. package/dist/components/ui/checkbox.js +2 -2
  62. package/dist/components/ui/checkbox.js.map +1 -1
  63. package/dist/components/ui/checkbox_module.css.map +1 -1
  64. package/dist/components/ui/collapsible.js +4 -4
  65. package/dist/components/ui/collapsible.js.map +1 -1
  66. package/dist/components/ui/collapsible_module.css.map +1 -1
  67. package/dist/components/ui/combobox.js +13 -13
  68. package/dist/components/ui/combobox.js.map +1 -1
  69. package/dist/components/ui/combobox_module.css.map +1 -1
  70. package/dist/components/ui/command.js +40 -40
  71. package/dist/components/ui/command.js.map +1 -1
  72. package/dist/components/ui/command_module.css +1 -1
  73. package/dist/components/ui/command_module.css.map +1 -1
  74. package/dist/components/ui/context-menu.js +6 -6
  75. package/dist/components/ui/context-menu.js.map +1 -1
  76. package/dist/components/ui/context-menu_module.css.map +1 -1
  77. package/dist/components/ui/copy-button.js +6 -6
  78. package/dist/components/ui/copy-button.js.map +1 -1
  79. package/dist/components/ui/copy-button_module.css.map +1 -1
  80. package/dist/components/ui/counting-number.js +6 -6
  81. package/dist/components/ui/counting-number.js.map +1 -1
  82. package/dist/components/ui/counting-number_module.css.map +1 -1
  83. package/dist/components/ui/dialog.js +6 -6
  84. package/dist/components/ui/dialog.js.map +1 -1
  85. package/dist/components/ui/dialog_module.css +1 -1
  86. package/dist/components/ui/dialog_module.css.map +1 -1
  87. package/dist/components/ui/dot-background_module.css.map +1 -1
  88. package/dist/components/ui/drawer.js +5 -5
  89. package/dist/components/ui/drawer.js.map +1 -1
  90. package/dist/components/ui/drawer_module.css.map +1 -1
  91. package/dist/components/ui/dropdown-menu.js +6 -6
  92. package/dist/components/ui/dropdown-menu.js.map +1 -1
  93. package/dist/components/ui/dropdown-menu_module.css.map +1 -1
  94. package/dist/components/ui/dropdrawer.js +52 -52
  95. package/dist/components/ui/dropdrawer.js.map +1 -1
  96. package/dist/components/ui/dropdrawer_module.css.map +1 -1
  97. package/dist/components/ui/empty.js +7 -7
  98. package/dist/components/ui/empty.js.map +1 -1
  99. package/dist/components/ui/empty_module.css.map +1 -1
  100. package/dist/components/ui/error-boundary.js +2 -2
  101. package/dist/components/ui/error-boundary.js.map +1 -1
  102. package/dist/components/ui/error-boundary_module.css.map +1 -1
  103. package/dist/components/ui/field.js +12 -12
  104. package/dist/components/ui/field.js.map +1 -1
  105. package/dist/components/ui/field_module.css.map +1 -1
  106. package/dist/components/ui/fireworks-background.js +6 -6
  107. package/dist/components/ui/fireworks-background.js.map +1 -1
  108. package/dist/components/ui/fireworks-background_module.css.map +1 -1
  109. package/dist/components/ui/flip-button.js +5 -5
  110. package/dist/components/ui/flip-button.js.map +1 -1
  111. package/dist/components/ui/flip-button_module.css.map +1 -1
  112. package/dist/components/ui/focus-scope.js +6 -6
  113. package/dist/components/ui/focus-scope.js.map +1 -1
  114. package/dist/components/ui/focus-scope_module.css.map +1 -1
  115. package/dist/components/ui/form-skeleton.js +2 -2
  116. package/dist/components/ui/form-skeleton.js.map +1 -1
  117. package/dist/components/ui/form-skeleton_module.css.map +1 -1
  118. package/dist/components/ui/form.d.ts +3 -3
  119. package/dist/components/ui/form.d.ts.map +1 -1
  120. package/dist/components/ui/form.js +13 -13
  121. package/dist/components/ui/form.js.map +1 -1
  122. package/dist/components/ui/form_module.css.map +1 -1
  123. package/dist/components/ui/gradient-background.js +2 -2
  124. package/dist/components/ui/gradient-background.js.map +1 -1
  125. package/dist/components/ui/gradient-background_module.css.map +1 -1
  126. package/dist/components/ui/gradient-text.js +2 -2
  127. package/dist/components/ui/gradient-text.js.map +1 -1
  128. package/dist/components/ui/gradient-text_module.css.map +1 -1
  129. package/dist/components/ui/highlight-text.js +4 -4
  130. package/dist/components/ui/highlight-text.js.map +1 -1
  131. package/dist/components/ui/highlight-text_module.css.map +1 -1
  132. package/dist/components/ui/hole-background.js +21 -21
  133. package/dist/components/ui/hole-background.js.map +1 -1
  134. package/dist/components/ui/hole-background_module.css.map +1 -1
  135. package/dist/components/ui/hover-card.js +3 -3
  136. package/dist/components/ui/hover-card.js.map +1 -1
  137. package/dist/components/ui/hover-card_module.css.map +1 -1
  138. package/dist/components/ui/input-group.js +7 -7
  139. package/dist/components/ui/input-group.js.map +1 -1
  140. package/dist/components/ui/input-group_module.css.map +1 -1
  141. package/dist/components/ui/input-otp.d.ts +3 -3
  142. package/dist/components/ui/input-otp.d.ts.map +1 -1
  143. package/dist/components/ui/input-otp.js +6 -6
  144. package/dist/components/ui/input-otp.js.map +1 -1
  145. package/dist/components/ui/input-otp_module.css.map +1 -1
  146. package/dist/components/ui/input.js +2 -2
  147. package/dist/components/ui/input.js.map +1 -1
  148. package/dist/components/ui/input_module.css.map +1 -1
  149. package/dist/components/ui/item.js +13 -13
  150. package/dist/components/ui/item.js.map +1 -1
  151. package/dist/components/ui/item_module.css.map +1 -1
  152. package/dist/components/ui/kbd.js +3 -3
  153. package/dist/components/ui/kbd.js.map +1 -1
  154. package/dist/components/ui/kbd_module.css.map +1 -1
  155. package/dist/components/ui/label.js +2 -2
  156. package/dist/components/ui/label.js.map +1 -1
  157. package/dist/components/ui/label_module.css.map +1 -1
  158. package/dist/components/ui/list-skeleton.js +2 -2
  159. package/dist/components/ui/list-skeleton.js.map +1 -1
  160. package/dist/components/ui/list-skeleton_module.css.map +1 -1
  161. package/dist/components/ui/loading-overlay.js +2 -2
  162. package/dist/components/ui/loading-overlay.js.map +1 -1
  163. package/dist/components/ui/loading-overlay_module.css.map +1 -1
  164. package/dist/components/ui/menubar.js +4 -4
  165. package/dist/components/ui/menubar.js.map +1 -1
  166. package/dist/components/ui/menubar_module.css.map +1 -1
  167. package/dist/components/ui/meter.js +5 -5
  168. package/dist/components/ui/meter.js.map +1 -1
  169. package/dist/components/ui/meter_module.css.map +1 -1
  170. package/dist/components/ui/navigation-menu.js +5 -5
  171. package/dist/components/ui/navigation-menu.js.map +1 -1
  172. package/dist/components/ui/navigation-menu_module.css +1 -1
  173. package/dist/components/ui/navigation-menu_module.css.map +1 -1
  174. package/dist/components/ui/number-field.js +3 -3
  175. package/dist/components/ui/number-field.js.map +1 -1
  176. package/dist/components/ui/number-field_module.css.map +1 -1
  177. package/dist/components/ui/pagination.js +8 -8
  178. package/dist/components/ui/pagination.js.map +1 -1
  179. package/dist/components/ui/pagination_module.css.map +1 -1
  180. package/dist/components/ui/popover.js +5 -5
  181. package/dist/components/ui/popover.js.map +1 -1
  182. package/dist/components/ui/popover_module.css.map +1 -1
  183. package/dist/components/ui/progress.js +2 -2
  184. package/dist/components/ui/progress.js.map +1 -1
  185. package/dist/components/ui/progress_module.css.map +1 -1
  186. package/dist/components/ui/radio-group.js +3 -3
  187. package/dist/components/ui/radio-group.js.map +1 -1
  188. package/dist/components/ui/radio-group_module.css.map +1 -1
  189. package/dist/components/ui/resizable.d.ts +13 -29
  190. package/dist/components/ui/resizable.d.ts.map +1 -1
  191. package/dist/components/ui/resizable.js +8 -7
  192. package/dist/components/ui/resizable.js.map +1 -1
  193. package/dist/components/ui/resizable_module.css.map +1 -1
  194. package/dist/components/ui/ripple-button.js +9 -9
  195. package/dist/components/ui/ripple-button.js.map +1 -1
  196. package/dist/components/ui/ripple-button_module.css.map +1 -1
  197. package/dist/components/ui/scratcher_module.css.map +1 -1
  198. package/dist/components/ui/scroll-area.js +2 -2
  199. package/dist/components/ui/scroll-area.js.map +1 -1
  200. package/dist/components/ui/scroll-area_module.css.map +1 -1
  201. package/dist/components/ui/select.js +4 -4
  202. package/dist/components/ui/select.js.map +1 -1
  203. package/dist/components/ui/select_module.css.map +1 -1
  204. package/dist/components/ui/separator.js +2 -2
  205. package/dist/components/ui/separator.js.map +1 -1
  206. package/dist/components/ui/separator_module.css.map +1 -1
  207. package/dist/components/ui/sheet.js +6 -6
  208. package/dist/components/ui/sheet.js.map +1 -1
  209. package/dist/components/ui/sheet_module.css.map +1 -1
  210. package/dist/components/ui/sidebar.js +36 -36
  211. package/dist/components/ui/sidebar.js.map +1 -1
  212. package/dist/components/ui/sidebar_module.css.map +1 -1
  213. package/dist/components/ui/skeleton.js +2 -2
  214. package/dist/components/ui/skeleton.js.map +1 -1
  215. package/dist/components/ui/skeleton_module.css.map +1 -1
  216. package/dist/components/ui/slider.js +2 -2
  217. package/dist/components/ui/slider.js.map +1 -1
  218. package/dist/components/ui/slider_module.css.map +1 -1
  219. package/dist/components/ui/spinner.js +2 -2
  220. package/dist/components/ui/spinner.js.map +1 -1
  221. package/dist/components/ui/spinner_module.css.map +1 -1
  222. package/dist/components/ui/stepper.js +2 -2
  223. package/dist/components/ui/stepper.js.map +1 -1
  224. package/dist/components/ui/stepper_module.css.map +1 -1
  225. package/dist/components/ui/switch.js +2 -2
  226. package/dist/components/ui/switch.js.map +1 -1
  227. package/dist/components/ui/switch_module.css.map +1 -1
  228. package/dist/components/ui/table-skeleton.js +2 -2
  229. package/dist/components/ui/table-skeleton.js.map +1 -1
  230. package/dist/components/ui/table-skeleton_module.css.map +1 -1
  231. package/dist/components/ui/table.js +9 -9
  232. package/dist/components/ui/table.js.map +1 -1
  233. package/dist/components/ui/table_module.css.map +1 -1
  234. package/dist/components/ui/tabs.js +3 -3
  235. package/dist/components/ui/tabs.js.map +1 -1
  236. package/dist/components/ui/tabs_module.css.map +1 -1
  237. package/dist/components/ui/textarea.js +2 -2
  238. package/dist/components/ui/textarea.js.map +1 -1
  239. package/dist/components/ui/textarea_module.css.map +1 -1
  240. package/dist/components/ui/timeline.js +5 -5
  241. package/dist/components/ui/timeline.js.map +1 -1
  242. package/dist/components/ui/timeline_module.css.map +1 -1
  243. package/dist/components/ui/{sonner.d.ts → toast.d.ts} +10 -2
  244. package/dist/components/ui/toast.d.ts.map +1 -0
  245. package/dist/components/ui/{sonner.js → toast.js} +40 -40
  246. package/dist/components/ui/toast.js.map +1 -0
  247. package/dist/components/ui/toast.module.js +34 -0
  248. package/dist/components/ui/toast.module.js.map +1 -0
  249. package/dist/components/ui/{sonner_module.css → toast_module.css} +35 -35
  250. package/dist/components/ui/toast_module.css.map +1 -0
  251. package/dist/components/ui/toggle-group.js +5 -5
  252. package/dist/components/ui/toggle-group.js.map +1 -1
  253. package/dist/components/ui/toggle-group_module.css.map +1 -1
  254. package/dist/components/ui/toggle.js +2 -2
  255. package/dist/components/ui/toggle.js.map +1 -1
  256. package/dist/components/ui/toggle_module.css.map +1 -1
  257. package/dist/components/ui/toolbar.js +6 -6
  258. package/dist/components/ui/toolbar.js.map +1 -1
  259. package/dist/components/ui/toolbar_module.css.map +1 -1
  260. package/dist/components/ui/tooltip.js +4 -4
  261. package/dist/components/ui/tooltip.js.map +1 -1
  262. package/dist/components/ui/tooltip_module.css.map +1 -1
  263. package/dist/components/ui/typewriter.js +4 -4
  264. package/dist/components/ui/typewriter.js.map +1 -1
  265. package/dist/components/ui/typewriter_module.css.map +1 -1
  266. package/dist/components/ui/visually-hidden.js +2 -2
  267. package/dist/components/ui/visually-hidden.js.map +1 -1
  268. package/dist/components/ui/visually-hidden_module.css.map +1 -1
  269. package/dist/hooks/useAnnounce.js +5 -5
  270. package/dist/hooks/useAnnounce.js.map +1 -1
  271. package/dist/hooks/useClipboard.js +6 -6
  272. package/dist/hooks/useClipboard.js.map +1 -1
  273. package/dist/hooks/useControllableState.js +3 -3
  274. package/dist/hooks/useControllableState.js.map +1 -1
  275. package/dist/hooks/useDebounce.js +3 -3
  276. package/dist/hooks/useDebounce.js.map +1 -1
  277. package/dist/hooks/useEventCallback.js +4 -4
  278. package/dist/hooks/useEventCallback.js.map +1 -1
  279. package/dist/hooks/useFocusManager.js +6 -6
  280. package/dist/hooks/useFocusManager.js.map +1 -1
  281. package/dist/hooks/useFocusVisible.js +5 -5
  282. package/dist/hooks/useFocusVisible.js.map +1 -1
  283. package/dist/hooks/useId.js +4 -4
  284. package/dist/hooks/useId.js.map +1 -1
  285. package/dist/hooks/useIntersectionObserver.js +3 -3
  286. package/dist/hooks/useIntersectionObserver.js.map +1 -1
  287. package/dist/hooks/useInterval.js +4 -4
  288. package/dist/hooks/useInterval.js.map +1 -1
  289. package/dist/hooks/useLocalStorage.js +4 -4
  290. package/dist/hooks/useLocalStorage.js.map +1 -1
  291. package/dist/hooks/useMediaQuery.js +3 -3
  292. package/dist/hooks/useMediaQuery.js.map +1 -1
  293. package/dist/hooks/useMergedRefs.js +2 -2
  294. package/dist/hooks/useMergedRefs.js.map +1 -1
  295. package/dist/hooks/useOnClickOutside.js +2 -2
  296. package/dist/hooks/useOnClickOutside.js.map +1 -1
  297. package/dist/hooks/usePrevious.js +3 -3
  298. package/dist/hooks/usePrevious.js.map +1 -1
  299. package/dist/hooks/useThrottle.js +7 -7
  300. package/dist/hooks/useThrottle.js.map +1 -1
  301. package/dist/hooks/useTimeout.js +4 -4
  302. package/dist/hooks/useTimeout.js.map +1 -1
  303. package/dist/index.css.map +1 -1
  304. package/dist/index.d.ts +3 -3
  305. package/dist/index.d.ts.map +1 -1
  306. package/dist/index.js +1 -1
  307. package/dist/motion/Collapse.js +2 -2
  308. package/dist/motion/Collapse.js.map +1 -1
  309. package/dist/motion/Collapse_module.css.map +1 -1
  310. package/package.json +7 -8
  311. package/src/components/ui/calendar.tsx +2 -1
  312. package/src/components/ui/chart.tsx +2 -2
  313. package/src/components/ui/form.tsx +28 -3
  314. package/src/components/ui/input-otp.tsx +3 -3
  315. package/src/components/ui/resizable.tsx +15 -18
  316. package/src/components/ui/{sonner.module.css → toast.module.css} +1 -1
  317. package/src/components/ui/{sonner.tsx → toast.tsx} +2 -2
  318. package/src/index.ts +4 -4
  319. package/dist/components/ui/sonner.d.ts.map +0 -1
  320. package/dist/components/ui/sonner.js.map +0 -1
  321. package/dist/components/ui/sonner.module.js +0 -34
  322. package/dist/components/ui/sonner.module.js.map +0 -1
  323. package/dist/components/ui/sonner_module.css.map +0 -1
  324. package/dist/rslib-runtime.js +0 -39
  325. package/dist/rslib-runtime.js.map +0 -1
@@ -6,24 +6,24 @@ import { mergeProps } from "@base-ui/react/merge-props";
6
6
  import { useRender } from "@base-ui/react/use-render";
7
7
  import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
8
8
  import { AnimatePresence, motion } from "motion/react";
9
- import { Children, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
10
9
  import { useIsMobile } from "../../hooks/useIsMobile.js";
11
10
  import { cn } from "../../lib/utilities.js";
12
11
  import dropdrawer_module from "./dropdrawer.module.js";
12
+ import * as __rspack_external_react from "react";
13
13
  const MOBILE_MENU_TITLE = "Menu";
14
14
  const MOBILE_SUBMENU_TITLE = "Submenu";
15
15
  const MOBILE_BACK_LABEL = "Go back";
16
- const DropDrawerContext = /*#__PURE__*/ createContext(null);
16
+ const DropDrawerContext = /*#__PURE__*/ __rspack_external_react.createContext(null);
17
17
  const useDropDrawerContext = ()=>{
18
- const context = useContext(DropDrawerContext);
18
+ const context = __rspack_external_react.useContext(DropDrawerContext);
19
19
  if (null === context) throw new Error("DropDrawer components cannot be rendered outside the Context");
20
20
  return context;
21
21
  };
22
22
  const dropdrawer_Drawer = Drawer.Root;
23
23
  const DrawerPortal = Drawer.Portal;
24
- const dropdrawer_DrawerTrigger = /*#__PURE__*/ forwardRef(function(props, forwardedRef) {
24
+ const dropdrawer_DrawerTrigger = /*#__PURE__*/ __rspack_external_react.forwardRef(function(props, forwardedRef) {
25
25
  const { asChild = false, children, className, render, ...otherProps } = props;
26
- const renderProp = asChild && /*#__PURE__*/ isValidElement(children) ? children : render;
26
+ const renderProp = asChild && /*#__PURE__*/ __rspack_external_react.isValidElement(children) ? children : render;
27
27
  return /*#__PURE__*/ jsx(Drawer.Trigger, {
28
28
  ...otherProps,
29
29
  ref: forwardedRef,
@@ -50,7 +50,7 @@ function DrawerOverlay(props) {
50
50
  })
51
51
  });
52
52
  }
53
- const dropdrawer_DrawerContent = /*#__PURE__*/ forwardRef(function(props, forwardedRef) {
53
+ const dropdrawer_DrawerContent = /*#__PURE__*/ __rspack_external_react.forwardRef(function(props, forwardedRef) {
54
54
  const { className, children, render, ...otherProps } = props;
55
55
  return /*#__PURE__*/ jsxs(DrawerPortal, {
56
56
  children: [
@@ -121,9 +121,9 @@ function DrawerTitle(props) {
121
121
  }
122
122
  const DropdownMenu = Menu.Root;
123
123
  const DropdownMenuSub = Menu.SubmenuRoot;
124
- const dropdrawer_DropdownMenuTrigger = /*#__PURE__*/ forwardRef(function(props, forwardedRef) {
124
+ const dropdrawer_DropdownMenuTrigger = /*#__PURE__*/ __rspack_external_react.forwardRef(function(props, forwardedRef) {
125
125
  const { asChild = false, children, className, render, ...otherProps } = props;
126
- const renderProp = asChild && /*#__PURE__*/ isValidElement(children) ? children : render;
126
+ const renderProp = asChild && /*#__PURE__*/ __rspack_external_react.isValidElement(children) ? children : render;
127
127
  return /*#__PURE__*/ jsx(Menu.Trigger, {
128
128
  ...otherProps,
129
129
  ref: forwardedRef,
@@ -137,7 +137,7 @@ const dropdrawer_DropdownMenuTrigger = /*#__PURE__*/ forwardRef(function(props,
137
137
  children: renderProp ? void 0 : children
138
138
  });
139
139
  });
140
- const dropdrawer_DropdownMenuContent = /*#__PURE__*/ forwardRef(function(props, forwardedRef) {
140
+ const dropdrawer_DropdownMenuContent = /*#__PURE__*/ __rspack_external_react.forwardRef(function(props, forwardedRef) {
141
141
  const { className, children, render, ...otherProps } = props;
142
142
  return /*#__PURE__*/ jsx(Menu.Portal, {
143
143
  children: /*#__PURE__*/ jsx(Menu.Positioner, {
@@ -164,7 +164,7 @@ const dropdrawer_DropdownMenuContent = /*#__PURE__*/ forwardRef(function(props,
164
164
  });
165
165
  function DropdownMenuItem(props) {
166
166
  const { asChild = false, children, className, inset = false, render, ...otherProps } = props;
167
- const renderProp = asChild && /*#__PURE__*/ isValidElement(children) ? children : render;
167
+ const renderProp = asChild && /*#__PURE__*/ __rspack_external_react.isValidElement(children) ? children : render;
168
168
  return /*#__PURE__*/ jsx(Menu.Item, {
169
169
  ...otherProps,
170
170
  render: useRender({
@@ -245,7 +245,7 @@ function DropdownMenuSubContent(props) {
245
245
  })
246
246
  });
247
247
  }
248
- const SubmenuContext = /*#__PURE__*/ createContext({
248
+ const SubmenuContext = /*#__PURE__*/ __rspack_external_react.createContext({
249
249
  activeSubmenu: null,
250
250
  navigateToSubmenu: void 0,
251
251
  registerSubmenuContent: void 0,
@@ -270,7 +270,7 @@ function DropDrawer({ children, ...props }) {
270
270
  })
271
271
  });
272
272
  }
273
- const dropdrawer_DropDrawerTrigger = /*#__PURE__*/ forwardRef(function({ className, children, ...props }, forwardedRef) {
273
+ const dropdrawer_DropDrawerTrigger = /*#__PURE__*/ __rspack_external_react.forwardRef(function({ className, children, ...props }, forwardedRef) {
274
274
  const { isMobile } = useDropDrawerContext();
275
275
  return isMobile ? /*#__PURE__*/ jsx(dropdrawer_DrawerTrigger, {
276
276
  ref: forwardedRef,
@@ -286,19 +286,19 @@ const dropdrawer_DropDrawerTrigger = /*#__PURE__*/ forwardRef(function({ classNa
286
286
  children: children
287
287
  });
288
288
  });
289
- const dropdrawer_DropDrawerContent = /*#__PURE__*/ forwardRef(function({ className, children, ...props }, forwardedRef) {
289
+ const dropdrawer_DropDrawerContent = /*#__PURE__*/ __rspack_external_react.forwardRef(function({ className, children, ...props }, forwardedRef) {
290
290
  const { isMobile } = useDropDrawerContext();
291
- const [activeSubmenu, setActiveSubmenu] = useState(null);
292
- const [submenuTitle, setSubmenuTitle] = useState(null);
293
- const [submenuStack, setSubmenuStack] = useState([]);
294
- const [animationDirection, setAnimationDirection] = useState("forward");
295
- const submenuContentRef = useRef(new Map());
296
- useEffect(()=>{
291
+ const [activeSubmenu, setActiveSubmenu] = __rspack_external_react.useState(null);
292
+ const [submenuTitle, setSubmenuTitle] = __rspack_external_react.useState(null);
293
+ const [submenuStack, setSubmenuStack] = __rspack_external_react.useState([]);
294
+ const [animationDirection, setAnimationDirection] = __rspack_external_react.useState("forward");
295
+ const submenuContentRef = __rspack_external_react.useRef(new Map());
296
+ __rspack_external_react.useEffect(()=>{
297
297
  submenuContentRef.current.clear();
298
298
  }, [
299
299
  children
300
300
  ]);
301
- const navigateToSubmenu = useCallback((id, title)=>{
301
+ const navigateToSubmenu = __rspack_external_react.useCallback((id, title)=>{
302
302
  setAnimationDirection("forward");
303
303
  setActiveSubmenu(id);
304
304
  setSubmenuTitle(title);
@@ -310,7 +310,7 @@ const dropdrawer_DropDrawerContent = /*#__PURE__*/ forwardRef(function({ classNa
310
310
  }
311
311
  ]);
312
312
  }, []);
313
- const goBack = useCallback(()=>{
313
+ const goBack = __rspack_external_react.useCallback(()=>{
314
314
  setAnimationDirection("backward");
315
315
  if (submenuStack.length <= 1) {
316
316
  setActiveSubmenu(null);
@@ -335,22 +335,22 @@ const dropdrawer_DropDrawerContent = /*#__PURE__*/ forwardRef(function({ classNa
335
335
  }, [
336
336
  submenuStack
337
337
  ]);
338
- const registerSubmenuContent = useCallback((id, content)=>{
338
+ const registerSubmenuContent = __rspack_external_react.useCallback((id, content)=>{
339
339
  submenuContentRef.current.set(id, content);
340
340
  }, []);
341
- const extractSubmenuContent = useCallback((elements, targetId)=>{
341
+ const extractSubmenuContent = __rspack_external_react.useCallback((elements, targetId)=>{
342
342
  const result = [];
343
343
  const findSubmenuContent = (node)=>{
344
- if (!/*#__PURE__*/ isValidElement(node)) return;
344
+ if (!/*#__PURE__*/ __rspack_external_react.isValidElement(node)) return;
345
345
  const element = node;
346
346
  if (element.type === DropDrawerSub) {
347
347
  const elementId = element.props.id;
348
348
  const dataSubmenuId = element.props["data-submenu-id"];
349
349
  if (elementId === targetId || dataSubmenuId === targetId) {
350
- if (element.props.children) Children.forEach(element.props.children, (child)=>{
351
- if (/*#__PURE__*/ isValidElement(child) && child.type === DropDrawerSubContent) {
350
+ if (element.props.children) __rspack_external_react.Children.forEach(element.props.children, (child)=>{
351
+ if (/*#__PURE__*/ __rspack_external_react.isValidElement(child) && child.type === DropDrawerSubContent) {
352
352
  const subContentElement = child;
353
- Children.forEach(subContentElement.props.children, (contentChild)=>{
353
+ __rspack_external_react.Children.forEach(subContentElement.props.children, (contentChild)=>{
354
354
  result.push(contentChild);
355
355
  });
356
356
  }
@@ -358,12 +358,12 @@ const dropdrawer_DropDrawerContent = /*#__PURE__*/ forwardRef(function({ classNa
358
358
  return;
359
359
  }
360
360
  }
361
- if (element.props.children) Children.forEach(element.props.children, findSubmenuContent);
361
+ if (element.props.children) __rspack_external_react.Children.forEach(element.props.children, findSubmenuContent);
362
362
  };
363
- Children.forEach(elements, findSubmenuContent);
363
+ __rspack_external_react.Children.forEach(elements, findSubmenuContent);
364
364
  return result;
365
365
  }, []);
366
- const getSubmenuContent = useCallback((id)=>{
366
+ const getSubmenuContent = __rspack_external_react.useCallback((id)=>{
367
367
  const cachedContent = submenuContentRef.current.get(id);
368
368
  if (cachedContent && cachedContent.length > 0) return cachedContent;
369
369
  const submenuContent = extractSubmenuContent(children, id);
@@ -507,7 +507,7 @@ const dropdrawer_DropDrawerContent = /*#__PURE__*/ forwardRef(function({ classNa
507
507
  });
508
508
  function DropDrawerItem({ className, children, closeOnClick, disabled, icon, inset, onClick, onSelect, ...props }) {
509
509
  const { isMobile } = useDropDrawerContext();
510
- const isInGroup = useCallback((element)=>{
510
+ const isInGroup = __rspack_external_react.useCallback((element)=>{
511
511
  if (!element) return false;
512
512
  let parent = element.parentElement;
513
513
  while(parent){
@@ -516,9 +516,9 @@ function DropDrawerItem({ className, children, closeOnClick, disabled, icon, ins
516
516
  }
517
517
  return false;
518
518
  }, []);
519
- const itemRef = useRef(null);
520
- const [isInsideGroup, setIsInsideGroup] = useState(false);
521
- useEffect(()=>{
519
+ const itemRef = __rspack_external_react.useRef(null);
520
+ const [isInsideGroup, setIsInsideGroup] = __rspack_external_react.useState(false);
521
+ __rspack_external_react.useEffect(()=>{
522
522
  if (!isMobile) return;
523
523
  const timer = globalThis.window.setTimeout(()=>{
524
524
  if (itemRef.current) setIsInsideGroup(isInGroup(itemRef.current));
@@ -528,7 +528,7 @@ function DropDrawerItem({ className, children, closeOnClick, disabled, icon, ins
528
528
  isInGroup,
529
529
  isMobile
530
530
  ]);
531
- const handleSelect = useCallback((event)=>{
531
+ const handleSelect = __rspack_external_react.useCallback((event)=>{
532
532
  if (!disabled) onSelect?.(event);
533
533
  }, [
534
534
  disabled,
@@ -646,10 +646,10 @@ function DropDrawerFooter({ className, children, ...props }) {
646
646
  }
647
647
  function DropDrawerGroup({ className, children, ...props }) {
648
648
  const { isMobile } = useDropDrawerContext();
649
- const childrenWithSeparators = useMemo(()=>{
649
+ const childrenWithSeparators = __rspack_external_react.useMemo(()=>{
650
650
  if (!isMobile) return children;
651
- const childArray = Children.toArray(children);
652
- const filteredChildren = childArray.filter((child)=>!/*#__PURE__*/ (isValidElement(child) && child.type === DropDrawerSeparator));
651
+ const childArray = __rspack_external_react.Children.toArray(children);
652
+ const filteredChildren = childArray.filter((child)=>!/*#__PURE__*/ (__rspack_external_react.isValidElement(child) && child.type === DropDrawerSeparator));
653
653
  return filteredChildren.flatMap((child, index)=>{
654
654
  if (index === filteredChildren.length - 1) return [
655
655
  child
@@ -683,16 +683,16 @@ function DropDrawerGroup({ className, children, ...props }) {
683
683
  }
684
684
  function DropDrawerSub({ children, id, ...props }) {
685
685
  const { isMobile } = useDropDrawerContext();
686
- const { registerSubmenuContent } = useContext(SubmenuContext);
687
- const generatedId = useId();
686
+ const { registerSubmenuContent } = __rspack_external_react.useContext(SubmenuContext);
687
+ const generatedId = __rspack_external_react.useId();
688
688
  const submenuId = id || generatedId;
689
- useEffect(()=>{
689
+ __rspack_external_react.useEffect(()=>{
690
690
  if (!registerSubmenuContent) return;
691
691
  const contentItems = [];
692
- Children.forEach(children, (child)=>{
693
- if (/*#__PURE__*/ isValidElement(child) && child.type === DropDrawerSubContent) {
692
+ __rspack_external_react.Children.forEach(children, (child)=>{
693
+ if (/*#__PURE__*/ __rspack_external_react.isValidElement(child) && child.type === DropDrawerSubContent) {
694
694
  const childElement = child;
695
- Children.forEach(childElement.props.children, (contentChild)=>{
695
+ __rspack_external_react.Children.forEach(childElement.props.children, (contentChild)=>{
696
696
  contentItems.push(contentChild);
697
697
  });
698
698
  }
@@ -704,9 +704,9 @@ function DropDrawerSub({ children, id, ...props }) {
704
704
  submenuId
705
705
  ]);
706
706
  if (isMobile) {
707
- const processedChildren = Children.map(children, (child)=>{
708
- if (!/*#__PURE__*/ isValidElement(child)) return child;
709
- if (child.type === DropDrawerSubTrigger || child.type === DropDrawerSubContent) return /*#__PURE__*/ cloneElement(child, {
707
+ const processedChildren = __rspack_external_react.Children.map(children, (child)=>{
708
+ if (!/*#__PURE__*/ __rspack_external_react.isValidElement(child)) return child;
709
+ if (child.type === DropDrawerSubTrigger || child.type === DropDrawerSubContent) return /*#__PURE__*/ __rspack_external_react.cloneElement(child, {
710
710
  "data-parent-submenu": submenuId,
711
711
  "data-parent-submenu-id": submenuId,
712
712
  "data-submenu-id": submenuId
@@ -729,8 +729,8 @@ function DropDrawerSub({ children, id, ...props }) {
729
729
  }
730
730
  function DropDrawerSubTrigger({ className, inset, children, onClick, ...props }) {
731
731
  const { isMobile } = useDropDrawerContext();
732
- const { navigateToSubmenu } = useContext(SubmenuContext);
733
- const isInGroup = useCallback((element)=>{
732
+ const { navigateToSubmenu } = __rspack_external_react.useContext(SubmenuContext);
733
+ const isInGroup = __rspack_external_react.useCallback((element)=>{
734
734
  if (!element) return false;
735
735
  let parent = element.parentElement;
736
736
  while(parent){
@@ -739,9 +739,9 @@ function DropDrawerSubTrigger({ className, inset, children, onClick, ...props })
739
739
  }
740
740
  return false;
741
741
  }, []);
742
- const itemRef = useRef(null);
743
- const [isInsideGroup, setIsInsideGroup] = useState(false);
744
- useEffect(()=>{
742
+ const itemRef = __rspack_external_react.useRef(null);
743
+ const [isInsideGroup, setIsInsideGroup] = __rspack_external_react.useState(false);
744
+ __rspack_external_react.useEffect(()=>{
745
745
  if (!isMobile) return;
746
746
  const timer = globalThis.window.setTimeout(()=>{
747
747
  if (itemRef.current) setIsInsideGroup(isInGroup(itemRef.current));
@@ -1 +1 @@
1
- {"version":3,"file":"components/ui/dropdrawer.js","sources":["../../../src/components/ui/dropdrawer.tsx"],"sourcesContent":["\"use client\";\r\n\r\n/* eslint-disable react/no-children-prop, react-x/no-children-for-each, react-x/no-children-map, react-x/no-children-to-array, react-x/no-clone-element, sonarjs/function-return-type, sonarjs/no-identical-functions, sonarjs/no-unused-vars, max-lines, unicorn/no-array-callback-reference, unicorn/no-useless-undefined, unicorn/prefer-at, unicorn/prefer-dom-node-dataset, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */\r\n\r\nimport {Drawer as BaseDrawer} from \"@base-ui/react/drawer\";\r\nimport {Menu as BaseMenu} from \"@base-ui/react/menu\";\r\nimport {mergeProps} from \"@base-ui/react/merge-props\";\r\nimport {useRender} from \"@base-ui/react/use-render\";\r\nimport {ChevronLeftIcon, ChevronRightIcon} from \"lucide-react\";\r\nimport {AnimatePresence, motion, type Transition} from \"motion/react\";\r\nimport * as React from \"react\";\r\n\r\nimport {useIsMobile} from \"@/hooks/useIsMobile\";\r\nimport {cn} from \"@/lib/utilities\";\r\nimport styles from \"./dropdrawer.module.css\";\r\n\r\nconst MOBILE_MENU_TITLE = \"Menu\";\r\nconst MOBILE_SUBMENU_TITLE = \"Submenu\";\r\nconst MOBILE_BACK_LABEL = \"Go back\";\r\n\r\ninterface DropDrawerContextValue {\r\n isMobile: boolean;\r\n}\r\n\r\nconst DropDrawerContext = React.createContext<DropDrawerContextValue | null>(null);\r\n\r\nconst useDropDrawerContext = (): DropDrawerContextValue => {\r\n const context = React.useContext(DropDrawerContext);\r\n\r\n if (context === null) {\r\n throw new Error(\"DropDrawer components cannot be rendered outside the Context\");\r\n }\r\n\r\n return context;\r\n};\r\n\r\nconst Drawer = BaseDrawer.Root;\r\nconst DrawerPortal = BaseDrawer.Portal;\r\n\r\nconst DrawerTrigger = React.forwardRef<HTMLButtonElement, React.ComponentPropsWithRef<typeof BaseDrawer.Trigger> & {asChild?: boolean}>(\r\n function DrawerTrigger(props, forwardedRef) {\r\n const {asChild = false, children, className, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return (\r\n <BaseDrawer.Trigger\r\n {...otherProps}\r\n ref={forwardedRef}\r\n render={useRender({\r\n defaultTagName: \"button\",\r\n render: renderProp as never,\r\n props: mergeProps({className}, {}),\r\n })}>\r\n {renderProp ? undefined : children}\r\n </BaseDrawer.Trigger>\r\n );\r\n },\r\n);\r\n\r\nfunction DrawerOverlay(props: Readonly<React.ComponentPropsWithRef<typeof BaseDrawer.Backdrop>>): React.ReactElement {\r\n const {className, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseDrawer.Backdrop\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.drawerOverlay, className)}, {}),\r\n })}\r\n />\r\n );\r\n}\r\n\r\nconst DrawerContent = React.forwardRef<HTMLDivElement, React.ComponentPropsWithRef<typeof BaseDrawer.Popup> & {children?: React.ReactNode}>(\r\n function DrawerContent(props, forwardedRef) {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <DrawerPortal>\r\n <DrawerOverlay />\r\n <BaseDrawer.Viewport className={styles.drawerViewport}>\r\n <BaseDrawer.Popup\r\n {...otherProps}\r\n ref={forwardedRef}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.drawerContent, className)}, {}),\r\n })}>\r\n <div className={styles.drawerHandle} />\r\n <BaseDrawer.Content className={styles.drawerInnerContent}>{children}</BaseDrawer.Content>\r\n </BaseDrawer.Popup>\r\n </BaseDrawer.Viewport>\r\n </DrawerPortal>\r\n );\r\n },\r\n);\r\n\r\nfunction DrawerHeader(\r\n props: Readonly<React.ComponentPropsWithRef<\"div\"> & {render?: useRender.RenderProp<Record<string, never>>}>,\r\n): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.drawerHeader, className)}, otherProps, {children}),\r\n });\r\n}\r\n\r\nfunction DrawerFooter(\r\n props: Readonly<React.ComponentPropsWithRef<\"div\"> & {render?: useRender.RenderProp<Record<string, never>>}>,\r\n): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.drawerFooter, className)}, otherProps, {children}),\r\n });\r\n}\r\n\r\nfunction DrawerTitle(props: Readonly<React.ComponentPropsWithRef<typeof BaseDrawer.Title>>): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseDrawer.Title\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"h2\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.drawerTitle, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseDrawer.Title>\r\n );\r\n}\r\n\r\nconst DropdownMenu = BaseMenu.Root;\r\nconst DropdownMenuSub = BaseMenu.SubmenuRoot;\r\n\r\nconst DropdownMenuTrigger = React.forwardRef<HTMLButtonElement, React.ComponentPropsWithRef<typeof BaseMenu.Trigger> & {asChild?: boolean}>(\r\n function DropdownMenuTrigger(props, forwardedRef) {\r\n const {asChild = false, children, className, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return (\r\n <BaseMenu.Trigger\r\n {...otherProps}\r\n ref={forwardedRef}\r\n render={useRender({\r\n defaultTagName: \"button\",\r\n render: renderProp as never,\r\n props: mergeProps({className}, {}),\r\n })}>\r\n {renderProp ? undefined : children}\r\n </BaseMenu.Trigger>\r\n );\r\n },\r\n);\r\n\r\nconst DropdownMenuContent = React.forwardRef<\r\n HTMLDivElement,\r\n React.ComponentPropsWithRef<typeof BaseMenu.Positioner> & {children?: React.ReactNode}\r\n>(function DropdownMenuContent(props, forwardedRef) {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseMenu.Portal>\r\n <BaseMenu.Positioner\r\n {...otherProps}\r\n ref={forwardedRef}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n props: mergeProps({className: styles.dropdownPositioner}, {}),\r\n })}>\r\n <BaseMenu.Popup\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.dropdownContent, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseMenu.Popup>\r\n </BaseMenu.Positioner>\r\n </BaseMenu.Portal>\r\n );\r\n});\r\n\r\ninterface DropdownMenuItemProps extends React.ComponentPropsWithRef<typeof BaseMenu.Item> {\r\n /** @deprecated Prefer Base UI's `render` prop. */\r\n asChild?: boolean;\r\n /**\r\n * Whether to apply inset spacing to align with grouped menu content.\r\n * @default false\r\n */\r\n inset?: boolean;\r\n}\r\n\r\nfunction DropdownMenuItem(props: Readonly<DropdownMenuItemProps>): React.ReactElement {\r\n // eslint-disable-next-line sonarjs/deprecation -- backward-compatible asChild API\r\n const {asChild = false, children, className, inset = false, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return (\r\n <BaseMenu.Item\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: renderProp as never,\r\n props: mergeProps({className: cn(styles.desktopItem, inset && styles.inset, className)}, {}),\r\n })}>\r\n {renderProp ? undefined : children}\r\n </BaseMenu.Item>\r\n );\r\n}\r\n\r\nfunction DropdownMenuLabel(props: Readonly<React.ComponentPropsWithRef<typeof BaseMenu.GroupLabel>>): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseMenu.GroupLabel\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.desktopLabel, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseMenu.GroupLabel>\r\n );\r\n}\r\n\r\nfunction DropdownMenuSeparator(props: Readonly<React.ComponentPropsWithRef<typeof BaseMenu.Separator>>): React.ReactElement {\r\n const {className, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseMenu.Separator\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.desktopSeparator, className)}, {}),\r\n })}\r\n />\r\n );\r\n}\r\n\r\nfunction DropdownMenuSubTrigger(\r\n props: Readonly<React.ComponentPropsWithRef<typeof BaseMenu.SubmenuTrigger> & {inset?: boolean}>,\r\n): React.ReactElement {\r\n const {className, children, inset = false, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseMenu.SubmenuTrigger\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.desktopSubTrigger, inset && styles.inset, className)}, {}),\r\n })}>\r\n {children}\r\n <ChevronRightIcon className={styles.chevron} />\r\n </BaseMenu.SubmenuTrigger>\r\n );\r\n}\r\n\r\nfunction DropdownMenuSubContent(\r\n props: Readonly<React.ComponentPropsWithRef<typeof BaseMenu.Positioner> & {children?: React.ReactNode}>,\r\n): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseMenu.Positioner\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n props: mergeProps({className: styles.dropdownPositioner}, {}),\r\n })}>\r\n <BaseMenu.Popup\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.dropdownSubContent, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseMenu.Popup>\r\n </BaseMenu.Positioner>\r\n );\r\n}\r\n\r\ntype DropDrawerRootProps = React.ComponentProps<typeof Drawer> | React.ComponentProps<typeof DropdownMenu>;\r\ntype DropDrawerTriggerProps =\r\n | React.ComponentPropsWithoutRef<typeof DrawerTrigger>\r\n | React.ComponentPropsWithoutRef<typeof DropdownMenuTrigger>;\r\ntype DropDrawerContentProps =\r\n | React.ComponentPropsWithoutRef<typeof DrawerContent>\r\n | React.ComponentPropsWithoutRef<typeof DropdownMenuContent>;\r\n\r\ninterface MobileSubmenuDataAttributes {\r\n \"data-parent-submenu-id\"?: string;\r\n \"data-parent-submenu\"?: string;\r\n \"data-submenu-id\"?: string;\r\n}\r\n\r\ninterface SharedDropDrawerItemProps\r\n extends Omit<React.ComponentPropsWithoutRef<typeof BaseMenu.Item>, \"children\" | \"onClick\" | \"onSelect\">, MobileSubmenuDataAttributes {\r\n /**\r\n * Item contents.\r\n * @default undefined\r\n */\r\n children?: React.ReactNode;\r\n /**\r\n * Additional CSS classes merged with the item styles.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Whether the desktop dropdown should close after the item is activated.\r\n * @default undefined\r\n */\r\n closeOnClick?: boolean;\r\n /**\r\n * Optional trailing icon or affordance rendered alongside the item content.\r\n * @default undefined\r\n */\r\n icon?: React.ReactNode;\r\n /**\r\n * Whether to apply inset spacing to align the item with grouped content.\r\n * @default undefined\r\n */\r\n inset?: boolean;\r\n /**\r\n * Mouse click handler invoked when the item is activated.\r\n * @default undefined\r\n */\r\n onClick?: React.MouseEventHandler<HTMLElement>;\r\n /**\r\n * Selection callback invoked with the native event when the item is activated.\r\n * @default undefined\r\n */\r\n onSelect?: (event: Event) => void;\r\n}\r\n\r\ninterface SubmenuContextType {\r\n activeSubmenu: string | null;\r\n navigateToSubmenu?: (id: string, title: string) => void;\r\n registerSubmenuContent?: (id: string, content: ReadonlyArray<React.ReactNode>) => void;\r\n setActiveSubmenu: (id: string | null) => void;\r\n setSubmenuTitle: (title: string | null) => void;\r\n submenuTitle: string | null;\r\n}\r\n\r\nconst SubmenuContext = React.createContext<SubmenuContextType>({\r\n activeSubmenu: null,\r\n navigateToSubmenu: undefined,\r\n registerSubmenuContent: undefined,\r\n setActiveSubmenu: () => undefined,\r\n setSubmenuTitle: () => undefined,\r\n submenuTitle: null,\r\n});\r\n\r\n/**\r\n * Provides a responsive dropdown-on-desktop, drawer-on-mobile navigation surface.\r\n *\r\n * @remarks\r\n * - Renders either Base UI `Menu.Root` or `Drawer.Root` depending on viewport size\r\n * - Built on Base UI Menu and Drawer primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawer>\r\n * <DropDrawerTrigger>Open menu</DropDrawerTrigger>\r\n * <DropDrawerContent>\r\n * <DropDrawerItem>Profile</DropDrawerItem>\r\n * </DropDrawerContent>\r\n * </DropDrawer>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawer({children, ...props}: DropDrawerRootProps): React.JSX.Element {\r\n const isMobile = useIsMobile();\r\n\r\n return (\r\n <DropDrawerContext.Provider value={{isMobile}}>\r\n {isMobile ? (\r\n <Drawer\r\n data-slot='drop-drawer'\r\n {...(props as React.ComponentProps<typeof Drawer>)}>\r\n {children}\r\n </Drawer>\r\n ) : (\r\n <DropdownMenu\r\n data-slot='drop-drawer'\r\n {...(props as React.ComponentProps<typeof DropdownMenu>)}>\r\n {children}\r\n </DropdownMenu>\r\n )}\r\n </DropDrawerContext.Provider>\r\n );\r\n}\r\n\r\n/**\r\n * Renders the control that opens the dropdown or drawer surface.\r\n *\r\n * @remarks\r\n * - Renders either a Base UI menu trigger or drawer trigger\r\n * - Built on Base UI Menu and Drawer primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerTrigger>Open menu</DropDrawerTrigger>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/drawer | Base UI Drawer Docs}\r\n */\r\nconst DropDrawerTrigger = React.forwardRef<HTMLButtonElement, DropDrawerTriggerProps>(function DropDrawerTrigger(\r\n {className, children, ...props},\r\n forwardedRef,\r\n) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n return isMobile ? (\r\n <DrawerTrigger\r\n ref={forwardedRef}\r\n data-slot='drop-drawer-trigger'\r\n className={className}\r\n {...(props as React.ComponentProps<typeof DrawerTrigger>)}>\r\n {children}\r\n </DrawerTrigger>\r\n ) : (\r\n <DropdownMenuTrigger\r\n ref={forwardedRef}\r\n data-slot='drop-drawer-trigger'\r\n className={className}\r\n {...(props as React.ComponentProps<typeof DropdownMenuTrigger>)}>\r\n {children}\r\n </DropdownMenuTrigger>\r\n );\r\n});\r\n\r\n/**\r\n * Renders the responsive dropdown or drawer content surface.\r\n *\r\n * @remarks\r\n * - Renders a Base UI popup on desktop and drawer content on mobile\r\n * - Built on Base UI Menu and Drawer primitives with animated mobile submenu navigation\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerContent>\r\n * <DropDrawerItem>Settings</DropDrawerItem>\r\n * </DropDrawerContent>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nconst DropDrawerContent = React.forwardRef<HTMLDivElement, DropDrawerContentProps>(function DropDrawerContent(\r\n {className, children, ...props},\r\n forwardedRef,\r\n) {\r\n const {isMobile} = useDropDrawerContext();\r\n const [activeSubmenu, setActiveSubmenu] = React.useState<string | null>(null);\r\n const [submenuTitle, setSubmenuTitle] = React.useState<string | null>(null);\r\n const [submenuStack, setSubmenuStack] = React.useState<ReadonlyArray<{id: string; title: string}>>([]);\r\n const [animationDirection, setAnimationDirection] = React.useState<\"forward\" | \"backward\">(\"forward\");\r\n const submenuContentRef = React.useRef(new Map<string, ReadonlyArray<React.ReactNode>>());\r\n\r\n React.useEffect(() => {\r\n submenuContentRef.current.clear();\r\n }, [children]);\r\n\r\n const navigateToSubmenu = React.useCallback((id: string, title: string): void => {\r\n setAnimationDirection(\"forward\");\r\n setActiveSubmenu(id);\r\n setSubmenuTitle(title);\r\n setSubmenuStack((previousStack) => [...previousStack, {id, title}]);\r\n }, []);\r\n\r\n const goBack = React.useCallback((): void => {\r\n setAnimationDirection(\"backward\");\r\n\r\n if (submenuStack.length <= 1) {\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n return;\r\n }\r\n\r\n const newStack = [...submenuStack];\r\n newStack.pop();\r\n const previousSubmenu = newStack[newStack.length - 1];\r\n\r\n if (!previousSubmenu) {\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n return;\r\n }\r\n\r\n setActiveSubmenu(previousSubmenu.id);\r\n setSubmenuTitle(previousSubmenu.title);\r\n setSubmenuStack(newStack);\r\n }, [submenuStack]);\r\n\r\n const registerSubmenuContent = React.useCallback((id: string, content: ReadonlyArray<React.ReactNode>): void => {\r\n submenuContentRef.current.set(id, content);\r\n }, []);\r\n\r\n const extractSubmenuContent = React.useCallback((elements: React.ReactNode, targetId: string): ReadonlyArray<React.ReactNode> => {\r\n const result: Array<React.ReactNode> = [];\r\n\r\n const findSubmenuContent = (node: React.ReactNode): void => {\r\n if (!React.isValidElement(node)) {\r\n return;\r\n }\r\n\r\n const element = node as React.ReactElement<{\r\n \"data-submenu-id\"?: string;\r\n children?: React.ReactNode;\r\n id?: string;\r\n }>;\r\n\r\n if (element.type === DropDrawerSub) {\r\n const elementId = element.props.id;\r\n const dataSubmenuId = element.props[\"data-submenu-id\"];\r\n\r\n if (elementId === targetId || dataSubmenuId === targetId) {\r\n if (element.props.children) {\r\n React.Children.forEach(element.props.children, (child) => {\r\n if (React.isValidElement(child) && child.type === DropDrawerSubContent) {\r\n const subContentElement = child as React.ReactElement<{children?: React.ReactNode}>;\r\n\r\n React.Children.forEach(subContentElement.props.children, (contentChild) => {\r\n result.push(contentChild);\r\n });\r\n }\r\n });\r\n }\r\n\r\n return;\r\n }\r\n }\r\n\r\n if (element.props.children) {\r\n React.Children.forEach(element.props.children, findSubmenuContent);\r\n }\r\n };\r\n\r\n React.Children.forEach(elements, findSubmenuContent);\r\n return result;\r\n }, []);\r\n\r\n const getSubmenuContent = React.useCallback(\r\n (id: string): ReadonlyArray<React.ReactNode> => {\r\n const cachedContent = submenuContentRef.current.get(id);\r\n\r\n if (cachedContent && cachedContent.length > 0) {\r\n return cachedContent;\r\n }\r\n\r\n const submenuContent = extractSubmenuContent(children, id);\r\n\r\n if (submenuContent.length > 0) {\r\n submenuContentRef.current.set(id, submenuContent);\r\n }\r\n\r\n return submenuContent;\r\n },\r\n [children, extractSubmenuContent],\r\n );\r\n\r\n const variants = {\r\n center: {\r\n opacity: 1,\r\n x: 0,\r\n },\r\n enter: (direction: \"forward\" | \"backward\") => ({\r\n opacity: 0,\r\n x: direction === \"forward\" ? \"100%\" : \"-100%\",\r\n }),\r\n exit: (direction: \"forward\" | \"backward\") => ({\r\n opacity: 0,\r\n x: direction === \"forward\" ? \"-100%\" : \"100%\",\r\n }),\r\n };\r\n\r\n const transition = {\r\n duration: 0.3,\r\n ease: [0.25, 0.1, 0.25, 1],\r\n } satisfies Transition;\r\n\r\n if (isMobile) {\r\n return (\r\n <SubmenuContext.Provider\r\n value={{\r\n activeSubmenu,\r\n navigateToSubmenu,\r\n registerSubmenuContent,\r\n setActiveSubmenu: (id) => {\r\n if (id === null) {\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n }\r\n },\r\n setSubmenuTitle,\r\n submenuTitle,\r\n }}>\r\n <DrawerContent\r\n ref={forwardedRef}\r\n data-slot='drop-drawer-content'\r\n className={cn(styles.mobileContent, className)}\r\n {...(props as React.ComponentProps<typeof DrawerContent>)}>\r\n {activeSubmenu ? (\r\n <>\r\n <DrawerHeader>\r\n <div className={styles.mobileHeaderRow}>\r\n <button\r\n type='button'\r\n aria-label={MOBILE_BACK_LABEL}\r\n onClick={goBack}\r\n className={styles.backButton}>\r\n <ChevronLeftIcon className={styles.chevron} />\r\n </button>\r\n <DrawerTitle>{submenuTitle || MOBILE_SUBMENU_TITLE}</DrawerTitle>\r\n </div>\r\n </DrawerHeader>\r\n <div className={styles.mobileViewport}>\r\n <AnimatePresence\r\n initial={false}\r\n mode='wait'\r\n custom={animationDirection}>\r\n <motion.div\r\n key={activeSubmenu}\r\n custom={animationDirection}\r\n variants={variants}\r\n initial='enter'\r\n animate='center'\r\n exit='exit'\r\n transition={transition}\r\n className={styles.mobileMotionPanel}>\r\n {getSubmenuContent(activeSubmenu)}\r\n </motion.div>\r\n </AnimatePresence>\r\n </div>\r\n </>\r\n ) : (\r\n <>\r\n <DrawerHeader className={styles.screenReaderOnlyHeader}>\r\n <DrawerTitle>{MOBILE_MENU_TITLE}</DrawerTitle>\r\n </DrawerHeader>\r\n <div className={styles.mobileMainViewport}>\r\n <AnimatePresence\r\n initial={false}\r\n mode='wait'\r\n custom={animationDirection}>\r\n <motion.div\r\n key='main-menu'\r\n custom={animationDirection}\r\n variants={variants}\r\n initial='enter'\r\n animate='center'\r\n exit='exit'\r\n transition={transition}\r\n className={styles.mobileMotionPanel}>\r\n {children}\r\n </motion.div>\r\n </AnimatePresence>\r\n </div>\r\n </>\r\n )}\r\n </DrawerContent>\r\n </SubmenuContext.Provider>\r\n );\r\n }\r\n\r\n return (\r\n <SubmenuContext.Provider\r\n value={{\r\n activeSubmenu,\r\n registerSubmenuContent,\r\n setActiveSubmenu,\r\n setSubmenuTitle,\r\n submenuTitle,\r\n }}>\r\n <DropdownMenuContent\r\n ref={forwardedRef}\r\n data-slot='drop-drawer-content'\r\n align='end'\r\n sideOffset={4}\r\n className={cn(styles.desktopContent, className)}\r\n {...(props as React.ComponentProps<typeof DropdownMenuContent>)}>\r\n {children}\r\n </DropdownMenuContent>\r\n </SubmenuContext.Provider>\r\n );\r\n});\r\n\r\n/**\r\n * Renders an actionable item inside the drop drawer surface.\r\n *\r\n * @remarks\r\n * - Renders a Base UI menu item on desktop and a keyboard-accessible `<div>` on mobile\r\n * - Built on Base UI Menu and Drawer close primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerItem icon={<ChevronRightIcon />}>Account</DropDrawerItem>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerItem({\r\n className,\r\n children,\r\n closeOnClick,\r\n disabled,\r\n icon,\r\n inset,\r\n onClick,\r\n onSelect,\r\n ...props\r\n}: SharedDropDrawerItemProps): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n const isInGroup = React.useCallback((element: HTMLElement | null): boolean => {\r\n if (!element) {\r\n return false;\r\n }\r\n\r\n let parent = element.parentElement;\r\n\r\n while (parent) {\r\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\r\n return true;\r\n }\r\n\r\n parent = parent.parentElement;\r\n }\r\n\r\n return false;\r\n }, []);\r\n\r\n const itemRef = React.useRef<HTMLDivElement>(null);\r\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n if (!isMobile) {\r\n return;\r\n }\r\n\r\n const timer = globalThis.window.setTimeout(() => {\r\n if (itemRef.current) {\r\n setIsInsideGroup(isInGroup(itemRef.current));\r\n }\r\n }, 0);\r\n\r\n return () => globalThis.window.clearTimeout(timer);\r\n }, [isInGroup, isMobile]);\r\n\r\n const handleSelect = React.useCallback(\r\n (event: Event): void => {\r\n if (!disabled) {\r\n onSelect?.(event);\r\n }\r\n },\r\n [disabled, onSelect],\r\n );\r\n\r\n if (isMobile) {\r\n const handleClick: React.MouseEventHandler<HTMLDivElement> = (event): void => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n onClick?.(event);\r\n handleSelect(event.nativeEvent);\r\n };\r\n\r\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (event): void => {\r\n if (event.key !== \"Enter\" && event.key !== \" \") {\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n event.currentTarget.click();\r\n };\r\n\r\n const content = (\r\n <div\r\n ref={itemRef}\r\n data-slot='drop-drawer-item'\r\n data-disabled={disabled}\r\n data-inset={inset}\r\n role='menuitem'\r\n tabIndex={disabled ? -1 : 0}\r\n className={cn(\r\n styles.mobileItem,\r\n !isInsideGroup && styles.mobileStandaloneItem,\r\n isInsideGroup && styles.mobileGroupedItem,\r\n inset && styles.inset,\r\n className,\r\n )}\r\n onClick={handleClick}\r\n onKeyDown={handleKeyDown}\r\n aria-disabled={disabled}\r\n {...props}>\r\n <div className={styles.itemChildren}>{children}</div>\r\n {icon ? <div className={styles.itemIcon}>{icon}</div> : null}\r\n </div>\r\n );\r\n\r\n const parentSubmenuId = props[\"data-parent-submenu-id\"] ?? props[\"data-parent-submenu\"];\r\n\r\n if (parentSubmenuId) {\r\n return content;\r\n }\r\n\r\n return (\r\n <BaseDrawer.Close\r\n nativeButton={false}\r\n render={content}\r\n />\r\n );\r\n }\r\n\r\n const handleDesktopClick: React.MouseEventHandler<HTMLElement> = (event): void => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n onClick?.(event);\r\n handleSelect(event.nativeEvent);\r\n };\r\n\r\n return (\r\n <DropdownMenuItem\r\n data-slot='drop-drawer-item'\r\n data-inset={inset}\r\n className={cn(styles.desktopItem, className)}\r\n closeOnClick={closeOnClick}\r\n disabled={disabled}\r\n inset={inset}\r\n onClick={handleDesktopClick}\r\n {...props}>\r\n <div className={styles.itemRow}>\r\n <div className={styles.itemChildren}>{children}</div>\r\n {icon ? <div className={styles.itemIcon}>{icon}</div> : null}\r\n </div>\r\n </DropdownMenuItem>\r\n );\r\n}\r\n\r\n/**\r\n * Renders a visual separator between desktop drop drawer sections.\r\n *\r\n * @remarks\r\n * - Renders a separator only in desktop dropdown mode\r\n * - Built on Base UI Menu separator primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerSeparator />\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerSeparator({\r\n className,\r\n ...props\r\n}: React.ComponentPropsWithoutRef<typeof DropdownMenuSeparator>): React.JSX.Element | null {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n return null;\r\n }\r\n\r\n return (\r\n <DropdownMenuSeparator\r\n data-slot='drop-drawer-separator'\r\n className={className}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\n/**\r\n * Renders a section label for the drop drawer surface.\r\n *\r\n * @remarks\r\n * - Renders a drawer title on mobile and a menu label on desktop\r\n * - Built on Base UI Drawer and Menu primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerLabel>Actions</DropDrawerLabel>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerLabel({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuLabel> | React.ComponentProps<typeof DrawerTitle>): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n return isMobile ? (\r\n <DrawerHeader className={styles.mobileLabelWrapper}>\r\n <DrawerTitle\r\n data-slot='drop-drawer-label'\r\n className={cn(styles.mobileLabel, className)}\r\n {...(props as React.ComponentProps<typeof DrawerTitle>)}>\r\n {children}\r\n </DrawerTitle>\r\n </DrawerHeader>\r\n ) : (\r\n <DropdownMenuLabel\r\n data-slot='drop-drawer-label'\r\n className={className}\r\n {...(props as React.ComponentProps<typeof DropdownMenuLabel>)}>\r\n {children}\r\n </DropdownMenuLabel>\r\n );\r\n}\r\n\r\n/**\r\n * Renders footer content aligned to the bottom of the responsive surface.\r\n *\r\n * @remarks\r\n * - Renders a drawer footer on mobile and a styled `<div>` on desktop\r\n * - Built on Base UI Drawer primitives for mobile layouts\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerFooter>Signed in as Alex</DropDrawerFooter>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/drawer | Base UI Drawer Docs}\r\n */\r\nfunction DropDrawerFooter({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DrawerFooter> | React.ComponentProps<\"div\">): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n return isMobile ? (\r\n <DrawerFooter\r\n data-slot='drop-drawer-footer'\r\n className={cn(styles.mobileFooter, className)}\r\n {...(props as React.ComponentProps<typeof DrawerFooter>)}>\r\n {children}\r\n </DrawerFooter>\r\n ) : (\r\n <div\r\n data-slot='drop-drawer-footer'\r\n className={cn(styles.desktopFooter, className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n}\r\n\r\n/**\r\n * Renders a grouped collection of drop drawer items.\r\n *\r\n * @remarks\r\n * - Renders a Base UI menu group on desktop and a `<div role=\"group\">` on mobile\r\n * - Inserts mobile-only separators between adjacent children\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerGroup>\r\n * <DropDrawerItem>Profile</DropDrawerItem>\r\n * <DropDrawerItem>Billing</DropDrawerItem>\r\n * </DropDrawerGroup>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/Accessibility/ARIA/Roles/group_role | ARIA Group Role}\r\n */\r\nfunction DropDrawerGroup({className, children, ...props}: React.ComponentProps<\"div\"> & {children: React.ReactNode}): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n const childrenWithSeparators = React.useMemo(() => {\r\n if (!isMobile) {\r\n return children;\r\n }\r\n\r\n const childArray = React.Children.toArray(children);\r\n const filteredChildren = childArray.filter((child) => !(React.isValidElement(child) && child.type === DropDrawerSeparator));\r\n\r\n return filteredChildren.flatMap((child, index) => {\r\n if (index === filteredChildren.length - 1) {\r\n return [child];\r\n }\r\n\r\n return [\r\n child,\r\n <div\r\n key={`separator-${index}`}\r\n className={styles.mobileGroupSeparator}\r\n aria-hidden='true'\r\n />,\r\n ];\r\n });\r\n }, [children, isMobile]);\r\n\r\n return isMobile ? (\r\n <div\r\n data-drop-drawer-group\r\n data-slot='drop-drawer-group'\r\n role='group'\r\n className={cn(styles.mobileGroup, className)}\r\n {...props}>\r\n {childrenWithSeparators}\r\n </div>\r\n ) : (\r\n <BaseMenu.Group\r\n data-drop-drawer-group\r\n data-slot='drop-drawer-group'\r\n className={className}\r\n {...(props as React.ComponentPropsWithoutRef<typeof BaseMenu.Group>)}>\r\n {children}\r\n </BaseMenu.Group>\r\n );\r\n}\r\n\r\n/**\r\n * Renders a submenu root within the drop drawer surface.\r\n *\r\n * @remarks\r\n * - Renders a Base UI submenu on desktop and a mobile-aware container on small screens\r\n * - Registers submenu content for animated mobile drill-down navigation\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerSub>\r\n * <DropDrawerSubTrigger>More</DropDrawerSubTrigger>\r\n * <DropDrawerSubContent>\r\n * <DropDrawerItem>Sub item</DropDrawerItem>\r\n * </DropDrawerSubContent>\r\n * </DropDrawerSub>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerSub({\r\n children,\r\n id,\r\n ...props\r\n}: React.ComponentPropsWithoutRef<typeof DropdownMenuSub> & {children?: React.ReactNode; id?: string}): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n const {registerSubmenuContent} = React.useContext(SubmenuContext);\r\n const generatedId = React.useId();\r\n const submenuId = id || generatedId;\r\n\r\n React.useEffect(() => {\r\n if (!registerSubmenuContent) {\r\n return;\r\n }\r\n\r\n const contentItems: Array<React.ReactNode> = [];\r\n\r\n React.Children.forEach(children, (child) => {\r\n if (React.isValidElement(child) && child.type === DropDrawerSubContent) {\r\n const childElement = child as React.ReactElement<{children?: React.ReactNode}>;\r\n\r\n React.Children.forEach(childElement.props.children, (contentChild) => {\r\n contentItems.push(contentChild);\r\n });\r\n }\r\n });\r\n\r\n if (contentItems.length > 0) {\r\n registerSubmenuContent(submenuId, contentItems);\r\n }\r\n }, [children, registerSubmenuContent, submenuId]);\r\n\r\n if (isMobile) {\r\n const processedChildren = React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) {\r\n return child;\r\n }\r\n\r\n if (child.type === DropDrawerSubTrigger || child.type === DropDrawerSubContent) {\r\n return React.cloneElement(child as React.ReactElement<MobileSubmenuDataAttributes>, {\r\n \"data-parent-submenu\": submenuId,\r\n \"data-parent-submenu-id\": submenuId,\r\n \"data-submenu-id\": submenuId,\r\n });\r\n }\r\n\r\n return child;\r\n });\r\n\r\n return (\r\n <div\r\n data-slot='drop-drawer-sub'\r\n data-submenu-id={submenuId}\r\n id={submenuId}>\r\n {processedChildren}\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <DropdownMenuSub\r\n data-slot='drop-drawer-sub'\r\n data-submenu-id={submenuId}\r\n {...props}>\r\n {children}\r\n </DropdownMenuSub>\r\n );\r\n}\r\n\r\ninterface DropDrawerSubTriggerProps\r\n extends Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuSubTrigger>, \"children\" | \"onClick\">, MobileSubmenuDataAttributes {\r\n /**\r\n * Trigger contents.\r\n * @default undefined\r\n */\r\n children?: React.ReactNode;\r\n /**\r\n * Additional CSS classes merged with the trigger styles.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Whether to apply inset spacing to align the trigger with grouped content.\r\n * @default undefined\r\n */\r\n inset?: boolean;\r\n /**\r\n * Mouse click handler invoked before submenu navigation occurs.\r\n * @default undefined\r\n */\r\n onClick?: React.MouseEventHandler<HTMLElement>;\r\n}\r\n\r\n/**\r\n * Renders the trigger that opens a nested submenu.\r\n *\r\n * @remarks\r\n * - Renders a Base UI submenu trigger on desktop and a keyboard-accessible `<div>` on mobile\r\n * - Built on Base UI Menu submenu primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerSubTrigger>Advanced</DropDrawerSubTrigger>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerSubTrigger({className, inset, children, onClick, ...props}: DropDrawerSubTriggerProps): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n const {navigateToSubmenu} = React.useContext(SubmenuContext);\r\n\r\n const isInGroup = React.useCallback((element: HTMLElement | null): boolean => {\r\n if (!element) {\r\n return false;\r\n }\r\n\r\n let parent = element.parentElement;\r\n\r\n while (parent) {\r\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\r\n return true;\r\n }\r\n\r\n parent = parent.parentElement;\r\n }\r\n\r\n return false;\r\n }, []);\r\n\r\n const itemRef = React.useRef<HTMLDivElement>(null);\r\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n if (!isMobile) {\r\n return;\r\n }\r\n\r\n const timer = globalThis.window.setTimeout(() => {\r\n if (itemRef.current) {\r\n setIsInsideGroup(isInGroup(itemRef.current));\r\n }\r\n }, 0);\r\n\r\n return () => globalThis.window.clearTimeout(timer);\r\n }, [isInGroup, isMobile]);\r\n\r\n if (isMobile) {\r\n const navigate = (eventTarget: HTMLElement): void => {\r\n let submenuId: string | null = null;\r\n const closestElement = eventTarget.closest(\"[data-submenu-id]\");\r\n const closestId = closestElement?.getAttribute(\"data-submenu-id\");\r\n\r\n if (closestId) {\r\n submenuId = closestId;\r\n }\r\n\r\n if (!submenuId) {\r\n submenuId = props[\"data-parent-submenu-id\"] ?? props[\"data-parent-submenu\"] ?? null;\r\n }\r\n\r\n if (!submenuId) {\r\n return;\r\n }\r\n\r\n const title = typeof children === \"string\" ? children : MOBILE_SUBMENU_TITLE;\r\n navigateToSubmenu?.(submenuId, title);\r\n };\r\n\r\n const handleClick: React.MouseEventHandler<HTMLDivElement> = (event): void => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n onClick?.(event);\r\n navigate(event.currentTarget);\r\n };\r\n\r\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (event): void => {\r\n if (event.key !== \"Enter\" && event.key !== \" \") {\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n event.stopPropagation();\r\n event.currentTarget.click();\r\n };\r\n\r\n return (\r\n <div\r\n ref={itemRef}\r\n data-slot='drop-drawer-sub-trigger'\r\n data-inset={inset}\r\n role='menuitem'\r\n tabIndex={0}\r\n className={cn(\r\n styles.mobileItem,\r\n !isInsideGroup && styles.mobileStandaloneItem,\r\n isInsideGroup && styles.mobileGroupedItem,\r\n inset && styles.inset,\r\n className,\r\n )}\r\n onClick={handleClick}\r\n onKeyDown={handleKeyDown}\r\n {...props}>\r\n <div className={styles.itemChildren}>{children}</div>\r\n <ChevronRightIcon className={styles.chevron} />\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <DropdownMenuSubTrigger\r\n data-slot='drop-drawer-sub-trigger'\r\n data-inset={inset}\r\n className={className}\r\n inset={inset}\r\n onClick={onClick}\r\n {...props}>\r\n {children}\r\n </DropdownMenuSubTrigger>\r\n );\r\n}\r\n\r\n/**\r\n * Renders the content region for a nested submenu.\r\n *\r\n * @remarks\r\n * - Renders only in desktop dropdown mode\r\n * - Built on Base UI Menu submenu popup primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerSubContent>\r\n * <DropDrawerItem>Details</DropDrawerItem>\r\n * </DropDrawerSubContent>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerSubContent({\r\n className,\r\n sideOffset = 4,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuSubContent>): React.JSX.Element | null {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n return null;\r\n }\r\n\r\n return (\r\n <DropdownMenuSubContent\r\n data-slot='drop-drawer-sub-content'\r\n sideOffset={sideOffset}\r\n className={cn(styles.dropdownSubContent, className)}\r\n {...props}>\r\n {children}\r\n </DropdownMenuSubContent>\r\n );\r\n}\r\n\r\nDropDrawer.displayName = \"DropDrawer\";\r\nDropDrawerTrigger.displayName = \"DropDrawerTrigger\";\r\nDropDrawerContent.displayName = \"DropDrawerContent\";\r\nDropDrawerItem.displayName = \"DropDrawerItem\";\r\nDropDrawerSeparator.displayName = \"DropDrawerSeparator\";\r\nDropDrawerLabel.displayName = \"DropDrawerLabel\";\r\nDropDrawerFooter.displayName = \"DropDrawerFooter\";\r\nDropDrawerGroup.displayName = \"DropDrawerGroup\";\r\nDropDrawerSub.displayName = \"DropDrawerSub\";\r\nDropDrawerSubTrigger.displayName = \"DropDrawerSubTrigger\";\r\nDropDrawerSubContent.displayName = \"DropDrawerSubContent\";\r\n\r\nexport {\r\n DropDrawer,\r\n DropDrawerContent,\r\n DropDrawerFooter,\r\n DropDrawerGroup,\r\n DropDrawerItem,\r\n DropDrawerLabel,\r\n DropDrawerSeparator,\r\n DropDrawerSub,\r\n DropDrawerSubContent,\r\n DropDrawerSubTrigger,\r\n DropDrawerTrigger,\r\n};\r\n"],"names":["MOBILE_MENU_TITLE","MOBILE_SUBMENU_TITLE","MOBILE_BACK_LABEL","DropDrawerContext","React","useDropDrawerContext","context","Error","Drawer","BaseDrawer","DrawerPortal","DrawerTrigger","props","forwardedRef","asChild","children","className","render","otherProps","renderProp","useRender","mergeProps","undefined","DrawerOverlay","cn","styles","DrawerContent","DrawerHeader","DrawerFooter","DrawerTitle","DropdownMenu","BaseMenu","DropdownMenuSub","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuItem","inset","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuSubTrigger","ChevronRightIcon","DropdownMenuSubContent","SubmenuContext","DropDrawer","isMobile","useIsMobile","DropDrawerTrigger","DropDrawerContent","activeSubmenu","setActiveSubmenu","submenuTitle","setSubmenuTitle","submenuStack","setSubmenuStack","animationDirection","setAnimationDirection","submenuContentRef","Map","navigateToSubmenu","id","title","previousStack","goBack","newStack","previousSubmenu","registerSubmenuContent","content","extractSubmenuContent","elements","targetId","result","findSubmenuContent","node","element","DropDrawerSub","elementId","dataSubmenuId","child","DropDrawerSubContent","subContentElement","contentChild","getSubmenuContent","cachedContent","submenuContent","variants","direction","transition","ChevronLeftIcon","AnimatePresence","motion","DropDrawerItem","closeOnClick","disabled","icon","onClick","onSelect","isInGroup","parent","itemRef","isInsideGroup","setIsInsideGroup","timer","globalThis","handleSelect","event","handleClick","handleKeyDown","parentSubmenuId","handleDesktopClick","DropDrawerSeparator","DropDrawerLabel","DropDrawerFooter","DropDrawerGroup","childrenWithSeparators","childArray","filteredChildren","index","generatedId","submenuId","contentItems","childElement","processedChildren","DropDrawerSubTrigger","navigate","eventTarget","closestElement","closestId","sideOffset"],"mappings":";;;;;;;;;;;;AAgBA,MAAMA,oBAAoB;AAC1B,MAAMC,uBAAuB;AAC7B,MAAMC,oBAAoB;AAM1B,MAAMC,oBAAoB,WAAHA,GAAGC,cAAmD;AAE7E,MAAMC,uBAAuB;IAC3B,MAAMC,UAAUF,WAAiBD;IAEjC,IAAIG,AAAY,SAAZA,SACF,MAAM,IAAIC,MAAM;IAGlB,OAAOD;AACT;AAEA,MAAME,oBAASC,OAAAA,IAAe;AAC9B,MAAMC,eAAeD,OAAAA,MAAiB;AAEtC,MAAME,2BAAgB,WAAHA,GAAGP,WACpB,SAAuBQ,KAAK,EAAEC,YAAY;IACxC,MAAM,EAACC,UAAU,KAAK,EAAEC,Q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QACP,SAAS0D;QACR,GAAGlF,KAAK;kBACRG;;AAGP;AAkBA,SAAS+D,qBAAqB,EAC5B9D,SAAS,EACT+G,aAAa,CAAC,EACdhH,QAAQ,EACR,GAAGH,OACiD;IACpD,MAAM,EAACgC,QAAQ,EAAC,GAAGvC;IAEnB,IAAIuC,UACF,OAAO;IAGT,OAAO,WAAP,GACE,IAACH,wBAAsBA;QACrB,aAAU;QACV,YAAYsF;QACZ,WAAWvG,GAAGC,kBAAAA,kBAAyB,EAAET;QACxC,GAAGJ,KAAK;kBACRG;;AAGP;AAEA4B,WAAW,WAAW,GAAG;AACzBG,6BAAkB,WAAW,GAAG;AAChCC,6BAAkB,WAAW,GAAG;AAChC2C,eAAe,WAAW,GAAG;AAC7BmB,oBAAoB,WAAW,GAAG;AAClCC,gBAAgB,WAAW,GAAG;AAC9BC,iBAAiB,WAAW,GAAG;AAC/BC,gBAAgB,WAAW,GAAG;AAC9BtC,cAAc,WAAW,GAAG;AAC5BgD,qBAAqB,WAAW,GAAG;AACnC5C,qBAAqB,WAAW,GAAG"}
1
+ {"version":3,"file":"components/ui/dropdrawer.js","sources":["../../../src/components/ui/dropdrawer.tsx"],"sourcesContent":["\"use client\";\r\n\r\n/* eslint-disable react/no-children-prop, react-x/no-children-for-each, react-x/no-children-map, react-x/no-children-to-array, react-x/no-clone-element, sonarjs/function-return-type, sonarjs/no-identical-functions, sonarjs/no-unused-vars, max-lines, unicorn/no-array-callback-reference, unicorn/no-useless-undefined, unicorn/prefer-at, unicorn/prefer-dom-node-dataset, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */\r\n\r\nimport {Drawer as BaseDrawer} from \"@base-ui/react/drawer\";\r\nimport {Menu as BaseMenu} from \"@base-ui/react/menu\";\r\nimport {mergeProps} from \"@base-ui/react/merge-props\";\r\nimport {useRender} from \"@base-ui/react/use-render\";\r\nimport {ChevronLeftIcon, ChevronRightIcon} from \"lucide-react\";\r\nimport {AnimatePresence, motion, type Transition} from \"motion/react\";\r\nimport * as React from \"react\";\r\n\r\nimport {useIsMobile} from \"@/hooks/useIsMobile\";\r\nimport {cn} from \"@/lib/utilities\";\r\nimport styles from \"./dropdrawer.module.css\";\r\n\r\nconst MOBILE_MENU_TITLE = \"Menu\";\r\nconst MOBILE_SUBMENU_TITLE = \"Submenu\";\r\nconst MOBILE_BACK_LABEL = \"Go back\";\r\n\r\ninterface DropDrawerContextValue {\r\n isMobile: boolean;\r\n}\r\n\r\nconst DropDrawerContext = React.createContext<DropDrawerContextValue | null>(null);\r\n\r\nconst useDropDrawerContext = (): DropDrawerContextValue => {\r\n const context = React.useContext(DropDrawerContext);\r\n\r\n if (context === null) {\r\n throw new Error(\"DropDrawer components cannot be rendered outside the Context\");\r\n }\r\n\r\n return context;\r\n};\r\n\r\nconst Drawer = BaseDrawer.Root;\r\nconst DrawerPortal = BaseDrawer.Portal;\r\n\r\nconst DrawerTrigger = React.forwardRef<HTMLButtonElement, React.ComponentPropsWithRef<typeof BaseDrawer.Trigger> & {asChild?: boolean}>(\r\n function DrawerTrigger(props, forwardedRef) {\r\n const {asChild = false, children, className, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return (\r\n <BaseDrawer.Trigger\r\n {...otherProps}\r\n ref={forwardedRef}\r\n render={useRender({\r\n defaultTagName: \"button\",\r\n render: renderProp as never,\r\n props: mergeProps({className}, {}),\r\n })}>\r\n {renderProp ? undefined : children}\r\n </BaseDrawer.Trigger>\r\n );\r\n },\r\n);\r\n\r\nfunction DrawerOverlay(props: Readonly<React.ComponentPropsWithRef<typeof BaseDrawer.Backdrop>>): React.ReactElement {\r\n const {className, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseDrawer.Backdrop\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.drawerOverlay, className)}, {}),\r\n })}\r\n />\r\n );\r\n}\r\n\r\nconst DrawerContent = React.forwardRef<HTMLDivElement, React.ComponentPropsWithRef<typeof BaseDrawer.Popup> & {children?: React.ReactNode}>(\r\n function DrawerContent(props, forwardedRef) {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <DrawerPortal>\r\n <DrawerOverlay />\r\n <BaseDrawer.Viewport className={styles.drawerViewport}>\r\n <BaseDrawer.Popup\r\n {...otherProps}\r\n ref={forwardedRef}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.drawerContent, className)}, {}),\r\n })}>\r\n <div className={styles.drawerHandle} />\r\n <BaseDrawer.Content className={styles.drawerInnerContent}>{children}</BaseDrawer.Content>\r\n </BaseDrawer.Popup>\r\n </BaseDrawer.Viewport>\r\n </DrawerPortal>\r\n );\r\n },\r\n);\r\n\r\nfunction DrawerHeader(\r\n props: Readonly<React.ComponentPropsWithRef<\"div\"> & {render?: useRender.RenderProp<Record<string, never>>}>,\r\n): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.drawerHeader, className)}, otherProps, {children}),\r\n });\r\n}\r\n\r\nfunction DrawerFooter(\r\n props: Readonly<React.ComponentPropsWithRef<\"div\"> & {render?: useRender.RenderProp<Record<string, never>>}>,\r\n): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.drawerFooter, className)}, otherProps, {children}),\r\n });\r\n}\r\n\r\nfunction DrawerTitle(props: Readonly<React.ComponentPropsWithRef<typeof BaseDrawer.Title>>): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseDrawer.Title\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"h2\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.drawerTitle, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseDrawer.Title>\r\n );\r\n}\r\n\r\nconst DropdownMenu = BaseMenu.Root;\r\nconst DropdownMenuSub = BaseMenu.SubmenuRoot;\r\n\r\nconst DropdownMenuTrigger = React.forwardRef<HTMLButtonElement, React.ComponentPropsWithRef<typeof BaseMenu.Trigger> & {asChild?: boolean}>(\r\n function DropdownMenuTrigger(props, forwardedRef) {\r\n const {asChild = false, children, className, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return (\r\n <BaseMenu.Trigger\r\n {...otherProps}\r\n ref={forwardedRef}\r\n render={useRender({\r\n defaultTagName: \"button\",\r\n render: renderProp as never,\r\n props: mergeProps({className}, {}),\r\n })}>\r\n {renderProp ? undefined : children}\r\n </BaseMenu.Trigger>\r\n );\r\n },\r\n);\r\n\r\nconst DropdownMenuContent = React.forwardRef<\r\n HTMLDivElement,\r\n React.ComponentPropsWithRef<typeof BaseMenu.Positioner> & {children?: React.ReactNode}\r\n>(function DropdownMenuContent(props, forwardedRef) {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseMenu.Portal>\r\n <BaseMenu.Positioner\r\n {...otherProps}\r\n ref={forwardedRef}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n props: mergeProps({className: styles.dropdownPositioner}, {}),\r\n })}>\r\n <BaseMenu.Popup\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.dropdownContent, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseMenu.Popup>\r\n </BaseMenu.Positioner>\r\n </BaseMenu.Portal>\r\n );\r\n});\r\n\r\ninterface DropdownMenuItemProps extends React.ComponentPropsWithRef<typeof BaseMenu.Item> {\r\n /** @deprecated Prefer Base UI's `render` prop. */\r\n asChild?: boolean;\r\n /**\r\n * Whether to apply inset spacing to align with grouped menu content.\r\n * @default false\r\n */\r\n inset?: boolean;\r\n}\r\n\r\nfunction DropdownMenuItem(props: Readonly<DropdownMenuItemProps>): React.ReactElement {\r\n // eslint-disable-next-line sonarjs/deprecation -- backward-compatible asChild API\r\n const {asChild = false, children, className, inset = false, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return (\r\n <BaseMenu.Item\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: renderProp as never,\r\n props: mergeProps({className: cn(styles.desktopItem, inset && styles.inset, className)}, {}),\r\n })}>\r\n {renderProp ? undefined : children}\r\n </BaseMenu.Item>\r\n );\r\n}\r\n\r\nfunction DropdownMenuLabel(props: Readonly<React.ComponentPropsWithRef<typeof BaseMenu.GroupLabel>>): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseMenu.GroupLabel\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.desktopLabel, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseMenu.GroupLabel>\r\n );\r\n}\r\n\r\nfunction DropdownMenuSeparator(props: Readonly<React.ComponentPropsWithRef<typeof BaseMenu.Separator>>): React.ReactElement {\r\n const {className, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseMenu.Separator\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.desktopSeparator, className)}, {}),\r\n })}\r\n />\r\n );\r\n}\r\n\r\nfunction DropdownMenuSubTrigger(\r\n props: Readonly<React.ComponentPropsWithRef<typeof BaseMenu.SubmenuTrigger> & {inset?: boolean}>,\r\n): React.ReactElement {\r\n const {className, children, inset = false, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseMenu.SubmenuTrigger\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.desktopSubTrigger, inset && styles.inset, className)}, {}),\r\n })}>\r\n {children}\r\n <ChevronRightIcon className={styles.chevron} />\r\n </BaseMenu.SubmenuTrigger>\r\n );\r\n}\r\n\r\nfunction DropdownMenuSubContent(\r\n props: Readonly<React.ComponentPropsWithRef<typeof BaseMenu.Positioner> & {children?: React.ReactNode}>,\r\n): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseMenu.Positioner\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n props: mergeProps({className: styles.dropdownPositioner}, {}),\r\n })}>\r\n <BaseMenu.Popup\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.dropdownSubContent, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseMenu.Popup>\r\n </BaseMenu.Positioner>\r\n );\r\n}\r\n\r\ntype DropDrawerRootProps = React.ComponentProps<typeof Drawer> | React.ComponentProps<typeof DropdownMenu>;\r\ntype DropDrawerTriggerProps =\r\n | React.ComponentPropsWithoutRef<typeof DrawerTrigger>\r\n | React.ComponentPropsWithoutRef<typeof DropdownMenuTrigger>;\r\ntype DropDrawerContentProps =\r\n | React.ComponentPropsWithoutRef<typeof DrawerContent>\r\n | React.ComponentPropsWithoutRef<typeof DropdownMenuContent>;\r\n\r\ninterface MobileSubmenuDataAttributes {\r\n \"data-parent-submenu-id\"?: string;\r\n \"data-parent-submenu\"?: string;\r\n \"data-submenu-id\"?: string;\r\n}\r\n\r\ninterface SharedDropDrawerItemProps\r\n extends Omit<React.ComponentPropsWithoutRef<typeof BaseMenu.Item>, \"children\" | \"onClick\" | \"onSelect\">, MobileSubmenuDataAttributes {\r\n /**\r\n * Item contents.\r\n * @default undefined\r\n */\r\n children?: React.ReactNode;\r\n /**\r\n * Additional CSS classes merged with the item styles.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Whether the desktop dropdown should close after the item is activated.\r\n * @default undefined\r\n */\r\n closeOnClick?: boolean;\r\n /**\r\n * Optional trailing icon or affordance rendered alongside the item content.\r\n * @default undefined\r\n */\r\n icon?: React.ReactNode;\r\n /**\r\n * Whether to apply inset spacing to align the item with grouped content.\r\n * @default undefined\r\n */\r\n inset?: boolean;\r\n /**\r\n * Mouse click handler invoked when the item is activated.\r\n * @default undefined\r\n */\r\n onClick?: React.MouseEventHandler<HTMLElement>;\r\n /**\r\n * Selection callback invoked with the native event when the item is activated.\r\n * @default undefined\r\n */\r\n onSelect?: (event: Event) => void;\r\n}\r\n\r\ninterface SubmenuContextType {\r\n activeSubmenu: string | null;\r\n navigateToSubmenu?: (id: string, title: string) => void;\r\n registerSubmenuContent?: (id: string, content: ReadonlyArray<React.ReactNode>) => void;\r\n setActiveSubmenu: (id: string | null) => void;\r\n setSubmenuTitle: (title: string | null) => void;\r\n submenuTitle: string | null;\r\n}\r\n\r\nconst SubmenuContext = React.createContext<SubmenuContextType>({\r\n activeSubmenu: null,\r\n navigateToSubmenu: undefined,\r\n registerSubmenuContent: undefined,\r\n setActiveSubmenu: () => undefined,\r\n setSubmenuTitle: () => undefined,\r\n submenuTitle: null,\r\n});\r\n\r\n/**\r\n * Provides a responsive dropdown-on-desktop, drawer-on-mobile navigation surface.\r\n *\r\n * @remarks\r\n * - Renders either Base UI `Menu.Root` or `Drawer.Root` depending on viewport size\r\n * - Built on Base UI Menu and Drawer primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawer>\r\n * <DropDrawerTrigger>Open menu</DropDrawerTrigger>\r\n * <DropDrawerContent>\r\n * <DropDrawerItem>Profile</DropDrawerItem>\r\n * </DropDrawerContent>\r\n * </DropDrawer>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawer({children, ...props}: DropDrawerRootProps): React.JSX.Element {\r\n const isMobile = useIsMobile();\r\n\r\n return (\r\n <DropDrawerContext.Provider value={{isMobile}}>\r\n {isMobile ? (\r\n <Drawer\r\n data-slot='drop-drawer'\r\n {...(props as React.ComponentProps<typeof Drawer>)}>\r\n {children}\r\n </Drawer>\r\n ) : (\r\n <DropdownMenu\r\n data-slot='drop-drawer'\r\n {...(props as React.ComponentProps<typeof DropdownMenu>)}>\r\n {children}\r\n </DropdownMenu>\r\n )}\r\n </DropDrawerContext.Provider>\r\n );\r\n}\r\n\r\n/**\r\n * Renders the control that opens the dropdown or drawer surface.\r\n *\r\n * @remarks\r\n * - Renders either a Base UI menu trigger or drawer trigger\r\n * - Built on Base UI Menu and Drawer primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerTrigger>Open menu</DropDrawerTrigger>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/drawer | Base UI Drawer Docs}\r\n */\r\nconst DropDrawerTrigger = React.forwardRef<HTMLButtonElement, DropDrawerTriggerProps>(function DropDrawerTrigger(\r\n {className, children, ...props},\r\n forwardedRef,\r\n) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n return isMobile ? (\r\n <DrawerTrigger\r\n ref={forwardedRef}\r\n data-slot='drop-drawer-trigger'\r\n className={className}\r\n {...(props as React.ComponentProps<typeof DrawerTrigger>)}>\r\n {children}\r\n </DrawerTrigger>\r\n ) : (\r\n <DropdownMenuTrigger\r\n ref={forwardedRef}\r\n data-slot='drop-drawer-trigger'\r\n className={className}\r\n {...(props as React.ComponentProps<typeof DropdownMenuTrigger>)}>\r\n {children}\r\n </DropdownMenuTrigger>\r\n );\r\n});\r\n\r\n/**\r\n * Renders the responsive dropdown or drawer content surface.\r\n *\r\n * @remarks\r\n * - Renders a Base UI popup on desktop and drawer content on mobile\r\n * - Built on Base UI Menu and Drawer primitives with animated mobile submenu navigation\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerContent>\r\n * <DropDrawerItem>Settings</DropDrawerItem>\r\n * </DropDrawerContent>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nconst DropDrawerContent = React.forwardRef<HTMLDivElement, DropDrawerContentProps>(function DropDrawerContent(\r\n {className, children, ...props},\r\n forwardedRef,\r\n) {\r\n const {isMobile} = useDropDrawerContext();\r\n const [activeSubmenu, setActiveSubmenu] = React.useState<string | null>(null);\r\n const [submenuTitle, setSubmenuTitle] = React.useState<string | null>(null);\r\n const [submenuStack, setSubmenuStack] = React.useState<ReadonlyArray<{id: string; title: string}>>([]);\r\n const [animationDirection, setAnimationDirection] = React.useState<\"forward\" | \"backward\">(\"forward\");\r\n const submenuContentRef = React.useRef(new Map<string, ReadonlyArray<React.ReactNode>>());\r\n\r\n React.useEffect(() => {\r\n submenuContentRef.current.clear();\r\n }, [children]);\r\n\r\n const navigateToSubmenu = React.useCallback((id: string, title: string): void => {\r\n setAnimationDirection(\"forward\");\r\n setActiveSubmenu(id);\r\n setSubmenuTitle(title);\r\n setSubmenuStack((previousStack) => [...previousStack, {id, title}]);\r\n }, []);\r\n\r\n const goBack = React.useCallback((): void => {\r\n setAnimationDirection(\"backward\");\r\n\r\n if (submenuStack.length <= 1) {\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n return;\r\n }\r\n\r\n const newStack = [...submenuStack];\r\n newStack.pop();\r\n const previousSubmenu = newStack[newStack.length - 1];\r\n\r\n if (!previousSubmenu) {\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n return;\r\n }\r\n\r\n setActiveSubmenu(previousSubmenu.id);\r\n setSubmenuTitle(previousSubmenu.title);\r\n setSubmenuStack(newStack);\r\n }, [submenuStack]);\r\n\r\n const registerSubmenuContent = React.useCallback((id: string, content: ReadonlyArray<React.ReactNode>): void => {\r\n submenuContentRef.current.set(id, content);\r\n }, []);\r\n\r\n const extractSubmenuContent = React.useCallback((elements: React.ReactNode, targetId: string): ReadonlyArray<React.ReactNode> => {\r\n const result: Array<React.ReactNode> = [];\r\n\r\n const findSubmenuContent = (node: React.ReactNode): void => {\r\n if (!React.isValidElement(node)) {\r\n return;\r\n }\r\n\r\n const element = node as React.ReactElement<{\r\n \"data-submenu-id\"?: string;\r\n children?: React.ReactNode;\r\n id?: string;\r\n }>;\r\n\r\n if (element.type === DropDrawerSub) {\r\n const elementId = element.props.id;\r\n const dataSubmenuId = element.props[\"data-submenu-id\"];\r\n\r\n if (elementId === targetId || dataSubmenuId === targetId) {\r\n if (element.props.children) {\r\n React.Children.forEach(element.props.children, (child) => {\r\n if (React.isValidElement(child) && child.type === DropDrawerSubContent) {\r\n const subContentElement = child as React.ReactElement<{children?: React.ReactNode}>;\r\n\r\n React.Children.forEach(subContentElement.props.children, (contentChild) => {\r\n result.push(contentChild);\r\n });\r\n }\r\n });\r\n }\r\n\r\n return;\r\n }\r\n }\r\n\r\n if (element.props.children) {\r\n React.Children.forEach(element.props.children, findSubmenuContent);\r\n }\r\n };\r\n\r\n React.Children.forEach(elements, findSubmenuContent);\r\n return result;\r\n }, []);\r\n\r\n const getSubmenuContent = React.useCallback(\r\n (id: string): ReadonlyArray<React.ReactNode> => {\r\n const cachedContent = submenuContentRef.current.get(id);\r\n\r\n if (cachedContent && cachedContent.length > 0) {\r\n return cachedContent;\r\n }\r\n\r\n const submenuContent = extractSubmenuContent(children, id);\r\n\r\n if (submenuContent.length > 0) {\r\n submenuContentRef.current.set(id, submenuContent);\r\n }\r\n\r\n return submenuContent;\r\n },\r\n [children, extractSubmenuContent],\r\n );\r\n\r\n const variants = {\r\n center: {\r\n opacity: 1,\r\n x: 0,\r\n },\r\n enter: (direction: \"forward\" | \"backward\") => ({\r\n opacity: 0,\r\n x: direction === \"forward\" ? \"100%\" : \"-100%\",\r\n }),\r\n exit: (direction: \"forward\" | \"backward\") => ({\r\n opacity: 0,\r\n x: direction === \"forward\" ? \"-100%\" : \"100%\",\r\n }),\r\n };\r\n\r\n const transition = {\r\n duration: 0.3,\r\n ease: [0.25, 0.1, 0.25, 1],\r\n } satisfies Transition;\r\n\r\n if (isMobile) {\r\n return (\r\n <SubmenuContext.Provider\r\n value={{\r\n activeSubmenu,\r\n navigateToSubmenu,\r\n registerSubmenuContent,\r\n setActiveSubmenu: (id) => {\r\n if (id === null) {\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n }\r\n },\r\n setSubmenuTitle,\r\n submenuTitle,\r\n }}>\r\n <DrawerContent\r\n ref={forwardedRef}\r\n data-slot='drop-drawer-content'\r\n className={cn(styles.mobileContent, className)}\r\n {...(props as React.ComponentProps<typeof DrawerContent>)}>\r\n {activeSubmenu ? (\r\n <>\r\n <DrawerHeader>\r\n <div className={styles.mobileHeaderRow}>\r\n <button\r\n type='button'\r\n aria-label={MOBILE_BACK_LABEL}\r\n onClick={goBack}\r\n className={styles.backButton}>\r\n <ChevronLeftIcon className={styles.chevron} />\r\n </button>\r\n <DrawerTitle>{submenuTitle || MOBILE_SUBMENU_TITLE}</DrawerTitle>\r\n </div>\r\n </DrawerHeader>\r\n <div className={styles.mobileViewport}>\r\n <AnimatePresence\r\n initial={false}\r\n mode='wait'\r\n custom={animationDirection}>\r\n <motion.div\r\n key={activeSubmenu}\r\n custom={animationDirection}\r\n variants={variants}\r\n initial='enter'\r\n animate='center'\r\n exit='exit'\r\n transition={transition}\r\n className={styles.mobileMotionPanel}>\r\n {getSubmenuContent(activeSubmenu)}\r\n </motion.div>\r\n </AnimatePresence>\r\n </div>\r\n </>\r\n ) : (\r\n <>\r\n <DrawerHeader className={styles.screenReaderOnlyHeader}>\r\n <DrawerTitle>{MOBILE_MENU_TITLE}</DrawerTitle>\r\n </DrawerHeader>\r\n <div className={styles.mobileMainViewport}>\r\n <AnimatePresence\r\n initial={false}\r\n mode='wait'\r\n custom={animationDirection}>\r\n <motion.div\r\n key='main-menu'\r\n custom={animationDirection}\r\n variants={variants}\r\n initial='enter'\r\n animate='center'\r\n exit='exit'\r\n transition={transition}\r\n className={styles.mobileMotionPanel}>\r\n {children}\r\n </motion.div>\r\n </AnimatePresence>\r\n </div>\r\n </>\r\n )}\r\n </DrawerContent>\r\n </SubmenuContext.Provider>\r\n );\r\n }\r\n\r\n return (\r\n <SubmenuContext.Provider\r\n value={{\r\n activeSubmenu,\r\n registerSubmenuContent,\r\n setActiveSubmenu,\r\n setSubmenuTitle,\r\n submenuTitle,\r\n }}>\r\n <DropdownMenuContent\r\n ref={forwardedRef}\r\n data-slot='drop-drawer-content'\r\n align='end'\r\n sideOffset={4}\r\n className={cn(styles.desktopContent, className)}\r\n {...(props as React.ComponentProps<typeof DropdownMenuContent>)}>\r\n {children}\r\n </DropdownMenuContent>\r\n </SubmenuContext.Provider>\r\n );\r\n});\r\n\r\n/**\r\n * Renders an actionable item inside the drop drawer surface.\r\n *\r\n * @remarks\r\n * - Renders a Base UI menu item on desktop and a keyboard-accessible `<div>` on mobile\r\n * - Built on Base UI Menu and Drawer close primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerItem icon={<ChevronRightIcon />}>Account</DropDrawerItem>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerItem({\r\n className,\r\n children,\r\n closeOnClick,\r\n disabled,\r\n icon,\r\n inset,\r\n onClick,\r\n onSelect,\r\n ...props\r\n}: SharedDropDrawerItemProps): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n const isInGroup = React.useCallback((element: HTMLElement | null): boolean => {\r\n if (!element) {\r\n return false;\r\n }\r\n\r\n let parent = element.parentElement;\r\n\r\n while (parent) {\r\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\r\n return true;\r\n }\r\n\r\n parent = parent.parentElement;\r\n }\r\n\r\n return false;\r\n }, []);\r\n\r\n const itemRef = React.useRef<HTMLDivElement>(null);\r\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n if (!isMobile) {\r\n return;\r\n }\r\n\r\n const timer = globalThis.window.setTimeout(() => {\r\n if (itemRef.current) {\r\n setIsInsideGroup(isInGroup(itemRef.current));\r\n }\r\n }, 0);\r\n\r\n return () => globalThis.window.clearTimeout(timer);\r\n }, [isInGroup, isMobile]);\r\n\r\n const handleSelect = React.useCallback(\r\n (event: Event): void => {\r\n if (!disabled) {\r\n onSelect?.(event);\r\n }\r\n },\r\n [disabled, onSelect],\r\n );\r\n\r\n if (isMobile) {\r\n const handleClick: React.MouseEventHandler<HTMLDivElement> = (event): void => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n onClick?.(event);\r\n handleSelect(event.nativeEvent);\r\n };\r\n\r\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (event): void => {\r\n if (event.key !== \"Enter\" && event.key !== \" \") {\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n event.currentTarget.click();\r\n };\r\n\r\n const content = (\r\n <div\r\n ref={itemRef}\r\n data-slot='drop-drawer-item'\r\n data-disabled={disabled}\r\n data-inset={inset}\r\n role='menuitem'\r\n tabIndex={disabled ? -1 : 0}\r\n className={cn(\r\n styles.mobileItem,\r\n !isInsideGroup && styles.mobileStandaloneItem,\r\n isInsideGroup && styles.mobileGroupedItem,\r\n inset && styles.inset,\r\n className,\r\n )}\r\n onClick={handleClick}\r\n onKeyDown={handleKeyDown}\r\n aria-disabled={disabled}\r\n {...props}>\r\n <div className={styles.itemChildren}>{children}</div>\r\n {icon ? <div className={styles.itemIcon}>{icon}</div> : null}\r\n </div>\r\n );\r\n\r\n const parentSubmenuId = props[\"data-parent-submenu-id\"] ?? props[\"data-parent-submenu\"];\r\n\r\n if (parentSubmenuId) {\r\n return content;\r\n }\r\n\r\n return (\r\n <BaseDrawer.Close\r\n nativeButton={false}\r\n render={content}\r\n />\r\n );\r\n }\r\n\r\n const handleDesktopClick: React.MouseEventHandler<HTMLElement> = (event): void => {\r\n if (disabled) {\r\n return;\r\n }\r\n\r\n onClick?.(event);\r\n handleSelect(event.nativeEvent);\r\n };\r\n\r\n return (\r\n <DropdownMenuItem\r\n data-slot='drop-drawer-item'\r\n data-inset={inset}\r\n className={cn(styles.desktopItem, className)}\r\n closeOnClick={closeOnClick}\r\n disabled={disabled}\r\n inset={inset}\r\n onClick={handleDesktopClick}\r\n {...props}>\r\n <div className={styles.itemRow}>\r\n <div className={styles.itemChildren}>{children}</div>\r\n {icon ? <div className={styles.itemIcon}>{icon}</div> : null}\r\n </div>\r\n </DropdownMenuItem>\r\n );\r\n}\r\n\r\n/**\r\n * Renders a visual separator between desktop drop drawer sections.\r\n *\r\n * @remarks\r\n * - Renders a separator only in desktop dropdown mode\r\n * - Built on Base UI Menu separator primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerSeparator />\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerSeparator({\r\n className,\r\n ...props\r\n}: React.ComponentPropsWithoutRef<typeof DropdownMenuSeparator>): React.JSX.Element | null {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n return null;\r\n }\r\n\r\n return (\r\n <DropdownMenuSeparator\r\n data-slot='drop-drawer-separator'\r\n className={className}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\n/**\r\n * Renders a section label for the drop drawer surface.\r\n *\r\n * @remarks\r\n * - Renders a drawer title on mobile and a menu label on desktop\r\n * - Built on Base UI Drawer and Menu primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerLabel>Actions</DropDrawerLabel>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerLabel({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuLabel> | React.ComponentProps<typeof DrawerTitle>): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n return isMobile ? (\r\n <DrawerHeader className={styles.mobileLabelWrapper}>\r\n <DrawerTitle\r\n data-slot='drop-drawer-label'\r\n className={cn(styles.mobileLabel, className)}\r\n {...(props as React.ComponentProps<typeof DrawerTitle>)}>\r\n {children}\r\n </DrawerTitle>\r\n </DrawerHeader>\r\n ) : (\r\n <DropdownMenuLabel\r\n data-slot='drop-drawer-label'\r\n className={className}\r\n {...(props as React.ComponentProps<typeof DropdownMenuLabel>)}>\r\n {children}\r\n </DropdownMenuLabel>\r\n );\r\n}\r\n\r\n/**\r\n * Renders footer content aligned to the bottom of the responsive surface.\r\n *\r\n * @remarks\r\n * - Renders a drawer footer on mobile and a styled `<div>` on desktop\r\n * - Built on Base UI Drawer primitives for mobile layouts\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerFooter>Signed in as Alex</DropDrawerFooter>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/drawer | Base UI Drawer Docs}\r\n */\r\nfunction DropDrawerFooter({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DrawerFooter> | React.ComponentProps<\"div\">): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n return isMobile ? (\r\n <DrawerFooter\r\n data-slot='drop-drawer-footer'\r\n className={cn(styles.mobileFooter, className)}\r\n {...(props as React.ComponentProps<typeof DrawerFooter>)}>\r\n {children}\r\n </DrawerFooter>\r\n ) : (\r\n <div\r\n data-slot='drop-drawer-footer'\r\n className={cn(styles.desktopFooter, className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n}\r\n\r\n/**\r\n * Renders a grouped collection of drop drawer items.\r\n *\r\n * @remarks\r\n * - Renders a Base UI menu group on desktop and a `<div role=\"group\">` on mobile\r\n * - Inserts mobile-only separators between adjacent children\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerGroup>\r\n * <DropDrawerItem>Profile</DropDrawerItem>\r\n * <DropDrawerItem>Billing</DropDrawerItem>\r\n * </DropDrawerGroup>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/Accessibility/ARIA/Roles/group_role | ARIA Group Role}\r\n */\r\nfunction DropDrawerGroup({className, children, ...props}: React.ComponentProps<\"div\"> & {children: React.ReactNode}): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n const childrenWithSeparators = React.useMemo(() => {\r\n if (!isMobile) {\r\n return children;\r\n }\r\n\r\n const childArray = React.Children.toArray(children);\r\n const filteredChildren = childArray.filter((child) => !(React.isValidElement(child) && child.type === DropDrawerSeparator));\r\n\r\n return filteredChildren.flatMap((child, index) => {\r\n if (index === filteredChildren.length - 1) {\r\n return [child];\r\n }\r\n\r\n return [\r\n child,\r\n <div\r\n key={`separator-${index}`}\r\n className={styles.mobileGroupSeparator}\r\n aria-hidden='true'\r\n />,\r\n ];\r\n });\r\n }, [children, isMobile]);\r\n\r\n return isMobile ? (\r\n <div\r\n data-drop-drawer-group\r\n data-slot='drop-drawer-group'\r\n role='group'\r\n className={cn(styles.mobileGroup, className)}\r\n {...props}>\r\n {childrenWithSeparators}\r\n </div>\r\n ) : (\r\n <BaseMenu.Group\r\n data-drop-drawer-group\r\n data-slot='drop-drawer-group'\r\n className={className}\r\n {...(props as React.ComponentPropsWithoutRef<typeof BaseMenu.Group>)}>\r\n {children}\r\n </BaseMenu.Group>\r\n );\r\n}\r\n\r\n/**\r\n * Renders a submenu root within the drop drawer surface.\r\n *\r\n * @remarks\r\n * - Renders a Base UI submenu on desktop and a mobile-aware container on small screens\r\n * - Registers submenu content for animated mobile drill-down navigation\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerSub>\r\n * <DropDrawerSubTrigger>More</DropDrawerSubTrigger>\r\n * <DropDrawerSubContent>\r\n * <DropDrawerItem>Sub item</DropDrawerItem>\r\n * </DropDrawerSubContent>\r\n * </DropDrawerSub>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerSub({\r\n children,\r\n id,\r\n ...props\r\n}: React.ComponentPropsWithoutRef<typeof DropdownMenuSub> & {children?: React.ReactNode; id?: string}): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n const {registerSubmenuContent} = React.useContext(SubmenuContext);\r\n const generatedId = React.useId();\r\n const submenuId = id || generatedId;\r\n\r\n React.useEffect(() => {\r\n if (!registerSubmenuContent) {\r\n return;\r\n }\r\n\r\n const contentItems: Array<React.ReactNode> = [];\r\n\r\n React.Children.forEach(children, (child) => {\r\n if (React.isValidElement(child) && child.type === DropDrawerSubContent) {\r\n const childElement = child as React.ReactElement<{children?: React.ReactNode}>;\r\n\r\n React.Children.forEach(childElement.props.children, (contentChild) => {\r\n contentItems.push(contentChild);\r\n });\r\n }\r\n });\r\n\r\n if (contentItems.length > 0) {\r\n registerSubmenuContent(submenuId, contentItems);\r\n }\r\n }, [children, registerSubmenuContent, submenuId]);\r\n\r\n if (isMobile) {\r\n const processedChildren = React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) {\r\n return child;\r\n }\r\n\r\n if (child.type === DropDrawerSubTrigger || child.type === DropDrawerSubContent) {\r\n return React.cloneElement(child as React.ReactElement<MobileSubmenuDataAttributes>, {\r\n \"data-parent-submenu\": submenuId,\r\n \"data-parent-submenu-id\": submenuId,\r\n \"data-submenu-id\": submenuId,\r\n });\r\n }\r\n\r\n return child;\r\n });\r\n\r\n return (\r\n <div\r\n data-slot='drop-drawer-sub'\r\n data-submenu-id={submenuId}\r\n id={submenuId}>\r\n {processedChildren}\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <DropdownMenuSub\r\n data-slot='drop-drawer-sub'\r\n data-submenu-id={submenuId}\r\n {...props}>\r\n {children}\r\n </DropdownMenuSub>\r\n );\r\n}\r\n\r\ninterface DropDrawerSubTriggerProps\r\n extends Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuSubTrigger>, \"children\" | \"onClick\">, MobileSubmenuDataAttributes {\r\n /**\r\n * Trigger contents.\r\n * @default undefined\r\n */\r\n children?: React.ReactNode;\r\n /**\r\n * Additional CSS classes merged with the trigger styles.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Whether to apply inset spacing to align the trigger with grouped content.\r\n * @default undefined\r\n */\r\n inset?: boolean;\r\n /**\r\n * Mouse click handler invoked before submenu navigation occurs.\r\n * @default undefined\r\n */\r\n onClick?: React.MouseEventHandler<HTMLElement>;\r\n}\r\n\r\n/**\r\n * Renders the trigger that opens a nested submenu.\r\n *\r\n * @remarks\r\n * - Renders a Base UI submenu trigger on desktop and a keyboard-accessible `<div>` on mobile\r\n * - Built on Base UI Menu submenu primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerSubTrigger>Advanced</DropDrawerSubTrigger>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerSubTrigger({className, inset, children, onClick, ...props}: DropDrawerSubTriggerProps): React.JSX.Element {\r\n const {isMobile} = useDropDrawerContext();\r\n const {navigateToSubmenu} = React.useContext(SubmenuContext);\r\n\r\n const isInGroup = React.useCallback((element: HTMLElement | null): boolean => {\r\n if (!element) {\r\n return false;\r\n }\r\n\r\n let parent = element.parentElement;\r\n\r\n while (parent) {\r\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\r\n return true;\r\n }\r\n\r\n parent = parent.parentElement;\r\n }\r\n\r\n return false;\r\n }, []);\r\n\r\n const itemRef = React.useRef<HTMLDivElement>(null);\r\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n if (!isMobile) {\r\n return;\r\n }\r\n\r\n const timer = globalThis.window.setTimeout(() => {\r\n if (itemRef.current) {\r\n setIsInsideGroup(isInGroup(itemRef.current));\r\n }\r\n }, 0);\r\n\r\n return () => globalThis.window.clearTimeout(timer);\r\n }, [isInGroup, isMobile]);\r\n\r\n if (isMobile) {\r\n const navigate = (eventTarget: HTMLElement): void => {\r\n let submenuId: string | null = null;\r\n const closestElement = eventTarget.closest(\"[data-submenu-id]\");\r\n const closestId = closestElement?.getAttribute(\"data-submenu-id\");\r\n\r\n if (closestId) {\r\n submenuId = closestId;\r\n }\r\n\r\n if (!submenuId) {\r\n submenuId = props[\"data-parent-submenu-id\"] ?? props[\"data-parent-submenu\"] ?? null;\r\n }\r\n\r\n if (!submenuId) {\r\n return;\r\n }\r\n\r\n const title = typeof children === \"string\" ? children : MOBILE_SUBMENU_TITLE;\r\n navigateToSubmenu?.(submenuId, title);\r\n };\r\n\r\n const handleClick: React.MouseEventHandler<HTMLDivElement> = (event): void => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n onClick?.(event);\r\n navigate(event.currentTarget);\r\n };\r\n\r\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (event): void => {\r\n if (event.key !== \"Enter\" && event.key !== \" \") {\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n event.stopPropagation();\r\n event.currentTarget.click();\r\n };\r\n\r\n return (\r\n <div\r\n ref={itemRef}\r\n data-slot='drop-drawer-sub-trigger'\r\n data-inset={inset}\r\n role='menuitem'\r\n tabIndex={0}\r\n className={cn(\r\n styles.mobileItem,\r\n !isInsideGroup && styles.mobileStandaloneItem,\r\n isInsideGroup && styles.mobileGroupedItem,\r\n inset && styles.inset,\r\n className,\r\n )}\r\n onClick={handleClick}\r\n onKeyDown={handleKeyDown}\r\n {...props}>\r\n <div className={styles.itemChildren}>{children}</div>\r\n <ChevronRightIcon className={styles.chevron} />\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <DropdownMenuSubTrigger\r\n data-slot='drop-drawer-sub-trigger'\r\n data-inset={inset}\r\n className={className}\r\n inset={inset}\r\n onClick={onClick}\r\n {...props}>\r\n {children}\r\n </DropdownMenuSubTrigger>\r\n );\r\n}\r\n\r\n/**\r\n * Renders the content region for a nested submenu.\r\n *\r\n * @remarks\r\n * - Renders only in desktop dropdown mode\r\n * - Built on Base UI Menu submenu popup primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <DropDrawerSubContent>\r\n * <DropDrawerItem>Details</DropDrawerItem>\r\n * </DropDrawerSubContent>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/menu | Base UI Menu Docs}\r\n */\r\nfunction DropDrawerSubContent({\r\n className,\r\n sideOffset = 4,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuSubContent>): React.JSX.Element | null {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n return null;\r\n }\r\n\r\n return (\r\n <DropdownMenuSubContent\r\n data-slot='drop-drawer-sub-content'\r\n sideOffset={sideOffset}\r\n className={cn(styles.dropdownSubContent, className)}\r\n {...props}>\r\n {children}\r\n </DropdownMenuSubContent>\r\n );\r\n}\r\n\r\nDropDrawer.displayName = \"DropDrawer\";\r\nDropDrawerTrigger.displayName = \"DropDrawerTrigger\";\r\nDropDrawerContent.displayName = \"DropDrawerContent\";\r\nDropDrawerItem.displayName = \"DropDrawerItem\";\r\nDropDrawerSeparator.displayName = \"DropDrawerSeparator\";\r\nDropDrawerLabel.displayName = \"DropDrawerLabel\";\r\nDropDrawerFooter.displayName = \"DropDrawerFooter\";\r\nDropDrawerGroup.displayName = \"DropDrawerGroup\";\r\nDropDrawerSub.displayName = \"DropDrawerSub\";\r\nDropDrawerSubTrigger.displayName = \"DropDrawerSubTrigger\";\r\nDropDrawerSubContent.displayName = \"DropDrawerSubContent\";\r\n\r\nexport {\r\n DropDrawer,\r\n DropDrawerContent,\r\n DropDrawerFooter,\r\n DropDrawerGroup,\r\n DropDrawerItem,\r\n DropDrawerLabel,\r\n DropDrawerSeparator,\r\n DropDrawerSub,\r\n DropDrawerSubContent,\r\n DropDrawerSubTrigger,\r\n DropDrawerTrigger,\r\n};\r\n"],"names":["MOBILE_MENU_TITLE","MOBILE_SUBMENU_TITLE","MOBILE_BACK_LABEL","DropDrawerContext","React","useDropDrawerContext","context","Error","Drawer","BaseDrawer","DrawerPortal","DrawerTrigger","props","forwardedRef","asChild","children","className","render","otherProps","renderProp","useRender","mergeProps","undefined","DrawerOverlay","cn","styles","DrawerContent","DrawerHeader","DrawerFooter","DrawerTitle","DropdownMenu","BaseMenu","DropdownMenuSub","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuItem","inset","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuSubTrigger","ChevronRightIcon","DropdownMenuSubContent","SubmenuContext","DropDrawer","isMobile","useIsMobile","DropDrawerTrigger","DropDrawerContent","activeSubmenu","setActiveSubmenu","submenuTitle","setSubmenuTitle","submenuStack","setSubmenuStack","animationDirection","setAnimationDirection","submenuContentRef","Map","navigateToSubmenu","id","title","previousStack","goBack","newStack","previousSubmenu","registerSubmenuContent","content","extractSubmenuContent","elements","targetId","result","findSubmenuContent","node","element","DropDrawerSub","elementId","dataSubmenuId","child","DropDrawerSubContent","subContentElement","contentChild","getSubmenuContent","cachedContent","submenuContent","variants","direction","transition","ChevronLeftIcon","AnimatePresence","motion","DropDrawerItem","closeOnClick","disabled","icon","onClick","onSelect","isInGroup","parent","itemRef","isInsideGroup","setIsInsideGroup","timer","globalThis","handleSelect","event","handleClick","handleKeyDown","parentSubmenuId","handleDesktopClick","DropDrawerSeparator","DropDrawerLabel","DropDrawerFooter","DropDrawerGroup","childrenWithSeparators","childArray","filteredChildren","index","generatedId","submenuId","contentItems","childElement","processedChildren","DropDrawerSubTrigger","navigate","eventTarget","closestElement","closestId","sideOffset"],"mappings":";;;;;;;;;;;;AAgBA,MAAMA,oBAAoB;AAC1B,MAAMC,uBAAuB;AAC7B,MAAMC,oBAAoB;AAM1B,MAAMC,oBAAoB,WAAHA,GAAGC,wBAAAA,aAAmB,CAAgC;AAE7E,MAAMC,uBAAuB;IAC3B,MAAMC,UAAUF,wBAAAA,UAAgB,CAACD;IAEjC,IAAIG,AAAY,SAAZA,SACF,MAAM,IAAIC,MAAM;IAGlB,OAAOD;AACT;AAEA,MAAME,oBAASC,OAAAA,IAAe;AAC9B,MAAMC,eAAeD,OAAAA,MAAiB;AAEtC,MAAME,2BAAgB,WAAHA,GAAGP,wBAAAA,UAAgB,CACpC,SAAuBQ,KAAK,EAAEC,YAAY;IACxC,MAAM,EAACC,UAAU,KAAK,EAAEC,QAAQ,EA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