@marcwelti/mw-ui 0.1.7 → 0.1.9

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.js CHANGED
@@ -1403,7 +1403,7 @@ function SocialIcons() {
1403
1403
  href: link.url,
1404
1404
  target: "_blank",
1405
1405
  rel: "noopener noreferrer",
1406
- className: "p-1.5 text-muted-foreground hover:text-foreground transition-colors",
1406
+ className: "p-1.5 text-foreground hover:text-muted-foreground transition-colors",
1407
1407
  title: link.name,
1408
1408
  children: /* @__PURE__ */ jsxRuntime.jsx(link.icon, { className: "h-[18px] w-[18px]" })
1409
1409
  },
@@ -1418,31 +1418,51 @@ var PUBLIC_NAV_LINKS = [
1418
1418
  { label: "Blog", href: "/blog" },
1419
1419
  { label: "FAQ", href: "/faq" }
1420
1420
  ];
1421
- function NavDropdown({ label, isActive, items }) {
1422
- return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
1423
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
1424
- Button,
1425
- {
1426
- intent: "ghost",
1427
- size: "sm",
1428
- className: cn(
1429
- "gap-1 font-medium hover:bg-transparent hover:text-current text-base",
1430
- isActive && "text-brand-gold"
1431
- ),
1432
- children: [
1433
- label,
1434
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" })
1435
- ]
1436
- }
1437
- ) }),
1438
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuContent, { align: "start", className: "w-80 p-2", children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, className: "focus:bg-muted/50 focus:text-current hover:bg-muted/50 mb-1 last:mb-0 gap-0", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: item.href, className: "cursor-pointer flex flex-col gap-1 p-3", children: [
1439
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 w-full", children: [
1440
- /* @__PURE__ */ jsxRuntime.jsx(item.icon, { className: "h-4 w-4 text-muted-foreground flex-shrink-0" }),
1441
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm leading-5", children: item.label })
1442
- ] }),
1443
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground w-full", children: item.description })
1444
- ] }) }, index)) })
1445
- ] });
1421
+ function NavDropdown({ label, isActive, items, baseUrl, openKey, onHover, dropdownKey }) {
1422
+ const isOpen = openKey === dropdownKey;
1423
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1424
+ "div",
1425
+ {
1426
+ className: "relative",
1427
+ onMouseEnter: () => onHover(dropdownKey),
1428
+ onMouseLeave: () => onHover(null),
1429
+ children: [
1430
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
1431
+ /* @__PURE__ */ jsxRuntime.jsx(
1432
+ "a",
1433
+ {
1434
+ href: baseUrl,
1435
+ className: cn(
1436
+ "inline-flex items-center gap-1 rounded-md px-3 h-9 text-base font-medium transition-colors hover:bg-transparent hover:text-current",
1437
+ isActive && "text-brand-gold"
1438
+ ),
1439
+ children: label
1440
+ }
1441
+ ),
1442
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: cn(
1443
+ "h-4 w-4 transition-transform duration-150",
1444
+ isOpen && "rotate-180",
1445
+ isActive && "text-brand-gold"
1446
+ ) })
1447
+ ] }),
1448
+ isOpen && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-full left-0 pt-1 z-50", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-80 rounded-md border border-border bg-popover p-2 shadow-lg animate-in fade-in-0 zoom-in-95 duration-100", children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
1449
+ "a",
1450
+ {
1451
+ href: item.href,
1452
+ className: "flex flex-col gap-1 p-3 rounded-md cursor-pointer hover:bg-muted/50 transition-colors mb-1 last:mb-0",
1453
+ children: [
1454
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 w-full", children: [
1455
+ /* @__PURE__ */ jsxRuntime.jsx(item.icon, { className: "h-4 w-4 text-muted-foreground flex-shrink-0" }),
1456
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm leading-5 text-popover-foreground", children: item.label })
1457
+ ] }),
1458
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground w-full", children: item.description })
1459
+ ]
1460
+ },
1461
+ index
1462
+ )) }) })
1463
+ ]
1464
+ }
1465
+ );
1446
1466
  }
