@moontra/moonui-pro 3.4.37 → 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/index.mjs CHANGED
@@ -86994,18 +86994,19 @@ var GridPatternInternal = ({
86994
86994
  squares = [],
86995
86995
  strokeDasharray = "0",
86996
86996
  className,
86997
- strokeColor = "rgb(156 163 175 / 0.2)",
86998
- // gray-400/20
86997
+ strokeColor,
86998
+ darkStrokeColor,
86999
86999
  strokeWidth = 1,
87000
- maxOpacity = 0.4,
87000
+ maxOpacity,
87001
+ darkMaxOpacity,
87001
87002
  duration = 4e3,
87002
87003
  repeatDelay = 0,
87003
87004
  variant = "lines",
87004
87005
  gradient = false,
87005
- gradientFrom = "rgb(59 130 246)",
87006
- // blue-500
87007
- gradientTo = "rgb(147 51 234)",
87008
- // purple-500
87006
+ gradientFrom,
87007
+ darkGradientFrom,
87008
+ gradientTo,
87009
+ darkGradientTo,
87009
87010
  gradientDirection = "diagonal",
87010
87011
  animationType = "fade",
87011
87012
  blur: blur2 = false,
@@ -87017,12 +87018,65 @@ var GridPatternInternal = ({
87017
87018
  size: size4,
87018
87019
  performance: performance2 = "balanced"
87019
87020
  }) => {
87021
+ const { theme } = useTheme();
87020
87022
  const uniqueId = useId();
87021
87023
  const patternId = `grid-pattern-${uniqueId}`;
87022
87024
  const gradientId = `grid-gradient-${uniqueId}`;
87023
87025
  const maskId = `grid-mask-${uniqueId}`;
87024
87026
  const noiseId = `grid-noise-${uniqueId}`;
87025
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]);
87026
87080
  useEffect(() => {
87027
87081
  if (!parallax || !containerRef.current)
87028
87082
  return;
@@ -87051,23 +87105,23 @@ var GridPatternInternal = ({
87051
87105
  switch (gradientDirection) {
87052
87106
  case "horizontal":
87053
87107
  return /* @__PURE__ */ jsxs("linearGradient", { ...gradientProps, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
87054
- /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: gradientFrom }),
87055
- /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: gradientTo })
87108
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: defaultGradientFrom }),
87109
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: defaultGradientTo })
87056
87110
  ] });
87057
87111
  case "vertical":
87058
87112
  return /* @__PURE__ */ jsxs("linearGradient", { ...gradientProps, x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
87059
- /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: gradientFrom }),
87060
- /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: gradientTo })
87113
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: defaultGradientFrom }),
87114
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: defaultGradientTo })
87061
87115
  ] });
87062
87116
  case "radial":
87063
87117
  return /* @__PURE__ */ jsxs("radialGradient", { ...gradientProps, cx: "50%", cy: "50%", r: "50%", children: [
87064
- /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: gradientFrom }),
87065
- /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: gradientTo })
87118
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: defaultGradientFrom }),
87119
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: defaultGradientTo })
87066
87120
  ] });
87067
87121
  default:
87068
87122
  return /* @__PURE__ */ jsxs("linearGradient", { ...gradientProps, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
87069
- /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: gradientFrom }),
87070
- /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: gradientTo })
87123
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: defaultGradientFrom }),
87124
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: defaultGradientTo })
87071
87125
  ] });
87072
87126
  }
87073
87127
  };
