@moontra/moonui-pro 3.4.11 → 3.4.13

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
@@ -2061,6 +2061,25 @@ interface FloatingDockProps extends Omit<React__default.HTMLAttributes<HTMLDivEl
2061
2061
  * Container mode - docs örnekleri için
2062
2062
  */
2063
2063
  containerMode?: boolean;
2064
+ /**
2065
+ * Mobil davranış modu
2066
+ * - "hidden": Mobilde tamamen gizli
2067
+ * - "toggle": Toggle button ile göster/gizle (default)
2068
+ * - "always": Her zaman görünür
2069
+ */
2070
+ mobileMode?: "hidden" | "toggle" | "always";
2071
+ /**
2072
+ * Mobil breakpoint (default: "lg" = 1024px)
2073
+ */
2074
+ mobileBreakpoint?: "sm" | "md" | "lg" | "xl";
2075
+ /**
2076
+ * Auto-hide süresi (ms, default: 5000)
2077
+ */
2078
+ autoHideDelay?: number;
2079
+ /**
2080
+ * Toggle button ikonu
2081
+ */
2082
+ toggleIcon?: React__default.ReactNode;
2064
2083
  }
2065
2084
  declare const FloatingDock: React__default.ForwardRefExoticComponent<FloatingDockProps & React__default.RefAttributes<HTMLDivElement>>;
2066
2085
 
package/dist/index.mjs CHANGED
@@ -17340,8 +17340,59 @@ var FloatingDockInternal = React71__default.forwardRef(
17340
17340
  size: size4 = "md",
17341
17341
  position = "bottom",
17342
17342
  containerMode = false,
17343
+ mobileMode = "toggle",
17344
+ mobileBreakpoint = "lg",
17345
+ autoHideDelay = 5e3,
17346
+ toggleIcon,
17343
17347
  ...props
17344
17348
  }, ref) => {
17349
+ const [isMobileOpen, setIsMobileOpen] = useState(false);
17350
+ const [isMobile, setIsMobile] = useState(false);
17351
+ const autoHideTimerRef = useRef(null);
17352
+ useEffect(() => {
17353
+ const breakpoints = {
17354
+ sm: 640,
17355
+ md: 768,
17356
+ lg: 1024,
17357
+ xl: 1280
17358
+ };
17359
+ const checkMobile = () => {
17360
+ setIsMobile(window.innerWidth < breakpoints[mobileBreakpoint]);
17361
+ };
17362
+ checkMobile();
17363
+ window.addEventListener("resize", checkMobile);
17364
+ return () => window.removeEventListener("resize", checkMobile);
17365
+ }, [mobileBreakpoint]);
17366
+ useEffect(() => {
17367
+ if (isMobileOpen && mobileMode === "toggle" && isMobile) {
17368
+ autoHideTimerRef.current = setTimeout(() => {
17369
+ setIsMobileOpen(false);
17370
+ }, autoHideDelay);
17371
+ }
17372
+ return () => {
17373
+ if (autoHideTimerRef.current) {
17374
+ clearTimeout(autoHideTimerRef.current);
17375
+ }
17376
+ };
17377
+ }, [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
+ };
17345
17396
  const getPositionClass = () => {
17346
17397
  if (containerMode) {
17347
17398
  switch (position) {
@@ -17371,31 +17422,177 @@ var FloatingDockInternal = React71__default.forwardRef(
17371
17422
  }
17372
17423
  }
17373
17424
  };
17374
- return /* @__PURE__ */ jsx(
17375
- motion.div,
17376
- {
17377
- ref,
17378
- className: cn(
17379
- floatingDockVariants({ size: size4, position }),
17380
- getPositionClass(),
17381
- className
17382
- ),
17383
- initial: { opacity: 0, scale: 0.95 },
17384
- animate: { opacity: 1, scale: 1 },
17385
- transition: { duration: 0.4, ease: "easeOut" },
17386
- children: items.map((item) => /* @__PURE__ */ jsx(
17387
- DockIcon,
17388
- {
17389
- item,
17390
- size: size4 || "md",
17391
- magnification,
17392
- showTooltip,
17393
- position: position || "bottom"
17394
- },
17395
- item.id
17396
- ))
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
+ }
17397
17452
  }
17398
- );
17453
+ };
17454
+ const getToggleIconRotation = () => {
17455
+ if (!isMobileOpen) {
17456
+ switch (position) {
17457
+ case "right":
17458
+ return 0;
17459
+ case "left":
17460
+ return 180;
17461
+ case "bottom":
17462
+ return 90;
17463
+ case "top":
17464
+ return -90;
17465
+ default:
17466
+ return 0;
17467
+ }
17468
+ } else {
17469
+ switch (position) {
17470
+ case "right":
17471
+ return 180;
17472
+ case "left":
17473
+ return 0;
17474
+ case "bottom":
17475
+ return -90;
17476
+ case "top":
17477
+ return 90;
17478
+ default:
17479
+ return 180;
17480
+ }
17481
+ }
17482
+ };
17483
+ if (!isMobile || mobileMode === "always") {
17484
+ return /* @__PURE__ */ jsx(
17485
+ motion.div,
17486
+ {
17487
+ ref,
17488
+ className: cn(
17489
+ floatingDockVariants({ size: size4, position }),
17490
+ getPositionClass(),
17491
+ "z-[99999]",
17492
+ className
17493
+ ),
17494
+ initial: { opacity: 0, scale: 0.95 },
17495
+ animate: { opacity: 1, scale: 1 },
17496
+ transition: { duration: 0.4, ease: "easeOut" },
17497
+ children: items.map((item) => /* @__PURE__ */ jsx(
17498
+ DockIcon,
17499
+ {
17500
+ item,
17501
+ size: size4 || "md",
17502
+ magnification,
17503
+ showTooltip,
17504
+ position: position || "bottom"
17505
+ },
17506
+ item.id
17507
+ ))
17508
+ }
17509
+ );
17510
+ }
17511
+ if (mobileMode === "hidden") {
17512
+ return null;
17513
+ }
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()
17579
+ ),
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,
17587
+ {
17588
+ animate: { rotate: getToggleIconRotation() },
17589
+ transition: { duration: 0.3, ease: "easeOut" },
17590
+ children: toggleIcon || /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" })
17591
+ }
17592
+ )
17593
+ }
17594
+ )
17595
+ ] });
17399
17596
  }
17400
17597
  );
17401
17598
  FloatingDockInternal.displayName = "FloatingDockInternal";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "3.4.11",
3
+ "version": "3.4.13",
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",