pelatform-ui 1.3.0 → 1.3.1
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/animation.js +102 -287
- package/dist/badge-Rr33PgV_.d.ts +15 -0
- package/dist/button-Bc3N6jWT.d.ts +22 -0
- package/dist/chunk-4Z3DBWB6.js +193 -0
- package/dist/chunk-Q2RH7YQE.js +857 -0
- package/dist/chunk-V3ET2B55.js +53 -0
- package/dist/components.d.ts +1014 -2
- package/dist/components.js +930 -1
- package/dist/hooks.js +14 -59
- package/dist/index.d.ts +48 -1
- package/dist/radix.d.ts +5 -27
- package/dist/radix.js +1524 -2261
- package/package.json +4 -2
package/dist/animation.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
HoverBackground
|
|
4
|
+
} from "./chunk-4Z3DBWB6.js";
|
|
2
5
|
|
|
3
6
|
// src/ui/animation/avatar-group.tsx
|
|
4
7
|
import * as React from "react";
|
|
@@ -665,198 +668,10 @@ function GridBackground({
|
|
|
665
668
|
);
|
|
666
669
|
}
|
|
667
670
|
|
|
668
|
-
// src/ui/animation/hover-background.tsx
|
|
669
|
-
import * as React4 from "react";
|
|
670
|
-
import { motion as motion6, useMotionValue as useMotionValue3, useSpring as useSpring2 } from "motion/react";
|
|
671
|
-
import { cn as cn6 } from "@pelatform/utils";
|
|
672
|
-
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
673
|
-
function HoverBackground({
|
|
674
|
-
className,
|
|
675
|
-
objectCount = 12,
|
|
676
|
-
children,
|
|
677
|
-
colors = {},
|
|
678
|
-
...props
|
|
679
|
-
}) {
|
|
680
|
-
const {
|
|
681
|
-
background = "bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900",
|
|
682
|
-
objects = [
|
|
683
|
-
"bg-cyan-400/20",
|
|
684
|
-
"bg-purple-400/20",
|
|
685
|
-
"bg-fuchsia-400/20",
|
|
686
|
-
"bg-violet-400/20",
|
|
687
|
-
"bg-blue-400/20",
|
|
688
|
-
"bg-indigo-400/20"
|
|
689
|
-
],
|
|
690
|
-
glow = "shadow-cyan-400/50"
|
|
691
|
-
} = colors;
|
|
692
|
-
const [isHovered, setIsHovered] = React4.useState(false);
|
|
693
|
-
const mouseX = useMotionValue3(0);
|
|
694
|
-
const mouseY = useMotionValue3(0);
|
|
695
|
-
const springX = useSpring2(mouseX, {
|
|
696
|
-
stiffness: 300,
|
|
697
|
-
damping: 30,
|
|
698
|
-
// Slower return to center when hover ends
|
|
699
|
-
restSpeed: 0.1,
|
|
700
|
-
restDelta: 0.1
|
|
701
|
-
});
|
|
702
|
-
const springY = useSpring2(mouseY, {
|
|
703
|
-
stiffness: 300,
|
|
704
|
-
damping: 30,
|
|
705
|
-
restSpeed: 0.1,
|
|
706
|
-
restDelta: 0.1
|
|
707
|
-
});
|
|
708
|
-
const animatedObjects = React4.useMemo(
|
|
709
|
-
() => Array.from({ length: objectCount }, (_, i) => {
|
|
710
|
-
const shape = Math.random() > 0.5 ? "circle" : "square";
|
|
711
|
-
return {
|
|
712
|
-
id: i,
|
|
713
|
-
x: Math.random() * 90 + 5,
|
|
714
|
-
// 5-95% to avoid edges
|
|
715
|
-
y: Math.random() * 90 + 5,
|
|
716
|
-
size: Math.random() * 60 + 20,
|
|
717
|
-
// 20-80px
|
|
718
|
-
color: objects[i % objects.length],
|
|
719
|
-
delay: Math.random() * 2,
|
|
720
|
-
shape,
|
|
721
|
-
floatDirection: Math.random() > 0.5 ? 1 : -1,
|
|
722
|
-
breathDuration: Math.random() * 3 + 3,
|
|
723
|
-
// 3-6 seconds
|
|
724
|
-
parallaxStrength: Math.random() * 0.5 + 0.3,
|
|
725
|
-
// 0.3-0.8 for more varied parallax depth
|
|
726
|
-
baseRotation: Math.random() * 360
|
|
727
|
-
// Random starting rotation offset
|
|
728
|
-
};
|
|
729
|
-
}),
|
|
730
|
-
[objectCount, objects]
|
|
731
|
-
);
|
|
732
|
-
const handleMouseMove = (event) => {
|
|
733
|
-
if (!isHovered) return;
|
|
734
|
-
const rect = event.currentTarget.getBoundingClientRect();
|
|
735
|
-
const centerX = rect.width / 2;
|
|
736
|
-
const centerY = rect.height / 2;
|
|
737
|
-
const x = (event.clientX - rect.left - centerX) / centerX;
|
|
738
|
-
const y = (event.clientY - rect.top - centerY) / centerY;
|
|
739
|
-
mouseX.set(x * 15);
|
|
740
|
-
mouseY.set(y * 15);
|
|
741
|
-
};
|
|
742
|
-
const handleHoverStart = () => {
|
|
743
|
-
setIsHovered(true);
|
|
744
|
-
};
|
|
745
|
-
const handleHoverEnd = () => {
|
|
746
|
-
setIsHovered(false);
|
|
747
|
-
mouseX.set(0);
|
|
748
|
-
mouseY.set(0);
|
|
749
|
-
};
|
|
750
|
-
return /* @__PURE__ */ jsxs4(
|
|
751
|
-
motion6.div,
|
|
752
|
-
{
|
|
753
|
-
"data-slot": "hover-background",
|
|
754
|
-
className: cn6("relative size-full overflow-hidden", background, className),
|
|
755
|
-
onHoverStart: handleHoverStart,
|
|
756
|
-
onHoverEnd: handleHoverEnd,
|
|
757
|
-
onMouseMove: handleMouseMove,
|
|
758
|
-
whileHover: { scale: 1.02 },
|
|
759
|
-
transition: { duration: 0.3, ease: "easeOut" },
|
|
760
|
-
animate: {
|
|
761
|
-
backgroundPosition: ["0% 50%", "100% 50%", "0% 50%"]
|
|
762
|
-
},
|
|
763
|
-
style: {
|
|
764
|
-
backgroundSize: "200% 200%"
|
|
765
|
-
},
|
|
766
|
-
...props,
|
|
767
|
-
children: [
|
|
768
|
-
/* @__PURE__ */ jsx6(
|
|
769
|
-
motion6.div,
|
|
770
|
-
{
|
|
771
|
-
className: "absolute inset-0 bg-gradient-radial from-white/5 via-transparent to-transparent",
|
|
772
|
-
animate: {
|
|
773
|
-
opacity: [0.3, 0.6, 0.3],
|
|
774
|
-
scale: [1, 1.1, 1]
|
|
775
|
-
},
|
|
776
|
-
transition: {
|
|
777
|
-
duration: 4,
|
|
778
|
-
repeat: Infinity,
|
|
779
|
-
ease: "easeInOut"
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
),
|
|
783
|
-
animatedObjects.map((obj) => /* @__PURE__ */ jsx6(
|
|
784
|
-
motion6.div,
|
|
785
|
-
{
|
|
786
|
-
className: cn6(
|
|
787
|
-
"absolute border border-white/10 backdrop-blur-sm",
|
|
788
|
-
obj.color,
|
|
789
|
-
obj.shape === "circle" ? "rounded-full" : "rotate-45 rounded-lg"
|
|
790
|
-
),
|
|
791
|
-
style: {
|
|
792
|
-
left: `${obj.x}%`,
|
|
793
|
-
top: `${obj.y}%`,
|
|
794
|
-
width: obj.size,
|
|
795
|
-
height: obj.size,
|
|
796
|
-
// Apply parallax with individual object strength
|
|
797
|
-
x: springX.get() * obj.parallaxStrength,
|
|
798
|
-
y: springY.get() * obj.parallaxStrength
|
|
799
|
-
},
|
|
800
|
-
initial: {
|
|
801
|
-
scale: 0.6,
|
|
802
|
-
opacity: 0.4,
|
|
803
|
-
rotate: obj.baseRotation
|
|
804
|
-
},
|
|
805
|
-
animate: {
|
|
806
|
-
// Default state animations - breathing with base rotation offset
|
|
807
|
-
scale: [0.6, 0.8, 0.6],
|
|
808
|
-
opacity: [0.4, 0.6, 0.4],
|
|
809
|
-
rotate: obj.shape === "circle" ? [obj.baseRotation, obj.baseRotation + 10, obj.baseRotation] : [obj.baseRotation, obj.baseRotation + 5, obj.baseRotation],
|
|
810
|
-
y: [0, obj.floatDirection * 15, 0],
|
|
811
|
-
x: [0, obj.floatDirection * 8, 0]
|
|
812
|
-
},
|
|
813
|
-
transition: {
|
|
814
|
-
duration: obj.breathDuration,
|
|
815
|
-
delay: obj.delay,
|
|
816
|
-
ease: "easeInOut",
|
|
817
|
-
repeat: Infinity,
|
|
818
|
-
repeatType: "reverse"
|
|
819
|
-
},
|
|
820
|
-
whileHover: {
|
|
821
|
-
scale: 1.5,
|
|
822
|
-
boxShadow: `0 0 30px ${glow.replace("shadow-", "").replace("/50", "")}`
|
|
823
|
-
}
|
|
824
|
-
},
|
|
825
|
-
obj.id
|
|
826
|
-
)),
|
|
827
|
-
isHovered && /* @__PURE__ */ jsx6("div", { className: "pointer-events-none absolute inset-0", children: Array.from({ length: 20 }).map((_, i) => /* @__PURE__ */ jsx6(
|
|
828
|
-
motion6.div,
|
|
829
|
-
{
|
|
830
|
-
className: "absolute h-1 w-1 rounded-full bg-white/60",
|
|
831
|
-
style: {
|
|
832
|
-
left: `${Math.random() * 100}%`,
|
|
833
|
-
top: `${Math.random() * 100}%`
|
|
834
|
-
},
|
|
835
|
-
initial: { opacity: 0, scale: 0 },
|
|
836
|
-
animate: {
|
|
837
|
-
opacity: [0, 1, 0],
|
|
838
|
-
scale: [0, 1, 0],
|
|
839
|
-
y: [0, -50, -100]
|
|
840
|
-
},
|
|
841
|
-
transition: {
|
|
842
|
-
duration: 3,
|
|
843
|
-
delay: Math.random() * 2,
|
|
844
|
-
repeat: Infinity,
|
|
845
|
-
ease: "easeOut"
|
|
846
|
-
}
|
|
847
|
-
},
|
|
848
|
-
`particle-${i}`
|
|
849
|
-
)) }),
|
|
850
|
-
/* @__PURE__ */ jsx6("div", { className: "relative z-10 size-full", children })
|
|
851
|
-
]
|
|
852
|
-
}
|
|
853
|
-
);
|
|
854
|
-
}
|
|
855
|
-
|
|
856
671
|
// src/ui/animation/marquee.tsx
|
|
857
|
-
import
|
|
858
|
-
import { cn as
|
|
859
|
-
import { Fragment, jsx as
|
|
672
|
+
import React4, { useRef as useRef2 } from "react";
|
|
673
|
+
import { cn as cn6 } from "@pelatform/utils";
|
|
674
|
+
import { Fragment, jsx as jsx6 } from "react/jsx-runtime";
|
|
860
675
|
function Marquee({
|
|
861
676
|
className,
|
|
862
677
|
reverse = false,
|
|
@@ -870,13 +685,13 @@ function Marquee({
|
|
|
870
685
|
...props
|
|
871
686
|
}) {
|
|
872
687
|
const marqueeRef = useRef2(null);
|
|
873
|
-
return /* @__PURE__ */
|
|
688
|
+
return /* @__PURE__ */ jsx6(
|
|
874
689
|
"div",
|
|
875
690
|
{
|
|
876
691
|
...props,
|
|
877
692
|
ref: marqueeRef,
|
|
878
693
|
"data-slot": "marquee",
|
|
879
|
-
className:
|
|
694
|
+
className: cn6(
|
|
880
695
|
"group flex gap-(--gap) overflow-hidden p-2 [--duration:40s] [--gap:1rem]",
|
|
881
696
|
{
|
|
882
697
|
"flex-row": !vertical,
|
|
@@ -888,11 +703,11 @@ function Marquee({
|
|
|
888
703
|
"aria-live": ariaLive,
|
|
889
704
|
role: ariaRole,
|
|
890
705
|
tabIndex: 0,
|
|
891
|
-
children:
|
|
892
|
-
() => /* @__PURE__ */
|
|
706
|
+
children: React4.useMemo(
|
|
707
|
+
() => /* @__PURE__ */ jsx6(Fragment, { children: Array.from({ length: repeat }, (_, i) => /* @__PURE__ */ jsx6(
|
|
893
708
|
"div",
|
|
894
709
|
{
|
|
895
|
-
className:
|
|
710
|
+
className: cn6(
|
|
896
711
|
!vertical ? "flex-row gap-(--gap)" : "flex-col gap-(--gap)",
|
|
897
712
|
"flex shrink-0 justify-around",
|
|
898
713
|
!vertical && "animate-marquee flex-row",
|
|
@@ -911,10 +726,10 @@ function Marquee({
|
|
|
911
726
|
}
|
|
912
727
|
|
|
913
728
|
// src/ui/animation/shimmering-text.tsx
|
|
914
|
-
import { useMemo as
|
|
915
|
-
import { motion as
|
|
916
|
-
import { cn as
|
|
917
|
-
import { jsx as
|
|
729
|
+
import { useMemo as useMemo2, useRef as useRef3 } from "react";
|
|
730
|
+
import { motion as motion6, useInView as useInView3 } from "motion/react";
|
|
731
|
+
import { cn as cn7 } from "@pelatform/utils";
|
|
732
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
918
733
|
function ShimmeringText({
|
|
919
734
|
text,
|
|
920
735
|
duration = 2,
|
|
@@ -931,15 +746,15 @@ function ShimmeringText({
|
|
|
931
746
|
}) {
|
|
932
747
|
const ref = useRef3(null);
|
|
933
748
|
const isInView = useInView3(ref, { once, margin: inViewMargin });
|
|
934
|
-
const dynamicSpread =
|
|
749
|
+
const dynamicSpread = useMemo2(() => {
|
|
935
750
|
return text.length * spread;
|
|
936
751
|
}, [text, spread]);
|
|
937
752
|
const shouldAnimate = !startOnView || isInView;
|
|
938
|
-
return /* @__PURE__ */
|
|
939
|
-
|
|
753
|
+
return /* @__PURE__ */ jsx7(
|
|
754
|
+
motion6.span,
|
|
940
755
|
{
|
|
941
756
|
ref,
|
|
942
|
-
className:
|
|
757
|
+
className: cn7(
|
|
943
758
|
"relative inline-block bg-size-[250%_100%,auto] bg-clip-text text-transparent",
|
|
944
759
|
"[--base-color:var(--color-zinc-400)] [--shimmer-color:var(--color-zinc-950)]",
|
|
945
760
|
"[background-repeat:no-repeat,padding-box]",
|
|
@@ -980,9 +795,9 @@ function ShimmeringText({
|
|
|
980
795
|
}
|
|
981
796
|
|
|
982
797
|
// src/ui/animation/sliding-number.tsx
|
|
983
|
-
import { useEffect as useEffect3, useLayoutEffect, useMemo as
|
|
984
|
-
import { motion as
|
|
985
|
-
import { jsx as
|
|
798
|
+
import { useEffect as useEffect3, useLayoutEffect, useMemo as useMemo3, useRef as useRef4, useState as useState4 } from "react";
|
|
799
|
+
import { motion as motion7, useInView as useInView4, useSpring as useSpring2, useTransform as useTransform2 } from "motion/react";
|
|
800
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
986
801
|
function Digit({
|
|
987
802
|
place,
|
|
988
803
|
value,
|
|
@@ -990,14 +805,14 @@ function Digit({
|
|
|
990
805
|
duration
|
|
991
806
|
}) {
|
|
992
807
|
const valueRoundedToPlace = Math.floor(value / place);
|
|
993
|
-
const animatedValue =
|
|
808
|
+
const animatedValue = useSpring2(valueRoundedToPlace, {
|
|
994
809
|
duration: duration * 1e3
|
|
995
810
|
// Convert to milliseconds
|
|
996
811
|
});
|
|
997
812
|
useEffect3(() => {
|
|
998
813
|
animatedValue.set(valueRoundedToPlace);
|
|
999
814
|
}, [animatedValue, valueRoundedToPlace]);
|
|
1000
|
-
return /* @__PURE__ */
|
|
815
|
+
return /* @__PURE__ */ jsx8("div", { style: { height: digitHeight }, className: "relative w-[1ch] overflow-hidden tabular-nums", children: Array.from({ length: 10 }, (_, i) => /* @__PURE__ */ jsx8(MyNumber, { mv: animatedValue, number: i, digitHeight }, i)) });
|
|
1001
816
|
}
|
|
1002
817
|
function MyNumber({
|
|
1003
818
|
mv,
|
|
@@ -1013,7 +828,7 @@ function MyNumber({
|
|
|
1013
828
|
}
|
|
1014
829
|
return memo;
|
|
1015
830
|
});
|
|
1016
|
-
return /* @__PURE__ */
|
|
831
|
+
return /* @__PURE__ */ jsx8(motion7.span, { style: { y }, className: "absolute inset-0 flex items-center justify-center", children: number });
|
|
1017
832
|
}
|
|
1018
833
|
function SlidingNumber({
|
|
1019
834
|
from,
|
|
@@ -1028,9 +843,9 @@ function SlidingNumber({
|
|
|
1028
843
|
}) {
|
|
1029
844
|
const ref = useRef4(null);
|
|
1030
845
|
const isInView = useInView4(ref, { once: false });
|
|
1031
|
-
const [currentValue, setCurrentValue] =
|
|
1032
|
-
const [hasAnimated, setHasAnimated] =
|
|
1033
|
-
const [animationKey, setAnimationKey] =
|
|
846
|
+
const [currentValue, setCurrentValue] = useState4(from);
|
|
847
|
+
const [hasAnimated, setHasAnimated] = useState4(false);
|
|
848
|
+
const [animationKey, setAnimationKey] = useState4(0);
|
|
1034
849
|
const animationFrameRef = useRef4(null);
|
|
1035
850
|
const timeoutRef = useRef4(null);
|
|
1036
851
|
const onCompleteRef = useRef4(onComplete);
|
|
@@ -1050,7 +865,7 @@ function SlidingNumber({
|
|
|
1050
865
|
timeoutRef.current = null;
|
|
1051
866
|
}
|
|
1052
867
|
}, [from]);
|
|
1053
|
-
const shouldStart =
|
|
868
|
+
const shouldStart = useMemo3(() => {
|
|
1054
869
|
if (!startOnView) return true;
|
|
1055
870
|
if (!isInView) return false;
|
|
1056
871
|
if (once && hasAnimated) return false;
|
|
@@ -1100,13 +915,13 @@ function SlidingNumber({
|
|
|
1100
915
|
const roundedValue = Math.round(currentValue);
|
|
1101
916
|
const absValue = Math.abs(roundedValue);
|
|
1102
917
|
const maxDigits = Math.max(Math.abs(from).toString().length, Math.abs(to).toString().length);
|
|
1103
|
-
const places =
|
|
918
|
+
const places = useMemo3(
|
|
1104
919
|
() => Array.from({ length: maxDigits }, (_, i) => 10 ** (maxDigits - i - 1)),
|
|
1105
920
|
[maxDigits]
|
|
1106
921
|
);
|
|
1107
|
-
return /* @__PURE__ */
|
|
922
|
+
return /* @__PURE__ */ jsxs4("div", { ref, className: `flex items-center ${className}`, children: [
|
|
1108
923
|
roundedValue < 0 && "-",
|
|
1109
|
-
places.map((place) => /* @__PURE__ */
|
|
924
|
+
places.map((place) => /* @__PURE__ */ jsx8(
|
|
1110
925
|
Digit,
|
|
1111
926
|
{
|
|
1112
927
|
place,
|
|
@@ -1120,10 +935,10 @@ function SlidingNumber({
|
|
|
1120
935
|
}
|
|
1121
936
|
|
|
1122
937
|
// src/ui/animation/svg-text.tsx
|
|
1123
|
-
import * as
|
|
1124
|
-
import { useEffect as useEffect4, useRef as useRef5, useState as
|
|
1125
|
-
import { cn as
|
|
1126
|
-
import { jsx as
|
|
938
|
+
import * as React5 from "react";
|
|
939
|
+
import { useEffect as useEffect4, useRef as useRef5, useState as useState5 } from "react";
|
|
940
|
+
import { cn as cn8 } from "@pelatform/utils";
|
|
941
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1127
942
|
function SvgText({
|
|
1128
943
|
svg,
|
|
1129
944
|
children,
|
|
@@ -1133,9 +948,9 @@ function SvgText({
|
|
|
1133
948
|
as: Component = "div"
|
|
1134
949
|
}) {
|
|
1135
950
|
const textRef = useRef5(null);
|
|
1136
|
-
const [textDimensions, setTextDimensions] =
|
|
1137
|
-
const content =
|
|
1138
|
-
const maskId =
|
|
951
|
+
const [textDimensions, setTextDimensions] = useState5({ width: 0, height: 0 });
|
|
952
|
+
const content = React5.Children.toArray(children).join("");
|
|
953
|
+
const maskId = React5.useId();
|
|
1139
954
|
useEffect4(() => {
|
|
1140
955
|
if (!textRef.current) return;
|
|
1141
956
|
const updateDimensions = () => {
|
|
@@ -1152,8 +967,8 @@ function SvgText({
|
|
|
1152
967
|
resizeObserver.observe(textRef.current);
|
|
1153
968
|
return () => resizeObserver.disconnect();
|
|
1154
969
|
}, []);
|
|
1155
|
-
return /* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ jsxs5(Component, { className: cn8("relative inline-block", className), children: [
|
|
971
|
+
/* @__PURE__ */ jsx9(
|
|
1157
972
|
"div",
|
|
1158
973
|
{
|
|
1159
974
|
ref: textRef,
|
|
@@ -1166,7 +981,7 @@ function SvgText({
|
|
|
1166
981
|
children: content
|
|
1167
982
|
}
|
|
1168
983
|
),
|
|
1169
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ jsxs5(
|
|
1170
985
|
"svg",
|
|
1171
986
|
{
|
|
1172
987
|
className: "block",
|
|
@@ -1179,9 +994,9 @@ function SvgText({
|
|
|
1179
994
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
1180
995
|
},
|
|
1181
996
|
children: [
|
|
1182
|
-
/* @__PURE__ */
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
/* @__PURE__ */
|
|
997
|
+
/* @__PURE__ */ jsx9("defs", { children: /* @__PURE__ */ jsxs5("mask", { id: maskId, children: [
|
|
998
|
+
/* @__PURE__ */ jsx9("rect", { width: "100%", height: "100%", fill: "black" }),
|
|
999
|
+
/* @__PURE__ */ jsx9(
|
|
1185
1000
|
"text",
|
|
1186
1001
|
{
|
|
1187
1002
|
x: "50%",
|
|
@@ -1198,7 +1013,7 @@ function SvgText({
|
|
|
1198
1013
|
}
|
|
1199
1014
|
)
|
|
1200
1015
|
] }) }),
|
|
1201
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ jsx9("g", { mask: `url(#${maskId})`, children: /* @__PURE__ */ jsx9(
|
|
1202
1017
|
"foreignObject",
|
|
1203
1018
|
{
|
|
1204
1019
|
width: "100%",
|
|
@@ -1206,7 +1021,7 @@ function SvgText({
|
|
|
1206
1021
|
style: {
|
|
1207
1022
|
overflow: "visible"
|
|
1208
1023
|
},
|
|
1209
|
-
children: /* @__PURE__ */
|
|
1024
|
+
children: /* @__PURE__ */ jsx9(
|
|
1210
1025
|
"div",
|
|
1211
1026
|
{
|
|
1212
1027
|
style: {
|
|
@@ -1216,7 +1031,7 @@ function SvgText({
|
|
|
1216
1031
|
alignItems: "center",
|
|
1217
1032
|
justifyContent: "center"
|
|
1218
1033
|
},
|
|
1219
|
-
children: /* @__PURE__ */
|
|
1034
|
+
children: /* @__PURE__ */ jsx9(
|
|
1220
1035
|
"div",
|
|
1221
1036
|
{
|
|
1222
1037
|
style: {
|
|
@@ -1235,15 +1050,15 @@ function SvgText({
|
|
|
1235
1050
|
]
|
|
1236
1051
|
}
|
|
1237
1052
|
),
|
|
1238
|
-
/* @__PURE__ */
|
|
1053
|
+
/* @__PURE__ */ jsx9("span", { className: "sr-only", children: content })
|
|
1239
1054
|
] });
|
|
1240
1055
|
}
|
|
1241
1056
|
|
|
1242
1057
|
// src/ui/animation/text-reveal.tsx
|
|
1243
|
-
import { useEffect as useEffect5, useRef as useRef6, useState as
|
|
1244
|
-
import { motion as
|
|
1245
|
-
import { cn as
|
|
1246
|
-
import { jsx as
|
|
1058
|
+
import { useEffect as useEffect5, useRef as useRef6, useState as useState6 } from "react";
|
|
1059
|
+
import { motion as motion8, useInView as useInView5 } from "motion/react";
|
|
1060
|
+
import { cn as cn9 } from "@pelatform/utils";
|
|
1061
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1247
1062
|
var containerVariants = {
|
|
1248
1063
|
fade: {
|
|
1249
1064
|
hidden: {},
|
|
@@ -1442,7 +1257,7 @@ function TextReveal({
|
|
|
1442
1257
|
}) {
|
|
1443
1258
|
const ref = useRef6(null);
|
|
1444
1259
|
const isInView = useInView5(ref, { once, margin: "-10%" });
|
|
1445
|
-
const [hasAnimated, setHasAnimated] =
|
|
1260
|
+
const [hasAnimated, setHasAnimated] = useState6(false);
|
|
1446
1261
|
const shouldAnimate = startOnView ? isInView : true;
|
|
1447
1262
|
const elements = wordLevel ? children.split(" ").map((word, i, arr) => i < arr.length - 1 ? `${word} ` : word) : children.split("");
|
|
1448
1263
|
const customContainerVariants = {
|
|
@@ -1470,12 +1285,12 @@ function TextReveal({
|
|
|
1470
1285
|
setHasAnimated(true);
|
|
1471
1286
|
}
|
|
1472
1287
|
}, [shouldAnimate, hasAnimated]);
|
|
1473
|
-
const MotionComponent = variant === "typewriter" ?
|
|
1474
|
-
return /* @__PURE__ */
|
|
1475
|
-
|
|
1288
|
+
const MotionComponent = variant === "typewriter" ? motion8.div : motion8.span;
|
|
1289
|
+
return /* @__PURE__ */ jsx10(
|
|
1290
|
+
motion8.div,
|
|
1476
1291
|
{
|
|
1477
1292
|
ref,
|
|
1478
|
-
className:
|
|
1293
|
+
className: cn9("inline-block", className),
|
|
1479
1294
|
variants: customContainerVariants,
|
|
1480
1295
|
initial: "hidden",
|
|
1481
1296
|
animate: shouldAnimate ? "visible" : "hidden",
|
|
@@ -1489,8 +1304,8 @@ function TextReveal({
|
|
|
1489
1304
|
contain: "layout style paint",
|
|
1490
1305
|
...style
|
|
1491
1306
|
},
|
|
1492
|
-
children: variant === "typewriter" ? /* @__PURE__ */
|
|
1493
|
-
|
|
1307
|
+
children: variant === "typewriter" ? /* @__PURE__ */ jsx10(
|
|
1308
|
+
motion8.span,
|
|
1494
1309
|
{
|
|
1495
1310
|
className: "inline-block overflow-hidden whitespace-nowrap",
|
|
1496
1311
|
variants: customItemVariants,
|
|
@@ -1500,10 +1315,10 @@ function TextReveal({
|
|
|
1500
1315
|
},
|
|
1501
1316
|
children
|
|
1502
1317
|
}
|
|
1503
|
-
) : elements.map((element, index) => /* @__PURE__ */
|
|
1318
|
+
) : elements.map((element, index) => /* @__PURE__ */ jsx10(
|
|
1504
1319
|
MotionComponent,
|
|
1505
1320
|
{
|
|
1506
|
-
className:
|
|
1321
|
+
className: cn9("inline-block", {
|
|
1507
1322
|
"whitespace-pre": !wordLevel
|
|
1508
1323
|
}),
|
|
1509
1324
|
variants: customItemVariants,
|
|
@@ -1526,13 +1341,13 @@ function TextReveal({
|
|
|
1526
1341
|
}
|
|
1527
1342
|
|
|
1528
1343
|
// src/ui/animation/typing-text.tsx
|
|
1529
|
-
import { useEffect as useEffect6, useRef as useRef7, useState as
|
|
1344
|
+
import { useEffect as useEffect6, useRef as useRef7, useState as useState7 } from "react";
|
|
1530
1345
|
import {
|
|
1531
|
-
motion as
|
|
1346
|
+
motion as motion9,
|
|
1532
1347
|
useInView as useInView6
|
|
1533
1348
|
} from "motion/react";
|
|
1534
|
-
import { cn as
|
|
1535
|
-
import { jsx as
|
|
1349
|
+
import { cn as cn10 } from "@pelatform/utils";
|
|
1350
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1536
1351
|
var cursorVariants = {
|
|
1537
1352
|
blinking: {
|
|
1538
1353
|
opacity: [0, 0, 1, 1],
|
|
@@ -1567,11 +1382,11 @@ function TypingText({
|
|
|
1567
1382
|
once,
|
|
1568
1383
|
margin: inViewMargin
|
|
1569
1384
|
});
|
|
1570
|
-
const [hasAnimated, setHasAnimated] =
|
|
1571
|
-
const [displayText, setDisplayText] =
|
|
1572
|
-
const [currentIndex, setCurrentIndex] =
|
|
1573
|
-
const [isTyping, setIsTyping] =
|
|
1574
|
-
const [currentTextIndex, setCurrentTextIndex] =
|
|
1385
|
+
const [hasAnimated, setHasAnimated] = useState7(false);
|
|
1386
|
+
const [displayText, setDisplayText] = useState7("");
|
|
1387
|
+
const [currentIndex, setCurrentIndex] = useState7(0);
|
|
1388
|
+
const [isTyping, setIsTyping] = useState7(false);
|
|
1389
|
+
const [currentTextIndex, setCurrentTextIndex] = useState7(0);
|
|
1575
1390
|
const shouldStart = !startOnView || isInView && (!once || !hasAnimated);
|
|
1576
1391
|
const textArray = texts && texts.length > 0 ? texts : [text];
|
|
1577
1392
|
const currentText = textArray[currentTextIndex] ?? "";
|
|
@@ -1610,8 +1425,8 @@ function TypingText({
|
|
|
1610
1425
|
exit: { opacity: 0 }
|
|
1611
1426
|
}
|
|
1612
1427
|
};
|
|
1613
|
-
const MotionComponent =
|
|
1614
|
-
return /* @__PURE__ */
|
|
1428
|
+
const MotionComponent = motion9.span;
|
|
1429
|
+
return /* @__PURE__ */ jsx11(
|
|
1615
1430
|
MotionComponent,
|
|
1616
1431
|
{
|
|
1617
1432
|
ref,
|
|
@@ -1620,17 +1435,17 @@ function TypingText({
|
|
|
1620
1435
|
whileInView: startOnView ? "show" : void 0,
|
|
1621
1436
|
animate: startOnView ? void 0 : "show",
|
|
1622
1437
|
exit: "exit",
|
|
1623
|
-
className:
|
|
1438
|
+
className: cn10("whitespace-pre-wrap", className),
|
|
1624
1439
|
viewport: { once },
|
|
1625
1440
|
...props,
|
|
1626
|
-
children: /* @__PURE__ */
|
|
1441
|
+
children: /* @__PURE__ */ jsxs6("span", { style: { display: "inline-flex", alignItems: "center" }, children: [
|
|
1627
1442
|
displayText,
|
|
1628
|
-
showCursor && /* @__PURE__ */
|
|
1629
|
-
|
|
1443
|
+
showCursor && /* @__PURE__ */ jsx11(
|
|
1444
|
+
motion9.span,
|
|
1630
1445
|
{
|
|
1631
1446
|
variants: cursorVariants,
|
|
1632
1447
|
animate: "blinking",
|
|
1633
|
-
className:
|
|
1448
|
+
className: cn10(
|
|
1634
1449
|
"ms-1 inline-block w-px select-none font-normal text-foreground",
|
|
1635
1450
|
cursorClassName
|
|
1636
1451
|
),
|
|
@@ -1643,10 +1458,10 @@ function TypingText({
|
|
|
1643
1458
|
}
|
|
1644
1459
|
|
|
1645
1460
|
// src/ui/animation/video-text.tsx
|
|
1646
|
-
import * as
|
|
1461
|
+
import * as React6 from "react";
|
|
1647
1462
|
import { useEffect as useEffect7, useRef as useRef8 } from "react";
|
|
1648
|
-
import { cn as
|
|
1649
|
-
import { jsx as
|
|
1463
|
+
import { cn as cn11 } from "@pelatform/utils";
|
|
1464
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1650
1465
|
function VideoText({
|
|
1651
1466
|
src,
|
|
1652
1467
|
children,
|
|
@@ -1714,14 +1529,14 @@ function VideoText({
|
|
|
1714
1529
|
};
|
|
1715
1530
|
}, [fontSize, fontWeight]);
|
|
1716
1531
|
const sources = Array.isArray(src) ? src : [src];
|
|
1717
|
-
const content =
|
|
1718
|
-
return /* @__PURE__ */
|
|
1532
|
+
const content = React6.Children.toArray(children).join("");
|
|
1533
|
+
return /* @__PURE__ */ jsxs7(
|
|
1719
1534
|
Component,
|
|
1720
1535
|
{
|
|
1721
1536
|
ref: containerRef,
|
|
1722
|
-
className:
|
|
1537
|
+
className: cn11("relative inline-block overflow-hidden", className),
|
|
1723
1538
|
children: [
|
|
1724
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ jsxs7(
|
|
1725
1540
|
"video",
|
|
1726
1541
|
{
|
|
1727
1542
|
ref: videoRef,
|
|
@@ -1736,12 +1551,12 @@ function VideoText({
|
|
|
1736
1551
|
onEnded,
|
|
1737
1552
|
crossOrigin: "anonymous",
|
|
1738
1553
|
children: [
|
|
1739
|
-
sources.map((source, index) => /* @__PURE__ */
|
|
1554
|
+
sources.map((source, index) => /* @__PURE__ */ jsx12("source", { src: source }, index)),
|
|
1740
1555
|
"Your browser does not support the video tag."
|
|
1741
1556
|
]
|
|
1742
1557
|
}
|
|
1743
1558
|
),
|
|
1744
|
-
/* @__PURE__ */
|
|
1559
|
+
/* @__PURE__ */ jsx12(
|
|
1745
1560
|
"canvas",
|
|
1746
1561
|
{
|
|
1747
1562
|
ref: canvasRef,
|
|
@@ -1752,7 +1567,7 @@ function VideoText({
|
|
|
1752
1567
|
}
|
|
1753
1568
|
}
|
|
1754
1569
|
),
|
|
1755
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ jsx12(
|
|
1756
1571
|
"div",
|
|
1757
1572
|
{
|
|
1758
1573
|
ref: textRef,
|
|
@@ -1765,20 +1580,20 @@ function VideoText({
|
|
|
1765
1580
|
children
|
|
1766
1581
|
}
|
|
1767
1582
|
),
|
|
1768
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: content })
|
|
1769
1584
|
]
|
|
1770
1585
|
}
|
|
1771
1586
|
);
|
|
1772
1587
|
}
|
|
1773
1588
|
|
|
1774
1589
|
// src/ui/animation/word-rotate.tsx
|
|
1775
|
-
import { useEffect as useEffect8, useRef as useRef9, useState as
|
|
1590
|
+
import { useEffect as useEffect8, useRef as useRef9, useState as useState8 } from "react";
|
|
1776
1591
|
import {
|
|
1777
|
-
motion as
|
|
1592
|
+
motion as motion10,
|
|
1778
1593
|
useInView as useInView7
|
|
1779
1594
|
} from "motion/react";
|
|
1780
|
-
import { cn as
|
|
1781
|
-
import { jsx as
|
|
1595
|
+
import { cn as cn12 } from "@pelatform/utils";
|
|
1596
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1782
1597
|
function WordRotate({
|
|
1783
1598
|
words,
|
|
1784
1599
|
duration = 1500,
|
|
@@ -1797,9 +1612,9 @@ function WordRotate({
|
|
|
1797
1612
|
once,
|
|
1798
1613
|
margin: inViewMargin
|
|
1799
1614
|
});
|
|
1800
|
-
const [hasAnimated, setHasAnimated] =
|
|
1801
|
-
const [currentWord, setCurrentWord] =
|
|
1802
|
-
const [show, setShow] =
|
|
1615
|
+
const [hasAnimated, setHasAnimated] = useState8(false);
|
|
1616
|
+
const [currentWord, setCurrentWord] = useState8(0);
|
|
1617
|
+
const [show, setShow] = useState8(true);
|
|
1803
1618
|
const variants = {
|
|
1804
1619
|
fade: {
|
|
1805
1620
|
initial: { opacity: 0 },
|
|
@@ -1924,14 +1739,14 @@ function WordRotate({
|
|
|
1924
1739
|
}, duration + pauseDuration);
|
|
1925
1740
|
return () => clearInterval(interval);
|
|
1926
1741
|
}, [shouldStart, duration, pauseDuration, words.length, loop]);
|
|
1927
|
-
return /* @__PURE__ */
|
|
1928
|
-
|
|
1742
|
+
return /* @__PURE__ */ jsx13(
|
|
1743
|
+
motion10.span,
|
|
1929
1744
|
{
|
|
1930
1745
|
ref,
|
|
1931
|
-
className:
|
|
1746
|
+
className: cn12("inline-block overflow-hidden", containerClassName),
|
|
1932
1747
|
...props,
|
|
1933
|
-
children: /* @__PURE__ */
|
|
1934
|
-
|
|
1748
|
+
children: /* @__PURE__ */ jsx13(
|
|
1749
|
+
motion10.span,
|
|
1935
1750
|
{
|
|
1936
1751
|
initial: "initial",
|
|
1937
1752
|
animate: show ? "animate" : "exit",
|
|
@@ -1941,7 +1756,7 @@ function WordRotate({
|
|
|
1941
1756
|
style: {
|
|
1942
1757
|
perspective: animationStyle === "flip" ? 1e3 : void 0
|
|
1943
1758
|
},
|
|
1944
|
-
className:
|
|
1759
|
+
className: cn12("inline-block overflow-hidden", className),
|
|
1945
1760
|
children: words[currentWord]
|
|
1946
1761
|
},
|
|
1947
1762
|
currentWord
|