@wow-two-beta/ui 0.0.22 → 0.0.23
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.
- package/dist/{chunk-6UJX6YAP.js → chunk-XLPFX4WK.js} +513 -3
- package/dist/chunk-XLPFX4WK.js.map +1 -0
- package/dist/display/animatedNumber/AnimatedNumber.d.ts +14 -0
- package/dist/display/animatedNumber/AnimatedNumber.d.ts.map +1 -0
- package/dist/display/animatedNumber/index.d.ts +2 -0
- package/dist/display/animatedNumber/index.d.ts.map +1 -0
- package/dist/display/confetti/Confetti.d.ts +31 -0
- package/dist/display/confetti/Confetti.d.ts.map +1 -0
- package/dist/display/confetti/index.d.ts +2 -0
- package/dist/display/confetti/index.d.ts.map +1 -0
- package/dist/display/countUp/CountUp.d.ts +17 -0
- package/dist/display/countUp/CountUp.d.ts.map +1 -0
- package/dist/display/countUp/index.d.ts +2 -0
- package/dist/display/countUp/index.d.ts.map +1 -0
- package/dist/display/gradientText/GradientText.d.ts +18 -0
- package/dist/display/gradientText/GradientText.d.ts.map +1 -0
- package/dist/display/gradientText/index.d.ts +2 -0
- package/dist/display/gradientText/index.d.ts.map +1 -0
- package/dist/display/index.d.ts +8 -0
- package/dist/display/index.d.ts.map +1 -1
- package/dist/display/index.js +1 -1
- package/dist/display/marquee/Marquee.d.ts +16 -0
- package/dist/display/marquee/Marquee.d.ts.map +1 -0
- package/dist/display/marquee/index.d.ts +2 -0
- package/dist/display/marquee/index.d.ts.map +1 -0
- package/dist/display/scrollReveal/ScrollReveal.d.ts +18 -0
- package/dist/display/scrollReveal/ScrollReveal.d.ts.map +1 -0
- package/dist/display/scrollReveal/index.d.ts +2 -0
- package/dist/display/scrollReveal/index.d.ts.map +1 -0
- package/dist/display/tilt/Tilt.d.ts +15 -0
- package/dist/display/tilt/Tilt.d.ts.map +1 -0
- package/dist/display/tilt/index.d.ts +2 -0
- package/dist/display/tilt/index.d.ts.map +1 -0
- package/dist/display/typewriter/Typewriter.d.ts +18 -0
- package/dist/display/typewriter/Typewriter.d.ts.map +1 -0
- package/dist/display/typewriter/index.d.ts +2 -0
- package/dist/display/typewriter/index.d.ts.map +1 -0
- package/dist/index.css +24 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6UJX6YAP.js.map +0 -1
|
@@ -4398,7 +4398,517 @@ function AgendaView({ date, events, onEventClick }) {
|
|
|
4398
4398
|
] }, key);
|
|
4399
4399
|
}) });
|
|
4400
4400
|
}
|
|
4401
|
+
var DIR_TO_DEG = {
|
|
4402
|
+
r: 90,
|
|
4403
|
+
l: 270,
|
|
4404
|
+
t: 0,
|
|
4405
|
+
b: 180,
|
|
4406
|
+
tr: 45,
|
|
4407
|
+
br: 135,
|
|
4408
|
+
bl: 225,
|
|
4409
|
+
tl: 315
|
|
4410
|
+
};
|
|
4411
|
+
var GradientText = forwardRef(
|
|
4412
|
+
function GradientText2({
|
|
4413
|
+
from = "var(--color-primary)",
|
|
4414
|
+
via,
|
|
4415
|
+
to = "var(--color-accent, var(--color-primary))",
|
|
4416
|
+
direction = "r",
|
|
4417
|
+
animated,
|
|
4418
|
+
as = "span",
|
|
4419
|
+
className,
|
|
4420
|
+
style,
|
|
4421
|
+
children,
|
|
4422
|
+
...rest
|
|
4423
|
+
}, ref) {
|
|
4424
|
+
const stops = via ? `${from}, ${via}, ${to}` : `${from}, ${to}`;
|
|
4425
|
+
const Tag = as;
|
|
4426
|
+
return /* @__PURE__ */ jsx(
|
|
4427
|
+
Tag,
|
|
4428
|
+
{
|
|
4429
|
+
ref,
|
|
4430
|
+
className: cn(
|
|
4431
|
+
"inline-block bg-clip-text text-transparent",
|
|
4432
|
+
animated && "motion-safe:animate-[gradient-shift_4s_ease-in-out_infinite]",
|
|
4433
|
+
className
|
|
4434
|
+
),
|
|
4435
|
+
style: {
|
|
4436
|
+
backgroundImage: `linear-gradient(${DIR_TO_DEG[direction]}deg, ${stops})`,
|
|
4437
|
+
backgroundSize: animated ? "200% 100%" : void 0,
|
|
4438
|
+
...style
|
|
4439
|
+
},
|
|
4440
|
+
...rest,
|
|
4441
|
+
children
|
|
4442
|
+
}
|
|
4443
|
+
);
|
|
4444
|
+
}
|
|
4445
|
+
);
|
|
4446
|
+
var easeOutCubic = (t) => 1 - Math.pow(1 - t, 3);
|
|
4447
|
+
var defaultFormat = (v) => v.toFixed(0);
|
|
4448
|
+
function prefersReducedMotion() {
|
|
4449
|
+
if (typeof window === "undefined") return false;
|
|
4450
|
+
return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
|
|
4451
|
+
}
|
|
4452
|
+
var CountUp = forwardRef(function CountUp2({
|
|
4453
|
+
to,
|
|
4454
|
+
from = 0,
|
|
4455
|
+
duration = 1500,
|
|
4456
|
+
easing = easeOutCubic,
|
|
4457
|
+
format = defaultFormat,
|
|
4458
|
+
triggerOnView = false,
|
|
4459
|
+
as = "span",
|
|
4460
|
+
className,
|
|
4461
|
+
...rest
|
|
4462
|
+
}, ref) {
|
|
4463
|
+
const [value, setValue] = useState(triggerOnView ? from : to);
|
|
4464
|
+
const elRef = useRef(null);
|
|
4465
|
+
const startedRef = useRef(false);
|
|
4466
|
+
useEffect(() => {
|
|
4467
|
+
if (prefersReducedMotion()) {
|
|
4468
|
+
setValue(to);
|
|
4469
|
+
return;
|
|
4470
|
+
}
|
|
4471
|
+
if (triggerOnView && typeof IntersectionObserver !== "undefined" && elRef.current) {
|
|
4472
|
+
const obs = new IntersectionObserver(
|
|
4473
|
+
(entries) => {
|
|
4474
|
+
for (const entry of entries) {
|
|
4475
|
+
if (entry.isIntersecting && !startedRef.current) {
|
|
4476
|
+
startedRef.current = true;
|
|
4477
|
+
animate();
|
|
4478
|
+
}
|
|
4479
|
+
}
|
|
4480
|
+
},
|
|
4481
|
+
{ threshold: 0.2 }
|
|
4482
|
+
);
|
|
4483
|
+
obs.observe(elRef.current);
|
|
4484
|
+
return () => obs.disconnect();
|
|
4485
|
+
}
|
|
4486
|
+
animate();
|
|
4487
|
+
function animate() {
|
|
4488
|
+
const start = performance.now();
|
|
4489
|
+
let raf = 0;
|
|
4490
|
+
const tick = (now) => {
|
|
4491
|
+
const t = Math.min(1, (now - start) / duration);
|
|
4492
|
+
const eased = easing(t);
|
|
4493
|
+
setValue(from + (to - from) * eased);
|
|
4494
|
+
if (t < 1) raf = requestAnimationFrame(tick);
|
|
4495
|
+
};
|
|
4496
|
+
raf = requestAnimationFrame(tick);
|
|
4497
|
+
return () => cancelAnimationFrame(raf);
|
|
4498
|
+
}
|
|
4499
|
+
}, [to, from, duration, easing, triggerOnView]);
|
|
4500
|
+
const Tag = as;
|
|
4501
|
+
return /* @__PURE__ */ jsx(
|
|
4502
|
+
Tag,
|
|
4503
|
+
{
|
|
4504
|
+
ref: (el) => {
|
|
4505
|
+
elRef.current = el;
|
|
4506
|
+
if (typeof ref === "function") ref(el);
|
|
4507
|
+
else if (ref) ref.current = el;
|
|
4508
|
+
},
|
|
4509
|
+
className: cn("tabular-nums", className),
|
|
4510
|
+
...rest,
|
|
4511
|
+
children: format(value)
|
|
4512
|
+
}
|
|
4513
|
+
);
|
|
4514
|
+
});
|
|
4515
|
+
var easeOutCubic2 = (t) => 1 - Math.pow(1 - t, 3);
|
|
4516
|
+
var defaultFormat2 = (v) => v.toFixed(0);
|
|
4517
|
+
function prefersReducedMotion2() {
|
|
4518
|
+
if (typeof window === "undefined") return false;
|
|
4519
|
+
return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
|
|
4520
|
+
}
|
|
4521
|
+
var AnimatedNumber = forwardRef(
|
|
4522
|
+
function AnimatedNumber2({
|
|
4523
|
+
value,
|
|
4524
|
+
duration = 500,
|
|
4525
|
+
easing = easeOutCubic2,
|
|
4526
|
+
format = defaultFormat2,
|
|
4527
|
+
as = "span",
|
|
4528
|
+
className,
|
|
4529
|
+
...rest
|
|
4530
|
+
}, ref) {
|
|
4531
|
+
const [display, setDisplay] = useState(value);
|
|
4532
|
+
const fromRef = useRef(value);
|
|
4533
|
+
useEffect(() => {
|
|
4534
|
+
if (prefersReducedMotion2()) {
|
|
4535
|
+
setDisplay(value);
|
|
4536
|
+
fromRef.current = value;
|
|
4537
|
+
return;
|
|
4538
|
+
}
|
|
4539
|
+
const from = fromRef.current;
|
|
4540
|
+
const to = value;
|
|
4541
|
+
if (from === to) return;
|
|
4542
|
+
const start = performance.now();
|
|
4543
|
+
let raf = 0;
|
|
4544
|
+
const tick = (now) => {
|
|
4545
|
+
const t = Math.min(1, (now - start) / duration);
|
|
4546
|
+
const eased = easing(t);
|
|
4547
|
+
const next = from + (to - from) * eased;
|
|
4548
|
+
setDisplay(next);
|
|
4549
|
+
if (t < 1) raf = requestAnimationFrame(tick);
|
|
4550
|
+
else fromRef.current = to;
|
|
4551
|
+
};
|
|
4552
|
+
raf = requestAnimationFrame(tick);
|
|
4553
|
+
return () => cancelAnimationFrame(raf);
|
|
4554
|
+
}, [value, duration, easing]);
|
|
4555
|
+
const Tag = as;
|
|
4556
|
+
return /* @__PURE__ */ jsx(
|
|
4557
|
+
Tag,
|
|
4558
|
+
{
|
|
4559
|
+
ref,
|
|
4560
|
+
className: cn("tabular-nums", className),
|
|
4561
|
+
...rest,
|
|
4562
|
+
children: format(display)
|
|
4563
|
+
}
|
|
4564
|
+
);
|
|
4565
|
+
}
|
|
4566
|
+
);
|
|
4567
|
+
var HIDDEN_TRANSFORMS = {
|
|
4568
|
+
fade: "",
|
|
4569
|
+
"slide-up": "translateY(20px)",
|
|
4570
|
+
"slide-down": "translateY(-20px)",
|
|
4571
|
+
"slide-left": "translateX(20px)",
|
|
4572
|
+
"slide-right": "translateX(-20px)",
|
|
4573
|
+
zoom: "scale(0.95)"
|
|
4574
|
+
};
|
|
4575
|
+
var ScrollReveal = forwardRef(
|
|
4576
|
+
function ScrollReveal2({
|
|
4577
|
+
effect = "fade",
|
|
4578
|
+
duration = 600,
|
|
4579
|
+
delay = 0,
|
|
4580
|
+
threshold = 0.1,
|
|
4581
|
+
once = true,
|
|
4582
|
+
as = "div",
|
|
4583
|
+
className,
|
|
4584
|
+
style,
|
|
4585
|
+
children,
|
|
4586
|
+
...rest
|
|
4587
|
+
}, ref) {
|
|
4588
|
+
const [revealed, setRevealed] = useState(false);
|
|
4589
|
+
const elRef = useRef(null);
|
|
4590
|
+
const reduced = typeof window !== "undefined" && (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false);
|
|
4591
|
+
useEffect(() => {
|
|
4592
|
+
if (reduced) {
|
|
4593
|
+
setRevealed(true);
|
|
4594
|
+
return;
|
|
4595
|
+
}
|
|
4596
|
+
const el = elRef.current;
|
|
4597
|
+
if (!el || typeof IntersectionObserver === "undefined") {
|
|
4598
|
+
setRevealed(true);
|
|
4599
|
+
return;
|
|
4600
|
+
}
|
|
4601
|
+
const obs = new IntersectionObserver(
|
|
4602
|
+
(entries) => {
|
|
4603
|
+
for (const entry of entries) {
|
|
4604
|
+
if (entry.isIntersecting) {
|
|
4605
|
+
setRevealed(true);
|
|
4606
|
+
if (once) obs.disconnect();
|
|
4607
|
+
} else if (!once) {
|
|
4608
|
+
setRevealed(false);
|
|
4609
|
+
}
|
|
4610
|
+
}
|
|
4611
|
+
},
|
|
4612
|
+
{ threshold }
|
|
4613
|
+
);
|
|
4614
|
+
obs.observe(el);
|
|
4615
|
+
return () => obs.disconnect();
|
|
4616
|
+
}, [reduced, threshold, once]);
|
|
4617
|
+
const Tag = as;
|
|
4618
|
+
return /* @__PURE__ */ jsx(
|
|
4619
|
+
Tag,
|
|
4620
|
+
{
|
|
4621
|
+
ref: (el) => {
|
|
4622
|
+
elRef.current = el;
|
|
4623
|
+
if (typeof ref === "function") ref(el);
|
|
4624
|
+
else if (ref) ref.current = el;
|
|
4625
|
+
},
|
|
4626
|
+
"data-revealed": revealed || void 0,
|
|
4627
|
+
className: cn(className),
|
|
4628
|
+
style: {
|
|
4629
|
+
opacity: revealed || reduced ? 1 : 0,
|
|
4630
|
+
transform: revealed || reduced ? "none" : HIDDEN_TRANSFORMS[effect],
|
|
4631
|
+
transition: reduced ? void 0 : `opacity ${duration}ms ease-out ${delay}ms, transform ${duration}ms ease-out ${delay}ms`,
|
|
4632
|
+
...style
|
|
4633
|
+
},
|
|
4634
|
+
...rest,
|
|
4635
|
+
children
|
|
4636
|
+
}
|
|
4637
|
+
);
|
|
4638
|
+
}
|
|
4639
|
+
);
|
|
4640
|
+
var Tilt = forwardRef(function Tilt2({
|
|
4641
|
+
maxAngle = 12,
|
|
4642
|
+
perspective = 800,
|
|
4643
|
+
glare,
|
|
4644
|
+
scale = 1,
|
|
4645
|
+
as = "div",
|
|
4646
|
+
className,
|
|
4647
|
+
style,
|
|
4648
|
+
children,
|
|
4649
|
+
onPointerMove,
|
|
4650
|
+
onPointerLeave,
|
|
4651
|
+
...rest
|
|
4652
|
+
}, ref) {
|
|
4653
|
+
const elRef = useRef(null);
|
|
4654
|
+
const [tilt, setTilt] = useState({
|
|
4655
|
+
rotateX: 0,
|
|
4656
|
+
rotateY: 0,
|
|
4657
|
+
glareX: 50,
|
|
4658
|
+
glareY: 50,
|
|
4659
|
+
active: false
|
|
4660
|
+
});
|
|
4661
|
+
const reduced = typeof window !== "undefined" && (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false);
|
|
4662
|
+
const handleMove = (e) => {
|
|
4663
|
+
onPointerMove?.(e);
|
|
4664
|
+
if (reduced) return;
|
|
4665
|
+
const el = elRef.current;
|
|
4666
|
+
if (!el) return;
|
|
4667
|
+
const rect = el.getBoundingClientRect();
|
|
4668
|
+
const x = (e.clientX - rect.left) / rect.width;
|
|
4669
|
+
const y = (e.clientY - rect.top) / rect.height;
|
|
4670
|
+
const rotateY = (x - 0.5) * 2 * maxAngle;
|
|
4671
|
+
const rotateX = (0.5 - y) * 2 * maxAngle;
|
|
4672
|
+
setTilt({ rotateX, rotateY, glareX: x * 100, glareY: y * 100, active: true });
|
|
4673
|
+
};
|
|
4674
|
+
const handleLeave = (e) => {
|
|
4675
|
+
onPointerLeave?.(e);
|
|
4676
|
+
setTilt({ rotateX: 0, rotateY: 0, glareX: 50, glareY: 50, active: false });
|
|
4677
|
+
};
|
|
4678
|
+
const Tag = as;
|
|
4679
|
+
return /* @__PURE__ */ jsxs(
|
|
4680
|
+
Tag,
|
|
4681
|
+
{
|
|
4682
|
+
ref: (el) => {
|
|
4683
|
+
elRef.current = el;
|
|
4684
|
+
if (typeof ref === "function") ref(el);
|
|
4685
|
+
else if (ref) ref.current = el;
|
|
4686
|
+
},
|
|
4687
|
+
onPointerMove: handleMove,
|
|
4688
|
+
onPointerLeave: handleLeave,
|
|
4689
|
+
className: cn("relative", className),
|
|
4690
|
+
style: {
|
|
4691
|
+
perspective,
|
|
4692
|
+
transform: tilt.active && !reduced ? `rotateX(${tilt.rotateX}deg) rotateY(${tilt.rotateY}deg) scale(${scale})` : "rotateX(0) rotateY(0) scale(1)",
|
|
4693
|
+
transition: tilt.active ? "transform 80ms ease-out" : "transform 220ms ease-out",
|
|
4694
|
+
transformStyle: "preserve-3d",
|
|
4695
|
+
...style
|
|
4696
|
+
},
|
|
4697
|
+
...rest,
|
|
4698
|
+
children: [
|
|
4699
|
+
children,
|
|
4700
|
+
glare && !reduced && tilt.active && /* @__PURE__ */ jsx(
|
|
4701
|
+
"span",
|
|
4702
|
+
{
|
|
4703
|
+
"aria-hidden": "true",
|
|
4704
|
+
className: "pointer-events-none absolute inset-0 rounded-[inherit] mix-blend-overlay",
|
|
4705
|
+
style: {
|
|
4706
|
+
background: `radial-gradient(circle at ${tilt.glareX}% ${tilt.glareY}%, rgba(255,255,255,0.35) 0%, transparent 50%)`
|
|
4707
|
+
}
|
|
4708
|
+
}
|
|
4709
|
+
)
|
|
4710
|
+
]
|
|
4711
|
+
}
|
|
4712
|
+
);
|
|
4713
|
+
});
|
|
4714
|
+
var Marquee = forwardRef(function Marquee2({ direction = "left", speed = 30, pauseOnHover = true, gap = 48, className, children, ...rest }, ref) {
|
|
4715
|
+
const horizontal = direction === "left" || direction === "right";
|
|
4716
|
+
const reverse = direction === "right" || direction === "down";
|
|
4717
|
+
const animationName = horizontal ? "marquee-x" : "marquee-y";
|
|
4718
|
+
return /* @__PURE__ */ jsx(
|
|
4719
|
+
"div",
|
|
4720
|
+
{
|
|
4721
|
+
ref,
|
|
4722
|
+
role: "marquee",
|
|
4723
|
+
"data-direction": direction,
|
|
4724
|
+
className: cn(
|
|
4725
|
+
"group/marquee relative overflow-hidden",
|
|
4726
|
+
horizontal ? "flex" : "flex flex-col",
|
|
4727
|
+
className
|
|
4728
|
+
),
|
|
4729
|
+
style: { "--marquee-gap": `${gap}px` },
|
|
4730
|
+
...rest,
|
|
4731
|
+
children: [0, 1].map((i) => /* @__PURE__ */ jsx(
|
|
4732
|
+
"div",
|
|
4733
|
+
{
|
|
4734
|
+
"aria-hidden": i === 1,
|
|
4735
|
+
className: cn(
|
|
4736
|
+
"shrink-0 motion-safe:animate-(--marquee-anim) motion-reduce:animation-none",
|
|
4737
|
+
horizontal ? "flex shrink-0 items-center" : "flex flex-col items-center",
|
|
4738
|
+
pauseOnHover && "group-hover/marquee:[animation-play-state:paused]"
|
|
4739
|
+
),
|
|
4740
|
+
style: {
|
|
4741
|
+
gap,
|
|
4742
|
+
paddingInline: horizontal ? gap / 2 : 0,
|
|
4743
|
+
paddingBlock: horizontal ? 0 : gap / 2,
|
|
4744
|
+
animation: `${animationName} ${speed}s linear infinite ${reverse ? "reverse" : "normal"}`
|
|
4745
|
+
},
|
|
4746
|
+
children
|
|
4747
|
+
},
|
|
4748
|
+
i
|
|
4749
|
+
))
|
|
4750
|
+
}
|
|
4751
|
+
);
|
|
4752
|
+
});
|
|
4753
|
+
var Typewriter = forwardRef(function Typewriter2({
|
|
4754
|
+
text,
|
|
4755
|
+
typeSpeed = 60,
|
|
4756
|
+
deleteSpeed = 40,
|
|
4757
|
+
pauseBetween = 1500,
|
|
4758
|
+
loop,
|
|
4759
|
+
cursor = true,
|
|
4760
|
+
cursorChar = "\u2502",
|
|
4761
|
+
as = "span",
|
|
4762
|
+
className,
|
|
4763
|
+
...rest
|
|
4764
|
+
}, ref) {
|
|
4765
|
+
const phrases = useMemo(() => Array.isArray(text) ? text : [text], [text]);
|
|
4766
|
+
const shouldLoop = loop ?? phrases.length > 1;
|
|
4767
|
+
const reduced = typeof window !== "undefined" && (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false);
|
|
4768
|
+
const [phraseIndex, setPhraseIndex] = useState(0);
|
|
4769
|
+
const [charIndex, setCharIndex] = useState(0);
|
|
4770
|
+
const [deleting, setDeleting] = useState(false);
|
|
4771
|
+
useEffect(() => {
|
|
4772
|
+
if (reduced) return;
|
|
4773
|
+
const current = phrases[phraseIndex] ?? "";
|
|
4774
|
+
let timeout;
|
|
4775
|
+
if (!deleting) {
|
|
4776
|
+
if (charIndex < current.length) {
|
|
4777
|
+
timeout = window.setTimeout(() => setCharIndex(charIndex + 1), typeSpeed);
|
|
4778
|
+
} else {
|
|
4779
|
+
if (phrases.length === 1 && !shouldLoop) return;
|
|
4780
|
+
timeout = window.setTimeout(() => setDeleting(true), pauseBetween);
|
|
4781
|
+
}
|
|
4782
|
+
} else {
|
|
4783
|
+
if (charIndex > 0) {
|
|
4784
|
+
timeout = window.setTimeout(() => setCharIndex(charIndex - 1), deleteSpeed);
|
|
4785
|
+
} else {
|
|
4786
|
+
const nextIdx = (phraseIndex + 1) % phrases.length;
|
|
4787
|
+
if (!shouldLoop && nextIdx === 0) return;
|
|
4788
|
+
setDeleting(false);
|
|
4789
|
+
setPhraseIndex(nextIdx);
|
|
4790
|
+
}
|
|
4791
|
+
}
|
|
4792
|
+
return () => window.clearTimeout(timeout);
|
|
4793
|
+
}, [charIndex, deleting, phraseIndex, phrases, typeSpeed, deleteSpeed, pauseBetween, shouldLoop, reduced]);
|
|
4794
|
+
const fullText = reduced ? Array.isArray(text) ? text[0] ?? "" : text : (phrases[phraseIndex] ?? "").slice(0, charIndex);
|
|
4795
|
+
const Tag = as;
|
|
4796
|
+
return /* @__PURE__ */ jsxs(Tag, { ref, className: cn("inline-block", className), ...rest, children: [
|
|
4797
|
+
fullText,
|
|
4798
|
+
cursor && !reduced && /* @__PURE__ */ jsx(
|
|
4799
|
+
"span",
|
|
4800
|
+
{
|
|
4801
|
+
"aria-hidden": "true",
|
|
4802
|
+
className: "ml-0.5 inline-block motion-safe:animate-[blink-caret_1s_step-end_infinite]",
|
|
4803
|
+
children: cursorChar
|
|
4804
|
+
}
|
|
4805
|
+
)
|
|
4806
|
+
] });
|
|
4807
|
+
});
|
|
4808
|
+
var DEFAULT_COLORS = ["#ef4444", "#f59e0b", "#10b981", "#3b82f6", "#a855f7", "#ec4899"];
|
|
4809
|
+
var nextParticleId = 0;
|
|
4810
|
+
var Confetti = forwardRef(function Confetti2({
|
|
4811
|
+
particleCount = 60,
|
|
4812
|
+
colors = DEFAULT_COLORS,
|
|
4813
|
+
gravity = 1200,
|
|
4814
|
+
spread = 60,
|
|
4815
|
+
velocity = 500,
|
|
4816
|
+
lifetime = 3e3,
|
|
4817
|
+
origin,
|
|
4818
|
+
autoFire
|
|
4819
|
+
}, forwardedRef) {
|
|
4820
|
+
const [particles, setParticles] = useState([]);
|
|
4821
|
+
const rafRef = useRef(null);
|
|
4822
|
+
const lastTimeRef = useRef(0);
|
|
4823
|
+
const reducedRef = useRef(
|
|
4824
|
+
typeof window !== "undefined" && (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false)
|
|
4825
|
+
);
|
|
4826
|
+
const spawn = useCallback(
|
|
4827
|
+
(opts) => {
|
|
4828
|
+
if (reducedRef.current) return;
|
|
4829
|
+
const count = opts?.particleCount ?? particleCount;
|
|
4830
|
+
const palette = opts?.colors ?? colors;
|
|
4831
|
+
const sp = opts?.spread ?? spread;
|
|
4832
|
+
const vel = opts?.velocity ?? velocity;
|
|
4833
|
+
const o = opts?.origin ?? origin;
|
|
4834
|
+
const x = o?.x ?? (typeof window !== "undefined" ? window.innerWidth / 2 : 200);
|
|
4835
|
+
const y = o?.y ?? (typeof window !== "undefined" ? window.innerHeight / 2 : 200);
|
|
4836
|
+
const burst = [];
|
|
4837
|
+
const now = performance.now();
|
|
4838
|
+
for (let i = 0; i < count; i++) {
|
|
4839
|
+
const angle = -Math.PI / 2 + (Math.random() - 0.5) * (sp * Math.PI) / 180;
|
|
4840
|
+
const speed = vel * (0.7 + Math.random() * 0.6);
|
|
4841
|
+
burst.push({
|
|
4842
|
+
id: ++nextParticleId,
|
|
4843
|
+
x,
|
|
4844
|
+
y,
|
|
4845
|
+
vx: Math.cos(angle) * speed + (Math.random() - 0.5) * 60,
|
|
4846
|
+
vy: Math.sin(angle) * speed,
|
|
4847
|
+
rotation: Math.random() * 360,
|
|
4848
|
+
rotationSpeed: (Math.random() - 0.5) * 720,
|
|
4849
|
+
size: 6 + Math.random() * 6,
|
|
4850
|
+
color: palette[Math.floor(Math.random() * palette.length)] ?? "#000",
|
|
4851
|
+
shape: Math.random() > 0.5 ? "rect" : "circle",
|
|
4852
|
+
bornAt: now
|
|
4853
|
+
});
|
|
4854
|
+
}
|
|
4855
|
+
setParticles((prev) => [...prev, ...burst]);
|
|
4856
|
+
},
|
|
4857
|
+
[particleCount, colors, spread, velocity, origin]
|
|
4858
|
+
);
|
|
4859
|
+
useImperativeHandle(forwardedRef, () => ({ fire: spawn }), [spawn]);
|
|
4860
|
+
useEffect(() => {
|
|
4861
|
+
if (autoFire) spawn();
|
|
4862
|
+
}, [autoFire, spawn]);
|
|
4863
|
+
useEffect(() => {
|
|
4864
|
+
if (particles.length === 0) return;
|
|
4865
|
+
const tick = (now) => {
|
|
4866
|
+
const last = lastTimeRef.current || now;
|
|
4867
|
+
const dt = (now - last) / 1e3;
|
|
4868
|
+
lastTimeRef.current = now;
|
|
4869
|
+
const viewportH = typeof window !== "undefined" ? window.innerHeight : 800;
|
|
4870
|
+
setParticles(
|
|
4871
|
+
(prev) => prev.map((p) => ({
|
|
4872
|
+
...p,
|
|
4873
|
+
x: p.x + p.vx * dt,
|
|
4874
|
+
y: p.y + p.vy * dt,
|
|
4875
|
+
vy: p.vy + gravity * dt,
|
|
4876
|
+
rotation: p.rotation + p.rotationSpeed * dt
|
|
4877
|
+
})).filter((p) => p.y < viewportH + 80 && now - p.bornAt < lifetime)
|
|
4878
|
+
);
|
|
4879
|
+
rafRef.current = requestAnimationFrame(tick);
|
|
4880
|
+
};
|
|
4881
|
+
rafRef.current = requestAnimationFrame(tick);
|
|
4882
|
+
return () => {
|
|
4883
|
+
if (rafRef.current != null) cancelAnimationFrame(rafRef.current);
|
|
4884
|
+
lastTimeRef.current = 0;
|
|
4885
|
+
};
|
|
4886
|
+
}, [particles.length, gravity, lifetime]);
|
|
4887
|
+
if (particles.length === 0) return null;
|
|
4888
|
+
return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
|
|
4889
|
+
"svg",
|
|
4890
|
+
{
|
|
4891
|
+
"aria-hidden": "true",
|
|
4892
|
+
className: "pointer-events-none fixed inset-0 z-50",
|
|
4893
|
+
style: { width: "100vw", height: "100vh" },
|
|
4894
|
+
children: particles.map(
|
|
4895
|
+
(p) => p.shape === "rect" ? /* @__PURE__ */ jsx(
|
|
4896
|
+
"rect",
|
|
4897
|
+
{
|
|
4898
|
+
x: p.x - p.size / 2,
|
|
4899
|
+
y: p.y - p.size / 2,
|
|
4900
|
+
width: p.size,
|
|
4901
|
+
height: p.size * 0.5,
|
|
4902
|
+
fill: p.color,
|
|
4903
|
+
transform: `rotate(${p.rotation} ${p.x} ${p.y})`
|
|
4904
|
+
},
|
|
4905
|
+
p.id
|
|
4906
|
+
) : /* @__PURE__ */ jsx("circle", { cx: p.x, cy: p.y, r: p.size / 2, fill: p.color }, p.id)
|
|
4907
|
+
)
|
|
4908
|
+
}
|
|
4909
|
+
) });
|
|
4910
|
+
});
|
|
4401
4911
|
|
|
4402
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AudioPlayer, AudioWaveform, Avatar, AvatarGroup, Badge, BadgeOverlay, Card, Carousel, CarouselDot, CarouselDots, CarouselNext, CarouselPrev, CarouselSlide, CarouselSlides, CarouselViewport, Code, Collapsible, CollapsibleContent, CollapsibleTrigger, CountBadge, DataGrid, DataTable, DescriptionList, DiffViewer, EmptyState, EventCalendar, Gantt, Heading, HeatmapCalendar, Highlight, Image, InfoRow, Kbd, KeyboardShortcut, List, ListItem, Mark, NodeEditor, NotificationDot, PDFViewer, Quote, ScheduleView, SectionHeader, Separator, Snippet, Sparkline, Stat, Status, SwipeActions, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeaderCell, TableRow, Tabs, TabsList, TabsPanel, TabsTab, Text, Timeline, TimelineDescription, TimelineItem, TimelineTitle, Tooltip, Tree, TreeGroup, TreeItem, VideoPlayer, avatarVariants, badgeVariants, codeVariants, headingVariants, textVariants };
|
|
4403
|
-
//# sourceMappingURL=chunk-
|
|
4404
|
-
//# sourceMappingURL=chunk-
|
|
4912
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedNumber, AudioPlayer, AudioWaveform, Avatar, AvatarGroup, Badge, BadgeOverlay, Card, Carousel, CarouselDot, CarouselDots, CarouselNext, CarouselPrev, CarouselSlide, CarouselSlides, CarouselViewport, Code, Collapsible, CollapsibleContent, CollapsibleTrigger, Confetti, CountBadge, CountUp, DataGrid, DataTable, DescriptionList, DiffViewer, EmptyState, EventCalendar, Gantt, GradientText, Heading, HeatmapCalendar, Highlight, Image, InfoRow, Kbd, KeyboardShortcut, List, ListItem, Mark, Marquee, NodeEditor, NotificationDot, PDFViewer, Quote, ScheduleView, ScrollReveal, SectionHeader, Separator, Snippet, Sparkline, Stat, Status, SwipeActions, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeaderCell, TableRow, Tabs, TabsList, TabsPanel, TabsTab, Text, Tilt, Timeline, TimelineDescription, TimelineItem, TimelineTitle, Tooltip, Tree, TreeGroup, TreeItem, Typewriter, VideoPlayer, avatarVariants, badgeVariants, codeVariants, headingVariants, textVariants };
|
|
4913
|
+
//# sourceMappingURL=chunk-XLPFX4WK.js.map
|
|
4914
|
+
//# sourceMappingURL=chunk-XLPFX4WK.js.map
|