@moontra/moonui-pro 3.4.13 → 3.4.15

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
@@ -2080,6 +2080,14 @@ interface FloatingDockProps extends Omit<React__default.HTMLAttributes<HTMLDivEl
2080
2080
  * Toggle button ikonu
2081
2081
  */
2082
2082
  toggleIcon?: React__default.ReactNode;
2083
+ /**
2084
+ * Toggle button arkaplan rengi (default: "bg-background/95")
2085
+ */
2086
+ toggleButtonBg?: string;
2087
+ /**
2088
+ * Toggle button border rengi (default: "border-border")
2089
+ */
2090
+ toggleButtonBorder?: string;
2083
2091
  }
2084
2092
  declare const FloatingDock: React__default.ForwardRefExoticComponent<FloatingDockProps & React__default.RefAttributes<HTMLDivElement>>;
2085
2093
 
package/dist/index.mjs CHANGED
@@ -17344,6 +17344,8 @@ var FloatingDockInternal = React71__default.forwardRef(
17344
17344
  mobileBreakpoint = "lg",
17345
17345
  autoHideDelay = 5e3,
17346
17346
  toggleIcon,
17347
+ toggleButtonBg = "bg-background/95",
17348
+ toggleButtonBorder = "border-border",
17347
17349
  ...props
17348
17350
  }, ref) => {
17349
17351
  const [isMobileOpen, setIsMobileOpen] = useState(false);
@@ -17375,24 +17377,6 @@ var FloatingDockInternal = React71__default.forwardRef(
17375
17377
  }
17376
17378
  };
17377
17379
  }, [isMobileOpen, autoHideDelay, mobileMode, isMobile]);
