@opensite/ui 1.0.9 → 1.1.1

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 (41) hide show
  1. package/dist/navbar-animated-preview.cjs +30 -19
  2. package/dist/navbar-animated-preview.js +30 -19
  3. package/dist/navbar-centered-menu.cjs +21 -10
  4. package/dist/navbar-centered-menu.js +21 -10
  5. package/dist/navbar-dark-icons.cjs +21 -10
  6. package/dist/navbar-dark-icons.js +21 -10
  7. package/dist/navbar-dropdown-menu.cjs +21 -10
  8. package/dist/navbar-dropdown-menu.js +21 -10
  9. package/dist/navbar-education-platform.cjs +82 -56
  10. package/dist/navbar-education-platform.js +82 -56
  11. package/dist/navbar-enterprise-mega.cjs +22 -11
  12. package/dist/navbar-enterprise-mega.js +22 -11
  13. package/dist/navbar-feature-grid.cjs +21 -10
  14. package/dist/navbar-feature-grid.js +21 -10
  15. package/dist/navbar-icon-links.cjs +21 -10
  16. package/dist/navbar-icon-links.js +21 -10
  17. package/dist/navbar-image-preview.cjs +21 -10
  18. package/dist/navbar-image-preview.js +21 -10
  19. package/dist/navbar-mega-menu.cjs +21 -10
  20. package/dist/navbar-mega-menu.js +21 -10
  21. package/dist/navbar-multi-column-groups.cjs +53 -35
  22. package/dist/navbar-multi-column-groups.js +53 -35
  23. package/dist/navbar-platform-resources.cjs +21 -10
  24. package/dist/navbar-platform-resources.js +21 -10
  25. package/dist/navbar-search-focused.cjs +192 -103
  26. package/dist/navbar-search-focused.js +192 -103
  27. package/dist/navbar-sidebar-mobile.cjs +22 -10
  28. package/dist/navbar-sidebar-mobile.js +22 -10
  29. package/dist/navbar-simple-links.cjs +23 -12
  30. package/dist/navbar-simple-links.js +23 -12
  31. package/dist/navbar-split-cta.cjs +21 -10
  32. package/dist/navbar-split-cta.js +21 -10
  33. package/dist/navbar-sticky-compact.cjs +231 -123
  34. package/dist/navbar-sticky-compact.js +230 -123
  35. package/dist/navbar-tabbed-sections.cjs +21 -10
  36. package/dist/navbar-tabbed-sections.js +21 -10
  37. package/dist/navbar-transparent-overlay.cjs +23 -10
  38. package/dist/navbar-transparent-overlay.js +23 -10
  39. package/dist/registry.cjs +435 -302
  40. package/dist/registry.js +435 -302
  41. package/package.json +1 -1
@@ -992,6 +992,22 @@ var NavbarLogo = ({
992
992
  }
993
993
  );
994
994
  };
