@pelatform/ui 1.5.1 → 1.5.3
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/css/components/image-input.css +1 -1
- package/dist/animation.cjs +8 -192
- package/dist/animation.js +83 -267
- package/dist/base.cjs +5 -5
- package/dist/base.js +5 -5
- package/dist/{chunk-TYEFU7IG.js → chunk-CTHRAJQZ.js} +446 -279
- package/dist/chunk-D373YKDA.js +196 -0
- package/dist/{chunk-DBE4IGCP.cjs → chunk-HILACSFA.cjs} +368 -201
- package/dist/{chunk-S3QFGYE6.js → chunk-UYMAUGVA.js} +12 -0
- package/dist/{chunk-KNS6QRVB.cjs → chunk-WI36EFUS.cjs} +14 -2
- package/dist/chunk-ZBO5IAMA.cjs +196 -0
- package/dist/{components-BgbIL9EW.d.cts → components-CidsRcc3.d.cts} +4 -0
- package/dist/{components-BgbIL9EW.d.ts → components-CidsRcc3.d.ts} +4 -0
- package/dist/components.cjs +437 -100
- package/dist/components.d.cts +172 -4
- package/dist/components.d.ts +172 -4
- package/dist/components.js +635 -298
- package/dist/default.cjs +184 -333
- package/dist/default.js +712 -861
- package/dist/index.cjs +5 -9
- package/dist/index.d.cts +22 -2
- package/dist/index.d.ts +22 -2
- package/dist/index.js +4 -8
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +2 -34
package/dist/animation.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
+
import {
|
|
5
|
+
HoverBackground
|
|
6
|
+
} from "./chunk-D373YKDA.js";
|
|
4
7
|
import {
|
|
5
8
|
cn
|
|
6
9
|
} from "./chunk-RQHJBTEU.js";
|
|
@@ -665,196 +668,9 @@ 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 { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
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 = useMotionValue3(0);
|
|
693
|
-
const mouseY = useMotionValue3(0);
|
|
694
|
-
const springX = useSpring2(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 = useSpring2(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__ */ jsxs4(
|
|
750
|
-
motion6.div,
|
|
751
|
-
{
|
|
752
|
-
"data-slot": "hover-background",
|
|
753
|
-
className: cn("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__ */ jsx6(
|
|
768
|
-
motion6.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__ */ jsx6(
|
|
783
|
-
motion6.div,
|
|
784
|
-
{
|
|
785
|
-
className: cn(
|
|
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__ */ jsx6("div", { className: "pointer-events-none absolute inset-0", children: Array.from({ length: 20 }).map((_, i) => /* @__PURE__ */ jsx6(
|
|
827
|
-
motion6.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__ */ jsx6("div", { className: "relative z-10 size-full", children })
|
|
850
|
-
]
|
|
851
|
-
}
|
|
852
|
-
);
|
|
853
|
-
}
|
|
854
|
-
|
|
855
671
|
// src/ui/animation/marquee.tsx
|
|
856
|
-
import
|
|
857
|
-
import { Fragment, jsx as
|
|
672
|
+
import React4, { useRef as useRef2 } from "react";
|
|
673
|
+
import { Fragment, jsx as jsx6 } from "react/jsx-runtime";
|
|
858
674
|
function Marquee({
|
|
859
675
|
className,
|
|
860
676
|
reverse = false,
|
|
@@ -868,7 +684,7 @@ function Marquee({
|
|
|
868
684
|
...props
|
|
869
685
|
}) {
|
|
870
686
|
const marqueeRef = useRef2(null);
|
|
871
|
-
return /* @__PURE__ */
|
|
687
|
+
return /* @__PURE__ */ jsx6(
|
|
872
688
|
"div",
|
|
873
689
|
{
|
|
874
690
|
...props,
|
|
@@ -886,8 +702,8 @@ function Marquee({
|
|
|
886
702
|
"aria-live": ariaLive,
|
|
887
703
|
role: ariaRole,
|
|
888
704
|
tabIndex: 0,
|
|
889
|
-
children:
|
|
890
|
-
() => /* @__PURE__ */
|
|
705
|
+
children: React4.useMemo(
|
|
706
|
+
() => /* @__PURE__ */ jsx6(Fragment, { children: Array.from({ length: repeat }, (_, i) => /* @__PURE__ */ jsx6(
|
|
891
707
|
"div",
|
|
892
708
|
{
|
|
893
709
|
className: cn(
|
|
@@ -909,9 +725,9 @@ function Marquee({
|
|
|
909
725
|
}
|
|
910
726
|
|
|
911
727
|
// src/ui/animation/shimmering-text.tsx
|
|
912
|
-
import { useMemo as
|
|
913
|
-
import { motion as
|
|
914
|
-
import { jsx as
|
|
728
|
+
import { useMemo as useMemo2, useRef as useRef3 } from "react";
|
|
729
|
+
import { motion as motion6, useInView as useInView3 } from "motion/react";
|
|
730
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
915
731
|
function ShimmeringText({
|
|
916
732
|
text,
|
|
917
733
|
duration = 2,
|
|
@@ -928,12 +744,12 @@ function ShimmeringText({
|
|
|
928
744
|
}) {
|
|
929
745
|
const ref = useRef3(null);
|
|
930
746
|
const isInView = useInView3(ref, { once, margin: inViewMargin });
|
|
931
|
-
const dynamicSpread =
|
|
747
|
+
const dynamicSpread = useMemo2(() => {
|
|
932
748
|
return text.length * spread;
|
|
933
749
|
}, [text, spread]);
|
|
934
750
|
const shouldAnimate = !startOnView || isInView;
|
|
935
|
-
return /* @__PURE__ */
|
|
936
|
-
|
|
751
|
+
return /* @__PURE__ */ jsx7(
|
|
752
|
+
motion6.span,
|
|
937
753
|
{
|
|
938
754
|
ref,
|
|
939
755
|
className: cn(
|
|
@@ -977,9 +793,9 @@ function ShimmeringText({
|
|
|
977
793
|
}
|
|
978
794
|
|
|
979
795
|
// src/ui/animation/sliding-number.tsx
|
|
980
|
-
import { useEffect as useEffect3, useRef as useRef4, useState as
|
|
981
|
-
import { motion as
|
|
982
|
-
import { jsx as
|
|
796
|
+
import { useEffect as useEffect3, useRef as useRef4, useState as useState4 } from "react";
|
|
797
|
+
import { motion as motion7, useInView as useInView4, useSpring as useSpring2, useTransform as useTransform2 } from "motion/react";
|
|
798
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
983
799
|
function Digit({
|
|
984
800
|
place,
|
|
985
801
|
value,
|
|
@@ -987,14 +803,14 @@ function Digit({
|
|
|
987
803
|
duration
|
|
988
804
|
}) {
|
|
989
805
|
const valueRoundedToPlace = Math.floor(value / place);
|
|
990
|
-
const animatedValue =
|
|
806
|
+
const animatedValue = useSpring2(valueRoundedToPlace, {
|
|
991
807
|
duration: duration * 1e3
|
|
992
808
|
// Convert to milliseconds
|
|
993
809
|
});
|
|
994
810
|
useEffect3(() => {
|
|
995
811
|
animatedValue.set(valueRoundedToPlace);
|
|
996
812
|
}, [animatedValue, valueRoundedToPlace]);
|
|
997
|
-
return /* @__PURE__ */
|
|
813
|
+
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)) });
|
|
998
814
|
}
|
|
999
815
|
function MyNumber({
|
|
1000
816
|
mv,
|
|
@@ -1010,7 +826,7 @@ function MyNumber({
|
|
|
1010
826
|
}
|
|
1011
827
|
return memo;
|
|
1012
828
|
});
|
|
1013
|
-
return /* @__PURE__ */
|
|
829
|
+
return /* @__PURE__ */ jsx8(motion7.span, { style: { y }, className: "absolute inset-0 flex items-center justify-center", children: number });
|
|
1014
830
|
}
|
|
1015
831
|
function SlidingNumber({
|
|
1016
832
|
from,
|
|
@@ -1025,9 +841,9 @@ function SlidingNumber({
|
|
|
1025
841
|
}) {
|
|
1026
842
|
const ref = useRef4(null);
|
|
1027
843
|
const isInView = useInView4(ref, { once: false });
|
|
1028
|
-
const [currentValue, setCurrentValue] =
|
|
1029
|
-
const [hasAnimated, setHasAnimated] =
|
|
1030
|
-
const [animationKey, setAnimationKey] =
|
|
844
|
+
const [currentValue, setCurrentValue] = useState4(from);
|
|
845
|
+
const [hasAnimated, setHasAnimated] = useState4(false);
|
|
846
|
+
const [animationKey, setAnimationKey] = useState4(0);
|
|
1031
847
|
useEffect3(() => {
|
|
1032
848
|
setCurrentValue(from);
|
|
1033
849
|
setHasAnimated(false);
|
|
@@ -1075,9 +891,9 @@ function SlidingNumber({
|
|
|
1075
891
|
const absValue = Math.abs(roundedValue);
|
|
1076
892
|
const maxDigits = Math.max(Math.abs(from).toString().length, Math.abs(to).toString().length);
|
|
1077
893
|
const places = Array.from({ length: maxDigits }, (_, i) => 10 ** (maxDigits - i - 1));
|
|
1078
|
-
return /* @__PURE__ */
|
|
894
|
+
return /* @__PURE__ */ jsxs4("div", { ref, className: `flex items-center ${className}`, children: [
|
|
1079
895
|
roundedValue < 0 && "-",
|
|
1080
|
-
places.map((place) => /* @__PURE__ */
|
|
896
|
+
places.map((place) => /* @__PURE__ */ jsx8(
|
|
1081
897
|
Digit,
|
|
1082
898
|
{
|
|
1083
899
|
place,
|
|
@@ -1091,9 +907,9 @@ function SlidingNumber({
|
|
|
1091
907
|
}
|
|
1092
908
|
|
|
1093
909
|
// src/ui/animation/svg-text.tsx
|
|
1094
|
-
import * as
|
|
1095
|
-
import { useEffect as useEffect4, useRef as useRef5, useState as
|
|
1096
|
-
import { jsx as
|
|
910
|
+
import * as React5 from "react";
|
|
911
|
+
import { useEffect as useEffect4, useRef as useRef5, useState as useState5 } from "react";
|
|
912
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1097
913
|
function SvgText({
|
|
1098
914
|
svg,
|
|
1099
915
|
children,
|
|
@@ -1103,9 +919,9 @@ function SvgText({
|
|
|
1103
919
|
as: Component = "div"
|
|
1104
920
|
}) {
|
|
1105
921
|
const textRef = useRef5(null);
|
|
1106
|
-
const [textDimensions, setTextDimensions] =
|
|
1107
|
-
const content =
|
|
1108
|
-
const maskId =
|
|
922
|
+
const [textDimensions, setTextDimensions] = useState5({ width: 0, height: 0 });
|
|
923
|
+
const content = React5.Children.toArray(children).join("");
|
|
924
|
+
const maskId = React5.useId();
|
|
1109
925
|
useEffect4(() => {
|
|
1110
926
|
if (!textRef.current) return;
|
|
1111
927
|
const updateDimensions = () => {
|
|
@@ -1122,8 +938,8 @@ function SvgText({
|
|
|
1122
938
|
resizeObserver.observe(textRef.current);
|
|
1123
939
|
return () => resizeObserver.disconnect();
|
|
1124
940
|
}, []);
|
|
1125
|
-
return /* @__PURE__ */
|
|
1126
|
-
/* @__PURE__ */
|
|
941
|
+
return /* @__PURE__ */ jsxs5(Component, { className: cn("relative inline-block", className), children: [
|
|
942
|
+
/* @__PURE__ */ jsx9(
|
|
1127
943
|
"div",
|
|
1128
944
|
{
|
|
1129
945
|
ref: textRef,
|
|
@@ -1136,7 +952,7 @@ function SvgText({
|
|
|
1136
952
|
children: content
|
|
1137
953
|
}
|
|
1138
954
|
),
|
|
1139
|
-
/* @__PURE__ */
|
|
955
|
+
/* @__PURE__ */ jsxs5(
|
|
1140
956
|
"svg",
|
|
1141
957
|
{
|
|
1142
958
|
className: "block",
|
|
@@ -1149,9 +965,9 @@ function SvgText({
|
|
|
1149
965
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
1150
966
|
},
|
|
1151
967
|
children: [
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ jsx9("defs", { children: /* @__PURE__ */ jsxs5("mask", { id: maskId, children: [
|
|
969
|
+
/* @__PURE__ */ jsx9("rect", { width: "100%", height: "100%", fill: "black" }),
|
|
970
|
+
/* @__PURE__ */ jsx9(
|
|
1155
971
|
"text",
|
|
1156
972
|
{
|
|
1157
973
|
x: "50%",
|
|
@@ -1168,7 +984,7 @@ function SvgText({
|
|
|
1168
984
|
}
|
|
1169
985
|
)
|
|
1170
986
|
] }) }),
|
|
1171
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ jsx9("g", { mask: `url(#${maskId})`, children: /* @__PURE__ */ jsx9(
|
|
1172
988
|
"foreignObject",
|
|
1173
989
|
{
|
|
1174
990
|
width: "100%",
|
|
@@ -1176,7 +992,7 @@ function SvgText({
|
|
|
1176
992
|
style: {
|
|
1177
993
|
overflow: "visible"
|
|
1178
994
|
},
|
|
1179
|
-
children: /* @__PURE__ */
|
|
995
|
+
children: /* @__PURE__ */ jsx9(
|
|
1180
996
|
"div",
|
|
1181
997
|
{
|
|
1182
998
|
style: {
|
|
@@ -1186,7 +1002,7 @@ function SvgText({
|
|
|
1186
1002
|
alignItems: "center",
|
|
1187
1003
|
justifyContent: "center"
|
|
1188
1004
|
},
|
|
1189
|
-
children: /* @__PURE__ */
|
|
1005
|
+
children: /* @__PURE__ */ jsx9(
|
|
1190
1006
|
"div",
|
|
1191
1007
|
{
|
|
1192
1008
|
style: {
|
|
@@ -1205,14 +1021,14 @@ function SvgText({
|
|
|
1205
1021
|
]
|
|
1206
1022
|
}
|
|
1207
1023
|
),
|
|
1208
|
-
/* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ jsx9("span", { className: "sr-only", children: content })
|
|
1209
1025
|
] });
|
|
1210
1026
|
}
|
|
1211
1027
|
|
|
1212
1028
|
// src/ui/animation/text-reveal.tsx
|
|
1213
|
-
import { useEffect as useEffect5, useRef as useRef6, useState as
|
|
1214
|
-
import { motion as
|
|
1215
|
-
import { jsx as
|
|
1029
|
+
import { useEffect as useEffect5, useRef as useRef6, useState as useState6 } from "react";
|
|
1030
|
+
import { motion as motion8, useInView as useInView5 } from "motion/react";
|
|
1031
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1216
1032
|
var containerVariants = {
|
|
1217
1033
|
fade: {
|
|
1218
1034
|
hidden: {},
|
|
@@ -1411,7 +1227,7 @@ function TextReveal({
|
|
|
1411
1227
|
}) {
|
|
1412
1228
|
const ref = useRef6(null);
|
|
1413
1229
|
const isInView = useInView5(ref, { once, margin: "-10%" });
|
|
1414
|
-
const [hasAnimated, setHasAnimated] =
|
|
1230
|
+
const [hasAnimated, setHasAnimated] = useState6(false);
|
|
1415
1231
|
const shouldAnimate = startOnView ? isInView : true;
|
|
1416
1232
|
const elements = wordLevel ? children.split(" ").map((word, i, arr) => i < arr.length - 1 ? `${word} ` : word) : children.split("");
|
|
1417
1233
|
const customContainerVariants = {
|
|
@@ -1439,9 +1255,9 @@ function TextReveal({
|
|
|
1439
1255
|
setHasAnimated(true);
|
|
1440
1256
|
}
|
|
1441
1257
|
}, [shouldAnimate, hasAnimated]);
|
|
1442
|
-
const MotionComponent = variant === "typewriter" ?
|
|
1443
|
-
return /* @__PURE__ */
|
|
1444
|
-
|
|
1258
|
+
const MotionComponent = variant === "typewriter" ? motion8.div : motion8.span;
|
|
1259
|
+
return /* @__PURE__ */ jsx10(
|
|
1260
|
+
motion8.div,
|
|
1445
1261
|
{
|
|
1446
1262
|
ref,
|
|
1447
1263
|
className: cn("inline-block", className),
|
|
@@ -1458,8 +1274,8 @@ function TextReveal({
|
|
|
1458
1274
|
contain: "layout style paint",
|
|
1459
1275
|
...style
|
|
1460
1276
|
},
|
|
1461
|
-
children: variant === "typewriter" ? /* @__PURE__ */
|
|
1462
|
-
|
|
1277
|
+
children: variant === "typewriter" ? /* @__PURE__ */ jsx10(
|
|
1278
|
+
motion8.span,
|
|
1463
1279
|
{
|
|
1464
1280
|
className: "inline-block overflow-hidden whitespace-nowrap",
|
|
1465
1281
|
variants: customItemVariants,
|
|
@@ -1469,7 +1285,7 @@ function TextReveal({
|
|
|
1469
1285
|
},
|
|
1470
1286
|
children
|
|
1471
1287
|
}
|
|
1472
|
-
) : elements.map((element, index) => /* @__PURE__ */
|
|
1288
|
+
) : elements.map((element, index) => /* @__PURE__ */ jsx10(
|
|
1473
1289
|
MotionComponent,
|
|
1474
1290
|
{
|
|
1475
1291
|
className: cn("inline-block", {
|
|
@@ -1495,12 +1311,12 @@ function TextReveal({
|
|
|
1495
1311
|
}
|
|
1496
1312
|
|
|
1497
1313
|
// src/ui/animation/typing-text.tsx
|
|
1498
|
-
import { useEffect as useEffect6, useRef as useRef7, useState as
|
|
1314
|
+
import { useEffect as useEffect6, useRef as useRef7, useState as useState7 } from "react";
|
|
1499
1315
|
import {
|
|
1500
|
-
motion as
|
|
1316
|
+
motion as motion9,
|
|
1501
1317
|
useInView as useInView6
|
|
1502
1318
|
} from "motion/react";
|
|
1503
|
-
import { jsx as
|
|
1319
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1504
1320
|
var cursorVariants = {
|
|
1505
1321
|
blinking: {
|
|
1506
1322
|
opacity: [0, 0, 1, 1],
|
|
@@ -1535,11 +1351,11 @@ function TypingText({
|
|
|
1535
1351
|
once,
|
|
1536
1352
|
margin: inViewMargin
|
|
1537
1353
|
});
|
|
1538
|
-
const [hasAnimated, setHasAnimated] =
|
|
1539
|
-
const [displayText, setDisplayText] =
|
|
1540
|
-
const [currentIndex, setCurrentIndex] =
|
|
1541
|
-
const [isTyping, setIsTyping] =
|
|
1542
|
-
const [currentTextIndex, setCurrentTextIndex] =
|
|
1354
|
+
const [hasAnimated, setHasAnimated] = useState7(false);
|
|
1355
|
+
const [displayText, setDisplayText] = useState7("");
|
|
1356
|
+
const [currentIndex, setCurrentIndex] = useState7(0);
|
|
1357
|
+
const [isTyping, setIsTyping] = useState7(false);
|
|
1358
|
+
const [currentTextIndex, setCurrentTextIndex] = useState7(0);
|
|
1543
1359
|
const shouldStart = !startOnView || isInView && (!once || !hasAnimated);
|
|
1544
1360
|
const textArray = texts && texts.length > 0 ? texts : [text];
|
|
1545
1361
|
const currentText = textArray[currentTextIndex] ?? "";
|
|
@@ -1578,8 +1394,8 @@ function TypingText({
|
|
|
1578
1394
|
exit: { opacity: 0 }
|
|
1579
1395
|
}
|
|
1580
1396
|
};
|
|
1581
|
-
const MotionComponent =
|
|
1582
|
-
return /* @__PURE__ */
|
|
1397
|
+
const MotionComponent = motion9.span;
|
|
1398
|
+
return /* @__PURE__ */ jsx11(
|
|
1583
1399
|
MotionComponent,
|
|
1584
1400
|
{
|
|
1585
1401
|
ref,
|
|
@@ -1591,10 +1407,10 @@ function TypingText({
|
|
|
1591
1407
|
className: cn("whitespace-pre-wrap", className),
|
|
1592
1408
|
viewport: { once },
|
|
1593
1409
|
...props,
|
|
1594
|
-
children: /* @__PURE__ */
|
|
1410
|
+
children: /* @__PURE__ */ jsxs6("span", { style: { display: "inline-flex", alignItems: "center" }, children: [
|
|
1595
1411
|
displayText,
|
|
1596
|
-
showCursor && /* @__PURE__ */
|
|
1597
|
-
|
|
1412
|
+
showCursor && /* @__PURE__ */ jsx11(
|
|
1413
|
+
motion9.span,
|
|
1598
1414
|
{
|
|
1599
1415
|
variants: cursorVariants,
|
|
1600
1416
|
animate: "blinking",
|
|
@@ -1611,9 +1427,9 @@ function TypingText({
|
|
|
1611
1427
|
}
|
|
1612
1428
|
|
|
1613
1429
|
// src/ui/animation/video-text.tsx
|
|
1614
|
-
import * as
|
|
1430
|
+
import * as React6 from "react";
|
|
1615
1431
|
import { useEffect as useEffect7, useRef as useRef8 } from "react";
|
|
1616
|
-
import { jsx as
|
|
1432
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1617
1433
|
function VideoText({
|
|
1618
1434
|
src,
|
|
1619
1435
|
children,
|
|
@@ -1681,14 +1497,14 @@ function VideoText({
|
|
|
1681
1497
|
};
|
|
1682
1498
|
}, [fontSize, fontWeight]);
|
|
1683
1499
|
const sources = Array.isArray(src) ? src : [src];
|
|
1684
|
-
const content =
|
|
1685
|
-
return /* @__PURE__ */
|
|
1500
|
+
const content = React6.Children.toArray(children).join("");
|
|
1501
|
+
return /* @__PURE__ */ jsxs7(
|
|
1686
1502
|
Component,
|
|
1687
1503
|
{
|
|
1688
1504
|
ref: containerRef,
|
|
1689
1505
|
className: cn("relative inline-block overflow-hidden", className),
|
|
1690
1506
|
children: [
|
|
1691
|
-
/* @__PURE__ */
|
|
1507
|
+
/* @__PURE__ */ jsxs7(
|
|
1692
1508
|
"video",
|
|
1693
1509
|
{
|
|
1694
1510
|
ref: videoRef,
|
|
@@ -1703,12 +1519,12 @@ function VideoText({
|
|
|
1703
1519
|
onEnded,
|
|
1704
1520
|
crossOrigin: "anonymous",
|
|
1705
1521
|
children: [
|
|
1706
|
-
sources.map((source, index) => /* @__PURE__ */
|
|
1522
|
+
sources.map((source, index) => /* @__PURE__ */ jsx12("source", { src: source }, index)),
|
|
1707
1523
|
"Your browser does not support the video tag."
|
|
1708
1524
|
]
|
|
1709
1525
|
}
|
|
1710
1526
|
),
|
|
1711
|
-
/* @__PURE__ */
|
|
1527
|
+
/* @__PURE__ */ jsx12(
|
|
1712
1528
|
"canvas",
|
|
1713
1529
|
{
|
|
1714
1530
|
ref: canvasRef,
|
|
@@ -1719,7 +1535,7 @@ function VideoText({
|
|
|
1719
1535
|
}
|
|
1720
1536
|
}
|
|
1721
1537
|
),
|
|
1722
|
-
/* @__PURE__ */
|
|
1538
|
+
/* @__PURE__ */ jsx12(
|
|
1723
1539
|
"div",
|
|
1724
1540
|
{
|
|
1725
1541
|
ref: textRef,
|
|
@@ -1732,19 +1548,19 @@ function VideoText({
|
|
|
1732
1548
|
children
|
|
1733
1549
|
}
|
|
1734
1550
|
),
|
|
1735
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: content })
|
|
1736
1552
|
]
|
|
1737
1553
|
}
|
|
1738
1554
|
);
|
|
1739
1555
|
}
|
|
1740
1556
|
|
|
1741
1557
|
// src/ui/animation/word-rotate.tsx
|
|
1742
|
-
import { useEffect as useEffect8, useRef as useRef9, useState as
|
|
1558
|
+
import { useEffect as useEffect8, useRef as useRef9, useState as useState8 } from "react";
|
|
1743
1559
|
import {
|
|
1744
|
-
motion as
|
|
1560
|
+
motion as motion10,
|
|
1745
1561
|
useInView as useInView7
|
|
1746
1562
|
} from "motion/react";
|
|
1747
|
-
import { jsx as
|
|
1563
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1748
1564
|
function WordRotate({
|
|
1749
1565
|
words,
|
|
1750
1566
|
duration = 1500,
|
|
@@ -1763,9 +1579,9 @@ function WordRotate({
|
|
|
1763
1579
|
once,
|
|
1764
1580
|
margin: inViewMargin
|
|
1765
1581
|
});
|
|
1766
|
-
const [hasAnimated, setHasAnimated] =
|
|
1767
|
-
const [currentWord, setCurrentWord] =
|
|
1768
|
-
const [show, setShow] =
|
|
1582
|
+
const [hasAnimated, setHasAnimated] = useState8(false);
|
|
1583
|
+
const [currentWord, setCurrentWord] = useState8(0);
|
|
1584
|
+
const [show, setShow] = useState8(true);
|
|
1769
1585
|
const variants = {
|
|
1770
1586
|
fade: {
|
|
1771
1587
|
initial: { opacity: 0 },
|
|
@@ -1890,14 +1706,14 @@ function WordRotate({
|
|
|
1890
1706
|
}, duration + pauseDuration);
|
|
1891
1707
|
return () => clearInterval(interval);
|
|
1892
1708
|
}, [shouldStart, duration, pauseDuration, words.length, loop]);
|
|
1893
|
-
return /* @__PURE__ */
|
|
1894
|
-
|
|
1709
|
+
return /* @__PURE__ */ jsx13(
|
|
1710
|
+
motion10.span,
|
|
1895
1711
|
{
|
|
1896
1712
|
ref,
|
|
1897
1713
|
className: cn("inline-block overflow-hidden", containerClassName),
|
|
1898
1714
|
...props,
|
|
1899
|
-
children: /* @__PURE__ */
|
|
1900
|
-
|
|
1715
|
+
children: /* @__PURE__ */ jsx13(
|
|
1716
|
+
motion10.span,
|
|
1901
1717
|
{
|
|
1902
1718
|
initial: "initial",
|
|
1903
1719
|
animate: show ? "animate" : "exit",
|
package/dist/base.cjs
CHANGED
|
@@ -3268,7 +3268,7 @@ function NavigationMenuPositioner({
|
|
|
3268
3268
|
collisionPadding: { top: 5, bottom: 5, left: 20, right: 20 },
|
|
3269
3269
|
collisionAvoidance: { side: "none" },
|
|
3270
3270
|
className: _chunkCJXIPSTGcjs.cn.call(void 0,
|
|
3271
|
-
"box-border h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom] duration-(--duration) ease-(--easing) before:absolute before:content-[''] data-instant:transition-none data-[side=
|
|
3271
|
+
"data-[side=left]:before:-right-2.5 data-side=bottom:before:-top-2.5 data-side=top:before:-bottom-2.5 data-side=right:before:-left-2.5 box-border h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom] duration-(--duration) ease-(--easing) before:absolute before:content-[''] data-instant:transition-none data-[side=left]:before:top-0 data-side=right:before:top-0 data-side=bottom:before:right-0 data-side=top:before:right-0 data-[side=left]:before:bottom-0 data-side=right:before:bottom-0 data-side=bottom:before:left-0 data-side=top:before:left-0 data-side=bottom:before:h-2.5 data-side=top:before:h-2.5 data-[side=left]:before:w-2.5 data-side=right:before:w-2.5",
|
|
3272
3272
|
className
|
|
3273
3273
|
),
|
|
3274
3274
|
style: {
|
|
@@ -3337,7 +3337,7 @@ function NavigationMenuArrow({
|
|
|
3337
3337
|
{
|
|
3338
3338
|
"data-slot": "navigation-menu-arrow",
|
|
3339
3339
|
className: _chunkCJXIPSTGcjs.cn.call(void 0,
|
|
3340
|
-
"data-
|
|
3340
|
+
"data-side=right:-rotate-90 data-side=bottom:-top-2 data-side=top:-bottom-2 flex transition-[left] duration-(--duration) ease-(--easing) data-[side=left]:right-[-13px] data-side=right:left-[-13px] data-[side=left]:rotate-90 data-side=top:rotate-180",
|
|
3341
3341
|
className
|
|
3342
3342
|
),
|
|
3343
3343
|
...props,
|
|
@@ -3774,7 +3774,7 @@ function PopoverArrow({
|
|
|
3774
3774
|
{
|
|
3775
3775
|
"data-slot": "popover-arrow",
|
|
3776
3776
|
className: _chunkCJXIPSTGcjs.cn.call(void 0,
|
|
3777
|
-
"data-[side=right]:-rotate-90
|
|
3777
|
+
"data-[side=right]:-rotate-90 data-[side=bottom]:-top-2 data-[side=top]:-bottom-2 z-50 data-[side=left]:right-[-13px] data-[side=right]:left-[-13px] data-[side=left]:rotate-90 data-[side=top]:rotate-180",
|
|
3778
3778
|
className
|
|
3779
3779
|
),
|
|
3780
3780
|
...props,
|
|
@@ -3844,7 +3844,7 @@ function PreviewCardArrow({
|
|
|
3844
3844
|
_react2.PreviewCard.Arrow,
|
|
3845
3845
|
{
|
|
3846
3846
|
className: _chunkCJXIPSTGcjs.cn.call(void 0,
|
|
3847
|
-
"data-[side=right]:-rotate-90 data-[side=bottom]
|
|
3847
|
+
"data-[side=right]:-rotate-90 data-[side=bottom]:-top-2 data-[side=top]:-bottom-2 data-[side=left]:right-[-13px] data-[side=right]:left-[-13px] data-[side=left]:rotate-90 data-[side=top]:rotate-180",
|
|
3848
3848
|
className
|
|
3849
3849
|
),
|
|
3850
3850
|
...props,
|
|
@@ -4531,7 +4531,7 @@ function TooltipArrow({ className, variant, ...props }) {
|
|
|
4531
4531
|
{
|
|
4532
4532
|
"data-slot": "tooltip-arrow",
|
|
4533
4533
|
className: _chunkCJXIPSTGcjs.cn.call(void 0,
|
|
4534
|
-
"data-[side=right]:-rotate-90
|
|
4534
|
+
"data-[side=right]:-rotate-90 data-[side=bottom]:-top-2 data-[side=top]:-bottom-2 z-50 data-[side=left]:right-[-13px] data-[side=right]:left-[-13px] data-[side=left]:rotate-90 data-[side=top]:rotate-180",
|
|
4535
4535
|
className
|
|
4536
4536
|
),
|
|
4537
4537
|
...props,
|