@moontra/moonui-pro 3.4.36 → 3.4.38
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/cdn/index.global.js +189 -189
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.d.ts +32 -0
- package/dist/index.mjs +290 -58
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -16519,6 +16519,12 @@ var MoonUIAnimatedButtonProInternal = React71__default.forwardRef(
|
|
|
16519
16519
|
const handleClick2 = async (e) => {
|
|
16520
16520
|
if (currentState === "loading")
|
|
16521
16521
|
return;
|
|
16522
|
+
if (props.type === "submit" && !onClick) {
|
|
16523
|
+
return;
|
|
16524
|
+
}
|
|
16525
|
+
if (onClick) {
|
|
16526
|
+
e.preventDefault();
|
|
16527
|
+
}
|
|
16522
16528
|
if (ripple) {
|
|
16523
16529
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
16524
16530
|
const x = e.clientX - rect.left;
|
|
@@ -86988,18 +86994,19 @@ var GridPatternInternal = ({
|
|
|
86988
86994
|
squares = [],
|
|
86989
86995
|
strokeDasharray = "0",
|
|
86990
86996
|
className,
|
|
86991
|
-
strokeColor
|
|
86992
|
-
|
|
86997
|
+
strokeColor,
|
|
86998
|
+
darkStrokeColor,
|
|
86993
86999
|
strokeWidth = 1,
|
|
86994
|
-
maxOpacity
|
|
87000
|
+
maxOpacity,
|
|
87001
|
+
darkMaxOpacity,
|
|
86995
87002
|
duration = 4e3,
|
|
86996
87003
|
repeatDelay = 0,
|
|
86997
87004
|
variant = "lines",
|
|
86998
87005
|
gradient = false,
|
|
86999
|
-
gradientFrom
|
|
87000
|
-
|
|
87001
|
-
gradientTo
|
|
87002
|
-
|
|
87006
|
+
gradientFrom,
|
|
87007
|
+
darkGradientFrom,
|
|
87008
|
+
gradientTo,
|
|
87009
|
+
darkGradientTo,
|
|
87003
87010
|
gradientDirection = "diagonal",
|
|
87004
87011
|
animationType = "fade",
|
|
87005
87012
|
blur: blur2 = false,
|
|
@@ -87011,12 +87018,65 @@ var GridPatternInternal = ({
|
|
|
87011
87018
|
size: size4,
|
|
87012
87019
|
performance: performance2 = "balanced"
|
|
87013
87020
|
}) => {
|
|
87021
|
+
const { theme } = useTheme();
|
|
87014
87022
|
const uniqueId = useId();
|
|
87015
87023
|
const patternId = `grid-pattern-${uniqueId}`;
|
|
87016
87024
|
const gradientId = `grid-gradient-${uniqueId}`;
|
|
87017
87025
|
const maskId = `grid-mask-${uniqueId}`;
|
|
87018
87026
|
const noiseId = `grid-noise-${uniqueId}`;
|
|
87019
87027
|
const containerRef = useRef(null);
|
|
87028
|
+
const defaultStrokeColor = useMemo(() => {
|
|
87029
|
+
if (theme === "dark") {
|
|
87030
|
+
if (darkStrokeColor)
|
|
87031
|
+
return darkStrokeColor;
|
|
87032
|
+
if (strokeColor)
|
|
87033
|
+
return strokeColor;
|
|
87034
|
+
return "rgb(156 163 175 / 0.3)";
|
|
87035
|
+
} else {
|
|
87036
|
+
if (strokeColor)
|
|
87037
|
+
return strokeColor;
|
|
87038
|
+
return "rgb(156 163 175 / 0.15)";
|
|
87039
|
+
}
|
|
87040
|
+
}, [theme, strokeColor, darkStrokeColor]);
|
|
87041
|
+
const defaultMaxOpacity = useMemo(() => {
|
|
87042
|
+
if (theme === "dark") {
|
|
87043
|
+
if (darkMaxOpacity !== void 0)
|
|
87044
|
+
return darkMaxOpacity;
|
|
87045
|
+
if (maxOpacity !== void 0)
|
|
87046
|
+
return maxOpacity;
|
|
87047
|
+
return 0.5;
|
|
87048
|
+
} else {
|
|
87049
|
+
if (maxOpacity !== void 0)
|
|
87050
|
+
return maxOpacity;
|
|
87051
|
+
return 0.3;
|
|
87052
|
+
}
|
|
87053
|
+
}, [theme, maxOpacity, darkMaxOpacity]);
|
|
87054
|
+
const defaultGradientFrom = useMemo(() => {
|
|
87055
|
+
if (theme === "dark") {
|
|
87056
|
+
if (darkGradientFrom)
|
|
87057
|
+
return darkGradientFrom;
|
|
87058
|
+
if (gradientFrom)
|
|
87059
|
+
return gradientFrom;
|
|
87060
|
+
return "rgb(139 92 246)";
|
|
87061
|
+
} else {
|
|
87062
|
+
if (gradientFrom)
|
|
87063
|
+
return gradientFrom;
|
|
87064
|
+
return "rgb(168 85 247)";
|
|
87065
|
+
}
|
|
87066
|
+
}, [theme, gradientFrom, darkGradientFrom]);
|
|
87067
|
+
const defaultGradientTo = useMemo(() => {
|
|
87068
|
+
if (theme === "dark") {
|
|
87069
|
+
if (darkGradientTo)
|
|
87070
|
+
return darkGradientTo;
|
|
87071
|
+
if (gradientTo)
|
|
87072
|
+
return gradientTo;
|
|
87073
|
+
return "rgb(59 130 246)";
|
|
87074
|
+
} else {
|
|
87075
|
+
if (gradientTo)
|
|
87076
|
+
return gradientTo;
|
|
87077
|
+
return "rgb(96 165 250)";
|
|
87078
|
+
}
|
|
87079
|
+
}, [theme, gradientTo, darkGradientTo]);
|
|
87020
87080
|
useEffect(() => {
|
|
87021
87081
|
if (!parallax || !containerRef.current)
|
|
87022
87082
|
return;
|
|
@@ -87045,23 +87105,23 @@ var GridPatternInternal = ({
|
|
|
87045
87105
|
switch (gradientDirection) {
|
|
87046
87106
|
case "horizontal":
|
|
87047
87107
|
return /* @__PURE__ */ jsxs("linearGradient", { ...gradientProps, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
|
|
87048
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor:
|
|
87049
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor:
|
|
87108
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: defaultGradientFrom }),
|
|
87109
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: defaultGradientTo })
|
|
87050
87110
|
] });
|
|
87051
87111
|
case "vertical":
|
|
87052
87112
|
return /* @__PURE__ */ jsxs("linearGradient", { ...gradientProps, x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
|
|
87053
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor:
|
|
87054
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor:
|
|
87113
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: defaultGradientFrom }),
|
|
87114
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: defaultGradientTo })
|
|
87055
87115
|
] });
|
|
87056
87116
|
case "radial":
|
|
87057
87117
|
return /* @__PURE__ */ jsxs("radialGradient", { ...gradientProps, cx: "50%", cy: "50%", r: "50%", children: [
|
|
87058
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor:
|
|
87059
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor:
|
|
87118
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: defaultGradientFrom }),
|
|
87119
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: defaultGradientTo })
|
|
87060
87120
|
] });
|
|
87061
87121
|
default:
|
|
87062
87122
|
return /* @__PURE__ */ jsxs("linearGradient", { ...gradientProps, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
|
|
87063
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor:
|
|
87064
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor:
|
|
87123
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: defaultGradientFrom }),
|
|
87124
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: defaultGradientTo })
|
|
87065
87125
|
] });
|
|
87066
87126
|
}
|
|
87067
87127
|
};
|
|
@@ -87105,7 +87165,7 @@ var GridPatternInternal = ({
|
|
|
87105
87165
|
};
|
|
87106
87166
|
const renderPattern = () => {
|
|
87107
87167
|
const baseProps = {
|
|
87108
|
-
stroke: gradient ? `url(#${gradientId})` :
|
|
87168
|
+
stroke: gradient ? `url(#${gradientId})` : defaultStrokeColor,
|
|
87109
87169
|
strokeWidth,
|
|
87110
87170
|
strokeDasharray,
|
|
87111
87171
|
fill: "none"
|
|
@@ -87118,7 +87178,7 @@ var GridPatternInternal = ({
|
|
|
87118
87178
|
cx: width / 2,
|
|
87119
87179
|
cy: height / 2,
|
|
87120
87180
|
r: Math.max(strokeWidth, 1),
|
|
87121
|
-
fill: gradient ? `url(#${gradientId})` :
|
|
87181
|
+
fill: gradient ? `url(#${gradientId})` : defaultStrokeColor,
|
|
87122
87182
|
strokeWidth: 0
|
|
87123
87183
|
}
|
|
87124
87184
|
);
|
|
@@ -87234,8 +87294,8 @@ var GridPatternInternal = ({
|
|
|
87234
87294
|
y: squareY * height + y,
|
|
87235
87295
|
width,
|
|
87236
87296
|
height,
|
|
87237
|
-
fill: gradient ? `url(#${gradientId})` :
|
|
87238
|
-
opacity:
|
|
87297
|
+
fill: gradient ? `url(#${gradientId})` : defaultStrokeColor,
|
|
87298
|
+
opacity: defaultMaxOpacity,
|
|
87239
87299
|
style: {
|
|
87240
87300
|
animation: animationType === "fade" ? `grid-square-fade ${duration}ms ease-in-out infinite ${index2 * 100}ms` : void 0
|
|
87241
87301
|
}
|
|
@@ -87248,7 +87308,7 @@ var GridPatternInternal = ({
|
|
|
87248
87308
|
animationType === "fade" && squares.length > 0 && /* @__PURE__ */ jsx("style", { children: `
|
|
87249
87309
|
@keyframes grid-square-fade {
|
|
87250
87310
|
0%, 20% { opacity: 0; }
|
|
87251
|
-
50% { opacity: ${
|
|
87311
|
+
50% { opacity: ${defaultMaxOpacity}; }
|
|
87252
87312
|
80%, 100% { opacity: 0; }
|
|
87253
87313
|
}
|
|
87254
87314
|
` }),
|
|
@@ -87827,20 +87887,23 @@ var ParticlesInternal = ({
|
|
|
87827
87887
|
className,
|
|
87828
87888
|
count: count3 = 50,
|
|
87829
87889
|
size: size4 = { min: 1, max: 3 },
|
|
87830
|
-
colors
|
|
87890
|
+
colors,
|
|
87891
|
+
darkColors,
|
|
87831
87892
|
speed = 0.5,
|
|
87832
87893
|
interactive = true,
|
|
87833
87894
|
mouseRadius = 100,
|
|
87834
87895
|
connectDistance = 100,
|
|
87835
87896
|
showConnections = true,
|
|
87836
87897
|
lineWidth = 0.5,
|
|
87837
|
-
lineOpacity
|
|
87898
|
+
lineOpacity,
|
|
87899
|
+
darkLineOpacity,
|
|
87838
87900
|
shape = "circle",
|
|
87839
87901
|
parallax = false,
|
|
87840
87902
|
parallaxFactor = 0.5,
|
|
87841
87903
|
fps = 60,
|
|
87842
87904
|
performanceMode = false,
|
|
87843
|
-
backgroundColor
|
|
87905
|
+
backgroundColor,
|
|
87906
|
+
darkBackgroundColor,
|
|
87844
87907
|
blur: blur2 = 0,
|
|
87845
87908
|
containerClassName,
|
|
87846
87909
|
glow = true,
|
|
@@ -87851,6 +87914,7 @@ var ParticlesInternal = ({
|
|
|
87851
87914
|
opacity = { min: 0.3, max: 1 },
|
|
87852
87915
|
pauseWhenHidden = false
|
|
87853
87916
|
}) => {
|
|
87917
|
+
const { theme } = useTheme();
|
|
87854
87918
|
const canvasRef = useRef(null);
|
|
87855
87919
|
const containerRef = useRef(null);
|
|
87856
87920
|
const animationRef = useRef(void 0);
|
|
@@ -87860,6 +87924,45 @@ var ParticlesInternal = ({
|
|
|
87860
87924
|
const frameInterval = 1e3 / fps;
|
|
87861
87925
|
const [isVisible, setIsVisible] = useState(true);
|
|
87862
87926
|
const observerTimeoutRef = useRef(null);
|
|
87927
|
+
const defaultColors2 = useMemo(() => {
|
|
87928
|
+
if (theme === "dark") {
|
|
87929
|
+
if (darkColors)
|
|
87930
|
+
return darkColors;
|
|
87931
|
+
if (colors)
|
|
87932
|
+
return colors;
|
|
87933
|
+
return ["#8b5cf6", "#ec4899", "#3b82f6", "#10b981"];
|
|
87934
|
+
} else {
|
|
87935
|
+
if (colors)
|
|
87936
|
+
return colors;
|
|
87937
|
+
return ["#a855f7", "#f472b6", "#60a5fa", "#34d399"];
|
|
87938
|
+
}
|
|
87939
|
+
}, [theme, colors, darkColors]);
|
|
87940
|
+
const defaultBg = useMemo(() => {
|
|
87941
|
+
if (theme === "dark") {
|
|
87942
|
+
if (darkBackgroundColor)
|
|
87943
|
+
return darkBackgroundColor;
|
|
87944
|
+
if (backgroundColor)
|
|
87945
|
+
return backgroundColor;
|
|
87946
|
+
return "transparent";
|
|
87947
|
+
} else {
|
|
87948
|
+
if (backgroundColor)
|
|
87949
|
+
return backgroundColor;
|
|
87950
|
+
return "transparent";
|
|
87951
|
+
}
|
|
87952
|
+
}, [theme, backgroundColor, darkBackgroundColor]);
|
|
87953
|
+
const defaultLineOpacity = useMemo(() => {
|
|
87954
|
+
if (theme === "dark") {
|
|
87955
|
+
if (darkLineOpacity !== void 0)
|
|
87956
|
+
return darkLineOpacity;
|
|
87957
|
+
if (lineOpacity !== void 0)
|
|
87958
|
+
return lineOpacity;
|
|
87959
|
+
return 0.4;
|
|
87960
|
+
} else {
|
|
87961
|
+
if (lineOpacity !== void 0)
|
|
87962
|
+
return lineOpacity;
|
|
87963
|
+
return 0.2;
|
|
87964
|
+
}
|
|
87965
|
+
}, [theme, lineOpacity, darkLineOpacity]);
|
|
87863
87966
|
const drawParticle = useCallback((ctx, particle) => {
|
|
87864
87967
|
ctx.save();
|
|
87865
87968
|
ctx.translate(particle.x, particle.y);
|
|
@@ -87988,7 +88091,7 @@ var ParticlesInternal = ({
|
|
|
87988
88091
|
const dy = particles[i].y - particles[j].y;
|
|
87989
88092
|
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
87990
88093
|
if (distance < connectDistance) {
|
|
87991
|
-
const opacity2 = (1 - distance / connectDistance) *
|
|
88094
|
+
const opacity2 = (1 - distance / connectDistance) * defaultLineOpacity;
|
|
87992
88095
|
ctx.strokeStyle = `rgba(255, 255, 255, ${opacity2})`;
|
|
87993
88096
|
ctx.lineWidth = lineWidth;
|
|
87994
88097
|
ctx.beginPath();
|
|
@@ -87998,7 +88101,7 @@ var ParticlesInternal = ({
|
|
|
87998
88101
|
}
|
|
87999
88102
|
}
|
|
88000
88103
|
}
|
|
88001
|
-
}, [connectDistance,
|
|
88104
|
+
}, [connectDistance, defaultLineOpacity, lineWidth]);
|
|
88002
88105
|
const animate4 = useCallback((currentTime) => {
|
|
88003
88106
|
const canvas = canvasRef.current;
|
|
88004
88107
|
const ctx = canvas?.getContext("2d", {
|
|
@@ -88045,7 +88148,7 @@ var ParticlesInternal = ({
|
|
|
88045
88148
|
vx: (Math.random() - 0.5) * speed,
|
|
88046
88149
|
vy: (Math.random() - 0.5) * speed,
|
|
88047
88150
|
size: Math.random() * (size4.max - size4.min) + size4.min,
|
|
88048
|
-
color:
|
|
88151
|
+
color: defaultColors2[Math.floor(Math.random() * defaultColors2.length)],
|
|
88049
88152
|
opacity: Math.random() * (opacity.max - opacity.min) + opacity.min,
|
|
88050
88153
|
angle: Math.random() * Math.PI * 2,
|
|
88051
88154
|
rotationSpeed: (Math.random() - 0.5) * 0.02,
|
|
@@ -88055,7 +88158,7 @@ var ParticlesInternal = ({
|
|
|
88055
88158
|
newParticles.push(particle);
|
|
88056
88159
|
}
|
|
88057
88160
|
particlesRef.current = newParticles;
|
|
88058
|
-
}, [count3, size4,
|
|
88161
|
+
}, [count3, size4, defaultColors2, speed, opacity]);
|
|
88059
88162
|
const handleMouseMove2 = useCallback((e) => {
|
|
88060
88163
|
const canvas = canvasRef.current;
|
|
88061
88164
|
if (!canvas)
|
|
@@ -88111,7 +88214,7 @@ var ParticlesInternal = ({
|
|
|
88111
88214
|
vx: (Math.random() - 0.5) * speed,
|
|
88112
88215
|
vy: (Math.random() - 0.5) * speed,
|
|
88113
88216
|
size: Math.random() * (size4.max - size4.min) + size4.min,
|
|
88114
|
-
color:
|
|
88217
|
+
color: defaultColors2[Math.floor(Math.random() * defaultColors2.length)],
|
|
88115
88218
|
opacity: Math.random() * (opacity.max - opacity.min) + opacity.min,
|
|
88116
88219
|
angle: Math.random() * Math.PI * 2,
|
|
88117
88220
|
rotationSpeed: (Math.random() - 0.5) * 0.02,
|
|
@@ -88134,7 +88237,7 @@ var ParticlesInternal = ({
|
|
|
88134
88237
|
cancelAnimationFrame(animationRef.current);
|
|
88135
88238
|
}
|
|
88136
88239
|
};
|
|
88137
|
-
}, [handleResize, handleMouseMove2, animate4, interactive, count3, size4,
|
|
88240
|
+
}, [handleResize, handleMouseMove2, animate4, interactive, count3, size4, defaultColors2, speed, opacity]);
|
|
88138
88241
|
const canvasStyle = useMemo(() => ({
|
|
88139
88242
|
willChange: "transform",
|
|
88140
88243
|
transform: "translate3d(0, 0, 0)",
|
|
@@ -88151,7 +88254,7 @@ var ParticlesInternal = ({
|
|
|
88151
88254
|
containerClassName
|
|
88152
88255
|
),
|
|
88153
88256
|
style: {
|
|
88154
|
-
backgroundColor
|
|
88257
|
+
backgroundColor: defaultBg
|
|
88155
88258
|
},
|
|
88156
88259
|
children: [
|
|
88157
88260
|
/* @__PURE__ */ jsx(
|
|
@@ -88190,9 +88293,11 @@ var StarfieldInternal = ({
|
|
|
88190
88293
|
className,
|
|
88191
88294
|
fullWidth = false,
|
|
88192
88295
|
starCount = 500,
|
|
88193
|
-
starColor
|
|
88296
|
+
starColor,
|
|
88297
|
+
darkStarColor,
|
|
88194
88298
|
speed = 1,
|
|
88195
|
-
backgroundColor
|
|
88299
|
+
backgroundColor,
|
|
88300
|
+
darkBackgroundColor,
|
|
88196
88301
|
mouseParallax = true,
|
|
88197
88302
|
parallaxIntensity = 0.5,
|
|
88198
88303
|
starSize = { min: 0.5, max: 2 },
|
|
@@ -88209,10 +88314,12 @@ var StarfieldInternal = ({
|
|
|
88209
88314
|
trails = false,
|
|
88210
88315
|
trailLength = 5,
|
|
88211
88316
|
nebula = false,
|
|
88212
|
-
nebulaColors
|
|
88317
|
+
nebulaColors,
|
|
88318
|
+
darkNebulaColors,
|
|
88213
88319
|
direction = "forward",
|
|
88214
88320
|
spiralSpeed = 1e-3
|
|
88215
88321
|
}) => {
|
|
88322
|
+
const { theme } = useTheme();
|
|
88216
88323
|
const canvasRef = useRef(null);
|
|
88217
88324
|
const animationRef = useRef(void 0);
|
|
88218
88325
|
const starsRef = useRef([]);
|
|
@@ -88228,7 +88335,46 @@ var StarfieldInternal = ({
|
|
|
88228
88335
|
const [isVisible, setIsVisible] = useState(true);
|
|
88229
88336
|
const observerTimeoutRef = useRef(null);
|
|
88230
88337
|
const containerRef = useRef(null);
|
|
88231
|
-
const
|
|
88338
|
+
const defaultStarColor = useMemo(() => {
|
|
88339
|
+
if (theme === "dark") {
|
|
88340
|
+
if (darkStarColor)
|
|
88341
|
+
return darkStarColor;
|
|
88342
|
+
if (starColor)
|
|
88343
|
+
return starColor;
|
|
88344
|
+
return "#ffffff";
|
|
88345
|
+
} else {
|
|
88346
|
+
if (starColor)
|
|
88347
|
+
return starColor;
|
|
88348
|
+
return "#1f2937";
|
|
88349
|
+
}
|
|
88350
|
+
}, [theme, starColor, darkStarColor]);
|
|
88351
|
+
const defaultBg = useMemo(() => {
|
|
88352
|
+
if (theme === "dark") {
|
|
88353
|
+
if (darkBackgroundColor)
|
|
88354
|
+
return darkBackgroundColor;
|
|
88355
|
+
if (backgroundColor)
|
|
88356
|
+
return backgroundColor;
|
|
88357
|
+
return "#000000";
|
|
88358
|
+
} else {
|
|
88359
|
+
if (backgroundColor)
|
|
88360
|
+
return backgroundColor;
|
|
88361
|
+
return "#f9fafb";
|
|
88362
|
+
}
|
|
88363
|
+
}, [theme, backgroundColor, darkBackgroundColor]);
|
|
88364
|
+
const defaultNebulaColors = useMemo(() => {
|
|
88365
|
+
if (theme === "dark") {
|
|
88366
|
+
if (darkNebulaColors)
|
|
88367
|
+
return darkNebulaColors;
|
|
88368
|
+
if (nebulaColors)
|
|
88369
|
+
return nebulaColors;
|
|
88370
|
+
return ["#ff00ff20", "#00ffff20", "#ffff0020"];
|
|
88371
|
+
} else {
|
|
88372
|
+
if (nebulaColors)
|
|
88373
|
+
return nebulaColors;
|
|
88374
|
+
return ["#db278610", "#06b6d410", "#eab30810"];
|
|
88375
|
+
}
|
|
88376
|
+
}, [theme, nebulaColors, darkNebulaColors]);
|
|
88377
|
+
const starColors = Array.isArray(defaultStarColor) ? defaultStarColor : [defaultStarColor];
|
|
88232
88378
|
const initializeShootingStars = useCallback(() => {
|
|
88233
88379
|
const shootingStars2 = [];
|
|
88234
88380
|
for (let i = 0; i < 5; i++) {
|
|
@@ -88393,7 +88539,7 @@ var StarfieldInternal = ({
|
|
|
88393
88539
|
}
|
|
88394
88540
|
};
|
|
88395
88541
|
const drawNebula = (ctx, canvas) => {
|
|
88396
|
-
|
|
88542
|
+
defaultNebulaColors.forEach((color, i) => {
|
|
88397
88543
|
const gradient = ctx.createRadialGradient(
|
|
88398
88544
|
canvas.width / 2 + Math.sin(Date.now() * 1e-4 + i) * 100,
|
|
88399
88545
|
canvas.height / 2 + Math.cos(Date.now() * 1e-4 + i) * 100,
|
|
@@ -88427,7 +88573,7 @@ var StarfieldInternal = ({
|
|
|
88427
88573
|
return;
|
|
88428
88574
|
}
|
|
88429
88575
|
lastFrameTimeRef.current = currentTime - deltaTime % frameInterval;
|
|
88430
|
-
ctx.fillStyle =
|
|
88576
|
+
ctx.fillStyle = defaultBg;
|
|
88431
88577
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
88432
88578
|
if (nebula) {
|
|
88433
88579
|
drawNebula(ctx, canvas);
|
|
@@ -88451,7 +88597,7 @@ var StarfieldInternal = ({
|
|
|
88451
88597
|
}
|
|
88452
88598
|
animationRef.current = requestAnimationFrame(animate4);
|
|
88453
88599
|
}, [
|
|
88454
|
-
|
|
88600
|
+
defaultBg,
|
|
88455
88601
|
frameInterval,
|
|
88456
88602
|
speed,
|
|
88457
88603
|
warpSpeed,
|
|
@@ -88462,7 +88608,7 @@ var StarfieldInternal = ({
|
|
|
88462
88608
|
depthBlur,
|
|
88463
88609
|
trails,
|
|
88464
88610
|
nebula,
|
|
88465
|
-
|
|
88611
|
+
defaultNebulaColors,
|
|
88466
88612
|
shootingStars,
|
|
88467
88613
|
direction,
|
|
88468
88614
|
spiralSpeed,
|
|
@@ -88643,8 +88789,10 @@ var DotPatternInternal = ({
|
|
|
88643
88789
|
containerClassName,
|
|
88644
88790
|
dotSize = 4,
|
|
88645
88791
|
gap = 20,
|
|
88646
|
-
color
|
|
88647
|
-
|
|
88792
|
+
color,
|
|
88793
|
+
darkColor,
|
|
88794
|
+
opacity,
|
|
88795
|
+
darkOpacity,
|
|
88648
88796
|
animated = false,
|
|
88649
88797
|
animationType = "pulse",
|
|
88650
88798
|
animationDuration = 3,
|
|
@@ -88655,7 +88803,8 @@ var DotPatternInternal = ({
|
|
|
88655
88803
|
gradientDirection = "radial",
|
|
88656
88804
|
gradientAngle = 45,
|
|
88657
88805
|
blur: blur2 = 0,
|
|
88658
|
-
backgroundColor
|
|
88806
|
+
backgroundColor,
|
|
88807
|
+
darkBackgroundColor,
|
|
88659
88808
|
maskFade = false,
|
|
88660
88809
|
maskFadeDirection = "bottom",
|
|
88661
88810
|
parallax = false,
|
|
@@ -88663,9 +88812,49 @@ var DotPatternInternal = ({
|
|
|
88663
88812
|
density = 1,
|
|
88664
88813
|
responsive = true
|
|
88665
88814
|
}) => {
|
|
88815
|
+
const { theme } = useTheme();
|
|
88666
88816
|
const containerRef = useRef(null);
|
|
88667
88817
|
const patternRef = useRef(null);
|
|
88668
88818
|
const mouseRef = useRef({ x: 0, y: 0 });
|
|
88819
|
+
const defaultColor = useMemo(() => {
|
|
88820
|
+
if (theme === "dark") {
|
|
88821
|
+
if (darkColor)
|
|
88822
|
+
return darkColor;
|
|
88823
|
+
if (color)
|
|
88824
|
+
return color;
|
|
88825
|
+
return "#ffffff";
|
|
88826
|
+
} else {
|
|
88827
|
+
if (color)
|
|
88828
|
+
return color;
|
|
88829
|
+
return "#1f2937";
|
|
88830
|
+
}
|
|
88831
|
+
}, [theme, color, darkColor]);
|
|
88832
|
+
const defaultOpacity = useMemo(() => {
|
|
88833
|
+
if (theme === "dark") {
|
|
88834
|
+
if (darkOpacity !== void 0)
|
|
88835
|
+
return darkOpacity;
|
|
88836
|
+
if (opacity !== void 0)
|
|
88837
|
+
return opacity;
|
|
88838
|
+
return 0.4;
|
|
88839
|
+
} else {
|
|
88840
|
+
if (opacity !== void 0)
|
|
88841
|
+
return opacity;
|
|
88842
|
+
return 0.25;
|
|
88843
|
+
}
|
|
88844
|
+
}, [theme, opacity, darkOpacity]);
|
|
88845
|
+
const defaultBg = useMemo(() => {
|
|
88846
|
+
if (theme === "dark") {
|
|
88847
|
+
if (darkBackgroundColor)
|
|
88848
|
+
return darkBackgroundColor;
|
|
88849
|
+
if (backgroundColor)
|
|
88850
|
+
return backgroundColor;
|
|
88851
|
+
return "transparent";
|
|
88852
|
+
} else {
|
|
88853
|
+
if (backgroundColor)
|
|
88854
|
+
return backgroundColor;
|
|
88855
|
+
return "transparent";
|
|
88856
|
+
}
|
|
88857
|
+
}, [theme, backgroundColor, darkBackgroundColor]);
|
|
88669
88858
|
const responsiveDotSize = dotSize * 0.4;
|
|
88670
88859
|
useMemo(
|
|
88671
88860
|
() => `dot-pattern-${Math.random().toString(36).substr(2, 9)}`,
|
|
@@ -88752,17 +88941,17 @@ var DotPatternInternal = ({
|
|
|
88752
88941
|
if (distance < hoverRadius) {
|
|
88753
88942
|
const scale = 1 + (1 - distance / hoverRadius) * 2;
|
|
88754
88943
|
dot.setAttribute("transform", `scale(${scale})`);
|
|
88755
|
-
dot.style.opacity = String(Math.min(1,
|
|
88944
|
+
dot.style.opacity = String(Math.min(1, defaultOpacity + (1 - distance / hoverRadius) * 0.5));
|
|
88756
88945
|
} else {
|
|
88757
88946
|
dot.setAttribute("transform", "scale(1)");
|
|
88758
|
-
dot.style.opacity = String(
|
|
88947
|
+
dot.style.opacity = String(defaultOpacity);
|
|
88759
88948
|
}
|
|
88760
88949
|
});
|
|
88761
88950
|
}
|
|
88762
88951
|
};
|
|
88763
88952
|
window.addEventListener("mousemove", handleMouseMove2);
|
|
88764
88953
|
return () => window.removeEventListener("mousemove", handleMouseMove2);
|
|
88765
|
-
}, [hoverEffect, hoverRadius,
|
|
88954
|
+
}, [hoverEffect, hoverRadius, defaultOpacity]);
|
|
88766
88955
|
useEffect(() => {
|
|
88767
88956
|
if (!parallax || !containerRef.current)
|
|
88768
88957
|
return;
|
|
@@ -88804,7 +88993,7 @@ var DotPatternInternal = ({
|
|
|
88804
88993
|
return "";
|
|
88805
88994
|
}
|
|
88806
88995
|
};
|
|
88807
|
-
const processedColors = Array.isArray(
|
|
88996
|
+
const processedColors = Array.isArray(defaultColor) ? defaultColor : [defaultColor];
|
|
88808
88997
|
return /* @__PURE__ */ jsxs(
|
|
88809
88998
|
"div",
|
|
88810
88999
|
{
|
|
@@ -88814,7 +89003,7 @@ var DotPatternInternal = ({
|
|
|
88814
89003
|
containerClassName
|
|
88815
89004
|
),
|
|
88816
89005
|
style: {
|
|
88817
|
-
backgroundColor
|
|
89006
|
+
backgroundColor: defaultBg
|
|
88818
89007
|
},
|
|
88819
89008
|
children: [
|
|
88820
89009
|
/* @__PURE__ */ jsxs(
|
|
@@ -88947,7 +89136,7 @@ var DotPatternInternal = ({
|
|
|
88947
89136
|
cy: dot.y,
|
|
88948
89137
|
r: responsiveDotSize,
|
|
88949
89138
|
fill: gradient ? `url(#${gradientId})` : processedColors[0],
|
|
88950
|
-
opacity,
|
|
89139
|
+
opacity: defaultOpacity,
|
|
88951
89140
|
style: {
|
|
88952
89141
|
transformOrigin: `${dot.x} ${dot.y}`,
|
|
88953
89142
|
transition: hoverEffect ? "all 0.3s ease" : void 0,
|
|
@@ -88966,8 +89155,8 @@ var DotPatternInternal = ({
|
|
|
88966
89155
|
}
|
|
88967
89156
|
|
|
88968
89157
|
@keyframes dot-pattern-fade {
|
|
88969
|
-
0%, 100% { opacity: ${
|
|
88970
|
-
50% { opacity: ${
|
|
89158
|
+
0%, 100% { opacity: ${defaultOpacity}; }
|
|
89159
|
+
50% { opacity: ${defaultOpacity * 0.3}; }
|
|
88971
89160
|
}
|
|
88972
89161
|
|
|
88973
89162
|
@keyframes dot-pattern-scale {
|
|
@@ -89396,12 +89585,15 @@ var WavesInternal = ({
|
|
|
89396
89585
|
className,
|
|
89397
89586
|
containerClassName,
|
|
89398
89587
|
layers = 3,
|
|
89399
|
-
colors
|
|
89588
|
+
colors,
|
|
89589
|
+
darkColors,
|
|
89400
89590
|
amplitude = 50,
|
|
89401
89591
|
frequency = 2,
|
|
89402
89592
|
speed = 0.5,
|
|
89403
|
-
opacity
|
|
89404
|
-
|
|
89593
|
+
opacity,
|
|
89594
|
+
darkOpacity,
|
|
89595
|
+
backgroundColor,
|
|
89596
|
+
darkBackgroundColor,
|
|
89405
89597
|
waveStyle = "smooth",
|
|
89406
89598
|
parallax = true,
|
|
89407
89599
|
parallaxIntensity = 0.5,
|
|
@@ -89415,6 +89607,7 @@ var WavesInternal = ({
|
|
|
89415
89607
|
fps = 60,
|
|
89416
89608
|
pauseWhenHidden = false
|
|
89417
89609
|
}) => {
|
|
89610
|
+
const { theme } = useTheme();
|
|
89418
89611
|
const canvasRef = useRef(null);
|
|
89419
89612
|
const containerRef = useRef(null);
|
|
89420
89613
|
const animationRef = useRef(void 0);
|
|
@@ -89425,6 +89618,45 @@ var WavesInternal = ({
|
|
|
89425
89618
|
const frameInterval = 1e3 / fps;
|
|
89426
89619
|
const [isVisible, setIsVisible] = useState(true);
|
|
89427
89620
|
const observerTimeoutRef = useRef(null);
|
|
89621
|
+
const defaultColors2 = useMemo(() => {
|
|
89622
|
+
if (theme === "dark") {
|
|
89623
|
+
if (darkColors)
|
|
89624
|
+
return darkColors;
|
|
89625
|
+
if (colors)
|
|
89626
|
+
return colors;
|
|
89627
|
+
return ["#8b5cf6", "#ec4899", "#3b82f6"];
|
|
89628
|
+
} else {
|
|
89629
|
+
if (colors)
|
|
89630
|
+
return colors;
|
|
89631
|
+
return ["#a855f7", "#f472b6", "#60a5fa"];
|
|
89632
|
+
}
|
|
89633
|
+
}, [theme, colors, darkColors]);
|
|
89634
|
+
const defaultOpacity = useMemo(() => {
|
|
89635
|
+
if (theme === "dark") {
|
|
89636
|
+
if (darkOpacity !== void 0)
|
|
89637
|
+
return darkOpacity;
|
|
89638
|
+
if (opacity !== void 0)
|
|
89639
|
+
return opacity;
|
|
89640
|
+
return 0.6;
|
|
89641
|
+
} else {
|
|
89642
|
+
if (opacity !== void 0)
|
|
89643
|
+
return opacity;
|
|
89644
|
+
return 0.4;
|
|
89645
|
+
}
|
|
89646
|
+
}, [theme, opacity, darkOpacity]);
|
|
89647
|
+
const defaultBg = useMemo(() => {
|
|
89648
|
+
if (theme === "dark") {
|
|
89649
|
+
if (darkBackgroundColor)
|
|
89650
|
+
return darkBackgroundColor;
|
|
89651
|
+
if (backgroundColor)
|
|
89652
|
+
return backgroundColor;
|
|
89653
|
+
return "transparent";
|
|
89654
|
+
} else {
|
|
89655
|
+
if (backgroundColor)
|
|
89656
|
+
return backgroundColor;
|
|
89657
|
+
return "transparent";
|
|
89658
|
+
}
|
|
89659
|
+
}, [theme, backgroundColor, darkBackgroundColor]);
|
|
89428
89660
|
const initializeWaves = useCallback(() => {
|
|
89429
89661
|
const waveLayers = [];
|
|
89430
89662
|
for (let i = 0; i < layers; i++) {
|
|
@@ -89434,11 +89666,11 @@ var WavesInternal = ({
|
|
|
89434
89666
|
frequency: frequency * (1 + layerIndex * 0.2),
|
|
89435
89667
|
speed: speed * (1 - layerIndex * (parallax ? parallaxIntensity * 0.5 : 0)),
|
|
89436
89668
|
phase: Math.PI * 2 * i / layers,
|
|
89437
|
-
color:
|
|
89669
|
+
color: defaultColors2[i % defaultColors2.length]
|
|
89438
89670
|
});
|
|
89439
89671
|
}
|
|
89440
89672
|
waveLayersRef.current = waveLayers;
|
|
89441
|
-
}, [layers, amplitude, frequency, speed, parallax, parallaxIntensity,
|
|
89673
|
+
}, [layers, amplitude, frequency, speed, parallax, parallaxIntensity, defaultColors2]);
|
|
89442
89674
|
const calculateWavePoint = (x, layer, time, mouseEffect = 0) => {
|
|
89443
89675
|
let y = 0;
|
|
89444
89676
|
switch (waveStyle) {
|
|
@@ -89496,10 +89728,10 @@ var WavesInternal = ({
|
|
|
89496
89728
|
const rgbaMatch = layer.color.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
89497
89729
|
if (rgbaMatch) {
|
|
89498
89730
|
colorBase = `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, 0)`;
|
|
89499
|
-
colorWithAlpha = `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${
|
|
89731
|
+
colorWithAlpha = `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${defaultOpacity})`;
|
|
89500
89732
|
}
|
|
89501
89733
|
} else if (layer.color.startsWith("#")) {
|
|
89502
|
-
const alphaHex = Math.floor(
|
|
89734
|
+
const alphaHex = Math.floor(defaultOpacity * 255).toString(16).padStart(2, "0");
|
|
89503
89735
|
colorBase = layer.color + "00";
|
|
89504
89736
|
colorWithAlpha = layer.color + alphaHex;
|
|
89505
89737
|
} else {
|
|
@@ -89512,7 +89744,7 @@ var WavesInternal = ({
|
|
|
89512
89744
|
ctx.fillStyle = grad;
|
|
89513
89745
|
} else {
|
|
89514
89746
|
ctx.fillStyle = layer.color;
|
|
89515
|
-
ctx.globalAlpha =
|
|
89747
|
+
ctx.globalAlpha = defaultOpacity * (1 - index2 * 0.2 / layers);
|
|
89516
89748
|
}
|
|
89517
89749
|
ctx.beginPath();
|
|
89518
89750
|
if (direction === "vertical") {
|
|
@@ -89673,7 +89905,7 @@ var WavesInternal = ({
|
|
|
89673
89905
|
containerClassName
|
|
89674
89906
|
),
|
|
89675
89907
|
style: {
|
|
89676
|
-
backgroundColor
|
|
89908
|
+
backgroundColor: defaultBg
|
|
89677
89909
|
},
|
|
89678
89910
|
children: [
|
|
89679
89911
|
/* @__PURE__ */ jsx(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.38",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|