995
+ function Input({ className, type, ...props }) {
996
+ return /* @__PURE__ */ jsxRuntime.jsx(
997
+ "input",
998
+ {
999
+ type,
1000
+ "data-slot": "input",
1001
+ className: cn(
1002
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1003
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
1004
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
1005
+ className
1006
+ ),
1007
+ ...props
1008
+ }
1009
+ );
1010
+ }
995
1011
  function NavigationMenu({
996
1012
  className,
997
1013
  children,
@@ -1093,6 +1109,8 @@ var NavbarMobileMenu = ({
1093
1109
  children,
1094
1110
  className,
1095
1111
  contentClassName,
1112
+ closeContainerClassName,
1113
+ closeIconClassName,
1096
1114
  title = "Mobile Navigation"
1097
1115
  }) => {
1098
1116
  React__namespace.useEffect(() => {
@@ -1117,18 +1135,27 @@ var NavbarMobileMenu = ({
1117
1135
  "data-state": open ? "open" : "closed",
1118
1136
  children: [
1119
1137
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sr-only", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: title }) }),
1120
- /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsxs(
1121
- "button",
1138
+ /* @__PURE__ */ jsxRuntime.jsx(
1139
+ "div",
1122
1140
  {
1123
- onClick: onClose,
1124
- 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",
1125
- "aria-label": "Close mobile menu",
1126
- children: [
1127
- /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/x", className: "size-4" }),
1128
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
1129
- ]
1141
+ className: cn(
1142
+ "absolute top-0 left-0 right-0 p-4 bg-background flex justify-end items-center z-10 w-screen",
1143
+ closeContainerClassName
1144
+ ),
1145
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1146
+ "button",
1147
+ {
1148
+ onClick: onClose,
1149
+ 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",
1150
+ "aria-label": "Close mobile menu",
1151
+ children: [
1152
+ /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/x", className: cn("size-4", closeIconClassName) }),
1153
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
1154
+ ]
1155
+ }
1156
+ )
1130
1157
  }
1131
- ) }),
1158
+ ),
1132
1159
  /* @__PURE__ */ jsxRuntime.jsx(
1133
1160
  "div",
1134
1161
  {
@@ -1205,6 +1232,11 @@ var NavbarSearchFocused = ({
1205
1232
  optixFlowConfig
1206
1233
  }) => {
1207
1234
  const [isOpen, setIsOpen] = React.useState(false);
1235
+ const [searchQuery, setSearchQuery] = React.useState("");
1236
+ const handleSearchSubmit = (e) => {
1237
+ e.preventDefault();
1238
+ onSearch?.(searchQuery);
1239
+ };
1208
1240
  const renderNavigation = (items) => {
1209
1241
  if (navigationSlot) return navigationSlot;
1210
1242
  if (!items || items.length === 0) return null;
@@ -1250,7 +1282,7 @@ var NavbarSearchFocused = ({
1250
1282
  );
1251
1283
  });
1252
1284
  }, [authActionsSlot, authActions]);
1253
- const renderMobileMenuActions = React.useMemo(() => {
1285
+ React.useMemo(() => {
1254
1286
  if (mobileMenuActionsSlot) return mobileMenuActionsSlot;
1255
1287
  if (!mobileMenuActions || mobileMenuActions.length === 0) return null;
1256
1288
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: mobileMenuActions.map((action, index) => {
@@ -1279,100 +1311,157 @@ var NavbarSearchFocused = ({
1279
1311
  sectionContainerMaxWidth,
1280
1312
  spacingOverride
1281
1313
  } = getNavbarLayoutClasses(layoutVariant, { className, containerClassName });
1282
- return /* @__PURE__ */ jsxRuntime.jsx(
1283
- Section,
1284
- {
1285
- background,
1286
- spacing: spacingOverride ?? spacing,
1287
- className: sectionClasses,
1288
- pattern,
1289
- patternOpacity,
1290
- containerClassName: sectionContainerClassName,
1291
- containerMaxWidth: sectionContainerMaxWidth,
1292
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: containerWrapperClasses, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: navWrapperClasses, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: innerContainerClasses, children: /* @__PURE__ */ jsxRuntime.jsxs(
1293
- "nav",
1294
- {
1295
- className: cn(
1296
- "flex items-center gap-4 py-3 lg:gap-8",
1297
- navClassName
1298
- ),
1299
- children: [
1300
- /* @__PURE__ */ jsxRuntime.jsx(
1301
- NavbarLogo,
1302
- {
1303
- logo,
1304
- logoSlot,
1305
- logoClassName,
1306
- optixFlowConfig
1307
- }
1308
- ),
1309
- /* @__PURE__ */ jsxRuntime.jsx(
1310
- NavigationMenu,
1311
- {
1312
- className: cn("hidden lg:flex", navigationMenuClassName),
1313
- children: renderNavigation(navItems?.slice(0, 2) ?? [])
1314
- }
1315
- ),
1316
- /* @__PURE__ */ jsxRuntime.jsx(
1317
- NavigationMenu,
1318
- {
1319
- className: cn("hidden lg:flex", navigationMenuClassName),
1320
- children: renderNavigation(navItems?.slice(2) ?? [])
1321
- }
1314
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1315
+ /* @__PURE__ */ jsxRuntime.jsx(
1316
+ Section,
1317
+ {
1318
+ background,
1319
+ spacing: spacingOverride ?? spacing,
1320
+ className: sectionClasses,
1321
+ pattern,
1322
+ patternOpacity,
1323
+ containerClassName: sectionContainerClassName,
1324
+ containerMaxWidth: sectionContainerMaxWidth,
1325
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: containerWrapperClasses, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: navWrapperClasses, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: innerContainerClasses, children: /* @__PURE__ */ jsxRuntime.jsxs(
1326
+ "nav",
1327
+ {
1328
+ className: cn(
1329
+ "flex items-center justify-between gap-4 py-3 lg:gap-6",
1330
+ navClassName
1322
1331
  ),
1323
- /* @__PURE__ */ jsxRuntime.jsx(
1324
- "div",
1325
- {
1326
- className: cn(
1327
- "hidden shrink-0 items-center gap-2 lg:flex",
1328
- actionsClassName
1332
+ children: [
1333
+ /* @__PURE__ */ jsxRuntime.jsx(
1334
+ NavbarLogo,
1335
+ {
1336
+ logo,
1337
+ logoSlot,
1338
+ logoClassName,
1339
+ optixFlowConfig
1340
+ }
1341
+ ),
1342
+ /* @__PURE__ */ jsxRuntime.jsx(
1343
+ NavigationMenu,
1344
+ {
1345
+ className: cn("hidden lg:flex", navigationMenuClassName),
1346
+ children: renderNavigation(navItems ?? [])
1347
+ }
1348
+ ),
1349
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden flex-1 max-w-md lg:block", children: searchSlot ?? /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSearchSubmit, className: "relative", children: [
1350
+ /* @__PURE__ */ jsxRuntime.jsx(
1351
+ DynamicIcon,
1352
+ {
1353
+ name: "lucide/search",
1354
+ size: 16,
1355
+ className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
1356
+ }
1329
1357
  ),
1330
- children: renderAuthActions
1331
- }
1332
- ),
1333
- /* @__PURE__ */ jsxRuntime.jsxs(
1334
- Pressable,
1335
- {
1336
- variant: "ghost",
1337
- size: "icon",
1338
- asButton: true,
1339
- className: "lg:hidden",
1340
- onClick: () => setIsOpen(!isOpen),
1341
- children: [
1342
- /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/menu", size: 20 }),
1343
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle menu" })
1344
- ]
1345
- }
1346
- ),
1347
- /* @__PURE__ */ jsxRuntime.jsx(
1348
- NavbarMobileMenu,
1349
- {
1350
- open: isOpen,
1351
- onClose: () => setIsOpen(false),
1352
- title: "Navigation Menu",
1353
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-screen-sm mx-auto", children: [
1354
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: navItems?.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
1355
- Pressable,
1356
- {
1357
- href: item.url,
1358
- className: "flex items-center gap-2 rounded-md py-2 text-base font-medium",
1359
- onClick: () => setIsOpen(false),
1360
- children: [
1361
- item.icon ?? (item.iconName && /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: item.iconName, size: 16 })),
1362
- item.title
1363
- ]
1364
- },
1365
- index
1366
- )) }),
1367
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t pt-4 mt-6", children: renderMobileMenuActions })
1368
- ] })
1369
- }
1370
- )
1371
- ]
1372
- }
1373
- ) }) }) })
1374
- }
1375
- );
1358
+ /* @__PURE__ */ jsxRuntime.jsx(
1359
+ Input,
1360
+ {
1361
+ type: "search",
1362
+ placeholder: typeof searchPlaceholder === "string" ? searchPlaceholder : "Search...",
1363
+ value: searchQuery,
1364
+ onChange: (e) => setSearchQuery(e.target.value),
1365
+ className: "pl-9 pr-4"
1366
+ }
1367
+ )
1368
+ ] }) }),
1369
+ /* @__PURE__ */ jsxRuntime.jsx(
1370
+ "div",
1371
+ {
1372
+ className: cn(
1373
+ "hidden shrink-0 items-center gap-2 lg:flex",
1374
+ actionsClassName
1375
+ ),
1376
+ children: renderAuthActions
1377
+ }
1378
+ ),
1379
+ /* @__PURE__ */ jsxRuntime.jsxs(
1380
+ Pressable,
1381
+ {
1382
+ variant: "ghost",
1383
+ size: "icon",
1384
+ asButton: true,
1385
+ className: "lg:hidden",
1386
+ onClick: () => setIsOpen(!isOpen),
1387
+ children: [
1388
+ /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/menu", size: 20 }),
1389
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle menu" })
1390
+ ]
1391
+ }
1392
+ )
1393
+ ]
1394
+ }
1395
+ ) }) }) })
1396
+ }
1397
+ ),
1398
+ /* @__PURE__ */ jsxRuntime.jsx(
1399
+ MobileNavigationMenu,
1400
+ {
1401
+ open: isOpen,
1402
+ setOpen: setIsOpen,
1403
+ navItems: navItems ?? [],
1404
+ navigationSlot,
1405
+ mobileMenuActions: mobileMenuActions ?? authActions,
1406
+ mobileMenuActionsSlot: mobileMenuActionsSlot ?? authActionsSlot
1407
+ }
1408
+ )
1409
+ ] });
1410
+ };
1411
+ var MobileNavigationMenu = ({
1412
+ open,
1413
+ setOpen,
1414
+ navItems,
1415
+ navigationSlot,
1416
+ mobileMenuActions,
1417
+ mobileMenuActionsSlot
1418
+ }) => {
1419
+ const handleClose = () => setOpen(false);
1420
+ const renderMobileActions = React.useMemo(() => {
1421
+ if (mobileMenuActionsSlot) return mobileMenuActionsSlot;
1422
+ if (!mobileMenuActions || mobileMenuActions.length === 0) return null;
1423
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-6 flex flex-col gap-4", children: mobileMenuActions.map((action, index) => {
1424
+ const {
1425
+ label,
1426
+ icon,
1427
+ iconAfter,
1428
+ children,
1429
+ className: actionClassName,
1430
+ ...pressableProps
1431
+ } = action;
1432
+ return /* @__PURE__ */ jsxRuntime.jsx(
1433
+ Pressable,
1434
+ {
1435
+ asButton: true,
1436
+ className: cn("w-full", actionClassName),
1437
+ onClick: handleClose,
1438
+ ...pressableProps,
1439
+ children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1440
+ icon,
1441
+ label,
1442
+ iconAfter
1443
+ ] })
1444
+ },
1445
+ index
1446
+ );
1447
+ }) });
1448
+ }, [mobileMenuActionsSlot, mobileMenuActions]);
1449
+ return /* @__PURE__ */ jsxRuntime.jsx(NavbarMobileMenu, { open, onClose: handleClose, title: "Navigation Menu", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-screen-sm mx-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-6", children: [
1450
+ navigationSlot ?? /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "flex flex-col", children: navItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
1451
+ Pressable,
1452
+ {
1453
+ href: item.url,
1454
+ className: "flex h-15 items-center gap-2 rounded-md px-4 text-left text-base leading-[3.75] font-normal text-muted-foreground ring-ring/10 outline-ring/50 transition-all hover:bg-muted focus-visible:ring-4 focus-visible:outline-1",
1455
+ onClick: handleClose,
1456
+ children: [
1457
+ item.icon ?? (item.iconName && /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: item.iconName, size: 16 })),
1458
+ item.title
1459
+ ]
1460
+ },
1461
+ `nav-link-${index}`
1462
+ )) }),
1463
+ renderMobileActions
1464
+ ] }) }) });
1376
1465
  };
1377
1466
 
1378
1467
  exports.NavbarSearchFocused = NavbarSearchFocused;