@hanzo/ui 5.3.25 → 5.3.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/content/index.ts +26 -0
  2. package/docs/_registry/index.ts +426 -0
  3. package/docs/_registry/layout/docs-min.tsx +197 -0
  4. package/docs/_registry/layout/page-min.tsx +128 -0
  5. package/docs/components/accordion.tsx +118 -0
  6. package/docs/components/banner.tsx +144 -0
  7. package/docs/components/callout.tsx +112 -0
  8. package/docs/components/card.tsx +52 -0
  9. package/docs/components/codeblock.tsx +258 -0
  10. package/docs/components/dialog/search-algolia.tsx +132 -0
  11. package/docs/components/dialog/search-default.tsx +131 -0
  12. package/docs/components/dialog/search-orama.tsx +143 -0
  13. package/docs/components/dialog/search.tsx +529 -0
  14. package/docs/components/dynamic-codeblock.tsx +129 -0
  15. package/docs/components/files.tsx +81 -0
  16. package/docs/components/github-info.tsx +107 -0
  17. package/docs/components/heading.tsx +33 -0
  18. package/docs/components/image-zoom.css +77 -0
  19. package/docs/components/image-zoom.tsx +58 -0
  20. package/docs/components/index.ts +7 -0
  21. package/docs/components/inline-toc.tsx +48 -0
  22. package/docs/components/sidebar/base.tsx +451 -0
  23. package/docs/components/sidebar/link-item.tsx +65 -0
  24. package/docs/components/sidebar/page-tree.tsx +113 -0
  25. package/docs/components/sidebar/tabs/dropdown.tsx +109 -0
  26. package/docs/components/sidebar/tabs/index.tsx +89 -0
  27. package/docs/components/steps.tsx +9 -0
  28. package/docs/components/tabs.tsx +203 -0
  29. package/docs/components/toc/clerk.tsx +173 -0
  30. package/docs/components/toc/default.tsx +57 -0
  31. package/docs/components/toc/index.tsx +136 -0
  32. package/docs/components/type-table.tsx +174 -0
  33. package/docs/components/ui/accordion.tsx +88 -0
  34. package/docs/components/ui/button.tsx +28 -0
  35. package/docs/components/ui/collapsible.tsx +42 -0
  36. package/docs/components/ui/navigation-menu.tsx +83 -0
  37. package/docs/components/ui/popover.tsx +32 -0
  38. package/docs/components/ui/scroll-area.tsx +59 -0
  39. package/docs/components/ui/tabs.tsx +145 -0
  40. package/docs/contexts/i18n.tsx +56 -0
  41. package/docs/contexts/search.tsx +165 -0
  42. package/docs/contexts/tree.tsx +65 -0
  43. package/docs/css/black.css +39 -0
  44. package/docs/css/catppuccin.css +49 -0
  45. package/docs/css/colors/index.css +51 -0
  46. package/docs/css/dusk.css +47 -0
  47. package/docs/css/layouts/docs.css +1 -0
  48. package/docs/css/layouts/home.css +1 -0
  49. package/docs/css/layouts/notebook.css +1 -0
  50. package/docs/css/neutral.css +7 -0
  51. package/docs/css/ocean.css +48 -0
  52. package/docs/css/preset.css +305 -0
  53. package/docs/css/purple.css +39 -0
  54. package/docs/css/shadcn.css +36 -0
  55. package/docs/css/shiki.css +90 -0
  56. package/docs/css/solar.css +75 -0
  57. package/docs/css/style.css +9 -0
  58. package/docs/css/vitepress.css +77 -0
  59. package/docs/i18n.tsx +30 -0
  60. package/docs/icons.tsx +354 -0
  61. package/docs/layouts/docs/client.tsx +129 -0
  62. package/docs/layouts/docs/index.tsx +321 -0
  63. package/docs/layouts/docs/page/client.tsx +376 -0
  64. package/docs/layouts/docs/page/index.tsx +251 -0
  65. package/docs/layouts/docs/sidebar.tsx +265 -0
  66. package/docs/layouts/home/client.tsx +375 -0
  67. package/docs/layouts/home/index.tsx +51 -0
  68. package/docs/layouts/home/navbar.tsx +55 -0
  69. package/docs/layouts/notebook/client.tsx +281 -0
  70. package/docs/layouts/notebook/index.tsx +461 -0
  71. package/docs/layouts/notebook/page/client.tsx +375 -0
  72. package/docs/layouts/notebook/page/index.tsx +251 -0
  73. package/docs/layouts/notebook/sidebar.tsx +248 -0
  74. package/docs/layouts/shared/index.tsx +89 -0
  75. package/docs/layouts/shared/language-toggle.tsx +66 -0
  76. package/docs/layouts/shared/link-item.tsx +119 -0
  77. package/docs/layouts/shared/search-toggle.tsx +78 -0
  78. package/docs/layouts/shared/theme-toggle.tsx +86 -0
  79. package/docs/mdx.server.tsx +37 -0
  80. package/docs/mdx.tsx +97 -0
  81. package/docs/og.tsx +101 -0
  82. package/docs/page.tsx +85 -0
  83. package/docs/provider/base.tsx +173 -0
  84. package/docs/provider/next.tsx +23 -0
  85. package/docs/provider/react-router.tsx +23 -0
  86. package/docs/provider/tanstack.tsx +23 -0
  87. package/docs/provider/waku.tsx +23 -0
  88. package/docs/source.ts +3 -0
  89. package/docs/theme/typography/LICENSE +21 -0
  90. package/docs/theme/typography/index.ts +201 -0
  91. package/docs/theme/typography/styles.ts +449 -0
  92. package/docs/utils/cn.ts +1 -0
  93. package/docs/utils/is-active.ts +23 -0
  94. package/docs/utils/merge-refs.ts +15 -0
  95. package/docs/utils/use-copy-button.ts +39 -0
  96. package/docs/utils/use-footer-items.ts +27 -0
  97. package/docs/utils/use-is-scroll-top.ts +21 -0
  98. package/package.json +8 -2
  99. package/dist/3d/button.js +0 -298
  100. package/dist/3d/button.mjs +0 -273
  101. package/dist/3d/card.js +0 -234
  102. package/dist/3d/card.mjs +0 -207
  103. package/dist/3d/carousel.js +0 -371
  104. package/dist/3d/carousel.mjs +0 -344
  105. package/dist/3d/grid.js +0 -362
  106. package/dist/3d/grid.mjs +0 -337
  107. package/dist/3d/index.js +0 -1518
  108. package/dist/3d/index.mjs +0 -1472
  109. package/dist/3d/marquee.js +0 -352
  110. package/dist/3d/marquee.mjs +0 -327
  111. package/dist/3d/pin.js +0 -46
  112. package/dist/3d/pin.mjs +0 -24
  113. package/dist/accordion.js +0 -80
  114. package/dist/accordion.mjs +0 -55
  115. package/dist/alert-dialog.js +0 -220
  116. package/dist/alert-dialog.mjs +0 -187
  117. package/dist/alert.js +0 -68
  118. package/dist/alert.mjs +0 -64
  119. package/dist/animation/animated-background.js +0 -424
  120. package/dist/animation/animated-background.mjs +0 -418
  121. package/dist/animation/animated-beam.js +0 -119
  122. package/dist/animation/animated-beam.mjs +0 -97
  123. package/dist/animation/animated-cursor.js +0 -275
  124. package/dist/animation/animated-cursor.mjs +0 -270
  125. package/dist/animation/animated-icon.js +0 -357
  126. package/dist/animation/animated-icon.mjs +0 -351
  127. package/dist/animation/animated-list.js +0 -339
  128. package/dist/animation/animated-list.mjs +0 -333
  129. package/dist/animation/animated-number.js +0 -283
  130. package/dist/animation/animated-number.mjs +0 -277
  131. package/dist/animation/animated-testimonials.js +0 -97
  132. package/dist/animation/animated-testimonials.mjs +0 -75
  133. package/dist/animation/animated-tooltip.js +0 -67
  134. package/dist/animation/animated-tooltip.mjs +0 -45
  135. package/dist/animation/apple-cards-carousel.js +0 -308
  136. package/dist/animation/apple-cards-carousel.mjs +0 -285
  137. package/dist/animation/apple-hello-effect.js +0 -60
  138. package/dist/animation/apple-hello-effect.mjs +0 -38
  139. package/dist/animation/index.js +0 -1952
  140. package/dist/animation/index.mjs +0 -1921
  141. package/dist/avatar.js +0 -71
  142. package/dist/avatar.mjs +0 -47
  143. package/dist/badge.js +0 -66
  144. package/dist/badge.mjs +0 -40
  145. package/dist/blocks/index.js +0 -1665
  146. package/dist/blocks/index.mjs +0 -1626
  147. package/dist/breadcrumb.js +0 -107
  148. package/dist/breadcrumb.mjs +0 -99
  149. package/dist/calendar.js +0 -189
  150. package/dist/calendar.mjs +0 -164
  151. package/dist/carousel.js +0 -278
  152. package/dist/carousel.mjs +0 -249
  153. package/dist/checkbox.js +0 -60
  154. package/dist/checkbox.mjs +0 -35
  155. package/dist/code/block.js +0 -226
  156. package/dist/code/block.mjs +0 -203
  157. package/dist/code/compare.js +0 -446
  158. package/dist/code/compare.mjs +0 -423
  159. package/dist/code/diff.js +0 -430
  160. package/dist/code/diff.mjs +0 -407
  161. package/dist/code/editor.js +0 -243
  162. package/dist/code/editor.mjs +0 -218
  163. package/dist/code/explorer.js +0 -291
  164. package/dist/code/explorer.mjs +0 -268
  165. package/dist/code/index.js +0 -2551
  166. package/dist/code/index.mjs +0 -2510
  167. package/dist/code/preview.js +0 -400
  168. package/dist/code/preview.mjs +0 -377
  169. package/dist/code/snippet.js +0 -274
  170. package/dist/code/snippet.mjs +0 -250
  171. package/dist/code/tabs.js +0 -75
  172. package/dist/code/tabs.mjs +0 -53
  173. package/dist/code/terminal.js +0 -437
  174. package/dist/code/terminal.mjs +0 -414
  175. package/dist/collapsible.js +0 -33
  176. package/dist/collapsible.mjs +0 -9
  177. package/dist/command.js +0 -262
  178. package/dist/command.mjs +0 -232
  179. package/dist/context-menu.js +0 -207
  180. package/dist/context-menu.mjs +0 -171
  181. package/dist/device/index.js +0 -3
  182. package/dist/device/index.mjs +0 -2
  183. package/dist/dialog.js +0 -151
  184. package/dist/dialog.mjs +0 -121
  185. package/dist/dock/basic.js +0 -174
  186. package/dist/dock/basic.mjs +0 -151
  187. package/dist/dock/index.js +0 -628
  188. package/dist/dock/index.mjs +0 -601
  189. package/dist/dock/limelight-nav.js +0 -295
  190. package/dist/dock/limelight-nav.mjs +0 -274
  191. package/dist/dock/macos.js +0 -141
  192. package/dist/dock/macos.mjs +0 -118
  193. package/dist/dock/menu.js +0 -70
  194. package/dist/dock/menu.mjs +0 -48
  195. package/dist/dock/message.js +0 -144
  196. package/dist/dock/message.mjs +0 -122
  197. package/dist/drawer.js +0 -115
  198. package/dist/drawer.mjs +0 -103
  199. package/dist/dropdown-menu.js +0 -202
  200. package/dist/dropdown-menu.mjs +0 -166
  201. package/dist/finance/AdvancedChart.js +0 -48
  202. package/dist/finance/AdvancedChart.mjs +0 -46
  203. package/dist/finance/CompanyProfile.js +0 -48
  204. package/dist/finance/CompanyProfile.mjs +0 -46
  205. package/dist/finance/CryptoScreener.js +0 -45
  206. package/dist/finance/CryptoScreener.mjs +0 -43
  207. package/dist/finance/Financials.js +0 -52
  208. package/dist/finance/Financials.mjs +0 -50
  209. package/dist/finance/ForexScreener.js +0 -46
  210. package/dist/finance/ForexScreener.mjs +0 -44
  211. package/dist/finance/MarketOverview.js +0 -104
  212. package/dist/finance/MarketOverview.mjs +0 -102
  213. package/dist/finance/NewsTimeline.js +0 -44
  214. package/dist/finance/NewsTimeline.mjs +0 -42
  215. package/dist/finance/OrderEntry.js +0 -131
  216. package/dist/finance/OrderEntry.mjs +0 -129
  217. package/dist/finance/OrdersHistory.js +0 -64
  218. package/dist/finance/OrdersHistory.mjs +0 -62
  219. package/dist/finance/PositionsList.js +0 -80
  220. package/dist/finance/PositionsList.mjs +0 -78
  221. package/dist/finance/StockScreener.js +0 -46
  222. package/dist/finance/StockScreener.mjs +0 -44
  223. package/dist/finance/SymbolInfo.js +0 -46
  224. package/dist/finance/SymbolInfo.mjs +0 -44
  225. package/dist/finance/TechnicalAnalysis.js +0 -54
  226. package/dist/finance/TechnicalAnalysis.mjs +0 -52
  227. package/dist/finance/TickerTape.js +0 -56
  228. package/dist/finance/TickerTape.mjs +0 -54
  229. package/dist/finance/TradingPanel.js +0 -191
  230. package/dist/finance/TradingPanel.mjs +0 -189
  231. package/dist/finance/index.js +0 -930
  232. package/dist/finance/index.mjs +0 -914
  233. package/dist/form/index.js +0 -155
  234. package/dist/form/index.mjs +0 -125
  235. package/dist/form.js +0 -172
  236. package/dist/form.mjs +0 -142
  237. package/dist/hover-card.js +0 -58
  238. package/dist/hover-card.mjs +0 -34
  239. package/dist/index.js +0 -10179
  240. package/dist/index.mjs +0 -9785
  241. package/dist/input-otp.js +0 -79
  242. package/dist/input-otp.mjs +0 -54
  243. package/dist/lib/utils.js +0 -28
  244. package/dist/lib/utils.mjs +0 -24
  245. package/dist/navigation/index.js +0 -98
  246. package/dist/navigation/index.mjs +0 -79
  247. package/dist/navigation-menu.js +0 -149
  248. package/dist/navigation-menu.mjs +0 -116
  249. package/dist/pattern/grid-pattern.js +0 -333
  250. package/dist/pattern/grid-pattern.mjs +0 -310
  251. package/dist/pattern/index.js +0 -333
  252. package/dist/pattern/index.mjs +0 -310
  253. package/dist/popover.js +0 -63
  254. package/dist/popover.mjs +0 -37
  255. package/dist/primitives/index.js +0 -10179
  256. package/dist/primitives/index.mjs +0 -9785
  257. package/dist/primitives-export.js +0 -10179
  258. package/dist/primitives-export.mjs +0 -9785
  259. package/dist/progress.js +0 -62
  260. package/dist/progress.mjs +0 -37
  261. package/dist/project/gantt.js +0 -65
  262. package/dist/project/gantt.mjs +0 -43
  263. package/dist/project/index.js +0 -636
  264. package/dist/project/index.mjs +0 -611
  265. package/dist/project/kanban.js +0 -597
  266. package/dist/project/kanban.mjs +0 -572
  267. package/dist/project/list.js +0 -35
  268. package/dist/project/list.mjs +0 -12
  269. package/dist/radio-group.js +0 -68
  270. package/dist/radio-group.mjs +0 -45
  271. package/dist/resizable.js +0 -72
  272. package/dist/resizable.mjs +0 -48
  273. package/dist/scroll-area.js +0 -89
  274. package/dist/scroll-area.mjs +0 -66
  275. package/dist/select.js +0 -140
  276. package/dist/select.mjs +0 -111
  277. package/dist/separator.js +0 -59
  278. package/dist/separator.mjs +0 -34
  279. package/dist/sheet.js +0 -148
  280. package/dist/sheet.mjs +0 -117
  281. package/dist/skeleton.js +0 -32
  282. package/dist/skeleton.mjs +0 -27
  283. package/dist/slider.js +0 -99
  284. package/dist/slider.mjs +0 -73
  285. package/dist/sonner.js +0 -34
  286. package/dist/sonner.mjs +0 -29
  287. package/dist/switch.js +0 -62
  288. package/dist/switch.mjs +0 -37
  289. package/dist/table.js +0 -110
  290. package/dist/table.mjs +0 -101
  291. package/dist/tabs.js +0 -82
  292. package/dist/tabs.mjs +0 -57
  293. package/dist/tailwind/index.js +0 -2023
  294. package/dist/tailwind/index.mjs +0 -2011
  295. package/dist/textarea.js +0 -78
  296. package/dist/textarea.mjs +0 -56
  297. package/dist/toggle-group.js +0 -118
  298. package/dist/toggle-group.mjs +0 -93
  299. package/dist/toggle.js +0 -71
  300. package/dist/toggle.mjs +0 -48
  301. package/dist/tooltip.js +0 -67
  302. package/dist/tooltip.mjs +0 -40
  303. package/dist/types/index.js +0 -57
  304. package/dist/types/index.mjs +0 -51
  305. package/dist/ui/announcement.js +0 -129
  306. package/dist/ui/announcement.mjs +0 -107
  307. package/dist/ui/avatar-group.js +0 -88
  308. package/dist/ui/avatar-group.mjs +0 -65
  309. package/dist/ui/banner.js +0 -85
  310. package/dist/ui/banner.mjs +0 -62
  311. package/dist/ui/cursor.js +0 -78
  312. package/dist/ui/cursor.mjs +0 -56
  313. package/dist/ui/index.js +0 -475
  314. package/dist/ui/index.mjs +0 -442
  315. package/dist/ui/marquee.js +0 -74
  316. package/dist/ui/marquee.mjs +0 -52
  317. package/dist/ui/pill.js +0 -85
  318. package/dist/ui/pill.mjs +0 -62
  319. package/dist/ui/spinner.js +0 -28
  320. package/dist/ui/spinner.mjs +0 -26
  321. package/dist/ui/tags.js +0 -101
  322. package/dist/ui/tags.mjs +0 -79
  323. package/dist/ui/ticker.js +0 -73
  324. package/dist/ui/ticker.mjs +0 -51
  325. package/dist/util/index.js +0 -457
  326. package/dist/util/index.mjs +0 -399
