@arolariu/components 0.0.38 → 0.0.40

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 (418) hide show
  1. package/CONTRIBUTING.md +371 -0
  2. package/DEBUGGING.md +401 -0
  3. package/EXAMPLES.md +1035 -0
  4. package/LICENSE +21 -21
  5. package/changelog.md +85 -29
  6. package/dist/cjs/components/ui/accordion.cjs +2 -2
  7. package/dist/cjs/components/ui/accordion.cjs.map +1 -1
  8. package/dist/cjs/components/ui/alert-dialog.cjs +7 -7
  9. package/dist/cjs/components/ui/alert-dialog.cjs.map +1 -1
  10. package/dist/cjs/components/ui/alert.cjs +2 -2
  11. package/dist/cjs/components/ui/alert.cjs.map +1 -1
  12. package/dist/cjs/components/ui/aspect-ratio.cjs.map +1 -1
  13. package/dist/cjs/components/ui/avatar.cjs +2 -2
  14. package/dist/cjs/components/ui/avatar.cjs.map +1 -1
  15. package/dist/cjs/components/ui/background-beams.cjs.map +1 -1
  16. package/dist/cjs/components/ui/badge.cjs +2 -2
  17. package/dist/cjs/components/ui/badge.cjs.map +1 -1
  18. package/dist/cjs/components/ui/breadcrumb.cjs +5 -5
  19. package/dist/cjs/components/ui/breadcrumb.cjs.map +1 -1
  20. package/dist/cjs/components/ui/bubble-background.cjs +1 -2
  21. package/dist/cjs/components/ui/bubble-background.cjs.map +1 -1
  22. package/dist/cjs/components/ui/button.cjs.map +1 -1
  23. package/dist/cjs/components/ui/calendar.cjs +89 -35
  24. package/dist/cjs/components/ui/calendar.cjs.map +1 -1
  25. package/dist/cjs/components/ui/card.cjs +5 -5
  26. package/dist/cjs/components/ui/card.cjs.map +1 -1
  27. package/dist/cjs/components/ui/carousel.cjs +3 -3
  28. package/dist/cjs/components/ui/carousel.cjs.map +1 -1
  29. package/dist/cjs/components/ui/chart.cjs +14 -14
  30. package/dist/cjs/components/ui/chart.cjs.map +1 -1
  31. package/dist/cjs/components/ui/checkbox.cjs.map +1 -1
  32. package/dist/cjs/components/ui/collapsible.cjs +2 -2
  33. package/dist/cjs/components/ui/collapsible.cjs.map +1 -1
  34. package/dist/cjs/components/ui/command.cjs +8 -7
  35. package/dist/cjs/components/ui/command.cjs.map +1 -1
  36. package/dist/cjs/components/ui/context-menu.cjs +9 -9
  37. package/dist/cjs/components/ui/context-menu.cjs.map +1 -1
  38. package/dist/cjs/components/ui/counting-number.cjs.map +1 -1
  39. package/dist/cjs/components/ui/dialog.cjs +8 -7
  40. package/dist/cjs/components/ui/dialog.cjs.map +1 -1
  41. package/dist/cjs/components/ui/dot-background.cjs.map +1 -1
  42. package/dist/cjs/components/ui/drawer.cjs +6 -6
  43. package/dist/cjs/components/ui/drawer.cjs.map +1 -1
  44. package/dist/cjs/components/ui/dropdown-menu.cjs +10 -10
  45. package/dist/cjs/components/ui/dropdown-menu.cjs.map +1 -1
  46. package/dist/cjs/components/ui/dropdrawer.cjs +8 -8
  47. package/dist/cjs/components/ui/dropdrawer.cjs.map +1 -1
  48. package/dist/cjs/components/ui/fireworks-background.cjs.map +1 -1
  49. package/dist/cjs/components/ui/flip-button.cjs.map +1 -1
  50. package/dist/cjs/components/ui/form.cjs +5 -5
  51. package/dist/cjs/components/ui/form.cjs.map +1 -1
  52. package/dist/cjs/components/ui/gradient-background.cjs.map +1 -1
  53. package/dist/cjs/components/ui/gradient-text.cjs.map +1 -1
  54. package/dist/cjs/components/ui/highlight-text.cjs.map +1 -1
  55. package/dist/cjs/components/ui/hole-background.cjs.map +1 -1
  56. package/dist/cjs/components/ui/hover-card.cjs +2 -2
  57. package/dist/cjs/components/ui/hover-card.cjs.map +1 -1
  58. package/dist/cjs/components/ui/input-otp.cjs +3 -3
  59. package/dist/cjs/components/ui/input-otp.cjs.map +1 -1
  60. package/dist/cjs/components/ui/input.cjs.map +1 -1
  61. package/dist/cjs/components/ui/label.cjs.map +1 -1
  62. package/dist/cjs/components/ui/menubar.cjs +9 -9
  63. package/dist/cjs/components/ui/menubar.cjs.map +1 -1
  64. package/dist/cjs/components/ui/navigation-menu.cjs +4 -4
  65. package/dist/cjs/components/ui/navigation-menu.cjs.map +1 -1
  66. package/dist/cjs/components/ui/pagination.cjs +3 -3
  67. package/dist/cjs/components/ui/pagination.cjs.map +1 -1
  68. package/dist/cjs/components/ui/popover.cjs.map +1 -1
  69. package/dist/cjs/components/ui/progress.cjs.map +1 -1
  70. package/dist/cjs/components/ui/radio-group.cjs.map +1 -1
  71. package/dist/cjs/components/ui/resizable.cjs +1 -1
  72. package/dist/cjs/components/ui/resizable.cjs.map +1 -1
  73. package/dist/cjs/components/ui/ripple-button.cjs.map +1 -1
  74. package/dist/cjs/components/ui/scratcher.cjs.map +1 -1
  75. package/dist/cjs/components/ui/scroll-area.cjs.map +1 -1
  76. package/dist/cjs/components/ui/select.cjs +5 -5
  77. package/dist/cjs/components/ui/select.cjs.map +1 -1
  78. package/dist/cjs/components/ui/separator.cjs +1 -1
  79. package/dist/cjs/components/ui/separator.cjs.map +1 -1
  80. package/dist/cjs/components/ui/sheet.cjs +5 -5
  81. package/dist/cjs/components/ui/sheet.cjs.map +1 -1
  82. package/dist/cjs/components/ui/sidebar.cjs +19 -19
  83. package/dist/cjs/components/ui/sidebar.cjs.map +1 -1
  84. package/dist/cjs/components/ui/skeleton.cjs.map +1 -1
  85. package/dist/cjs/components/ui/slider.cjs.map +1 -1
  86. package/dist/cjs/components/ui/sonner.cjs +2 -2
  87. package/dist/cjs/components/ui/sonner.cjs.map +1 -1
  88. package/dist/cjs/components/ui/switch.cjs.map +1 -1
  89. package/dist/cjs/components/ui/table.cjs +6 -6
  90. package/dist/cjs/components/ui/table.cjs.map +1 -1
  91. package/dist/cjs/components/ui/tabs.cjs +2 -2
  92. package/dist/cjs/components/ui/tabs.cjs.map +1 -1
  93. package/dist/cjs/components/ui/textarea.cjs.map +1 -1
  94. package/dist/cjs/components/ui/toggle-group.cjs +2 -2
  95. package/dist/cjs/components/ui/toggle-group.cjs.map +1 -1
  96. package/dist/cjs/components/ui/toggle.cjs +2 -2
  97. package/dist/cjs/components/ui/toggle.cjs.map +1 -1
  98. package/dist/cjs/components/ui/tooltip.cjs +3 -3
  99. package/dist/cjs/components/ui/tooltip.cjs.map +1 -1
  100. package/dist/cjs/hooks/use-mobile.cjs.map +1 -1
  101. package/dist/cjs/index.cjs +243 -241
  102. package/dist/cjs/index.cjs.map +1 -0
  103. package/dist/cjs/index.css +400 -150
  104. package/dist/cjs/index.css.map +1 -0
  105. package/dist/cjs/lib/utils.cjs.map +1 -1
  106. package/dist/esm/components/ui/accordion.js +14 -14
  107. package/dist/esm/components/ui/accordion.js.map +1 -1
  108. package/dist/esm/components/ui/alert-dialog.js +25 -25
  109. package/dist/esm/components/ui/alert-dialog.js.map +1 -1
  110. package/dist/esm/components/ui/alert.js +10 -10
  111. package/dist/esm/components/ui/alert.js.map +1 -1
  112. package/dist/esm/components/ui/aspect-ratio.js +3 -3
  113. package/dist/esm/components/ui/aspect-ratio.js.map +1 -1
  114. package/dist/esm/components/ui/avatar.js +9 -9
  115. package/dist/esm/components/ui/avatar.js.map +1 -1
  116. package/dist/esm/components/ui/background-beams.js +20 -20
  117. package/dist/esm/components/ui/background-beams.js.map +1 -1
  118. package/dist/esm/components/ui/badge.js +8 -8
  119. package/dist/esm/components/ui/badge.js.map +1 -1
  120. package/dist/esm/components/ui/breadcrumb.js +21 -21
  121. package/dist/esm/components/ui/breadcrumb.js.map +1 -1
  122. package/dist/esm/components/ui/bubble-background.js +32 -33
  123. package/dist/esm/components/ui/bubble-background.js.map +1 -1
  124. package/dist/esm/components/ui/button.js +8 -8
  125. package/dist/esm/components/ui/button.js.map +1 -1
  126. package/dist/esm/components/ui/calendar.js +93 -42
  127. package/dist/esm/components/ui/calendar.js.map +1 -1
  128. package/dist/esm/components/ui/card.js +16 -16
  129. package/dist/esm/components/ui/card.js.map +1 -1
  130. package/dist/esm/components/ui/carousel.js +33 -33
  131. package/dist/esm/components/ui/carousel.js.map +1 -1
  132. package/dist/esm/components/ui/chart.js +45 -45
  133. package/dist/esm/components/ui/chart.js.map +1 -1
  134. package/dist/esm/components/ui/checkbox.js +8 -8
  135. package/dist/esm/components/ui/checkbox.js.map +1 -1
  136. package/dist/esm/components/ui/collapsible.js +8 -8
  137. package/dist/esm/components/ui/collapsible.js.map +1 -1
  138. package/dist/esm/components/ui/command.js +33 -32
  139. package/dist/esm/components/ui/command.js.map +1 -1
  140. package/dist/esm/components/ui/context-menu.js +36 -36
  141. package/dist/esm/components/ui/context-menu.js.map +1 -1
  142. package/dist/esm/components/ui/counting-number.js +12 -12
  143. package/dist/esm/components/ui/counting-number.js.map +1 -1
  144. package/dist/esm/components/ui/dialog.js +27 -26
  145. package/dist/esm/components/ui/dialog.js.map +1 -1
  146. package/dist/esm/components/ui/dot-background.js +15 -15
  147. package/dist/esm/components/ui/dot-background.js.map +1 -1
  148. package/dist/esm/components/ui/drawer.js +24 -24
  149. package/dist/esm/components/ui/drawer.js.map +1 -1
  150. package/dist/esm/components/ui/dropdown-menu.js +36 -36
  151. package/dist/esm/components/ui/dropdown-menu.js.map +1 -1
  152. package/dist/esm/components/ui/dropdrawer.js +104 -104
  153. package/dist/esm/components/ui/dropdrawer.js.map +1 -1
  154. package/dist/esm/components/ui/fireworks-background.js +12 -12
  155. package/dist/esm/components/ui/fireworks-background.js.map +1 -1
  156. package/dist/esm/components/ui/flip-button.js +12 -12
  157. package/dist/esm/components/ui/flip-button.js.map +1 -1
  158. package/dist/esm/components/ui/form.js +26 -26
  159. package/dist/esm/components/ui/form.js.map +1 -1
  160. package/dist/esm/components/ui/gradient-background.js +7 -7
  161. package/dist/esm/components/ui/gradient-background.js.map +1 -1
  162. package/dist/esm/components/ui/gradient-text.js +9 -9
  163. package/dist/esm/components/ui/gradient-text.js.map +1 -1
  164. package/dist/esm/components/ui/highlight-text.js +10 -10
  165. package/dist/esm/components/ui/highlight-text.js.map +1 -1
  166. package/dist/esm/components/ui/hole-background.js +30 -30
  167. package/dist/esm/components/ui/hole-background.js.map +1 -1
  168. package/dist/esm/components/ui/hover-card.js +8 -8
  169. package/dist/esm/components/ui/hover-card.js.map +1 -1
  170. package/dist/esm/components/ui/input-otp.js +17 -17
  171. package/dist/esm/components/ui/input-otp.js.map +1 -1
  172. package/dist/esm/components/ui/input.js +4 -4
  173. package/dist/esm/components/ui/input.js.map +1 -1
  174. package/dist/esm/components/ui/label.js +5 -5
  175. package/dist/esm/components/ui/label.js.map +1 -1
  176. package/dist/esm/components/ui/menubar.js +39 -39
  177. package/dist/esm/components/ui/menubar.js.map +1 -1
  178. package/dist/esm/components/ui/navigation-menu.js +27 -27
  179. package/dist/esm/components/ui/navigation-menu.js.map +1 -1
  180. package/dist/esm/components/ui/pagination.js +23 -23
  181. package/dist/esm/components/ui/pagination.js.map +1 -1
  182. package/dist/esm/components/ui/popover.js +9 -9
  183. package/dist/esm/components/ui/popover.js.map +1 -1
  184. package/dist/esm/components/ui/progress.js +6 -6
  185. package/dist/esm/components/ui/progress.js.map +1 -1
  186. package/dist/esm/components/ui/radio-group.js +10 -10
  187. package/dist/esm/components/ui/radio-group.js.map +1 -1
  188. package/dist/esm/components/ui/resizable.js +11 -11
  189. package/dist/esm/components/ui/resizable.js.map +1 -1
  190. package/dist/esm/components/ui/ripple-button.js +14 -14
  191. package/dist/esm/components/ui/ripple-button.js.map +1 -1
  192. package/dist/esm/components/ui/scratcher.js +13 -13
  193. package/dist/esm/components/ui/scratcher.js.map +1 -1
  194. package/dist/esm/components/ui/scroll-area.js +11 -11
  195. package/dist/esm/components/ui/scroll-area.js.map +1 -1
  196. package/dist/esm/components/ui/select.js +34 -34
  197. package/dist/esm/components/ui/select.js.map +1 -1
  198. package/dist/esm/components/ui/separator.js +6 -6
  199. package/dist/esm/components/ui/separator.js.map +1 -1
  200. package/dist/esm/components/ui/sheet.js +25 -25
  201. package/dist/esm/components/ui/sheet.js.map +1 -1
  202. package/dist/esm/components/ui/sidebar.js +96 -96
  203. package/dist/esm/components/ui/sidebar.js.map +1 -1
  204. package/dist/esm/components/ui/skeleton.js +4 -4
  205. package/dist/esm/components/ui/skeleton.js.map +1 -1
  206. package/dist/esm/components/ui/slider.js +12 -12
  207. package/dist/esm/components/ui/slider.js.map +1 -1
  208. package/dist/esm/components/ui/sonner.js +7 -8
  209. package/dist/esm/components/ui/sonner.js.map +1 -1
  210. package/dist/esm/components/ui/switch.js +7 -7
  211. package/dist/esm/components/ui/switch.js.map +1 -1
  212. package/dist/esm/components/ui/table.js +19 -19
  213. package/dist/esm/components/ui/table.js.map +1 -1
  214. package/dist/esm/components/ui/tabs.js +11 -11
  215. package/dist/esm/components/ui/tabs.js.map +1 -1
  216. package/dist/esm/components/ui/textarea.js +4 -4
  217. package/dist/esm/components/ui/textarea.js.map +1 -1
  218. package/dist/esm/components/ui/toggle-group.js +12 -12
  219. package/dist/esm/components/ui/toggle-group.js.map +1 -1
  220. package/dist/esm/components/ui/toggle.js +7 -7
  221. package/dist/esm/components/ui/toggle.js.map +1 -1
  222. package/dist/esm/components/ui/tooltip.js +11 -11
  223. package/dist/esm/components/ui/tooltip.js.map +1 -1
  224. package/dist/esm/hooks/use-mobile.js +3 -3
  225. package/dist/esm/hooks/use-mobile.js.map +1 -1
  226. package/dist/esm/index.css +400 -150
  227. package/dist/esm/index.css.map +1 -0
  228. package/dist/esm/index.js +62 -332
  229. package/dist/esm/lib/utils.js +3 -3
  230. package/dist/esm/lib/utils.js.map +1 -1
  231. package/dist/index.css +400 -150
  232. package/dist/index.js +62 -332
  233. package/dist/types/components/ui/accordion.d.ts +1 -0
  234. package/dist/types/components/ui/accordion.d.ts.map +1 -0
  235. package/dist/types/components/ui/alert-dialog.d.ts +1 -0
  236. package/dist/types/components/ui/alert-dialog.d.ts.map +1 -0
  237. package/dist/types/components/ui/alert.d.ts +1 -0
  238. package/dist/types/components/ui/alert.d.ts.map +1 -0
  239. package/dist/types/components/ui/aspect-ratio.d.ts +1 -0
  240. package/dist/types/components/ui/aspect-ratio.d.ts.map +1 -0
  241. package/dist/types/components/ui/avatar.d.ts +1 -0
  242. package/dist/types/components/ui/avatar.d.ts.map +1 -0
  243. package/dist/types/components/ui/background-beams.d.ts +1 -0
  244. package/dist/types/components/ui/background-beams.d.ts.map +1 -0
  245. package/dist/types/components/ui/badge.d.ts +1 -0
  246. package/dist/types/components/ui/badge.d.ts.map +1 -0
  247. package/dist/types/components/ui/breadcrumb.d.ts +1 -0
  248. package/dist/types/components/ui/breadcrumb.d.ts.map +1 -0
  249. package/dist/types/components/ui/bubble-background.d.ts +1 -0
  250. package/dist/types/components/ui/bubble-background.d.ts.map +1 -0
  251. package/dist/types/components/ui/button.d.ts +1 -0
  252. package/dist/types/components/ui/button.d.ts.map +1 -0
  253. package/dist/types/components/ui/calendar.d.ts +8 -3
  254. package/dist/types/components/ui/calendar.d.ts.map +1 -0
  255. package/dist/types/components/ui/card.d.ts +1 -0
  256. package/dist/types/components/ui/card.d.ts.map +1 -0
  257. package/dist/types/components/ui/carousel.d.ts +1 -0
  258. package/dist/types/components/ui/carousel.d.ts.map +1 -0
  259. package/dist/types/components/ui/chart.d.ts +19 -4
  260. package/dist/types/components/ui/chart.d.ts.map +1 -0
  261. package/dist/types/components/ui/checkbox.d.ts +1 -0
  262. package/dist/types/components/ui/checkbox.d.ts.map +1 -0
  263. package/dist/types/components/ui/collapsible.d.ts +1 -0
  264. package/dist/types/components/ui/collapsible.d.ts.map +1 -0
  265. package/dist/types/components/ui/command.d.ts +4 -1
  266. package/dist/types/components/ui/command.d.ts.map +1 -0
  267. package/dist/types/components/ui/context-menu.d.ts +1 -0
  268. package/dist/types/components/ui/context-menu.d.ts.map +1 -0
  269. package/dist/types/components/ui/counting-number.d.ts +1 -0
  270. package/dist/types/components/ui/counting-number.d.ts.map +1 -0
  271. package/dist/types/components/ui/dialog.d.ts +4 -1
  272. package/dist/types/components/ui/dialog.d.ts.map +1 -0
  273. package/dist/types/components/ui/dot-background.d.ts +1 -0
  274. package/dist/types/components/ui/dot-background.d.ts.map +1 -0
  275. package/dist/types/components/ui/drawer.d.ts +1 -0
  276. package/dist/types/components/ui/drawer.d.ts.map +1 -0
  277. package/dist/types/components/ui/dropdown-menu.d.ts +1 -0
  278. package/dist/types/components/ui/dropdown-menu.d.ts.map +1 -0
  279. package/dist/types/components/ui/dropdrawer.d.ts +1 -0
  280. package/dist/types/components/ui/dropdrawer.d.ts.map +1 -0
  281. package/dist/types/components/ui/fireworks-background.d.ts +1 -0
  282. package/dist/types/components/ui/fireworks-background.d.ts.map +1 -0
  283. package/dist/types/components/ui/flip-button.d.ts +1 -0
  284. package/dist/types/components/ui/flip-button.d.ts.map +1 -0
  285. package/dist/types/components/ui/form.d.ts +1 -0
  286. package/dist/types/components/ui/form.d.ts.map +1 -0
  287. package/dist/types/components/ui/gradient-background.d.ts +1 -0
  288. package/dist/types/components/ui/gradient-background.d.ts.map +1 -0
  289. package/dist/types/components/ui/gradient-text.d.ts +1 -0
  290. package/dist/types/components/ui/gradient-text.d.ts.map +1 -0
  291. package/dist/types/components/ui/highlight-text.d.ts +1 -0
  292. package/dist/types/components/ui/highlight-text.d.ts.map +1 -0
  293. package/dist/types/components/ui/hole-background.d.ts +1 -0
  294. package/dist/types/components/ui/hole-background.d.ts.map +1 -0
  295. package/dist/types/components/ui/hover-card.d.ts +1 -0
  296. package/dist/types/components/ui/hover-card.d.ts.map +1 -0
  297. package/dist/types/components/ui/input-otp.d.ts +1 -0
  298. package/dist/types/components/ui/input-otp.d.ts.map +1 -0
  299. package/dist/types/components/ui/input.d.ts +1 -0
  300. package/dist/types/components/ui/input.d.ts.map +1 -0
  301. package/dist/types/components/ui/label.d.ts +1 -0
  302. package/dist/types/components/ui/label.d.ts.map +1 -0
  303. package/dist/types/components/ui/menubar.d.ts +1 -0
  304. package/dist/types/components/ui/menubar.d.ts.map +1 -0
  305. package/dist/types/components/ui/navigation-menu.d.ts +1 -0
  306. package/dist/types/components/ui/navigation-menu.d.ts.map +1 -0
  307. package/dist/types/components/ui/pagination.d.ts +1 -0
  308. package/dist/types/components/ui/pagination.d.ts.map +1 -0
  309. package/dist/types/components/ui/popover.d.ts +1 -0
  310. package/dist/types/components/ui/popover.d.ts.map +1 -0
  311. package/dist/types/components/ui/progress.d.ts +1 -0
  312. package/dist/types/components/ui/progress.d.ts.map +1 -0
  313. package/dist/types/components/ui/radio-group.d.ts +1 -0
  314. package/dist/types/components/ui/radio-group.d.ts.map +1 -0
  315. package/dist/types/components/ui/resizable.d.ts +1 -0
  316. package/dist/types/components/ui/resizable.d.ts.map +1 -0
  317. package/dist/types/components/ui/ripple-button.d.ts +1 -0
  318. package/dist/types/components/ui/ripple-button.d.ts.map +1 -0
  319. package/dist/types/components/ui/scratcher.d.ts +1 -0
  320. package/dist/types/components/ui/scratcher.d.ts.map +1 -0
  321. package/dist/types/components/ui/scroll-area.d.ts +1 -0
  322. package/dist/types/components/ui/scroll-area.d.ts.map +1 -0
  323. package/dist/types/components/ui/select.d.ts +1 -0
  324. package/dist/types/components/ui/select.d.ts.map +1 -0
  325. package/dist/types/components/ui/separator.d.ts +1 -0
  326. package/dist/types/components/ui/separator.d.ts.map +1 -0
  327. package/dist/types/components/ui/sheet.d.ts +1 -0
  328. package/dist/types/components/ui/sheet.d.ts.map +1 -0
  329. package/dist/types/components/ui/sidebar.d.ts +1 -0
  330. package/dist/types/components/ui/sidebar.d.ts.map +1 -0
  331. package/dist/types/components/ui/skeleton.d.ts +1 -0
  332. package/dist/types/components/ui/skeleton.d.ts.map +1 -0
  333. package/dist/types/components/ui/slider.d.ts +1 -0
  334. package/dist/types/components/ui/slider.d.ts.map +1 -0
  335. package/dist/types/components/ui/sonner.d.ts +1 -0
  336. package/dist/types/components/ui/sonner.d.ts.map +1 -0
  337. package/dist/types/components/ui/switch.d.ts +1 -0
  338. package/dist/types/components/ui/switch.d.ts.map +1 -0
  339. package/dist/types/components/ui/table.d.ts +1 -0
  340. package/dist/types/components/ui/table.d.ts.map +1 -0
  341. package/dist/types/components/ui/tabs.d.ts +1 -0
  342. package/dist/types/components/ui/tabs.d.ts.map +1 -0
  343. package/dist/types/components/ui/textarea.d.ts +1 -0
  344. package/dist/types/components/ui/textarea.d.ts.map +1 -0
  345. package/dist/types/components/ui/toggle-group.d.ts +1 -0
  346. package/dist/types/components/ui/toggle-group.d.ts.map +1 -0
  347. package/dist/types/components/ui/toggle.d.ts +1 -0
  348. package/dist/types/components/ui/toggle.d.ts.map +1 -0
  349. package/dist/types/components/ui/tooltip.d.ts +1 -0
  350. package/dist/types/components/ui/tooltip.d.ts.map +1 -0
  351. package/dist/types/hooks/use-mobile.d.ts +1 -0
  352. package/dist/types/hooks/use-mobile.d.ts.map +1 -0
  353. package/dist/types/index.d.ts +1 -0
  354. package/dist/types/index.d.ts.map +1 -0
  355. package/dist/types/lib/utils.d.ts +1 -0
  356. package/dist/types/lib/utils.d.ts.map +1 -0
  357. package/package.json +90 -72
  358. package/readme.md +627 -215
  359. package/src/components/ui/accordion.tsx +1 -1
  360. package/src/components/ui/alert-dialog.tsx +4 -4
  361. package/src/components/ui/alert.tsx +3 -3
  362. package/src/components/ui/avatar.tsx +2 -2
  363. package/src/components/ui/badge.tsx +1 -1
  364. package/src/components/ui/breadcrumb.tsx +3 -3
  365. package/src/components/ui/bubble-background.tsx +189 -187
  366. package/src/components/ui/button.tsx +1 -1
  367. package/src/components/ui/calendar.tsx +189 -51
  368. package/src/components/ui/card.tsx +4 -4
  369. package/src/components/ui/carousel.tsx +6 -6
  370. package/src/components/ui/chart.tsx +380 -353
  371. package/src/components/ui/checkbox.tsx +1 -1
  372. package/src/components/ui/command.tsx +14 -7
  373. package/src/components/ui/context-menu.tsx +9 -9
  374. package/src/components/ui/counting-number.tsx +4 -4
  375. package/src/components/ui/dialog.tsx +17 -9
  376. package/src/components/ui/dot-background.tsx +2 -2
  377. package/src/components/ui/drawer.tsx +141 -138
  378. package/src/components/ui/dropdrawer.tsx +2 -2
  379. package/src/components/ui/fireworks-background.tsx +12 -12
  380. package/src/components/ui/flip-button.tsx +6 -6
  381. package/src/components/ui/form.tsx +6 -6
  382. package/src/components/ui/gradient-background.tsx +3 -3
  383. package/src/components/ui/gradient-text.tsx +2 -2
  384. package/src/components/ui/highlight-text.tsx +3 -3
  385. package/src/components/ui/hole-background.tsx +9 -9
  386. package/src/components/ui/hover-card.tsx +1 -1
  387. package/src/components/ui/input-otp.tsx +2 -2
  388. package/src/components/ui/input.tsx +22 -23
  389. package/src/components/ui/label.tsx +1 -1
  390. package/src/components/ui/menubar.tsx +11 -11
  391. package/src/components/ui/navigation-menu.tsx +8 -8
  392. package/src/components/ui/pagination.tsx +1 -1
  393. package/src/components/ui/popover.tsx +1 -1
  394. package/src/components/ui/progress.tsx +1 -1
  395. package/src/components/ui/radio-group.tsx +1 -1
  396. package/src/components/ui/resizable.tsx +3 -3
  397. package/src/components/ui/ripple-button.tsx +111 -111
  398. package/src/components/ui/scratcher.tsx +171 -171
  399. package/src/components/ui/scroll-area.tsx +1 -1
  400. package/src/components/ui/select.tsx +8 -8
  401. package/src/components/ui/separator.tsx +2 -2
  402. package/src/components/ui/sheet.tsx +4 -4
  403. package/src/components/ui/sidebar.tsx +18 -18
  404. package/src/components/ui/skeleton.tsx +1 -1
  405. package/src/components/ui/slider.tsx +6 -6
  406. package/src/components/ui/switch.tsx +2 -2
  407. package/src/components/ui/table.tsx +5 -5
  408. package/src/components/ui/tabs.tsx +2 -2
  409. package/src/components/ui/textarea.tsx +1 -1
  410. package/src/components/ui/toggle-group.tsx +2 -2
  411. package/src/components/ui/toggle.tsx +1 -1
  412. package/src/components/ui/tooltip.tsx +1 -1
  413. package/src/hooks/use-mobile.tsx +44 -44
  414. package/src/index.css +68 -68
  415. package/src/index.ts +400 -400
  416. package/src/lib/utils.ts +10 -10
  417. package/tailwind.config.mjs +65 -65
  418. package/tsconfig.json +8 -0
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\dropdrawer.cjs","sources":["webpack://@arolariu/components/./src/components/ui/dropdrawer.tsx"],"sourcesContent":["\r\n\r\nimport { AnimatePresence, motion } from \"motion/react\";\r\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {\r\n Drawer,\r\n DrawerClose,\r\n DrawerContent,\r\n DrawerFooter,\r\n DrawerHeader,\r\n DrawerTitle,\r\n DrawerTrigger,\r\n} 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/use-mobile\";\r\nimport { cn } from \"@/lib/utils\";\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(\r\n \"DropDrawer components cannot be rendered outside the Context\",\r\n );\r\n }\r\n return context;\r\n};\r\n\r\nfunction DropDrawer({\r\n children,\r\n ...props\r\n}:\r\n | React.ComponentProps<typeof Drawer>\r\n | 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 >\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}:\r\n | React.ComponentProps<typeof DrawerTrigger>\r\n | 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 >\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}:\r\n | React.ComponentProps<typeof DrawerContent>\r\n | 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<\r\n { id: string; title: string }[]\r\n >([]);\r\n // Add animation direction state\r\n const [animationDirection, setAnimationDirection] = React.useState<\r\n \"forward\" | \"backward\"\r\n >(\"forward\");\r\n\r\n // Create a ref to store submenu content by ID\r\n const submenuContentRef = React.useRef<Map<string, React.ReactNode[]>>(\r\n new Map(),\r\n );\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(\r\n (id: string, content: React.ReactNode[]) => {\r\n submenuContentRef.current.set(id, content);\r\n },\r\n [],\r\n );\r\n\r\n // Function to extract submenu content\r\n const extractSubmenuContent = React.useCallback(\r\n (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 (\r\n React.isValidElement(child) &&\r\n child.type === DropDrawerSubContent\r\n ) {\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(\r\n subContentProps.children,\r\n (contentChild) => {\r\n result.push(contentChild);\r\n },\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) =>\r\n findSubmenuContent(child),\r\n );\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 );\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 };\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 >\r\n <DrawerContent\r\n data-slot=\"drop-drawer-content\"\r\n className={cn(\"max-h-[90vh]\", className)}\r\n {...props}\r\n >\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=\"hover:bg-neutral-100/50 rounded-full p-1 dark:hover:bg-neutral-800/50\"\r\n >\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=\"flex-1 relative overflow-y-auto max-h-[70vh]\">\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 >\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=\"pb-6 space-y-1.5 w-full h-full\"\r\n >\r\n {activeSubmenu\r\n ? getSubmenuContent(activeSubmenu)\r\n : 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=\"overflow-y-auto max-h-[70vh]\">\r\n <AnimatePresence\r\n initial={false}\r\n mode=\"wait\"\r\n custom={animationDirection}\r\n >\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=\"pb-6 space-y-1.5 w-full\"\r\n >\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 >\r\n <DropdownMenuContent\r\n data-slot=\"drop-drawer-content\"\r\n align=\"end\"\r\n sideOffset={4}\r\n className={cn(\r\n \"max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[220px] overflow-y-auto\",\r\n className,\r\n )}\r\n {...props}\r\n >\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(\r\n (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 );\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 &&\r\n \"bg-neutral-100 dark:bg-neutral-100 mx-2 my-1.5 rounded-md 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\" &&\r\n \"text-red-500 dark:text-red-500 dark:text-red-900 dark: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 >\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\"] ||\r\n (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 >\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({\r\n className,\r\n ...props\r\n}: 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}:\r\n | React.ComponentProps<typeof DropdownMenuLabel>\r\n | 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(\r\n \"text-neutral-500 px-4 py-2 text-sm font-medium dark:text-neutral-400\",\r\n className,\r\n )}\r\n {...props}\r\n >\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 >\r\n {children}\r\n </DropdownMenuLabel>\r\n );\r\n}\r\n\r\nfunction DropDrawerFooter({\r\n className,\r\n children,\r\n ...props\r\n}: 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 >\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 >\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(\r\n (child) =>\r\n React.isValidElement(child) && child.type !== DropDrawerSeparator,\r\n );\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=\"bg-neutral-200 h-px 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 \"bg-neutral-100 dark:bg-neutral-100 mx-2 my-3 overflow-hidden rounded-xl dark:bg-neutral-800 dark:dark:bg-neutral-800\",\r\n className,\r\n )}\r\n {...props}\r\n >\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 >\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(\r\n (child.props as { children?: React.ReactNode }).children,\r\n (contentChild) => {\r\n contentItems.push(contentChild);\r\n },\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 >\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 >\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(\r\n (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 );\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>)[\r\n \"data-parent-submenu-id\"\r\n ] 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[\r\n \"onClick\"\r\n ] 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 &&\r\n \"bg-neutral-100 dark:bg-neutral-100 mx-2 my-1.5 rounded-md 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 >\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 >\r\n {children}\r\n </DropdownMenuSubTrigger>\r\n );\r\n}\r\n\r\nfunction DropDrawerSubContent({\r\n className,\r\n sideOffset = 4,\r\n children,\r\n ...props\r\n}: 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 >\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAMA,oBAAoB,WAApBA,GAAoBC,+BAAAA,aAAmB,CAAwB;IACnE,UAAU;AACZ;AAEA,MAAMC,uBAAuB;IAC3B,MAAMC,UAAUF,+BAAAA,UAAgB,CAACD;IACjC,IAAI,CAACG,SACH,MAAM,IAAIC,MACR;IAGJ,OAAOD;AACT;AAEA,SAASE,WAAW,EAClBC,QAAQ,EACR,GAAGC,OAGwC;IAC3C,MAAMC,WAAWC,IAAAA,+BAAAA,WAAAA;IACjB,MAAMC,oBAAoBF,WAAWG,oCAAAA,MAAMA,GAAGC,2CAAAA,YAAYA;IAE1D,OACE,WADF,GACE,qCAACZ,kBAAkB,QAAQ;QAAC,OAAO;YAAEQ;QAAS;kBAC5C,mDAACE,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,oCAAAA,aAAaA,GAAGC,2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AMvE,QAAQ,mBAAOzB,WAAwBA,WAAW;YAGxD,IAAIuB,mBACFA,kBAAkByE,WAAWvE;QAEjC;QAGA,MAAM6E,kBAAkB,CAACxB;YAEvB,MAAMyB,aAAatG;YACnB,IAAIsG,UAAU,CAAC,UAAU,EAAE;gBACzB,MAAMC,kBAAkBD,UAAU,CAChC,UACD;gBACDC,gBAAgB1B;YAClB;YAGAD,YAAYC;QACd;QAGA,MAAM,EAAE,GAAG2B,WAAW,GAAGxG;QAGzB,OACE,WADF,GACE,sCAAC;YACC,KAAKsE;YACL,aAAU;YACV,cAAYJ;YACZ,WAAWZ,IAAAA,0BAAAA,EAAAA,EACT,8DAEA,CAACiB,iBACC,0GAEFA,iBAAiB,uBACjBL,SAAS,QACT3D;YAEF,SAAS8F;YACR,GAAGG,SAAS;;8BAEb,qCAAC;oBAAI,WAAU;8BAA2BzG;;8BAC1C,qCAAC0G,sCAAAA,gBAAgBA,EAAAA;oBAAC,WAAU;;;;IAGlC;IAEA,OACE,WADF,GACE,qCAACC,2CAAAA,sBAAsBA,EAAAA;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,OACE,WADF,GACE,qCAAC2G,2CAAAA,sBAAsBA,EAAAA;QACrB,aAAU;QACV,YAAYD;QACZ,WAAWrD,IAAAA,0BAAAA,EAAAA,EACT,gHACA/C;QAED,GAAGP,KAAK;kBAERD;;AAGP"}
1
+ {"version":3,"file":"components\\ui\\dropdrawer.cjs","sources":["webpack://@arolariu/components/webpack/runtime/define_property_getters","webpack://@arolariu/components/webpack/runtime/has_own_property","webpack://@arolariu/components/webpack/runtime/make_namespace_object","webpack://@arolariu/components/./src/components/ui/dropdrawer.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\r\n\r\nimport { AnimatePresence, motion, Transition } from \"motion/react\";\r\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {\r\n Drawer,\r\n DrawerClose,\r\n DrawerContent,\r\n DrawerFooter,\r\n DrawerHeader,\r\n DrawerTitle,\r\n DrawerTrigger,\r\n} 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/use-mobile\";\r\nimport { cn } from \"@/lib/utils\";\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(\r\n \"DropDrawer components cannot be rendered outside the Context\",\r\n );\r\n }\r\n return context;\r\n};\r\n\r\nfunction DropDrawer({\r\n children,\r\n ...props\r\n}:\r\n | React.ComponentProps<typeof Drawer>\r\n | 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 >\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}:\r\n | React.ComponentProps<typeof DrawerTrigger>\r\n | 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 >\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}:\r\n | React.ComponentProps<typeof DrawerContent>\r\n | 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<\r\n { id: string; title: string }[]\r\n >([]);\r\n // Add animation direction state\r\n const [animationDirection, setAnimationDirection] = React.useState<\r\n \"forward\" | \"backward\"\r\n >(\"forward\");\r\n\r\n // Create a ref to store submenu content by ID\r\n const submenuContentRef = React.useRef<Map<string, React.ReactNode[]>>(\r\n new Map(),\r\n );\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(\r\n (id: string, content: React.ReactNode[]) => {\r\n submenuContentRef.current.set(id, content);\r\n },\r\n [],\r\n );\r\n\r\n // Function to extract submenu content\r\n const extractSubmenuContent = React.useCallback(\r\n (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 (\r\n React.isValidElement(child) &&\r\n child.type === DropDrawerSubContent\r\n ) {\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(\r\n subContentProps.children,\r\n (contentChild) => {\r\n result.push(contentChild);\r\n },\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) =>\r\n findSubmenuContent(child),\r\n );\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 );\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 >\r\n <DrawerContent\r\n data-slot=\"drop-drawer-content\"\r\n className={cn(\"max-h-[90vh]\", className)}\r\n {...props}\r\n >\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=\"hover:bg-neutral-100/50 rounded-full p-1 dark:hover:bg-neutral-800/50\"\r\n >\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=\"flex-1 relative overflow-y-auto max-h-[70vh]\">\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 >\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=\"pb-6 space-y-1.5 w-full h-full\"\r\n >\r\n {activeSubmenu\r\n ? getSubmenuContent(activeSubmenu)\r\n : 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=\"overflow-y-auto max-h-[70vh]\">\r\n <AnimatePresence\r\n initial={false}\r\n mode=\"wait\"\r\n custom={animationDirection}\r\n >\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=\"pb-6 space-y-1.5 w-full\"\r\n >\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 >\r\n <DropdownMenuContent\r\n data-slot=\"drop-drawer-content\"\r\n align=\"end\"\r\n sideOffset={4}\r\n className={cn(\r\n \"max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[220px] overflow-y-auto\",\r\n className,\r\n )}\r\n {...props}\r\n >\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(\r\n (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 );\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 &&\r\n \"bg-neutral-100 dark:bg-neutral-100 mx-2 my-1.5 rounded-md 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\" &&\r\n \"text-red-500 dark:text-red-500 dark:text-red-900 dark: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 >\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\"] ||\r\n (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 >\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({\r\n className,\r\n ...props\r\n}: 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}:\r\n | React.ComponentProps<typeof DropdownMenuLabel>\r\n | 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(\r\n \"text-neutral-500 px-4 py-2 text-sm font-medium dark:text-neutral-400\",\r\n className,\r\n )}\r\n {...props}\r\n >\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 >\r\n {children}\r\n </DropdownMenuLabel>\r\n );\r\n}\r\n\r\nfunction DropDrawerFooter({\r\n className,\r\n children,\r\n ...props\r\n}: 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 >\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 >\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(\r\n (child) =>\r\n React.isValidElement(child) && child.type !== DropDrawerSeparator,\r\n );\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=\"bg-neutral-200 h-px 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 \"bg-neutral-100 dark:bg-neutral-100 mx-2 my-3 overflow-hidden rounded-xl dark:bg-neutral-800 dark:dark:bg-neutral-800\",\r\n className,\r\n )}\r\n {...props}\r\n >\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 >\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(\r\n (child.props as { children?: React.ReactNode }).children,\r\n (contentChild) => {\r\n contentItems.push(contentChild);\r\n },\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 >\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 >\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(\r\n (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 );\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>)[\r\n \"data-parent-submenu-id\"\r\n ] 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[\r\n \"onClick\"\r\n ] 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 &&\r\n \"bg-neutral-100 dark:bg-neutral-100 mx-2 my-1.5 rounded-md 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 >\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 >\r\n {children}\r\n </DropdownMenuSubTrigger>\r\n );\r\n}\r\n\r\nfunction DropDrawerSubContent({\r\n className,\r\n sideOffset = 4,\r\n children,\r\n ...props\r\n}: 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 >\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":["__webpack_require__","definition","key","Object","obj","prop","Symbol","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":";;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,C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AGAD,YAAYC;QACd;QAGA,MAAM,EAAE,GAAG2B,WAAW,GAAGxG;QAGzB,OACE,WADF,GACE,sCAAC;YACC,KAAKsE;YACL,aAAU;YACV,cAAYJ;YACZ,WAAWZ,IAAAA,0BAAAA,EAAAA,EACT,8DAEA,CAACiB,iBACC,0GAEFA,iBAAiB,uBACjBL,SAAS,QACT3D;YAEF,SAAS8F;YACR,GAAGG,SAAS;;8BAEb,qCAAC;oBAAI,WAAU;8BAA2BzG;;8BAC1C,qCAAC0G,sCAAAA,gBAAgBA,EAAAA;oBAAC,WAAU;;;;IAGlC;IAEA,OACE,WADF,GACE,qCAACC,2CAAAA,sBAAsBA,EAAAA;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,OACE,WADF,GACE,qCAAC2G,2CAAAA,sBAAsBA,EAAAA;QACrB,aAAU;QACV,YAAYD;QACZ,WAAWrD,IAAAA,0BAAAA,EAAAA,EACT,gHACA/C;QAED,GAAGP,KAAK;kBAERD;;AAGP"}
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\fireworks-background.cjs","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,MACzBC,KAAK,MAAM,KAAMD,CAAAA,MAAMD,GAAE,IAAKA;AAChC,MAAMG,UAAU,CAACH,KAAaC,MAC5BC,KAAK,KAAK,CAACA,KAAK,MA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AAA,0BAAAA,EAAAA,EAAG,8BAA8B9B,aAAa;;;AAIjE;AAGFH,oBAAoB,WAAW,GAAG"}
1
+ {"version":3,"file":"components\\ui\\fireworks-background.cjs","sources":["webpack://@arolariu/components/webpack/runtime/define_property_getters","webpack://@arolariu/components/webpack/runtime/has_own_property","webpack://@arolariu/components/webpack/runtime/make_namespace_object","webpack://@arolariu/components/./src/components/ui/fireworks-background.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\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":["__webpack_require__","definition","key","Object","obj","prop","Symbol","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":";;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,sBAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,O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AAC,SAASkB;YACvCE,qBAAqBP;QACvB;IACF,GAAG;QACDrB;QACAlC;QACAmC;QACAC;QACAvB;QACAC;KACD;IAED,OACE,WADF,GACE,qCAAC;QACC,KAAK0B;QACL,WAAWuB,IAAAA,0BAAAA,EAAAA,EAAG,sCAAsC/B;QACnD,GAAGK,KAAK;kBAET,mDAAC;YACE,GAAGJ,WAAW;YACf,KAAKM;YACL,WAAWwB,IAAAA,0BAAAA,EAAAA,EAAG,8BAA8B9B,aAAa;;;AAIjE;AAGFH,oBAAoB,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\flip-button.cjs","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;AAEF,MAAMC,aAAa,WAAbA,GAAaC,+BAAAA,UAAgB,CACjC,CACE,EACEC,SAAS,EACTC,QAAQ,EACRC,aAAa;IAAE,MAAM;IAAU,WAAW;IAAK,SAAS;AAAG,CAAC,EAC5DC,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,CACnBC,SACAC,UACAC,SAAwB,IAAI,GACf;YACbF;YACA,CAACJ,WAAW,EAAEK;YACd,GAAIN,cAAcO,SAAAA,SAAkB;gBAAE,GAAGA;YAAO,IAAI,CAAC,CAAC;YACtD,GAAI,CAACP,cAAcO,SAAAA,SAAkB;gBAAE,GAAGA;YAAO,IAAI,CAAC,CAAC;QACzD;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,OACE,WADF,GACE,sCAACM,sBAAAA,MAAAA,CAAAA,MAAa;QACZ,KAAKX;QACL,SAAQ;QACR,YAAW;QACX,UAAU;YAAE,OAAO;QAAK;QACxB,WAAWY,IAAAA,0BAAAA,EAAAA,EACT,mHACAjB;QAED,GAAGI,KAAK;;0BAET,qCAACY,sBAAAA,MAAAA,CAAAA,IAAW;gBACV,UAAUF;gBACV,YAAYf;gBACZ,WAAWkB,IAAAA,0BAAAA,EAAAA,EACTvB,sBACA,uCACAO;0BAGDJ;;0BAEH,qCAACmB,sBAAAA,MAAAA,CAAAA,IAAW;gBACV,UAAUD;gBACV,YAAYhB;gBACZ,WAAWkB,IAAAA,0BAAAA,EAAAA,EACTvB,sBACA,sCACAQ;0BAGDJ;;0BAEH,qCAAC;gBAAK,WAAU;0BAAaD;;;;AAGnC;AAGFF,WAAW,WAAW,GAAG"}
1
+ {"version":3,"file":"components\\ui\\flip-button.cjs","sources":["webpack://@arolariu/components/webpack/runtime/define_property_getters","webpack://@arolariu/components/webpack/runtime/has_own_property","webpack://@arolariu/components/webpack/runtime/make_namespace_object","webpack://@arolariu/components/./src/components/ui/flip-button.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\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":["__webpack_require__","definition","key","Object","obj","prop","Symbol","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":";;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,sBAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAA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ACAO;0BAGDJ;;0BAEH,qCAACmB,sBAAAA,MAAAA,CAAAA,IAAW;gBACV,UAAUD;gBACV,YAAYhB;gBACZ,WAAWkB,IAAAA,0BAAAA,EAAAA,EACTvB,sBACA,sCACAQ;0BAGDJ;;0BAEH,qCAAC;gBAAK,WAAU;0BAAaD;;;;AAGnC;AAGFF,WAAW,WAAW,GAAG"}
@@ -25,14 +25,14 @@ var __webpack_require__ = {};
25
25
  var __webpack_exports__ = {};
26
26
  __webpack_require__.r(__webpack_exports__);
27
27
  __webpack_require__.d(__webpack_exports__, {
28
- FormMessage: ()=>FormMessage,
29
- FormDescription: ()=>FormDescription,
30
- FormControl: ()=>FormControl,
28
+ useFormField: ()=>useFormField,
31
29
  FormLabel: ()=>FormLabel,
30
+ FormControl: ()=>FormControl,
32
31
  FormItem: ()=>FormItem,
32
+ FormField: ()=>FormField,
33
+ FormMessage: ()=>FormMessage,
33
34
  Form: ()=>Form,
34
- useFormField: ()=>useFormField,
35
- FormField: ()=>FormField
35
+ FormDescription: ()=>FormDescription
36
36
  });
37
37
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
38
38
  const external_react_namespaceObject = require("react");
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\form.cjs","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","formMessageId","Slot","FormDescription","FormMessage","body","String"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,OAAOC,yCAAAA,YAAYA;AASzB,MAAMC,mBAAmB,WAAnBA,GAAmBC,+BAAAA,aAAmB,CAC1C,CAAC;AAGH,MAAMC,YAAY,CAGhB,EACA,GAAGC,OACkC,GAEnC,WADF,GACE,qCAACH,iBAAiB,QAAQ;QAAC,OAAO;YAAE,MAAMG,MAAM,IAAI;QAAC;kBACnD,mDAACC,yCAAAA,UAAUA,EAAAA;YAAE,GAAGD,KAAK;;;AAK3B,MAAME,eAAe;IACnB,MAAMC,eAAeL,+BAAAA,UAAgB,CAACD;IACtC,MAAMO,cAAcN,+BAAAA,UAAgB,CAACO;IACrC,MAAM,EAAEC,aAAa,EAAE,GAAGC,IAAAA,yCAAAA,cAAAA;IAC1B,MAAMC,YAAYC,IAAAA,yCAAAA,YAAAA,EAAa;QAAE,MAAMN,aAAa,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AC,CAACJ;QACf,GAAGjB,KAAK;;AAGf;AAEA,SAASwB,gBAAgB,EAAEV,SAAS,EAAE,GAAGd,OAAkC;IACzE,MAAM,EAAEqB,iBAAiB,EAAE,GAAGnB;IAE9B,OACE,WADF,GACE,qCAAC;QACC,aAAU;QACV,IAAImB;QACJ,WAAWN,IAAAA,0BAAAA,EAAAA,EACT,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,OACE,WADF,GACE,qCAAC;QACC,aAAU;QACV,IAAIJ;QACJ,WAAWP,IAAAA,0BAAAA,EAAAA,EAAG,0CAA0CD;QACvD,GAAGd,KAAK;kBAER0B;;AAGP"}
1
+ {"version":3,"file":"components\\ui\\form.cjs","sources":["webpack://@arolariu/components/webpack/runtime/define_property_getters","webpack://@arolariu/components/webpack/runtime/has_own_property","webpack://@arolariu/components/webpack/runtime/make_namespace_object","webpack://@arolariu/components/./src/components/ui/form.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\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":["__webpack_require__","definition","key","Object","obj","prop","Symbol","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":";;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,U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,aAAa,EAAE,GAAGpB;IACjC,MAAMwB,OAAOT,QAAQU,OAAOV,OAAO,WAAW,MAAMjB,MAAM,QAAQ;IAElE,IAAI,CAAC0B,MACH,OAAO;IAGT,OACE,WADF,GACE,qCAAC;QACC,aAAU;QACV,IAAIJ;QACJ,WAAWP,IAAAA,0BAAAA,EAAAA,EAAG,0CAA0CD;QACvD,GAAGd,KAAK;kBAER0B;;AAGP"}
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\gradient-background.cjs","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,+BAAAA,UAAgB,CAIzC,CACE,EACEC,SAAS,EACTC,aAAa;IAAE,UAAU;IAAI,MAAM;IAAa,QAAQC;AAAS,CAAC,EAClE,GAAGC,OACJ,EACDC,MAGE,WADF,GACE,qCAACC,sBAAAA,MAAAA,CAAAA,GAAU;QACT,KAAKD;QACL,WAAWE,IAAAA,0BAAAA,EAAAA,EACT,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.cjs","sources":["webpack://@arolariu/components/webpack/runtime/define_property_getters","webpack://@arolariu/components/webpack/runtime/has_own_property","webpack://@arolariu/components/webpack/runtime/make_namespace_object","webpack://@arolariu/components/./src/components/ui/gradient-background.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\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":["__webpack_require__","definition","key","Object","obj","prop","Symbol","GradientBackground","React","className","transition","Infinity","props","ref","motion","cn"],"mappings":";;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,sBAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;ACKA,MAAMI,qBAAqB,WAArBA,GAAqBC,+BAAAA,UAAgB,CAIzC,CACE,EACEC,SAAS,EACTC,aAAa;IAAE,UAAU;IAAI,MAAM;IAAa,QAAQC;AAAS,CAAC,EAClE,GAAGC,OACJ,EACDC,MAGE,WADF,GACE,qCAACC,sBAAAA,MAAAA,CAAAA,GAAU;QACT,KAAKD;QACL,WAAWE,IAAAA,0BAAAA,EAAAA,EACT,8FACAN;QAEF,SAAS;YACP,oBAAoB;gBAAC;gBAAU;gBAAY;aAAS;QACtD;QACA,YAAYC;QACX,GAAGE,KAAK;;AAMjBL,mBAAmB,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\gradient-text.cjs","sources":["webpack://@arolariu/components/./src/components/ui/gradient-text.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport { motion, type Transition } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface GradientTextProps extends React.HTMLAttributes<HTMLSpanElement> {\n text: string;\n gradient?: string;\n neon?: boolean;\n transition?: Transition;\n}\n\nconst GradientText = React.forwardRef<HTMLSpanElement, GradientTextProps>(\n (\n {\n text,\n className,\n gradient = \"linear-gradient(90deg, #3b82f6 0%, #a855f7 20%, #ec4899 50%, #a855f7 80%, #3b82f6 100%)\",\n neon = false,\n transition = { duration: 50, repeat: Infinity, ease: \"linear\" },\n ...props\n },\n ref\n ) => {\n const baseStyle: React.CSSProperties = {\n backgroundImage: gradient,\n };\n\n return (\n <span\n ref={ref}\n className={cn(\"relative inline-block\", className)}\n {...props}\n >\n <motion.span\n className=\"m-0 text-transparent bg-clip-text bg-[length:700%_100%] bg-[position:0%_0%]\"\n style={baseStyle}\n initial={{ backgroundPosition: \"0% 0%\" }}\n animate={{ backgroundPosition: \"500% 100%\" }}\n transition={transition}\n >\n {text}\n </motion.span>\n\n {neon && (\n <motion.span\n 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%]\"\n style={baseStyle}\n initial={{ backgroundPosition: \"0% 0%\" }}\n animate={{ backgroundPosition: \"500% 100%\" }}\n transition={transition}\n >\n {text}\n </motion.span>\n )}\n </span>\n );\n }\n);\n\nGradientText.displayName = \"GradientText\";\n\nexport { GradientText, type GradientTextProps };\n"],"names":["GradientText","React","text","className","gradient","neon","transition","Infinity","props","ref","baseStyle","cn","motion"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAMA,eAAe,WAAfA,GAAeC,+BAAAA,UAAgB,CACnC,CACE,EACEC,IAAI,EACJC,SAAS,EACTC,WAAW,yFAAyF,EACpGC,OAAO,KAAK,EACZC,aAAa;IAAE,UAAU;IAAI,QAAQC;IAAU,MAAM;AAAS,CAAC,EAC/D,GAAGC,OACJ,EACDC;IAEA,MAAMC,YAAiC;QACrC,iBAAiBN;IACnB;IAEA,OACE,WADF,GACE,sCAAC;QACC,KAAKK;QACL,WAAWE,IAAAA,0BAAAA,EAAAA,EAAG,yBAAyBR;QACtC,GAAGK,KAAK;;0BAET,qCAACI,sBAAAA,MAAAA,CAAAA,IAAW;gBACV,WAAU;gBACV,OAAOF;gBACP,SAAS;oBAAE,oBAAoB;gBAAQ;gBACvC,SAAS;oBAAE,oBAAoB;gBAAY;gBAC3C,YAAYJ;0BAEXJ;;YAGFG,QACC,WADDA,GACC,qCAACO,sBAAAA,MAAAA,CAAAA,IAAW;gBACV,WAAU;gBACV,OAAOF;gBACP,SAAS;oBAAE,oBAAoB;gBAAQ;gBACvC,SAAS;oBAAE,oBAAoB;gBAAY;gBAC3C,YAAYJ;0BAEXJ;;;;AAKX;AAGFF,aAAa,WAAW,GAAG"}
1
+ {"version":3,"file":"components\\ui\\gradient-text.cjs","sources":["webpack://@arolariu/components/webpack/runtime/define_property_getters","webpack://@arolariu/components/webpack/runtime/has_own_property","webpack://@arolariu/components/webpack/runtime/make_namespace_object","webpack://@arolariu/components/./src/components/ui/gradient-text.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n\nimport * as React from \"react\";\nimport { motion, type Transition } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface GradientTextProps extends React.HTMLAttributes<HTMLSpanElement> {\n text: string;\n gradient?: string;\n neon?: boolean;\n transition?: Transition;\n}\n\nconst GradientText = React.forwardRef<HTMLSpanElement, GradientTextProps>(\n (\n {\n text,\n className,\n gradient = \"linear-gradient(90deg, #3b82f6 0%, #a855f7 20%, #ec4899 50%, #a855f7 80%, #3b82f6 100%)\",\n neon = false,\n transition = { duration: 50, repeat: Infinity, ease: \"linear\" },\n ...props\n },\n ref,\n ) => {\n const baseStyle: React.CSSProperties = {\n backgroundImage: gradient,\n };\n\n return (\n <span\n ref={ref}\n className={cn(\"relative inline-block\", className)}\n {...props}\n >\n <motion.span\n className=\"m-0 text-transparent bg-clip-text bg-[length:700%_100%] bg-[position:0%_0%]\"\n style={baseStyle}\n initial={{ backgroundPosition: \"0% 0%\" }}\n animate={{ backgroundPosition: \"500% 100%\" }}\n transition={transition}\n >\n {text}\n </motion.span>\n\n {neon && (\n <motion.span\n 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%]\"\n style={baseStyle}\n initial={{ backgroundPosition: \"0% 0%\" }}\n animate={{ backgroundPosition: \"500% 100%\" }}\n transition={transition}\n >\n {text}\n </motion.span>\n )}\n </span>\n );\n },\n);\n\nGradientText.displayName = \"GradientText\";\n\nexport { GradientText, type GradientTextProps };\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","GradientText","React","text","className","gradient","neon","transition","Infinity","props","ref","baseStyle","cn","motion"],"mappings":";;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,sBAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;ACQA,MAAMI,eAAe,WAAfA,GAAeC,+BAAAA,UAAgB,CACnC,CACE,EACEC,IAAI,EACJC,SAAS,EACTC,WAAW,yFAAyF,EACpGC,OAAO,KAAK,EACZC,aAAa;IAAE,UAAU;IAAI,QAAQC;IAAU,MAAM;AAAS,CAAC,EAC/D,GAAGC,OACJ,EACDC;IAEA,MAAMC,YAAiC;QACrC,iBAAiBN;IACnB;IAEA,OACE,WADF,GACE,sCAAC;QACC,KAAKK;QACL,WAAWE,IAAAA,0BAAAA,EAAAA,EAAG,yBAAyBR;QACtC,GAAGK,KAAK;;0BAET,qCAACI,sBAAAA,MAAAA,CAAAA,IAAW;gBACV,WAAU;gBACV,OAAOF;gBACP,SAAS;oBAAE,oBAAoB;gBAAQ;gBACvC,SAAS;oBAAE,oBAAoB;gBAAY;gBAC3C,YAAYJ;0BAEXJ;;YAGFG,QACC,WADDA,GACC,qCAACO,sBAAAA,MAAAA,CAAAA,IAAW;gBACV,WAAU;gBACV,OAAOF;gBACP,SAAS;oBAAE,oBAAoB;gBAAQ;gBACvC,SAAS;oBAAE,oBAAoB;gBAAY;gBAC3C,YAAYJ;0BAEXJ;;;;AAKX;AAGFF,aAAa,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\highlight-text.cjs","sources":["webpack://@arolariu/components/./src/components/ui/highlight-text.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport {\n motion,\n useInView,\n type HTMLMotionProps,\n type Transition,\n type UseInViewOptions,\n} from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface HighlightTextProps extends HTMLMotionProps<\"span\"> {\n text: string;\n inView?: boolean;\n inViewMargin?: UseInViewOptions[\"margin\"];\n inViewOnce?: boolean;\n transition?: Transition;\n}\n\nconst animation = { backgroundSize: \"100% 100%\" };\n\nconst HighlightText = React.forwardRef<HTMLSpanElement, HighlightTextProps>(\n (\n {\n text,\n className,\n inView = false,\n inViewMargin = \"0px\",\n transition = { duration: 2, ease: \"easeInOut\" },\n ...props\n },\n ref\n ) => {\n const localRef = React.useRef<HTMLSpanElement>(null);\n React.useImperativeHandle(ref, () => localRef.current as HTMLSpanElement);\n\n const inViewResult = useInView(localRef, {\n once: true,\n margin: inViewMargin,\n });\n const isInView = !inView || inViewResult;\n\n return (\n <motion.span\n ref={localRef}\n initial={{\n backgroundSize: \"0% 100%\",\n }}\n animate={isInView ? animation : undefined}\n transition={transition}\n style={{\n backgroundRepeat: \"no-repeat\",\n backgroundPosition: \"left center\",\n display: \"inline\",\n }}\n className={cn(\n `relative inline-block px-2 py-1 rounded-lg bg-gradient-to-r from-blue-100 to-purple-100 dark:from-blue-500 dark:to-purple-500`,\n className\n )}\n {...props}\n >\n {text}\n </motion.span>\n );\n }\n);\nHighlightText.displayName = \"HighlightText\";\n\nexport { HighlightText, type HighlightTextProps };\n"],"names":["animation","HighlightText","React","text","className","inView","inViewMargin","transition","props","ref","localRef","inViewResult","useInView","isInView","motion","undefined","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAMA,YAAY;IAAE,gBAAgB;AAAY;AAEhD,MAAMC,gBAAgB,WAAhBA,GAAgBC,+BAAAA,UAAgB,CACpC,CACE,EACEC,IAAI,EACJC,SAAS,EACTC,SAAS,KAAK,EACdC,eAAe,KAAK,EACpBC,aAAa;IAAE,UAAU;IAAG,MAAM;AAAY,CAAC,EAC/C,GAAGC,OACJ,EACDC;IAEA,MAAMC,WAAWR,+BAAAA,MAAY,CAAkB;IAC/CA,+BAAAA,mBAAyB,CAACO,KAAK,IAAMC,SAAS,OAAO;IAErD,MAAMC,eAAeC,IAAAA,sBAAAA,SAAAA,EAAUF,UAAU;QACvC,MAAM;QACN,QAAQJ;IACV;IACA,MAAMO,WAAW,CAACR,UAAUM;IAE5B,OACE,WADF,GACE,qCAACG,sBAAAA,MAAAA,CAAAA,IAAW;QACV,KAAKJ;QACL,SAAS;YACP,gBAAgB;QAClB;QACA,SAASG,WAAWb,YAAYe;QAChC,YAAYR;QACZ,OAAO;YACL,kBAAkB;YAClB,oBAAoB;YACpB,SAAS;QACX;QACA,WAAWS,IAAAA,0BAAAA,EAAAA,EACT,iIACAZ;QAED,GAAGI,KAAK;kBAERL;;AAGP;AAEFF,cAAc,WAAW,GAAG"}
1
+ {"version":3,"file":"components\\ui\\highlight-text.cjs","sources":["webpack://@arolariu/components/webpack/runtime/define_property_getters","webpack://@arolariu/components/webpack/runtime/has_own_property","webpack://@arolariu/components/webpack/runtime/make_namespace_object","webpack://@arolariu/components/./src/components/ui/highlight-text.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n\nimport * as React from \"react\";\nimport {\n motion,\n useInView,\n type HTMLMotionProps,\n type Transition,\n type UseInViewOptions,\n} from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface HighlightTextProps extends HTMLMotionProps<\"span\"> {\n text: string;\n inView?: boolean;\n inViewMargin?: UseInViewOptions[\"margin\"];\n inViewOnce?: boolean;\n transition?: Transition;\n}\n\nconst animation = { backgroundSize: \"100% 100%\" };\n\nconst HighlightText = React.forwardRef<HTMLSpanElement, HighlightTextProps>(\n (\n {\n text,\n className,\n inView = false,\n inViewMargin = \"0px\",\n transition = { duration: 2, ease: \"easeInOut\" },\n ...props\n },\n ref,\n ) => {\n const localRef = React.useRef<HTMLSpanElement>(null);\n React.useImperativeHandle(ref, () => localRef.current as HTMLSpanElement);\n\n const inViewResult = useInView(localRef, {\n once: true,\n margin: inViewMargin,\n });\n const isInView = !inView || inViewResult;\n\n return (\n <motion.span\n ref={localRef}\n initial={{\n backgroundSize: \"0% 100%\",\n }}\n animate={isInView ? animation : undefined}\n transition={transition}\n style={{\n backgroundRepeat: \"no-repeat\",\n backgroundPosition: \"left center\",\n display: \"inline\",\n }}\n className={cn(\n `relative inline-block px-2 py-1 rounded-lg bg-gradient-to-r from-blue-100 to-purple-100 dark:from-blue-500 dark:to-purple-500`,\n className,\n )}\n {...props}\n >\n {text}\n </motion.span>\n );\n },\n);\nHighlightText.displayName = \"HighlightText\";\n\nexport { HighlightText, type HighlightTextProps };\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","animation","HighlightText","React","text","className","inView","inViewMargin","transition","props","ref","localRef","inViewResult","useInView","isInView","motion","undefined","cn"],"mappings":";;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,sBAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;ACeA,MAAMI,YAAY;IAAE,gBAAgB;AAAY;AAEhD,MAAMC,gBAAgB,WAAhBA,GAAgBC,+BAAAA,UAAgB,CACpC,CACE,EACEC,IAAI,EACJC,SAAS,EACTC,SAAS,KAAK,EACdC,eAAe,KAAK,EACpBC,aAAa;IAAE,UAAU;IAAG,MAAM;AAAY,CAAC,EAC/C,GAAGC,OACJ,EACDC;IAEA,MAAMC,WAAWR,+BAAAA,MAAY,CAAkB;IAC/CA,+BAAAA,mBAAyB,CAACO,KAAK,IAAMC,SAAS,OAAO;IAErD,MAAMC,eAAeC,IAAAA,sBAAAA,SAAAA,EAAUF,UAAU;QACvC,MAAM;QACN,QAAQJ;IACV;IACA,MAAMO,WAAW,CAACR,UAAUM;IAE5B,OACE,WADF,GACE,qCAACG,sBAAAA,MAAAA,CAAAA,IAAW;QACV,KAAKJ;QACL,SAAS;YACP,gBAAgB;QAClB;QACA,SAASG,WAAWb,YAAYe;QAChC,YAAYR;QACZ,OAAO;YACL,kBAAkB;YAClB,oBAAoB;YACpB,SAAS;QACX;QACA,WAAWS,IAAAA,0BAAAA,EAAAA,EACT,iIACAZ;QAED,GAAGI,KAAK;kBAERL;;AAGP;AAEFF,cAAc,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"components\\ui\\hole-background.cjs","sources":["webpack://@arolariu/components/./src/components/ui/hole-background.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface HoleBackgroundProps extends React.HTMLAttributes<HTMLCanvasElement> {\n strokeColor?: string;\n numberOfLines?: number;\n numberOfDiscs?: number;\n particleRGBColor?: [number, number, number];\n}\n\nconst HoleBackground = React.forwardRef<HTMLCanvasElement, HoleBackgroundProps>(\n (\n {\n strokeColor = \"#737373\",\n numberOfLines = 50,\n numberOfDiscs = 50,\n particleRGBColor = [255, 255, 255],\n className,\n children,\n ...props\n },\n ref\n ) => {\n const canvasRef = React.useRef<HTMLCanvasElement>(null);\n React.useImperativeHandle(\n ref,\n () => canvasRef.current as HTMLCanvasElement\n );\n\n const animationFrameIdRef = React.useRef<number>(0);\n const stateRef = React.useRef<any>({\n discs: [] as any[],\n lines: [] as any[],\n particles: [] as any[],\n clip: {},\n startDisc: {},\n endDisc: {},\n rect: { width: 0, height: 0 },\n render: { width: 0, height: 0, dpi: 1 },\n particleArea: {},\n linesCanvas: null,\n });\n\n const linear = (p: number) => p;\n const easeInExpo = (p: number) => (p === 0 ? 0 : Math.pow(2, 10 * (p - 1)));\n\n const tweenValue = React.useCallback(\n (start: number, end: number, p: number, ease: \"inExpo\" | null = null) => {\n const delta = end - start;\n const easeFn = ease === \"inExpo\" ? easeInExpo : linear;\n return start + delta * easeFn(p);\n },\n []\n );\n\n const tweenDisc = React.useCallback(\n (disc: any) => {\n const { startDisc, endDisc } = stateRef.current;\n disc.x = tweenValue(startDisc.x, endDisc.x, disc.p);\n disc.y = tweenValue(startDisc.y, endDisc.y, disc.p, \"inExpo\");\n disc.w = tweenValue(startDisc.w, endDisc.w, disc.p);\n disc.h = tweenValue(startDisc.h, endDisc.h, disc.p);\n },\n [tweenValue]\n );\n\n const setSize = React.useCallback(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const rect = canvas.getBoundingClientRect();\n stateRef.current.rect = { width: rect.width, height: rect.height };\n stateRef.current.render = {\n width: rect.width,\n height: rect.height,\n dpi: window.devicePixelRatio || 1,\n };\n canvas.width =\n stateRef.current.render.width * stateRef.current.render.dpi;\n canvas.height =\n stateRef.current.render.height * stateRef.current.render.dpi;\n }, []);\n\n const setDiscs = React.useCallback(() => {\n const { width, height } = stateRef.current.rect;\n stateRef.current.discs = [];\n stateRef.current.startDisc = {\n x: width * 0.5,\n y: height * 0.45,\n w: width * 0.75,\n h: height * 0.7,\n };\n stateRef.current.endDisc = {\n x: width * 0.5,\n y: height * 0.95,\n w: 0,\n h: 0,\n };\n let prevBottom = height;\n stateRef.current.clip = {};\n for (let i = 0; i < numberOfDiscs; i++) {\n const p = i / numberOfDiscs;\n const disc = { p, x: 0, y: 0, w: 0, h: 0 };\n tweenDisc(disc);\n const bottom = disc.y + disc.h;\n if (bottom <= prevBottom) {\n stateRef.current.clip = { disc: { ...disc }, i };\n }\n prevBottom = bottom;\n stateRef.current.discs.push(disc);\n }\n const clipPath = new Path2D();\n const disc = stateRef.current.clip.disc;\n clipPath.ellipse(disc.x, disc.y, disc.w, disc.h, 0, 0, Math.PI * 2);\n clipPath.rect(disc.x - disc.w, 0, disc.w * 2, disc.y);\n stateRef.current.clip.path = clipPath;\n }, [tweenDisc]);\n\n const setLines = React.useCallback(() => {\n const { width, height } = stateRef.current.rect;\n stateRef.current.lines = [];\n const linesAngle = (Math.PI * 2) / numberOfLines;\n for (let i = 0; i < numberOfLines; i++) {\n stateRef.current.lines.push([]);\n }\n stateRef.current.discs.forEach((disc: any) => {\n for (let i = 0; i < numberOfLines; i++) {\n const angle = i * linesAngle;\n const p = {\n x: disc.x + Math.cos(angle) * disc.w,\n y: disc.y + Math.sin(angle) * disc.h,\n };\n stateRef.current.lines[i].push(p);\n }\n });\n const offCanvas = document.createElement(\"canvas\");\n offCanvas.width = width;\n offCanvas.height = height;\n const ctx = offCanvas.getContext(\"2d\");\n if (!ctx) return;\n stateRef.current.lines.forEach((line: any) => {\n ctx.save();\n let lineIsIn = false;\n line.forEach((p1: any, j: number) => {\n if (j === 0) return;\n const p0 = line[j - 1];\n if (\n !lineIsIn &&\n (ctx.isPointInPath(stateRef.current.clip.path, p1.x, p1.y) ||\n ctx.isPointInStroke(stateRef.current.clip.path, p1.x, p1.y))\n ) {\n lineIsIn = true;\n } else if (lineIsIn) {\n ctx.clip(stateRef.current.clip.path);\n }\n ctx.beginPath();\n ctx.moveTo(p0.x, p0.y);\n ctx.lineTo(p1.x, p1.y);\n ctx.strokeStyle = strokeColor;\n ctx.lineWidth = 2;\n ctx.stroke();\n ctx.closePath();\n });\n ctx.restore();\n });\n stateRef.current.linesCanvas = offCanvas;\n }, [strokeColor]);\n\n const initParticle = React.useCallback((start: boolean = false) => {\n const sx =\n stateRef.current.particleArea.sx +\n stateRef.current.particleArea.sw * Math.random();\n const ex =\n stateRef.current.particleArea.ex +\n stateRef.current.particleArea.ew * Math.random();\n const dx = ex - sx;\n const y = start\n ? stateRef.current.particleArea.h * Math.random()\n : stateRef.current.particleArea.h;\n const r = 0.5 + Math.random() * 4;\n const vy = 0.5 + Math.random();\n return {\n x: sx,\n sx,\n dx,\n y,\n vy,\n p: 0,\n r,\n c: `rgba(${particleRGBColor[0]}, ${particleRGBColor[1]}, ${\n particleRGBColor[2]\n }, ${Math.random()})`,\n };\n }, []);\n\n const setParticles = React.useCallback(() => {\n const { width, height } = stateRef.current.rect;\n stateRef.current.particles = [];\n const disc = stateRef.current.clip.disc;\n stateRef.current.particleArea = {\n sw: disc.w * 0.5,\n ew: disc.w * 2,\n h: height * 0.85,\n };\n stateRef.current.particleArea.sx =\n (width - stateRef.current.particleArea.sw) / 2;\n stateRef.current.particleArea.ex =\n (width - stateRef.current.particleArea.ew) / 2;\n const totalParticles = 100;\n for (let i = 0; i < totalParticles; i++) {\n stateRef.current.particles.push(initParticle(true));\n }\n }, [initParticle]);\n\n const drawDiscs = React.useCallback(\n (ctx: CanvasRenderingContext2D) => {\n ctx.strokeStyle = strokeColor;\n ctx.lineWidth = 2;\n const outerDisc = stateRef.current.startDisc;\n ctx.beginPath();\n ctx.ellipse(\n outerDisc.x,\n outerDisc.y,\n outerDisc.w,\n outerDisc.h,\n 0,\n 0,\n Math.PI * 2\n );\n ctx.stroke();\n ctx.closePath();\n stateRef.current.discs.forEach((disc: any, i: number) => {\n if (i % 5 !== 0) return;\n if (disc.w < stateRef.current.clip.disc.w - 5) {\n ctx.save();\n ctx.clip(stateRef.current.clip.path);\n }\n ctx.beginPath();\n ctx.ellipse(disc.x, disc.y, disc.w, disc.h, 0, 0, Math.PI * 2);\n ctx.stroke();\n ctx.closePath();\n if (disc.w < stateRef.current.clip.disc.w - 5) {\n ctx.restore();\n }\n });\n },\n [strokeColor]\n );\n\n const drawLines = React.useCallback((ctx: CanvasRenderingContext2D) => {\n if (stateRef.current.linesCanvas) {\n ctx.drawImage(stateRef.current.linesCanvas, 0, 0);\n }\n }, []);\n\n const drawParticles = React.useCallback((ctx: CanvasRenderingContext2D) => {\n ctx.save();\n ctx.clip(stateRef.current.clip.path);\n stateRef.current.particles.forEach((particle: any) => {\n ctx.fillStyle = particle.c;\n ctx.beginPath();\n ctx.rect(particle.x, particle.y, particle.r, particle.r);\n ctx.closePath();\n ctx.fill();\n });\n ctx.restore();\n }, []);\n\n const moveDiscs = React.useCallback(() => {\n stateRef.current.discs.forEach((disc: any) => {\n disc.p = (disc.p + 0.001) % 1;\n tweenDisc(disc);\n });\n }, [tweenDisc]);\n\n const moveParticles = React.useCallback(() => {\n stateRef.current.particles.forEach((particle: any, idx: number) => {\n particle.p = 1 - particle.y / stateRef.current.particleArea.h;\n particle.x = particle.sx + particle.dx * particle.p;\n particle.y -= particle.vy;\n if (particle.y < 0) {\n stateRef.current.particles[idx] = initParticle();\n }\n });\n }, [initParticle]);\n\n const tick = React.useCallback(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.save();\n ctx.scale(stateRef.current.render.dpi, stateRef.current.render.dpi);\n moveDiscs();\n moveParticles();\n drawDiscs(ctx);\n drawLines(ctx);\n drawParticles(ctx);\n ctx.restore();\n animationFrameIdRef.current = requestAnimationFrame(tick);\n }, [moveDiscs, moveParticles, drawDiscs, drawLines, drawParticles]);\n\n const init = React.useCallback(() => {\n setSize();\n setDiscs();\n setLines();\n setParticles();\n }, [setSize, setDiscs, setLines, setParticles]);\n\n React.useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n init();\n tick();\n const handleResize = () => {\n setSize();\n setDiscs();\n setLines();\n setParticles();\n };\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n cancelAnimationFrame(animationFrameIdRef.current);\n };\n }, [init, tick, setSize, setDiscs, setLines, setParticles]);\n\n return (\n <div\n className={cn(\n \"relative size-full overflow-hidden\",\n 'before:content-[\"\"] before:absolute before:top-1/2 before:left-1/2 before:block before:size-[140%] dark:before:[background:radial-gradient(ellipse_at_50%_55%,transparent_10%,black_50%)] before:[background:radial-gradient(ellipse_at_50%_55%,transparent_10%,white_50%)] before:[transform:translate3d(-50%,-50%,0)]',\n 'after:content-[\"\"] after:absolute after:z-[5] after:top-1/2 after:left-1/2 after:block after:size-full after:[background:radial-gradient(ellipse_at_50%_75%,#a900ff_20%,transparent_75%)] after:[transform:translate3d(-50%,-50%,0)] after:mix-blend-overlay',\n className\n )}\n >\n {children}\n <canvas\n ref={canvasRef}\n className=\"absolute inset-0 block size-full dark:opacity-20 opacity-10\"\n {...props}\n />\n <motion.div\n className={cn(\n \"absolute top-[-71.5%] left-1/2 z-[3] w-[30%] h-[140%] rounded-b-full blur-3xl opacity-75 dark:mix-blend-plus-lighter mix-blend-plus-darker [transform:translate3d(-50%,0,0)] [background-position:0%_100%] [background-size:100%_200%]\",\n \"dark:[background:linear-gradient(20deg,#00f8f1,#ffbd1e20_16.5%,#fe848f_33%,#fe848f20_49.5%,#00f8f1_66%,#00f8f160_85.5%,#ffbd1e_100%)_0_100%_/_100%_200%] [background:linear-gradient(20deg,#00f8f1,#ffbd1e40_16.5%,#fe848f_33%,#fe848f40_49.5%,#00f8f1_66%,#00f8f180_85.5%,#ffbd1e_100%)_0_100%_/_100%_200%]\"\n )}\n animate={{ backgroundPosition: \"0% 300%\" }}\n transition={{ duration: 5, ease: \"linear\", repeat: Infinity }}\n />\n <div className=\"absolute top-0 left-0 z-[7] size-full dark:[background:repeating-linear-gradient(transparent,transparent_1px,white_1px,white_2px)] mix-blend-overlay opacity-50\" />\n </div>\n );\n }\n);\n\nexport { HoleBackground, type HoleBackgroundProps };\n"],"names":["HoleBackground","React","strokeColor","numberOfLines","numberOfDiscs","particleRGBColor","className","children","props","ref","canvasRef","animationFrameIdRef","stateRef","linear","p","easeInExpo","Math","tweenValue","start","end","ease","delta","easeFn","tweenDisc","disc","startDisc","endDisc","setSize","canvas","rect","window","setDiscs","width","height","prevBottom","i","bottom","clipPath","Path2D","setLines","linesAngle","angle","offCanvas","document","ctx","line","lineIsIn","p1","j","p0","initParticle","sx","ex","dx","y","r","vy","setParticles","totalParticles","drawDiscs","outerDisc","drawLines","drawParticles","particle","moveDiscs","moveParticles","idx","tick","requestAnimationFrame","init","handleResize","cancelAnimationFrame","cn","motion","Infinity"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAMA,iBAAiB,WAAjBA,GAAiBC,+BAAAA,UAAgB,CACrC,CACE,EACEC,cAAc,SAAS,EACvBC,gBAAgB,EAAE,EAClBC,gBAAgB,EAAE,EAClBC,mBAAmB;IAAC;IAAK;IAAK;CAAI,EAClCC,SAAS,EACTC,QAAQ,EACR,GAAGC,OACJ,EACDC;IAEA,MAAMC,YAAYT,+BAAAA,MAAY,CAAoB;IAClDA,+BAAAA,mBAAyB,CACvBQ,KACA,IAAMC,UAAU,OAAO;IAGzB,MAAMC,sBAAsBV,+BAAAA,MAAY,CAAS;IACjD,MAAMW,WAAWX,+BAAAA,MAAY,CAAM;QACjC,OAAO,EAAE;QACT,OAAO,EAAE;QACT,WAAW,EAAE;QACb,MAAM,CAAC;QACP,WAAW,CAAC;QACZ,SAAS,CAAC;QACV,MAAM;YAAE,OAAO;YAAG,QAAQ;QAAE;QAC5B,QAAQ;YAAE,OAAO;YAAG,QAAQ;YAAG,KAAK;QAAE;QACtC,cAAc,CAAC;QACf,aAAa;IACf;IAEA,MAAMY,SAAS,CAACC,IAAcA;IAC9B,MAAMC,aAAa,CAACD,IAAeA,MAAAA,IAAU,IAAIE,KAAK,GAAG,CAAC,GAAG,KAAMF,CAAAA,IAAI;IAEvE,MAAMG,aAAahB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AQ;QACAkB;IACF,GAAG;QAAC9B;QAASI;QAAUQ;QAAUkB;KAAa;IAE9CxD,+BAAAA,SAAe,CAAC;QACd,MAAM2B,SAASlB,UAAU,OAAO;QAChC,IAAI,CAACkB,QAAQ;QACbyC;QACAF;QACA,MAAMG,eAAe;YACnB3C;YACAI;YACAQ;YACAkB;QACF;QACA3B,OAAO,gBAAgB,CAAC,UAAUwC;QAClC,OAAO;YACLxC,OAAO,mBAAmB,CAAC,UAAUwC;YACrCC,qBAAqB5D,oBAAoB,OAAO;QAClD;IACF,GAAG;QAAC0D;QAAMF;QAAMxC;QAASI;QAAUQ;QAAUkB;KAAa;IAE1D,OACE,WADF,GACE,sCAAC;QACC,WAAWe,IAAAA,0BAAAA,EAAAA,EACT,sCACA,2TACA,gQACAlE;;YAGDC;0BACD,qCAAC;gBACC,KAAKG;gBACL,WAAU;gBACT,GAAGF,KAAK;;0BAEX,qCAACiE,sBAAAA,MAAAA,CAAAA,GAAU;gBACT,WAAWD,IAAAA,0BAAAA,EAAAA,EACT,0OACA;gBAEF,SAAS;oBAAE,oBAAoB;gBAAU;gBACzC,YAAY;oBAAE,UAAU;oBAAG,MAAM;oBAAU,QAAQE;gBAAS;;0BAE9D,qCAAC;gBAAI,WAAU;;;;AAGrB"}
1
+ {"version":3,"file":"components\\ui\\hole-background.cjs","sources":["webpack://@arolariu/components/webpack/runtime/define_property_getters","webpack://@arolariu/components/webpack/runtime/has_own_property","webpack://@arolariu/components/webpack/runtime/make_namespace_object","webpack://@arolariu/components/./src/components/ui/hole-background.tsx"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface HoleBackgroundProps extends React.HTMLAttributes<HTMLCanvasElement> {\n strokeColor?: string;\n numberOfLines?: number;\n numberOfDiscs?: number;\n particleRGBColor?: [number, number, number];\n}\n\nconst HoleBackground = React.forwardRef<HTMLCanvasElement, HoleBackgroundProps>(\n (\n {\n strokeColor = \"#737373\",\n numberOfLines = 50,\n numberOfDiscs = 50,\n particleRGBColor = [255, 255, 255],\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const canvasRef = React.useRef<HTMLCanvasElement>(null);\n React.useImperativeHandle(\n ref,\n () => canvasRef.current as HTMLCanvasElement,\n );\n\n const animationFrameIdRef = React.useRef<number>(0);\n const stateRef = React.useRef<any>({\n discs: [] as any[],\n lines: [] as any[],\n particles: [] as any[],\n clip: {},\n startDisc: {},\n endDisc: {},\n rect: { width: 0, height: 0 },\n render: { width: 0, height: 0, dpi: 1 },\n particleArea: {},\n linesCanvas: null,\n });\n\n const linear = (p: number) => p;\n const easeInExpo = (p: number) => (p === 0 ? 0 : Math.pow(2, 10 * (p - 1)));\n\n const tweenValue = React.useCallback(\n (start: number, end: number, p: number, ease: \"inExpo\" | null = null) => {\n const delta = end - start;\n const easeFn = ease === \"inExpo\" ? easeInExpo : linear;\n return start + delta * easeFn(p);\n },\n [],\n );\n\n const tweenDisc = React.useCallback(\n (disc: any) => {\n const { startDisc, endDisc } = stateRef.current;\n disc.x = tweenValue(startDisc.x, endDisc.x, disc.p);\n disc.y = tweenValue(startDisc.y, endDisc.y, disc.p, \"inExpo\");\n disc.w = tweenValue(startDisc.w, endDisc.w, disc.p);\n disc.h = tweenValue(startDisc.h, endDisc.h, disc.p);\n },\n [tweenValue],\n );\n\n const setSize = React.useCallback(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const rect = canvas.getBoundingClientRect();\n stateRef.current.rect = { width: rect.width, height: rect.height };\n stateRef.current.render = {\n width: rect.width,\n height: rect.height,\n dpi: window.devicePixelRatio || 1,\n };\n canvas.width =\n stateRef.current.render.width * stateRef.current.render.dpi;\n canvas.height =\n stateRef.current.render.height * stateRef.current.render.dpi;\n }, []);\n\n const setDiscs = React.useCallback(() => {\n const { width, height } = stateRef.current.rect;\n stateRef.current.discs = [];\n stateRef.current.startDisc = {\n x: width * 0.5,\n y: height * 0.45,\n w: width * 0.75,\n h: height * 0.7,\n };\n stateRef.current.endDisc = {\n x: width * 0.5,\n y: height * 0.95,\n w: 0,\n h: 0,\n };\n let prevBottom = height;\n stateRef.current.clip = {};\n for (let i = 0; i < numberOfDiscs; i++) {\n const p = i / numberOfDiscs;\n const disc = { p, x: 0, y: 0, w: 0, h: 0 };\n tweenDisc(disc);\n const bottom = disc.y + disc.h;\n if (bottom <= prevBottom) {\n stateRef.current.clip = { disc: { ...disc }, i };\n }\n prevBottom = bottom;\n stateRef.current.discs.push(disc);\n }\n const clipPath = new Path2D();\n const disc = stateRef.current.clip.disc;\n clipPath.ellipse(disc.x, disc.y, disc.w, disc.h, 0, 0, Math.PI * 2);\n clipPath.rect(disc.x - disc.w, 0, disc.w * 2, disc.y);\n stateRef.current.clip.path = clipPath;\n }, [tweenDisc]);\n\n const setLines = React.useCallback(() => {\n const { width, height } = stateRef.current.rect;\n stateRef.current.lines = [];\n const linesAngle = (Math.PI * 2) / numberOfLines;\n for (let i = 0; i < numberOfLines; i++) {\n stateRef.current.lines.push([]);\n }\n stateRef.current.discs.forEach((disc: any) => {\n for (let i = 0; i < numberOfLines; i++) {\n const angle = i * linesAngle;\n const p = {\n x: disc.x + Math.cos(angle) * disc.w,\n y: disc.y + Math.sin(angle) * disc.h,\n };\n stateRef.current.lines[i].push(p);\n }\n });\n const offCanvas = document.createElement(\"canvas\");\n offCanvas.width = width;\n offCanvas.height = height;\n const ctx = offCanvas.getContext(\"2d\");\n if (!ctx) return;\n stateRef.current.lines.forEach((line: any) => {\n ctx.save();\n let lineIsIn = false;\n line.forEach((p1: any, j: number) => {\n if (j === 0) return;\n const p0 = line[j - 1];\n if (\n !lineIsIn &&\n (ctx.isPointInPath(stateRef.current.clip.path, p1.x, p1.y) ||\n ctx.isPointInStroke(stateRef.current.clip.path, p1.x, p1.y))\n ) {\n lineIsIn = true;\n } else if (lineIsIn) {\n ctx.clip(stateRef.current.clip.path);\n }\n ctx.beginPath();\n ctx.moveTo(p0.x, p0.y);\n ctx.lineTo(p1.x, p1.y);\n ctx.strokeStyle = strokeColor;\n ctx.lineWidth = 2;\n ctx.stroke();\n ctx.closePath();\n });\n ctx.restore();\n });\n stateRef.current.linesCanvas = offCanvas;\n }, [strokeColor]);\n\n const initParticle = React.useCallback((start: boolean = false) => {\n const sx =\n stateRef.current.particleArea.sx +\n stateRef.current.particleArea.sw * Math.random();\n const ex =\n stateRef.current.particleArea.ex +\n stateRef.current.particleArea.ew * Math.random();\n const dx = ex - sx;\n const y = start\n ? stateRef.current.particleArea.h * Math.random()\n : stateRef.current.particleArea.h;\n const r = 0.5 + Math.random() * 4;\n const vy = 0.5 + Math.random();\n return {\n x: sx,\n sx,\n dx,\n y,\n vy,\n p: 0,\n r,\n c: `rgba(${particleRGBColor[0]}, ${particleRGBColor[1]}, ${\n particleRGBColor[2]\n }, ${Math.random()})`,\n };\n }, []);\n\n const setParticles = React.useCallback(() => {\n const { width, height } = stateRef.current.rect;\n stateRef.current.particles = [];\n const disc = stateRef.current.clip.disc;\n stateRef.current.particleArea = {\n sw: disc.w * 0.5,\n ew: disc.w * 2,\n h: height * 0.85,\n };\n stateRef.current.particleArea.sx =\n (width - stateRef.current.particleArea.sw) / 2;\n stateRef.current.particleArea.ex =\n (width - stateRef.current.particleArea.ew) / 2;\n const totalParticles = 100;\n for (let i = 0; i < totalParticles; i++) {\n stateRef.current.particles.push(initParticle(true));\n }\n }, [initParticle]);\n\n const drawDiscs = React.useCallback(\n (ctx: CanvasRenderingContext2D) => {\n ctx.strokeStyle = strokeColor;\n ctx.lineWidth = 2;\n const outerDisc = stateRef.current.startDisc;\n ctx.beginPath();\n ctx.ellipse(\n outerDisc.x,\n outerDisc.y,\n outerDisc.w,\n outerDisc.h,\n 0,\n 0,\n Math.PI * 2,\n );\n ctx.stroke();\n ctx.closePath();\n stateRef.current.discs.forEach((disc: any, i: number) => {\n if (i % 5 !== 0) return;\n if (disc.w < stateRef.current.clip.disc.w - 5) {\n ctx.save();\n ctx.clip(stateRef.current.clip.path);\n }\n ctx.beginPath();\n ctx.ellipse(disc.x, disc.y, disc.w, disc.h, 0, 0, Math.PI * 2);\n ctx.stroke();\n ctx.closePath();\n if (disc.w < stateRef.current.clip.disc.w - 5) {\n ctx.restore();\n }\n });\n },\n [strokeColor],\n );\n\n const drawLines = React.useCallback((ctx: CanvasRenderingContext2D) => {\n if (stateRef.current.linesCanvas) {\n ctx.drawImage(stateRef.current.linesCanvas, 0, 0);\n }\n }, []);\n\n const drawParticles = React.useCallback((ctx: CanvasRenderingContext2D) => {\n ctx.save();\n ctx.clip(stateRef.current.clip.path);\n stateRef.current.particles.forEach((particle: any) => {\n ctx.fillStyle = particle.c;\n ctx.beginPath();\n ctx.rect(particle.x, particle.y, particle.r, particle.r);\n ctx.closePath();\n ctx.fill();\n });\n ctx.restore();\n }, []);\n\n const moveDiscs = React.useCallback(() => {\n stateRef.current.discs.forEach((disc: any) => {\n disc.p = (disc.p + 0.001) % 1;\n tweenDisc(disc);\n });\n }, [tweenDisc]);\n\n const moveParticles = React.useCallback(() => {\n stateRef.current.particles.forEach((particle: any, idx: number) => {\n particle.p = 1 - particle.y / stateRef.current.particleArea.h;\n particle.x = particle.sx + particle.dx * particle.p;\n particle.y -= particle.vy;\n if (particle.y < 0) {\n stateRef.current.particles[idx] = initParticle();\n }\n });\n }, [initParticle]);\n\n const tick = React.useCallback(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.save();\n ctx.scale(stateRef.current.render.dpi, stateRef.current.render.dpi);\n moveDiscs();\n moveParticles();\n drawDiscs(ctx);\n drawLines(ctx);\n drawParticles(ctx);\n ctx.restore();\n animationFrameIdRef.current = requestAnimationFrame(tick);\n }, [moveDiscs, moveParticles, drawDiscs, drawLines, drawParticles]);\n\n const init = React.useCallback(() => {\n setSize();\n setDiscs();\n setLines();\n setParticles();\n }, [setSize, setDiscs, setLines, setParticles]);\n\n React.useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n init();\n tick();\n const handleResize = () => {\n setSize();\n setDiscs();\n setLines();\n setParticles();\n };\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n cancelAnimationFrame(animationFrameIdRef.current);\n };\n }, [init, tick, setSize, setDiscs, setLines, setParticles]);\n\n return (\n <div\n className={cn(\n \"relative size-full overflow-hidden\",\n 'before:content-[\"\"] before:absolute before:top-1/2 before:left-1/2 before:block before:size-[140%] dark:before:[background:radial-gradient(ellipse_at_50%_55%,transparent_10%,black_50%)] before:[background:radial-gradient(ellipse_at_50%_55%,transparent_10%,white_50%)] before:[transform:translate3d(-50%,-50%,0)]',\n 'after:content-[\"\"] after:absolute after:z-[5] after:top-1/2 after:left-1/2 after:block after:size-full after:[background:radial-gradient(ellipse_at_50%_75%,#a900ff_20%,transparent_75%)] after:[transform:translate3d(-50%,-50%,0)] after:mix-blend-overlay',\n className,\n )}\n >\n {children}\n <canvas\n ref={canvasRef}\n className=\"absolute inset-0 block size-full dark:opacity-20 opacity-10\"\n {...props}\n />\n <motion.div\n className={cn(\n \"absolute top-[-71.5%] left-1/2 z-[3] w-[30%] h-[140%] rounded-b-full blur-3xl opacity-75 dark:mix-blend-plus-lighter mix-blend-plus-darker [transform:translate3d(-50%,0,0)] [background-position:0%_100%] [background-size:100%_200%]\",\n \"dark:[background:linear-gradient(20deg,#00f8f1,#ffbd1e20_16.5%,#fe848f_33%,#fe848f20_49.5%,#00f8f1_66%,#00f8f160_85.5%,#ffbd1e_100%)_0_100%_/_100%_200%] [background:linear-gradient(20deg,#00f8f1,#ffbd1e40_16.5%,#fe848f_33%,#fe848f40_49.5%,#00f8f1_66%,#00f8f180_85.5%,#ffbd1e_100%)_0_100%_/_100%_200%]\",\n )}\n animate={{ backgroundPosition: \"0% 300%\" }}\n transition={{ duration: 5, ease: \"linear\", repeat: Infinity }}\n />\n <div className=\"absolute top-0 left-0 z-[7] size-full dark:[background:repeating-linear-gradient(transparent,transparent_1px,white_1px,white_2px)] mix-blend-overlay opacity-50\" />\n </div>\n );\n },\n);\n\nexport { HoleBackground, type HoleBackgroundProps };\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","HoleBackground","React","strokeColor","numberOfLines","numberOfDiscs","particleRGBColor","className","children","props","ref","canvasRef","animationFrameIdRef","stateRef","linear","p","easeInExpo","Math","tweenValue","start","end","ease","delta","easeFn","tweenDisc","disc","startDisc","endDisc","setSize","canvas","rect","window","setDiscs","width","height","prevBottom","i","bottom","clipPath","Path2D","setLines","linesAngle","angle","offCanvas","document","ctx","line","lineIsIn","p1","j","p0","initParticle","sx","ex","dx","y","r","vy","setParticles","totalParticles","drawDiscs","outerDisc","drawLines","drawParticles","particle","moveDiscs","moveParticles","idx","tick","requestAnimationFrame","init","handleResize","cancelAnimationFrame","cn","motion","Infinity"],"mappings":";;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CA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