@arolariu/components 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/DEBUGGING.md +396 -396
  2. package/LICENSE.md +21 -21
  3. package/changelog.md +109 -118
  4. package/dist/components/ui/accordion.d.ts +2 -2
  5. package/dist/components/ui/accordion.d.ts.map +1 -1
  6. package/dist/components/ui/accordion.js +4 -4
  7. package/dist/components/ui/accordion.js.map +1 -1
  8. package/dist/components/ui/alert-dialog.d.ts +13 -13
  9. package/dist/components/ui/alert-dialog.d.ts.map +1 -1
  10. package/dist/components/ui/alert-dialog.js +4 -4
  11. package/dist/components/ui/alert-dialog.js.map +1 -1
  12. package/dist/components/ui/alert.d.ts +5 -5
  13. package/dist/components/ui/alert.d.ts.map +1 -1
  14. package/dist/components/ui/alert.js +3 -3
  15. package/dist/components/ui/alert.js.map +1 -1
  16. package/dist/components/ui/aspect-ratio.d.ts +1 -1
  17. package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
  18. package/dist/components/ui/aspect-ratio.js +1 -1
  19. package/dist/components/ui/aspect-ratio.js.map +1 -1
  20. package/dist/components/ui/avatar.d.ts +2 -2
  21. package/dist/components/ui/avatar.d.ts.map +1 -1
  22. package/dist/components/ui/avatar.js +3 -3
  23. package/dist/components/ui/avatar.js.map +1 -1
  24. package/dist/components/ui/background-beams.d.ts.map +1 -1
  25. package/dist/components/ui/background-beams.js +6 -6
  26. package/dist/components/ui/background-beams.js.map +1 -1
  27. package/dist/components/ui/badge.d.ts +4 -4
  28. package/dist/components/ui/badge.d.ts.map +1 -1
  29. package/dist/components/ui/badge.js +2 -2
  30. package/dist/components/ui/badge.js.map +1 -1
  31. package/dist/components/ui/breadcrumb.d.ts +6 -6
  32. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  33. package/dist/components/ui/breadcrumb.js +5 -5
  34. package/dist/components/ui/breadcrumb.js.map +1 -1
  35. package/dist/components/ui/bubble-background.d.ts +1 -1
  36. package/dist/components/ui/bubble-background.d.ts.map +1 -1
  37. package/dist/components/ui/bubble-background.js +13 -13
  38. package/dist/components/ui/bubble-background.js.map +1 -1
  39. package/dist/components/ui/button.d.ts +5 -5
  40. package/dist/components/ui/button.d.ts.map +1 -1
  41. package/dist/components/ui/button.js +2 -2
  42. package/dist/components/ui/button.js.map +1 -1
  43. package/dist/components/ui/calendar.d.ts.map +1 -1
  44. package/dist/components/ui/calendar.js +4 -4
  45. package/dist/components/ui/calendar.js.map +1 -1
  46. package/dist/components/ui/card.d.ts +1 -1
  47. package/dist/components/ui/card.d.ts.map +1 -1
  48. package/dist/components/ui/card.js +3 -3
  49. package/dist/components/ui/card.js.map +1 -1
  50. package/dist/components/ui/carousel.d.ts +2 -2
  51. package/dist/components/ui/carousel.d.ts.map +1 -1
  52. package/dist/components/ui/carousel.js +3 -3
  53. package/dist/components/ui/carousel.js.map +1 -1
  54. package/dist/components/ui/chart.d.ts +4 -4
  55. package/dist/components/ui/chart.d.ts.map +1 -1
  56. package/dist/components/ui/chart.js +1 -1
  57. package/dist/components/ui/chart.js.map +1 -1
  58. package/dist/components/ui/checkbox.d.ts +1 -1
  59. package/dist/components/ui/checkbox.d.ts.map +1 -1
  60. package/dist/components/ui/checkbox.js +3 -3
  61. package/dist/components/ui/checkbox.js.map +1 -1
  62. package/dist/components/ui/collapsible.d.ts +2 -2
  63. package/dist/components/ui/collapsible.d.ts.map +1 -1
  64. package/dist/components/ui/collapsible.js +1 -1
  65. package/dist/components/ui/collapsible.js.map +1 -1
  66. package/dist/components/ui/command.d.ts +2 -2
  67. package/dist/components/ui/command.d.ts.map +1 -1
  68. package/dist/components/ui/command.js +9 -9
  69. package/dist/components/ui/command.js.map +1 -1
  70. package/dist/components/ui/context-menu.d.ts +2 -2
  71. package/dist/components/ui/context-menu.d.ts.map +1 -1
  72. package/dist/components/ui/context-menu.js +11 -11
  73. package/dist/components/ui/context-menu.js.map +1 -1
  74. package/dist/components/ui/counting-number.d.ts +1 -1
  75. package/dist/components/ui/counting-number.d.ts.map +1 -1
  76. package/dist/components/ui/counting-number.js +4 -3
  77. package/dist/components/ui/counting-number.js.map +1 -1
  78. package/dist/components/ui/dialog.d.ts +1 -1
  79. package/dist/components/ui/dialog.d.ts.map +1 -1
  80. package/dist/components/ui/dialog.js +6 -6
  81. package/dist/components/ui/dialog.js.map +1 -1
  82. package/dist/components/ui/dot-background.d.ts +10 -17
  83. package/dist/components/ui/dot-background.d.ts.map +1 -1
  84. package/dist/components/ui/dot-background.js +2 -2
  85. package/dist/components/ui/dot-background.js.map +1 -1
  86. package/dist/components/ui/drawer.d.ts +1 -1
  87. package/dist/components/ui/drawer.d.ts.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/dropdown-menu.d.ts +2 -2
  91. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  92. package/dist/components/ui/dropdown-menu.js +10 -10
  93. package/dist/components/ui/dropdown-menu.js.map +1 -1
  94. package/dist/components/ui/dropdrawer.d.ts +2 -2
  95. package/dist/components/ui/dropdrawer.d.ts.map +1 -1
  96. package/dist/components/ui/dropdrawer.js +13 -13
  97. package/dist/components/ui/dropdrawer.js.map +1 -1
  98. package/dist/components/ui/fireworks-background.d.ts.map +1 -1
  99. package/dist/components/ui/fireworks-background.js +1 -1
  100. package/dist/components/ui/fireworks-background.js.map +1 -1
  101. package/dist/components/ui/flip-button.d.ts +1 -1
  102. package/dist/components/ui/flip-button.d.ts.map +1 -1
  103. package/dist/components/ui/flip-button.js +3 -3
  104. package/dist/components/ui/flip-button.js.map +1 -1
  105. package/dist/components/ui/form.d.ts +3 -3
  106. package/dist/components/ui/form.d.ts.map +1 -1
  107. package/dist/components/ui/form.js +4 -4
  108. package/dist/components/ui/form.js.map +1 -1
  109. package/dist/components/ui/gradient-background.d.ts +1 -1
  110. package/dist/components/ui/gradient-background.d.ts.map +1 -1
  111. package/dist/components/ui/gradient-background.js +2 -2
  112. package/dist/components/ui/gradient-background.js.map +1 -1
  113. package/dist/components/ui/gradient-text.d.ts +1 -1
  114. package/dist/components/ui/gradient-text.d.ts.map +1 -1
  115. package/dist/components/ui/gradient-text.js +5 -5
  116. package/dist/components/ui/gradient-text.js.map +1 -1
  117. package/dist/components/ui/highlight-text.d.ts +1 -1
  118. package/dist/components/ui/highlight-text.d.ts.map +1 -1
  119. package/dist/components/ui/highlight-text.js +3 -3
  120. package/dist/components/ui/highlight-text.js.map +1 -1
  121. package/dist/components/ui/hole-background.d.ts.map +1 -1
  122. package/dist/components/ui/hole-background.js +11 -10
  123. package/dist/components/ui/hole-background.js.map +1 -1
  124. package/dist/components/ui/hover-card.d.ts +2 -2
  125. package/dist/components/ui/hover-card.d.ts.map +1 -1
  126. package/dist/components/ui/hover-card.js +3 -3
  127. package/dist/components/ui/hover-card.js.map +1 -1
  128. package/dist/components/ui/input-otp.d.ts +2 -2
  129. package/dist/components/ui/input-otp.d.ts.map +1 -1
  130. package/dist/components/ui/input-otp.js +5 -5
  131. package/dist/components/ui/input-otp.js.map +1 -1
  132. package/dist/components/ui/input.d.ts.map +1 -1
  133. package/dist/components/ui/input.js +2 -2
  134. package/dist/components/ui/input.js.map +1 -1
  135. package/dist/components/ui/label.d.ts +1 -1
  136. package/dist/components/ui/label.d.ts.map +1 -1
  137. package/dist/components/ui/label.js +2 -2
  138. package/dist/components/ui/label.js.map +1 -1
  139. package/dist/components/ui/menubar.d.ts +2 -2
  140. package/dist/components/ui/menubar.d.ts.map +1 -1
  141. package/dist/components/ui/menubar.js +12 -12
  142. package/dist/components/ui/menubar.js.map +1 -1
  143. package/dist/components/ui/navigation-menu.d.ts +3 -3
  144. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  145. package/dist/components/ui/navigation-menu.js +6 -7
  146. package/dist/components/ui/navigation-menu.js.map +1 -1
  147. package/dist/components/ui/pagination.d.ts +2 -2
  148. package/dist/components/ui/pagination.d.ts.map +1 -1
  149. package/dist/components/ui/pagination.js +8 -4
  150. package/dist/components/ui/pagination.js.map +1 -1
  151. package/dist/components/ui/popover.d.ts +2 -2
  152. package/dist/components/ui/popover.d.ts.map +1 -1
  153. package/dist/components/ui/popover.js +3 -3
  154. package/dist/components/ui/popover.js.map +1 -1
  155. package/dist/components/ui/progress.d.ts +1 -1
  156. package/dist/components/ui/progress.d.ts.map +1 -1
  157. package/dist/components/ui/progress.js +4 -4
  158. package/dist/components/ui/progress.js.map +1 -1
  159. package/dist/components/ui/radio-group.d.ts +1 -1
  160. package/dist/components/ui/radio-group.d.ts.map +1 -1
  161. package/dist/components/ui/radio-group.js +3 -3
  162. package/dist/components/ui/radio-group.js.map +1 -1
  163. package/dist/components/ui/resizable.d.ts +1 -1
  164. package/dist/components/ui/resizable.d.ts.map +1 -1
  165. package/dist/components/ui/resizable.js +5 -5
  166. package/dist/components/ui/resizable.js.map +1 -1
  167. package/dist/components/ui/ripple-button.d.ts +1 -1
  168. package/dist/components/ui/ripple-button.d.ts.map +1 -1
  169. package/dist/components/ui/ripple-button.js +4 -4
  170. package/dist/components/ui/ripple-button.js.map +1 -1
  171. package/dist/components/ui/scratcher.d.ts.map +1 -1
  172. package/dist/components/ui/scratcher.js +7 -5
  173. package/dist/components/ui/scratcher.js.map +1 -1
  174. package/dist/components/ui/scroll-area.d.ts +1 -1
  175. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  176. package/dist/components/ui/scroll-area.js +4 -4
  177. package/dist/components/ui/scroll-area.js.map +1 -1
  178. package/dist/components/ui/select.d.ts +1 -1
  179. package/dist/components/ui/select.d.ts.map +1 -1
  180. package/dist/components/ui/select.js +7 -7
  181. package/dist/components/ui/select.js.map +1 -1
  182. package/dist/components/ui/separator.d.ts +1 -1
  183. package/dist/components/ui/separator.d.ts.map +1 -1
  184. package/dist/components/ui/separator.js +3 -3
  185. package/dist/components/ui/separator.js.map +1 -1
  186. package/dist/components/ui/sheet.d.ts +2 -2
  187. package/dist/components/ui/sheet.d.ts.map +1 -1
  188. package/dist/components/ui/sheet.js +6 -6
  189. package/dist/components/ui/sheet.js.map +1 -1
  190. package/dist/components/ui/sidebar.d.ts +5 -5
  191. package/dist/components/ui/sidebar.d.ts.map +1 -1
  192. package/dist/components/ui/sidebar.js +5 -5
  193. package/dist/components/ui/sidebar.js.map +1 -1
  194. package/dist/components/ui/skeleton.d.ts.map +1 -1
  195. package/dist/components/ui/skeleton.js +2 -2
  196. package/dist/components/ui/skeleton.js.map +1 -1
  197. package/dist/components/ui/slider.d.ts +1 -1
  198. package/dist/components/ui/slider.d.ts.map +1 -1
  199. package/dist/components/ui/slider.js +5 -5
  200. package/dist/components/ui/slider.js.map +1 -1
  201. package/dist/components/ui/sonner.d.ts +1 -1
  202. package/dist/components/ui/sonner.d.ts.map +1 -1
  203. package/dist/components/ui/sonner.js +1 -1
  204. package/dist/components/ui/sonner.js.map +1 -1
  205. package/dist/components/ui/switch.d.ts +1 -1
  206. package/dist/components/ui/switch.d.ts.map +1 -1
  207. package/dist/components/ui/switch.js +4 -4
  208. package/dist/components/ui/switch.js.map +1 -1
  209. package/dist/components/ui/table.d.ts +1 -1
  210. package/dist/components/ui/table.d.ts.map +1 -1
  211. package/dist/components/ui/table.js +5 -5
  212. package/dist/components/ui/table.js.map +1 -1
  213. package/dist/components/ui/tabs.d.ts +2 -2
  214. package/dist/components/ui/tabs.d.ts.map +1 -1
  215. package/dist/components/ui/tabs.js +4 -4
  216. package/dist/components/ui/tabs.js.map +1 -1
  217. package/dist/components/ui/textarea.d.ts +1 -1
  218. package/dist/components/ui/textarea.d.ts.map +1 -1
  219. package/dist/components/ui/textarea.js +2 -2
  220. package/dist/components/ui/textarea.js.map +1 -1
  221. package/dist/components/ui/toggle-group.d.ts +3 -3
  222. package/dist/components/ui/toggle-group.d.ts.map +1 -1
  223. package/dist/components/ui/toggle-group.js +2 -2
  224. package/dist/components/ui/toggle-group.js.map +1 -1
  225. package/dist/components/ui/toggle.d.ts +6 -6
  226. package/dist/components/ui/toggle.d.ts.map +1 -1
  227. package/dist/components/ui/toggle.js +2 -2
  228. package/dist/components/ui/toggle.js.map +1 -1
  229. package/dist/components/ui/tooltip.d.ts +6 -6
  230. package/dist/components/ui/tooltip.d.ts.map +1 -1
  231. package/dist/components/ui/tooltip.js +4 -4
  232. package/dist/components/ui/tooltip.js.map +1 -1
  233. package/dist/components/ui/typewriter.d.ts.map +1 -1
  234. package/dist/components/ui/typewriter.js +15 -11
  235. package/dist/components/ui/typewriter.js.map +1 -1
  236. package/dist/hooks/{use-mobile.d.ts → useIsMobile.d.ts} +3 -6
  237. package/dist/hooks/useIsMobile.d.ts.map +1 -0
  238. package/dist/hooks/useIsMobile.js +19 -0
  239. package/dist/hooks/useIsMobile.js.map +1 -0
  240. package/dist/hooks/useWindowSize.d.ts +29 -0
  241. package/dist/hooks/useWindowSize.d.ts.map +1 -0
  242. package/dist/hooks/useWindowSize.js +28 -0
  243. package/dist/hooks/useWindowSize.js.map +1 -0
  244. package/dist/index.css +2 -2
  245. package/dist/index.css.map +1 -1
  246. package/dist/index.d.ts +39 -38
  247. package/dist/index.d.ts.map +1 -1
  248. package/dist/index.js +5 -4
  249. package/dist/lib/utilities.d.ts +9 -0
  250. package/dist/lib/utilities.d.ts.map +1 -0
  251. package/dist/lib/{utils.js → utilities.js} +1 -1
  252. package/dist/lib/utilities.js.map +1 -0
  253. package/package.json +95 -94
  254. package/{README.md → readme.md} +627 -627
  255. package/src/components/ui/accordion.tsx +56 -66
  256. package/src/components/ui/alert-dialog.tsx +135 -160
  257. package/src/components/ui/alert.tsx +58 -69
  258. package/src/components/ui/aspect-ratio.tsx +15 -12
  259. package/src/components/ui/avatar.tsx +38 -53
  260. package/src/components/ui/background-beams.tsx +145 -142
  261. package/src/components/ui/badge.tsx +47 -48
  262. package/src/components/ui/breadcrumb.tsx +97 -117
  263. package/src/components/ui/bubble-background.tsx +170 -189
  264. package/src/components/ui/button.tsx +61 -61
  265. package/src/components/ui/calendar.tsx +177 -216
  266. package/src/components/ui/card.tsx +83 -97
  267. package/src/components/ui/carousel.tsx +204 -241
  268. package/src/components/ui/chart.tsx +303 -385
  269. package/src/components/ui/checkbox.tsx +27 -32
  270. package/src/components/ui/collapsible.tsx +33 -34
  271. package/src/components/ui/command.tsx +137 -184
  272. package/src/components/ui/context-menu.tsx +229 -255
  273. package/src/components/ui/counting-number.tsx +92 -108
  274. package/src/components/ui/dialog.tsx +141 -146
  275. package/src/components/ui/dot-background.tsx +153 -158
  276. package/src/components/ui/drawer.tsx +133 -141
  277. package/src/components/ui/dropdown-menu.tsx +235 -260
  278. package/src/components/ui/dropdrawer.tsx +870 -973
  279. package/src/components/ui/fireworks-background.tsx +325 -378
  280. package/src/components/ui/flip-button.tsx +89 -110
  281. package/src/components/ui/form.tsx +145 -174
  282. package/src/components/ui/gradient-background.tsx +30 -43
  283. package/src/components/ui/gradient-text.tsx +62 -65
  284. package/src/components/ui/highlight-text.tsx +54 -71
  285. package/src/components/ui/hole-background.tsx +326 -361
  286. package/src/components/ui/hover-card.tsx +48 -44
  287. package/src/components/ui/input-otp.tsx +76 -77
  288. package/src/components/ui/input.tsx +22 -22
  289. package/src/components/ui/label.tsx +21 -24
  290. package/src/components/ui/menubar.tsx +256 -279
  291. package/src/components/ui/navigation-menu.tsx +135 -171
  292. package/src/components/ui/pagination.tsx +103 -129
  293. package/src/components/ui/popover.tsx +52 -48
  294. package/src/components/ui/progress.tsx +23 -31
  295. package/src/components/ui/radio-group.tsx +37 -45
  296. package/src/components/ui/resizable.tsx +52 -56
  297. package/src/components/ui/ripple-button.tsx +90 -111
  298. package/src/components/ui/scratcher.tsx +167 -171
  299. package/src/components/ui/scroll-area.tsx +45 -58
  300. package/src/components/ui/select.tsx +160 -191
  301. package/src/components/ui/separator.tsx +28 -28
  302. package/src/components/ui/sheet.tsx +133 -145
  303. package/src/components/ui/sidebar.tsx +673 -729
  304. package/src/components/ui/skeleton.tsx +16 -19
  305. package/src/components/ui/slider.tsx +49 -63
  306. package/src/components/ui/sonner.tsx +30 -26
  307. package/src/components/ui/switch.tsx +27 -31
  308. package/src/components/ui/table.tsx +98 -119
  309. package/src/components/ui/tabs.tsx +54 -66
  310. package/src/components/ui/textarea.tsx +20 -20
  311. package/src/components/ui/toggle-group.tsx +66 -73
  312. package/src/components/ui/toggle.tsx +46 -47
  313. package/src/components/ui/tooltip.tsx +56 -61
  314. package/src/components/ui/typewriter.tsx +174 -188
  315. package/src/hooks/{use-mobile.tsx → useIsMobile.tsx} +42 -44
  316. package/src/hooks/useWindowSize.tsx +66 -0
  317. package/src/index.css +73 -73
  318. package/src/index.ts +303 -407
  319. package/src/lib/utilities.ts +12 -0
  320. package/dist/hooks/use-mobile.d.ts.map +0 -1
  321. package/dist/hooks/use-mobile.js +0 -18
  322. package/dist/hooks/use-mobile.js.map +0 -1
  323. package/dist/lib/utils.d.ts +0 -7
  324. package/dist/lib/utils.d.ts.map +0 -1
  325. package/dist/lib/utils.js.map +0 -1
  326. package/src/lib/utils.ts +0 -10
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\dropdrawer.js","sources":["webpack://@arolariu/components/./src/components/ui/dropdrawer.tsx"],"sourcesContent":["\n\nimport { AnimatePresence, motion, Transition } from \"motion/react\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n DrawerTrigger,\n} from \"@/components/ui/drawer\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { useIsMobile } from \"@/hooks/use-mobile\";\nimport { cn } from \"@/lib/utils\";\n\nconst DropDrawerContext = React.createContext<{ isMobile: boolean }>({\n isMobile: false,\n});\n\nconst useDropDrawerContext = () => {\n const context = React.useContext(DropDrawerContext);\n if (!context) {\n throw new Error(\n \"DropDrawer components cannot be rendered outside the Context\",\n );\n }\n return context;\n};\n\nfunction DropDrawer({\n children,\n ...props\n}:\n | React.ComponentProps<typeof Drawer>\n | React.ComponentProps<typeof DropdownMenu>) {\n const isMobile = useIsMobile();\n const DropdownComponent = isMobile ? Drawer : DropdownMenu;\n\n return (\n <DropDrawerContext.Provider value={{ isMobile }}>\n <DropdownComponent\n data-slot=\"drop-drawer\"\n {...(isMobile && { autoFocus: true })}\n {...props}\n >\n {children}\n </DropdownComponent>\n </DropDrawerContext.Provider>\n );\n}\n\nfunction DropDrawerTrigger({\n className,\n children,\n ...props\n}:\n | React.ComponentProps<typeof DrawerTrigger>\n | React.ComponentProps<typeof DropdownMenuTrigger>) {\n const { isMobile } = useDropDrawerContext();\n const TriggerComponent = isMobile ? DrawerTrigger : DropdownMenuTrigger;\n\n return (\n <TriggerComponent\n data-slot=\"drop-drawer-trigger\"\n className={className}\n {...props}\n >\n {children}\n </TriggerComponent>\n );\n}\n\nfunction DropDrawerContent({\n className,\n children,\n ...props\n}:\n | React.ComponentProps<typeof DrawerContent>\n | React.ComponentProps<typeof DropdownMenuContent>) {\n const { isMobile } = useDropDrawerContext();\n const [activeSubmenu, setActiveSubmenu] = React.useState<string | null>(null);\n const [submenuTitle, setSubmenuTitle] = React.useState<string | null>(null);\n const [submenuStack, setSubmenuStack] = React.useState<\n { id: string; title: string }[]\n >([]);\n // Add animation direction state\n const [animationDirection, setAnimationDirection] = React.useState<\n \"forward\" | \"backward\"\n >(\"forward\");\n\n // Create a ref to store submenu content by ID\n const submenuContentRef = React.useRef<Map<string, React.ReactNode[]>>(\n new Map(),\n );\n\n // Function to navigate to a submenu\n const navigateToSubmenu = React.useCallback((id: string, title: string) => {\n // Set animation direction to forward when navigating to a submenu\n setAnimationDirection(\"forward\");\n setActiveSubmenu(id);\n setSubmenuTitle(title);\n setSubmenuStack((prev) => [...prev, { id, title }]);\n }, []);\n\n // Function to go back to previous menu\n const goBack = React.useCallback(() => {\n // Set animation direction to backward when going back\n setAnimationDirection(\"backward\");\n\n if (submenuStack.length <= 1) {\n // If we're at the first level, go back to main menu\n setActiveSubmenu(null);\n setSubmenuTitle(null);\n setSubmenuStack([]);\n } else {\n // Go back to previous submenu\n const newStack = [...submenuStack];\n newStack.pop(); // Remove current\n const previous = newStack[newStack.length - 1];\n setActiveSubmenu(previous.id);\n setSubmenuTitle(previous.title);\n setSubmenuStack(newStack);\n }\n }, [submenuStack]);\n\n // Function to register submenu content\n const registerSubmenuContent = React.useCallback(\n (id: string, content: React.ReactNode[]) => {\n submenuContentRef.current.set(id, content);\n },\n [],\n );\n\n // Function to extract submenu content\n const extractSubmenuContent = React.useCallback(\n (elements: React.ReactNode, targetId: string): React.ReactNode[] => {\n const result: React.ReactNode[] = [];\n\n // Recursive function to search through all children\n const findSubmenuContent = (node: React.ReactNode) => {\n // Skip if not a valid element\n if (!React.isValidElement(node)) return;\n\n const element = node as React.ReactElement;\n // Use a more specific type to avoid 'any'\n const props = element.props as {\n id?: string;\n \"data-submenu-id\"?: string;\n children?: React.ReactNode;\n };\n\n // Check if this is a DropDrawerSub\n if (element.type === DropDrawerSub) {\n // Get all possible ID values\n const elementId = props.id;\n const dataSubmenuId = props[\"data-submenu-id\"];\n\n // If this is the submenu we're looking for\n if (elementId === targetId || dataSubmenuId === targetId) {\n // Find the SubContent within this Sub\n if (props.children) {\n React.Children.forEach(props.children, (child) => {\n if (\n React.isValidElement(child) &&\n child.type === DropDrawerSubContent\n ) {\n // Add all children of the SubContent to the result\n const subContentProps = child.props as {\n children?: React.ReactNode;\n };\n if (subContentProps.children) {\n React.Children.forEach(\n subContentProps.children,\n (contentChild) => {\n result.push(contentChild);\n },\n );\n }\n }\n });\n }\n return; // Found what we needed, no need to search deeper\n }\n }\n\n // If this element has children, search through them\n if (props.children) {\n if (Array.isArray(props.children)) {\n props.children.forEach((child: React.ReactNode) =>\n findSubmenuContent(child),\n );\n } else {\n findSubmenuContent(props.children);\n }\n }\n };\n\n // Start the search from the root elements\n if (Array.isArray(elements)) {\n elements.forEach((child) => findSubmenuContent(child));\n } else {\n findSubmenuContent(elements);\n }\n\n return result;\n },\n [],\n );\n\n // Get submenu content (either from cache or extract it)\n const getSubmenuContent = React.useCallback(\n (id: string) => {\n // Check if we have the content in our ref\n const cachedContent = submenuContentRef.current.get(id || \"\");\n if (cachedContent && cachedContent.length > 0) {\n return cachedContent;\n }\n\n // If not in cache, extract it\n const submenuContent = extractSubmenuContent(children, id);\n\n if (submenuContent.length === 0) {\n return [];\n }\n\n // Store in cache for future use\n if (id) {\n submenuContentRef.current.set(id, submenuContent);\n }\n\n return submenuContent;\n },\n [children, extractSubmenuContent],\n );\n\n // Animation variants for Framer Motion\n const variants = {\n enter: (direction: \"forward\" | \"backward\") => ({\n x: direction === \"forward\" ? \"100%\" : \"-100%\",\n opacity: 0,\n }),\n center: {\n x: 0,\n opacity: 1,\n },\n exit: (direction: \"forward\" | \"backward\") => ({\n x: direction === \"forward\" ? \"-100%\" : \"100%\",\n opacity: 0,\n }),\n };\n\n // Animation transition\n const transition = {\n duration: 0.3,\n ease: [0.25, 0.1, 0.25, 1.0], // cubic-bezier easing\n } satisfies Transition;\n\n if (isMobile) {\n return (\n <SubmenuContext.Provider\n value={{\n activeSubmenu,\n setActiveSubmenu: (id) => {\n if (id === null) {\n setActiveSubmenu(null);\n setSubmenuTitle(null);\n setSubmenuStack([]);\n }\n },\n submenuTitle,\n setSubmenuTitle,\n navigateToSubmenu,\n registerSubmenuContent,\n }}\n >\n <DrawerContent\n data-slot=\"drop-drawer-content\"\n className={cn(\"max-h-[90vh]\", className)}\n {...props}\n >\n {activeSubmenu ? (\n <>\n <DrawerHeader>\n <div className=\"flex items-center gap-2\">\n <button\n onClick={goBack}\n className=\"hover:bg-neutral-100/50 rounded-full p-1 dark:hover:bg-neutral-800/50\"\n >\n <ChevronLeftIcon className=\"h-5 w-5\" />\n </button>\n <DrawerTitle>{submenuTitle || \"Submenu\"}</DrawerTitle>\n </div>\n </DrawerHeader>\n <div className=\"flex-1 relative overflow-y-auto max-h-[70vh]\">\n {/* Use AnimatePresence to handle exit animations */}\n <AnimatePresence\n initial={false}\n mode=\"wait\"\n custom={animationDirection}\n >\n <motion.div\n key={activeSubmenu || \"main\"}\n custom={animationDirection}\n variants={variants}\n initial=\"enter\"\n animate=\"center\"\n exit=\"exit\"\n transition={transition}\n className=\"pb-6 space-y-1.5 w-full h-full\"\n >\n {activeSubmenu\n ? getSubmenuContent(activeSubmenu)\n : children}\n </motion.div>\n </AnimatePresence>\n </div>\n </>\n ) : (\n <>\n <DrawerHeader className=\"sr-only\">\n <DrawerTitle>Menu</DrawerTitle>\n </DrawerHeader>\n <div className=\"overflow-y-auto max-h-[70vh]\">\n <AnimatePresence\n initial={false}\n mode=\"wait\"\n custom={animationDirection}\n >\n <motion.div\n key=\"main-menu\"\n custom={animationDirection}\n variants={variants}\n initial=\"enter\"\n animate=\"center\"\n exit=\"exit\"\n transition={transition}\n className=\"pb-6 space-y-1.5 w-full\"\n >\n {children}\n </motion.div>\n </AnimatePresence>\n </div>\n </>\n )}\n </DrawerContent>\n </SubmenuContext.Provider>\n );\n }\n\n return (\n <SubmenuContext.Provider\n value={{\n activeSubmenu,\n setActiveSubmenu,\n submenuTitle,\n setSubmenuTitle,\n registerSubmenuContent,\n }}\n >\n <DropdownMenuContent\n data-slot=\"drop-drawer-content\"\n align=\"end\"\n sideOffset={4}\n className={cn(\n \"max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[220px] overflow-y-auto\",\n className,\n )}\n {...props}\n >\n {children}\n </DropdownMenuContent>\n </SubmenuContext.Provider>\n );\n}\n\nfunction DropDrawerItem({\n className,\n children,\n onSelect,\n onClick,\n icon,\n variant = \"default\",\n inset,\n disabled,\n ...props\n}: React.ComponentProps<typeof DropdownMenuItem> & {\n icon?: React.ReactNode;\n}) {\n const { isMobile } = useDropDrawerContext();\n\n // Define hooks outside of conditionals to follow React rules\n // Check if this item is inside a group by looking at parent elements\n const isInGroup = React.useCallback(\n (element: HTMLElement | null): boolean => {\n if (!element) return false;\n\n // Check if any parent has a data-drop-drawer-group attribute\n let parent = element.parentElement;\n while (parent) {\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\n return true;\n }\n parent = parent.parentElement;\n }\n return false;\n },\n [],\n );\n\n // Create a ref to check if the item is in a group\n const itemRef = React.useRef<HTMLDivElement>(null);\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\n\n React.useEffect(() => {\n // Only run this effect in mobile mode\n if (!isMobile) return;\n\n // Use a short timeout to ensure the DOM is fully rendered\n const timer = setTimeout(() => {\n if (itemRef.current) {\n setIsInsideGroup(isInGroup(itemRef.current));\n }\n }, 0);\n\n return () => clearTimeout(timer);\n }, [isInGroup, isMobile]);\n\n if (isMobile) {\n const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {\n if (disabled) return;\n if (onClick) onClick(e);\n if (onSelect) onSelect(e as unknown as Event);\n };\n\n // Only wrap in DrawerClose if it's not a submenu item\n const content = (\n <div\n ref={itemRef}\n data-slot=\"drop-drawer-item\"\n data-variant={variant}\n data-inset={inset}\n data-disabled={disabled}\n className={cn(\n \"flex cursor-pointer items-center justify-between px-4 py-4\",\n // Only apply margin, background and rounded corners if not in a group\n !isInsideGroup &&\n \"bg-neutral-100 dark:bg-neutral-100 mx-2 my-1.5 rounded-md dark:bg-neutral-800 dark:dark:bg-neutral-800\",\n // For items in a group, don't add background but add more padding\n isInsideGroup && \"bg-transparent py-4\",\n inset && \"pl-8\",\n variant === \"destructive\" &&\n \"text-red-500 dark:text-red-500 dark:text-red-900 dark:dark:text-red-900\",\n disabled && \"pointer-events-none opacity-50\",\n className,\n )}\n onClick={handleClick}\n aria-disabled={disabled}\n {...props}\n >\n <div className=\"flex items-center gap-2\">{children}</div>\n {icon && <div className=\"flex-shrink-0\">{icon}</div>}\n </div>\n );\n\n // Check if this is inside a submenu\n const isInSubmenu =\n (props as Record<string, unknown>)[\"data-parent-submenu-id\"] ||\n (props as Record<string, unknown>)[\"data-parent-submenu\"];\n\n if (isInSubmenu) {\n return content;\n }\n\n return <DrawerClose asChild>{content}</DrawerClose>;\n }\n\n return (\n <DropdownMenuItem\n data-slot=\"drop-drawer-item\"\n data-variant={variant}\n data-inset={inset}\n className={className}\n onSelect={onSelect}\n onClick={onClick as React.MouseEventHandler<HTMLDivElement>}\n variant={variant}\n inset={inset}\n disabled={disabled}\n {...props}\n >\n <div className=\"flex w-full items-center justify-between\">\n <div>{children}</div>\n {icon && <div>{icon}</div>}\n </div>\n </DropdownMenuItem>\n );\n}\n\nfunction DropDrawerSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuSeparator>) {\n const { isMobile } = useDropDrawerContext();\n\n // For mobile, render a simple divider\n if (isMobile) {\n return null;\n }\n\n // For desktop, use the standard dropdown separator\n return (\n <DropdownMenuSeparator\n data-slot=\"drop-drawer-separator\"\n className={className}\n {...props}\n />\n );\n}\n\nfunction DropDrawerLabel({\n className,\n children,\n ...props\n}:\n | React.ComponentProps<typeof DropdownMenuLabel>\n | React.ComponentProps<typeof DrawerTitle>) {\n const { isMobile } = useDropDrawerContext();\n\n if (isMobile) {\n return (\n <DrawerHeader className=\"p-0\">\n <DrawerTitle\n data-slot=\"drop-drawer-label\"\n className={cn(\n \"text-neutral-500 px-4 py-2 text-sm font-medium dark:text-neutral-400\",\n className,\n )}\n {...props}\n >\n {children}\n </DrawerTitle>\n </DrawerHeader>\n );\n }\n\n return (\n <DropdownMenuLabel\n data-slot=\"drop-drawer-label\"\n className={className}\n {...props}\n >\n {children}\n </DropdownMenuLabel>\n );\n}\n\nfunction DropDrawerFooter({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerFooter> | React.ComponentProps<\"div\">) {\n const { isMobile } = useDropDrawerContext();\n\n if (isMobile) {\n return (\n <DrawerFooter\n data-slot=\"drop-drawer-footer\"\n className={cn(\"p-4\", className)}\n {...props}\n >\n {children}\n </DrawerFooter>\n );\n }\n\n // No direct equivalent in DropdownMenu, so we'll just render a div\n return (\n <div\n data-slot=\"drop-drawer-footer\"\n className={cn(\"p-2\", className)}\n {...props}\n >\n {children}\n </div>\n );\n}\n\nfunction DropDrawerGroup({\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n children: React.ReactNode;\n}) {\n const { isMobile } = useDropDrawerContext();\n\n // Add separators between children on mobile\n const childrenWithSeparators = React.useMemo(() => {\n if (!isMobile) return children;\n\n const childArray = React.Children.toArray(children);\n\n // Filter out any existing separators\n const filteredChildren = childArray.filter(\n (child) =>\n React.isValidElement(child) && child.type !== DropDrawerSeparator,\n );\n\n // Add separators between items\n return filteredChildren.flatMap((child, index) => {\n if (index === filteredChildren.length - 1) return [child];\n return [\n child,\n <div\n key={`separator-${index}`}\n className=\"bg-neutral-200 h-px dark:bg-neutral-800\"\n aria-hidden=\"true\"\n />,\n ];\n });\n }, [children, isMobile]);\n\n if (isMobile) {\n return (\n <div\n data-drop-drawer-group\n data-slot=\"drop-drawer-group\"\n role=\"group\"\n className={cn(\n \"bg-neutral-100 dark:bg-neutral-100 mx-2 my-3 overflow-hidden rounded-xl dark:bg-neutral-800 dark:dark:bg-neutral-800\",\n className,\n )}\n {...props}\n >\n {childrenWithSeparators}\n </div>\n );\n }\n\n // On desktop, use a div with proper role and attributes\n return (\n <div\n data-drop-drawer-group\n data-slot=\"drop-drawer-group\"\n role=\"group\"\n className={className}\n {...props}\n >\n {children}\n </div>\n );\n}\n\n// Context for managing submenu state on mobile\ninterface SubmenuContextType {\n activeSubmenu: string | null;\n setActiveSubmenu: (id: string | null) => void;\n submenuTitle: string | null;\n setSubmenuTitle: (title: string | null) => void;\n navigateToSubmenu?: (id: string, title: string) => void;\n registerSubmenuContent?: (id: string, content: React.ReactNode[]) => void;\n}\n\nconst SubmenuContext = React.createContext<SubmenuContextType>({\n activeSubmenu: null,\n setActiveSubmenu: () => {},\n submenuTitle: null,\n setSubmenuTitle: () => {},\n navigateToSubmenu: undefined,\n registerSubmenuContent: undefined,\n});\n\n// Submenu components\n// Counter for generating simple numeric IDs\nlet submenuIdCounter = 0;\n\nfunction DropDrawerSub({\n children,\n id,\n ...props\n}: React.ComponentProps<typeof DropdownMenuSub> & {\n id?: string;\n}) {\n const { isMobile } = useDropDrawerContext();\n const { registerSubmenuContent } = React.useContext(SubmenuContext);\n\n // Generate a simple numeric ID instead of using React.useId()\n const [generatedId] = React.useState(() => `submenu-${submenuIdCounter++}`);\n const submenuId = id || generatedId;\n\n // Extract submenu content to register with parent\n React.useEffect(() => {\n if (!registerSubmenuContent) return;\n\n // Find the SubContent within this Sub\n const contentItems: React.ReactNode[] = [];\n React.Children.forEach(children, (child) => {\n if (React.isValidElement(child) && child.type === DropDrawerSubContent) {\n // Add all children of the SubContent to the result\n React.Children.forEach(\n (child.props as { children?: React.ReactNode }).children,\n (contentChild) => {\n contentItems.push(contentChild);\n },\n );\n }\n });\n\n // Register the content with the parent\n if (contentItems.length > 0) {\n registerSubmenuContent(submenuId, contentItems);\n }\n }, [children, registerSubmenuContent, submenuId]);\n\n if (isMobile) {\n // For mobile, we'll use the context to manage submenu state\n // Process children to pass the submenu ID to the trigger and content\n const processedChildren = React.Children.map(children, (child) => {\n if (!React.isValidElement(child)) return child;\n\n if (child.type === DropDrawerSubTrigger) {\n return React.cloneElement(\n child as React.ReactElement,\n {\n ...(child.props as object),\n \"data-parent-submenu-id\": submenuId,\n \"data-submenu-id\": submenuId,\n // Use only data attributes, not custom props\n \"data-parent-submenu\": submenuId,\n } as React.HTMLAttributes<HTMLElement>,\n );\n }\n\n if (child.type === DropDrawerSubContent) {\n return React.cloneElement(\n child as React.ReactElement,\n {\n ...(child.props as object),\n \"data-parent-submenu-id\": submenuId,\n \"data-submenu-id\": submenuId,\n // Use only data attributes, not custom props\n \"data-parent-submenu\": submenuId,\n } as React.HTMLAttributes<HTMLElement>,\n );\n }\n\n return child;\n });\n\n return (\n <div\n data-slot=\"drop-drawer-sub\"\n data-submenu-id={submenuId}\n id={submenuId}\n >\n {processedChildren}\n </div>\n );\n }\n\n // For desktop, pass the generated ID to the DropdownMenuSub\n return (\n <DropdownMenuSub\n data-slot=\"drop-drawer-sub\"\n data-submenu-id={submenuId}\n // Don't pass id to DropdownMenuSub as it doesn't accept this prop\n {...props}\n >\n {children}\n </DropdownMenuSub>\n );\n}\n\nfunction DropDrawerSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuSubTrigger> & {\n icon?: React.ReactNode;\n}) {\n const { isMobile } = useDropDrawerContext();\n const { navigateToSubmenu } = React.useContext(SubmenuContext);\n\n // Define hooks outside of conditionals to follow React rules\n // Check if this item is inside a group by looking at parent elements\n const isInGroup = React.useCallback(\n (element: HTMLElement | null): boolean => {\n if (!element) return false;\n\n // Check if any parent has a data-drop-drawer-group attribute\n let parent = element.parentElement;\n while (parent) {\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\n return true;\n }\n parent = parent.parentElement;\n }\n return false;\n },\n [],\n );\n\n // Create a ref to check if the item is in a group\n const itemRef = React.useRef<HTMLDivElement>(null);\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\n\n React.useEffect(() => {\n // Only run this effect in mobile mode\n if (!isMobile) return;\n\n // Use a short timeout to ensure the DOM is fully rendered\n const timer = setTimeout(() => {\n if (itemRef.current) {\n setIsInsideGroup(isInGroup(itemRef.current));\n }\n }, 0);\n\n return () => clearTimeout(timer);\n }, [isInGroup, isMobile]);\n\n if (isMobile) {\n // Find the parent submenu ID\n const handleClick = (e: React.MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n // Get the closest parent with data-submenu-id attribute\n const element = e.currentTarget as HTMLElement;\n let submenuId: string | null = null;\n\n // First check if the element itself has the data attribute\n if (element.closest(\"[data-submenu-id]\")) {\n const closestElement = element.closest(\"[data-submenu-id]\");\n const id = closestElement?.getAttribute(\"data-submenu-id\");\n if (id) {\n submenuId = id;\n }\n }\n\n // If not found, try props\n if (!submenuId) {\n submenuId =\n ((props as Record<string, unknown>)[\n \"data-parent-submenu-id\"\n ] as string) ||\n ((props as Record<string, unknown>)[\"data-parent-submenu\"] as string);\n }\n\n if (!submenuId) {\n return;\n }\n\n // Get the title\n const title = typeof children === \"string\" ? children : \"Submenu\";\n\n // Navigate to the submenu\n if (navigateToSubmenu) {\n navigateToSubmenu(submenuId, title);\n }\n };\n\n // Combine onClick handlers\n const combinedOnClick = (e: React.MouseEvent) => {\n // Call the original onClick if provided\n const typedProps = props as Record<string, unknown>;\n if (typedProps[\"onClick\"]) {\n const originalOnClick = typedProps[\n \"onClick\"\n ] as React.MouseEventHandler<HTMLDivElement>;\n originalOnClick(e as React.MouseEvent<HTMLDivElement>);\n }\n\n // Call our navigation handler\n handleClick(e);\n };\n\n // Remove onClick from props to avoid duplicate handlers\n const { ...restProps } = props as Record<string, unknown>;\n\n // Don't wrap in DrawerClose for submenu triggers\n return (\n <div\n ref={itemRef}\n data-slot=\"drop-drawer-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-pointer items-center justify-between px-4 py-4\",\n // Only apply margin, background and rounded corners if not in a group\n !isInsideGroup &&\n \"bg-neutral-100 dark:bg-neutral-100 mx-2 my-1.5 rounded-md dark:bg-neutral-800 dark:dark:bg-neutral-800\",\n // For items in a group, don't add background but add more padding\n isInsideGroup && \"bg-transparent py-4\",\n inset && \"pl-8\",\n className,\n )}\n onClick={combinedOnClick}\n {...restProps}\n >\n <div className=\"flex items-center gap-2\">{children}</div>\n <ChevronRightIcon className=\"h-5 w-5\" />\n </div>\n );\n }\n\n return (\n <DropdownMenuSubTrigger\n data-slot=\"drop-drawer-sub-trigger\"\n data-inset={inset}\n className={className}\n inset={inset}\n {...props}\n >\n {children}\n </DropdownMenuSubTrigger>\n );\n}\n\nfunction DropDrawerSubContent({\n className,\n sideOffset = 4,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuSubContent>) {\n const { isMobile } = useDropDrawerContext();\n\n if (isMobile) {\n // For mobile, we don't render the content directly\n // It will be rendered by the DropDrawerContent component when active\n return null;\n }\n\n return (\n <DropdownMenuSubContent\n data-slot=\"drop-drawer-sub-content\"\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 p-1 shadow-lg dark:border-neutral-800\",\n className,\n )}\n {...props}\n >\n {children}\n </DropdownMenuSubContent>\n );\n}\n\nexport {\n DropDrawer,\n DropDrawerContent,\n DropDrawerFooter,\n DropDrawerGroup,\n DropDrawerItem,\n DropDrawerLabel,\n DropDrawerSeparator,\n DropDrawerSub,\n DropDrawerSubContent,\n DropDrawerSubTrigger,\n DropDrawerTrigger,\n};\n"],"names":["DropDrawerContext","React","useDropDrawerContext","context","Error","DropDrawer","children","props","isMobile","useIsMobile","DropdownComponent","Drawer","DropdownMenu","DropDrawerTrigger","className","TriggerComponent","DrawerTrigger","DropdownMenuTrigger","DropDrawerContent","activeSubmenu","setActiveSubmenu","submenuTitle","setSubmenuTitle","submenuStack","setSubmenuStack","animationDirection","setAnimationDirection","submenuContentRef","Map","navigateToSubmenu","id","title","prev","goBack","newStack","previous","registerSubmenuContent","content","extractSubmenuContent","elements","targetId","result","findSubmenuContent","node","element","DropDrawerSub","elementId","dataSubmenuId","child","DropDrawerSubContent","subContentProps","contentChild","Array","getSubmenuContent","cachedContent","submenuContent","variants","direction","transition","SubmenuContext","DrawerContent","cn","DrawerHeader","ChevronLeftIcon","DrawerTitle","AnimatePresence","motion","DropdownMenuContent","DropDrawerItem","onSelect","onClick","icon","variant","inset","disabled","isInGroup","parent","itemRef","isInsideGroup","setIsInsideGroup","timer","setTimeout","clearTimeout","handleClick","e","isInSubmenu","DrawerClose","DropdownMenuItem","DropDrawerSeparator","DropdownMenuSeparator","DropDrawerLabel","DropdownMenuLabel","DropDrawerFooter","DrawerFooter","DropDrawerGroup","childrenWithSeparators","childArray","filteredChildren","index","undefined","submenuIdCounter","generatedId","submenuId","contentItems","processedChildren","DropDrawerSubTrigger","DropdownMenuSub","closestElement","combinedOnClick","typedProps","originalOnClick","restProps","ChevronRightIcon","DropdownMenuSubTrigger","sideOffset","DropdownMenuSubContent"],"mappings":";;;;;;;;;AA6BA,MAAMA,oBAAoB,WAApBA,GAAoBC,cAA2C;IACnE,UAAU;AACZ;AAEA,MAAMC,uBAAuB;IAC3B,MAAMC,UAAUF,WAAiBD;IACjC,IAAI,CAACG,SACH,MAAM,IAAIC,MACR;IAGJ,OAAOD;AACT;AAEA,SAASE,WAAW,EAClBC,QAAQ,EACR,GAAGC,OAGwC;IAC3C,MAAMC,WAAWC;IACjB,MAAMC,oBAAoBF,WAAWG,SAASC;IAE9C,OAAO,WAAP,GACE,IAACZ,kBAAkB,QAAQ;QAAC,OAAO;YAAEQ;QAAS;kBAC5C,kBAACE,mBAAAA;YACC,aAAU;YACT,GAAIF,YAAY;gBAAE,WAAW;YAAK,CAAC;YACnC,GAAGD,KAAK;sBAERD;;;AAIT;AAEA,SAASO,kBAAkB,EACzBC,SAAS,EACTR,QAAQ,EACR,GAAGC,OAG+C;IAClD,MAAM,EAAEC,QAAQ,EAAE,GAAGN;IACrB,MAAMa,mBAAmBP,WAAWQ,gBAAgBC;IAEpD,OAAO,WAAP,GACE,IAACF,kBAAAA;QACC,aAAU;QACV,WAAWD;QACV,GAAGP,KAAK;kBAERD;;AAGP;AAEA,SAASY,kBAAkB,EACzBJ,SAAS,EACTR,QAAQ,EACR,GAAGC,OAG+C;IAClD,MAAM,EAAEC,QAAQ,EAAE,GAAGN;IACrB,MAAM,CAACiB,eAAeC,iBAAiB,GAAGnB,SAA8B;IACxE,MAAM,CAACoB,cAAcC,gBAAgB,GAAGrB,SAA8B;IACtE,MAAM,CAACsB,cAAcC,gBAAgB,GAAGvB,SAEtC,EAAE;IAEJ,MAAM,CAACwB,oBAAoBC,sBAAsB,GAAGzB,SAElD;IAGF,MAAM0B,oBAAoB1B,OACxB,IAAI2B;IAIN,MAAMC,oBAA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C;QACd;QAGA,MAAM,EAAE,GAAG2B,WAAW,GAAGxG;QAGzB,OAAO,WAAP,GACE,KAAC;YACC,KAAKsE;YACL,aAAU;YACV,cAAYJ;YACZ,WAAWZ,GACT,8DAEA,CAACiB,iBACC,0GAEFA,iBAAiB,uBACjBL,SAAS,QACT3D;YAEF,SAAS8F;YACR,GAAGG,SAAS;;8BAEb,IAAC;oBAAI,WAAU;8BAA2BzG;;8BAC1C,IAAC0G,kBAAgBA;oBAAC,WAAU;;;;IAGlC;IAEA,OAAO,WAAP,GACE,IAACC,wBAAsBA;QACrB,aAAU;QACV,cAAYxC;QACZ,WAAW3D;QACX,OAAO2D;QACN,GAAGlE,KAAK;kBAERD;;AAGP;AAEA,SAAS2C,qBAAqB,EAC5BnC,SAAS,EACToG,aAAa,CAAC,EACd5G,QAAQ,EACR,GAAGC,OACiD;IACpD,MAAM,EAAEC,QAAQ,EAAE,GAAGN;IAErB,IAAIM,UAGF,OAAO;IAGT,OAAO,WAAP,GACE,IAAC2G,wBAAsBA;QACrB,aAAU;QACV,YAAYD;QACZ,WAAWrD,GACT,gHACA/C;QAED,GAAGP,KAAK;kBAERD;;AAGP"}
1
+ {"version":3,"file":"components\\ui\\dropdrawer.js","sources":["webpack://@arolariu/components/./src/components/ui/dropdrawer.tsx"],"sourcesContent":["\r\n\r\n/* eslint-disable */\r\n\r\nimport {ChevronLeftIcon, ChevronRightIcon} from \"lucide-react\";\r\nimport {AnimatePresence, motion, Transition} from \"motion/react\";\r\nimport * as React from \"react\";\r\n\r\nimport {Drawer, DrawerClose, DrawerContent, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger} from \"@/components/ui/drawer\";\r\nimport {\r\n DropdownMenu,\r\n DropdownMenuContent,\r\n DropdownMenuItem,\r\n DropdownMenuLabel,\r\n DropdownMenuSeparator,\r\n DropdownMenuSub,\r\n DropdownMenuSubContent,\r\n DropdownMenuSubTrigger,\r\n DropdownMenuTrigger,\r\n} from \"@/components/ui/dropdown-menu\";\r\nimport {useIsMobile} from \"@/hooks/useIsMobile\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst DropDrawerContext = React.createContext<{isMobile: boolean}>({\r\n isMobile: false,\r\n});\r\n\r\nconst useDropDrawerContext = () => {\r\n const context = React.useContext(DropDrawerContext);\r\n if (!context) {\r\n throw new Error(\"DropDrawer components cannot be rendered outside the Context\");\r\n }\r\n return context;\r\n};\r\n\r\nfunction DropDrawer({children, ...props}: React.ComponentProps<typeof Drawer> | React.ComponentProps<typeof DropdownMenu>) {\r\n const isMobile = useIsMobile();\r\n const DropdownComponent = isMobile ? Drawer : DropdownMenu;\r\n\r\n return (\r\n <DropDrawerContext.Provider value={{isMobile}}>\r\n <DropdownComponent\r\n data-slot='drop-drawer'\r\n {...(isMobile && {autoFocus: true})}\r\n {...props}>\r\n {children}\r\n </DropdownComponent>\r\n </DropDrawerContext.Provider>\r\n );\r\n}\r\n\r\nfunction DropDrawerTrigger({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DrawerTrigger> | React.ComponentProps<typeof DropdownMenuTrigger>) {\r\n const {isMobile} = useDropDrawerContext();\r\n const TriggerComponent = isMobile ? DrawerTrigger : DropdownMenuTrigger;\r\n\r\n return (\r\n <TriggerComponent\r\n data-slot='drop-drawer-trigger'\r\n className={className}\r\n {...props}>\r\n {children}\r\n </TriggerComponent>\r\n );\r\n}\r\n\r\nfunction DropDrawerContent({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DrawerContent> | React.ComponentProps<typeof DropdownMenuContent>) {\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<{id: string; title: string}[]>([]);\r\n // Add animation direction state\r\n const [animationDirection, setAnimationDirection] = React.useState<\"forward\" | \"backward\">(\"forward\");\r\n\r\n // Create a ref to store submenu content by ID\r\n const submenuContentRef = React.useRef<Map<string, React.ReactNode[]>>(new Map());\r\n\r\n // Function to navigate to a submenu\r\n const navigateToSubmenu = React.useCallback((id: string, title: string) => {\r\n // Set animation direction to forward when navigating to a submenu\r\n setAnimationDirection(\"forward\");\r\n setActiveSubmenu(id);\r\n setSubmenuTitle(title);\r\n setSubmenuStack((prev) => [...prev, {id, title}]);\r\n }, []);\r\n\r\n // Function to go back to previous menu\r\n const goBack = React.useCallback(() => {\r\n // Set animation direction to backward when going back\r\n setAnimationDirection(\"backward\");\r\n\r\n if (submenuStack.length <= 1) {\r\n // If we're at the first level, go back to main menu\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n } else {\r\n // Go back to previous submenu\r\n const newStack = [...submenuStack];\r\n newStack.pop(); // Remove current\r\n const previous = newStack[newStack.length - 1];\r\n setActiveSubmenu(previous.id);\r\n setSubmenuTitle(previous.title);\r\n setSubmenuStack(newStack);\r\n }\r\n }, [submenuStack]);\r\n\r\n // Function to register submenu content\r\n const registerSubmenuContent = React.useCallback((id: string, content: React.ReactNode[]) => {\r\n submenuContentRef.current.set(id, content);\r\n }, []);\r\n\r\n // Function to extract submenu content\r\n const extractSubmenuContent = React.useCallback((elements: React.ReactNode, targetId: string): React.ReactNode[] => {\r\n const result: React.ReactNode[] = [];\r\n\r\n // Recursive function to search through all children\r\n const findSubmenuContent = (node: React.ReactNode) => {\r\n // Skip if not a valid element\r\n if (!React.isValidElement(node)) return;\r\n\r\n const element = node as React.ReactElement;\r\n // Use a more specific type to avoid 'any'\r\n const props = element.props as {\r\n id?: string;\r\n \"data-submenu-id\"?: string;\r\n children?: React.ReactNode;\r\n };\r\n\r\n // Check if this is a DropDrawerSub\r\n if (element.type === DropDrawerSub) {\r\n // Get all possible ID values\r\n const elementId = props.id;\r\n const dataSubmenuId = props[\"data-submenu-id\"];\r\n\r\n // If this is the submenu we're looking for\r\n if (elementId === targetId || dataSubmenuId === targetId) {\r\n // Find the SubContent within this Sub\r\n if (props.children) {\r\n React.Children.forEach(props.children, (child) => {\r\n if (React.isValidElement(child) && child.type === DropDrawerSubContent) {\r\n // Add all children of the SubContent to the result\r\n const subContentProps = child.props as {\r\n children?: React.ReactNode;\r\n };\r\n if (subContentProps.children) {\r\n React.Children.forEach(subContentProps.children, (contentChild) => {\r\n result.push(contentChild);\r\n });\r\n }\r\n }\r\n });\r\n }\r\n return; // Found what we needed, no need to search deeper\r\n }\r\n }\r\n\r\n // If this element has children, search through them\r\n if (props.children) {\r\n if (Array.isArray(props.children)) {\r\n props.children.forEach((child: React.ReactNode) => findSubmenuContent(child));\r\n } else {\r\n findSubmenuContent(props.children);\r\n }\r\n }\r\n };\r\n\r\n // Start the search from the root elements\r\n if (Array.isArray(elements)) {\r\n elements.forEach((child) => findSubmenuContent(child));\r\n } else {\r\n findSubmenuContent(elements);\r\n }\r\n\r\n return result;\r\n }, []);\r\n\r\n // Get submenu content (either from cache or extract it)\r\n const getSubmenuContent = React.useCallback(\r\n (id: string) => {\r\n // Check if we have the content in our ref\r\n const cachedContent = submenuContentRef.current.get(id || \"\");\r\n if (cachedContent && cachedContent.length > 0) {\r\n return cachedContent;\r\n }\r\n\r\n // If not in cache, extract it\r\n const submenuContent = extractSubmenuContent(children, id);\r\n\r\n if (submenuContent.length === 0) {\r\n return [];\r\n }\r\n\r\n // Store in cache for future use\r\n if (id) {\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 // Animation variants for Framer Motion\r\n const variants = {\r\n enter: (direction: \"forward\" | \"backward\") => ({\r\n x: direction === \"forward\" ? \"100%\" : \"-100%\",\r\n opacity: 0,\r\n }),\r\n center: {\r\n x: 0,\r\n opacity: 1,\r\n },\r\n exit: (direction: \"forward\" | \"backward\") => ({\r\n x: direction === \"forward\" ? \"-100%\" : \"100%\",\r\n opacity: 0,\r\n }),\r\n };\r\n\r\n // Animation transition\r\n const transition = {\r\n duration: 0.3,\r\n ease: [0.25, 0.1, 0.25, 1.0], // cubic-bezier easing\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 setActiveSubmenu: (id) => {\r\n if (id === null) {\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n }\r\n },\r\n submenuTitle,\r\n setSubmenuTitle,\r\n navigateToSubmenu,\r\n registerSubmenuContent,\r\n }}>\r\n <DrawerContent\r\n data-slot='drop-drawer-content'\r\n className={cn(\"max-h-[90vh]\", className)}\r\n {...props}>\r\n {activeSubmenu ? (\r\n <>\r\n <DrawerHeader>\r\n <div className='flex items-center gap-2'>\r\n <button\r\n onClick={goBack}\r\n className='rounded-full p-1 hover:bg-neutral-100/50 dark:hover:bg-neutral-800/50'>\r\n <ChevronLeftIcon className='h-5 w-5' />\r\n </button>\r\n <DrawerTitle>{submenuTitle || \"Submenu\"}</DrawerTitle>\r\n </div>\r\n </DrawerHeader>\r\n <div className='relative max-h-[70vh] flex-1 overflow-y-auto'>\r\n {/* Use AnimatePresence to handle exit animations */}\r\n <AnimatePresence\r\n initial={false}\r\n mode='wait'\r\n custom={animationDirection}>\r\n <motion.div\r\n key={activeSubmenu || \"main\"}\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='h-full w-full space-y-1.5 pb-6'>\r\n {activeSubmenu ? getSubmenuContent(activeSubmenu) : children}\r\n </motion.div>\r\n </AnimatePresence>\r\n </div>\r\n </>\r\n ) : (\r\n <>\r\n <DrawerHeader className='sr-only'>\r\n <DrawerTitle>Menu</DrawerTitle>\r\n </DrawerHeader>\r\n <div className='max-h-[70vh] overflow-y-auto'>\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='w-full space-y-1.5 pb-6'>\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 setActiveSubmenu,\r\n submenuTitle,\r\n setSubmenuTitle,\r\n registerSubmenuContent,\r\n }}>\r\n <DropdownMenuContent\r\n data-slot='drop-drawer-content'\r\n align='end'\r\n sideOffset={4}\r\n className={cn(\"max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[220px] overflow-y-auto\", className)}\r\n {...props}>\r\n {children}\r\n </DropdownMenuContent>\r\n </SubmenuContext.Provider>\r\n );\r\n}\r\n\r\nfunction DropDrawerItem({\r\n className,\r\n children,\r\n onSelect,\r\n onClick,\r\n icon,\r\n variant = \"default\",\r\n inset,\r\n disabled,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuItem> & {\r\n icon?: React.ReactNode;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n // Define hooks outside of conditionals to follow React rules\r\n // Check if this item is inside a group by looking at parent elements\r\n const isInGroup = React.useCallback((element: HTMLElement | null): boolean => {\r\n if (!element) return false;\r\n\r\n // Check if any parent has a data-drop-drawer-group attribute\r\n let parent = element.parentElement;\r\n while (parent) {\r\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\r\n return true;\r\n }\r\n parent = parent.parentElement;\r\n }\r\n return false;\r\n }, []);\r\n\r\n // Create a ref to check if the item is in a group\r\n const itemRef = React.useRef<HTMLDivElement>(null);\r\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n // Only run this effect in mobile mode\r\n if (!isMobile) return;\r\n\r\n // Use a short timeout to ensure the DOM is fully rendered\r\n const timer = setTimeout(() => {\r\n if (itemRef.current) {\r\n setIsInsideGroup(isInGroup(itemRef.current));\r\n }\r\n }, 0);\r\n\r\n return () => clearTimeout(timer);\r\n }, [isInGroup, isMobile]);\r\n\r\n if (isMobile) {\r\n const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {\r\n if (disabled) return;\r\n if (onClick) onClick(e);\r\n if (onSelect) onSelect(e as unknown as Event);\r\n };\r\n\r\n // Only wrap in DrawerClose if it's not a submenu item\r\n const content = (\r\n <div\r\n ref={itemRef}\r\n data-slot='drop-drawer-item'\r\n data-variant={variant}\r\n data-inset={inset}\r\n data-disabled={disabled}\r\n className={cn(\r\n \"flex cursor-pointer items-center justify-between px-4 py-4\",\r\n // Only apply margin, background and rounded corners if not in a group\r\n !isInsideGroup && \"mx-2 my-1.5 rounded-md bg-neutral-100 dark:bg-neutral-100 dark:bg-neutral-800 dark:dark:bg-neutral-800\",\r\n // For items in a group, don't add background but add more padding\r\n isInsideGroup && \"bg-transparent py-4\",\r\n inset && \"pl-8\",\r\n variant === \"destructive\" && \"text-red-500 dark:dark:text-red-900 dark:text-red-500 dark:text-red-900\",\r\n disabled && \"pointer-events-none opacity-50\",\r\n className,\r\n )}\r\n onClick={handleClick}\r\n aria-disabled={disabled}\r\n {...props}>\r\n <div className='flex items-center gap-2'>{children}</div>\r\n {icon && <div className='flex-shrink-0'>{icon}</div>}\r\n </div>\r\n );\r\n\r\n // Check if this is inside a submenu\r\n const isInSubmenu =\r\n (props as Record<string, unknown>)[\"data-parent-submenu-id\"] || (props as Record<string, unknown>)[\"data-parent-submenu\"];\r\n\r\n if (isInSubmenu) {\r\n return content;\r\n }\r\n\r\n return <DrawerClose asChild>{content}</DrawerClose>;\r\n }\r\n\r\n return (\r\n <DropdownMenuItem\r\n data-slot='drop-drawer-item'\r\n data-variant={variant}\r\n data-inset={inset}\r\n className={className}\r\n onSelect={onSelect}\r\n onClick={onClick as React.MouseEventHandler<HTMLDivElement>}\r\n variant={variant}\r\n inset={inset}\r\n disabled={disabled}\r\n {...props}>\r\n <div className='flex w-full items-center justify-between'>\r\n <div>{children}</div>\r\n {icon && <div>{icon}</div>}\r\n </div>\r\n </DropdownMenuItem>\r\n );\r\n}\r\n\r\nfunction DropDrawerSeparator({className, ...props}: React.ComponentProps<typeof DropdownMenuSeparator>) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n // For mobile, render a simple divider\r\n if (isMobile) {\r\n return null;\r\n }\r\n\r\n // For desktop, use the standard dropdown separator\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\nfunction DropDrawerLabel({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuLabel> | React.ComponentProps<typeof DrawerTitle>) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n return (\r\n <DrawerHeader className='p-0'>\r\n <DrawerTitle\r\n data-slot='drop-drawer-label'\r\n className={cn(\"px-4 py-2 text-sm font-medium text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}>\r\n {children}\r\n </DrawerTitle>\r\n </DrawerHeader>\r\n );\r\n }\r\n\r\n return (\r\n <DropdownMenuLabel\r\n data-slot='drop-drawer-label'\r\n className={className}\r\n {...props}>\r\n {children}\r\n </DropdownMenuLabel>\r\n );\r\n}\r\n\r\nfunction DropDrawerFooter({className, children, ...props}: React.ComponentProps<typeof DrawerFooter> | React.ComponentProps<\"div\">) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n return (\r\n <DrawerFooter\r\n data-slot='drop-drawer-footer'\r\n className={cn(\"p-4\", className)}\r\n {...props}>\r\n {children}\r\n </DrawerFooter>\r\n );\r\n }\r\n\r\n // No direct equivalent in DropdownMenu, so we'll just render a div\r\n return (\r\n <div\r\n data-slot='drop-drawer-footer'\r\n className={cn(\"p-2\", className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n}\r\n\r\nfunction DropDrawerGroup({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<\"div\"> & {\r\n children: React.ReactNode;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n // Add separators between children on mobile\r\n const childrenWithSeparators = React.useMemo(() => {\r\n if (!isMobile) return children;\r\n\r\n const childArray = React.Children.toArray(children);\r\n\r\n // Filter out any existing separators\r\n const filteredChildren = childArray.filter((child) => React.isValidElement(child) && child.type !== DropDrawerSeparator);\r\n\r\n // Add separators between items\r\n return filteredChildren.flatMap((child, index) => {\r\n if (index === filteredChildren.length - 1) return [child];\r\n return [\r\n child,\r\n <div\r\n key={`separator-${index}`}\r\n className='h-px bg-neutral-200 dark:bg-neutral-800'\r\n aria-hidden='true'\r\n />,\r\n ];\r\n });\r\n }, [children, isMobile]);\r\n\r\n if (isMobile) {\r\n return (\r\n <div\r\n data-drop-drawer-group\r\n data-slot='drop-drawer-group'\r\n role='group'\r\n className={cn(\r\n \"mx-2 my-3 overflow-hidden rounded-xl bg-neutral-100 dark:bg-neutral-100 dark:bg-neutral-800 dark:dark:bg-neutral-800\",\r\n className,\r\n )}\r\n {...props}>\r\n {childrenWithSeparators}\r\n </div>\r\n );\r\n }\r\n\r\n // On desktop, use a div with proper role and attributes\r\n return (\r\n <div\r\n data-drop-drawer-group\r\n data-slot='drop-drawer-group'\r\n role='group'\r\n className={className}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n}\r\n\r\n// Context for managing submenu state on mobile\r\ninterface SubmenuContextType {\r\n activeSubmenu: string | null;\r\n setActiveSubmenu: (id: string | null) => void;\r\n submenuTitle: string | null;\r\n setSubmenuTitle: (title: string | null) => void;\r\n navigateToSubmenu?: (id: string, title: string) => void;\r\n registerSubmenuContent?: (id: string, content: React.ReactNode[]) => void;\r\n}\r\n\r\nconst SubmenuContext = React.createContext<SubmenuContextType>({\r\n activeSubmenu: null,\r\n setActiveSubmenu: () => {},\r\n submenuTitle: null,\r\n setSubmenuTitle: () => {},\r\n navigateToSubmenu: undefined,\r\n registerSubmenuContent: undefined,\r\n});\r\n\r\n// Submenu components\r\n// Counter for generating simple numeric IDs\r\nlet submenuIdCounter = 0;\r\n\r\nfunction DropDrawerSub({\r\n children,\r\n id,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuSub> & {\r\n id?: string;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n const {registerSubmenuContent} = React.useContext(SubmenuContext);\r\n\r\n // Generate a simple numeric ID instead of using React.useId()\r\n const [generatedId] = React.useState(() => `submenu-${submenuIdCounter++}`);\r\n const submenuId = id || generatedId;\r\n\r\n // Extract submenu content to register with parent\r\n React.useEffect(() => {\r\n if (!registerSubmenuContent) return;\r\n\r\n // Find the SubContent within this Sub\r\n const contentItems: React.ReactNode[] = [];\r\n React.Children.forEach(children, (child) => {\r\n if (React.isValidElement(child) && child.type === DropDrawerSubContent) {\r\n // Add all children of the SubContent to the result\r\n React.Children.forEach((child.props as {children?: React.ReactNode}).children, (contentChild) => {\r\n contentItems.push(contentChild);\r\n });\r\n }\r\n });\r\n\r\n // Register the content with the parent\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 // For mobile, we'll use the context to manage submenu state\r\n // Process children to pass the submenu ID to the trigger and content\r\n const processedChildren = React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child;\r\n\r\n if (child.type === DropDrawerSubTrigger) {\r\n return React.cloneElement(\r\n child as React.ReactElement,\r\n {\r\n ...(child.props as object),\r\n \"data-parent-submenu-id\": submenuId,\r\n \"data-submenu-id\": submenuId,\r\n // Use only data attributes, not custom props\r\n \"data-parent-submenu\": submenuId,\r\n } as React.HTMLAttributes<HTMLElement>,\r\n );\r\n }\r\n\r\n if (child.type === DropDrawerSubContent) {\r\n return React.cloneElement(\r\n child as React.ReactElement,\r\n {\r\n ...(child.props as object),\r\n \"data-parent-submenu-id\": submenuId,\r\n \"data-submenu-id\": submenuId,\r\n // Use only data attributes, not custom props\r\n \"data-parent-submenu\": submenuId,\r\n } as React.HTMLAttributes<HTMLElement>,\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 // For desktop, pass the generated ID to the DropdownMenuSub\r\n return (\r\n <DropdownMenuSub\r\n data-slot='drop-drawer-sub'\r\n data-submenu-id={submenuId}\r\n // Don't pass id to DropdownMenuSub as it doesn't accept this prop\r\n {...props}>\r\n {children}\r\n </DropdownMenuSub>\r\n );\r\n}\r\n\r\nfunction DropDrawerSubTrigger({\r\n className,\r\n inset,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuSubTrigger> & {\r\n icon?: React.ReactNode;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n const {navigateToSubmenu} = React.useContext(SubmenuContext);\r\n\r\n // Define hooks outside of conditionals to follow React rules\r\n // Check if this item is inside a group by looking at parent elements\r\n const isInGroup = React.useCallback((element: HTMLElement | null): boolean => {\r\n if (!element) return false;\r\n\r\n // Check if any parent has a data-drop-drawer-group attribute\r\n let parent = element.parentElement;\r\n while (parent) {\r\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\r\n return true;\r\n }\r\n parent = parent.parentElement;\r\n }\r\n return false;\r\n }, []);\r\n\r\n // Create a ref to check if the item is in a group\r\n const itemRef = React.useRef<HTMLDivElement>(null);\r\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n // Only run this effect in mobile mode\r\n if (!isMobile) return;\r\n\r\n // Use a short timeout to ensure the DOM is fully rendered\r\n const timer = setTimeout(() => {\r\n if (itemRef.current) {\r\n setIsInsideGroup(isInGroup(itemRef.current));\r\n }\r\n }, 0);\r\n\r\n return () => clearTimeout(timer);\r\n }, [isInGroup, isMobile]);\r\n\r\n if (isMobile) {\r\n // Find the parent submenu ID\r\n const handleClick = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n // Get the closest parent with data-submenu-id attribute\r\n const element = e.currentTarget as HTMLElement;\r\n let submenuId: string | null = null;\r\n\r\n // First check if the element itself has the data attribute\r\n if (element.closest(\"[data-submenu-id]\")) {\r\n const closestElement = element.closest(\"[data-submenu-id]\");\r\n const id = closestElement?.getAttribute(\"data-submenu-id\");\r\n if (id) {\r\n submenuId = id;\r\n }\r\n }\r\n\r\n // If not found, try props\r\n if (!submenuId) {\r\n submenuId =\r\n ((props as Record<string, unknown>)[\"data-parent-submenu-id\"] as string)\r\n || ((props as Record<string, unknown>)[\"data-parent-submenu\"] as string);\r\n }\r\n\r\n if (!submenuId) {\r\n return;\r\n }\r\n\r\n // Get the title\r\n const title = typeof children === \"string\" ? children : \"Submenu\";\r\n\r\n // Navigate to the submenu\r\n if (navigateToSubmenu) {\r\n navigateToSubmenu(submenuId, title);\r\n }\r\n };\r\n\r\n // Combine onClick handlers\r\n const combinedOnClick = (e: React.MouseEvent) => {\r\n // Call the original onClick if provided\r\n const typedProps = props as Record<string, unknown>;\r\n if (typedProps[\"onClick\"]) {\r\n const originalOnClick = typedProps[\"onClick\"] as React.MouseEventHandler<HTMLDivElement>;\r\n originalOnClick(e as React.MouseEvent<HTMLDivElement>);\r\n }\r\n\r\n // Call our navigation handler\r\n handleClick(e);\r\n };\r\n\r\n // Remove onClick from props to avoid duplicate handlers\r\n const {...restProps} = props as Record<string, unknown>;\r\n\r\n // Don't wrap in DrawerClose for submenu triggers\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 className={cn(\r\n \"flex cursor-pointer items-center justify-between px-4 py-4\",\r\n // Only apply margin, background and rounded corners if not in a group\r\n !isInsideGroup && \"mx-2 my-1.5 rounded-md bg-neutral-100 dark:bg-neutral-100 dark:bg-neutral-800 dark:dark:bg-neutral-800\",\r\n // For items in a group, don't add background but add more padding\r\n isInsideGroup && \"bg-transparent py-4\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n onClick={combinedOnClick}\r\n {...restProps}>\r\n <div className='flex items-center gap-2'>{children}</div>\r\n <ChevronRightIcon className='h-5 w-5' />\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 {...props}>\r\n {children}\r\n </DropdownMenuSubTrigger>\r\n );\r\n}\r\n\r\nfunction DropDrawerSubContent({className, sideOffset = 4, children, ...props}: React.ComponentProps<typeof DropdownMenuSubContent>) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n // For mobile, we don't render the content directly\r\n // It will be rendered by the DropDrawerContent component when active\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(\r\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 p-1 shadow-lg dark:border-neutral-800\",\r\n className,\r\n )}\r\n {...props}>\r\n {children}\r\n </DropdownMenuSubContent>\r\n );\r\n}\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":["DropDrawerContext","React","useDropDrawerContext","context","Error","DropDrawer","children","props","isMobile","useIsMobile","DropdownComponent","Drawer","DropdownMenu","DropDrawerTrigger","className","TriggerComponent","DrawerTrigger","DropdownMenuTrigger","DropDrawerContent","activeSubmenu","setActiveSubmenu","submenuTitle","setSubmenuTitle","submenuStack","setSubmenuStack","animationDirection","setAnimationDirection","submenuContentRef","Map","navigateToSubmenu","id","title","prev","goBack","newStack","previous","registerSubmenuContent","content","extractSubmenuContent","elements","targetId","result","findSubmenuContent","node","element","DropDrawerSub","elementId","dataSubmenuId","child","DropDrawerSubContent","subContentProps","contentChild","Array","getSubmenuContent","cachedContent","submenuContent","variants","direction","transition","SubmenuContext","DrawerContent","cn","DrawerHeader","ChevronLeftIcon","DrawerTitle","AnimatePresence","motion","DropdownMenuContent","DropDrawerItem","onSelect","onClick","icon","variant","inset","disabled","isInGroup","parent","itemRef","isInsideGroup","setIsInsideGroup","timer","setTimeout","clearTimeout","handleClick","e","isInSubmenu","DrawerClose","DropdownMenuItem","DropDrawerSeparator","DropdownMenuSeparator","DropDrawerLabel","DropdownMenuLabel","DropDrawerFooter","DrawerFooter","DropDrawerGroup","childrenWithSeparators","childArray","filteredChildren","index","undefined","submenuIdCounter","generatedId","submenuId","contentItems","processedChildren","DropDrawerSubTrigger","DropdownMenuSub","closestElement","combinedOnClick","typedProps","originalOnClick","restProps","ChevronRightIcon","DropdownMenuSubTrigger","sideOffset","DropdownMenuSubContent"],"mappings":";;;;;;;;;AAuBA,MAAMA,oBAAoB,WAApBA,GAAoBC,cAAyC;IACjE,UAAU;AACZ;AAEA,MAAMC,uBAAuB;IAC3B,MAAMC,UAAUF,WAAiBD;IACjC,IAAI,CAACG,SACH,MAAM,IAAIC,MAAM;IAElB,OAAOD;AACT;AAEA,SAASE,WAAW,EAACC,QAAQ,EAAE,GAAGC,OAAuF;IACvH,MAAMC,WAAWC;IACjB,MAAMC,oBAAoBF,WAAWG,SAASC;IAE9C,OAAO,WAAP,GACE,IAACZ,kBAAkB,QAAQ;QAAC,OAAO;YAACQ;QAAQ;kBAC1C,kBAACE,mBAAAA;YACC,aAAU;YACT,GAAIF,YAAY;gBAAC,WAAW;YAAI,CAAC;YACjC,GAAGD,KAAK;sBACRD;;;AAIT;AAEA,SAASO,kBAAkB,EACzBC,SAAS,EACTR,QAAQ,EACR,GAAGC,OAC2F;IAC9F,MAAM,EAACC,QAAQ,EAAC,GAAGN;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T,gHACA/C;QAED,GAAGP,KAAK;kBACRD;;AAGP"}
@@ -1 +1 @@
1
- {"version":3,"file":"fireworks-background.d.ts","sourceRoot":"","sources":["../../../src/components/ui/fireworks-background.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwM/B,UAAU,wBACR,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC3D,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;IACtD,YAAY,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;IACrD,aAAa,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;IACtD,YAAY,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;CACtD;AAED,QAAA,MAAM,mBAAmB,iGAgKxB,CAAC;AAIF,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"fireworks-background.d.ts","sourceRoot":"","sources":["../../../src/components/ui/fireworks-background.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAyL/B,UAAU,wBAAyB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC5F,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,GAAG,MAAM,CAAC;IACpD,YAAY,CAAC,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,GAAG,MAAM,CAAC;IACnD,aAAa,CAAC,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,GAAG,MAAM,CAAC;IACpD,YAAY,CAAC,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,GAAG,MAAM,CAAC;CACpD;AAED,QAAA,MAAM,mBAAmB,iGA2HxB,CAAC;AAIF,OAAO,EAAC,mBAAmB,EAAE,KAAK,wBAAwB,EAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
4
- import { cn } from "../../lib/utils.js";
4
+ import { cn } from "../../lib/utilities.js";
5
5
  const rand = (min, max)=>Math.random() * (max - min) + min;
6
6
  const randInt = (min, max)=>Math.floor(Math.random() * (max - min) + min);
7
7
  const randColor = ()=>`hsl(${randInt(0, 360)}, 100%, 50%)`;
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\fireworks-background.js","sources":["webpack://@arolariu/components/./src/components/ui/fireworks-background.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst rand = (min: number, max: number): number =>\n Math.random() * (max - min) + min;\nconst randInt = (min: number, max: number): number =>\n Math.floor(Math.random() * (max - min) + min);\nconst randColor = (): string => `hsl(${randInt(0, 360)}, 100%, 50%)`;\n\ninterface ParticleType {\n x: number;\n y: number;\n color: string;\n speed: number;\n direction: number;\n vx: number;\n vy: number;\n gravity: number;\n friction: number;\n alpha: number;\n decay: number;\n size: number;\n update: () => void;\n draw: (ctx: CanvasRenderingContext2D) => void;\n isAlive: () => boolean;\n}\n\nconst createParticle = (\n x: number,\n y: number,\n color: string,\n speed: number,\n direction: number,\n gravity: number,\n friction: number,\n size: number,\n): ParticleType => {\n const vx = Math.cos(direction) * speed;\n const vy = Math.sin(direction) * speed;\n const alpha = 1;\n const decay = rand(0.005, 0.02);\n\n return {\n x,\n y,\n color,\n speed,\n direction,\n vx,\n vy,\n gravity,\n friction,\n alpha,\n decay,\n size,\n update() {\n this.vx *= this.friction;\n this.vy *= this.friction;\n this.vy += this.gravity;\n this.x += this.vx;\n this.y += this.vy;\n this.alpha -= this.decay;\n },\n draw(ctx: CanvasRenderingContext2D) {\n ctx.save();\n ctx.globalAlpha = this.alpha;\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\n ctx.fillStyle = this.color;\n ctx.fill();\n ctx.restore();\n },\n isAlive() {\n return this.alpha > 0;\n },\n };\n};\n\ninterface FireworkType {\n x: number;\n y: number;\n targetY: number;\n color: string;\n speed: number;\n size: number;\n angle: number;\n vx: number;\n vy: number;\n trail: { x: number; y: number }[];\n trailLength: number;\n exploded: boolean;\n update: () => boolean;\n explode: () => void;\n draw: (ctx: CanvasRenderingContext2D) => void;\n}\n\nconst createFirework = (\n x: number,\n y: number,\n targetY: number,\n color: string,\n speed: number,\n size: number,\n particleSpeed: { min: number; max: number } | number,\n particleSize: { min: number; max: number } | number,\n onExplode: (particles: ParticleType[]) => void,\n): FireworkType => {\n const angle = -Math.PI / 2 + rand(-0.3, 0.3);\n const vx = Math.cos(angle) * speed;\n const vy = Math.sin(angle) * speed;\n const trail: { x: number; y: number }[] = [];\n const trailLength = randInt(10, 25);\n\n return {\n x,\n y,\n targetY,\n color,\n speed,\n size,\n angle,\n vx,\n vy,\n trail,\n trailLength,\n exploded: false,\n update() {\n this.trail.push({ x: this.x, y: this.y });\n if (this.trail.length > this.trailLength) {\n this.trail.shift();\n }\n this.x += this.vx;\n this.y += this.vy;\n this.vy += 0.02;\n if (this.vy >= 0 || this.y <= this.targetY) {\n this.explode();\n return false;\n }\n return true;\n },\n explode() {\n const numParticles = randInt(50, 150);\n const particles: ParticleType[] = [];\n for (let i = 0; i < numParticles; i++) {\n const particleAngle = rand(0, Math.PI * 2);\n const localParticleSpeed = getValueByRange(particleSpeed);\n const localParticleSize = getValueByRange(particleSize);\n particles.push(\n createParticle(\n this.x,\n this.y,\n this.color,\n localParticleSpeed,\n particleAngle,\n 0.05,\n 0.98,\n localParticleSize,\n ),\n );\n }\n onExplode(particles);\n },\n draw(ctx: CanvasRenderingContext2D) {\n ctx.save();\n ctx.beginPath();\n if (this.trail.length > 1) {\n ctx.moveTo(this.trail[0].x, this.trail[0].y);\n for (const point of this.trail) {\n ctx.lineTo(point.x, point.y);\n }\n } else {\n ctx.moveTo(this.x, this.y);\n ctx.lineTo(this.x, this.y);\n }\n ctx.strokeStyle = this.color;\n ctx.lineWidth = this.size;\n ctx.lineCap = \"round\";\n ctx.stroke();\n ctx.restore();\n },\n };\n};\n\nconst getValueByRange = (\n range: { min: number; max: number } | number,\n): number => {\n if (typeof range === \"number\") {\n return range;\n }\n return rand(range.min, range.max);\n};\n\nconst getColor = (color: string | string[] | undefined): string => {\n if (Array.isArray(color)) {\n return color[randInt(0, color.length)];\n }\n return color ?? randColor();\n};\n\ninterface FireworksBackgroundProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"color\"> {\n canvasProps?: React.HTMLAttributes<HTMLCanvasElement>;\n population?: number;\n color?: string | string[];\n fireworkSpeed?: { min: number; max: number } | number;\n fireworkSize?: { min: number; max: number } | number;\n particleSpeed?: { min: number; max: number } | number;\n particleSize?: { min: number; max: number } | number;\n}\n\nconst FireworksBackground = React.forwardRef<\n HTMLDivElement,\n FireworksBackgroundProps\n>(\n (\n {\n className,\n canvasProps,\n population = 1,\n color,\n fireworkSpeed = { min: 4, max: 8 },\n fireworkSize = { min: 2, max: 5 },\n particleSpeed = { min: 2, max: 7 },\n particleSize = { min: 1, max: 5 },\n ...props\n },\n ref,\n ) => {\n const canvasRef = React.useRef<HTMLCanvasElement>(null);\n const containerRef = React.useRef<HTMLDivElement>(null);\n React.useImperativeHandle(\n ref,\n () => containerRef.current as HTMLDivElement,\n );\n\n React.useEffect(() => {\n const canvas = canvasRef.current;\n const container = containerRef.current;\n if (!canvas || !container) return;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return;\n\n let maxX = window.innerWidth;\n let ratio = container.offsetHeight / container.offsetWidth;\n let maxY = maxX * ratio;\n canvas.width = maxX;\n canvas.height = maxY;\n\n const setCanvasSize = () => {\n maxX = window.innerWidth;\n ratio = container.offsetHeight / container.offsetWidth;\n maxY = maxX * ratio;\n canvas.width = maxX;\n canvas.height = maxY;\n };\n window.addEventListener(\"resize\", setCanvasSize);\n\n const explosions: ParticleType[] = [];\n const fireworks: FireworkType[] = [];\n\n const handleExplosion = (particles: ParticleType[]) => {\n explosions.push(...particles);\n };\n\n const launchFirework = () => {\n const x = rand(maxX * 0.1, maxX * 0.9);\n const y = maxY;\n const targetY = rand(maxY * 0.1, maxY * 0.4);\n const fireworkColor = getColor(color);\n const speed = getValueByRange(fireworkSpeed);\n const size = getValueByRange(fireworkSize);\n fireworks.push(\n createFirework(\n x,\n y,\n targetY,\n fireworkColor,\n speed,\n size,\n particleSpeed,\n particleSize,\n handleExplosion,\n ),\n );\n const timeout = rand(300, 800) / population;\n setTimeout(launchFirework, timeout);\n };\n\n launchFirework();\n\n let animationFrameId: number;\n const animate = () => {\n ctx.clearRect(0, 0, maxX, maxY);\n\n for (let i = fireworks.length - 1; i >= 0; i--) {\n const firework = fireworks[i];\n if (!firework.update()) {\n fireworks.splice(i, 1);\n } else {\n firework.draw(ctx);\n }\n }\n\n for (let i = explosions.length - 1; i >= 0; i--) {\n const particle = explosions[i];\n particle.update();\n if (particle.isAlive()) {\n particle.draw(ctx);\n } else {\n explosions.splice(i, 1);\n }\n }\n\n animationFrameId = requestAnimationFrame(animate);\n };\n\n animate();\n\n const handleClick = (event: MouseEvent) => {\n const x = event.clientX;\n const y = maxY;\n const targetY = event.clientY;\n const fireworkColor = getColor(color);\n const speed = getValueByRange(fireworkSpeed);\n const size = getValueByRange(fireworkSize);\n fireworks.push(\n createFirework(\n x,\n y,\n targetY,\n fireworkColor,\n speed,\n size,\n particleSpeed,\n particleSize,\n handleExplosion,\n ),\n );\n };\n\n container.addEventListener(\"click\", handleClick);\n\n return () => {\n window.removeEventListener(\"resize\", setCanvasSize);\n container.removeEventListener(\"click\", handleClick);\n cancelAnimationFrame(animationFrameId);\n };\n }, [\n population,\n color,\n fireworkSpeed,\n fireworkSize,\n particleSpeed,\n particleSize,\n ]);\n\n return (\n <div\n ref={containerRef}\n className={cn(\"relative size-full overflow-hidden\", className)}\n {...props}\n >\n <canvas\n {...canvasProps}\n ref={canvasRef}\n className={cn(\"absolute inset-0 size-full\", canvasProps?.className)}\n />\n </div>\n );\n },\n);\n\nFireworksBackground.displayName = \"FireworksBackground\";\n\nexport { FireworksBackground, type FireworksBackgroundProps };\n"],"names":["rand","min","max","Math","randInt","randColor","createParticle","x","y","color","speed","direction","gravity","friction","size","vx","vy","alpha","decay","ctx","createFirework","targetY","particleSpeed","particleSize","onExplode","angle","trail","trailLength","numParticles","particles","i","particleAngle","localParticleSpeed","getValueByRange","localParticleSize","point","range","getColor","Array","FireworksBackground","React","className","canvasProps","population","fireworkSpeed","fireworkSize","props","ref","canvasRef","containerRef","canvas","container","maxX","window","ratio","maxY","setCanvasSize","explosions","fireworks","handleExplosion","launchFirework","fireworkColor","timeout","setTimeout","animationFrameId","animate","firework","particle","requestAnimationFrame","handleClick","event","cancelAnimationFrame","cn"],"mappings":";;;;AAMA,MAAMA,OAAO,CAACC,KAAaC,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f,KAAKM;YACL,WAAWwB,GAAG,8BAA8B9B,aAAa;;;AAIjE;AAGFH,oBAAoB,WAAW,GAAG"}
1
+ {"version":3,"file":"components\\ui\\fireworks-background.js","sources":["webpack://@arolariu/components/./src/components/ui/fireworks-background.tsx"],"sourcesContent":["\r\n\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst rand = (min: number, max: number): number => Math.random() * (max - min) + min;\r\nconst randInt = (min: number, max: number): number => Math.floor(Math.random() * (max - min) + min);\r\nconst randColor = (): string => `hsl(${randInt(0, 360)}, 100%, 50%)`;\r\n\r\ninterface ParticleType {\r\n x: number;\r\n y: number;\r\n color: string;\r\n speed: number;\r\n direction: number;\r\n vx: number;\r\n vy: number;\r\n gravity: number;\r\n friction: number;\r\n alpha: number;\r\n decay: number;\r\n size: number;\r\n update: () => void;\r\n draw: (ctx: CanvasRenderingContext2D) => void;\r\n isAlive: () => boolean;\r\n}\r\n\r\nconst createParticle = (\r\n x: number,\r\n y: number,\r\n color: string,\r\n speed: number,\r\n direction: number,\r\n gravity: number,\r\n friction: number,\r\n size: number,\r\n): ParticleType => {\r\n const vx = Math.cos(direction) * speed;\r\n const vy = Math.sin(direction) * speed;\r\n const alpha = 1;\r\n const decay = rand(0.005, 0.02);\r\n\r\n return {\r\n x,\r\n y,\r\n color,\r\n speed,\r\n direction,\r\n vx,\r\n vy,\r\n gravity,\r\n friction,\r\n alpha,\r\n decay,\r\n size,\r\n update() {\r\n this.vx *= this.friction;\r\n this.vy *= this.friction;\r\n this.vy += this.gravity;\r\n this.x += this.vx;\r\n this.y += this.vy;\r\n this.alpha -= this.decay;\r\n },\r\n draw(ctx: CanvasRenderingContext2D) {\r\n ctx.save();\r\n ctx.globalAlpha = this.alpha;\r\n ctx.beginPath();\r\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\r\n ctx.fillStyle = this.color;\r\n ctx.fill();\r\n ctx.restore();\r\n },\r\n isAlive() {\r\n return this.alpha > 0;\r\n },\r\n };\r\n};\r\n\r\ninterface FireworkType {\r\n x: number;\r\n y: number;\r\n targetY: number;\r\n color: string;\r\n speed: number;\r\n size: number;\r\n angle: number;\r\n vx: number;\r\n vy: number;\r\n trail: {x: number; y: number}[];\r\n trailLength: number;\r\n exploded: boolean;\r\n update: () => boolean;\r\n explode: () => void;\r\n draw: (ctx: CanvasRenderingContext2D) => void;\r\n}\r\n\r\nconst createFirework = (\r\n x: number,\r\n y: number,\r\n targetY: number,\r\n color: string,\r\n speed: number,\r\n size: number,\r\n particleSpeed: {min: number; max: number} | number,\r\n particleSize: {min: number; max: number} | number,\r\n onExplode: (particles: ParticleType[]) => void,\r\n): FireworkType => {\r\n const angle = -Math.PI / 2 + rand(-0.3, 0.3);\r\n const vx = Math.cos(angle) * speed;\r\n const vy = Math.sin(angle) * speed;\r\n const trail: {x: number; y: number}[] = [];\r\n const trailLength = randInt(10, 25);\r\n\r\n return {\r\n x,\r\n y,\r\n targetY,\r\n color,\r\n speed,\r\n size,\r\n angle,\r\n vx,\r\n vy,\r\n trail,\r\n trailLength,\r\n exploded: false,\r\n update() {\r\n this.trail.push({x: this.x, y: this.y});\r\n if (this.trail.length > this.trailLength) {\r\n this.trail.shift();\r\n }\r\n this.x += this.vx;\r\n this.y += this.vy;\r\n this.vy += 0.02;\r\n if (this.vy >= 0 || this.y <= this.targetY) {\r\n this.explode();\r\n return false;\r\n }\r\n return true;\r\n },\r\n explode() {\r\n const numParticles = randInt(50, 150);\r\n const particles: ParticleType[] = [];\r\n for (let i = 0; i < numParticles; i++) {\r\n const particleAngle = rand(0, Math.PI * 2);\r\n const localParticleSpeed = getValueByRange(particleSpeed);\r\n const localParticleSize = getValueByRange(particleSize);\r\n particles.push(createParticle(this.x, this.y, this.color, localParticleSpeed, particleAngle, 0.05, 0.98, localParticleSize));\r\n }\r\n onExplode(particles);\r\n },\r\n draw(ctx: CanvasRenderingContext2D) {\r\n ctx.save();\r\n ctx.beginPath();\r\n if (this.trail.length > 1) {\r\n ctx.moveTo(this.trail[0].x, this.trail[0].y);\r\n for (const point of this.trail) {\r\n ctx.lineTo(point.x, point.y);\r\n }\r\n } else {\r\n ctx.moveTo(this.x, this.y);\r\n ctx.lineTo(this.x, this.y);\r\n }\r\n ctx.strokeStyle = this.color;\r\n ctx.lineWidth = this.size;\r\n ctx.lineCap = \"round\";\r\n ctx.stroke();\r\n ctx.restore();\r\n },\r\n };\r\n};\r\n\r\nconst getValueByRange = (range: {min: number; max: number} | number): number => {\r\n if (typeof range === \"number\") {\r\n return range;\r\n }\r\n return rand(range.min, range.max);\r\n};\r\n\r\nconst getColor = (color: string | string[] | undefined): string => {\r\n if (Array.isArray(color)) {\r\n return color[randInt(0, color.length)];\r\n }\r\n return color ?? randColor();\r\n};\r\n\r\ninterface FireworksBackgroundProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"color\"> {\r\n canvasProps?: React.HTMLAttributes<HTMLCanvasElement>;\r\n population?: number;\r\n color?: string | string[];\r\n fireworkSpeed?: {min: number; max: number} | number;\r\n fireworkSize?: {min: number; max: number} | number;\r\n particleSpeed?: {min: number; max: number} | number;\r\n particleSize?: {min: number; max: number} | number;\r\n}\r\n\r\nconst FireworksBackground = React.forwardRef<HTMLDivElement, FireworksBackgroundProps>(\r\n (\r\n {\r\n className,\r\n canvasProps,\r\n population = 1,\r\n color,\r\n fireworkSpeed = {min: 4, max: 8},\r\n fireworkSize = {min: 2, max: 5},\r\n particleSpeed = {min: 2, max: 7},\r\n particleSize = {min: 1, max: 5},\r\n ...props\r\n },\r\n ref,\r\n ) => {\r\n const canvasRef = React.useRef<HTMLCanvasElement>(null);\r\n const containerRef = React.useRef<HTMLDivElement>(null);\r\n React.useImperativeHandle(ref, () => containerRef.current as HTMLDivElement);\r\n\r\n React.useEffect(() => {\r\n const canvas = canvasRef.current;\r\n const container = containerRef.current;\r\n if (!canvas || !container) return;\r\n const ctx = canvas.getContext(\"2d\");\r\n if (!ctx) return;\r\n\r\n let maxX = window.innerWidth;\r\n let ratio = container.offsetHeight / container.offsetWidth;\r\n let maxY = maxX * ratio;\r\n canvas.width = maxX;\r\n canvas.height = maxY;\r\n\r\n const setCanvasSize = () => {\r\n maxX = window.innerWidth;\r\n ratio = container.offsetHeight / container.offsetWidth;\r\n maxY = maxX * ratio;\r\n canvas.width = maxX;\r\n canvas.height = maxY;\r\n };\r\n window.addEventListener(\"resize\", setCanvasSize);\r\n\r\n const explosions: ParticleType[] = [];\r\n const fireworks: FireworkType[] = [];\r\n\r\n const handleExplosion = (particles: ParticleType[]) => {\r\n explosions.push(...particles);\r\n };\r\n\r\n const launchFirework = () => {\r\n const x = rand(maxX * 0.1, maxX * 0.9);\r\n const y = maxY;\r\n const targetY = rand(maxY * 0.1, maxY * 0.4);\r\n const fireworkColor = getColor(color);\r\n const speed = getValueByRange(fireworkSpeed);\r\n const size = getValueByRange(fireworkSize);\r\n fireworks.push(createFirework(x, y, targetY, fireworkColor, speed, size, particleSpeed, particleSize, handleExplosion));\r\n const timeout = rand(300, 800) / population;\r\n setTimeout(launchFirework, timeout);\r\n };\r\n\r\n launchFirework();\r\n\r\n // eslint-disable-next-line init-declarations -- firework animation id\r\n let animationFrameId: number;\r\n const animate = () => {\r\n ctx.clearRect(0, 0, maxX, maxY);\r\n\r\n for (let i = fireworks.length - 1; i >= 0; i--) {\r\n const firework = fireworks[i];\r\n if (firework.update()) {\r\n firework.draw(ctx);\r\n } else {\r\n fireworks.splice(i, 1);\r\n }\r\n }\r\n\r\n for (let i = explosions.length - 1; i >= 0; i--) {\r\n const particle = explosions[i];\r\n particle.update();\r\n if (particle.isAlive()) {\r\n particle.draw(ctx);\r\n } else {\r\n explosions.splice(i, 1);\r\n }\r\n }\r\n\r\n animationFrameId = requestAnimationFrame(animate);\r\n };\r\n\r\n animate();\r\n\r\n const handleClick = (event: MouseEvent) => {\r\n const x = event.clientX;\r\n const y = maxY;\r\n const targetY = event.clientY;\r\n const fireworkColor = getColor(color);\r\n const speed = getValueByRange(fireworkSpeed);\r\n const size = getValueByRange(fireworkSize);\r\n fireworks.push(createFirework(x, y, targetY, fireworkColor, speed, size, particleSpeed, particleSize, handleExplosion));\r\n };\r\n\r\n container.addEventListener(\"click\", handleClick);\r\n\r\n return () => {\r\n window.removeEventListener(\"resize\", setCanvasSize);\r\n container.removeEventListener(\"click\", handleClick);\r\n cancelAnimationFrame(animationFrameId);\r\n };\r\n }, [population, color, fireworkSpeed, fireworkSize, particleSpeed, particleSize]);\r\n\r\n return (\r\n <div\r\n ref={containerRef}\r\n className={cn(\"relative size-full overflow-hidden\", className)}\r\n {...props}>\r\n <canvas\r\n {...canvasProps}\r\n ref={canvasRef}\r\n className={cn(\"absolute inset-0 size-full\", canvasProps?.className)}\r\n />\r\n </div>\r\n );\r\n },\r\n);\r\n\r\nFireworksBackground.displayName = \"FireworksBackground\";\r\n\r\nexport {FireworksBackground, type FireworksBackgroundProps};\r\n"],"names":["rand","min","max","Math","randInt","randColor","createParticle","x","y","color","speed","direction","gravity","friction","size","vx","vy","alpha","decay","ctx","createFirework","targetY","particleSpeed","particleSize","onExplode","angle","trail","trailLength","numParticles","particles","i","particleAngle","localParticleSpeed","getValueByRange","localParticleSize","point","range","getColor","Array","FireworksBackground","React","className","canvasProps","population","fireworkSpeed","fireworkSize","props","ref","canvasRef","containerRef","canvas","container","maxX","window","ratio","maxY","setCanvasSize","explosions","fireworks","handleExplosion","launchFirework","fireworkColor","timeout","setTimeout","animationFrameId","animate","firework","particle","requestAnimationFrame","handleClick","event","cancelAnimationFrame","cn"],"mappings":";;;;AAMA,MAAMA,OAAO,CAACC,KAAaC,MAAwBC,KAAK,MAAM,KAAMD,CAAAA,MAAMD,GAAE,IAAKA;AACjF,MAAMG,UAAU,CAACH,KAAaC,MAAwBC,KAAK,KAAK,CAACA,KAAK,MAAM,KAAMD,CAAAA,MAAMD,GAAE,IAAKA;AAC/F,MAAMI,YAAY,IAAc,CAAC,IAAI,EAAED,QAAQ,GAAG,KAAK,YAAY,CAAC;AA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,EAAE;gBAC7B,IAAIoC,SAAS,MAAM,IACjBA,SAAS,IAAI,CAAC/C;qBAEduC,UAAU,MAAM,CAAC5B,GAAG;YAExB;YAEA,IAAK,IAAIA,IAAI2B,WAAW,MAAM,GAAG,GAAG3B,KAAK,GAAGA,IAAK;gBAC/C,MAAMqC,WAAWV,UAAU,CAAC3B,EAAE;gBAC9BqC,SAAS,MAAM;gBACf,IAAIA,SAAS,OAAO,IAClBA,SAAS,IAAI,CAAChD;qBAEdsC,WAAW,MAAM,CAAC3B,GAAG;YAEzB;YAEAkC,mBAAmBI,sBAAsBH;QAC3C;QAEAA;QAEA,MAAMI,cAAc,CAACC;YACnB,MAAM/D,IAAI+D,MAAM,OAAO;YACvB,MAAM9D,IAAI+C;YACV,MAAMlC,UAAUiD,MAAM,OAAO;YAC7B,MAAMT,gBAAgBxB,SAAS5B;YAC/B,MAAMC,QAAQuB,gBAAgBW;YAC9B,MAAM9B,OAAOmB,gBAAgBY;YAC7Ba,UAAU,IAAI,CAACtC,eAAeb,GAAGC,GAAGa,SAASwC,eAAenD,OAAOI,MAAMQ,eAAeC,cAAcoC;QACxG;QAEAR,UAAU,gBAAgB,CAAC,SAASkB;QAEpC,OAAO;YACLhB,OAAO,mBAAmB,CAAC,UAAUG;YACrCL,UAAU,mBAAmB,CAAC,SAASkB;YACvCE,qBAAqBP;QACvB;IACF,GAAG;QAACrB;QAAYlC;QAAOmC;QAAeC;QAAcvB;QAAeC;KAAa;IAEhF,OAAO,WAAP,GACE,IAAC;QACC,KAAK0B;QACL,WAAWuB,GAAG,sCAAsC/B;QACnD,GAAGK,KAAK;kBACT,kBAAC;YACE,GAAGJ,WAAW;YACf,KAAKM;YACL,WAAWwB,GAAG,8BAA8B9B,aAAa;;;AAIjE;AAGFH,oBAAoB,WAAW,GAAG"}
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
1
  import { type HTMLMotionProps, type Transition } from "motion/react";
2
+ import * as React from "react";
3
3
  type FlipDirection = "top" | "bottom" | "left" | "righ";
4
4
  interface FlipButtonProps extends HTMLMotionProps<"button"> {
5
5
  frontText: string;
@@ -1 +1 @@
1
- {"version":3,"file":"flip-button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/flip-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AAItB,KAAK,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD,UAAU,eAAgB,SAAQ,eAAe,CAAC,QAAQ,CAAC;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAKD,QAAA,MAAM,UAAU,wGA+Ef,CAAC;AAIF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"flip-button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/flip-button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,eAAe,EAAE,KAAK,UAAU,EAAuB,MAAM,cAAc,CAAC;AACzF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD,UAAU,eAAgB,SAAQ,eAAe,CAAC,QAAQ,CAAC;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAID,QAAA,MAAM,UAAU,wGAgEf,CAAC;AAIF,OAAO,EAAC,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { forwardRef } from "react";
4
3
  import { motion } from "motion/react";
5
- import { cn } from "../../lib/utils.js";
4
+ import { forwardRef } from "react";
5
+ import { cn } from "../../lib/utilities.js";
6
6
  const defaultSpanClassName = "absolute inset-0 flex items-center justify-center rounded-lg";
7
7
  const FlipButton = /*#__PURE__*/ forwardRef(({ frontText, backText, transition = {
8
8
  type: "spring",
@@ -38,7 +38,7 @@ const FlipButton = /*#__PURE__*/ forwardRef(({ frontText, backText, transition =
38
38
  whileTap: {
39
39
  scale: 0.95
40
40
  },
41
- className: cn("relative inline-block h-10 px-4 py-2 text-sm font-medium cursor-pointer perspective-[1000px] focus:outline-none", className),
41
+ className: cn("relative inline-block h-10 cursor-pointer px-4 py-2 text-sm font-medium perspective-[1000px] focus:outline-none", className),
42
42
  ...props,
43
43
  children: [
44
44
  /*#__PURE__*/ jsx(motion.span, {
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\flip-button.js","sources":["webpack://@arolariu/components/./src/components/ui/flip-button.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport {\n type HTMLMotionProps,\n type Transition,\n type Variant,\n motion,\n} from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ntype FlipDirection = \"top\" | \"bottom\" | \"left\" | \"righ\";\n\ninterface FlipButtonProps extends HTMLMotionProps<\"button\"> {\n frontText: string;\n backText: string;\n transition?: Transition;\n frontClassName?: string;\n backClassName?: string;\n from?: FlipDirection;\n}\n\nconst defaultSpanClassName =\n \"absolute inset-0 flex items-center justify-center rounded-lg\";\n\nconst FlipButton = React.forwardRef<HTMLButtonElement, FlipButtonProps>(\n (\n {\n frontText,\n backText,\n transition = { type: \"spring\", stiffness: 280, damping: 20 },\n className,\n frontClassName,\n backClassName,\n from = \"top\",\n ...props\n },\n ref,\n ) => {\n const isVertical = from === \"top\" || from === \"bottom\";\n const rotateAxis = isVertical ? \"rotateX\" : \"rotateY\";\n\n const frontOffset = from === \"top\" || from === \"left\" ? \"50%\" : \"-50%\";\n const backOffset = from === \"top\" || from === \"left\" ? \"-50%\" : \"50%\";\n\n const buildVariant = (\n opacity: number,\n rotation: number,\n offset: string | null = null,\n ): Variant => ({\n opacity,\n [rotateAxis]: rotation,\n ...(isVertical && offset !== null ? { y: offset } : {}),\n ...(!isVertical && offset !== null ? { x: offset } : {}),\n });\n\n const frontVariants = {\n initial: buildVariant(1, 0, \"0%\"),\n hover: buildVariant(0, 90, frontOffset),\n };\n\n const backVariants = {\n initial: buildVariant(0, 90, backOffset),\n hover: buildVariant(1, 0, \"0%\"),\n };\n\n return (\n <motion.button\n ref={ref}\n initial=\"initial\"\n whileHover=\"hover\"\n whileTap={{ scale: 0.95 }}\n className={cn(\n \"relative inline-block h-10 px-4 py-2 text-sm font-medium cursor-pointer perspective-[1000px] focus:outline-none\",\n className,\n )}\n {...props}\n >\n <motion.span\n variants={frontVariants}\n transition={transition}\n className={cn(\n defaultSpanClassName,\n \"bg-muted text-black dark:text-white\",\n frontClassName,\n )}\n >\n {frontText}\n </motion.span>\n <motion.span\n variants={backVariants}\n transition={transition}\n className={cn(\n defaultSpanClassName,\n \"bg-primary text-primary-foreground\",\n backClassName,\n )}\n >\n {backText}\n </motion.span>\n <span className=\"invisible\">{frontText}</span>\n </motion.button>\n );\n },\n);\n\nFlipButton.displayName = \"FlipButton\";\n\nexport { FlipButton, type FlipButtonProps, type FlipDirection };\n"],"names":["defaultSpanClassName","FlipButton","React","frontText","backText","transition","className","frontClassName","backClassName","from","props","ref","isVertical","rotateAxis","frontOffset","backOffset","buildVariant","opacity","rotation","offset","frontVariants","backVariants","motion","cn"],"mappings":";;;;;AAuBA,MAAMA,uBACJ;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F,WAAW,WAAW,GAAG"}
1
+ {"version":3,"file":"components\\ui\\flip-button.js","sources":["webpack://@arolariu/components/./src/components/ui/flip-button.tsx"],"sourcesContent":["\r\n\r\nimport {type HTMLMotionProps, type Transition, type Variant, motion} from \"motion/react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\ntype FlipDirection = \"top\" | \"bottom\" | \"left\" | \"righ\";\r\n\r\ninterface FlipButtonProps extends HTMLMotionProps<\"button\"> {\r\n frontText: string;\r\n backText: string;\r\n transition?: Transition;\r\n frontClassName?: string;\r\n backClassName?: string;\r\n from?: FlipDirection;\r\n}\r\n\r\nconst defaultSpanClassName = \"absolute inset-0 flex items-center justify-center rounded-lg\";\r\n\r\nconst FlipButton = React.forwardRef<HTMLButtonElement, FlipButtonProps>(\r\n (\r\n {\r\n frontText,\r\n backText,\r\n transition = {type: \"spring\", stiffness: 280, damping: 20},\r\n className,\r\n frontClassName,\r\n backClassName,\r\n from = \"top\",\r\n ...props\r\n },\r\n ref,\r\n ) => {\r\n const isVertical = from === \"top\" || from === \"bottom\";\r\n const rotateAxis = isVertical ? \"rotateX\" : \"rotateY\";\r\n\r\n const frontOffset = from === \"top\" || from === \"left\" ? \"50%\" : \"-50%\";\r\n const backOffset = from === \"top\" || from === \"left\" ? \"-50%\" : \"50%\";\r\n\r\n const buildVariant = (opacity: number, rotation: number, offset: string | null = null): Variant => ({\r\n opacity,\r\n [rotateAxis]: rotation,\r\n ...(isVertical && offset !== null ? {y: offset} : {}),\r\n ...(!isVertical && offset !== null ? {x: offset} : {}),\r\n });\r\n\r\n const frontVariants = {\r\n initial: buildVariant(1, 0, \"0%\"),\r\n hover: buildVariant(0, 90, frontOffset),\r\n };\r\n\r\n const backVariants = {\r\n initial: buildVariant(0, 90, backOffset),\r\n hover: buildVariant(1, 0, \"0%\"),\r\n };\r\n\r\n return (\r\n <motion.button\r\n ref={ref}\r\n initial='initial'\r\n whileHover='hover'\r\n whileTap={{scale: 0.95}}\r\n className={cn(\r\n \"relative inline-block h-10 cursor-pointer px-4 py-2 text-sm font-medium perspective-[1000px] focus:outline-none\",\r\n className,\r\n )}\r\n {...props}>\r\n <motion.span\r\n variants={frontVariants}\r\n transition={transition}\r\n className={cn(defaultSpanClassName, \"bg-muted text-black dark:text-white\", frontClassName)}>\r\n {frontText}\r\n </motion.span>\r\n <motion.span\r\n variants={backVariants}\r\n transition={transition}\r\n className={cn(defaultSpanClassName, \"bg-primary text-primary-foreground\", backClassName)}>\r\n {backText}\r\n </motion.span>\r\n <span className='invisible'>{frontText}</span>\r\n </motion.button>\r\n );\r\n },\r\n);\r\n\r\nFlipButton.displayName = \"FlipButton\";\r\n\r\nexport {FlipButton, type FlipButtonProps, type FlipDirection};\r\n"],"names":["defaultSpanClassName","FlipButton","React","frontText","backText","transition","className","frontClassName","backClassName","from","props","ref","isVertical","rotateAxis","frontOffset","backOffset","buildVariant","opacity","rotation","offset","frontVariants","backVariants","motion","cn"],"mappings":";;;;;AAkBA,MAAMA,uBAAuB;AAE7B,MAAMC,aAAa,WAAbA,GAAaC,WACjB,CACE,EACEC,SAAS,EACTC,QAAQ,EACRC,aAAa;IAAC,MAAM;IAAU,WAAW;IAAK,SAAS;AAAE,CAAC,EAC1DC,SAAS,EACTC,cAAc,EACdC,aAAa,EACbC,OAAO,KAAK,EACZ,GAAGC,OACJ,EACDC;IAEA,MAAMC,aAAaH,UAAAA,QAAkBA,aAAAA;IACrC,MAAMI,aAAaD,aAAa,YAAY;IAE5C,MAAME,cAAcL,UAAAA,QAAkBA,WAAAA,OAAkB,QAAQ;IAChE,MAAMM,aAAaN,UAAAA,QAAkBA,WAAAA,OAAkB,SAAS;IAEhE,MAAMO,eAAe,CAACC,SAAiBC,UAAkBC,SAAwB,IAAI,GAAe;YAClGF;YACA,CAACJ,WAAW,EAAEK;YACd,GAAIN,cAAcO,SAAAA,SAAkB;gBAAC,GAAGA;YAAM,IAAI,CAAC,CAAC;YACpD,GAAI,CAACP,cAAcO,SAAAA,SAAkB;gBAAC,GAAGA;YAAM,IAAI,CAAC,CAAC;QACvD;IAEA,MAAMC,gBAAgB;QACpB,SAASJ,aAAa,GAAG,GAAG;QAC5B,OAAOA,aAAa,GAAG,IAAIF;IAC7B;IAEA,MAAMO,eAAe;QACnB,SAASL,aAAa,GAAG,IAAID;QAC7B,OAAOC,aAAa,GAAG,GAAG;IAC5B;IAEA,OAAO,WAAP,GACE,KAACM,OAAO,MAAM;QACZ,KAAKX;QACL,SAAQ;QACR,YAAW;QACX,UAAU;YAAC,OAAO;QAAI;QACtB,WAAWY,GACT,mHACAjB;QAED,GAAGI,KAAK;;0BACT,IAACY,OAAO,IAAI;gBACV,UAAUF;gBACV,YAAYf;gBACZ,WAAWkB,GAAGvB,sBAAsB,uCAAuCO;0BAC1EJ;;0BAEH,IAACmB,OAAO,IAAI;gBACV,UAAUD;gBACV,YAAYhB;gBACZ,WAAWkB,GAAGvB,sBAAsB,sCAAsCQ;0BACzEJ;;0BAEH,IAAC;gBAAK,WAAU;0BAAaD;;;;AAGnC;AAGFF,WAAW,WAAW,GAAG"}
@@ -1,6 +1,6 @@
1
- import * as React from "react";
2
1
  import * as LabelPrimitive from "@radix-ui/react-label";
3
2
  import { Slot } from "@radix-ui/react-slot";
3
+ import * as React from "react";
4
4
  import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
5
5
  declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
6
6
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
@@ -20,6 +20,6 @@ declare function FormItem({ className, ...props }: React.ComponentProps<"div">):
20
20
  declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
21
21
  declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): import("react/jsx-runtime").JSX.Element;
22
22
  declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
23
- declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element | null;
24
- export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
23
+ declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
24
+ export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
25
25
  //# sourceMappingURL=form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/components/ui/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAKzB,QAAA,MAAM,IAAI,4MAAe,CAAC;AAa1B,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEC,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMtC,CAAC;AAEF,QAAA,MAAM,YAAY;;;;;;;;;;;CAqBjB,CAAC;AAUF,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAYrE;AAED,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,C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EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,2CAYzF;AAED,iBAAS,WAAW,CAAC,EAAC,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,2CAYjE;AAED,iBAAS,eAAe,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAWxE;AAED,iBAAS,WAAW,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAiBpE;AAED,OAAO,EAAC,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAC,CAAC"}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { createContext, useContext, useId } from "react";
4
3
  import { Slot } from "@radix-ui/react-slot";
4
+ import { createContext, useContext, useId } from "react";
5
5
  import { Controller, FormProvider, useFormContext, useFormState } from "react-hook-form";
6
- import { cn } from "../../lib/utils.js";
7
6
  import { Label } from "./label.js";
7
+ import { cn } from "../../lib/utilities.js";
8
8
  const Form = FormProvider;
9
9
  const FormFieldContext = /*#__PURE__*/ createContext({});
10
10
  const FormField = ({ ...props })=>/*#__PURE__*/ jsx(FormFieldContext.Provider, {
@@ -73,7 +73,7 @@ function FormDescription({ className, ...props }) {
73
73
  return /*#__PURE__*/ jsx("p", {
74
74
  "data-slot": "form-description",
75
75
  id: formDescriptionId,
76
- className: cn("text-neutral-500 text-sm dark:text-neutral-400", className),
76
+ className: cn("text-sm text-neutral-500 dark:text-neutral-400", className),
77
77
  ...props
78
78
  });
79
79
  }
@@ -84,7 +84,7 @@ function FormMessage({ className, ...props }) {
84
84
  return /*#__PURE__*/ jsx("p", {
85
85
  "data-slot": "form-message",
86
86
  id: formMessageId,
87
- className: cn("text-red-500 text-sm dark:text-red-900", className),
87
+ className: cn("text-sm text-red-500 dark:text-red-900", className),
88
88
  ...props,
89
89
  children: body
90
90
  });
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\form.js","sources":["webpack://@arolariu/components/./src/components/ui/form.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n Controller,\n FormProvider,\n useFormContext,\n useFormState,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Label } from \"@/components/ui/label\";\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue,\n);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue,\n);\n\nfunction FormItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div\n data-slot=\"form-item\"\n className={cn(\"grid gap-2\", className)}\n {...props}\n />\n </FormItemContext.Provider>\n );\n}\n\nfunction FormLabel({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(\n \"data-[error=true]:text-red-500 dark:data-[error=true]:text-red-900\",\n className,\n )}\n htmlFor={formItemId}\n {...props}\n />\n );\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n\n return (\n <Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n data-slot=\"form-description\"\n id={formDescriptionId}\n className={cn(\n \"text-neutral-500 text-sm dark:text-neutral-400\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<\"p\">) {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? \"\") : props.children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n data-slot=\"form-message\"\n id={formMessageId}\n className={cn(\"text-red-500 text-sm dark:text-red-900\", className)}\n {...props}\n >\n {body}\n </p>\n );\n}\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n};\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","useFormContext","formState","useFormState","fieldState","Error","id","FormItem","className","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessage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F;QACd,WAAWF,GACT,sEACAD;QAEF,SAASI;QACR,GAAGlB,KAAK;;AAGf;AAEA,SAASoB,YAAY,EAAE,GAAGpB,OAA0C;IAClE,MAAM,EAAEiB,KAAK,EAAEC,UAAU,EAAEG,iBAAiB,EAAEC,aAAa,EAAE,GAC3DpB;IAEF,OAAO,WAAP,GACE,IAACqB,MAAIA;QACH,aAAU;QACV,IAAIL;QACJ,oBACE,QAEI,GAAGG,kBAAkB,CAAC,EAAEC,eAAe,GADvC,GAAGD,mBAAmB;QAG5B,gBAAc,CAAC,CAACJ;QACf,GAAGjB,KAAK;;AAGf;AAEA,SAASwB,gBAAgB,EAAEV,SAAS,EAAE,GAAGd,OAAkC;IACzE,MAAM,EAAEqB,iBAAiB,EAAE,GAAGnB;IAE9B,OAAO,WAAP,GACE,IAAC;QACC,aAAU;QACV,IAAImB;QACJ,WAAWN,GACT,kDACAD;QAED,GAAGd,KAAK;;AAGf;AAEA,SAASyB,YAAY,EAAEX,SAAS,EAAE,GAAGd,OAAkC;IACrE,MAAM,EAAEiB,KAAK,EAAEK,aAAa,EAAE,GAAGpB;IACjC,MAAMwB,OAAOT,QAAQU,OAAOV,OAAO,WAAW,MAAMjB,MAAM,QAAQ;IAElE,IAAI,CAAC0B,MACH,OAAO;IAGT,OAAO,WAAP,GACE,IAAC;QACC,aAAU;QACV,IAAIJ;QACJ,WAAWP,GAAG,0CAA0CD;QACvD,GAAGd,KAAK;kBAER0B;;AAGP"}
1
+ {"version":3,"file":"components\\ui\\form.js","sources":["webpack://@arolariu/components/./src/components/ui/form.tsx"],"sourcesContent":["\r\n\r\n/* eslint-disable */\r\n\r\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\r\nimport {Slot} from \"@radix-ui/react-slot\";\r\nimport * as React from \"react\";\r\nimport {\r\n Controller,\r\n FormProvider,\r\n useFormContext,\r\n useFormState,\r\n type ControllerProps,\r\n type FieldPath,\r\n type FieldValues,\r\n} from \"react-hook-form\";\r\n\r\nimport {Label} from \"@/components/ui/label\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst Form = FormProvider;\r\n\r\ntype FormFieldContextValue<\r\n TFieldValues extends FieldValues = FieldValues,\r\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\r\n> = {\r\n name: TName;\r\n};\r\n\r\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\r\n\r\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\r\n ...props\r\n}: ControllerProps<TFieldValues, TName>) => {\r\n return (\r\n <FormFieldContext.Provider value={{name: props.name}}>\r\n <Controller {...props} />\r\n </FormFieldContext.Provider>\r\n );\r\n};\r\n\r\nconst useFormField = () => {\r\n const fieldContext = React.useContext(FormFieldContext);\r\n const itemContext = React.useContext(FormItemContext);\r\n const {getFieldState} = useFormContext();\r\n const formState = useFormState({name: fieldContext.name});\r\n const fieldState = getFieldState(fieldContext.name, formState);\r\n\r\n if (!fieldContext) {\r\n throw new Error(\"useFormField should be used within <FormField>\");\r\n }\r\n\r\n const {id} = itemContext;\r\n\r\n return {\r\n id,\r\n name: fieldContext.name,\r\n formItemId: `${id}-form-item`,\r\n formDescriptionId: `${id}-form-item-description`,\r\n formMessageId: `${id}-form-item-message`,\r\n ...fieldState,\r\n };\r\n};\r\n\r\ntype FormItemContextValue = {\r\n id: string;\r\n};\r\n\r\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\r\n\r\nfunction FormItem({className, ...props}: React.ComponentProps<\"div\">) {\r\n const id = React.useId();\r\n\r\n return (\r\n <FormItemContext.Provider value={{id}}>\r\n <div\r\n data-slot='form-item'\r\n className={cn(\"grid gap-2\", className)}\r\n {...props}\r\n />\r\n </FormItemContext.Provider>\r\n );\r\n}\r\n\r\nfunction FormLabel({className, ...props}: React.ComponentProps<typeof LabelPrimitive.Root>) {\r\n const {error, formItemId} = useFormField();\r\n\r\n return (\r\n <Label\r\n data-slot='form-label'\r\n data-error={!!error}\r\n className={cn(\"data-[error=true]:text-red-500 dark:data-[error=true]:text-red-900\", className)}\r\n htmlFor={formItemId}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction FormControl({...props}: React.ComponentProps<typeof Slot>) {\r\n const {error, formItemId, formDescriptionId, formMessageId} = useFormField();\r\n\r\n return (\r\n <Slot\r\n data-slot='form-control'\r\n id={formItemId}\r\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\r\n aria-invalid={!!error}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction FormDescription({className, ...props}: React.ComponentProps<\"p\">) {\r\n const {formDescriptionId} = useFormField();\r\n\r\n return (\r\n <p\r\n data-slot='form-description'\r\n id={formDescriptionId}\r\n className={cn(\"text-sm text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction FormMessage({className, ...props}: React.ComponentProps<\"p\">) {\r\n const {error, formMessageId} = useFormField();\r\n const body = error ? String(error?.message ?? \"\") : props.children;\r\n\r\n if (!body) {\r\n return null;\r\n }\r\n\r\n return (\r\n <p\r\n data-slot='form-message'\r\n id={formMessageId}\r\n className={cn(\"text-sm text-red-500 dark:text-red-900\", className)}\r\n {...props}>\r\n {body}\r\n </p>\r\n );\r\n}\r\n\r\nexport {Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField};\r\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","useFormContext","formState","useFormState","fieldState","Error","id","FormItem","className","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","body","String"],"mappings":";;;;;;;AAoBA,MAAMA,OAAOC;AASb,MAAMC,mBAAmB,WAAnBA,GAAmBC,cAA2C,CAAC;AAErE,MAAMC,YAAY,CAAkH,EAClI,GAAGC,OACkC,GAC9B,WAAP,GACE,I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GAAGpB;IAE9D,OAAO,WAAP,GACE,IAACqB,MAAIA;QACH,aAAU;QACV,IAAIL;QACJ,oBAAkB,QAAkC,GAAGG,kBAAkB,CAAC,EAAEC,eAAe,GAAhE,GAAGD,mBAAmB;QACjD,gBAAc,CAAC,CAACJ;QACf,GAAGjB,KAAK;;AAGf;AAEA,SAASwB,gBAAgB,EAACV,SAAS,EAAE,GAAGd,OAAiC;IACvE,MAAM,EAACqB,iBAAiB,EAAC,GAAGnB;IAE5B,OAAO,WAAP,GACE,IAAC;QACC,aAAU;QACV,IAAImB;QACJ,WAAWN,GAAG,kDAAkDD;QAC/D,GAAGd,KAAK;;AAGf;AAEA,SAASyB,YAAY,EAACX,SAAS,EAAE,GAAGd,OAAiC;IACnE,MAAM,EAACiB,KAAK,EAAEK,aAAa,EAAC,GAAGpB;IAC/B,MAAMwB,OAAOT,QAAQU,OAAOV,OAAO,WAAW,MAAMjB,MAAM,QAAQ;IAElE,IAAI,CAAC0B,MACH,OAAO;IAGT,OAAO,WAAP,GACE,IAAC;QACC,aAAU;QACV,IAAIJ;QACJ,WAAWP,GAAG,0CAA0CD;QACvD,GAAGd,KAAK;kBACR0B;;AAGP"}
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
1
  import { HTMLMotionProps, type Transition } from "motion/react";
2
+ import * as React from "react";
3
3
  interface GradientBackgroundProps extends HTMLMotionProps<"div"> {
4
4
  transition?: Transition;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gradient-background.d.ts","sourceRoot":"","sources":["../../../src/components/ui/gradient-background.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAU,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAIxE,UAAU,uBAAwB,SAAQ,eAAe,CAAC,KAAK,CAAC;IAC9D,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,QAAA,MAAM,kBAAkB,6GA2BvB,CAAC;AAIF,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"gradient-background.d.ts","sourceRoot":"","sources":["../../../src/components/ui/gradient-background.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,eAAe,EAAU,KAAK,UAAU,EAAC,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,uBAAwB,SAAQ,eAAe,CAAC,KAAK,CAAC;IAC9D,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,QAAA,MAAM,kBAAkB,6GAcvB,CAAC;AAIF,OAAO,EAAC,kBAAkB,EAAE,KAAK,uBAAuB,EAAC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { forwardRef } from "react";
4
3
  import { motion } from "motion/react";
5
- import { cn } from "../../lib/utils.js";
4
+ import { forwardRef } from "react";
5
+ import { cn } from "../../lib/utilities.js";
6
6
  const GradientBackground = /*#__PURE__*/ forwardRef(({ className, transition = {
7
7
  duration: 15,
8
8
  ease: "easeInOut",
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\gradient-background.js","sources":["webpack://@arolariu/components/./src/components/ui/gradient-background.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport { HTMLMotionProps, motion, type Transition } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface GradientBackgroundProps extends HTMLMotionProps<\"div\"> {\n transition?: Transition;\n}\n\nconst GradientBackground = React.forwardRef<\n HTMLDivElement,\n GradientBackgroundProps\n>(\n (\n {\n className,\n transition = { duration: 15, ease: \"easeInOut\", repeat: Infinity },\n ...props\n },\n ref,\n ) => {\n return (\n <motion.div\n ref={ref}\n className={cn(\n \"size-full bg-gradient-to-br from-blue-500 via-purple-500 to-pink-500 bg-[length:400%_400%]\",\n className,\n )}\n animate={{\n backgroundPosition: [\"0% 50%\", \"100% 50%\", \"0% 50%\"],\n }}\n transition={transition}\n {...props}\n />\n );\n },\n);\n\nGradientBackground.displayName = \"GradientBackground\";\n\nexport { GradientBackground, type GradientBackgroundProps };\n"],"names":["GradientBackground","React","className","transition","Infinity","props","ref","motion","cn"],"mappings":";;;;;AAWA,MAAMA,qBAAqB,WAArBA,GAAqBC,WAIzB,CACE,EACEC,SAAS,EACTC,aAAa;IAAE,UAAU;IAAI,MAAM;IAAa,QAAQC;AAAS,CAAC,EAClE,GAAGC,OACJ,EACDC,MAEO,WAAP,GACE,IAACC,OAAO,GAAG;QACT,KAAKD;QACL,WAAWE,GACT,8FACAN;QAEF,SAAS;YACP,oBAAoB;gBAAC;gBAAU;gBAAY;aAAS;QACtD;QACA,YAAYC;QACX,GAAGE,KAAK;;AAMjBL,mBAAmB,WAAW,GAAG"}
1
+ {"version":3,"file":"components\\ui\\gradient-background.js","sources":["webpack://@arolariu/components/./src/components/ui/gradient-background.tsx"],"sourcesContent":["\r\n\r\nimport {HTMLMotionProps, motion, type Transition} from \"motion/react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\ninterface GradientBackgroundProps extends HTMLMotionProps<\"div\"> {\r\n transition?: Transition;\r\n}\r\n\r\nconst GradientBackground = React.forwardRef<HTMLDivElement, GradientBackgroundProps>(\r\n ({className, transition = {duration: 15, ease: \"easeInOut\", repeat: Infinity}, ...props}, ref) => {\r\n return (\r\n <motion.div\r\n ref={ref}\r\n className={cn(\"size-full bg-gradient-to-br from-blue-500 via-purple-500 to-pink-500 bg-[length:400%_400%]\", className)}\r\n animate={{\r\n backgroundPosition: [\"0% 50%\", \"100% 50%\", \"0% 50%\"],\r\n }}\r\n transition={transition}\r\n {...props}\r\n />\r\n );\r\n },\r\n);\r\n\r\nGradientBackground.displayName = \"GradientBackground\";\r\n\r\nexport {GradientBackground, type GradientBackgroundProps};\r\n"],"names":["GradientBackground","React","className","transition","Infinity","props","ref","motion","cn"],"mappings":";;;;;AAWA,MAAMA,qBAAqB,WAArBA,GAAqBC,WACzB,CAAC,EAACC,SAAS,EAAEC,aAAa;IAAC,UAAU;IAAI,MAAM;IAAa,QAAQC;AAAQ,CAAC,EAAE,GAAGC,OAAM,EAAEC,MACjF,WAAP,GACE,IAACC,OAAO,GAAG;QACT,KAAKD;QACL,WAAWE,GAAG,8FAA8FN;QAC5G,SAAS;YACP,oBAAoB;gBAAC;gBAAU;gBAAY;aAAS;QACtD;QACA,YAAYC;QACX,GAAGE,KAAK;;AAMjBL,mBAAmB,WAAW,GAAG"}
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
1
  import { type Transition } from "motion/react";
2
+ import * as React from "react";
3
3
  interface GradientTextProps extends React.HTMLAttributes<HTMLSpanElement> {
4
4
  text: string;
5
5
  gradient?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"gradient-text.d.ts","sourceRoot":"","sources":["../../../src/components/ui/gradient-text.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAIvD,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,QAAA,MAAM,YAAY,2FA8CjB,CAAC;AAIF,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"gradient-text.d.ts","sourceRoot":"","sources":["../../../src/components/ui/gradient-text.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,UAAU,EAAC,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,QAAA,MAAM,YAAY,2FA2CjB,CAAC;AAIF,OAAO,EAAC,YAAY,EAAE,KAAK,iBAAiB,EAAC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { forwardRef } from "react";
4
3
  import { motion } from "motion/react";
5
- import { cn } from "../../lib/utils.js";
4
+ import { forwardRef } from "react";
5
+ import { cn } from "../../lib/utilities.js";
6
6
  const GradientText = /*#__PURE__*/ forwardRef(({ text, className, gradient = "linear-gradient(90deg, #3b82f6 0%, #a855f7 20%, #ec4899 50%, #a855f7 80%, #3b82f6 100%)", neon = false, transition = {
7
7
  duration: 50,
8
8
  repeat: 1 / 0,
@@ -17,7 +17,7 @@ const GradientText = /*#__PURE__*/ forwardRef(({ text, className, gradient = "li
17
17
  ...props,
18
18
  children: [
19
19
  /*#__PURE__*/ jsx(motion.span, {
20
- className: "m-0 text-transparent bg-clip-text bg-[length:700%_100%] bg-[position:0%_0%]",
20
+ className: "m-0 bg-[length:700%_100%] bg-clip-text bg-[position:0%_0%] text-transparent",
21
21
  style: baseStyle,
22
22
  initial: {
23
23
  backgroundPosition: "0% 0%"
@@ -28,8 +28,8 @@ const GradientText = /*#__PURE__*/ forwardRef(({ text, className, gradient = "li
28
28
  transition: transition,
29
29
  children: text
30
30
  }),
31
- neon && /*#__PURE__*/ jsx(motion.span, {
32
- className: "m-0 absolute top-0 left-0 text-transparent bg-clip-text blur-[8px] mix-blend-plus-lighter bg-[length:700%_100%] bg-[position:0%_0%]",
31
+ Boolean(neon) && /*#__PURE__*/ jsx(motion.span, {
32
+ className: "absolute top-0 left-0 m-0 bg-[length:700%_100%] bg-clip-text bg-[position:0%_0%] text-transparent mix-blend-plus-lighter blur-[8px]",
33
33
  style: baseStyle,
34
34
  initial: {
35
35
  backgroundPosition: "0% 0%"