@pelatform/ui 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/css/components/apexcharts.css +101 -0
  4. package/css/components/book.css +19 -0
  5. package/css/components/extra.css +12 -0
  6. package/css/components/image-input.css +51 -0
  7. package/css/components/leaflet.css +25 -0
  8. package/css/components/patterns.css +34 -0
  9. package/css/components/rating.css +89 -0
  10. package/css/components/scrollable.css +118 -0
  11. package/css/components/theme-transition.css +51 -0
  12. package/css/theme.css +237 -0
  13. package/dist/animation.cjs +1936 -0
  14. package/dist/animation.d.cts +379 -0
  15. package/dist/animation.d.ts +379 -0
  16. package/dist/animation.js +1936 -0
  17. package/dist/aria.cjs +139 -0
  18. package/dist/aria.d.cts +31 -0
  19. package/dist/aria.d.ts +31 -0
  20. package/dist/aria.js +139 -0
  21. package/dist/badge-BtI4BMea.d.cts +33 -0
  22. package/dist/badge-BtI4BMea.d.ts +33 -0
  23. package/dist/base.cjs +5559 -0
  24. package/dist/base.d.cts +651 -0
  25. package/dist/base.d.ts +651 -0
  26. package/dist/base.js +5559 -0
  27. package/dist/chunk-3N75YA6Q.cjs +60 -0
  28. package/dist/chunk-CD2BCCQU.js +180 -0
  29. package/dist/chunk-CJXIPSTG.cjs +10 -0
  30. package/dist/chunk-CYFW37N5.js +1355 -0
  31. package/dist/chunk-EZW5GNS4.js +6 -0
  32. package/dist/chunk-HW52LCWN.js +22 -0
  33. package/dist/chunk-I46SELBA.cjs +22 -0
  34. package/dist/chunk-J4JGE3U5.cjs +180 -0
  35. package/dist/chunk-KNS6QRVB.cjs +28 -0
  36. package/dist/chunk-OMPNDLGS.js +576 -0
  37. package/dist/chunk-RQHJBTEU.js +10 -0
  38. package/dist/chunk-S3QFGYE6.js +28 -0
  39. package/dist/chunk-SK6SSJHC.js +9 -0
  40. package/dist/chunk-T74DBLYY.js +60 -0
  41. package/dist/chunk-UP53DCYH.cjs +6 -0
  42. package/dist/chunk-VECBSKBC.cjs +576 -0
  43. package/dist/chunk-VSLPH2IR.cjs +1355 -0
  44. package/dist/chunk-ZDR3OZ7Z.cjs +9 -0
  45. package/dist/colors-CUDWvz1g.d.cts +42 -0
  46. package/dist/colors-CUDWvz1g.d.ts +42 -0
  47. package/dist/components-BgbIL9EW.d.cts +42 -0
  48. package/dist/components-BgbIL9EW.d.ts +42 -0
  49. package/dist/components.cjs +2276 -0
  50. package/dist/components.d.cts +2762 -0
  51. package/dist/components.d.ts +2762 -0
  52. package/dist/components.js +2276 -0
  53. package/dist/default.cjs +9081 -0
  54. package/dist/default.d.cts +1322 -0
  55. package/dist/default.d.ts +1322 -0
  56. package/dist/default.js +9081 -0
  57. package/dist/hooks.cjs +666 -0
  58. package/dist/hooks.d.cts +1176 -0
  59. package/dist/hooks.d.ts +1176 -0
  60. package/dist/hooks.js +666 -0
  61. package/dist/index.cjs +234 -0
  62. package/dist/index.d.cts +298 -0
  63. package/dist/index.d.ts +298 -0
  64. package/dist/index.js +234 -0
  65. package/dist/input-AwYIskrX.d.cts +22 -0
  66. package/dist/input-AwYIskrX.d.ts +22 -0
  67. package/dist/menu-GmSRfRGB.d.cts +43 -0
  68. package/dist/menu-GmSRfRGB.d.ts +43 -0
  69. package/dist/metafile-cjs.json +1 -0
  70. package/dist/metafile-esm.json +1 -0
  71. package/dist/re-export/cva.cjs +6 -0
  72. package/dist/re-export/cva.d.cts +9 -0
  73. package/dist/re-export/cva.d.ts +9 -0
  74. package/dist/re-export/cva.js +6 -0
  75. package/dist/re-export/motion.cjs +2 -0
  76. package/dist/re-export/motion.d.cts +1 -0
  77. package/dist/re-export/motion.d.ts +1 -0
  78. package/dist/re-export/motion.js +2 -0
  79. package/dist/re-export/next-themes.cjs +2 -0
  80. package/dist/re-export/next-themes.d.cts +1 -0
  81. package/dist/re-export/next-themes.d.ts +1 -0
  82. package/dist/re-export/next-themes.js +2 -0
  83. package/dist/re-export/react-day-picker.cjs +2 -0
  84. package/dist/re-export/react-day-picker.d.cts +1 -0
  85. package/dist/re-export/react-day-picker.d.ts +1 -0
  86. package/dist/re-export/react-day-picker.js +2 -0
  87. package/dist/re-export/react-hook-form.cjs +2 -0
  88. package/dist/re-export/react-hook-form.d.cts +1 -0
  89. package/dist/re-export/react-hook-form.d.ts +1 -0
  90. package/dist/re-export/react-hook-form.js +2 -0
  91. package/dist/re-export/sonner.cjs +2 -0
  92. package/dist/re-export/sonner.d.cts +1 -0
  93. package/dist/re-export/sonner.d.ts +1 -0
  94. package/dist/re-export/sonner.js +2 -0
  95. package/dist/re-export/tanstack-query.cjs +2 -0
  96. package/dist/re-export/tanstack-query.d.cts +1 -0
  97. package/dist/re-export/tanstack-query.d.ts +1 -0
  98. package/dist/re-export/tanstack-query.js +2 -0
  99. package/dist/re-export/tanstack-table.cjs +2 -0
  100. package/dist/re-export/tanstack-table.d.cts +1 -0
  101. package/dist/re-export/tanstack-table.d.ts +1 -0
  102. package/dist/re-export/tanstack-table.js +2 -0
  103. package/dist/re-export/zod.cjs +2 -0
  104. package/dist/re-export/zod.d.cts +1 -0
  105. package/dist/re-export/zod.d.ts +1 -0
  106. package/dist/re-export/zod.js +2 -0
  107. package/package.json +171 -0
