@opensite/ui 1.0.7 → 1.0.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.
Files changed (47) hide show
  1. package/dist/navbar-animated-preview.cjs +16 -16
  2. package/dist/navbar-animated-preview.js +16 -16
  3. package/dist/navbar-centered-menu.cjs +1 -1
  4. package/dist/navbar-centered-menu.js +1 -1
  5. package/dist/navbar-dark-icons.cjs +1 -1
  6. package/dist/navbar-dark-icons.js +1 -1
  7. package/dist/navbar-dropdown-menu.cjs +1 -1
  8. package/dist/navbar-dropdown-menu.js +1 -1
  9. package/dist/navbar-education-platform.cjs +278 -236
  10. package/dist/navbar-education-platform.d.cts +61 -36
  11. package/dist/navbar-education-platform.d.ts +61 -36
  12. package/dist/navbar-education-platform.js +279 -237
  13. package/dist/navbar-enterprise-mega.cjs +6 -6
  14. package/dist/navbar-enterprise-mega.js +6 -6
  15. package/dist/navbar-feature-grid.cjs +1 -1
  16. package/dist/navbar-feature-grid.js +1 -1
  17. package/dist/navbar-icon-links.cjs +2 -1
  18. package/dist/navbar-icon-links.js +2 -1
  19. package/dist/navbar-image-preview.cjs +129 -50
  20. package/dist/navbar-image-preview.js +128 -50
  21. package/dist/navbar-mega-menu.cjs +1 -1
  22. package/dist/navbar-mega-menu.js +1 -1
  23. package/dist/navbar-multi-column-groups.cjs +53 -49
  24. package/dist/navbar-multi-column-groups.js +53 -49
  25. package/dist/navbar-platform-resources.cjs +5 -4
  26. package/dist/navbar-platform-resources.js +5 -4
  27. package/dist/navbar-search-focused.cjs +1 -1
  28. package/dist/navbar-search-focused.js +1 -1
  29. package/dist/navbar-sidebar-mobile.cjs +235 -166
  30. package/dist/navbar-sidebar-mobile.js +236 -167
  31. package/dist/navbar-simple-links.cjs +228 -184
  32. package/dist/navbar-simple-links.d.cts +15 -3
  33. package/dist/navbar-simple-links.d.ts +15 -3
  34. package/dist/navbar-simple-links.js +228 -183
  35. package/dist/navbar-split-cta.cjs +3 -3
  36. package/dist/navbar-split-cta.js +3 -3
  37. package/dist/navbar-sticky-compact.cjs +1 -1
  38. package/dist/navbar-sticky-compact.js +1 -1
  39. package/dist/navbar-tabbed-sections.cjs +1 -1
  40. package/dist/navbar-tabbed-sections.js +1 -1
  41. package/dist/navbar-transparent-overlay.cjs +244 -123
  42. package/dist/navbar-transparent-overlay.d.cts +30 -1
  43. package/dist/navbar-transparent-overlay.d.ts +30 -1
  44. package/dist/navbar-transparent-overlay.js +244 -123
  45. package/dist/registry.cjs +1008 -894
  46. package/dist/registry.js +1008 -894
  47. package/package.json +1 -1
@@ -970,6 +970,111 @@ var NavbarLogo = ({
970
970
  }
971
971
  );
972
972
  };