@@ -87111,7 +87165,7 @@ var GridPatternInternal = ({
87111
87165
  };
87112
87166
  const renderPattern = () => {
87113
87167
  const baseProps = {
87114
- stroke: gradient ? `url(#${gradientId})` : strokeColor,
87168
+ stroke: gradient ? `url(#${gradientId})` : defaultStrokeColor,
87115
87169
  strokeWidth,
87116
87170
  strokeDasharray,
87117
87171
  fill: "none"
@@ -87124,7 +87178,7 @@ var GridPatternInternal = ({
87124
87178
  cx: width / 2,
87125
87179
  cy: height / 2,
87126
87180
  r: Math.max(strokeWidth, 1),
87127
- fill: gradient ? `url(#${gradientId})` : strokeColor,
87181
+ fill: gradient ? `url(#${gradientId})` : defaultStrokeColor,
87128
87182
  strokeWidth: 0
87129
87183
  }
87130
87184
  );
@@ -87240,8 +87294,8 @@ var GridPatternInternal = ({
87240
87294
  y: squareY * height + y,
87241
87295
  width,
87242
87296
  height,
87243
- fill: gradient ? `url(#${gradientId})` : strokeColor,
87244
- opacity: maxOpacity,
87297
+ fill: gradient ? `url(#${gradientId})` : defaultStrokeColor,
87298
+ opacity: defaultMaxOpacity,
87245
87299
  style: {
87246
87300
  animation: animationType === "fade" ? `grid-square-fade ${duration}ms ease-in-out infinite ${index2 * 100}ms` : void 0
87247
87301
  }
@@ -87254,7 +87308,7 @@ var GridPatternInternal = ({
87254
87308
  animationType === "fade" && squares.length > 0 && /* @__PURE__ */ jsx("style", { children: `
87255
87309
  @keyframes grid-square-fade {
87256
87310
  0%, 20% { opacity: 0; }
87257
- 50% { opacity: ${maxOpacity}; }
87311
+ 50% { opacity: ${defaultMaxOpacity}; }
87258
87312
  80%, 100% { opacity: 0; }
87259
87313
  }
87260
87314
  ` }),
@@ -87833,20 +87887,23 @@ var ParticlesInternal = ({
87833
87887
  className,
87834
87888
  count: count3 = 50,
87835
87889
  size: size4 = { min: 1, max: 3 },
87836
- colors = ["#ffffff", "#00d4ff", "#ff00ff", "#ffff00"],
87890
+ colors,
87891
+ darkColors,
87837
87892
  speed = 0.5,
87838
87893
  interactive = true,
87839
87894
  mouseRadius = 100,
87840
87895
  connectDistance = 100,
87841
87896
  showConnections = true,
87842
87897
  lineWidth = 0.5,
87843
- lineOpacity = 0.2,
87898
+ lineOpacity,
87899
+ darkLineOpacity,
87844
87900
  shape = "circle",
87845
87901
  parallax = false,
87846
87902
  parallaxFactor = 0.5,
87847
87903
  fps = 60,
87848
87904
  performanceMode = false,
87849
- backgroundColor = "transparent",
87905
+ backgroundColor,
87906
+ darkBackgroundColor,
87850
87907
  blur: blur2 = 0,
87851
87908
  containerClassName,
87852
87909
  glow = true,
@@ -87857,6 +87914,7 @@ var ParticlesInternal = ({
87857
87914
  opacity = { min: 0.3, max: 1 },
87858
87915
  pauseWhenHidden = false
87859
87916
  }) => {
87917
+ const { theme } = useTheme();
87860
87918
  const canvasRef = useRef(null);
87861
87919
  const containerRef = useRef(null);
87862
87920
  const animationRef = useRef(void 0);
@@ -87866,6 +87924,45 @@ var ParticlesInternal = ({
87866
87924
  const frameInterval = 1e3 / fps;
87867
87925
  const [isVisible, setIsVisible] = useState(true);
87868
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]);
87869
87966
  const drawParticle = useCallback((ctx, particle) => {
87870
87967
  ctx.save();
87871
87968
  ctx.translate(particle.x, particle.y);
@@ -87994,7 +88091,7 @@ var ParticlesInternal = ({
87994
88091
  const dy = particles[i].y - particles[j].y;
87995
88092
  const distance = Math.sqrt(dx * dx + dy * dy);
87996
88093
  if (distance < connectDistance) {
87997
- const opacity2 = (1 - distance / connectDistance) * lineOpacity;
88094
+ const opacity2 = (1 - distance / connectDistance) * defaultLineOpacity;
87998
88095
  ctx.strokeStyle = `rgba(255, 255, 255, ${opacity2})`;
87999
88096
  ctx.lineWidth = lineWidth;
88000
88097
  ctx.beginPath();
@@ -88004,7 +88101,7 @@ var ParticlesInternal = ({
88004
88101
  }
88005
88102
  }
88006
88103
  }
88007
- }, [connectDistance, lineOpacity, lineWidth]);
88104
+ }, [connectDistance, defaultLineOpacity, lineWidth]);
88008
88105
  const animate4 = useCallback((currentTime) => {
88009
88106
  const canvas = canvasRef.current;
88010
88107
  const ctx = canvas?.getContext("2d", {
@@ -88051,7 +88148,7 @@ var ParticlesInternal = ({
88051
88148
  vx: (Math.random() - 0.5) * speed,
88052
88149
  vy: (Math.random() - 0.5) * speed,
88053
88150
  size: Math.random() * (size4.max - size4.min) + size4.min,
88054
- color: colors[Math.floor(Math.random() * colors.length)],
88151
+ color: defaultColors2[Math.floor(Math.random() * defaultColors2.length)],
88055
88152
  opacity: Math.random() * (opacity.max - opacity.min) + opacity.min,
88056
88153
  angle: Math.random() * Math.PI * 2,
88057
88154
  rotationSpeed: (Math.random() - 0.5) * 0.02,
@@ -88061,7 +88158,7 @@ var ParticlesInternal = ({
88061
88158
  newParticles.push(particle);
88062
88159
  }
88063
88160
  particlesRef.current = newParticles;
88064
- }, [count3, size4, colors, speed, opacity]);
88161
+ }, [count3, size4, defaultColors2, speed, opacity]);
88065
88162
  const handleMouseMove2 = useCallback((e) => {
88066
88163
  const canvas = canvasRef.current;
88067
88164
  if (!canvas)
@@ -88117,7 +88214,7 @@ var ParticlesInternal = ({
88117
88214
  vx: (Math.random() - 0.5) * speed,
88118
88215
  vy: (Math.random() - 0.5) * speed,
88119
88216
  size: Math.random() * (size4.max - size4.min) + size4.min,
88120
- color: colors[Math.floor(Math.random() * colors.length)],
88217
+ color: defaultColors2[Math.floor(Math.random() * defaultColors2.length)],
88121
88218
  opacity: Math.random() * (opacity.max - opacity.min) + opacity.min,
88122
88219
  angle: Math.random() * Math.PI * 2,
88123
88220
  rotationSpeed: (Math.random() - 0.5) * 0.02,
@@ -88140,7 +88237,7 @@ var ParticlesInternal = ({
88140
88237
  cancelAnimationFrame(animationRef.current);
88141
88238
  }
88142
88239
  };
88143
- }, [handleResize, handleMouseMove2, animate4, interactive, count3, size4, colors, speed, opacity]);
88240
+ }, [handleResize, handleMouseMove2, animate4, interactive, count3, size4, defaultColors2, speed, opacity]);
88144
88241
  const canvasStyle = useMemo(() => ({
88145
88242
  willChange: "transform",
88146
88243
  transform: "translate3d(0, 0, 0)",
@@ -88157,7 +88254,7 @@ var ParticlesInternal = ({
88157
88254
  containerClassName
88158
88255
  ),
88159
88256
  style: {
88160
- backgroundColor
88257
+ backgroundColor: defaultBg
88161
88258
  },
88162
88259
  children: [
88163
88260
  /* @__PURE__ */ jsx(
@@ -88196,9 +88293,11 @@ var StarfieldInternal = ({
88196
88293
  className,
88197
88294
  fullWidth = false,
88198
88295
  starCount = 500,
88199
- starColor = "#ffffff",
88296
+ starColor,
88297
+ darkStarColor,
88200
88298
  speed = 1,
88201
- backgroundColor = "#000000",
88299
+ backgroundColor,
88300
+ darkBackgroundColor,
88202
88301
  mouseParallax = true,
88203
88302
  parallaxIntensity = 0.5,
88204
88303
  starSize = { min: 0.5, max: 2 },
@@ -88215,10 +88314,12 @@ var StarfieldInternal = ({
88215
88314
  trails = false,
88216
88315
  trailLength = 5,
88217
88316
  nebula = false,
88218
- nebulaColors = ["#ff00ff20", "#00ffff20", "#ffff0020"],
88317
+ nebulaColors,
88318
+ darkNebulaColors,
88219
88319
  direction = "forward",
88220
88320
  spiralSpeed = 1e-3
88221
88321
  }) => {
88322
+ const { theme } = useTheme();
88222
88323
  const canvasRef = useRef(null);
88223
88324
  const animationRef = useRef(void 0);
88224
88325
  const starsRef = useRef([]);
@@ -88234,7 +88335,46 @@ var StarfieldInternal = ({
88234
88335
  const [isVisible, setIsVisible] = useState(true);
88235
88336
  const observerTimeoutRef = useRef(null);
88236
88337
  const containerRef = useRef(null);
88237
- const starColors = Array.isArray(starColor) ? starColor : [starColor];
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];
88238
88378
  const initializeShootingStars = useCallback(() => {
88239
88379
  const shootingStars2 = [];
88240
88380
  for (let i = 0; i < 5; i++) {
@@ -88399,7 +88539,7 @@ var StarfieldInternal = ({
88399
88539
  }
88400
88540
  };
88401
88541
  const drawNebula = (ctx, canvas) => {
88402
- nebulaColors.forEach((color, i) => {
88542
+ defaultNebulaColors.forEach((color, i) => {
88403
88543
  const gradient = ctx.createRadialGradient(
88404
88544
  canvas.width / 2 + Math.sin(Date.now() * 1e-4 + i) * 100,
88405
88545
  canvas.height / 2 + Math.cos(Date.now() * 1e-4 + i) * 100,
@@ -88433,7 +88573,7 @@ var StarfieldInternal = ({
88433
88573
  return;
88434
88574
  }
88435
88575
  lastFrameTimeRef.current = currentTime - deltaTime % frameInterval;
88436
- ctx.fillStyle = backgroundColor;
88576
+ ctx.fillStyle = defaultBg;
88437
88577
  ctx.fillRect(0, 0, canvas.width, canvas.height);
88438
88578
  if (nebula) {
88439
88579
  drawNebula(ctx, canvas);
@@ -88457,7 +88597,7 @@ var StarfieldInternal = ({
88457
88597
  }
88458
88598
  animationRef.current = requestAnimationFrame(animate4);
88459
88599
  }, [
88460
- backgroundColor,
88600
+ defaultBg,
88461
88601
  frameInterval,
88462
88602
  speed,
88463
88603
  warpSpeed,
@@ -88468,7 +88608,7 @@ var StarfieldInternal = ({
88468
88608
  depthBlur,
88469
88609
  trails,
88470
88610
  nebula,
88471
- nebulaColors,
88611
+ defaultNebulaColors,
88472
88612
  shootingStars,
88473
88613
  direction,
88474
88614
  spiralSpeed,
@@ -88649,8 +88789,10 @@ var DotPatternInternal = ({
88649
88789
  containerClassName,
88650
88790
  dotSize = 4,
88651
88791
  gap = 20,
88652
- color = "#ffffff",
88653
- opacity = 0.3,
88792
+ color,
88793
+ darkColor,
88794
+ opacity,
88795
+ darkOpacity,
88654
88796
  animated = false,
88655
88797
  animationType = "pulse",
88656
88798
  animationDuration = 3,
@@ -88661,7 +88803,8 @@ var DotPatternInternal = ({
88661
88803
  gradientDirection = "radial",
88662
88804
  gradientAngle = 45,
88663
88805
  blur: blur2 = 0,
88664
- backgroundColor = "transparent",
88806
+ backgroundColor,
88807
+ darkBackgroundColor,
88665
88808
  maskFade = false,
88666
88809
  maskFadeDirection = "bottom",
88667
88810
  parallax = false,
@@ -88669,9 +88812,49 @@ var DotPatternInternal = ({
88669
88812
  density = 1,
88670
88813
  responsive = true
88671
88814
  }) => {
88815
+ const { theme } = useTheme();
88672
88816
  const containerRef = useRef(null);
88673
88817
  const patternRef = useRef(null);
88674
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]);
88675
88858
  const responsiveDotSize = dotSize * 0.4;
88676
88859
  useMemo(
88677
88860
  () => `dot-pattern-${Math.random().toString(36).substr(2, 9)}`,
@@ -88758,17 +88941,17 @@ var DotPatternInternal = ({
88758
88941
  if (distance < hoverRadius) {
88759
88942
  const scale = 1 + (1 - distance / hoverRadius) * 2;
88760
88943
  dot.setAttribute("transform", `scale(${scale})`);
88761
- dot.style.opacity = String(Math.min(1, opacity + (1 - distance / hoverRadius) * 0.5));
88944
+ dot.style.opacity = String(Math.min(1, defaultOpacity + (1 - distance / hoverRadius) * 0.5));
88762
88945
  } else {
88763
88946
  dot.setAttribute("transform", "scale(1)");
88764
- dot.style.opacity = String(opacity);
88947
+ dot.style.opacity = String(defaultOpacity);
88765
88948
  }
88766
88949
  });
88767
88950
  }
88768
88951
  };
88769
88952
  window.addEventListener("mousemove", handleMouseMove2);
88770
88953
  return () => window.removeEventListener("mousemove", handleMouseMove2);
88771
- }, [hoverEffect, hoverRadius, opacity]);
88954
+ }, [hoverEffect, hoverRadius, defaultOpacity]);
88772
88955
  useEffect(() => {
88773
88956
  if (!parallax || !containerRef.current)
88774
88957
  return;
@@ -88810,7 +88993,7 @@ var DotPatternInternal = ({
88810
88993
  return "";
88811
88994
  }
88812
88995
  };
88813
- const processedColors = Array.isArray(color) ? color : [color];
88996
+ const processedColors = Array.isArray(defaultColor) ? defaultColor : [defaultColor];
88814
88997
  return /* @__PURE__ */ jsxs(
88815
88998
  "div",
88816
88999
  {
@@ -88820,7 +89003,7 @@ var DotPatternInternal = ({
88820
89003
  containerClassName
88821
89004
  ),
88822
89005
  style: {
88823
- backgroundColor
89006
+ backgroundColor: defaultBg
88824
89007
  },
88825
89008
  children: [
88826
89009
  /* @__PURE__ */ jsxs(
@@ -88953,7 +89136,7 @@ var DotPatternInternal = ({
88953
89136
  cy: dot.y,
88954
89137
  r: responsiveDotSize,
88955
89138
  fill: gradient ? `url(#${gradientId})` : processedColors[0],
88956
- opacity,
89139
+ opacity: defaultOpacity,
88957
89140
  style: {
88958
89141
  transformOrigin: `${dot.x} ${dot.y}`,
88959
89142
  transition: hoverEffect ? "all 0.3s ease" : void 0,
@@ -88972,8 +89155,8 @@ var DotPatternInternal = ({
88972
89155
  }
88973
89156
 
88974
89157
  @keyframes dot-pattern-fade {
88975
- 0%, 100% { opacity: ${opacity}; }
88976
- 50% { opacity: ${opacity * 0.3}; }
89158
+ 0%, 100% { opacity: ${defaultOpacity}; }
89159
+ 50% { opacity: ${defaultOpacity * 0.3}; }
88977
89160
  }
88978
89161
 
88979
89162
  @keyframes dot-pattern-scale {
@@ -89402,12 +89585,15 @@ var WavesInternal = ({
89402
89585
  className,
89403
89586
  containerClassName,
89404
89587
  layers = 3,
89405
- colors = ["#0066cc", "#0052a3", "#003d7a"],
89588
+ colors,
89589
+ darkColors,
89406
89590
  amplitude = 50,
89407
89591
  frequency = 2,
89408
89592
  speed = 0.5,
89409
- opacity = 0.5,
89410
- backgroundColor = "transparent",
89593
+ opacity,
89594
+ darkOpacity,
89595
+ backgroundColor,
89596
+ darkBackgroundColor,
89411
89597
  waveStyle = "smooth",
89412
89598
  parallax = true,
89413
89599
  parallaxIntensity = 0.5,
@@ -89421,6 +89607,7 @@ var WavesInternal = ({
89421
89607
  fps = 60,
89422
89608
  pauseWhenHidden = false
89423
89609
  }) => {
89610
+ const { theme } = useTheme();
89424
89611
  const canvasRef = useRef(null);
89425
89612
  const containerRef = useRef(null);
89426
89613
  const animationRef = useRef(void 0);
@@ -89431,6 +89618,45 @@ var WavesInternal = ({
89431
89618
  const frameInterval = 1e3 / fps;
89432
89619
  const [isVisible, setIsVisible] = useState(true);
89433
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]);
89434
89660
  const initializeWaves = useCallback(() => {
89435
89661
  const waveLayers = [];
89436
89662
  for (let i = 0; i < layers; i++) {
@@ -89440,11 +89666,11 @@ var WavesInternal = ({
89440
89666
  frequency: frequency * (1 + layerIndex * 0.2),
89441
89667
  speed: speed * (1 - layerIndex * (parallax ? parallaxIntensity * 0.5 : 0)),
89442
89668
  phase: Math.PI * 2 * i / layers,
89443
- color: colors[i % colors.length]
89669
+ color: defaultColors2[i % defaultColors2.length]
89444
89670
  });
89445
89671
  }
89446
89672
  waveLayersRef.current = waveLayers;
89447
- }, [layers, amplitude, frequency, speed, parallax, parallaxIntensity, colors]);
89673
+ }, [layers, amplitude, frequency, speed, parallax, parallaxIntensity, defaultColors2]);
89448
89674
  const calculateWavePoint = (x, layer, time, mouseEffect = 0) => {
89449
89675
  let y = 0;
89450
89676
  switch (waveStyle) {
@@ -89502,10 +89728,10 @@ var WavesInternal = ({
89502
89728
  const rgbaMatch = layer.color.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
89503
89729
  if (rgbaMatch) {
89504
89730
  colorBase = `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, 0)`;
89505
- colorWithAlpha = `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${opacity})`;
89731
+ colorWithAlpha = `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${defaultOpacity})`;
89506
89732
  }
89507
89733
  } else if (layer.color.startsWith("#")) {
89508
- const alphaHex = Math.floor(opacity * 255).toString(16).padStart(2, "0");
89734
+ const alphaHex = Math.floor(defaultOpacity * 255).toString(16).padStart(2, "0");
89509
89735
  colorBase = layer.color + "00";
89510
89736
  colorWithAlpha = layer.color + alphaHex;
89511
89737
  } else {
@@ -89518,7 +89744,7 @@ var WavesInternal = ({
89518
89744
  ctx.fillStyle = grad;
89519
89745
  } else {
89520
89746
  ctx.fillStyle = layer.color;
89521
- ctx.globalAlpha = opacity * (1 - index2 * 0.2 / layers);
89747
+ ctx.globalAlpha = defaultOpacity * (1 - index2 * 0.2 / layers);
89522
89748
  }
89523
89749
  ctx.beginPath();
89524
89750
  if (direction === "vertical") {
@@ -89679,7 +89905,7 @@ var WavesInternal = ({
89679
89905
  containerClassName
89680
89906
  ),
89681
89907
  style: {
89682
- backgroundColor
89908
+ backgroundColor: defaultBg
89683
89909
  },
89684
89910
  children: [
89685
89911
  /* @__PURE__ */ jsx(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "3.4.37",
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",