@@ -1,1921 +0,0 @@
1
- "use client";
2
- import * as React9 from 'react';
3
- import { useMemo, useState, useEffect, useCallback, useRef } from 'react';
4
- import { motion, AnimatePresence, Reorder, useMotionValue as useMotionValue$1, useTransform as useTransform$1, useSpring } from 'motion/react';
5
- import { cn as cn$1 } from '@/lib/utils';
6
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
- import { cn } from '@hanzo/ui/lib/utils';
8
- import { Avatar, AvatarImage, AvatarFallback } from '@hanzo/ui/primitives/avatar';
9
- import { Card, CardContent, Button } from '@hanzo/ui';
10
- import { AnimatePresence as AnimatePresence$1, motion as motion$1, useMotionValue, useTransform } from 'framer-motion';
11
- import { ChevronLeft, ChevronRight } from 'lucide-react';
12
-
13
- var __defProp = Object.defineProperty;
14
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
- function usePrefersReducedMotion() {
16
- const [prefersReducedMotion, setPrefersReducedMotion] = useState(false);
17
- useEffect(() => {
18
- if (typeof window === "undefined") return;
19
- const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
20
- setPrefersReducedMotion(mediaQuery.matches);
21
- const handleChange = /* @__PURE__ */ __name((event) => {
22
- setPrefersReducedMotion(event.matches);
23
- }, "handleChange");
24
- mediaQuery.addEventListener("change", handleChange);
25
- return () => mediaQuery.removeEventListener("change", handleChange);
26
- }, []);
27
- return prefersReducedMotion;
28
- }
29
- __name(usePrefersReducedMotion, "usePrefersReducedMotion");
30
- function GradientBackground({
31
- colors,
32
- speed,
33
- intensity,
34
- paused
35
- }) {
36
- const gradientColors = colors.length >= 2 ? colors : ["#ff6b6b", "#4ecdc4", "#45b7d1", "#96ceb4"];
37
- return /* @__PURE__ */ jsx(
38
- motion.div,
39
- {
40
- className: "absolute inset-0",
41
- style: {
42
- background: `linear-gradient(-45deg, ${gradientColors.join(", ")})`,
43
- backgroundSize: "400% 400%"
44
- },
45
- animate: paused ? {} : {
46
- x: ["0%", "100%", "0%"]
47
- },
48
- transition: {
49
- duration: 10 / speed,
50
- repeat: Infinity,
51
- ease: "linear"
52
- }
53
- }
54
- );
55
- }
56
- __name(GradientBackground, "GradientBackground");
57
- function BlobBackground({
58
- colors,
59
- speed,
60
- elementCount,
61
- intensity,
62
- paused
63
- }) {
64
- const blobs = useMemo(
65
- () => Array.from({ length: elementCount }, (_, i) => ({
66
- id: i,
67
- color: colors[i % colors.length],
68
- size: Math.random() * 200 + 100,
69
- x: Math.random() * 100,
70
- y: Math.random() * 100,
71
- duration: (Math.random() * 10 + 10) / speed
72
- })),
73
- [elementCount, colors, speed]
74
- );
75
- return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 overflow-hidden", children: blobs.map((blob) => /* @__PURE__ */ jsx(
76
- motion.div,
77
- {
78
- className: "absolute rounded-full",
79
- style: {
80
- background: `radial-gradient(circle, ${blob.color}40, transparent)`,
81
- width: blob.size * intensity,
82
- height: blob.size * intensity,
83
- filter: "blur(40px)"
84
- },
85
- initial: {
86
- x: `${blob.x}%`,
87
- y: `${blob.y}%`
88
- },
89
- animate: paused ? {} : {
90
- x: [`${blob.x}%`, `${(blob.x + 50) % 100}%`, `${blob.x}%`],
91
- y: [`${blob.y}%`, `${(blob.y + 30) % 100}%`, `${blob.y}%`],
92
- scale: [1, 1.2, 1]
93
- },
94
- transition: {
95
- duration: blob.duration,
96
- repeat: Infinity,
97
- ease: "easeInOut"
98
- }
99
- },
100
- blob.id
101
- )) });
102
- }
103
- __name(BlobBackground, "BlobBackground");
104
- function WaveBackground({
105
- colors,
106
- speed,
107
- intensity,
108
- paused
109
- }) {
110
- const waveColor = colors[0] || "#4ecdc4";
111
- return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 overflow-hidden", children: [0, 1, 2].map((index) => /* @__PURE__ */ jsx(
112
- motion.div,
113
- {
114
- className: "absolute inset-0",
115
- style: {
116
- background: `radial-gradient(ellipse 100% 50% at center ${50 + index * 20}%, ${waveColor}${Math.round(
117
- 30 * intensity
118
- ).toString(16).padStart(2, "0")}, transparent)`
119
- },
120
- animate: paused ? {} : {
121
- y: [index * 10, index * 10 + 20 * intensity, index * 10]
122
- },
123
- transition: {
124
- duration: (3 + index) / speed,
125
- repeat: Infinity,
126
- ease: "easeInOut"
127
- }
128
- },
129
- index
130
- )) });
131
- }
132
- __name(WaveBackground, "WaveBackground");
133
- function MeshBackground({
134
- colors,
135
- speed,
136
- intensity,
137
- paused
138
- }) {
139
- const meshColors = colors.length >= 4 ? colors.slice(0, 4) : ["#ff6b6b", "#4ecdc4", "#45b7d1", "#96ceb4"];
140
- return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 overflow-hidden", children: meshColors.map((color, index) => /* @__PURE__ */ jsx(
141
- motion.div,
142
- {
143
- className: "absolute rounded-full",
144
- style: {
145
- background: `radial-gradient(circle, ${color}60, transparent)`,
146
- width: `${60 + index * 20}%`,
147
- height: `${60 + index * 20}%`,
148
- filter: "blur(60px)",
149
- mixBlendMode: "multiply"
150
- },
151
- initial: {
152
- x: `${25 + index * 15}%`,
153
- y: `${25 + index * 15}%`
154
- },
155
- animate: paused ? {} : {
156
- x: [
157
- `${25 + index * 15}%`,
158
- `${35 + index * 15}%`,
159
- `${25 + index * 15}%`
160
- ],
161
- y: [
162
- `${25 + index * 15}%`,
163
- `${15 + index * 15}%`,
164
- `${25 + index * 15}%`
165
- ],
166
- rotate: [0, 180, 360]
167
- },
168
- transition: {
169
- duration: (8 + index * 2) / speed,
170
- repeat: Infinity,
171
- ease: "easeInOut"
172
- }
173
- },
174
- index
175
- )) });
176
- }
177
- __name(MeshBackground, "MeshBackground");
178
- function ParallaxBackground({
179
- layers,
180
- speed,
181
- paused
182
- }) {
183
- const mouseX = useMotionValue$1(0);
184
- const mouseY = useMotionValue$1(0);
185
- useEffect(() => {
186
- const handleMouseMove = /* @__PURE__ */ __name((e) => {
187
- const { clientX, clientY } = e;
188
- const { innerWidth, innerHeight } = window;
189
- mouseX.set((clientX / innerWidth - 0.5) * 100);
190
- mouseY.set((clientY / innerHeight - 0.5) * 100);
191
- }, "handleMouseMove");
192
- window.addEventListener("mousemove", handleMouseMove);
193
- return () => window.removeEventListener("mousemove", handleMouseMove);
194
- }, [mouseX, mouseY]);
195
- return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 overflow-hidden", children: layers.map((layer, index) => {
196
- const x = useTransform$1(
197
- mouseX,
198
- [-50, 50],
199
- [-layer.speed * 10, layer.speed * 10]
200
- );
201
- const y = useTransform$1(
202
- mouseY,
203
- [-50, 50],
204
- [-layer.speed * 10, layer.speed * 10]
205
- );
206
- return /* @__PURE__ */ jsx(
207
- motion.div,
208
- {
209
- className: "absolute inset-0",
210
- style: {
211
- background: `radial-gradient(circle, ${layer.color}, transparent)`,
212
- opacity: layer.opacity,
213
- x: paused ? 0 : x,
214
- y: paused ? 0 : y
215
- }
216
- },
217
- index
218
- );
219
- }) });
220
- }
221
- __name(ParallaxBackground, "ParallaxBackground");
222
- function ParticlesBackground({
223
- colors,
224
- speed,
225
- elementCount,
226
- intensity,
227
- paused
228
- }) {
229
- const particles = useMemo(
230
- () => Array.from({ length: elementCount }, (_, i) => ({
231
- id: i,
232
- color: colors[i % colors.length],
233
- size: Math.random() * 4 + 2,
234
- x: Math.random() * 100,
235
- y: Math.random() * 100,
236
- duration: (Math.random() * 20 + 20) / speed,
237
- delay: Math.random() * 5
238
- })),
239
- [elementCount, colors, speed]
240
- );
241
- return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 overflow-hidden", children: particles.map((particle) => /* @__PURE__ */ jsx(
242
- motion.div,
243
- {
244
- className: "absolute rounded-full",
245
- style: {
246
- backgroundColor: particle.color,
247
- width: particle.size * intensity,
248
- height: particle.size * intensity,
249
- opacity: 0.6
250
- },
251
- initial: {
252
- x: `${particle.x}%`,
253
- y: `${particle.y}%`
254
- },
255
- animate: paused ? {} : {
256
- y: [`${particle.y}%`, `${particle.y - 100}%`],
257
- opacity: [0, 0.6, 0]
258
- },
259
- transition: {
260
- duration: particle.duration,
261
- repeat: Infinity,
262
- delay: particle.delay,
263
- ease: "linear"
264
- }
265
- },
266
- particle.id
267
- )) });
268
- }
269
- __name(ParticlesBackground, "ParticlesBackground");
270
- function AnimatedBackground({
271
- animation = "gradient",
272
- speed = 1,
273
- colors = ["#ff6b6b", "#4ecdc4", "#45b7d1", "#96ceb4", "#ffeaa7"],
274
- paused = false,
275
- className,
276
- style,
277
- children,
278
- intensity = 1,
279
- blur = false,
280
- blurAmount = 20,
281
- opacity = 1,
282
- elementCount = 5,
283
- width = "100%",
284
- height = "100%",
285
- fullscreen = false,
286
- parallaxLayers = [
287
- { speed: 0.5, color: "#ff6b6b50", opacity: 0.3 },
288
- { speed: 1, color: "#4ecdc450", opacity: 0.4 },
289
- { speed: 1.5, color: "#45b7d150", opacity: 0.3 }
290
- ]
291
- }) {
292
- const prefersReducedMotion = usePrefersReducedMotion();
293
- const isAnimationPaused = paused || prefersReducedMotion;
294
- const containerStyle = useMemo(
295
- () => ({
296
- width: fullscreen ? "100vw" : width,
297
- height: fullscreen ? "100vh" : height,
298
- opacity,
299
- filter: blur ? `blur(${blurAmount}px)` : void 0,
300
- ...style
301
- }),
302
- [fullscreen, width, height, opacity, blur, blurAmount, style]
303
- );
304
- const renderAnimation = /* @__PURE__ */ __name(() => {
305
- const props = { colors, speed, intensity, paused: isAnimationPaused };
306
- switch (animation) {
307
- case "blob":
308
- return /* @__PURE__ */ jsx(BlobBackground, { ...props, elementCount });
309
- case "wave":
310
- return /* @__PURE__ */ jsx(WaveBackground, { ...props });
311
- case "mesh":
312
- return /* @__PURE__ */ jsx(MeshBackground, { ...props });
313
- case "parallax":
314
- return /* @__PURE__ */ jsx(
315
- ParallaxBackground,
316
- {
317
- layers: parallaxLayers,
318
- speed,
319
- paused: isAnimationPaused
320
- }
321
- );
322
- case "particles":
323
- return /* @__PURE__ */ jsx(ParticlesBackground, { ...props, elementCount });
324
- default:
325
- return /* @__PURE__ */ jsx(GradientBackground, { ...props });
326
- }
327
- }, "renderAnimation");
328
- return /* @__PURE__ */ jsxs(
329
- "div",
330
- {
331
- className: cn$1(
332
- "relative overflow-hidden",
333
- fullscreen && "fixed inset-0 z-0",
334
- className
335
- ),
336
- style: containerStyle,
337
- children: [
338
- renderAnimation(),
339
- children && /* @__PURE__ */ jsx("div", { className: "relative z-10 h-full w-full", children })
340
- ]
341
- }
342
- );
343
- }
344
- __name(AnimatedBackground, "AnimatedBackground");
345
- var AnimatedBeam = React9.forwardRef(
346
- ({
347
- className,
348
- duration = 3,
349
- delay = 0,
350
- pathColor = "gray",
351
- pathWidth = 2,
352
- gradientStartColor = "#18CCFC",
353
- gradientStopColor = "#6344F5",
354
- containerRef,
355
- fromRef,
356
- toRef,
357
- ...props
358
- }, ref) => {
359
- const [pathD, setPathD] = React9.useState("");
360
- React9.useEffect(() => {
361
- if (!containerRef?.current || !fromRef?.current || !toRef?.current) return;
362
- const updatePath = /* @__PURE__ */ __name(() => {
363
- const containerRect = containerRef.current.getBoundingClientRect();
364
- const fromRect = fromRef.current.getBoundingClientRect();
365
- const toRect = toRef.current.getBoundingClientRect();
366
- const fromX = fromRect.left - containerRect.left + fromRect.width / 2;
367
- const fromY = fromRect.top - containerRect.top + fromRect.height / 2;
368
- const toX = toRect.left - containerRect.left + toRect.width / 2;
369
- const toY = toRect.top - containerRect.top + toRect.height / 2;
370
- const controlX = (fromX + toX) / 2;
371
- const controlY = Math.min(fromY, toY) - 50;
372
- setPathD(`M ${fromX} ${fromY} Q ${controlX} ${controlY} ${toX} ${toY}`);
373
- }, "updatePath");
374
- updatePath();
375
- window.addEventListener("resize", updatePath);
376
- return () => window.removeEventListener("resize", updatePath);
377
- }, [containerRef, fromRef, toRef]);
378
- return /* @__PURE__ */ jsxs(
379
- "svg",
380
- {
381
- ref,
382
- className: cn("pointer-events-none absolute inset-0", className),
383
- ...props,
384
- children: [
385
- /* @__PURE__ */ jsx(
386
- "path",
387
- {
388
- d: pathD,
389
- stroke: pathColor,
390
- strokeWidth: pathWidth,
391
- fill: "none",
392
- strokeOpacity: 0.2
393
- }
394
- ),
395
- /* @__PURE__ */ jsx(
396
- motion.path,
397
- {
398
- d: pathD,
399
- stroke: `url(#gradient-${gradientStartColor}-${gradientStopColor})`,
400
- strokeWidth: pathWidth,
401
- fill: "none",
402
- initial: { pathLength: 0 },
403
- animate: { pathLength: 1 },
404
- transition: {
405
- duration,
406
- delay,
407
- ease: "easeInOut",
408
- repeat: Infinity
409
- }
410
- }
411
- ),
412
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
413
- "linearGradient",
414
- {
415
- id: `gradient-${gradientStartColor}-${gradientStopColor}`,
416
- x1: "0%",
417
- y1: "0%",
418
- x2: "100%",
419
- y2: "0%",
420
- children: [
421
- /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: gradientStartColor }),
422
- /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: gradientStopColor })
423
- ]
424
- }
425
- ) })
426
- ]
427
- }
428
- );
429
- }
430
- );
431
- AnimatedBeam.displayName = "AnimatedBeam";
432
- var INTERACTIVE_SELECTORS = [
433
- "a",
434
- "button",
435
- "input",
436
- "textarea",
437
- "select",
438
- '[role="button"]',
439
- '[role="link"]',
440
- '[tabindex]:not([tabindex="-1"])',
441
- ".cursor-pointer",
442
- '[data-cursor="pointer"]'
443
- ].join(", ");
444
- var TEXT_SELECTORS = [
445
- 'input[type="text"]',
446
- 'input[type="email"]',
447
- 'input[type="password"]',
448
- 'input[type="search"]',
449
- "textarea",
450
- '[contenteditable="true"]',
451
- '[data-cursor="text"]'
452
- ].join(", ");
453
- var GRAB_SELECTORS = ['[data-cursor="grab"]', ".cursor-grab"].join(", ");
454
- var GRABBING_SELECTORS = [
455
- '[data-cursor="grabbing"]',
456
- ".cursor-grabbing"
457
- ].join(", ");
458
- function isTouchDevice() {
459
- if (typeof window === "undefined") return false;
460
- return "ontouchstart" in window || navigator.maxTouchPoints > 0 || // @ts-ignore
461
- navigator.msMaxTouchPoints > 0;
462
- }
463
- __name(isTouchDevice, "isTouchDevice");
464
- function useCursorState() {
465
- const [cursorState, setCursorState] = useState({
466
- position: { x: 0, y: 0 },
467
- isHovering: false,
468
- isClicking: false,
469
- cursorType: "default"
470
- });
471
- const updatePosition = useCallback((x, y) => {
472
- setCursorState((prev) => ({
473
- ...prev,
474
- position: { x, y }
475
- }));
476
- }, []);
477
- const updateHoverState = useCallback(
478
- (isHovering, cursorType = "default") => {
479
- setCursorState((prev) => ({
480
- ...prev,
481
- isHovering,
482
- cursorType
483
- }));
484
- },
485
- []
486
- );
487
- const updateClickState = useCallback((isClicking) => {
488
- setCursorState((prev) => ({
489
- ...prev,
490
- isClicking
491
- }));
492
- }, []);
493
- return {
494
- cursorState,
495
- updatePosition,
496
- updateHoverState,
497
- updateClickState
498
- };
499
- }
500
- __name(useCursorState, "useCursorState");
501
- function useCursorTrail(trailLength, position) {
502
- const [trail, setTrail] = useState([]);
503
- const trailRef = useRef([]);
504
- useEffect(() => {
505
- trailRef.current.push(position);
506
- if (trailRef.current.length > trailLength) {
507
- trailRef.current.shift();
508
- }
509
- setTrail([...trailRef.current]);
510
- }, [position, trailLength]);
511
- return trail;
512
- }
513
- __name(useCursorTrail, "useCursorTrail");
514
- function AnimatedCursor({
515
- isVisible = true,
516
- size = 20,
517
- color = "#000000",
518
- trailColor = "#00000050",
519
- animationDuration = 200,
520
- showTrail = true,
521
- trailLength = 8,
522
- blendMode = "normal",
523
- hoverScale = 1.5,
524
- hideOnTouch = true,
525
- className,
526
- clickAnimationDuration = 100,
527
- zIndex = 9999
528
- }) {
529
- const { cursorState, updatePosition, updateHoverState, updateClickState } = useCursorState();
530
- const trail = useCursorTrail(trailLength, cursorState.position);
531
- const [isTouch, setIsTouch] = useState(false);
532
- const [mounted, setMounted] = useState(false);
533
- useEffect(() => {
534
- setIsTouch(isTouchDevice());
535
- setMounted(true);
536
- }, []);
537
- useEffect(() => {
538
- if (!mounted || hideOnTouch && isTouch) return;
539
- const handleMouseMove = /* @__PURE__ */ __name((e) => {
540
- try {
541
- requestAnimationFrame(() => {
542
- updatePosition(e.clientX, e.clientY);
543
- });
544
- } catch (error) {
545
- console.warn("AnimatedCursor: Error updating position", error);
546
- }
547
- }, "handleMouseMove");
548
- const handleMouseOver = /* @__PURE__ */ __name((e) => {
549
- try {
550
- const target = e.target;
551
- if (target?.closest?.(INTERACTIVE_SELECTORS)) {
552
- updateHoverState(true, "pointer");
553
- } else if (target?.closest?.(TEXT_SELECTORS)) {
554
- updateHoverState(true, "text");
555
- } else if (target?.closest?.(GRAB_SELECTORS)) {
556
- updateHoverState(true, "grab");
557
- } else if (target?.closest?.(GRABBING_SELECTORS)) {
558
- updateHoverState(true, "grabbing");
559
- } else {
560
- updateHoverState(false, "default");
561
- }
562
- } catch (error) {
563
- console.warn("AnimatedCursor: Error handling mouse over", error);
564
- updateHoverState(false, "default");
565
- }
566
- }, "handleMouseOver");
567
- const handleMouseDown = /* @__PURE__ */ __name(() => {
568
- updateClickState(true);
569
- }, "handleMouseDown");
570
- const handleMouseUp = /* @__PURE__ */ __name(() => {
571
- updateClickState(false);
572
- }, "handleMouseUp");
573
- const handleMouseLeave = /* @__PURE__ */ __name(() => {
574
- updateHoverState(false, "default");
575
- }, "handleMouseLeave");
576
- document.addEventListener("mousemove", handleMouseMove);
577
- document.addEventListener("mouseover", handleMouseOver);
578
- document.addEventListener("mousedown", handleMouseDown);
579
- document.addEventListener("mouseup", handleMouseUp);
580
- document.addEventListener("mouseleave", handleMouseLeave);
581
- return () => {
582
- document.removeEventListener("mousemove", handleMouseMove);
583
- document.removeEventListener("mouseover", handleMouseOver);
584
- document.removeEventListener("mousedown", handleMouseDown);
585
- document.removeEventListener("mouseup", handleMouseUp);
586
- document.removeEventListener("mouseleave", handleMouseLeave);
587
- };
588
- }, [
589
- mounted,
590
- hideOnTouch,
591
- isTouch,
592
- updatePosition,
593
- updateHoverState,
594
- updateClickState
595
- ]);
596
- useEffect(() => {
597
- if (!mounted || hideOnTouch && isTouch) return;
598
- try {
599
- const originalCursor = document.body.style.cursor;
600
- document.body.style.cursor = "none";
601
- return () => {
602
- try {
603
- document.body.style.cursor = originalCursor;
604
- } catch (error) {
605
- console.warn("AnimatedCursor: Error restoring cursor style", error);
606
- }
607
- };
608
- } catch (error) {
609
- console.warn("AnimatedCursor: Error hiding cursor", error);
610
- }
611
- }, [mounted, hideOnTouch, isTouch]);
612
- if (!mounted || !isVisible || hideOnTouch && isTouch) {
613
- return null;
614
- }
615
- const currentScale = cursorState.isHovering ? hoverScale : 1;
616
- const clickScale = cursorState.isClicking ? 0.8 : 1;
617
- const finalScale = currentScale * clickScale;
618
- const getCursorShape = /* @__PURE__ */ __name(() => {
619
- switch (cursorState.cursorType) {
620
- case "text":
621
- return "h-6 w-0.5";
622
- case "grab":
623
- case "grabbing":
624
- return "rounded-md";
625
- default:
626
- return "rounded-full";
627
- }
628
- }, "getCursorShape");
629
- return /* @__PURE__ */ jsxs("div", { className: cn("pointer-events-none fixed inset-0", className), children: [
630
- showTrail && trail.map((point, index) => {
631
- const opacity = (index + 1) / trail.length * 0.5;
632
- const scale = (index + 1) / trail.length * 0.8;
633
- return /* @__PURE__ */ jsx(
634
- "div",
635
- {
636
- className: "absolute",
637
- style: {
638
- left: point.x - size / 2,
639
- top: point.y - size / 2,
640
- width: size,
641
- height: size,
642
- backgroundColor: trailColor,
643
- borderRadius: "50%",
644
- opacity,
645
- transform: `scale(${scale})`,
646
- zIndex: zIndex - index - 1,
647
- mixBlendMode: blendMode
648
- }
649
- },
650
- index
651
- );
652
- }),
653
- /* @__PURE__ */ jsx(
654
- "div",
655
- {
656
- className: cn(
657
- "absolute transition-transform duration-100 ease-out",
658
- getCursorShape()
659
- ),
660
- style: {
661
- left: cursorState.position.x - size / 2,
662
- top: cursorState.position.y - size / 2,
663
- width: cursorState.cursorType === "text" ? 2 : size,
664
- height: cursorState.cursorType === "text" ? 24 : size,
665
- backgroundColor: color,
666
- transform: `scale(${finalScale})`,
667
- transitionDuration: `${animationDuration}ms`,
668
- zIndex,
669
- mixBlendMode: blendMode
670
- }
671
- }
672
- ),
673
- cursorState.isHovering && cursorState.cursorType !== "text" && /* @__PURE__ */ jsx(
674
- "div",
675
- {
676
- className: "absolute rounded-full border-2 transition-all duration-200 ease-out",
677
- style: {
678
- left: cursorState.position.x - size * hoverScale / 2,
679
- top: cursorState.position.y - size * hoverScale / 2,
680
- width: size * hoverScale,
681
- height: size * hoverScale,
682
- borderColor: color,
683
- opacity: 0.3,
684
- zIndex: zIndex - 1,
685
- mixBlendMode: blendMode
686
- }
687
- }
688
- )
689
- ] });
690
- }
691
- __name(AnimatedCursor, "AnimatedCursor");
692
- function usePrefersReducedMotion2() {
693
- const [prefersReducedMotion, setPrefersReducedMotion] = useState(false);
694
- useEffect(() => {
695
- if (typeof window === "undefined") return;
696
- const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
697
- setPrefersReducedMotion(mediaQuery.matches);
698
- const handleChange = /* @__PURE__ */ __name((event) => {
699
- setPrefersReducedMotion(event.matches);
700
- }, "handleChange");
701
- mediaQuery.addEventListener("change", handleChange);
702
- return () => mediaQuery.removeEventListener("change", handleChange);
703
- }, []);
704
- return prefersReducedMotion;
705
- }
706
- __name(usePrefersReducedMotion2, "usePrefersReducedMotion");
707
- var iconPaths = {
708
- loading: "M12 2v4m0 12v4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M2 12h4m12 0h4M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83",
709
- heart: [
710
- "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",
711
- "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"
712
- ],
713
- star: "m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2Z",
714
- hamburger: ["M3 12h18M3 6h18M3 18h18", "m6 6 12 12M6 18 18 6"],
715
- arrow: "M5 12l14 0m-7 -7l7 7l-7 7",
716
- check: "m9 12 2 2 4-4",
717
- x: "m18 6-12 12M6 6l12 12"
718
- };
719
- var animationVariants = {
720
- spin: {
721
- animate: {
722
- rotate: 360,
723
- transition: {
724
- duration: 1,
725
- repeat: Infinity,
726
- ease: "linear"
727
- }
728
- }
729
- },
730
- pulse: {
731
- animate: {
732
- scale: [1, 1.2, 1],
733
- transition: {
734
- duration: 1,
735
- repeat: Infinity,
736
- ease: "easeInOut"
737
- }
738
- }
739
- },
740
- bounce: {
741
- animate: {
742
- y: [0, -10, 0],
743
- transition: {
744
- duration: 0.6,
745
- repeat: Infinity,
746
- ease: "easeInOut"
747
- }
748
- }
749
- },
750
- draw: {
751
- initial: { pathLength: 0, opacity: 0 },
752
- animate: {
753
- pathLength: 1,
754
- opacity: 1,
755
- transition: { duration: 2, ease: "easeInOut" }
756
- }
757
- },
758
- hover: {
759
- whileHover: {
760
- scale: 1.1,
761
- transition: { duration: 0.2 }
762
- }
763
- }
764
- };
765
- var hoverVariants = {
766
- scale: { scale: 1.2 },
767
- rotate: { rotate: 15 },
768
- glow: { filter: "drop-shadow(0 0 8px currentColor)" },
769
- shake: { x: [-2, 2, -2, 2, 0] }
770
- };
771
- var clickVariants = {
772
- scale: { scale: 0.9 },
773
- rotate: { rotate: 180 },
774
- ripple: { scale: [1, 1.3, 1] }
775
- };
776
- function MorphingPath({
777
- paths,
778
- duration,
779
- strokeWidth = 2,
780
- autoAnimate,
781
- repeat,
782
- onComplete
783
- }) {
784
- const [currentPathIndex, setCurrentPathIndex] = useState(0);
785
- useEffect(() => {
786
- if (!autoAnimate || paths.length < 2) return;
787
- const interval = setInterval(() => {
788
- setCurrentPathIndex((prev) => {
789
- const next = (prev + 1) % paths.length;
790
- if (next === 0 && !repeat) {
791
- clearInterval(interval);
792
- onComplete?.();
793
- }
794
- return next;
795
- });
796
- }, duration);
797
- return () => clearInterval(interval);
798
- }, [autoAnimate, paths.length, duration, repeat, onComplete]);
799
- return /* @__PURE__ */ jsx(
800
- motion.path,
801
- {
802
- d: paths[currentPathIndex],
803
- fill: "none",
804
- stroke: "currentColor",
805
- strokeWidth,
806
- strokeLinecap: "round",
807
- strokeLinejoin: "round",
808
- animate: { d: paths[currentPathIndex] },
809
- transition: { duration: duration / 1e3, ease: "easeInOut" }
810
- }
811
- );
812
- }
813
- __name(MorphingPath, "MorphingPath");
814
- function DrawingPath({
815
- path,
816
- duration,
817
- strokeWidth = 2,
818
- progress,
819
- autoAnimate
820
- }) {
821
- const pathRef = useRef(null);
822
- const [pathLength, setPathLength] = useState(0);
823
- useEffect(() => {
824
- if (pathRef.current) {
825
- const length = pathRef.current.getTotalLength();
826
- setPathLength(length);
827
- }
828
- }, [path]);
829
- const animatedLength = progress !== void 0 ? pathLength * progress : pathLength;
830
- return /* @__PURE__ */ jsx(
831
- motion.path,
832
- {
833
- ref: pathRef,
834
- d: path,
835
- fill: "none",
836
- stroke: "currentColor",
837
- strokeWidth,
838
- strokeLinecap: "round",
839
- strokeLinejoin: "round",
840
- initial: { pathLength: 0 },
841
- animate: autoAnimate ? { pathLength: 1 } : { pathLength: animatedLength / pathLength },
842
- transition: { duration: duration / 1e3, ease: "easeInOut" },
843
- style: {
844
- strokeDasharray: pathLength,
845
- strokeDashoffset: pathLength - animatedLength
846
- }
847
- }
848
- );
849
- }
850
- __name(DrawingPath, "DrawingPath");
851
- function LoadingSpinner({
852
- size,
853
- strokeWidth = 2
854
- }) {
855
- return /* @__PURE__ */ jsx(
856
- motion.div,
857
- {
858
- animate: { rotate: 360 },
859
- transition: { duration: 1, repeat: Infinity, ease: "linear" },
860
- style: { width: size, height: size },
861
- children: /* @__PURE__ */ jsx("svg", { width: "100%", height: "100%", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
862
- "circle",
863
- {
864
- cx: "12",
865
- cy: "12",
866
- r: "10",
867
- stroke: "currentColor",
868
- strokeWidth,
869
- strokeLinecap: "round",
870
- strokeDasharray: "60 40",
871
- opacity: "0.3"
872
- }
873
- ) })
874
- }
875
- );
876
- }
877
- __name(LoadingSpinner, "LoadingSpinner");
878
- function AnimatedIcon({
879
- icon = "loading",
880
- paths,
881
- animation = "spin",
882
- size = 24,
883
- color = "currentColor",
884
- duration = 1e3,
885
- autoAnimate = true,
886
- repeat = true,
887
- className,
888
- style,
889
- onAnimationComplete,
890
- onClick,
891
- interactive = true,
892
- hoverAnimation = "scale",
893
- clickAnimation = "scale",
894
- customVariants,
895
- viewBox = "0 0 24 24",
896
- strokeWidth = 2,
897
- loading = false,
898
- progress
899
- }) {
900
- const [isHovered, setIsHovered] = useState(false);
901
- const [isClicked, setIsClicked] = useState(false);
902
- const prefersReducedMotion = usePrefersReducedMotion2();
903
- const variants = customVariants || animationVariants[animation] || {};
904
- const shouldAnimate = autoAnimate && !prefersReducedMotion;
905
- const getIconPaths = /* @__PURE__ */ __name(() => {
906
- if (paths) {
907
- return Array.isArray(paths) ? paths : [paths];
908
- }
909
- const builtInPath = iconPaths[icon];
910
- return Array.isArray(builtInPath) ? builtInPath : [builtInPath];
911
- }, "getIconPaths");
912
- const iconPathsArray = getIconPaths();
913
- const handleClick = /* @__PURE__ */ __name(() => {
914
- if (!interactive) return;
915
- setIsClicked(true);
916
- setTimeout(() => setIsClicked(false), 200);
917
- onClick?.();
918
- }, "handleClick");
919
- const getHoverVariant = /* @__PURE__ */ __name(() => {
920
- if (!interactive || !isHovered) return {};
921
- return hoverVariants[hoverAnimation] || {};
922
- }, "getHoverVariant");
923
- const getClickVariant = /* @__PURE__ */ __name(() => {
924
- if (!interactive || !isClicked) return {};
925
- return clickVariants[clickAnimation] || {};
926
- }, "getClickVariant");
927
- if (loading) {
928
- return /* @__PURE__ */ jsx(LoadingSpinner, { size, strokeWidth });
929
- }
930
- const renderIcon = /* @__PURE__ */ __name(() => {
931
- if (animation === "morph" && iconPathsArray.length > 1) {
932
- return /* @__PURE__ */ jsx(
933
- MorphingPath,
934
- {
935
- paths: iconPathsArray,
936
- duration,
937
- strokeWidth,
938
- autoAnimate: shouldAnimate,
939
- repeat,
940
- onComplete: onAnimationComplete
941
- }
942
- );
943
- }
944
- if (animation === "draw") {
945
- return /* @__PURE__ */ jsx(
946
- DrawingPath,
947
- {
948
- path: iconPathsArray[0],
949
- duration,
950
- strokeWidth,
951
- progress,
952
- autoAnimate: shouldAnimate
953
- }
954
- );
955
- }
956
- return iconPathsArray.map((path, index) => /* @__PURE__ */ jsx(
957
- motion.path,
958
- {
959
- d: path,
960
- fill: icon === "heart" ? "currentColor" : "none",
961
- stroke: icon === "heart" ? "none" : "currentColor",
962
- strokeWidth,
963
- strokeLinecap: "round",
964
- strokeLinejoin: "round"
965
- },
966
- index
967
- ));
968
- }, "renderIcon");
969
- return /* @__PURE__ */ jsx(
970
- motion.div,
971
- {
972
- className: cn$1(
973
- "inline-flex items-center justify-center",
974
- interactive && "cursor-pointer",
975
- className
976
- ),
977
- style: {
978
- width: size,
979
- height: size,
980
- color,
981
- ...style
982
- },
983
- onClick: handleClick,
984
- onMouseEnter: () => setIsHovered(true),
985
- onMouseLeave: () => setIsHovered(false),
986
- variants,
987
- animate: shouldAnimate ? "animate" : "initial",
988
- whileHover: !prefersReducedMotion ? getHoverVariant() : {},
989
- whileTap: !prefersReducedMotion ? getClickVariant() : {},
990
- onAnimationComplete,
991
- children: /* @__PURE__ */ jsx(
992
- "svg",
993
- {
994
- width: "100%",
995
- height: "100%",
996
- viewBox,
997
- fill: "none",
998
- xmlns: "http://www.w3.org/2000/svg",
999
- children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: renderIcon() })
1000
- }
1001
- )
1002
- }
1003
- );
1004
- }
1005
- __name(AnimatedIcon, "AnimatedIcon");
1006
- function usePrefersReducedMotion3() {
1007
- const [prefersReducedMotion, setPrefersReducedMotion] = useState(false);
1008
- useEffect(() => {
1009
- if (typeof window === "undefined") return;
1010
- const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
1011
- setPrefersReducedMotion(mediaQuery.matches);
1012
- const handleChange = /* @__PURE__ */ __name((event) => {
1013
- setPrefersReducedMotion(event.matches);
1014
- }, "handleChange");
1015
- mediaQuery.addEventListener("change", handleChange);
1016
- return () => mediaQuery.removeEventListener("change", handleChange);
1017
- }, []);
1018
- return prefersReducedMotion;
1019
- }
1020
- __name(usePrefersReducedMotion3, "usePrefersReducedMotion");
1021
- var slideVariants = {
1022
- hidden: { opacity: 0, x: -50 },
1023
- visible: /* @__PURE__ */ __name((i) => ({
1024
- opacity: 1,
1025
- x: 0,
1026
- transition: {
1027
- delay: i * 0.1,
1028
- duration: 0.5,
1029
- ease: "easeOut"
1030
- }
1031
- }), "visible"),
1032
- exit: { opacity: 0, x: 50, transition: { duration: 0.3 } }
1033
- };
1034
- var fadeVariants = {
1035
- hidden: { opacity: 0 },
1036
- visible: /* @__PURE__ */ __name((i) => ({
1037
- opacity: 1,
1038
- transition: {
1039
- delay: i * 0.1,
1040
- duration: 0.5,
1041
- ease: "easeOut"
1042
- }
1043
- }), "visible"),
1044
- exit: { opacity: 0, transition: { duration: 0.3 } }
1045
- };
1046
- var scaleVariants = {
1047
- hidden: { opacity: 0, scale: 0.8 },
1048
- visible: /* @__PURE__ */ __name((i) => ({
1049
- opacity: 1,
1050
- scale: 1,
1051
- transition: {
1052
- delay: i * 0.1,
1053
- duration: 0.5,
1054
- ease: "easeOut",
1055
- type: "spring",
1056
- stiffness: 100
1057
- }
1058
- }), "visible"),
1059
- exit: { opacity: 0, scale: 0.8, transition: { duration: 0.3 } }
1060
- };
1061
- var slideUpVariants = {
1062
- hidden: { opacity: 0, y: 50 },
1063
- visible: /* @__PURE__ */ __name((i) => ({
1064
- opacity: 1,
1065
- y: 0,
1066
- transition: {
1067
- delay: i * 0.1,
1068
- duration: 0.5,
1069
- ease: "easeOut"
1070
- }
1071
- }), "visible"),
1072
- exit: { opacity: 0, y: -50, transition: { duration: 0.3 } }
1073
- };
1074
- var slideDownVariants = {
1075
- hidden: { opacity: 0, y: -50 },
1076
- visible: /* @__PURE__ */ __name((i) => ({
1077
- opacity: 1,
1078
- y: 0,
1079
- transition: {
1080
- delay: i * 0.1,
1081
- duration: 0.5,
1082
- ease: "easeOut"
1083
- }
1084
- }), "visible"),
1085
- exit: { opacity: 0, y: 50, transition: { duration: 0.3 } }
1086
- };
1087
- var slideLeftVariants = {
1088
- hidden: { opacity: 0, x: 50 },
1089
- visible: /* @__PURE__ */ __name((i) => ({
1090
- opacity: 1,
1091
- x: 0,
1092
- transition: {
1093
- delay: i * 0.1,
1094
- duration: 0.5,
1095
- ease: "easeOut"
1096
- }
1097
- }), "visible"),
1098
- exit: { opacity: 0, x: -50, transition: { duration: 0.3 } }
1099
- };
1100
- var slideRightVariants = {
1101
- hidden: { opacity: 0, x: -50 },
1102
- visible: /* @__PURE__ */ __name((i) => ({
1103
- opacity: 1,
1104
- x: 0,
1105
- transition: {
1106
- delay: i * 0.1,
1107
- duration: 0.5,
1108
- ease: "easeOut"
1109
- }
1110
- }), "visible"),
1111
- exit: { opacity: 0, x: 50, transition: { duration: 0.3 } }
1112
- };
1113
- var animationVariants2 = {
1114
- slide: slideVariants,
1115
- fade: fadeVariants,
1116
- scale: scaleVariants,
1117
- slideUp: slideUpVariants,
1118
- slideDown: slideDownVariants,
1119
- slideLeft: slideLeftVariants,
1120
- slideRight: slideRightVariants
1121
- };
1122
- function useVirtualizedList(items, containerHeight, itemHeight, enabled) {
1123
- const [scrollTop, setScrollTop] = useState(0);
1124
- const visibleItems = useMemo(() => {
1125
- if (!enabled) return items;
1126
- const startIndex = Math.floor(scrollTop / itemHeight);
1127
- const endIndex = Math.min(
1128
- startIndex + Math.ceil(containerHeight / itemHeight) + 1,
1129
- items.length
1130
- );
1131
- return items.slice(startIndex, endIndex).map((item, index) => ({
1132
- ...item,
1133
- virtualIndex: startIndex + index,
1134
- style: {
1135
- position: "absolute",
1136
- top: (startIndex + index) * itemHeight,
1137
- height: itemHeight,
1138
- width: "100%"
1139
- }
1140
- }));
1141
- }, [items, scrollTop, itemHeight, containerHeight, enabled]);
1142
- const totalHeight = items.length * itemHeight;
1143
- const handleScroll = useCallback((e) => {
1144
- setScrollTop(e.currentTarget.scrollTop);
1145
- }, []);
1146
- return {
1147
- visibleItems,
1148
- totalHeight,
1149
- handleScroll
1150
- };
1151
- }
1152
- __name(useVirtualizedList, "useVirtualizedList");
1153
- function AnimatedList({
1154
- items,
1155
- animation = "slideUp",
1156
- staggerDelay = 100,
1157
- duration = 500,
1158
- reorderable = false,
1159
- enableAddRemove = true,
1160
- layout = "vertical",
1161
- gridColumns = 3,
1162
- className,
1163
- itemClassName,
1164
- style,
1165
- onReorder,
1166
- onItemClick,
1167
- showHoverEffects = true,
1168
- customVariants,
1169
- virtualized = false,
1170
- itemHeight = 60,
1171
- containerHeight = 400,
1172
- autoStart = true,
1173
- onAnimationComplete
1174
- }) {
1175
- const [animatedItems, setAnimatedItems] = useState(items);
1176
- const [animationKey, setAnimationKey] = useState(0);
1177
- const prefersReducedMotion = usePrefersReducedMotion3();
1178
- const variants = customVariants || animationVariants2[animation];
1179
- const shouldAnimate = !prefersReducedMotion && autoStart;
1180
- const { visibleItems, totalHeight, handleScroll } = useVirtualizedList(
1181
- items,
1182
- containerHeight,
1183
- itemHeight,
1184
- virtualized
1185
- );
1186
- useEffect(() => {
1187
- setAnimatedItems(items);
1188
- }, [items]);
1189
- const updatedVariants = useMemo(() => {
1190
- if (!variants.visible || typeof variants.visible !== "function")
1191
- return variants;
1192
- return {
1193
- ...variants,
1194
- visible: /* @__PURE__ */ __name((i) => {
1195
- const original = variants.visible;
1196
- const originalResult = original(i);
1197
- return {
1198
- ...originalResult,
1199
- transition: {
1200
- ...originalResult.transition,
1201
- delay: i * (staggerDelay / 1e3),
1202
- duration: duration / 1e3
1203
- }
1204
- };
1205
- }, "visible")
1206
- };
1207
- }, [variants, staggerDelay, duration]);
1208
- const getLayoutClassName = /* @__PURE__ */ __name(() => {
1209
- switch (layout) {
1210
- case "horizontal":
1211
- return "flex flex-row gap-4 overflow-x-auto";
1212
- case "grid":
1213
- return `grid gap-4 grid-cols-${gridColumns}`;
1214
- default:
1215
- return "flex flex-col gap-4";
1216
- }
1217
- }, "getLayoutClassName");
1218
- const renderListItem = /* @__PURE__ */ __name((item, index, virtualStyle) => {
1219
- const itemContent = /* @__PURE__ */ jsx(
1220
- motion.div,
1221
- {
1222
- custom: index,
1223
- variants: updatedVariants,
1224
- initial: shouldAnimate ? "hidden" : "visible",
1225
- animate: "visible",
1226
- exit: "exit",
1227
- layout: enableAddRemove,
1228
- className: cn$1(
1229
- "cursor-pointer select-none",
1230
- showHoverEffects && "hover:scale-105 transition-transform",
1231
- itemClassName
1232
- ),
1233
- style: virtualStyle,
1234
- onClick: () => onItemClick?.(item, index),
1235
- whileHover: showHoverEffects ? { scale: 1.02 } : void 0,
1236
- whileTap: showHoverEffects ? { scale: 0.98 } : void 0,
1237
- onAnimationComplete: () => {
1238
- if (index === animatedItems.length - 1) {
1239
- onAnimationComplete?.();
1240
- }
1241
- },
1242
- children: item.content
1243
- },
1244
- item.id
1245
- );
1246
- return itemContent;
1247
- }, "renderListItem");
1248
- if (reorderable && !virtualized) {
1249
- return /* @__PURE__ */ jsx(
1250
- Reorder.Group,
1251
- {
1252
- axis: layout === "horizontal" ? "x" : "y",
1253
- values: animatedItems,
1254
- onReorder: (newItems) => {
1255
- setAnimatedItems(newItems);
1256
- onReorder?.(newItems);
1257
- },
1258
- className: cn$1(getLayoutClassName(), className),
1259
- style,
1260
- children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: animatedItems.map((item, index) => /* @__PURE__ */ jsx(
1261
- Reorder.Item,
1262
- {
1263
- value: item,
1264
- className: cn$1(
1265
- "cursor-grab active:cursor-grabbing",
1266
- itemClassName
1267
- ),
1268
- whileDrag: { scale: 1.05, zIndex: 10 },
1269
- children: item.content
1270
- },
1271
- item.id
1272
- )) })
1273
- }
1274
- );
1275
- }
1276
- if (virtualized) {
1277
- return /* @__PURE__ */ jsx(
1278
- "div",
1279
- {
1280
- className: cn$1("overflow-auto", className),
1281
- style: { height: containerHeight, ...style },
1282
- onScroll: handleScroll,
1283
- children: /* @__PURE__ */ jsx("div", { style: { height: totalHeight, position: "relative" }, children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: visibleItems.map(
1284
- (item, index) => renderListItem(item, item.virtualIndex || index, item.style)
1285
- ) }) })
1286
- }
1287
- );
1288
- }
1289
- return /* @__PURE__ */ jsx(
1290
- motion.div,
1291
- {
1292
- className: cn$1(getLayoutClassName(), className),
1293
- style,
1294
- initial: "hidden",
1295
- animate: "visible",
1296
- children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: animatedItems.map((item, index) => renderListItem(item, index)) })
1297
- },
1298
- animationKey
1299
- );
1300
- }
1301
- __name(AnimatedList, "AnimatedList");
1302
- function usePrefersReducedMotion4() {
1303
- const [prefersReducedMotion, setPrefersReducedMotion] = useState(false);
1304
- useEffect(() => {
1305
- if (typeof window === "undefined") return;
1306
- const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
1307
- setPrefersReducedMotion(mediaQuery.matches);
1308
- const handleChange = /* @__PURE__ */ __name((event) => {
1309
- setPrefersReducedMotion(event.matches);
1310
- }, "handleChange");
1311
- mediaQuery.addEventListener("change", handleChange);
1312
- return () => mediaQuery.removeEventListener("change", handleChange);
1313
- }, []);
1314
- return prefersReducedMotion;
1315
- }
1316
- __name(usePrefersReducedMotion4, "usePrefersReducedMotion");
1317
- function useAnimatedNumber(targetValue, from, duration, decimals, format, currency, locale, easing, autoStart, useSpringAnim, springConfig, separator) {
1318
- const [displayValue, setDisplayValue] = useState(from);
1319
- const [isAnimating, setIsAnimating] = useState(false);
1320
- const animationRef = useRef(null);
1321
- const prefersReducedMotion = usePrefersReducedMotion4();
1322
- const springValue = useSpring(from, {
1323
- stiffness: springConfig.tension || 100,
1324
- damping: springConfig.friction || 10,
1325
- mass: springConfig.mass || 1
1326
- });
1327
- const [motionValue, setMotionValue] = useState(from);
1328
- const startAnimation = useCallback(() => {
1329
- if (prefersReducedMotion) {
1330
- setDisplayValue(targetValue);
1331
- return;
1332
- }
1333
- setIsAnimating(true);
1334
- if (useSpringAnim) {
1335
- springValue.set(targetValue);
1336
- } else {
1337
- const startTime = Date.now();
1338
- const startValue = displayValue;
1339
- const distance = targetValue - startValue;
1340
- const animate = /* @__PURE__ */ __name(() => {
1341
- const elapsed = Date.now() - startTime;
1342
- const progress = Math.min(elapsed / duration, 1);
1343
- const easedProgress = progress;
1344
- const currentValue = startValue + distance * easedProgress;
1345
- setDisplayValue(currentValue);
1346
- setMotionValue(currentValue);
1347
- if (progress < 1) {
1348
- animationRef.current = requestAnimationFrame(animate);
1349
- } else {
1350
- setIsAnimating(false);
1351
- animationRef.current = null;
1352
- }
1353
- }, "animate");
1354
- animationRef.current = requestAnimationFrame(animate);
1355
- }
1356
- }, [
1357
- targetValue,
1358
- displayValue,
1359
- duration,
1360
- useSpringAnim,
1361
- springValue,
1362
- prefersReducedMotion
1363
- ]);
1364
- useEffect(() => {
1365
- return () => {
1366
- if (animationRef.current) {
1367
- cancelAnimationFrame(animationRef.current);
1368
- }
1369
- };
1370
- }, []);
1371
- useEffect(() => {
1372
- if (useSpringAnim) {
1373
- const unsubscribe = springValue.onChange((latest) => {
1374
- setDisplayValue(latest);
1375
- if (Math.abs(latest - targetValue) < 0.01) {
1376
- setIsAnimating(false);
1377
- }
1378
- });
1379
- return () => {
1380
- unsubscribe();
1381
- };
1382
- }
1383
- }, [springValue, useSpringAnim, targetValue]);
1384
- useEffect(() => {
1385
- if (autoStart) {
1386
- startAnimation();
1387
- }
1388
- }, [autoStart, startAnimation]);
1389
- const formattedValue = useMemo(() => {
1390
- const roundedValue = Math.round(displayValue * Math.pow(10, decimals)) / Math.pow(10, decimals);
1391
- try {
1392
- switch (format) {
1393
- case "currency":
1394
- return new Intl.NumberFormat(locale, {
1395
- style: "currency",
1396
- currency,
1397
- minimumFractionDigits: decimals,
1398
- maximumFractionDigits: decimals
1399
- }).format(roundedValue);
1400
- case "percent":
1401
- return new Intl.NumberFormat(locale, {
1402
- style: "percent",
1403
- minimumFractionDigits: decimals,
1404
- maximumFractionDigits: decimals
1405
- }).format(roundedValue / 100);
1406
- default:
1407
- let formatted = new Intl.NumberFormat(locale, {
1408
- minimumFractionDigits: decimals,
1409
- maximumFractionDigits: decimals
1410
- }).format(roundedValue);
1411
- if (separator && separator !== ",") {
1412
- formatted = formatted.replace(/,/g, separator);
1413
- }
1414
- return formatted;
1415
- }
1416
- } catch (error) {
1417
- return roundedValue.toFixed(decimals);
1418
- }
1419
- }, [displayValue, decimals, format, currency, locale, separator]);
1420
- return {
1421
- formattedValue,
1422
- displayValue,
1423
- isAnimating,
1424
- startAnimation
1425
- };
1426
- }
1427
- __name(useAnimatedNumber, "useAnimatedNumber");
1428
- function AnimatedNumber({
1429
- value,
1430
- from = 0,
1431
- duration = 2e3,
1432
- decimals = 0,
1433
- format = "number",
1434
- currency = "USD",
1435
- locale = "en-US",
1436
- easing = "easeOut",
1437
- autoStart = true,
1438
- onComplete,
1439
- className,
1440
- style,
1441
- prefix = "",
1442
- suffix = "",
1443
- useSpring: useSpring2 = false,
1444
- springConfig = {},
1445
- separator,
1446
- animateOnHover = false,
1447
- hoverValue
1448
- }) {
1449
- const [isHovered, setIsHovered] = useState(false);
1450
- const [animationKey, setAnimationKey] = useState(0);
1451
- const currentValue = animateOnHover && isHovered && hoverValue !== void 0 ? hoverValue : value;
1452
- const { formattedValue, displayValue, isAnimating, startAnimation } = useAnimatedNumber(
1453
- currentValue,
1454
- from,
1455
- duration,
1456
- decimals,
1457
- format,
1458
- currency,
1459
- locale,
1460
- easing,
1461
- autoStart,
1462
- useSpring2,
1463
- springConfig,
1464
- separator
1465
- );
1466
- useEffect(() => {
1467
- if (!isAnimating && onComplete && Math.abs(displayValue - currentValue) < 1e-3) {
1468
- onComplete(displayValue);
1469
- }
1470
- }, [isAnimating, displayValue, currentValue, onComplete]);
1471
- useEffect(() => {
1472
- if (animateOnHover && hoverValue !== void 0) {
1473
- startAnimation();
1474
- }
1475
- }, [isHovered, animateOnHover, hoverValue, startAnimation]);
1476
- const handleMouseEnter = /* @__PURE__ */ __name(() => {
1477
- if (animateOnHover) {
1478
- setIsHovered(true);
1479
- }
1480
- }, "handleMouseEnter");
1481
- const handleMouseLeave = /* @__PURE__ */ __name(() => {
1482
- if (animateOnHover) {
1483
- setIsHovered(false);
1484
- }
1485
- }, "handleMouseLeave");
1486
- const prefersReducedMotion = usePrefersReducedMotion4();
1487
- return /* @__PURE__ */ jsxs(
1488
- motion.span,
1489
- {
1490
- className: cn$1("inline-block tabular-nums", className),
1491
- style,
1492
- onMouseEnter: handleMouseEnter,
1493
- onMouseLeave: handleMouseLeave,
1494
- initial: { scale: 1 },
1495
- animate: !prefersReducedMotion && isAnimating ? { scale: [1, 1.05, 1] } : { scale: 1 },
1496
- transition: { duration: 0.3 },
1497
- children: [
1498
- prefix,
1499
- /* @__PURE__ */ jsx(
1500
- motion.span,
1501
- {
1502
- initial: { opacity: 0, y: 20 },
1503
- animate: { opacity: 1, y: 0 },
1504
- transition: { duration: 0.3 },
1505
- children: formattedValue
1506
- },
1507
- animationKey
1508
- ),
1509
- suffix
1510
- ]
1511
- }
1512
- );
1513
- }
1514
- __name(AnimatedNumber, "AnimatedNumber");
1515
- var AnimatedTestimonials = React9.forwardRef(
1516
- ({ className, testimonials, autoPlay = true, duration = 5e3, ...props }, ref) => {
1517
- const [activeIndex, setActiveIndex] = React9.useState(0);
1518
- React9.useEffect(() => {
1519
- if (!autoPlay) return;
1520
- const interval = setInterval(() => {
1521
- setActiveIndex((prev) => (prev + 1) % testimonials.length);
1522
- }, duration);
1523
- return () => clearInterval(interval);
1524
- }, [autoPlay, duration, testimonials.length]);
1525
- return /* @__PURE__ */ jsxs(
1526
- "div",
1527
- {
1528
- ref,
1529
- className: cn("relative min-h-[200px]", className),
1530
- ...props,
1531
- children: [
1532
- /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(
1533
- motion.div,
1534
- {
1535
- initial: { opacity: 0, y: 20 },
1536
- animate: { opacity: 1, y: 0 },
1537
- exit: { opacity: 0, y: -20 },
1538
- transition: { duration: 0.5 },
1539
- children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, { className: "pt-6", children: /* @__PURE__ */ jsxs("blockquote", { className: "space-y-4", children: [
1540
- /* @__PURE__ */ jsxs("p", { className: "text-lg italic", children: [
1541
- '"',
1542
- testimonials[activeIndex].content,
1543
- '"'
1544
- ] }),
1545
- /* @__PURE__ */ jsxs("footer", { className: "flex items-center gap-4", children: [
1546
- /* @__PURE__ */ jsxs(Avatar, { children: [
1547
- /* @__PURE__ */ jsx(AvatarImage, { src: testimonials[activeIndex].avatar }),
1548
- /* @__PURE__ */ jsx(AvatarFallback, { children: testimonials[activeIndex].author.slice(0, 2).toUpperCase() })
1549
- ] }),
1550
- /* @__PURE__ */ jsxs("div", { children: [
1551
- /* @__PURE__ */ jsx("cite", { className: "not-italic font-medium", children: testimonials[activeIndex].author }),
1552
- testimonials[activeIndex].role && /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
1553
- testimonials[activeIndex].role,
1554
- testimonials[activeIndex].company && `, ${testimonials[activeIndex].company}`
1555
- ] })
1556
- ] })
1557
- ] })
1558
- ] }) }) })
1559
- },
1560
- activeIndex
1561
- ) }),
1562
- /* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center gap-2", children: testimonials.map((_, index) => /* @__PURE__ */ jsx(
1563
- "button",
1564
- {
1565
- onClick: () => setActiveIndex(index),
1566
- className: cn(
1567
- "h-2 w-2 rounded-full transition-all",
1568
- index === activeIndex ? "w-8 bg-primary" : "bg-muted hover:bg-muted-foreground"
1569
- ),
1570
- "aria-label": `Go to testimonial ${index + 1}`
1571
- },
1572
- index
1573
- )) })
1574
- ]
1575
- }
1576
- );
1577
- }
1578
- );
1579
- AnimatedTestimonials.displayName = "AnimatedTestimonials";
1580
- var AnimatedTooltip = React9.forwardRef(
1581
- ({ className, content, children, delay = 0, ...props }, ref) => {
1582
- const [isVisible, setIsVisible] = React9.useState(false);
1583
- return /* @__PURE__ */ jsxs(
1584
- "div",
1585
- {
1586
- ref,
1587
- className: cn("relative inline-block", className),
1588
- onMouseEnter: () => setIsVisible(true),
1589
- onMouseLeave: () => setIsVisible(false),
1590
- ...props,
1591
- children: [
1592
- children,
1593
- /* @__PURE__ */ jsx(AnimatePresence$1, { children: isVisible && /* @__PURE__ */ jsxs(
1594
- motion$1.div,
1595
- {
1596
- initial: { opacity: 0, y: 10, scale: 0.95 },
1597
- animate: { opacity: 1, y: 0, scale: 1 },
1598
- exit: { opacity: 0, y: 10, scale: 0.95 },
1599
- transition: {
1600
- duration: 0.2,
1601
- delay: delay / 1e3,
1602
- ease: "easeOut"
1603
- },
1604
- className: "absolute left-1/2 -translate-x-1/2 bottom-full mb-2 px-3 py-1.5 bg-popover text-popover-foreground text-sm rounded-md shadow-md whitespace-nowrap z-50",
1605
- children: [
1606
- content,
1607
- /* @__PURE__ */ jsx("div", { className: "absolute left-1/2 -translate-x-1/2 top-full w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-popover" })
1608
- ]
1609
- }
1610
- ) })
1611
- ]
1612
- }
1613
- );
1614
- }
1615
- );
1616
- AnimatedTooltip.displayName = "AnimatedTooltip";
1617
- function AppleCardsCarousel({
1618
- cards,
1619
- autoPlay = false,
1620
- autoPlayInterval = 5e3,
1621
- className,
1622
- cardClassName,
1623
- showArrows = true,
1624
- showDots = true,
1625
- parallaxOffset = 50,
1626
- stackOffset = 10,
1627
- stackScale = 0.95,
1628
- swipeThreshold = 50
1629
- }) {
1630
- const [currentIndex, setCurrentIndex] = React9.useState(0);
1631
- const [isAutoPlaying, setIsAutoPlaying] = React9.useState(autoPlay);
1632
- const containerRef = React9.useRef(null);
1633
- const dragX = useMotionValue(0);
1634
- const getCardStyle = /* @__PURE__ */ __name((index) => {
1635
- const offset = index - currentIndex;
1636
- const absOffset = Math.abs(offset);
1637
- if (absOffset > 2) {
1638
- return {
1639
- display: "none",
1640
- x: 0,
1641
- scale: 1,
1642
- opacity: 0,
1643
- zIndex: 0
1644
- };
1645
- }
1646
- const baseX = offset * stackOffset;
1647
- const scale = Math.pow(stackScale, absOffset);
1648
- const opacity = Math.max(0, 1 - absOffset * 0.3);
1649
- const zIndex = cards.length - absOffset;
1650
- return {
1651
- display: "block",
1652
- x: baseX,
1653
- scale,
1654
- opacity,
1655
- zIndex
1656
- };
1657
- }, "getCardStyle");
1658
- const goToNext = React9.useCallback(() => {
1659
- setCurrentIndex((prev) => (prev + 1) % cards.length);
1660
- }, [cards.length]);
1661
- const goToPrevious = React9.useCallback(() => {
1662
- setCurrentIndex((prev) => (prev - 1 + cards.length) % cards.length);
1663
- }, [cards.length]);
1664
- const goToCard = React9.useCallback((index) => {
1665
- setCurrentIndex(index);
1666
- }, []);
1667
- const handleDragEnd = React9.useCallback(
1668
- (event, info) => {
1669
- const { offset, velocity } = info;
1670
- if (Math.abs(offset.x) > swipeThreshold || Math.abs(velocity.x) > 500) {
1671
- if (offset.x > 0) {
1672
- goToPrevious();
1673
- } else {
1674
- goToNext();
1675
- }
1676
- }
1677
- },
1678
- [goToNext, goToPrevious, swipeThreshold]
1679
- );
1680
- React9.useEffect(() => {
1681
- if (!isAutoPlaying) return;
1682
- const interval = setInterval(goToNext, autoPlayInterval);
1683
- return () => clearInterval(interval);
1684
- }, [isAutoPlaying, goToNext, autoPlayInterval]);
1685
- const handleMouseEnter = React9.useCallback(() => {
1686
- if (autoPlay) {
1687
- setIsAutoPlaying(false);
1688
- }
1689
- }, [autoPlay]);
1690
- const handleMouseLeave = React9.useCallback(() => {
1691
- if (autoPlay) {
1692
- setIsAutoPlaying(true);
1693
- }
1694
- }, [autoPlay]);
1695
- React9.useEffect(() => {
1696
- const handleKeyDown = /* @__PURE__ */ __name((e) => {
1697
- if (e.key === "ArrowLeft") {
1698
- goToPrevious();
1699
- } else if (e.key === "ArrowRight") {
1700
- goToNext();
1701
- }
1702
- }, "handleKeyDown");
1703
- window.addEventListener("keydown", handleKeyDown);
1704
- return () => window.removeEventListener("keydown", handleKeyDown);
1705
- }, [goToNext, goToPrevious]);
1706
- return /* @__PURE__ */ jsxs(
1707
- "div",
1708
- {
1709
- ref: containerRef,
1710
- className: cn("relative w-full max-w-6xl mx-auto px-4 py-8", className),
1711
- onMouseEnter: handleMouseEnter,
1712
- onMouseLeave: handleMouseLeave,
1713
- children: [
1714
- /* @__PURE__ */ jsx("div", { className: "relative h-[400px] md:h-[500px] lg:h-[600px] flex items-center justify-center", children: /* @__PURE__ */ jsx(AnimatePresence$1, { mode: "popLayout", children: cards.map((card, index) => {
1715
- const style = getCardStyle(index);
1716
- const isActive = index === currentIndex;
1717
- return /* @__PURE__ */ jsx(
1718
- motion$1.div,
1719
- {
1720
- className: cn(
1721
- "absolute inset-0 w-full h-full",
1722
- !isActive && "pointer-events-none"
1723
- ),
1724
- initial: false,
1725
- animate: {
1726
- x: style.x,
1727
- scale: style.scale,
1728
- opacity: style.opacity,
1729
- zIndex: style.zIndex
1730
- },
1731
- transition: {
1732
- type: "spring",
1733
- stiffness: 300,
1734
- damping: 30
1735
- },
1736
- drag: isActive ? "x" : false,
1737
- dragSnapToOrigin: true,
1738
- dragElastic: 0.2,
1739
- onDragEnd: handleDragEnd,
1740
- whileDrag: { cursor: "grabbing" },
1741
- style: {
1742
- x: dragX,
1743
- display: style.display
1744
- },
1745
- children: /* @__PURE__ */ jsxs(
1746
- Card,
1747
- {
1748
- className: cn(
1749
- "relative w-full h-full overflow-hidden cursor-grab",
1750
- "bg-gradient-to-br from-white to-gray-50 dark:from-gray-900 dark:to-gray-950",
1751
- "shadow-2xl hover:shadow-3xl transition-shadow duration-300",
1752
- cardClassName
1753
- ),
1754
- style: {
1755
- background: card.gradient
1756
- },
1757
- children: [
1758
- card.image && /* @__PURE__ */ jsxs(
1759
- motion$1.div,
1760
- {
1761
- className: "absolute inset-0 w-full h-full",
1762
- style: {
1763
- x: useTransform(
1764
- dragX,
1765
- [-200, 0, 200],
1766
- [parallaxOffset, 0, -parallaxOffset]
1767
- )
1768
- },
1769
- children: [
1770
- /* @__PURE__ */ jsx(
1771
- "img",
1772
- {
1773
- src: card.image,
1774
- alt: card.title,
1775
- className: "w-full h-full object-cover"
1776
- }
1777
- ),
1778
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent" })
1779
- ]
1780
- }
1781
- ),
1782
- /* @__PURE__ */ jsx("div", { className: "relative z-10 flex flex-col justify-end h-full p-8 md:p-12", children: card.content ? card.content : /* @__PURE__ */ jsxs(Fragment, { children: [
1783
- /* @__PURE__ */ jsx(
1784
- motion$1.h3,
1785
- {
1786
- className: "text-3xl md:text-4xl lg:text-5xl font-bold text-white mb-2",
1787
- initial: { opacity: 0, y: 20 },
1788
- animate: { opacity: isActive ? 1 : 0.7, y: 0 },
1789
- transition: { delay: 0.1 },
1790
- children: card.title
1791
- }
1792
- ),
1793
- card.subtitle && /* @__PURE__ */ jsx(
1794
- motion$1.p,
1795
- {
1796
- className: "text-xl md:text-2xl text-white/80 mb-4",
1797
- initial: { opacity: 0, y: 20 },
1798
- animate: { opacity: isActive ? 1 : 0.7, y: 0 },
1799
- transition: { delay: 0.2 },
1800
- children: card.subtitle
1801
- }
1802
- ),
1803
- card.description && /* @__PURE__ */ jsx(
1804
- motion$1.p,
1805
- {
1806
- className: "text-base md:text-lg text-white/70 max-w-2xl",
1807
- initial: { opacity: 0, y: 20 },
1808
- animate: { opacity: isActive ? 1 : 0.7, y: 0 },
1809
- transition: { delay: 0.3 },
1810
- children: card.description
1811
- }
1812
- )
1813
- ] }) })
1814
- ]
1815
- }
1816
- )
1817
- },
1818
- card.id
1819
- );
1820
- }) }) }),
1821
- showArrows && /* @__PURE__ */ jsxs(Fragment, { children: [
1822
- /* @__PURE__ */ jsxs(
1823
- Button,
1824
- {
1825
- variant: "ghost",
1826
- size: "icon",
1827
- className: cn(
1828
- "absolute left-4 top-1/2 -translate-y-1/2 z-20",
1829
- "bg-white/10 backdrop-blur-md hover:bg-white/20",
1830
- "text-white border border-white/20",
1831
- "hidden md:flex"
1832
- ),
1833
- onClick: goToPrevious,
1834
- children: [
1835
- /* @__PURE__ */ jsx(ChevronLeft, { className: "h-6 w-6" }),
1836
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous card" })
1837
- ]
1838
- }
1839
- ),
1840
- /* @__PURE__ */ jsxs(
1841
- Button,
1842
- {
1843
- variant: "ghost",
1844
- size: "icon",
1845
- className: cn(
1846
- "absolute right-4 top-1/2 -translate-y-1/2 z-20",
1847
- "bg-white/10 backdrop-blur-md hover:bg-white/20",
1848
- "text-white border border-white/20",
1849
- "hidden md:flex"
1850
- ),
1851
- onClick: goToNext,
1852
- children: [
1853
- /* @__PURE__ */ jsx(ChevronRight, { className: "h-6 w-6" }),
1854
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next card" })
1855
- ]
1856
- }
1857
- )
1858
- ] }),
1859
- showDots && /* @__PURE__ */ jsx("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 z-20 flex gap-2", children: cards.map((_, index) => /* @__PURE__ */ jsx(
1860
- "button",
1861
- {
1862
- className: cn(
1863
- "w-2 h-2 rounded-full transition-all duration-300",
1864
- "bg-white/40 hover:bg-white/60",
1865
- index === currentIndex && "w-8 bg-white"
1866
- ),
1867
- onClick: () => goToCard(index),
1868
- children: /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
1869
- "Go to card ",
1870
- index + 1
1871
- ] })
1872
- },
1873
- index
1874
- )) })
1875
- ]
1876
- }
1877
- );
1878
- }
1879
- __name(AppleCardsCarousel, "AppleCardsCarousel");
1880
- var gradientPresets = {
1881
- sunset: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
1882
- ocean: "linear-gradient(135deg, #667eea 0%, #4ca1af 100%)",
1883
- fire: "linear-gradient(135deg, #f093fb 0%, #f5576c 100%)",
1884
- forest: "linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)",
1885
- galaxy: "linear-gradient(135deg, #7303c0 0%, #ec38bc 50%, #fdeff9 100%)",
1886
- aurora: "linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%)",
1887
- peach: "linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%)",
1888
- lavender: "linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)"
1889
- };
1890
- var AppleHelloEffect = React9.forwardRef(({ className, text = "Hello", duration = 2, ...props }, ref) => {
1891
- const letters = text.split("");
1892
- return /* @__PURE__ */ jsx(
1893
- "div",
1894
- {
1895
- ref,
1896
- className: cn(
1897
- "relative flex items-center justify-center text-6xl font-bold",
1898
- className
1899
- ),
1900
- ...props,
1901
- children: letters.map((letter, index) => /* @__PURE__ */ jsx(
1902
- motion$1.span,
1903
- {
1904
- initial: { opacity: 0, y: 50 },
1905
- animate: { opacity: 1, y: 0 },
1906
- transition: {
1907
- duration,
1908
- delay: index * 0.1,
1909
- ease: [0.215, 0.61, 0.355, 1]
1910
- },
1911
- className: "inline-block",
1912
- children: letter
1913
- },
1914
- index
1915
- ))
1916
- }
1917
- );
1918
- });
1919
- AppleHelloEffect.displayName = "AppleHelloEffect";
1920
-
1921
- export { AnimatedBackground, AnimatedBeam, AnimatedCursor, AnimatedIcon, AnimatedList, AnimatedNumber, AnimatedTestimonials, AnimatedTooltip, AppleCardsCarousel, AppleHelloEffect, gradientPresets };