1447
1467
  function NavigationBar({
1448
1468
  currentApp,
@@ -1457,6 +1477,7 @@ function NavigationBar({
1457
1477
  }) {
1458
1478
  const { theme, setTheme, systemTheme } = nextThemes.useTheme();
1459
1479
  const [mounted, setMounted] = React27__namespace.useState(false);
1480
+ const [activeDropdown, setActiveDropdown] = React27__namespace.useState(null);
1460
1481
  React27__namespace.useEffect(() => {
1461
1482
  setMounted(true);
1462
1483
  }, []);
@@ -1471,6 +1492,7 @@ function NavigationBar({
1471
1492
  {
1472
1493
  key: "booking",
1473
1494
  label: "Booking",
1495
+ baseUrl: bookingBaseUrl,
1474
1496
  items: [
1475
1497
  { label: "Book a call", description: "Schedule a phone consultation", href: `${bookingBaseUrl}/call`, icon: lucideReact.Phone },
1476
1498
  { label: "Book a private lesson", description: "One-on-one training session", href: `${bookingBaseUrl}/private-lesson`, icon: lucideReact.UserRound },
@@ -1481,6 +1503,7 @@ function NavigationBar({
1481
1503
  {
1482
1504
  key: "academy",
1483
1505
  label: "Academy",
1506
+ baseUrl: academyBaseUrl,
1484
1507
  items: [
1485
1508
  { label: "Academy Information", description: "Learn about our online dog training courses", href: `${academyBaseUrl}/`, icon: lucideReact.GraduationCap },
1486
1509
  { label: "Courses", description: "Browse and access available courses", href: `${academyBaseUrl}/courses`, icon: lucideReact.BookOpen },
@@ -1490,6 +1513,7 @@ function NavigationBar({
1490
1513
  {
1491
1514
  key: "training",
1492
1515
  label: "Training",
1516
+ baseUrl: trainingBaseUrl,
1493
1517
  items: [
1494
1518
  { label: "Dog Commands", description: "View and manage trained commands", href: `${trainingBaseUrl}/commands`, icon: lucideReact.Dog },
1495
1519
  { label: "Dog Progress", description: "Track your dog's training progress", href: `${trainingBaseUrl}/progress`, icon: lucideReact.TrendingUp },
@@ -1500,6 +1524,7 @@ function NavigationBar({
1500
1524
  {
1501
1525
  key: "achievements",
1502
1526
  label: "Achievements",
1527
+ baseUrl: achievementsBaseUrl,
1503
1528
  items: [
1504
1529
  { label: "Journey", description: "View your training journey and milestones", href: `${achievementsBaseUrl}/journey`, icon: lucideReact.Map },
1505
1530
  { label: "Next Task", description: "See your next recommended task", href: `${achievementsBaseUrl}/next-task`, icon: lucideReact.ListTodo }
@@ -1521,23 +1546,33 @@ function NavigationBar({
1521
1546
  navItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
1522
1547
  NavDropdown,
1523
1548
  {
1549
+ dropdownKey: item.key,
1524
1550
  label: item.label,
1525
1551
  isActive: currentApp === item.key,
1526
- items: item.items
1552
+ items: item.items,
1553
+ baseUrl: item.baseUrl,
1554
+ openKey: activeDropdown,
1555
+ onHover: setActiveDropdown
1527
1556
  },
1528
1557
  item.key
1529
1558
  ))
1530
1559
  ) : (
1531
1560
  /* Logged-out: Public page links */
1532
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-5", children: PUBLIC_NAV_LINKS.map((link) => /* @__PURE__ */ jsxRuntime.jsx(
1533
- "a",
1534
- {
1535
- href: link.href,
1536
- className: "text-sm font-medium text-foreground/80 hover:text-foreground transition-colors underline underline-offset-4 decoration-foreground/30 hover:decoration-foreground/60",
1537
- children: link.label
1538
- },
1539
- link.href
1540
- )) })
1561
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-5", children: PUBLIC_NAV_LINKS.map((link) => {
1562
+ const isActive = mounted && typeof window !== "undefined" && window.location.pathname === link.href;
1563
+ return /* @__PURE__ */ jsxRuntime.jsx(
1564
+ "a",
1565
+ {
1566
+ href: link.href,
1567
+ className: cn(
1568
+ "text-sm font-medium transition-colors",
1569
+ isActive ? "text-foreground underline underline-offset-4 decoration-foreground/60" : "text-foreground/70 hover:text-foreground"
1570
+ ),
1571
+ children: link.label
1572
+ },
1573
+ link.href
1574
+ );
1575
+ }) })
1541
1576
  ) }),
1542
1577
  /* @__PURE__ */ jsxRuntime.jsx("a", { href: "/", className: "flex items-center absolute left-1/2 transform -translate-x-1/2", children: mounted ? /* @__PURE__ */ jsxRuntime.jsx(
1543
1578
  "img",
@@ -1560,7 +1595,6 @@ function NavigationBar({
1560
1595
  /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { onClick: () => onLanguageChange?.("DE"), children: "Deutsch" })
1561
1596
  ] })
1562
1597
  ] }),
1563
- isLoggedIn && /* Theme Toggle – only for logged-in */
1564
1598
  /* @__PURE__ */ jsxRuntime.jsx(
1565
1599
  Button,
1566
1600
  {