@@ -0,0 +1,1936 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }'use client';
3
+
4
+
5
+
6
+ var _chunkCJXIPSTGcjs = require('./chunk-CJXIPSTG.cjs');
7
+
8
+ // src/ui/animation/avatar-group.tsx
9
+ var _react = require('react'); var React = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React6 = _interopRequireWildcard(_react); var React7 = _interopRequireWildcard(_react);
10
+
11
+
12
+
13
+
14
+
15
+
16
+ var _react2 = require('motion/react');
17
+ var _jsxruntime = require('react/jsx-runtime');
18
+ var AvatarGroupContext = React.createContext(null);
19
+ var StaggeredContent = ({ content }) => {
20
+ const children = React.Children.toArray(content);
21
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
22
+ _react2.motion.div,
23
+ {
24
+ initial: "initial",
25
+ animate: "animate",
26
+ exit: "exit",
27
+ variants: {
28
+ animate: { transition: { staggerChildren: 0.08 } }
29
+ },
30
+ children: children.map((child, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
31
+ _react2.motion.div,
32
+ {
33
+ variants: {
34
+ initial: { opacity: 0, y: 20 },
35
+ animate: {
36
+ opacity: 1,
37
+ y: 0,
38
+ transition: { duration: 0.3, ease: "easeOut" }
39
+ },
40
+ exit: {
41
+ opacity: 0,
42
+ y: -20,
43
+ transition: { duration: 0.2, ease: "easeIn" }
44
+ }
45
+ },
46
+ children: child
47
+ },
48
+ i
49
+ ))
50
+ }
51
+ );
52
+ };
53
+ function AvatarGroup({
54
+ children,
55
+ className,
56
+ tooltipClassName,
57
+ animation = "default"
58
+ }) {
59
+ const contextValue = {
60
+ tooltipClassName,
61
+ animation
62
+ };
63
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkCJXIPSTGcjs.cn.call(void 0, "-space-x-2.5 flex", className), children }) });
64
+ }
65
+ function AvatarGroupItem({
66
+ children,
67
+ className,
68
+ tooltipClassName,
69
+ animation: itemAnimation
70
+ }) {
71
+ const context = React.useContext(AvatarGroupContext);
72
+ const [hoveredIndex, setHoveredIndex] = React.useState(false);
73
+ const springConfig = { stiffness: 100, damping: 5 };
74
+ const x = _react2.useMotionValue.call(void 0, 0);
75
+ const animation = itemAnimation || _optionalChain([context, 'optionalAccess', _2 => _2.animation]) || "default";
76
+ const finalTooltipClassName = tooltipClassName || _optionalChain([context, 'optionalAccess', _3 => _3.tooltipClassName]);
77
+ const rotate = _react2.useSpring.call(void 0, _react2.useTransform.call(void 0, x, [-100, 100], [-45, 45]), springConfig);
78
+ const translateX = _react2.useSpring.call(void 0, _react2.useTransform.call(void 0, x, [-100, 100], [-50, 50]), springConfig);
79
+ const tooltipChild = React.Children.toArray(children).find(
80
+ (child) => React.isValidElement(child) && child.type === AvatarGroupTooltip
81
+ );
82
+ const otherChildren = React.Children.toArray(children).filter(
83
+ (child) => !(React.isValidElement(child) && child.type === AvatarGroupTooltip)
84
+ );
85
+ const tooltipContent = tooltipChild && React.isValidElement(tooltipChild) ? tooltipChild.props.children : null;
86
+ const handleMouseMove = (event) => {
87
+ const halfWidth = event.target.offsetWidth / 2;
88
+ x.set(event.nativeEvent.offsetX - halfWidth);
89
+ };
90
+ const animationVariants = {
91
+ default: {
92
+ initial: { opacity: 0, y: 20, scale: 0.6 },
93
+ animate: {
94
+ opacity: 1,
95
+ y: 0,
96
+ scale: 1,
97
+ transition: {
98
+ type: "spring",
99
+ stiffness: 260,
100
+ damping: 10
101
+ }
102
+ },
103
+ exit: {
104
+ opacity: 0,
105
+ y: 20,
106
+ scale: 0.6,
107
+ transition: {
108
+ duration: 0.2,
109
+ ease: "easeInOut"
110
+ }
111
+ }
112
+ },
113
+ flip: {
114
+ initial: { opacity: 0, rotateX: -90 },
115
+ animate: {
116
+ opacity: 1,
117
+ rotateX: 0,
118
+ transition: {
119
+ type: "spring",
120
+ stiffness: 180,
121
+ damping: 25
122
+ }
123
+ },
124
+ exit: {
125
+ opacity: 0,
126
+ rotateX: -90,
127
+ transition: {
128
+ duration: 0.3,
129
+ ease: "easeInOut"
130
+ }
131
+ }
132
+ },
133
+ reveal: {
134
+ initial: { opacity: 0, scale: 0.95 },
135
+ animate: {
136
+ opacity: 1,
137
+ scale: 1,
138
+ transition: { duration: 0.15, ease: "easeOut" }
139
+ },
140
+ exit: {
141
+ opacity: 0,
142
+ scale: 0.95,
143
+ transition: { duration: 0.1, ease: "easeIn" }
144
+ }
145
+ }
146
+ };
147
+ const selectedVariant = animationVariants[animation];
148
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
149
+ "div",
150
+ {
151
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "group relative", className),
152
+ onMouseEnter: () => setHoveredIndex(true),
153
+ onMouseLeave: () => setHoveredIndex(false),
154
+ children: [
155
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react2.AnimatePresence, { mode: "wait", children: hoveredIndex && tooltipContent && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
156
+ _react2.motion.div,
157
+ {
158
+ initial: selectedVariant.initial,
159
+ animate: selectedVariant.animate,
160
+ exit: selectedVariant.exit,
161
+ style: {
162
+ translateX: animation === "reveal" ? 0 : translateX,
163
+ rotate: animation === "reveal" ? 0 : rotate,
164
+ whiteSpace: "nowrap",
165
+ transformOrigin: "center"
166
+ },
167
+ className: _chunkCJXIPSTGcjs.cn.call(void 0,
168
+ "-top-16 -translate-x-1/2 absolute left-1/2 z-50 flex flex-col items-center justify-center rounded-md bg-black px-4 py-2 font-medium text-white text-xs shadow-xl",
169
+ finalTooltipClassName
170
+ ),
171
+ children: [
172
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
173
+ _react2.motion.div,
174
+ {
175
+ className: "-bottom-px absolute inset-x-10 z-30 h-px w-[20%] bg-gradient-to-r from-transparent via-emerald-500 to-transparent dark:via-emerald-900",
176
+ initial: { opacity: 0 },
177
+ animate: { opacity: 1 },
178
+ exit: { opacity: 0 },
179
+ transition: { duration: 0.15 }
180
+ }
181
+ ),
182
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
183
+ _react2.motion.div,
184
+ {
185
+ className: "-bottom-px absolute left-10 z-30 h-px w-[40%] bg-gradient-to-r from-transparent via-sky-500 to-transparent dark:via-sky-900",
186
+ initial: { opacity: 0 },
187
+ animate: { opacity: 1 },
188
+ exit: { opacity: 0 },
189
+ transition: { duration: 0.15 }
190
+ }
191
+ ),
192
+ animation === "reveal" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StaggeredContent, { content: tooltipContent }) : tooltipContent
193
+ ]
194
+ }
195
+ ) }),
196
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
197
+ _react2.motion.div,
198
+ {
199
+ className: "relative cursor-pointer",
200
+ whileHover: {
201
+ zIndex: 30
202
+ },
203
+ whileTap: { scale: 0.95 },
204
+ transition: {
205
+ duration: 0.5
206
+ },
207
+ onMouseMove: handleMouseMove,
208
+ children: otherChildren
209
+ }
210
+ )
211
+ ]
212
+ }
213
+ );
214
+ }
215
+ function AvatarGroupTooltip({ children, className }) {
216
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
217
+ _react2.motion.div,
218
+ {
219
+ initial: { opacity: 0, y: 20, scale: 0.6 },
220
+ animate: { opacity: 1 },
221
+ exit: { opacity: 0 },
222
+ transition: { duration: 0.15 },
223
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "relative z-30 hidden", className),
224
+ children
225
+ }
226
+ );
227
+ }
228
+
229
+ // src/ui/animation/counting-number.tsx
230
+
231
+
232
+
233
+ function CountingNumber({
234
+ from = 0,
235
+ to = 100,
236
+ duration = 2,
237
+ delay = 0,
238
+ className,
239
+ startOnView = true,
240
+ once = false,
241
+ inViewMargin,
242
+ onComplete,
243
+ format,
244
+ ...props
245
+ }) {
246
+ const ref = _react.useRef.call(void 0, null);
247
+ const isInView = _react2.useInView.call(void 0, ref, { once, margin: inViewMargin });
248
+ const [hasAnimated, setHasAnimated] = _react.useState.call(void 0, false);
249
+ const [display, setDisplay] = _react.useState.call(void 0, from);
250
+ const motionValue = _react2.useMotionValue.call(void 0, from);
251
+ const shouldStart = !startOnView || isInView && (!once || !hasAnimated);
252
+ _react.useEffect.call(void 0, () => {
253
+ if (!shouldStart) return;
254
+ setHasAnimated(true);
255
+ const timeout = setTimeout(() => {
256
+ const controls = _react2.animate.call(void 0, motionValue, to, {
257
+ duration,
258
+ onUpdate: (v) => setDisplay(v),
259
+ onComplete
260
+ });
261
+ return () => controls.stop();
262
+ }, delay);
263
+ return () => clearTimeout(timeout);
264
+ }, [shouldStart, to, duration, delay, motionValue, onComplete]);
265
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react2.motion.span, { ref, className: _chunkCJXIPSTGcjs.cn.call(void 0, "inline-block", className), ...props, children: format ? format(display) : Math.round(display) });
266
+ }
267
+
268
+ // src/ui/animation/github-button.tsx
269
+
270
+ var _classvarianceauthority = require('class-variance-authority');
271
+ var _lucidereact = require('lucide-react');
272
+
273
+
274
+ var githubButtonVariants = _classvarianceauthority.cva.call(void 0,
275
+ "cursor-pointer relative overflow-hidden will-change-transform backface-visibility-hidden transform-gpu transition-transform duration-200 ease-out hover:scale-105 group focus-visible:outline-hidden inline-flex items-center justify-center whitespace-nowrap font-medium ring-offset-background disabled:pointer-events-none disabled:opacity-60 [&_svg]:shrink-0",
276
+ {
277
+ variants: {
278
+ variant: {
279
+ default: "bg-zinc-950 hover:bg-zinc-900 text-white border-gray-700 dark:bg-zinc-50 dark:border-gray-300 dark:text-zinc-950 dark:hover:bg-zinc-50",
280
+ outline: "bg-background text-accent-foreground border border-input hover:bg-accent"
281
+ },
282
+ size: {
283
+ default: "h-8.5 rounded-md px-3 text-[0.8125rem] leading-none [&_svg]:size-4 gap-2",
284
+ sm: "h-7 rounded-md px-2.5 text-xs leading-none [&_svg]:size-3.5 gap-1.5",
285
+ lg: "h-10 rounded-md px-4 text-sm leading-none [&_svg]:size-5 gap-2.5"
286
+ }
287
+ },
288
+ defaultVariants: {
289
+ variant: "default",
290
+ size: "default"
291
+ }
292
+ }
293
+ );
294
+ function GithubButton({
295
+ initialStars = 0,
296
+ targetStars = 0,
297
+ starsClass = "",
298
+ fixedWidth = true,
299
+ animationDuration = 2,
300
+ animationDelay = 0,
301
+ autoAnimate = true,
302
+ className,
303
+ variant = "default",
304
+ size = "default",
305
+ showGithubIcon = true,
306
+ showStarIcon = true,
307
+ roundStars = false,
308
+ separator = false,
309
+ filled = false,
310
+ repoUrl,
311
+ onClick,
312
+ label = "",
313
+ useInViewTrigger = false,
314
+ inViewOptions = { once: true },
315
+ transition,
316
+ ...props
317
+ }) {
318
+ const [currentStars, setCurrentStars] = _react.useState.call(void 0, initialStars);
319
+ const [isAnimating, setIsAnimating] = _react.useState.call(void 0, false);
320
+ const [starProgress, setStarProgress] = _react.useState.call(void 0, filled ? 100 : 0);
321
+ const [hasAnimated, setHasAnimated] = _react.useState.call(void 0, false);
322
+ const formatNumber = (num) => {
323
+ const units = ["k", "M", "B", "T"];
324
+ if (roundStars && num >= 1e3) {
325
+ let unitIndex = -1;
326
+ let value = num;
327
+ while (value >= 1e3 && unitIndex < units.length - 1) {
328
+ value /= 1e3;
329
+ unitIndex++;
330
+ }
331
+ const formatted = value % 1 === 0 ? value.toString() : value.toFixed(1);
332
+ return `${formatted}${units[unitIndex]}`;
333
+ }
334
+ return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
335
+ };
336
+ const startAnimation = _react.useCallback.call(void 0, () => {
337
+ if (isAnimating || hasAnimated) return;
338
+ setIsAnimating(true);
339
+ const startTime = Date.now();
340
+ const startValue = 0;
341
+ const endValue = targetStars;
342
+ const duration = animationDuration * 1e3;
343
+ const animate2 = () => {
344
+ const elapsed = Date.now() - startTime;
345
+ const progress = Math.min(elapsed / duration, 1);
346
+ const easeOutQuart = 1 - (1 - progress) ** 4;
347
+ const newStars = Math.round(startValue + (endValue - startValue) * easeOutQuart);
348
+ setCurrentStars(newStars);
349
+ setStarProgress(progress * 100);
350
+ if (progress < 1) {
351
+ requestAnimationFrame(animate2);
352
+ } else {
353
+ setCurrentStars(endValue);
354
+ setStarProgress(100);
355
+ setIsAnimating(false);
356
+ setHasAnimated(true);
357
+ }
358
+ };
359
+ setTimeout(() => {
360
+ requestAnimationFrame(animate2);
361
+ }, animationDelay * 1e3);
362
+ }, [isAnimating, hasAnimated, targetStars, animationDuration, animationDelay]);
363
+ const ref = React.default.useRef(null);
364
+ const isInView = _react2.useInView.call(void 0, ref, inViewOptions);
365
+ _react.useEffect.call(void 0, () => {
366
+ setHasAnimated(false);
367
+ setCurrentStars(initialStars);
368
+ }, [initialStars]);
369
+ _react.useEffect.call(void 0, () => {
370
+ if (useInViewTrigger) {
371
+ if (isInView && !hasAnimated) {
372
+ startAnimation();
373
+ }
374
+ } else if (autoAnimate && !hasAnimated) {
375
+ startAnimation();
376
+ }
377
+ }, [autoAnimate, useInViewTrigger, isInView, hasAnimated, startAnimation]);
378
+ const navigateToRepo = () => {
379
+ if (!repoUrl) {
380
+ return;
381
+ }
382
+ try {
383
+ const link = document.createElement("a");
384
+ link.href = repoUrl;
385
+ link.target = "_blank";
386
+ link.rel = "noopener noreferrer";
387
+ document.body.appendChild(link);
388
+ link.click();
389
+ document.body.removeChild(link);
390
+ } catch (e) {
391
+ try {
392
+ window.open(repoUrl, "_blank", "noopener,noreferrer");
393
+ } catch (e2) {
394
+ window.location.href = repoUrl;
395
+ }
396
+ }
397
+ };
398
+ const handleClick = (event) => {
399
+ if (onClick) {
400
+ onClick(event);
401
+ return;
402
+ }
403
+ if (repoUrl) {
404
+ navigateToRepo();
405
+ } else if (!hasAnimated) {
406
+ startAnimation();
407
+ }
408
+ };
409
+ const handleKeyDown = (event) => {
410
+ if (event.key === "Enter" || event.key === " ") {
411
+ event.preventDefault();
412
+ if (repoUrl) {
413
+ navigateToRepo();
414
+ } else if (!hasAnimated) {
415
+ startAnimation();
416
+ }
417
+ }
418
+ };
419
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
420
+ "button",
421
+ {
422
+ ref,
423
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, githubButtonVariants({ variant, size, className }), separator && "ps-0"),
424
+ onClick: handleClick,
425
+ onKeyDown: handleKeyDown,
426
+ tabIndex: 0,
427
+ "aria-label": repoUrl ? `Star ${label} on GitHub` : label,
428
+ ...props,
429
+ children: [
430
+ showGithubIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
431
+ "div",
432
+ {
433
+ className: _chunkCJXIPSTGcjs.cn.call(void 0,
434
+ "relative flex h-full items-center justify-center",
435
+ separator && "w-9 border-input border-e bg-muted/60"
436
+ ),
437
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { role: "img", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" }) })
438
+ }
439
+ ),
440
+ label && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: label }),
441
+ showStarIcon && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "relative inline-flex shrink-0", children: [
442
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Star, { className: "fill-muted-foreground text-muted-foreground", "aria-hidden": "true" }),
443
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
444
+ _lucidereact.Star,
445
+ {
446
+ className: "absolute start-0 top-0 fill-yellow-400 text-yellow-400",
447
+ size: 18,
448
+ "aria-hidden": "true",
449
+ style: {
450
+ clipPath: `inset(${100 - starProgress}% 0 0 0)`
451
+ }
452
+ }
453
+ )
454
+ ] }),
455
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkCJXIPSTGcjs.cn.call(void 0, "relative flex flex-col overflow-hidden font-semibold", starsClass), children: [
456
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
457
+ _react2.motion.div,
458
+ {
459
+ animate: { opacity: 1 },
460
+ transition: {
461
+ type: "spring",
462
+ stiffness: 300,
463
+ damping: 30,
464
+ ...transition
465
+ },
466
+ className: "tabular-nums",
467
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: currentStars > 0 && formatNumber(currentStars) })
468
+ }
469
+ ),
470
+ fixedWidth && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "h-0 overflow-hidden tabular-nums opacity-0", children: formatNumber(targetStars) })
471
+ ] })
472
+ ]
473
+ }
474
+ );
475
+ }
476
+
477
+ // src/ui/animation/gradient-background.tsx
478
+
479
+
480
+ function GradientBackground({
481
+ className,
482
+ transition = { duration: 10, ease: "easeInOut", repeat: Infinity },
483
+ ...props
484
+ }) {
485
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
486
+ _react2.motion.div,
487
+ {
488
+ "data-slot": "gradient-background",
489
+ className: _chunkCJXIPSTGcjs.cn.call(void 0,
490
+ "size-full bg-[length:300%_300%] bg-gradient-to-br from-0% from-fuchsia-400 via-50% via-violet-500 to-100% to-fuchsia-600",
491
+ className
492
+ ),
493
+ animate: {
494
+ backgroundPosition: [
495
+ "0% 0%",
496
+ "50% 50%",
497
+ "100% 0%",
498
+ "50% 100%",
499
+ "0% 50%",
500
+ "100% 100%",
501
+ "0% 0%"
502
+ ]
503
+ },
504
+ whileTap: {
505
+ scale: 0.98
506
+ },
507
+ transition,
508
+ ...props
509
+ }
510
+ );
511
+ }
512
+
513
+ // src/ui/animation/grid-background.tsx
514
+
515
+
516
+
517
+ function GridBackground({
518
+ className,
519
+ children,
520
+ gridSize = "8:8",
521
+ colors = {},
522
+ beams = {},
523
+ ...props
524
+ }) {
525
+ const {
526
+ background = "bg-slate-900",
527
+ borderColor = "border-slate-700/50",
528
+ borderSize = "1px",
529
+ borderStyle = "solid"
530
+ } = colors;
531
+ const {
532
+ count = 12,
533
+ colors: beamColors = [
534
+ "bg-cyan-400",
535
+ "bg-purple-400",
536
+ "bg-fuchsia-400",
537
+ "bg-violet-400",
538
+ "bg-blue-400",
539
+ "bg-indigo-400",
540
+ "bg-green-400",
541
+ "bg-yellow-400",
542
+ "bg-orange-400",
543
+ "bg-red-400",
544
+ "bg-pink-400",
545
+ "bg-rose-400"
546
+ ],
547
+ shadow = "shadow-lg shadow-cyan-400/50 rounded-full",
548
+ speed = 4
549
+ } = beams;
550
+ const [cols, rows] = gridSize.split(":").map(Number);
551
+ const animatedBeams = React3.useMemo(
552
+ () => Array.from({ length: Math.min(count, 12) }, (_, i) => {
553
+ const direction = Math.random() > 0.5 ? "horizontal" : "vertical";
554
+ const startPosition = Math.random() > 0.5 ? "start" : "end";
555
+ return {
556
+ id: i,
557
+ color: beamColors[i % beamColors.length],
558
+ direction,
559
+ startPosition,
560
+ // For horizontal beams: choose a row index (1 to rows-1) - exclude edges
561
+ // For vertical beams: choose a column index (1 to cols-1) - exclude edges
562
+ gridLine: direction === "horizontal" ? Math.floor(Math.random() * (rows - 1)) + 1 : Math.floor(Math.random() * (cols - 1)) + 1,
563
+ delay: Math.random() * 2,
564
+ duration: speed + Math.random() * 2
565
+ };
566
+ }),
567
+ [count, beamColors, speed, cols, rows]
568
+ );
569
+ const gridStyle = {
570
+ "--border-style": borderStyle
571
+ };
572
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
573
+ _react2.motion.div,
574
+ {
575
+ "data-slot": "grid-background",
576
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "relative size-full overflow-hidden", background, className),
577
+ style: gridStyle,
578
+ ...props,
579
+ children: [
580
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
581
+ "div",
582
+ {
583
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "absolute inset-0 size-full", borderColor),
584
+ style: {
585
+ display: "grid",
586
+ gridTemplateColumns: `repeat(${cols}, 1fr)`,
587
+ gridTemplateRows: `repeat(${rows}, 1fr)`,
588
+ borderRightWidth: borderSize,
589
+ borderBottomWidth: borderSize,
590
+ borderRightStyle: borderStyle,
591
+ borderBottomStyle: borderStyle
592
+ },
593
+ children: Array.from({ length: cols * rows }).map((_, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
594
+ "div",
595
+ {
596
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "relative", borderColor),
597
+ style: {
598
+ borderTopWidth: borderSize,
599
+ borderLeftWidth: borderSize,
600
+ borderTopStyle: borderStyle,
601
+ borderLeftStyle: borderStyle
602
+ }
603
+ },
604
+ index
605
+ ))
606
+ }
607
+ ),
608
+ animatedBeams.map((beam) => {
609
+ const horizontalPosition = beam.gridLine / rows * 100;
610
+ const verticalPosition = beam.gridLine / cols * 100;
611
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
612
+ _react2.motion.div,
613
+ {
614
+ className: _chunkCJXIPSTGcjs.cn.call(void 0,
615
+ "absolute z-20 rounded-full backdrop-blur-sm",
616
+ beam.color,
617
+ beam.direction === "horizontal" ? "h-0.5 w-6" : "h-6 w-0.5",
618
+ shadow
619
+ ),
620
+ style: {
621
+ ...beam.direction === "horizontal" ? {
622
+ // Position exactly on the horizontal grid line
623
+ top: `${horizontalPosition}%`,
624
+ left: beam.startPosition === "start" ? "-12px" : "calc(100% + 12px)",
625
+ transform: "translateY(-50%)"
626
+ // Center on the line
627
+ } : {
628
+ // Position exactly on the vertical grid line
629
+ left: `${verticalPosition}%`,
630
+ top: beam.startPosition === "start" ? "-12px" : "calc(100% + 12px)",
631
+ transform: "translateX(-50%)"
632
+ // Center on the line
633
+ }
634
+ },
635
+ initial: {
636
+ opacity: 0
637
+ },
638
+ animate: {
639
+ opacity: [0, 1, 1, 0],
640
+ ...beam.direction === "horizontal" ? {
641
+ // Move across the full width of the container
642
+ x: beam.startPosition === "start" ? [0, "calc(100vw + 24px)"] : [0, "calc(-100vw - 24px)"]
643
+ } : {
644
+ // Move across the full height of the container
645
+ y: beam.startPosition === "start" ? [0, "calc(100vh + 24px)"] : [0, "calc(-100vh - 24px)"]
646
+ }
647
+ },
648
+ transition: {
649
+ duration: beam.duration,
650
+ delay: beam.delay,
651
+ repeat: Infinity,
652
+ repeatDelay: Math.random() * 3 + 2,
653
+ // 2-5s pause between repeats
654
+ ease: "linear",
655
+ times: [0, 0.1, 0.9, 1]
656
+ // Quick fade in, maintain, quick fade out
657
+ }
658
+ },
659
+ beam.id
660
+ );
661
+ }),
662
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "relative z-10 size-full", children })
663
+ ]
664
+ }
665
+ );
666
+ }
667
+
668
+ // src/ui/animation/hover-background.tsx
669
+
670
+
671
+
672
+ function HoverBackground({
673
+ className,
674
+ objectCount = 12,
675
+ children,
676
+ colors = {},
677
+ ...props
678
+ }) {
679
+ const {
680
+ background = "bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900",
681
+ objects = [
682
+ "bg-cyan-400/20",
683
+ "bg-purple-400/20",
684
+ "bg-fuchsia-400/20",
685
+ "bg-violet-400/20",
686
+ "bg-blue-400/20",
687
+ "bg-indigo-400/20"
688
+ ],
689
+ glow = "shadow-cyan-400/50"
690
+ } = colors;
691
+ const [isHovered, setIsHovered] = React4.useState(false);
692
+ const mouseX = _react2.useMotionValue.call(void 0, 0);
693
+ const mouseY = _react2.useMotionValue.call(void 0, 0);
694
+ const springX = _react2.useSpring.call(void 0, mouseX, {
695
+ stiffness: 300,
696
+ damping: 30,
697
+ // Slower return to center when hover ends
698
+ restSpeed: 0.1,
699
+ restDelta: 0.1
700
+ });
701
+ const springY = _react2.useSpring.call(void 0, mouseY, {
702
+ stiffness: 300,
703
+ damping: 30,
704
+ restSpeed: 0.1,
705
+ restDelta: 0.1
706
+ });
707
+ const animatedObjects = React4.useMemo(
708
+ () => Array.from({ length: objectCount }, (_, i) => {
709
+ const shape = Math.random() > 0.5 ? "circle" : "square";
710
+ return {
711
+ id: i,
712
+ x: Math.random() * 90 + 5,
713
+ // 5-95% to avoid edges
714
+ y: Math.random() * 90 + 5,
715
+ size: Math.random() * 60 + 20,
716
+ // 20-80px
717
+ color: objects[i % objects.length],
718
+ delay: Math.random() * 2,
719
+ shape,
720
+ floatDirection: Math.random() > 0.5 ? 1 : -1,
721
+ breathDuration: Math.random() * 3 + 3,
722
+ // 3-6 seconds
723
+ parallaxStrength: Math.random() * 0.5 + 0.3,
724
+ // 0.3-0.8 for more varied parallax depth
725
+ baseRotation: Math.random() * 360
726
+ // Random starting rotation offset
727
+ };
728
+ }),
729
+ [objectCount, objects]
730
+ );
731
+ const handleMouseMove = (event) => {
732
+ if (!isHovered) return;
733
+ const rect = event.currentTarget.getBoundingClientRect();
734
+ const centerX = rect.width / 2;
735
+ const centerY = rect.height / 2;
736
+ const x = (event.clientX - rect.left - centerX) / centerX;
737
+ const y = (event.clientY - rect.top - centerY) / centerY;
738
+ mouseX.set(x * 15);
739
+ mouseY.set(y * 15);
740
+ };
741
+ const handleHoverStart = () => {
742
+ setIsHovered(true);
743
+ };
744
+ const handleHoverEnd = () => {
745
+ setIsHovered(false);
746
+ mouseX.set(0);
747
+ mouseY.set(0);
748
+ };
749
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
750
+ _react2.motion.div,
751
+ {
752
+ "data-slot": "hover-background",
753
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "relative size-full overflow-hidden", background, className),
754
+ onHoverStart: handleHoverStart,
755
+ onHoverEnd: handleHoverEnd,
756
+ onMouseMove: handleMouseMove,
757
+ whileHover: { scale: 1.02 },
758
+ transition: { duration: 0.3, ease: "easeOut" },
759
+ animate: {
760
+ backgroundPosition: ["0% 50%", "100% 50%", "0% 50%"]
761
+ },
762
+ style: {
763
+ backgroundSize: "200% 200%"
764
+ },
765
+ ...props,
766
+ children: [
767
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
768
+ _react2.motion.div,
769
+ {
770
+ className: "absolute inset-0 bg-gradient-radial from-white/5 via-transparent to-transparent",
771
+ animate: {
772
+ opacity: [0.3, 0.6, 0.3],
773
+ scale: [1, 1.1, 1]
774
+ },
775
+ transition: {
776
+ duration: 4,
777
+ repeat: Infinity,
778
+ ease: "easeInOut"
779
+ }
780
+ }
781
+ ),
782
+ animatedObjects.map((obj) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
783
+ _react2.motion.div,
784
+ {
785
+ className: _chunkCJXIPSTGcjs.cn.call(void 0,
786
+ "absolute border border-white/10 backdrop-blur-sm",
787
+ obj.color,
788
+ obj.shape === "circle" ? "rounded-full" : "rotate-45 rounded-lg"
789
+ ),
790
+ style: {
791
+ left: `${obj.x}%`,
792
+ top: `${obj.y}%`,
793
+ width: obj.size,
794
+ height: obj.size,
795
+ // Apply parallax with individual object strength
796
+ x: springX.get() * obj.parallaxStrength,
797
+ y: springY.get() * obj.parallaxStrength
798
+ },
799
+ initial: {
800
+ scale: 0.6,
801
+ opacity: 0.4,
802
+ rotate: obj.baseRotation
803
+ },
804
+ animate: {
805
+ // Default state animations - breathing with base rotation offset
806
+ scale: [0.6, 0.8, 0.6],
807
+ opacity: [0.4, 0.6, 0.4],
808
+ rotate: obj.shape === "circle" ? [obj.baseRotation, obj.baseRotation + 10, obj.baseRotation] : [obj.baseRotation, obj.baseRotation + 5, obj.baseRotation],
809
+ y: [0, obj.floatDirection * 15, 0],
810
+ x: [0, obj.floatDirection * 8, 0]
811
+ },
812
+ transition: {
813
+ duration: obj.breathDuration,
814
+ delay: obj.delay,
815
+ ease: "easeInOut",
816
+ repeat: Infinity,
817
+ repeatType: "reverse"
818
+ },
819
+ whileHover: {
820
+ scale: 1.5,
821
+ boxShadow: `0 0 30px ${glow.replace("shadow-", "").replace("/50", "")}`
822
+ }
823
+ },
824
+ obj.id
825
+ )),
826
+ isHovered && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "pointer-events-none absolute inset-0", children: Array.from({ length: 20 }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
827
+ _react2.motion.div,
828
+ {
829
+ className: "absolute h-1 w-1 rounded-full bg-white/60",
830
+ style: {
831
+ left: `${Math.random() * 100}%`,
832
+ top: `${Math.random() * 100}%`
833
+ },
834
+ initial: { opacity: 0, scale: 0 },
835
+ animate: {
836
+ opacity: [0, 1, 0],
837
+ scale: [0, 1, 0],
838
+ y: [0, -50, -100]
839
+ },
840
+ transition: {
841
+ duration: 3,
842
+ delay: Math.random() * 2,
843
+ repeat: Infinity,
844
+ ease: "easeOut"
845
+ }
846
+ },
847
+ `particle-${i}`
848
+ )) }),
849
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "relative z-10 size-full", children })
850
+ ]
851
+ }
852
+ );
853
+ }
854
+
855
+ // src/ui/animation/marquee.tsx
856
+
857
+
858
+ function Marquee({
859
+ className,
860
+ reverse = false,
861
+ pauseOnHover = false,
862
+ children,
863
+ vertical = false,
864
+ repeat = 4,
865
+ ariaLabel,
866
+ ariaLive = "off",
867
+ ariaRole = "marquee",
868
+ ...props
869
+ }) {
870
+ const marqueeRef = _react.useRef.call(void 0, null);
871
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
872
+ "div",
873
+ {
874
+ ...props,
875
+ ref: marqueeRef,
876
+ "data-slot": "marquee",
877
+ className: _chunkCJXIPSTGcjs.cn.call(void 0,
878
+ "group flex overflow-hidden p-2 [--duration:40s] [--gap:1rem] [gap:var(--gap)]",
879
+ {
880
+ "flex-row": !vertical,
881
+ "flex-col": vertical
882
+ },
883
+ className
884
+ ),
885
+ "aria-label": ariaLabel,
886
+ "aria-live": ariaLive,
887
+ role: ariaRole,
888
+ tabIndex: 0,
889
+ children: React.default.useMemo(
890
+ () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: Array.from({ length: repeat }, (_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
891
+ "div",
892
+ {
893
+ className: _chunkCJXIPSTGcjs.cn.call(void 0,
894
+ !vertical ? "flex-row [gap:var(--gap)]" : "flex-col [gap:var(--gap)]",
895
+ "flex shrink-0 justify-around",
896
+ !vertical && "animate-marquee flex-row",
897
+ vertical && "animate-marquee-vertical flex-col",
898
+ pauseOnHover && "group-hover:[animation-play-state:paused]",
899
+ reverse && "[animation-direction:reverse]"
900
+ ),
901
+ children
902
+ },
903
+ i
904
+ )) }),
905
+ [repeat, children, vertical, pauseOnHover, reverse]
906
+ )
907
+ }
908
+ );
909
+ }
910
+
911
+ // src/ui/animation/shimmering-text.tsx
912
+
913
+
914
+
915
+ function ShimmeringText({
916
+ text,
917
+ duration = 2,
918
+ delay = 0,
919
+ repeat = true,
920
+ repeatDelay = 0.5,
921
+ className,
922
+ startOnView = true,
923
+ once = false,
924
+ inViewMargin,
925
+ spread = 2,
926
+ color,
927
+ shimmerColor
928
+ }) {
929
+ const ref = _react.useRef.call(void 0, null);
930
+ const isInView = _react2.useInView.call(void 0, ref, { once, margin: inViewMargin });
931
+ const dynamicSpread = _react.useMemo.call(void 0, () => {
932
+ return text.length * spread;
933
+ }, [text, spread]);
934
+ const shouldAnimate = !startOnView || isInView;
935
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
936
+ _react2.motion.span,
937
+ {
938
+ ref,
939
+ className: _chunkCJXIPSTGcjs.cn.call(void 0,
940
+ "relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent",
941
+ "[--base-color:var(--color-zinc-400)] [--shimmer-color:var(--color-zinc-950)]",
942
+ "[background-repeat:no-repeat,padding-box]",
943
+ "[--shimmer-bg:linear-gradient(90deg,transparent_calc(50%-var(--spread)),var(--shimmer-color),transparent_calc(50%+var(--spread)))]",
944
+ "dark:[--base-color:var(--color-zinc-600)] dark:[--shimmer-color:var(--color-white)]",
945
+ className
946
+ ),
947
+ style: {
948
+ "--spread": `${dynamicSpread}px`,
949
+ ...color && { "--base-color": color },
950
+ ...shimmerColor && { "--shimmer-color": shimmerColor },
951
+ backgroundImage: `var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))`
952
+ },
953
+ initial: {
954
+ backgroundPosition: "100% center",
955
+ opacity: 0
956
+ },
957
+ animate: shouldAnimate ? {
958
+ backgroundPosition: "0% center",
959
+ opacity: 1
960
+ } : {},
961
+ transition: {
962
+ backgroundPosition: {
963
+ repeat: repeat ? Infinity : 0,
964
+ duration,
965
+ delay,
966
+ repeatDelay,
967
+ ease: "linear"
968
+ },
969
+ opacity: {
970
+ duration: 0.3,
971
+ delay
972
+ }
973
+ },
974
+ children: text
975
+ }
976
+ );
977
+ }
978
+
979
+ // src/ui/animation/sliding-number.tsx
980
+
981
+
982
+
983
+ function Digit({
984
+ place,
985
+ value,
986
+ digitHeight,
987
+ duration
988
+ }) {
989
+ const valueRoundedToPlace = Math.floor(value / place);
990
+ const animatedValue = _react2.useSpring.call(void 0, valueRoundedToPlace, {
991
+ duration: duration * 1e3
992
+ // Convert to milliseconds
993
+ });
994
+ _react.useEffect.call(void 0, () => {
995
+ animatedValue.set(valueRoundedToPlace);
996
+ }, [animatedValue, valueRoundedToPlace]);
997
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { height: digitHeight }, className: "relative w-[1ch] overflow-hidden tabular-nums", children: Array.from({ length: 10 }, (_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MyNumber, { mv: animatedValue, number: i, digitHeight }, i)) });
998
+ }
999
+ function MyNumber({
1000
+ mv,
1001
+ number,
1002
+ digitHeight
1003
+ }) {
1004
+ const y = _react2.useTransform.call(void 0, mv, (latest) => {
1005
+ const placeValue = latest % 10;
1006
+ const offset = (10 + number - placeValue) % 10;
1007
+ let memo = offset * digitHeight;
1008
+ if (offset > 5) {
1009
+ memo -= 10 * digitHeight;
1010
+ }
1011
+ return memo;
1012
+ });
1013
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react2.motion.span, { style: { y }, className: "absolute inset-0 flex items-center justify-center", children: number });
1014
+ }
1015
+ function SlidingNumber({
1016
+ from,
1017
+ to,
1018
+ duration = 2,
1019
+ delay = 0,
1020
+ startOnView = true,
1021
+ once = false,
1022
+ className = "",
1023
+ onComplete,
1024
+ digitHeight = 40
1025
+ }) {
1026
+ const ref = _react.useRef.call(void 0, null);
1027
+ const isInView = _react2.useInView.call(void 0, ref, { once: false });
1028
+ const [currentValue, setCurrentValue] = _react.useState.call(void 0, from);
1029
+ const [hasAnimated, setHasAnimated] = _react.useState.call(void 0, false);
1030
+ const [animationKey, setAnimationKey] = _react.useState.call(void 0, 0);
1031
+ _react.useEffect.call(void 0, () => {
1032
+ setCurrentValue(from);
1033
+ setHasAnimated(false);
1034
+ setAnimationKey((prev) => prev + 1);
1035
+ }, [from]);
1036
+ _react.useEffect.call(void 0, () => {
1037
+ setCurrentValue(from);
1038
+ setHasAnimated(false);
1039
+ setAnimationKey((prev) => prev + 1);
1040
+ }, [from]);
1041
+ _react.useEffect.call(void 0, () => {
1042
+ if (!startOnView || !isInView) return;
1043
+ if (once && hasAnimated) return;
1044
+ const timer = setTimeout(() => {
1045
+ setAnimationKey((prev) => prev + 1);
1046
+ }, 50);
1047
+ return () => clearTimeout(timer);
1048
+ }, [isInView, startOnView, once, hasAnimated]);
1049
+ const shouldStart = !startOnView || isInView && (!once || !hasAnimated);
1050
+ _react.useEffect.call(void 0, () => {
1051
+ if (!shouldStart) return;
1052
+ setHasAnimated(true);
1053
+ const timer = setTimeout(() => {
1054
+ const startTime = Date.now();
1055
+ const startValue = currentValue;
1056
+ const difference = to - startValue;
1057
+ const animate2 = () => {
1058
+ const elapsed = Date.now() - startTime;
1059
+ const progress = Math.min(elapsed / (duration * 1e3), 1);
1060
+ const easeOutCubic = 1 - (1 - progress) ** 3;
1061
+ const newValue = startValue + difference * easeOutCubic;
1062
+ setCurrentValue(newValue);
1063
+ if (progress < 1) {
1064
+ requestAnimationFrame(animate2);
1065
+ } else {
1066
+ setCurrentValue(to);
1067
+ _optionalChain([onComplete, 'optionalCall', _4 => _4()]);
1068
+ }
1069
+ };
1070
+ requestAnimationFrame(animate2);
1071
+ }, delay * 1e3);
1072
+ return () => clearTimeout(timer);
1073
+ }, [shouldStart, currentValue, to, duration, delay, onComplete]);
1074
+ const roundedValue = Math.round(currentValue);
1075
+ const absValue = Math.abs(roundedValue);
1076
+ const maxDigits = Math.max(Math.abs(from).toString().length, Math.abs(to).toString().length);
1077
+ const places = Array.from({ length: maxDigits }, (_, i) => 10 ** (maxDigits - i - 1));
1078
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref, className: `flex items-center ${className}`, children: [
1079
+ roundedValue < 0 && "-",
1080
+ places.map((place) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1081
+ Digit,
1082
+ {
1083
+ place,
1084
+ value: absValue,
1085
+ digitHeight,
1086
+ duration
1087
+ },
1088
+ `${place}-${animationKey}`
1089
+ ))
1090
+ ] });
1091
+ }
1092
+
1093
+ // src/ui/animation/svg-text.tsx
1094
+
1095
+
1096
+
1097
+ function SvgText({
1098
+ svg,
1099
+ children,
1100
+ className = "",
1101
+ fontSize = "20vw",
1102
+ fontWeight = "bold",
1103
+ as: Component = "div"
1104
+ }) {
1105
+ const textRef = _react.useRef.call(void 0, null);
1106
+ const [textDimensions, setTextDimensions] = _react.useState.call(void 0, { width: 0, height: 0 });
1107
+ const content = React6.Children.toArray(children).join("");
1108
+ const maskId = React6.useId();
1109
+ _react.useEffect.call(void 0, () => {
1110
+ if (!textRef.current) return;
1111
+ const updateDimensions = () => {
1112
+ const rect = _optionalChain([textRef, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.getBoundingClientRect, 'call', _7 => _7()]);
1113
+ if (rect) {
1114
+ setTextDimensions({
1115
+ width: Math.max(rect.width, 200),
1116
+ height: Math.max(rect.height, 100)
1117
+ });
1118
+ }
1119
+ };
1120
+ updateDimensions();
1121
+ const resizeObserver = new ResizeObserver(updateDimensions);
1122
+ resizeObserver.observe(textRef.current);
1123
+ return () => resizeObserver.disconnect();
1124
+ }, []);
1125
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Component, { className: _chunkCJXIPSTGcjs.cn.call(void 0, "relative inline-block", className), children: [
1126
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1127
+ "div",
1128
+ {
1129
+ ref: textRef,
1130
+ className: "pointer-events-none absolute whitespace-nowrap font-bold opacity-0",
1131
+ style: {
1132
+ fontSize: typeof fontSize === "number" ? `${fontSize}px` : fontSize,
1133
+ fontWeight,
1134
+ fontFamily: "system-ui, -apple-system, sans-serif"
1135
+ },
1136
+ children: content
1137
+ }
1138
+ ),
1139
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1140
+ "svg",
1141
+ {
1142
+ className: "block",
1143
+ width: textDimensions.width,
1144
+ height: textDimensions.height,
1145
+ viewBox: `0 0 ${textDimensions.width} ${textDimensions.height}`,
1146
+ style: {
1147
+ fontSize: typeof fontSize === "number" ? `${fontSize}px` : fontSize,
1148
+ fontWeight,
1149
+ fontFamily: "system-ui, -apple-system, sans-serif"
1150
+ },
1151
+ children: [
1152
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "defs", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "mask", { id: maskId, children: [
1153
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "100%", height: "100%", fill: "black" }),
1154
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1155
+ "text",
1156
+ {
1157
+ x: "50%",
1158
+ y: "50%",
1159
+ textAnchor: "middle",
1160
+ dominantBaseline: "central",
1161
+ fill: "white",
1162
+ style: {
1163
+ fontSize: typeof fontSize === "number" ? `${fontSize}px` : fontSize,
1164
+ fontWeight,
1165
+ fontFamily: "system-ui, -apple-system, sans-serif"
1166
+ },
1167
+ children: content
1168
+ }
1169
+ )
1170
+ ] }) }),
1171
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "g", { mask: `url(#${maskId})`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1172
+ "foreignObject",
1173
+ {
1174
+ width: "100%",
1175
+ height: "100%",
1176
+ style: {
1177
+ overflow: "visible"
1178
+ },
1179
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1180
+ "div",
1181
+ {
1182
+ style: {
1183
+ width: `${textDimensions.width}px`,
1184
+ height: `${textDimensions.height}px`,
1185
+ display: "flex",
1186
+ alignItems: "center",
1187
+ justifyContent: "center"
1188
+ },
1189
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1190
+ "div",
1191
+ {
1192
+ style: {
1193
+ width: "400px",
1194
+ height: "200px",
1195
+ transform: `scale(${Math.max(textDimensions.width / 400, textDimensions.height / 200)})`,
1196
+ transformOrigin: "center"
1197
+ },
1198
+ children: svg
1199
+ }
1200
+ )
1201
+ }
1202
+ )
1203
+ }
1204
+ ) })
1205
+ ]
1206
+ }
1207
+ ),
1208
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", children: content })
1209
+ ] });
1210
+ }
1211
+
1212
+ // src/ui/animation/text-reveal.tsx
1213
+
1214
+
1215
+
1216
+ var containerVariants = {
1217
+ fade: {
1218
+ hidden: {},
1219
+ visible: {
1220
+ transition: { staggerChildren: 0.02 }
1221
+ }
1222
+ },
1223
+ slideUp: {
1224
+ hidden: {},
1225
+ visible: {
1226
+ transition: { staggerChildren: 0.04 }
1227
+ }
1228
+ },
1229
+ slideDown: {
1230
+ hidden: {},
1231
+ visible: {
1232
+ transition: { staggerChildren: 0.04 }
1233
+ }
1234
+ },
1235
+ slideLeft: {
1236
+ hidden: {},
1237
+ visible: {
1238
+ transition: { staggerChildren: 0.04 }
1239
+ }
1240
+ },
1241
+ slideRight: {
1242
+ hidden: {},
1243
+ visible: {
1244
+ transition: { staggerChildren: 0.04 }
1245
+ }
1246
+ },
1247
+ scale: {
1248
+ hidden: {},
1249
+ visible: {
1250
+ transition: { staggerChildren: 0.06 }
1251
+ }
1252
+ },
1253
+ blur: {
1254
+ hidden: {},
1255
+ visible: {
1256
+ transition: { staggerChildren: 0.03 }
1257
+ }
1258
+ },
1259
+ typewriter: {
1260
+ hidden: {},
1261
+ visible: {
1262
+ transition: { staggerChildren: 0.15 }
1263
+ }
1264
+ },
1265
+ wave: {
1266
+ hidden: {},
1267
+ visible: {
1268
+ transition: { staggerChildren: 0.12 }
1269
+ }
1270
+ },
1271
+ stagger: {
1272
+ hidden: {},
1273
+ visible: {
1274
+ transition: { staggerChildren: 0.08 }
1275
+ }
1276
+ },
1277
+ rotate: {
1278
+ hidden: {},
1279
+ visible: {
1280
+ transition: { staggerChildren: 0.05 }
1281
+ }
1282
+ },
1283
+ elastic: {
1284
+ hidden: {},
1285
+ visible: {
1286
+ transition: { staggerChildren: 0.07 }
1287
+ }
1288
+ }
1289
+ };
1290
+ var itemVariants = {
1291
+ fade: {
1292
+ hidden: { opacity: 0 },
1293
+ visible: {
1294
+ opacity: 1,
1295
+ transition: { duration: 0.6, ease: "easeOut" }
1296
+ }
1297
+ },
1298
+ slideUp: {
1299
+ hidden: { opacity: 0, y: 50, scale: 0.95 },
1300
+ visible: {
1301
+ opacity: 1,
1302
+ y: 0,
1303
+ scale: 1,
1304
+ transition: { duration: 0.7, ease: [0.22, 1, 0.36, 1] }
1305
+ }
1306
+ },
1307
+ slideDown: {
1308
+ hidden: { opacity: 0, y: -30, scale: 0.98 },
1309
+ visible: {
1310
+ opacity: 1,
1311
+ y: 0,
1312
+ scale: 1,
1313
+ transition: { duration: 0.5, ease: [0.25, 0.46, 0.45, 0.94] }
1314
+ }
1315
+ },
1316
+ slideLeft: {
1317
+ hidden: { opacity: 0, x: 60, rotateY: 15 },
1318
+ visible: {
1319
+ opacity: 1,
1320
+ x: 0,
1321
+ rotateY: 0,
1322
+ transition: { duration: 0.65, ease: [0.16, 1, 0.3, 1] }
1323
+ }
1324
+ },
1325
+ slideRight: {
1326
+ hidden: { opacity: 0, x: -60, rotateY: -15 },
1327
+ visible: {
1328
+ opacity: 1,
1329
+ x: 0,
1330
+ rotateY: 0,
1331
+ transition: { duration: 0.65, ease: [0.16, 1, 0.3, 1] }
1332
+ }
1333
+ },
1334
+ scale: {
1335
+ hidden: { opacity: 0, scale: 0.8 },
1336
+ visible: {
1337
+ opacity: 1,
1338
+ scale: 1,
1339
+ transition: { duration: 0.4, ease: [0.34, 1.56, 0.64, 1] }
1340
+ }
1341
+ },
1342
+ blur: {
1343
+ hidden: { opacity: 0, filter: "blur(4px)" },
1344
+ visible: {
1345
+ opacity: 1,
1346
+ filter: "blur(0px)",
1347
+ transition: { duration: 0.6, ease: "easeOut" }
1348
+ }
1349
+ },
1350
+ typewriter: {
1351
+ hidden: { width: 0 },
1352
+ visible: {
1353
+ width: "auto",
1354
+ transition: { duration: 0.3, ease: "easeInOut" }
1355
+ }
1356
+ },
1357
+ wave: {
1358
+ hidden: { opacity: 0, y: 20, rotateZ: -5 },
1359
+ visible: {
1360
+ opacity: 1,
1361
+ y: [20, -10, 0],
1362
+ rotateZ: [-5, 5, 0],
1363
+ transition: {
1364
+ duration: 0.8,
1365
+ ease: [0.34, 1.56, 0.64, 1],
1366
+ times: [0, 0.5, 1]
1367
+ }
1368
+ }
1369
+ },
1370
+ stagger: {
1371
+ hidden: { opacity: 0, y: 30, scale: 0.9 },
1372
+ visible: {
1373
+ opacity: 1,
1374
+ y: 0,
1375
+ scale: 1,
1376
+ transition: { duration: 0.6, ease: [0.25, 0.46, 0.45, 0.94] }
1377
+ }
1378
+ },
1379
+ rotate: {
1380
+ hidden: { opacity: 0, rotateY: -90 },
1381
+ visible: {
1382
+ opacity: 1,
1383
+ rotateY: 0,
1384
+ transition: { duration: 0.6, ease: [0.25, 0.46, 0.45, 0.94] }
1385
+ }
1386
+ },
1387
+ elastic: {
1388
+ hidden: { opacity: 0, scale: 0 },
1389
+ visible: {
1390
+ opacity: 1,
1391
+ scale: [0, 1.2, 1],
1392
+ transition: {
1393
+ duration: 0.8,
1394
+ ease: [0.68, -0.55, 0.265, 1.55],
1395
+ times: [0, 0.6, 1]
1396
+ }
1397
+ }
1398
+ }
1399
+ };
1400
+ function TextReveal({
1401
+ children,
1402
+ variant = "fade",
1403
+ className,
1404
+ style,
1405
+ delay = 0,
1406
+ duration = 0.6,
1407
+ staggerDelay = 0.03,
1408
+ once = true,
1409
+ startOnView = true,
1410
+ wordLevel = false
1411
+ }) {
1412
+ const ref = _react.useRef.call(void 0, null);
1413
+ const isInView = _react2.useInView.call(void 0, ref, { once, margin: "-10%" });
1414
+ const [hasAnimated, setHasAnimated] = _react.useState.call(void 0, false);
1415
+ const shouldAnimate = startOnView ? isInView : true;
1416
+ const elements = wordLevel ? children.split(" ").map((word, i, arr) => i < arr.length - 1 ? `${word} ` : word) : children.split("");
1417
+ const customContainerVariants = {
1418
+ ...containerVariants[variant],
1419
+ visible: {
1420
+ transition: {
1421
+ staggerChildren: staggerDelay,
1422
+ delayChildren: delay
1423
+ }
1424
+ }
1425
+ };
1426
+ const originalVariant = itemVariants[variant];
1427
+ const customItemVariants = duration === 0.6 ? originalVariant : {
1428
+ hidden: originalVariant.hidden,
1429
+ visible: {
1430
+ ...originalVariant.visible,
1431
+ transition: {
1432
+ ...originalVariant.visible.transition,
1433
+ duration
1434
+ }
1435
+ }
1436
+ };
1437
+ _react.useEffect.call(void 0, () => {
1438
+ if (shouldAnimate && !hasAnimated) {
1439
+ setHasAnimated(true);
1440
+ }
1441
+ }, [shouldAnimate, hasAnimated]);
1442
+ const MotionComponent = variant === "typewriter" ? _react2.motion.div : _react2.motion.span;
1443
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1444
+ _react2.motion.div,
1445
+ {
1446
+ ref,
1447
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "inline-block", className),
1448
+ variants: customContainerVariants,
1449
+ initial: "hidden",
1450
+ animate: shouldAnimate ? "visible" : "hidden",
1451
+ style: {
1452
+ willChange: "transform, opacity",
1453
+ WebkitBackfaceVisibility: "hidden",
1454
+ backfaceVisibility: "hidden",
1455
+ WebkitTransform: "translate3d(0,0,0)",
1456
+ transform: "translate3d(0,0,0)",
1457
+ isolation: "isolate",
1458
+ contain: "layout style paint",
1459
+ ...style
1460
+ },
1461
+ children: variant === "typewriter" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1462
+ _react2.motion.span,
1463
+ {
1464
+ className: "inline-block overflow-hidden whitespace-nowrap",
1465
+ variants: customItemVariants,
1466
+ style: {
1467
+ display: "inline-block",
1468
+ whiteSpace: "nowrap"
1469
+ },
1470
+ children
1471
+ }
1472
+ ) : elements.map((element, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1473
+ MotionComponent,
1474
+ {
1475
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "inline-block", {
1476
+ "whitespace-pre": !wordLevel
1477
+ }),
1478
+ variants: customItemVariants,
1479
+ style: {
1480
+ display: "inline-block",
1481
+ transformOrigin: variant === "rotate" ? "center center" : void 0,
1482
+ willChange: "transform, opacity",
1483
+ WebkitBackfaceVisibility: "hidden",
1484
+ backfaceVisibility: "hidden",
1485
+ WebkitTransform: "translate3d(0,0,0)",
1486
+ transform: "translate3d(0,0,0)",
1487
+ isolation: "isolate"
1488
+ },
1489
+ children: element === " " ? "\xA0" : element
1490
+ },
1491
+ index
1492
+ ))
1493
+ }
1494
+ );
1495
+ }
1496
+
1497
+ // src/ui/animation/typing-text.tsx
1498
+
1499
+
1500
+
1501
+
1502
+
1503
+
1504
+ var cursorVariants = {
1505
+ blinking: {
1506
+ opacity: [0, 0, 1, 1],
1507
+ transition: {
1508
+ duration: 1,
1509
+ repeat: Infinity,
1510
+ repeatDelay: 0,
1511
+ ease: "linear",
1512
+ times: [0, 0.5, 0.5, 1]
1513
+ }
1514
+ }
1515
+ };
1516
+ function TypingText({
1517
+ text,
1518
+ texts,
1519
+ speed = 100,
1520
+ delay = 0,
1521
+ showCursor = true,
1522
+ cursorClassName = "",
1523
+ cursor = "|",
1524
+ loop = false,
1525
+ pauseDuration = 2e3,
1526
+ className,
1527
+ onComplete,
1528
+ startOnView = true,
1529
+ once = false,
1530
+ inViewMargin,
1531
+ ...props
1532
+ }) {
1533
+ const ref = _react.useRef.call(void 0, null);
1534
+ const isInView = _react2.useInView.call(void 0, ref, {
1535
+ once,
1536
+ margin: inViewMargin
1537
+ });
1538
+ const [hasAnimated, setHasAnimated] = _react.useState.call(void 0, false);
1539
+ const [displayText, setDisplayText] = _react.useState.call(void 0, "");
1540
+ const [currentIndex, setCurrentIndex] = _react.useState.call(void 0, 0);
1541
+ const [isTyping, setIsTyping] = _react.useState.call(void 0, false);
1542
+ const [currentTextIndex, setCurrentTextIndex] = _react.useState.call(void 0, 0);
1543
+ const shouldStart = !startOnView || isInView && (!once || !hasAnimated);
1544
+ const textArray = texts && texts.length > 0 ? texts : [text];
1545
+ const currentText = _nullishCoalesce(textArray[currentTextIndex], () => ( ""));
1546
+ _react.useEffect.call(void 0, () => {
1547
+ if (!shouldStart) return;
1548
+ const timeout = setTimeout(() => {
1549
+ setIsTyping(true);
1550
+ setHasAnimated(true);
1551
+ }, delay);
1552
+ return () => clearTimeout(timeout);
1553
+ }, [delay, shouldStart]);
1554
+ _react.useEffect.call(void 0, () => {
1555
+ if (!isTyping) return;
1556
+ if (currentIndex < currentText.length) {
1557
+ const timeout = setTimeout(() => {
1558
+ setDisplayText(currentText.slice(0, currentIndex + 1));
1559
+ setCurrentIndex(currentIndex + 1);
1560
+ }, speed);
1561
+ return () => clearTimeout(timeout);
1562
+ } else {
1563
+ _optionalChain([onComplete, 'optionalCall', _8 => _8()]);
1564
+ if (loop && texts && texts.length > 1) {
1565
+ const timeout = setTimeout(() => {
1566
+ setDisplayText("");
1567
+ setCurrentIndex(0);
1568
+ setCurrentTextIndex((prev) => (prev + 1) % texts.length);
1569
+ }, pauseDuration);
1570
+ return () => clearTimeout(timeout);
1571
+ }
1572
+ }
1573
+ }, [currentIndex, currentText, isTyping, speed, loop, texts, pauseDuration, onComplete]);
1574
+ const finalVariants = {
1575
+ container: {
1576
+ hidden: { opacity: 0, y: 10 },
1577
+ show: { opacity: 1, y: 0, transition: { staggerChildren: 0.02 } },
1578
+ exit: { opacity: 0 }
1579
+ }
1580
+ };
1581
+ const MotionComponent = _react2.motion.span;
1582
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1583
+ MotionComponent,
1584
+ {
1585
+ ref,
1586
+ variants: finalVariants.container,
1587
+ initial: "hidden",
1588
+ whileInView: startOnView ? "show" : void 0,
1589
+ animate: startOnView ? void 0 : "show",
1590
+ exit: "exit",
1591
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "whitespace-pre-wrap", className),
1592
+ viewport: { once },
1593
+ ...props,
1594
+ children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { display: "inline-flex", alignItems: "center" }, children: [
1595
+ displayText,
1596
+ showCursor && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1597
+ _react2.motion.span,
1598
+ {
1599
+ variants: cursorVariants,
1600
+ animate: "blinking",
1601
+ className: _chunkCJXIPSTGcjs.cn.call(void 0,
1602
+ "ms-1 inline-block w-px select-none font-normal text-foreground",
1603
+ cursorClassName
1604
+ ),
1605
+ children: cursor
1606
+ }
1607
+ )
1608
+ ] })
1609
+ }
1610
+ );
1611
+ }
1612
+
1613
+ // src/ui/animation/video-text.tsx
1614
+
1615
+
1616
+
1617
+ function VideoText({
1618
+ src,
1619
+ children,
1620
+ className = "",
1621
+ autoPlay = true,
1622
+ muted = true,
1623
+ loop = true,
1624
+ preload = "auto",
1625
+ fontSize = "20vw",
1626
+ fontWeight = "bold",
1627
+ as: Component = "div",
1628
+ onPlay,
1629
+ onPause,
1630
+ onEnded
1631
+ }) {
1632
+ const videoRef = _react.useRef.call(void 0, null);
1633
+ const canvasRef = _react.useRef.call(void 0, null);
1634
+ const textRef = _react.useRef.call(void 0, null);
1635
+ const containerRef = _react.useRef.call(void 0, null);
1636
+ _react.useEffect.call(void 0, () => {
1637
+ const video = videoRef.current;
1638
+ const canvas = canvasRef.current;
1639
+ const textElement = textRef.current;
1640
+ const container = containerRef.current;
1641
+ if (!video || !canvas || !textElement || !container) return;
1642
+ const ctx = canvas.getContext("2d");
1643
+ if (!ctx) return;
1644
+ let animationId;
1645
+ const updateCanvas = () => {
1646
+ const text = textElement.textContent || "";
1647
+ ctx.font = `${fontWeight} ${typeof fontSize === "number" ? `${fontSize}px` : fontSize} system-ui, -apple-system, sans-serif`;
1648
+ const textMetrics = ctx.measureText(text);
1649
+ const textWidth = textMetrics.width;
1650
+ const textHeight = typeof fontSize === "number" ? fontSize : parseFloat(fontSize.replace(/[^\d.]/g, "")) || 100;
1651
+ const padding = 40;
1652
+ canvas.width = Math.max(textWidth + padding * 2, 400);
1653
+ canvas.height = Math.max(textHeight + padding * 2, 200);
1654
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
1655
+ ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
1656
+ ctx.globalCompositeOperation = "destination-in";
1657
+ ctx.fillStyle = "white";
1658
+ ctx.font = `${fontWeight} ${typeof fontSize === "number" ? `${fontSize}px` : fontSize} system-ui, -apple-system, sans-serif`;
1659
+ ctx.textAlign = "center";
1660
+ ctx.textBaseline = "middle";
1661
+ ctx.fillText(text, canvas.width / 2, canvas.height / 2);
1662
+ ctx.globalCompositeOperation = "source-over";
1663
+ animationId = requestAnimationFrame(updateCanvas);
1664
+ };
1665
+ const handleVideoLoad = () => {
1666
+ updateCanvas();
1667
+ };
1668
+ const handleResize = () => {
1669
+ updateCanvas();
1670
+ };
1671
+ video.addEventListener("loadeddata", handleVideoLoad);
1672
+ video.addEventListener("play", updateCanvas);
1673
+ window.addEventListener("resize", handleResize);
1674
+ return () => {
1675
+ video.removeEventListener("loadeddata", handleVideoLoad);
1676
+ video.removeEventListener("play", updateCanvas);
1677
+ window.removeEventListener("resize", handleResize);
1678
+ if (animationId) {
1679
+ cancelAnimationFrame(animationId);
1680
+ }
1681
+ };
1682
+ }, [fontSize, fontWeight]);
1683
+ const sources = Array.isArray(src) ? src : [src];
1684
+ const content = React7.Children.toArray(children).join("");
1685
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1686
+ Component,
1687
+ {
1688
+ ref: containerRef,
1689
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "relative inline-block overflow-hidden", className),
1690
+ children: [
1691
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1692
+ "video",
1693
+ {
1694
+ ref: videoRef,
1695
+ className: "pointer-events-none absolute opacity-0",
1696
+ autoPlay,
1697
+ muted,
1698
+ loop,
1699
+ preload,
1700
+ playsInline: true,
1701
+ onPlay,
1702
+ onPause,
1703
+ onEnded,
1704
+ crossOrigin: "anonymous",
1705
+ children: [
1706
+ sources.map((source, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "source", { src: source }, index)),
1707
+ "Your browser does not support the video tag."
1708
+ ]
1709
+ }
1710
+ ),
1711
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1712
+ "canvas",
1713
+ {
1714
+ ref: canvasRef,
1715
+ className: "block",
1716
+ style: {
1717
+ width: "100%",
1718
+ height: "auto"
1719
+ }
1720
+ }
1721
+ ),
1722
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1723
+ "div",
1724
+ {
1725
+ ref: textRef,
1726
+ className: "pointer-events-none absolute font-bold opacity-0",
1727
+ style: {
1728
+ fontSize: typeof fontSize === "number" ? `${fontSize}px` : fontSize,
1729
+ fontWeight
1730
+ },
1731
+ "aria-label": content,
1732
+ children
1733
+ }
1734
+ ),
1735
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", children: content })
1736
+ ]
1737
+ }
1738
+ );
1739
+ }
1740
+
1741
+ // src/ui/animation/word-rotate.tsx
1742
+
1743
+
1744
+
1745
+
1746
+
1747
+
1748
+ function WordRotate({
1749
+ words,
1750
+ duration = 1500,
1751
+ animationStyle = "fade",
1752
+ loop = true,
1753
+ className,
1754
+ containerClassName,
1755
+ pauseDuration = 300,
1756
+ startOnView = true,
1757
+ once = false,
1758
+ inViewMargin,
1759
+ ...props
1760
+ }) {
1761
+ const ref = _react.useRef.call(void 0, null);
1762
+ const isInView = _react2.useInView.call(void 0, ref, {
1763
+ once,
1764
+ margin: inViewMargin
1765
+ });
1766
+ const [hasAnimated, setHasAnimated] = _react.useState.call(void 0, false);
1767
+ const [currentWord, setCurrentWord] = _react.useState.call(void 0, 0);
1768
+ const [show, setShow] = _react.useState.call(void 0, true);
1769
+ const variants = {
1770
+ fade: {
1771
+ initial: { opacity: 0 },
1772
+ animate: {
1773
+ opacity: 1,
1774
+ transition: {
1775
+ duration: 0.4,
1776
+ ease: [0.4, 0, 0.2, 1]
1777
+ // Custom cubic-bezier for smooth fade
1778
+ }
1779
+ },
1780
+ exit: {
1781
+ opacity: 0,
1782
+ transition: {
1783
+ duration: 0.3,
1784
+ ease: [0.4, 0, 1, 1]
1785
+ // Faster exit
1786
+ }
1787
+ }
1788
+ },
1789
+ "slide-up": {
1790
+ initial: { opacity: 0, y: 24 },
1791
+ animate: {
1792
+ opacity: 1,
1793
+ y: 0,
1794
+ transition: {
1795
+ type: "spring",
1796
+ stiffness: 300,
1797
+ damping: 25,
1798
+ mass: 0.8
1799
+ }
1800
+ },
1801
+ exit: {
1802
+ opacity: 0,
1803
+ y: -24,
1804
+ transition: {
1805
+ duration: 0.25,
1806
+ ease: [0.4, 0, 1, 1]
1807
+ }
1808
+ }
1809
+ },
1810
+ "slide-down": {
1811
+ initial: { opacity: 0, y: -24 },
1812
+ animate: {
1813
+ opacity: 1,
1814
+ y: 0,
1815
+ transition: {
1816
+ type: "spring",
1817
+ stiffness: 300,
1818
+ damping: 25,
1819
+ mass: 0.8
1820
+ }
1821
+ },
1822
+ exit: {
1823
+ opacity: 0,
1824
+ y: 24,
1825
+ transition: {
1826
+ duration: 0.25,
1827
+ ease: [0.4, 0, 1, 1]
1828
+ }
1829
+ }
1830
+ },
1831
+ scale: {
1832
+ initial: { opacity: 0, scale: 0.8 },
1833
+ animate: {
1834
+ opacity: 1,
1835
+ scale: 1,
1836
+ transition: {
1837
+ type: "spring",
1838
+ stiffness: 400,
1839
+ damping: 30,
1840
+ mass: 0.6
1841
+ }
1842
+ },
1843
+ exit: {
1844
+ opacity: 0,
1845
+ scale: 0.9,
1846
+ transition: {
1847
+ duration: 0.2,
1848
+ ease: [0.4, 0, 1, 1]
1849
+ }
1850
+ }
1851
+ },
1852
+ flip: {
1853
+ initial: { opacity: 0, rotateX: 90 },
1854
+ animate: {
1855
+ opacity: 1,
1856
+ rotateX: 0,
1857
+ transition: {
1858
+ type: "spring",
1859
+ stiffness: 200,
1860
+ damping: 20,
1861
+ mass: 1
1862
+ }
1863
+ },
1864
+ exit: {
1865
+ opacity: 0,
1866
+ rotateX: -90,
1867
+ transition: {
1868
+ duration: 0.3,
1869
+ ease: [0.4, 0, 1, 1]
1870
+ }
1871
+ }
1872
+ }
1873
+ };
1874
+ const shouldStart = !startOnView || isInView && (!once || !hasAnimated);
1875
+ _react.useEffect.call(void 0, () => {
1876
+ if (!shouldStart) return;
1877
+ setHasAnimated(true);
1878
+ const interval = setInterval(() => {
1879
+ setShow(false);
1880
+ setTimeout(() => {
1881
+ setCurrentWord((prev) => {
1882
+ if (loop) {
1883
+ return (prev + 1) % words.length;
1884
+ } else {
1885
+ return prev < words.length - 1 ? prev + 1 : prev;
1886
+ }
1887
+ });
1888
+ setShow(true);
1889
+ }, pauseDuration);
1890
+ }, duration + pauseDuration);
1891
+ return () => clearInterval(interval);
1892
+ }, [shouldStart, duration, pauseDuration, words.length, loop]);
1893
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1894
+ _react2.motion.span,
1895
+ {
1896
+ ref,
1897
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "inline-block overflow-hidden", containerClassName),
1898
+ ...props,
1899
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1900
+ _react2.motion.span,
1901
+ {
1902
+ initial: "initial",
1903
+ animate: show ? "animate" : "exit",
1904
+ exit: "exit",
1905
+ variants: variants[animationStyle],
1906
+ transition: { duration: 0.5 },
1907
+ style: {
1908
+ perspective: animationStyle === "flip" ? 1e3 : void 0
1909
+ },
1910
+ className: _chunkCJXIPSTGcjs.cn.call(void 0, "inline-block overflow-hidden", className),
1911
+ children: words[currentWord]
1912
+ },
1913
+ currentWord
1914
+ )
1915
+ }
1916
+ );
1917
+ }
1918
+
1919
+
1920
+
1921
+
1922
+
1923
+
1924
+
1925
+
1926
+
1927
+
1928
+
1929
+
1930
+
1931
+
1932
+
1933
+
1934
+
1935
+
1936
+ exports.AvatarGroup = AvatarGroup; exports.AvatarGroupItem = AvatarGroupItem; exports.AvatarGroupTooltip = AvatarGroupTooltip; exports.CountingNumber = CountingNumber; exports.GithubButton = GithubButton; exports.GradientBackground = GradientBackground; exports.GridBackground = GridBackground; exports.HoverBackground = HoverBackground; exports.Marquee = Marquee; exports.ShimmeringText = ShimmeringText; exports.SlidingNumber = SlidingNumber; exports.SvgText = SvgText; exports.TextReveal = TextReveal; exports.TypingText = TypingText; exports.VideoText = VideoText; exports.WordRotate = WordRotate; exports.githubButtonVariants = githubButtonVariants;