@moontra/moonui-pro 3.3.17 → 3.3.19

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.d.ts CHANGED
@@ -3968,7 +3968,7 @@ interface NavbarConfig {
3968
3968
  text?: string;
3969
3969
  hover?: string;
3970
3970
  };
3971
- variant?: "default" | "floating" | "minimal" | "transparent";
3971
+ variant?: "default" | "floating" | "floating-centered" | "minimal" | "transparent";
3972
3972
  size?: "sm" | "md" | "lg";
3973
3973
  blur?: boolean;
3974
3974
  shadow?: boolean;
package/dist/index.mjs CHANGED
@@ -79177,9 +79177,6 @@ function NavbarInternal({
79177
79177
  ] }) })
79178
79178
  ] });
79179
79179
  const getHeight = () => {
79180
- if (isMinimal && minimalConfig?.heightOnScroll) {
79181
- return minimalConfig.heightOnScroll;
79182
- }
79183
79180
  switch (size4) {
79184
79181
  case "sm":
79185
79182
  return "h-14";
@@ -79189,15 +79186,12 @@ function NavbarInternal({
79189
79186
  return "h-16";
79190
79187
  }
79191
79188
  };
79192
- const shouldHideInMinimal = (element) => {
79193
- return isMinimal && minimalConfig?.hideElements?.includes(element);
79194
- };
79195
79189
  const navClasses = cn(
79196
- "moonui-pro w-full transition-all",
79197
- `duration-${minimalConfig?.animationDuration || 300}`,
79190
+ "moonui-pro w-full transition-all duration-300 ease-in-out",
79198
79191
  // Base variant styles
79199
79192
  variant === "default" && "border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",
79200
79193
  variant === "floating" && "mx-4 mt-4 rounded-lg border bg-background/95 backdrop-blur shadow-lg",
79194
+ variant === "floating-centered" && "mx-auto my-4 max-w-5xl rounded-2xl border border-border/40 bg-background/70 backdrop-blur-xl shadow-lg shadow-black/5 dark:shadow-black/20 px-6",
79201
79195
  variant === "minimal" && "bg-background",
79202
79196
  variant === "transparent" && "bg-transparent",
79203
79197
  // Sticky behavior
@@ -79206,9 +79200,6 @@ function NavbarInternal({
79206
79200
  scrolled && sticky && variant !== "transparent" && "shadow-sm",
79207
79201
  scrolled && variant === "transparent" && "bg-background/95 backdrop-blur border-b",
79208
79202
  scrollBehavior === "hide" && hidden && "-translate-y-full",
79209
- // Minimal mode styles
79210
- scrollBehavior === "minimal" && isMinimal && "shadow-md border-b",
79211
- scrollBehavior === "minimal" && isMinimal && minimalConfig?.centerOnScroll && "px-8",
79212
79203
  // Glass effect
79213
79204
  glassmorphism && "bg-background/80 backdrop-blur-xl border-white/10",
79214
79205
  blur2 && "backdrop-blur-md",
@@ -79225,23 +79216,18 @@ function NavbarInternal({
79225
79216
  "div",
79226
79217
  {
79227
79218
  className: cn(
79228
- "flex items-center",
79219
+ "flex items-center transition-[height] duration-300 ease-in-out",
79229
79220
  getHeight(),
79230
79221
  fullWidth ? "w-full px-4 sm:px-6 lg:px-8" : maxWidth === "sm" && "container max-w-screen-sm" || maxWidth === "md" && "container max-w-screen-md" || maxWidth === "lg" && "container max-w-screen-lg" || maxWidth === "xl" && "container max-w-screen-xl" || maxWidth === "2xl" && "container max-w-screen-2xl" || maxWidth === "full" && "w-full px-4 sm:px-6 lg:px-8"
79231
79222
  ),
79232
79223
  children: [
79233
79224
  branding && /* @__PURE__ */ jsxs(
79234
- motion.div,
79225
+ "div",
79235
79226
  {
79236
79227
  className: cn(
79237
79228
  "flex items-center gap-2",
79238
- logoPosition === "center" && !isMobile ? "absolute left-1/2 -translate-x-1/2" : "mr-4"
79229
+ logoPosition === "center" && !isMobile && variant !== "floating-centered" ? "absolute left-1/2 -translate-x-1/2" : "mr-4"
79239
79230
  ),
79240
- animate: {
79241
- scale: isMinimal ? 0.9 : 1,
79242
- opacity: shouldHideInMinimal("logo-text") ? 0.8 : 1
79243
- },
79244
- transition: { duration: minimalConfig?.animationDuration ? minimalConfig.animationDuration / 1e3 : 0.3 },
79245
79231
  children: [
79246
79232
  logoPosition === "left" && mobileMenuPosition === "left" && /* @__PURE__ */ jsx(MobileMenu, {}),
79247
79233
  /* @__PURE__ */ jsxs(
@@ -79257,18 +79243,7 @@ function NavbarInternal({
79257
79243
  className: "flex items-center gap-2",
79258
79244
  children: [
79259
79245
  branding.logo,
79260
- branding.title && !isMobile && !shouldHideInMinimal("logo-text") && /* @__PURE__ */ jsx(
79261
- motion.span,
79262
- {
79263
- className: "font-semibold text-lg",
79264
- animate: {
79265
- opacity: shouldHideInMinimal("logo-text") ? 0 : 1,
79266
- width: shouldHideInMinimal("logo-text") ? 0 : "auto"
79267
- },
79268
- transition: { duration: 0.3 },
79269
- children: branding.title
79270
- }
79271
- )
79246
+ branding.title && !isMobile && /* @__PURE__ */ jsx("span", { className: "font-semibold text-lg", children: branding.title })
79272
79247
  ]
79273
79248
  }
79274
79249
  )
@@ -79280,12 +79255,13 @@ function NavbarInternal({
79280
79255
  {
79281
79256
  className: cn(
79282
79257
  "hidden md:flex",
79283
- navItemsPosition === "center" && "flex-1 justify-center mx-4",
79258
+ navItemsPosition === "center" && variant !== "floating-centered" && "flex-1 justify-center mx-4",
79259
+ navItemsPosition === "center" && variant === "floating-centered" && "flex-1 justify-center",
79284
79260
  navItemsPosition === "right" && "ml-auto",
79285
79261
  navItemsPosition === "left" && "ml-4",
79286
79262
  // Keep position consistent in minimal mode unless centerOnScroll is enabled
79287
79263
  isMinimal && minimalConfig?.centerOnScroll && navItemsPosition !== "center" && "flex-1 justify-center",
79288
- navItemsPosition === "center" && "absolute left-1/2 transform -translate-x-1/2"
79264
+ navItemsPosition === "center" && variant !== "floating-centered" && "absolute left-1/2 transform -translate-x-1/2"
79289
79265
  ),
79290
79266
  children: /* @__PURE__ */ jsx(NavigationMenuList2, { children: sections.map((section) => /* @__PURE__ */ jsx(React71__default.Fragment, { children: section.items.map((item) => {
79291
79267
  const hasChildren = item.items && item.items.length > 0;
@@ -79355,7 +79331,7 @@ function NavbarInternal({
79355
79331
  }
79356
79332
  ),
79357
79333
  /* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
79358
- showSearch && !shouldHideInMinimal("search") && /* @__PURE__ */ jsx(Fragment, { children: isMobile ? /* @__PURE__ */ jsx(
79334
+ showSearch && /* @__PURE__ */ jsx(Fragment, { children: isMobile ? /* @__PURE__ */ jsx(
79359
79335
  MoonUIButtonPro,
79360
79336
  {
79361
79337
  variant: "ghost",
@@ -79603,7 +79579,7 @@ function NavbarInternal({
79603
79579
  }
79604
79580
  )
79605
79581
  ] }),
79606
- cta && !shouldHideInMinimal("cta") && /* @__PURE__ */ jsx(
79582
+ cta && /* @__PURE__ */ jsx(
79607
79583
  MoonUIButtonPro,
79608
79584
  {
79609
79585
  variant: cta.variant || "primary",
@@ -88944,76 +88920,41 @@ var MeshGradientInternal = ({
88944
88920
  const canvas = canvasRef.current;
88945
88921
  if (!canvas)
88946
88922
  return;
88923
+ const width = canvas.width > 0 ? canvas.width : 800;
88924
+ const height = canvas.height > 0 ? canvas.height : 600;
88947
88925
  const points = [];
88948
88926
  const totalPoints = complexity;
88949
88927
  for (let i = 0; i < totalPoints; i++) {
88950
88928
  const angle = i / totalPoints * Math.PI * 2;
88951
88929
  const distance = Math.random() * 0.5 + 0.2;
88952
88930
  points.push({
88953
- x: canvas.width / 2 + Math.cos(angle) * distance * canvas.width,
88954
- y: canvas.height / 2 + Math.sin(angle) * distance * canvas.height,
88931
+ x: width / 2 + Math.cos(angle) * distance * width,
88932
+ y: height / 2 + Math.sin(angle) * distance * height,
88955
88933
  vx: (Math.random() - 0.5) * speed,
88956
88934
  vy: (Math.random() - 0.5) * speed,
88957
88935
  color: colors[i % colors.length],
88958
- radius: (canvas.width + canvas.height) / 4,
88936
+ radius: Math.max(100, (width + height) / 4),
88959
88937
  phase: i / totalPoints * Math.PI * 2
88960
88938
  });
88961
88939
  }
88962
88940
  meshPointsRef.current = points;
88963
88941
  }, [colors, complexity, speed]);
88964
- const adjustColor = useCallback((color) => {
88942
+ const adjustColor = useCallback((color, alpha2 = 1) => {
88965
88943
  const hex = color.replace("#", "");
88966
88944
  const r2 = parseInt(hex.substring(0, 2), 16);
88967
88945
  const g = parseInt(hex.substring(2, 4), 16);
88968
88946
  const b = parseInt(hex.substring(4, 6), 16);
88969
- const max2 = Math.max(r2, g, b);
88970
- const min2 = Math.min(r2, g, b);
88971
- const delta = max2 - min2;
88972
- let h2 = 0, s = 0, l = (max2 + min2) / 510;
88973
- if (delta !== 0) {
88974
- s = delta / (510 - Math.abs(max2 + min2 - 510));
88975
- if (max2 === r2)
88976
- h2 = ((g - b) / delta + (g < b ? 6 : 0)) / 6;
88977
- else if (max2 === g)
88978
- h2 = ((b - r2) / delta + 2) / 6;
88979
- else
88980
- h2 = ((r2 - g) / delta + 4) / 6;
88981
- }
88982
- s *= saturation;
88983
- l *= brightness;
88984
- const c2 = (1 - Math.abs(2 * l - 1)) * s;
88985
- const x = c2 * (1 - Math.abs(h2 * 6 % 2 - 1));
88986
- const m = l - c2 / 2;
88987
- let r1 = 0, g1 = 0, b1 = 0;
88988
- if (h2 < 1 / 6) {
88989
- r1 = c2;
88990
- g1 = x;
88991
- b1 = 0;
88992
- } else if (h2 < 2 / 6) {
88993
- r1 = x;
88994
- g1 = c2;
88995
- b1 = 0;
88996
- } else if (h2 < 3 / 6) {
88997
- r1 = 0;
88998
- g1 = c2;
88999
- b1 = x;
89000
- } else if (h2 < 4 / 6) {
89001
- r1 = 0;
89002
- g1 = x;
89003
- b1 = c2;
89004
- } else if (h2 < 5 / 6) {
89005
- r1 = x;
89006
- g1 = 0;
89007
- b1 = c2;
89008
- } else {
89009
- r1 = c2;
89010
- g1 = 0;
89011
- b1 = x;
89012
- }
89013
- const finalR = Math.round((r1 + m) * 255);
89014
- const finalG = Math.round((g1 + m) * 255);
89015
- const finalB = Math.round((b1 + m) * 255);
89016
- return `rgb(${finalR}, ${finalG}, ${finalB})`;
88947
+ const adjustedR = Math.min(255, Math.max(0, r2 * brightness));
88948
+ const adjustedG = Math.min(255, Math.max(0, g * brightness));
88949
+ const adjustedB = Math.min(255, Math.max(0, b * brightness));
88950
+ if (saturation !== 1) {
88951
+ const gray = (adjustedR + adjustedG + adjustedB) / 3;
88952
+ const finalR = Math.round(gray + (adjustedR - gray) * saturation);
88953
+ const finalG = Math.round(gray + (adjustedG - gray) * saturation);
88954
+ const finalB = Math.round(gray + (adjustedB - gray) * saturation);
88955
+ return `rgba(${Math.min(255, Math.max(0, finalR))}, ${Math.min(255, Math.max(0, finalG))}, ${Math.min(255, Math.max(0, finalB))}, ${alpha2})`;
88956
+ }
88957
+ return `rgba(${Math.round(adjustedR)}, ${Math.round(adjustedG)}, ${Math.round(adjustedB)}, ${alpha2})`;
89017
88958
  }, [saturation, brightness]);
89018
88959
  const updateMeshPoints = useCallback((canvas) => {
89019
88960
  const points = meshPointsRef.current;
@@ -89064,12 +89005,16 @@ var MeshGradientInternal = ({
89064
89005
  const mdx = point.x - mouseRef.current.x;
89065
89006
  const mdy = point.y - mouseRef.current.y;
89066
89007
  const distance = Math.sqrt(mdx * mdx + mdy * mdy);
89067
- if (distance < mouseRadius) {
89008
+ if (distance > 0 && distance < mouseRadius) {
89068
89009
  const force = (1 - distance / mouseRadius) * 3;
89069
89010
  point.x += mdx / distance * force;
89070
89011
  point.y += mdy / distance * force;
89071
89012
  }
89072
89013
  }
89014
+ if (!isFinite(point.x))
89015
+ point.x = canvas.width / 2;
89016
+ if (!isFinite(point.y))
89017
+ point.y = canvas.height / 2;
89073
89018
  });
89074
89019
  }, [animationType, speed, interactive, mouseRadius]);
89075
89020
  const drawMeshGradient = useCallback((ctx, canvas) => {
@@ -89081,28 +89026,30 @@ var MeshGradientInternal = ({
89081
89026
  ctx.filter = `blur(${blur2}px)`;
89082
89027
  }
89083
89028
  points.forEach((point, i) => {
89029
+ const x = isFinite(point.x) ? point.x : canvas.width / 2;
89030
+ const y = isFinite(point.y) ? point.y : canvas.height / 2;
89031
+ const radius = isFinite(point.radius) && point.radius > 0 ? point.radius : 100;
89084
89032
  const gradient = ctx.createRadialGradient(
89085
- point.x,
89086
- point.y,
89033
+ x,
89034
+ y,
89087
89035
  0,
89088
- point.x,
89089
- point.y,
89090
- point.radius
89036
+ x,
89037
+ y,
89038
+ radius
89091
89039
  );
89092
- const adjustedColor = adjustColor(point.color);
89093
89040
  if (interpolation === "smooth") {
89094
- gradient.addColorStop(0, adjustedColor);
89095
- gradient.addColorStop(0.5, adjustedColor + "80");
89096
- gradient.addColorStop(1, adjustedColor + "00");
89041
+ gradient.addColorStop(0, adjustColor(point.color, 1));
89042
+ gradient.addColorStop(0.5, adjustColor(point.color, 0.5));
89043
+ gradient.addColorStop(1, adjustColor(point.color, 0));
89097
89044
  } else if (interpolation === "bezier") {
89098
- gradient.addColorStop(0, adjustedColor);
89099
- gradient.addColorStop(0.25, adjustedColor + "CC");
89100
- gradient.addColorStop(0.5, adjustedColor + "80");
89101
- gradient.addColorStop(0.75, adjustedColor + "40");
89102
- gradient.addColorStop(1, adjustedColor + "00");
89045
+ gradient.addColorStop(0, adjustColor(point.color, 1));
89046
+ gradient.addColorStop(0.25, adjustColor(point.color, 0.8));
89047
+ gradient.addColorStop(0.5, adjustColor(point.color, 0.5));
89048
+ gradient.addColorStop(0.75, adjustColor(point.color, 0.25));
89049
+ gradient.addColorStop(1, adjustColor(point.color, 0));
89103
89050
  } else {
89104
- gradient.addColorStop(0, adjustedColor);
89105
- gradient.addColorStop(1, adjustedColor + "00");
89051
+ gradient.addColorStop(0, adjustColor(point.color, 1));
89052
+ gradient.addColorStop(1, adjustColor(point.color, 0));
89106
89053
  }
89107
89054
  ctx.fillStyle = gradient;
89108
89055
  ctx.fillRect(0, 0, canvas.width, canvas.height);
@@ -89139,12 +89086,12 @@ var MeshGradientInternal = ({
89139
89086
  }
89140
89087
  lastFrameTimeRef.current = currentTime;
89141
89088
  if (animate4) {
89142
- timeRef.current += 1;
89089
+ timeRef.current += 5;
89143
89090
  }
89144
89091
  updateMeshPoints(canvas);
89145
89092
  drawMeshGradient(ctx, canvas);
89146
89093
  animationRef.current = requestAnimationFrame(animateLoop);
89147
- }, [frameInterval, updateMeshPoints, drawMeshGradient]);
89094
+ }, [frameInterval, updateMeshPoints, drawMeshGradient, animate4]);
89148
89095
  const handleResize = useCallback(() => {
89149
89096
  const canvas = canvasRef.current;
89150
89097
  if (!canvas)
@@ -89191,7 +89138,7 @@ var MeshGradientInternal = ({
89191
89138
  cancelAnimationFrame(animationRef.current);
89192
89139
  }
89193
89140
  };
89194
- }, [initializeMeshPoints, handleResize, handleMouseMove2, animateLoop, drawMeshGradient, interactive]);
89141
+ }, [initializeMeshPoints, handleResize, handleMouseMove2, animateLoop, drawMeshGradient, interactive, animate4]);
89195
89142
  return /* @__PURE__ */ jsxs(
89196
89143
  "div",
89197
89144
  {
@@ -89210,7 +89157,7 @@ var MeshGradientInternal = ({
89210
89157
  )
89211
89158
  }
89212
89159
  ),
89213
- children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
89160
+ children && /* @__PURE__ */ jsx("div", { className: "relative z-10 h-full w-full", children })
89214
89161
  ]
89215
89162
  }
89216
89163
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "3.3.17",
3
+ "version": "3.3.19",
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",