17378
- const slideVariants = {
17379
- right: {
17380
- hidden: { x: "calc(100% + 24px)", opacity: 0 },
17381
- visible: { x: 0, opacity: 1 }
17382
- },
17383
- left: {
17384
- hidden: { x: "calc(-100% - 24px)", opacity: 0 },
17385
- visible: { x: 0, opacity: 1 }
17386
- },
17387
- bottom: {
17388
- hidden: { y: "calc(100% + 24px)", opacity: 0 },
17389
- visible: { y: 0, opacity: 1 }
17390
- },
17391
- top: {
17392
- hidden: { y: "calc(-100% - 24px)", opacity: 0 },
17393
- visible: { y: 0, opacity: 1 }
17394
- }
17395
- };
17396
17380
  const getPositionClass = () => {
17397
17381
  if (containerMode) {
17398
17382
  switch (position) {
@@ -17422,35 +17406,6 @@ var FloatingDockInternal = React71__default.forwardRef(
17422
17406
  }
17423
17407
  }
17424
17408
  };
17425
- const getToggleButtonClass = () => {
17426
- if (containerMode) {
17427
- switch (position) {
17428
- case "right":
17429
- return "absolute right-2 top-1/2 -translate-y-1/2";
17430
- case "left":
17431
- return "absolute left-2 top-1/2 -translate-y-1/2";
17432
- case "bottom":
17433
- return "absolute bottom-2 left-1/2 -translate-x-1/2";
17434
- case "top":
17435
- return "absolute top-2 left-1/2 -translate-x-1/2";
17436
- default:
17437
- return "absolute right-2 top-1/2 -translate-y-1/2";
17438
- }
17439
- } else {
17440
- switch (position) {
17441
- case "right":
17442
- return "fixed right-2 top-1/2 -translate-y-1/2";
17443
- case "left":
17444
- return "fixed left-2 top-1/2 -translate-y-1/2";
17445
- case "bottom":
17446
- return "fixed bottom-2 left-1/2 -translate-x-1/2";
17447
- case "top":
17448
- return "fixed top-2 left-1/2 -translate-x-1/2";
17449
- default:
17450
- return "fixed right-2 top-1/2 -translate-y-1/2";
17451
- }
17452
- }
17453
- };
17454
17409
  const getToggleIconRotation = () => {
17455
17410
  if (!isMobileOpen) {
17456
17411
  switch (position) {
@@ -17480,6 +17435,21 @@ var FloatingDockInternal = React71__default.forwardRef(
17480
17435
  }
17481
17436
  }
17482
17437
  };
17438
+ const getSlideOffset = () => {
17439
+ const offset4 = "calc(100% + 56px)";
17440
+ switch (position) {
17441
+ case "right":
17442
+ return { x: offset4, y: 0 };
17443
+ case "left":
17444
+ return { x: `-${offset4}`, y: 0 };
17445
+ case "bottom":
17446
+ return { x: 0, y: offset4 };
17447
+ case "top":
17448
+ return { x: 0, y: `-${offset4}` };
17449
+ default:
17450
+ return { x: offset4, y: 0 };
17451
+ }
17452
+ };
17483
17453
  if (!isMobile || mobileMode === "always") {
17484
17454
  return /* @__PURE__ */ jsx(
17485
17455
  motion.div,
@@ -17511,88 +17481,70 @@ var FloatingDockInternal = React71__default.forwardRef(
17511
17481
  if (mobileMode === "hidden") {
17512
17482
  return null;
17513
17483
  }
17514
- return /* @__PURE__ */ jsxs(AnimatePresence, { children: [
17515
- /* @__PURE__ */ jsx(
17516
- motion.div,
17517
- {
17518
- className: cn(
17519
- "z-[99999]",
17520
- getPositionClass()
17521
- ),
17522
- variants: slideVariants[position || "bottom"],
17523
- initial: "hidden",
17524
- animate: isMobileOpen ? "visible" : "hidden",
17525
- transition: { duration: 0.3, ease: "easeOut" },
17526
- children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
17527
- /* @__PURE__ */ jsx(
17528
- "div",
17529
- {
17530
- ref,
17531
- className: cn(
17532
- floatingDockVariants({ size: size4, position }),
17533
- className
17534
- ),
17535
- children: items.map((item) => /* @__PURE__ */ jsx(
17536
- DockIcon,
17537
- {
17538
- item,
17539
- size: size4 || "md",
17540
- magnification,
17541
- showTooltip,
17542
- position: position || "bottom"
17543
- },
17544
- item.id
17545
- ))
17546
- }
17547
- ),
17548
- /* @__PURE__ */ jsx(
17549
- motion.button,
17550
- {
17551
- className: cn(
17552
- "absolute p-2.5 rounded-full bg-background/95 backdrop-blur-md border border-border shadow-lg hover:shadow-xl transition-shadow",
17553
- position === "right" && "-left-14 top-1/2 -translate-y-1/2",
17554
- position === "left" && "-right-14 top-1/2 -translate-y-1/2",
17555
- position === "bottom" && "left-1/2 -translate-x-1/2 -top-14",
17556
- position === "top" && "left-1/2 -translate-x-1/2 -bottom-14"
17557
- ),
17558
- onClick: () => setIsMobileOpen(!isMobileOpen),
17559
- whileTap: { scale: 0.95 },
17560
- children: /* @__PURE__ */ jsx(
17561
- motion.div,
17562
- {
17563
- animate: { rotate: getToggleIconRotation() },
17564
- transition: { duration: 0.3, ease: "easeOut" },
17565
- children: toggleIcon || /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" })
17566
- }
17567
- )
17568
- }
17569
- )
17570
- ] })
17571
- }
17572
- ),
17573
- !isMobileOpen && /* @__PURE__ */ jsx(
17574
- motion.button,
17575
- {
17576
- className: cn(
17577
- "z-[99999] p-2.5 rounded-full bg-background/95 backdrop-blur-md border border-border shadow-lg hover:shadow-xl transition-shadow",
17578
- getToggleButtonClass()
17484
+ const slideOffset = getSlideOffset();
17485
+ return /* @__PURE__ */ jsx("div", { className: cn("z-[99999]", getPositionClass()), children: /* @__PURE__ */ jsxs(
17486
+ motion.div,
17487
+ {
17488
+ className: "relative",
17489
+ initial: false,
17490
+ animate: {
17491
+ x: isMobileOpen ? 0 : slideOffset.x,
17492
+ y: isMobileOpen ? 0 : slideOffset.y
17493
+ },
17494
+ transition: {
17495
+ duration: 0.35,
17496
+ ease: [0.4, 0, 0.2, 1]
17497
+ // cubic-bezier for smooth motion
17498
+ },
17499
+ children: [
17500
+ /* @__PURE__ */ jsx(
17501
+ motion.button,
17502
+ {
17503
+ className: cn(
17504
+ "absolute p-2.5 rounded-full backdrop-blur-md border shadow-lg hover:shadow-xl transition-shadow",
17505
+ toggleButtonBg,
17506
+ toggleButtonBorder,
17507
+ position === "right" && "-left-14 top-1/2 -translate-y-1/2",
17508
+ position === "left" && "-right-14 top-1/2 -translate-y-1/2",
17509
+ position === "bottom" && "left-1/2 -translate-x-1/2 -top-14",
17510
+ position === "top" && "left-1/2 -translate-x-1/2 -bottom-14"
17511
+ ),
17512
+ onClick: () => setIsMobileOpen(!isMobileOpen),
17513
+ whileTap: { scale: 0.95 },
17514
+ children: /* @__PURE__ */ jsx(
17515
+ motion.div,
17516
+ {
17517
+ animate: { rotate: getToggleIconRotation() },
17518
+ transition: { duration: 0.3, ease: "easeOut" },
17519
+ children: toggleIcon || /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" })
17520
+ }
17521
+ )
17522
+ }
17579
17523
  ),
17580
- onClick: () => setIsMobileOpen(true),
17581
- whileTap: { scale: 0.95 },
17582
- initial: { opacity: 0, scale: 0.8 },
17583
- animate: { opacity: 1, scale: 1 },
17584
- transition: { duration: 0.3 },
17585
- children: /* @__PURE__ */ jsx(
17586
- motion.div,
17524
+ /* @__PURE__ */ jsx(
17525
+ "div",
17587
17526
  {
17588
- animate: { rotate: getToggleIconRotation() },
17589
- transition: { duration: 0.3, ease: "easeOut" },
17590
- children: toggleIcon || /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" })
17527
+ ref,
17528
+ className: cn(
17529
+ floatingDockVariants({ size: size4, position }),
17530
+ className
17531
+ ),
17532
+ children: items.map((item) => /* @__PURE__ */ jsx(
17533
+ DockIcon,
17534
+ {
17535
+ item,
17536
+ size: size4 || "md",
17537
+ magnification,
17538
+ showTooltip,
17539
+ position: position || "bottom"
17540
+ },
17541
+ item.id
17542
+ ))
17591
17543
  }
17592
17544
  )
17593
- }
17594
- )
17595
- ] });
17545
+ ]
17546
+ }
17547
+ ) });
17596
17548
  }
17597
17549
  );
17598
17550
  FloatingDockInternal.displayName = "FloatingDockInternal";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "3.4.13",
3
+ "version": "3.4.15",
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",