@moontra/moonui 2.4.4 → 2.4.6
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/README.md +73 -51
- package/dist/index.d.mts +81 -3
- package/dist/index.d.ts +81 -3
- package/dist/index.global.js +29 -29
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +103 -102
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +104 -103
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/scroll-reveal.tsx +201 -112
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import { cva } from 'class-variance-authority';
|
|
12
12
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
13
|
-
import { motion, AnimatePresence, useMotionValue, useTransform,
|
|
13
|
+
import { motion, AnimatePresence, useMotionValue, useTransform, animate } from 'framer-motion';
|
|
14
14
|
import { format, isSameMonth, isToday, isValid, subMonths, addMonths, isSameDay, startOfMonth, endOfMonth, eachDayOfInterval, getDay, startOfWeek, endOfWeek } from 'date-fns';
|
|
15
15
|
export { format } from 'date-fns';
|
|
16
16
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
@@ -10814,88 +10814,85 @@ var ScrollBar = t.forwardRef(({ className, orientation = "vertical", ...props },
|
|
|
10814
10814
|
}
|
|
10815
10815
|
));
|
|
10816
10816
|
ScrollBar.displayName = ScrollAreaScrollbar.displayName;
|
|
10817
|
-
var
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10817
|
+
var createDefaultVariants = (direction, distance) => {
|
|
10818
|
+
const baseVariants = {
|
|
10819
|
+
up: {
|
|
10820
|
+
hidden: { opacity: 0, y: distance },
|
|
10821
|
+
visible: { opacity: 1, y: 0 }
|
|
10822
|
+
},
|
|
10823
|
+
down: {
|
|
10824
|
+
hidden: { opacity: 0, y: -distance },
|
|
10825
|
+
visible: { opacity: 1, y: 0 }
|
|
10826
|
+
},
|
|
10827
|
+
left: {
|
|
10828
|
+
hidden: { opacity: 0, x: distance },
|
|
10829
|
+
visible: { opacity: 1, x: 0 }
|
|
10830
|
+
},
|
|
10831
|
+
right: {
|
|
10832
|
+
hidden: { opacity: 0, x: -distance },
|
|
10833
|
+
visible: { opacity: 1, x: 0 }
|
|
10834
|
+
},
|
|
10835
|
+
fade: {
|
|
10836
|
+
hidden: { opacity: 0 },
|
|
10837
|
+
visible: { opacity: 1 }
|
|
10838
|
+
},
|
|
10839
|
+
scale: {
|
|
10840
|
+
hidden: { opacity: 0, scale: 0.85 },
|
|
10841
|
+
visible: { opacity: 1, scale: 1 }
|
|
10842
|
+
},
|
|
10843
|
+
blur: {
|
|
10844
|
+
hidden: { opacity: 0, filter: "blur(10px)" },
|
|
10845
|
+
visible: { opacity: 1, filter: "blur(0px)" }
|
|
10846
|
+
}
|
|
10847
|
+
};
|
|
10848
|
+
return baseVariants[direction] || baseVariants.up;
|
|
10849
|
+
};
|
|
10850
|
+
var defaultTransition = {
|
|
10851
|
+
duration: 0.5,
|
|
10852
|
+
ease: [0.25, 0.46, 0.45, 0.94]
|
|
10853
|
+
// Custom cubic-bezier for smooth motion
|
|
10846
10854
|
};
|
|
10847
10855
|
var ScrollReveal = t.forwardRef(
|
|
10848
10856
|
({
|
|
10849
10857
|
children,
|
|
10850
10858
|
direction = "up",
|
|
10851
10859
|
delay = 0,
|
|
10852
|
-
duration = 0.
|
|
10860
|
+
duration = 0.5,
|
|
10853
10861
|
distance = 50,
|
|
10854
|
-
threshold = 0.
|
|
10855
|
-
|
|
10862
|
+
threshold = 0.3,
|
|
10863
|
+
// Increased from 0.1 for better visibility
|
|
10864
|
+
once = true,
|
|
10865
|
+
triggerOnce,
|
|
10866
|
+
// Backward compatibility
|
|
10856
10867
|
stagger = 0,
|
|
10857
10868
|
className,
|
|
10858
10869
|
variants,
|
|
10859
10870
|
animate: animate2 = true,
|
|
10860
10871
|
style,
|
|
10861
|
-
id
|
|
10872
|
+
id,
|
|
10873
|
+
viewport
|
|
10862
10874
|
}, ref) => {
|
|
10863
|
-
const
|
|
10864
|
-
const
|
|
10865
|
-
const isInView = useInView(elementRef, {
|
|
10866
|
-
amount: threshold,
|
|
10867
|
-
once: triggerOnce
|
|
10868
|
-
});
|
|
10869
|
-
const customVariants = t.useMemo(() => {
|
|
10875
|
+
const shouldTriggerOnce = triggerOnce !== void 0 ? triggerOnce : once;
|
|
10876
|
+
const animationVariants = t.useMemo(() => {
|
|
10870
10877
|
if (variants)
|
|
10871
10878
|
return variants;
|
|
10872
|
-
|
|
10873
|
-
return {
|
|
10874
|
-
hidden: {
|
|
10875
|
-
...baseVariants.hidden,
|
|
10876
|
-
...direction === "up" && { y: distance },
|
|
10877
|
-
...direction === "down" && { y: -distance },
|
|
10878
|
-
...direction === "left" && { x: distance },
|
|
10879
|
-
...direction === "right" && { x: -distance }
|
|
10880
|
-
},
|
|
10881
|
-
visible: baseVariants.visible
|
|
10882
|
-
};
|
|
10879
|
+
return createDefaultVariants(direction, distance);
|
|
10883
10880
|
}, [direction, distance, variants]);
|
|
10884
|
-
t.
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10881
|
+
const transition = t.useMemo(() => ({
|
|
10882
|
+
...defaultTransition,
|
|
10883
|
+
duration,
|
|
10884
|
+
delay: delay + stagger
|
|
10885
|
+
}), [duration, delay, stagger]);
|
|
10886
|
+
const viewportConfig = t.useMemo(() => ({
|
|
10887
|
+
once: shouldTriggerOnce,
|
|
10888
|
+
amount: threshold,
|
|
10889
|
+
...viewport
|
|
10890
|
+
}), [shouldTriggerOnce, threshold, viewport]);
|
|
10894
10891
|
if (!animate2) {
|
|
10895
10892
|
return /* @__PURE__ */ jsx(
|
|
10896
10893
|
"div",
|
|
10897
10894
|
{
|
|
10898
|
-
ref
|
|
10895
|
+
ref,
|
|
10899
10896
|
className,
|
|
10900
10897
|
style,
|
|
10901
10898
|
id,
|
|
@@ -10906,15 +10903,12 @@ var ScrollReveal = t.forwardRef(
|
|
|
10906
10903
|
return /* @__PURE__ */ jsx(
|
|
10907
10904
|
motion.div,
|
|
10908
10905
|
{
|
|
10909
|
-
ref
|
|
10910
|
-
variants: customVariants,
|
|
10906
|
+
ref,
|
|
10911
10907
|
initial: "hidden",
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
ease: "easeOut"
|
|
10917
|
-
},
|
|
10908
|
+
whileInView: "visible",
|
|
10909
|
+
viewport: viewportConfig,
|
|
10910
|
+
variants: animationVariants,
|
|
10911
|
+
transition,
|
|
10918
10912
|
className: cn(className),
|
|
10919
10913
|
style,
|
|
10920
10914
|
id,
|
|
@@ -10925,24 +10919,40 @@ var ScrollReveal = t.forwardRef(
|
|
|
10925
10919
|
);
|
|
10926
10920
|
ScrollReveal.displayName = "ScrollReveal";
|
|
10927
10921
|
var ScrollRevealContainer = t.forwardRef(
|
|
10928
|
-
({
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
10922
|
+
({
|
|
10923
|
+
children,
|
|
10924
|
+
stagger = 0.1,
|
|
10925
|
+
className,
|
|
10926
|
+
style,
|
|
10927
|
+
id,
|
|
10928
|
+
threshold = 0.3,
|
|
10929
|
+
once = true,
|
|
10930
|
+
triggerOnce,
|
|
10931
|
+
viewport
|
|
10932
|
+
}, ref) => {
|
|
10933
|
+
const shouldTriggerOnce = triggerOnce !== void 0 ? triggerOnce : once;
|
|
10934
|
+
const viewportConfig = t.useMemo(() => ({
|
|
10935
|
+
once: shouldTriggerOnce,
|
|
10936
|
+
amount: threshold,
|
|
10937
|
+
...viewport
|
|
10938
|
+
}), [shouldTriggerOnce, threshold, viewport]);
|
|
10939
|
+
const containerVariants = {
|
|
10940
|
+
hidden: {},
|
|
10941
|
+
visible: {
|
|
10942
|
+
transition: {
|
|
10943
|
+
staggerChildren: stagger,
|
|
10944
|
+
delayChildren: 0
|
|
10945
|
+
}
|
|
10946
|
+
}
|
|
10947
|
+
};
|
|
10932
10948
|
return /* @__PURE__ */ jsx(
|
|
10933
10949
|
motion.div,
|
|
10934
10950
|
{
|
|
10935
|
-
ref
|
|
10951
|
+
ref,
|
|
10936
10952
|
initial: "hidden",
|
|
10937
|
-
|
|
10938
|
-
|
|
10939
|
-
|
|
10940
|
-
visible: {
|
|
10941
|
-
transition: {
|
|
10942
|
-
staggerChildren: stagger
|
|
10943
|
-
}
|
|
10944
|
-
}
|
|
10945
|
-
},
|
|
10953
|
+
whileInView: "visible",
|
|
10954
|
+
viewport: viewportConfig,
|
|
10955
|
+
variants: containerVariants,
|
|
10946
10956
|
className: cn(className),
|
|
10947
10957
|
style,
|
|
10948
10958
|
id,
|
|
@@ -10956,37 +10966,28 @@ var ScrollRevealItem = t.forwardRef(
|
|
|
10956
10966
|
({
|
|
10957
10967
|
children,
|
|
10958
10968
|
direction = "up",
|
|
10959
|
-
duration = 0.
|
|
10969
|
+
duration = 0.5,
|
|
10960
10970
|
distance = 50,
|
|
10961
10971
|
className,
|
|
10962
10972
|
variants,
|
|
10963
10973
|
style,
|
|
10964
10974
|
id
|
|
10965
10975
|
}, ref) => {
|
|
10966
|
-
const
|
|
10976
|
+
const animationVariants = t.useMemo(() => {
|
|
10967
10977
|
if (variants)
|
|
10968
10978
|
return variants;
|
|
10969
|
-
|
|
10970
|
-
return {
|
|
10971
|
-
hidden: {
|
|
10972
|
-
...baseVariants.hidden,
|
|
10973
|
-
...direction === "up" && { y: distance },
|
|
10974
|
-
...direction === "down" && { y: -distance },
|
|
10975
|
-
...direction === "left" && { x: distance },
|
|
10976
|
-
...direction === "right" && { x: -distance }
|
|
10977
|
-
},
|
|
10978
|
-
visible: baseVariants.visible
|
|
10979
|
-
};
|
|
10979
|
+
return createDefaultVariants(direction, distance);
|
|
10980
10980
|
}, [direction, distance, variants]);
|
|
10981
|
+
const transition = t.useMemo(() => ({
|
|
10982
|
+
...defaultTransition,
|
|
10983
|
+
duration
|
|
10984
|
+
}), [duration]);
|
|
10981
10985
|
return /* @__PURE__ */ jsx(
|
|
10982
10986
|
motion.div,
|
|
10983
10987
|
{
|
|
10984
10988
|
ref,
|
|
10985
|
-
variants:
|
|
10986
|
-
transition
|
|
10987
|
-
duration,
|
|
10988
|
-
ease: "easeOut"
|
|
10989
|
-
},
|
|
10989
|
+
variants: animationVariants,
|
|
10990
|
+
transition,
|
|
10990
10991
|
className: cn(className),
|
|
10991
10992
|
style,
|
|
10992
10993
|
id,
|