973
+ var NavbarMobileMenu = ({
974
+ open,
975
+ onClose,
976
+ children,
977
+ className,
978
+ contentClassName,
979
+ title = "Mobile Navigation"
980
+ }) => {
981
+ React.useEffect(() => {
982
+ if (open) {
983
+ const originalOverflow = document.body.style.overflow;
984
+ document.body.style.overflow = "hidden";
985
+ return () => {
986
+ document.body.style.overflow = originalOverflow;
987
+ };
988
+ }
989
+ }, [open]);
990
+ if (!open) return null;
991
+ return /* @__PURE__ */ jsxs(
992
+ "div",
993
+ {
994
+ className: cn(
995
+ "fixed inset-0 z-998 flex flex-col bg-background",
996
+ "animate-in slide-in-from-top duration-300",
997
+ "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top data-[state=closed]:duration-300",
998
+ className
999
+ ),
1000
+ "data-state": open ? "open" : "closed",
1001
+ children: [
1002
+ /* @__PURE__ */ jsx("div", { className: "sr-only", children: /* @__PURE__ */ jsx("h2", { children: title }) }),
1003
+ /* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 right-0 p-4 bg-background flex justify-end items-center z-10 w-screen", children: /* @__PURE__ */ jsxs(
1004
+ "button",
1005
+ {
1006
+ onClick: onClose,
1007
+ className: "flex size-10 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",
1008
+ "aria-label": "Close mobile menu",
1009
+ children: [
1010
+ /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/x", className: "size-4" }),
1011
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
1012
+ ]
1013
+ }
1014
+ ) }),
1015
+ /* @__PURE__ */ jsx(
1016
+ "div",
1017
+ {
1018
+ className: cn(
1019
+ "h-full overflow-y-auto pt-20 pb-8 px-4 sm:px-6",
1020
+ contentClassName
1021
+ ),
1022
+ children
1023
+ }
1024
+ )
1025
+ ]
1026
+ }
1027
+ );
1028
+ };
1029
+ var platformIconMap = {
1030
+ instagram: "cib/instagram",
1031
+ linkedin: "cib/linkedin",
1032
+ google: "cib/google",
1033
+ facebook: "cib/facebook",
1034
+ tiktok: "cib/tiktok",
1035
+ youtube: "cib/youtube",
1036
+ yelp: "cib/yelp",
1037
+ spotify: "cib/spotify",
1038
+ apple: "cib/apple",
1039
+ x: "line-md/twitter-x"
1040
+ };
1041
+ var SocialLinkIcon = React.forwardRef(
1042
+ ({
1043
+ platformName,
1044
+ label,
1045
+ iconSize = 20,
1046
+ iconColor,
1047
+ iconClassName,
1048
+ className,
1049
+ ...pressableProps
1050
+ }, ref) => {
1051
+ const iconName = platformIconMap[platformName];
1052
+ const accessibleLabel = label || platformName;
1053
+ return /* @__PURE__ */ jsx(
1054
+ Pressable,
1055
+ {
1056
+ ref,
1057
+ "aria-label": accessibleLabel,
1058
+ className: cn(
1059
+ "inline-flex items-center justify-center transition-colors",
1060
+ className
1061
+ ),
1062
+ ...pressableProps,
1063
+ children: /* @__PURE__ */ jsx(
1064
+ DynamicIcon,
1065
+ {
1066
+ name: iconName,
1067
+ size: iconSize,
1068
+ color: iconColor,
1069
+ className: iconClassName,
1070
+ alt: accessibleLabel
1071
+ }
1072
+ )
1073
+ }
1074
+ );
1075
+ }
1076
+ );
1077
+ SocialLinkIcon.displayName = "SocialLinkIcon";
973
1078
  function NavigationMenu({
974
1079
  className,
975
1080
  children,
@@ -1107,6 +1212,8 @@ var NavbarTransparentOverlay = ({
1107
1212
  navClassName,
1108
1213
  navigationMenuClassName,
1109
1214
  actionsClassName,
1215
+ mobileMenuClassName,
1216
+ socialLinksClassName,
1110
1217
  logo,
1111
1218
  logoSlot,
1112
1219
  logoClassName,
@@ -1116,6 +1223,8 @@ var NavbarTransparentOverlay = ({
1116
1223
  authActionsSlot,
1117
1224
  mobileAuthActions,
1118
1225
  mobileAuthActionsSlot,
1226
+ socialLinks,
1227
+ socialLinksSlot,
1119
1228
  layoutVariant = "fullScreenContainerizedLinks",
1120
1229
  background,
1121
1230
  spacing,
@@ -1134,14 +1243,7 @@ var NavbarTransparentOverlay = ({
1134
1243
  window.addEventListener("scroll", handleScroll);
1135
1244
  return () => window.removeEventListener("scroll", handleScroll);
1136
1245
  }, []);
1137
- useEffect(() => {
1138
- if (typeof document === "undefined") return;
1139
- document.body.style.overflow = isOpen ? "hidden" : "auto";
1140
- return () => {
1141
- document.body.style.overflow = "auto";
1142
- };
1143
- }, [isOpen]);
1144
- const toggleMenu = () => setIsOpen(!isOpen);
1246
+ const handleMobileMenuClose = () => setIsOpen(false);
1145
1247
  const renderNavigation = useMemo(() => {
1146
1248
  if (navigationSlot) return navigationSlot;
1147
1249
  if (!navItems || navItems.length === 0) return null;
@@ -1196,35 +1298,6 @@ var NavbarTransparentOverlay = ({
1196
1298
  );
1197
1299
  });
1198
1300
  }, [authActionsSlot, authActions, isScrolled]);
1199
- const renderMobileAuthActions = useMemo(() => {
1200
- if (mobileAuthActionsSlot) return mobileAuthActionsSlot;
1201
- if (!mobileAuthActions || mobileAuthActions.length === 0) return null;
1202
- return mobileAuthActions.map((action, index) => {
1203
- const {
1204
- label,
1205
- icon,
1206
- iconAfter,
1207
- children,
1208
- className: actionClassName,
1209
- ...pressableProps
1210
- } = action;
1211
- return /* @__PURE__ */ jsx(
1212
- Pressable,
1213
- {
1214
- asButton: true,
1215
- className: cn("min-w-[200px]", actionClassName),
1216
- onClick: () => setIsOpen(false),
1217
- ...pressableProps,
1218
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
1219
- icon,
1220
- label,
1221
- iconAfter
1222
- ] })
1223
- },
1224
- index
1225
- );
1226
- });
1227
- }, [mobileAuthActionsSlot, mobileAuthActions]);
1228
1301
  const {
1229
1302
  sectionClasses,
1230
1303
  containerWrapperClasses,
@@ -1234,18 +1307,18 @@ var NavbarTransparentOverlay = ({
1234
1307
  sectionContainerMaxWidth,
1235
1308
  spacingOverride
1236
1309
  } = getNavbarLayoutClasses(layoutVariant, { className, containerClassName });
1237
- return /* @__PURE__ */ jsxs(
1238
- Section,
1239
- {
1240
- background,
1241
- spacing: spacingOverride ?? spacing,
1242
- className: sectionClasses,
1243
- pattern,
1244
- patternOpacity,
1245
- containerClassName: sectionContainerClassName,
1246
- containerMaxWidth: sectionContainerMaxWidth,
1247
- children: [
1248
- /* @__PURE__ */ jsx("div", { className: containerWrapperClasses, children: /* @__PURE__ */ jsx(
1310
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1311
+ /* @__PURE__ */ jsx(
1312
+ Section,
1313
+ {
1314
+ background,
1315
+ spacing: spacingOverride ?? spacing,
1316
+ className: sectionClasses,
1317
+ pattern,
1318
+ patternOpacity,
1319
+ containerClassName: sectionContainerClassName,
1320
+ containerMaxWidth: sectionContainerMaxWidth,
1321
+ children: /* @__PURE__ */ jsx("div", { className: containerWrapperClasses, children: /* @__PURE__ */ jsx(
1249
1322
  "nav",
1250
1323
  {
1251
1324
  className: cn(
@@ -1285,92 +1358,140 @@ var NavbarTransparentOverlay = ({
1285
1358
  children: renderAuthActions
1286
1359
  }
1287
1360
  ),
1288
- /* @__PURE__ */ jsxs(
1289
- "button",
1361
+ /* @__PURE__ */ jsx("div", { className: "lg:hidden", children: /* @__PURE__ */ jsx(
1362
+ Pressable,
1290
1363
  {
1291
- onClick: toggleMenu,
1364
+ variant: "ghost",
1365
+ size: "icon",
1366
+ asButton: true,
1367
+ "aria-label": "Open menu",
1368
+ onClick: () => setIsOpen(true),
1292
1369
  className: cn(
1293
- "z-50 flex h-10 w-10 flex-col items-center justify-center gap-1.5 lg:hidden"
1370
+ "size-11",
1371
+ !isScrolled && "hover:bg-white/10"
1294
1372
  ),
1295
- "aria-label": "Toggle menu",
1296
- children: [
1297
- /* @__PURE__ */ jsx(
1298
- "span",
1299
- {
1300
- className: cn(
1301
- "h-0.5 w-6 transition-all duration-300",
1302
- isOpen ? "translate-y-2 rotate-45 bg-foreground" : isScrolled ? "bg-foreground" : "bg-white"
1303
- )
1304
- }
1305
- ),
1306
- /* @__PURE__ */ jsx(
1307
- "span",
1308
- {
1309
- className: cn(
1310
- "h-0.5 w-6 transition-all duration-300",
1311
- isOpen ? "opacity-0" : isScrolled ? "bg-foreground" : "bg-white"
1312
- )
1313
- }
1314
- ),
1315
- /* @__PURE__ */ jsx(
1316
- "span",
1317
- {
1318
- className: cn(
1319
- "h-0.5 w-6 transition-all duration-300",
1320
- isOpen ? "-translate-y-2 -rotate-45 bg-foreground" : isScrolled ? "bg-foreground" : "bg-white"
1321
- )
1322
- }
1323
- )
1324
- ]
1373
+ children: /* @__PURE__ */ jsx(
1374
+ DynamicIcon,
1375
+ {
1376
+ name: "lucide/menu",
1377
+ size: 16,
1378
+ className: cn(
1379
+ isScrolled ? "stroke-foreground" : "stroke-white"
1380
+ )
1381
+ }
1382
+ )
1325
1383
  }
1326
- )
1384
+ ) })
1327
1385
  ] }) })
1328
1386
  }
1329
- ) }),
1330
- /* @__PURE__ */ jsx(
1387
+ ) })
1388
+ }
1389
+ ),
1390
+ /* @__PURE__ */ jsx(
1391
+ MobileNavigationMenu,
1392
+ {
1393
+ open: isOpen,
1394
+ onClose: handleMobileMenuClose,
1395
+ navItems,
1396
+ mobileAuthActions,
1397
+ mobileAuthActionsSlot,
1398
+ socialLinks,
1399
+ socialLinksSlot,
1400
+ mobileMenuClassName,
1401
+ socialLinksClassName
1402
+ }
1403
+ )
1404
+ ] });
1405
+ };
1406
+ var MobileNavigationMenu = ({
1407
+ open,
1408
+ onClose,
1409
+ navItems,
1410
+ mobileAuthActions,
1411
+ mobileAuthActionsSlot,
1412
+ socialLinks,
1413
+ socialLinksSlot,
1414
+ mobileMenuClassName,
1415
+ socialLinksClassName
1416
+ }) => {
1417
+ const renderMobileAuthActions = useMemo(() => {
1418
+ if (mobileAuthActionsSlot) return mobileAuthActionsSlot;
1419
+ if (!mobileAuthActions || mobileAuthActions.length === 0) return null;
1420
+ return mobileAuthActions.map((action, index) => {
1421
+ const {
1422
+ label,
1423
+ icon,
1424
+ iconAfter,
1425
+ children,
1426
+ className: actionClassName,
1427
+ ...pressableProps
1428
+ } = action;
1429
+ return /* @__PURE__ */ jsx(
1430
+ Pressable,
1431
+ {
1432
+ asButton: true,
1433
+ className: cn("min-w-[200px]", actionClassName),
1434
+ onClick: onClose,
1435
+ ...pressableProps,
1436
+ children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
1437
+ icon,
1438
+ label,
1439
+ iconAfter
1440
+ ] })
1441
+ },
1442
+ index
1443
+ );
1444
+ });
1445
+ }, [mobileAuthActionsSlot, mobileAuthActions, onClose]);
1446
+ const renderSocialLinks = useMemo(() => {
1447
+ if (socialLinksSlot) return socialLinksSlot;
1448
+ if (!socialLinks || socialLinks.length === 0) return null;
1449
+ return socialLinks.map((link) => /* @__PURE__ */ jsx(
1450
+ SocialLinkIcon,
1451
+ {
1452
+ platformName: link.platformName,
1453
+ href: link.href,
1454
+ label: link.label,
1455
+ iconSize: 24,
1456
+ className: "text-white/70 transition-all duration-300 hover:text-white hover:scale-110"
1457
+ },
1458
+ link.platformName
1459
+ ));
1460
+ }, [socialLinksSlot, socialLinks]);
1461
+ return /* @__PURE__ */ jsx(
1462
+ NavbarMobileMenu,
1463
+ {
1464
+ open,
1465
+ onClose,
1466
+ title: "Mobile Navigation",
1467
+ className: cn("bg-black/95", mobileMenuClassName),
1468
+ contentClassName: "flex flex-col items-center justify-center",
1469
+ children: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col items-center justify-center", children: [
1470
+ /* @__PURE__ */ jsx("nav", { className: "flex flex-col items-center gap-8", children: navItems?.map((item, index) => /* @__PURE__ */ jsxs(
1471
+ Pressable,
1472
+ {
1473
+ href: item.url,
1474
+ className: "text-3xl font-medium text-white transition-all duration-300 hover:text-white/80",
1475
+ onClick: onClose,
1476
+ children: [
1477
+ item.icon ?? (item.iconName && /* @__PURE__ */ jsx(DynamicIcon, { name: item.iconName, size: 24 })),
1478
+ item.title
1479
+ ]
1480
+ },
1481
+ index
1482
+ )) }),
1483
+ renderMobileAuthActions && /* @__PURE__ */ jsx("div", { className: "mt-12 flex flex-col items-center gap-4", children: renderMobileAuthActions }),
1484
+ renderSocialLinks && /* @__PURE__ */ jsx(
1331
1485
  "div",
1332
1486
  {
1333
1487
  className: cn(
1334
- "fixed inset-0 z-40 bg-background transition-all duration-500 lg:hidden",
1335
- isOpen ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"
1488
+ "mt-12 flex flex-row flex-wrap items-center justify-center gap-6",
1489
+ socialLinksClassName
1336
1490
  ),
1337
- children: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col items-center justify-center", children: [
1338
- /* @__PURE__ */ jsx("nav", { className: "flex flex-col items-center gap-8", children: navItems?.map((item, index) => /* @__PURE__ */ jsxs(
1339
- Pressable,
1340
- {
1341
- href: item.url,
1342
- className: cn(
1343
- "text-3xl font-medium text-foreground transition-all duration-300",
1344
- isOpen ? "translate-y-0 opacity-100" : "translate-y-4 opacity-0"
1345
- ),
1346
- style: {
1347
- transitionDelay: isOpen ? `${index * 100}ms` : "0ms"
1348
- },
1349
- onClick: () => setIsOpen(false),
1350
- children: [
1351
- item.icon ?? (item.iconName && /* @__PURE__ */ jsx(DynamicIcon, { name: item.iconName, size: 24 })),
1352
- item.title
1353
- ]
1354
- },
1355
- index
1356
- )) }),
1357
- /* @__PURE__ */ jsx(
1358
- "div",
1359
- {
1360
- className: cn(
1361
- "mt-12 flex flex-col items-center gap-4 transition-all duration-300",
1362
- isOpen ? "translate-y-0 opacity-100" : "translate-y-4 opacity-0"
1363
- ),
1364
- style: {
1365
- transitionDelay: isOpen ? `${(navItems?.length ?? 0) * 100}ms` : "0ms"
1366
- },
1367
- children: renderMobileAuthActions
1368
- }
1369
- )
1370
- ] })
1491
+ children: renderSocialLinks
1371
1492
  }
1372
1493
  )
1373
- ]
1494
+ ] })
1374
1495
  }
1375
1496
  );
1376
1497
  };