@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.
- package/dist/navbar-animated-preview.cjs +16 -16
- package/dist/navbar-animated-preview.js +16 -16
- package/dist/navbar-centered-menu.cjs +1 -1
- package/dist/navbar-centered-menu.js +1 -1
- package/dist/navbar-dark-icons.cjs +1 -1
- package/dist/navbar-dark-icons.js +1 -1
- package/dist/navbar-dropdown-menu.cjs +1 -1
- package/dist/navbar-dropdown-menu.js +1 -1
- package/dist/navbar-education-platform.cjs +278 -236
- package/dist/navbar-education-platform.d.cts +61 -36
- package/dist/navbar-education-platform.d.ts +61 -36
- package/dist/navbar-education-platform.js +279 -237
- package/dist/navbar-enterprise-mega.cjs +6 -6
- package/dist/navbar-enterprise-mega.js +6 -6
- package/dist/navbar-feature-grid.cjs +1 -1
- package/dist/navbar-feature-grid.js +1 -1
- package/dist/navbar-icon-links.cjs +2 -1
- package/dist/navbar-icon-links.js +2 -1
- package/dist/navbar-image-preview.cjs +129 -50
- package/dist/navbar-image-preview.js +128 -50
- package/dist/navbar-mega-menu.cjs +1 -1
- package/dist/navbar-mega-menu.js +1 -1
- package/dist/navbar-multi-column-groups.cjs +53 -49
- package/dist/navbar-multi-column-groups.js +53 -49
- package/dist/navbar-platform-resources.cjs +5 -4
- package/dist/navbar-platform-resources.js +5 -4
- package/dist/navbar-search-focused.cjs +1 -1
- package/dist/navbar-search-focused.js +1 -1
- package/dist/navbar-sidebar-mobile.cjs +235 -166
- package/dist/navbar-sidebar-mobile.js +236 -167
- package/dist/navbar-simple-links.cjs +228 -184
- package/dist/navbar-simple-links.d.cts +15 -3
- package/dist/navbar-simple-links.d.ts +15 -3
- package/dist/navbar-simple-links.js +228 -183
- package/dist/navbar-split-cta.cjs +3 -3
- package/dist/navbar-split-cta.js +3 -3
- package/dist/navbar-sticky-compact.cjs +1 -1
- package/dist/navbar-sticky-compact.js +1 -1
- package/dist/navbar-tabbed-sections.cjs +1 -1
- package/dist/navbar-tabbed-sections.js +1 -1
- package/dist/navbar-transparent-overlay.cjs +244 -123
- package/dist/navbar-transparent-overlay.d.cts +30 -1
- package/dist/navbar-transparent-overlay.d.ts +30 -1
- package/dist/navbar-transparent-overlay.js +244 -123
- package/dist/registry.cjs +1008 -894
- package/dist/registry.js +1008 -894
- package/package.json +1 -1
|
@@ -1139,7 +1139,7 @@ var NavbarMobileMenu = ({
|
|
|
1139
1139
|
"data-state": open ? "open" : "closed",
|
|
1140
1140
|
children: [
|
|
1141
1141
|
/* @__PURE__ */ jsx("div", { className: "sr-only", children: /* @__PURE__ */ jsx("h2", { children: title }) }),
|
|
1142
|
-
/* @__PURE__ */ jsx("div", { className: "absolute top-
|
|
1142
|
+
/* @__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(
|
|
1143
1143
|
"button",
|
|
1144
1144
|
{
|
|
1145
1145
|
onClick: onClose,
|
|
@@ -1834,7 +1834,7 @@ var DesktopMenuItem = ({
|
|
|
1834
1834
|
if (hasDropdown) {
|
|
1835
1835
|
return /* @__PURE__ */ jsxs(NavigationMenuItem, { value: `${index}`, children: [
|
|
1836
1836
|
/* @__PURE__ */ jsx(NavigationMenuTrigger, { className: "h-auto bg-transparent px-3 py-2 font-normal hover:bg-muted focus:bg-muted data-[state=open]:bg-muted/50", children: item.label }),
|
|
1837
|
-
/* @__PURE__ */ jsx(NavigationMenuContent, { className: "
|
|
1837
|
+
/* @__PURE__ */ jsx(NavigationMenuContent, { className: "rounded-xl! border-0! p-4!", children: renderDropdownContent(
|
|
1838
1838
|
{ ...item, layout: effectiveLayout },
|
|
1839
1839
|
optixFlowConfig
|
|
1840
1840
|
) })
|
|
@@ -1905,7 +1905,7 @@ var renderDropdownContent = (item, optixFlowConfig) => {
|
|
|
1905
1905
|
var renderMobileDropdownContent = (item) => {
|
|
1906
1906
|
switch (item.layout) {
|
|
1907
1907
|
case "solutions-with-platform":
|
|
1908
|
-
return /* @__PURE__ */ jsx("div", { className: "
|
|
1908
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col space-y-2", children: item.solutionCards?.map((solution) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
1909
1909
|
/* @__PURE__ */ jsx(
|
|
1910
1910
|
Pressable,
|
|
1911
1911
|
{
|
|
@@ -1933,7 +1933,7 @@ var renderMobileDropdownContent = (item) => {
|
|
|
1933
1933
|
Pressable,
|
|
1934
1934
|
{
|
|
1935
1935
|
href: product.href,
|
|
1936
|
-
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
1936
|
+
className: "flex items-center pl-4 gap-2 text-sm text-muted-foreground",
|
|
1937
1937
|
children: product.title
|
|
1938
1938
|
},
|
|
1939
1939
|
product.id
|
|
@@ -1944,7 +1944,7 @@ var renderMobileDropdownContent = (item) => {
|
|
|
1944
1944
|
Pressable,
|
|
1945
1945
|
{
|
|
1946
1946
|
href: resource.href,
|
|
1947
|
-
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
1947
|
+
className: "flex items-center pl-4 gap-2 text-sm text-muted-foreground",
|
|
1948
1948
|
children: [
|
|
1949
1949
|
/* @__PURE__ */ jsx(DynamicIcon, { name: resource.icon, size: 14 }),
|
|
1950
1950
|
resource.title
|
|
@@ -2033,7 +2033,7 @@ var MobileNavigationMenu = ({
|
|
|
2033
2033
|
typeof item.label === "string" ? item.label : `nav-${index}`
|
|
2034
2034
|
);
|
|
2035
2035
|
}) }),
|
|
2036
|
-
/* @__PURE__ */ jsx("div", { className: cn("mt-
|
|
2036
|
+
/* @__PURE__ */ jsx("div", { className: cn("mt-4 flex flex-col gap-4", actionsClassName), children: renderActions })
|
|
2037
2037
|
] })
|
|
2038
2038
|
}
|
|
2039
2039
|
);
|
|
@@ -1162,7 +1162,7 @@ var NavbarMobileMenu = ({
|
|
|
1162
1162
|
"data-state": open ? "open" : "closed",
|
|
1163
1163
|
children: [
|
|
1164
1164
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sr-only", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: title }) }),
|
|
1165
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-
|
|
1165
|
+
/* @__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(
|
|
1166
1166
|
"button",
|
|
1167
1167
|
{
|
|
1168
1168
|
onClick: onClose,
|
|
@@ -1139,7 +1139,7 @@ var NavbarMobileMenu = ({
|
|
|
1139
1139
|
"data-state": open ? "open" : "closed",
|
|
1140
1140
|
children: [
|
|
1141
1141
|
/* @__PURE__ */ jsx("div", { className: "sr-only", children: /* @__PURE__ */ jsx("h2", { children: title }) }),
|
|
1142
|
-
/* @__PURE__ */ jsx("div", { className: "absolute top-
|
|
1142
|
+
/* @__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(
|
|
1143
1143
|
"button",
|
|
1144
1144
|
{
|
|
1145
1145
|
onClick: onClose,
|
|
@@ -1059,7 +1059,7 @@ var NavbarMobileMenu = ({
|
|
|
1059
1059
|
"data-state": open ? "open" : "closed",
|
|
1060
1060
|
children: [
|
|
1061
1061
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sr-only", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: title }) }),
|
|
1062
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-
|
|
1062
|
+
/* @__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(
|
|
1063
1063
|
"button",
|
|
1064
1064
|
{
|
|
1065
1065
|
onClick: onClose,
|
|
@@ -1265,6 +1265,7 @@ var NavbarIconLinks = ({
|
|
|
1265
1265
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1266
1266
|
Pressable,
|
|
1267
1267
|
{
|
|
1268
|
+
size: "icon",
|
|
1268
1269
|
className: cn(
|
|
1269
1270
|
"flex h-10 w-10 items-center justify-center rounded-md transition-colors",
|
|
1270
1271
|
"text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
@@ -1036,7 +1036,7 @@ var NavbarMobileMenu = ({
|
|
|
1036
1036
|
"data-state": open ? "open" : "closed",
|
|
1037
1037
|
children: [
|
|
1038
1038
|
/* @__PURE__ */ jsx("div", { className: "sr-only", children: /* @__PURE__ */ jsx("h2", { children: title }) }),
|
|
1039
|
-
/* @__PURE__ */ jsx("div", { className: "absolute top-
|
|
1039
|
+
/* @__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(
|
|
1040
1040
|
"button",
|
|
1041
1041
|
{
|
|
1042
1042
|
onClick: onClose,
|
|
@@ -1242,6 +1242,7 @@ var NavbarIconLinks = ({
|
|
|
1242
1242
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
1243
1243
|
Pressable,
|
|
1244
1244
|
{
|
|
1245
|
+
size: "icon",
|
|
1245
1246
|
className: cn(
|
|
1246
1247
|
"flex h-10 w-10 items-center justify-center rounded-md transition-colors",
|
|
1247
1248
|
"text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
@@ -7,6 +7,7 @@ var tailwindMerge = require('tailwind-merge');
|
|
|
7
7
|
var classVarianceAuthority = require('class-variance-authority');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
var img = require('@page-speed/img');
|
|
10
|
+
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
10
11
|
var NavigationMenuPrimitive = require('@radix-ui/react-navigation-menu');
|
|
11
12
|
|
|
12
13
|
function _interopNamespace(e) {
|
|
@@ -28,6 +29,7 @@ function _interopNamespace(e) {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
32
|
+
var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
|
|
31
33
|
var NavigationMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(NavigationMenuPrimitive);
|
|
32
34
|
|
|
33
35
|
// components/blocks/navbars/navbar-image-preview.tsx
|
|
@@ -992,6 +994,66 @@ var NavbarLogo = ({
|
|
|
992
994
|
}
|
|
993
995
|
);
|
|
994
996
|
};
|
|
997
|
+
function Accordion({
|
|
998
|
+
...props
|
|
999
|
+
}) {
|
|
1000
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Root, { "data-slot": "accordion", ...props });
|
|
1001
|
+
}
|
|
1002
|
+
function AccordionItem({
|
|
1003
|
+
className,
|
|
1004
|
+
...props
|
|
1005
|
+
}) {
|
|
1006
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1007
|
+
AccordionPrimitive__namespace.Item,
|
|
1008
|
+
{
|
|
1009
|
+
"data-slot": "accordion-item",
|
|
1010
|
+
className: cn("border-b ", className),
|
|
1011
|
+
...props
|
|
1012
|
+
}
|
|
1013
|
+
);
|
|
1014
|
+
}
|
|
1015
|
+
function AccordionTrigger({
|
|
1016
|
+
className,
|
|
1017
|
+
children,
|
|
1018
|
+
...props
|
|
1019
|
+
}) {
|
|
1020
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1021
|
+
AccordionPrimitive__namespace.Trigger,
|
|
1022
|
+
{
|
|
1023
|
+
"data-slot": "accordion-trigger",
|
|
1024
|
+
className: cn(
|
|
1025
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-center justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
1026
|
+
className
|
|
1027
|
+
),
|
|
1028
|
+
...props,
|
|
1029
|
+
children: [
|
|
1030
|
+
children,
|
|
1031
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1032
|
+
DynamicIcon,
|
|
1033
|
+
{
|
|
1034
|
+
name: "lucide/chevron-down",
|
|
1035
|
+
className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"
|
|
1036
|
+
}
|
|
1037
|
+
)
|
|
1038
|
+
]
|
|
1039
|
+
}
|
|
1040
|
+
) });
|
|
1041
|
+
}
|
|
1042
|
+
function AccordionContent({
|
|
1043
|
+
className,
|
|
1044
|
+
children,
|
|
1045
|
+
...props
|
|
1046
|
+
}) {
|
|
1047
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1048
|
+
AccordionPrimitive__namespace.Content,
|
|
1049
|
+
{
|
|
1050
|
+
"data-slot": "accordion-content",
|
|
1051
|
+
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
1052
|
+
...props,
|
|
1053
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("pt-0 pb-4", className), children })
|
|
1054
|
+
}
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
995
1057
|
function NavigationMenu({
|
|
996
1058
|
className,
|
|
997
1059
|
children,
|
|
@@ -1160,7 +1222,7 @@ var NavbarMobileMenu = ({
|
|
|
1160
1222
|
"data-state": open ? "open" : "closed",
|
|
1161
1223
|
children: [
|
|
1162
1224
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sr-only", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: title }) }),
|
|
1163
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-
|
|
1225
|
+
/* @__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(
|
|
1164
1226
|
"button",
|
|
1165
1227
|
{
|
|
1166
1228
|
onClick: onClose,
|
|
@@ -1479,7 +1541,7 @@ var DesktopMenuItem = ({
|
|
|
1479
1541
|
onMouseLeave: handleMouseLeave,
|
|
1480
1542
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1481
1543
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm leading-normal font-medium", children: link.label }),
|
|
1482
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs leading-normal
|
|
1544
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs leading-normal", children: link.description })
|
|
1483
1545
|
] })
|
|
1484
1546
|
}
|
|
1485
1547
|
) }, `desktop-nav-sublink-${linkIndex}`)) })
|
|
@@ -1507,44 +1569,17 @@ var MobileNavigationMenu = ({
|
|
|
1507
1569
|
authActions,
|
|
1508
1570
|
authActionsSlot
|
|
1509
1571
|
}) => {
|
|
1510
|
-
const
|
|
1511
|
-
if (mobileNavigationSlot) return mobileNavigationSlot;
|
|
1512
|
-
if (!mobileNavigation || mobileNavigation.length === 0) return null;
|
|
1513
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid w-full grid-cols-2 gap-x-4 gap-y-10", children: mobileNavigation.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1514
|
-
"div",
|
|
1515
|
-
{
|
|
1516
|
-
className: cn(
|
|
1517
|
-
"flex flex-col gap-4 text-primary-foreground",
|
|
1518
|
-
item.className
|
|
1519
|
-
),
|
|
1520
|
-
children: [
|
|
1521
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground uppercase", children: item.title }),
|
|
1522
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-3", children: item.links?.map((link, i) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1523
|
-
Pressable,
|
|
1524
|
-
{
|
|
1525
|
-
href: getLinkUrl(link),
|
|
1526
|
-
className: cn(
|
|
1527
|
-
"text-primary-foreground leading-normal font-medium",
|
|
1528
|
-
index === 0 ? "text-2xl" : "text-base"
|
|
1529
|
-
),
|
|
1530
|
-
children: link.label
|
|
1531
|
-
}
|
|
1532
|
-
) }, `mobile-nav-link-${i}`)) })
|
|
1533
|
-
]
|
|
1534
|
-
},
|
|
1535
|
-
`mobile-menu-item-${index}`
|
|
1536
|
-
)) });
|
|
1537
|
-
}, [mobileNavigationSlot, mobileNavigation]);
|
|
1572
|
+
const handleClose = () => setOpen(false);
|
|
1538
1573
|
const renderSocialLinks = React.useMemo(() => {
|
|
1539
1574
|
if (socialLinksSlot) return socialLinksSlot;
|
|
1540
1575
|
if (!socialLinks || socialLinks.length === 0) return null;
|
|
1541
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "
|
|
1542
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-
|
|
1543
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-4", children: socialLinks.map((link, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1576
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 mt-6", children: [
|
|
1577
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 text-[10px] text-muted-foreground uppercase", children: "SOCIAL" }),
|
|
1578
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-4 px-4", children: socialLinks.map((link, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1544
1579
|
Pressable,
|
|
1545
1580
|
{
|
|
1546
1581
|
href: link.url,
|
|
1547
|
-
|
|
1582
|
+
onClick: handleClose,
|
|
1548
1583
|
children: [
|
|
1549
1584
|
link.icon ?? (link.iconName && /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: link.iconName, size: 20 })),
|
|
1550
1585
|
!link.icon && !link.iconName && link.label
|
|
@@ -1553,11 +1588,11 @@ var MobileNavigationMenu = ({
|
|
|
1553
1588
|
`social-link-${index}`
|
|
1554
1589
|
)) })
|
|
1555
1590
|
] });
|
|
1556
|
-
}, [socialLinksSlot, socialLinks]);
|
|
1591
|
+
}, [socialLinksSlot, socialLinks, handleClose]);
|
|
1557
1592
|
const renderMobileAuthActions = React.useMemo(() => {
|
|
1558
1593
|
if (authActionsSlot) return authActionsSlot;
|
|
1559
1594
|
if (!authActions || authActions.length === 0) return null;
|
|
1560
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-
|
|
1595
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-4 mt-6", children: authActions.map((action, index) => {
|
|
1561
1596
|
const {
|
|
1562
1597
|
label,
|
|
1563
1598
|
icon,
|
|
@@ -1571,6 +1606,7 @@ var MobileNavigationMenu = ({
|
|
|
1571
1606
|
{
|
|
1572
1607
|
asButton: true,
|
|
1573
1608
|
className: cn("w-full", actionClassName),
|
|
1609
|
+
onClick: handleClose,
|
|
1574
1610
|
...pressableProps,
|
|
1575
1611
|
children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1576
1612
|
icon,
|
|
@@ -1581,20 +1617,63 @@ var MobileNavigationMenu = ({
|
|
|
1581
1617
|
index
|
|
1582
1618
|
);
|
|
1583
1619
|
}) });
|
|
1584
|
-
}, [authActionsSlot, authActions]);
|
|
1585
|
-
|
|
1586
|
-
NavbarMobileMenu,
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1620
|
+
}, [authActionsSlot, authActions, handleClose]);
|
|
1621
|
+
if (mobileNavigationSlot) {
|
|
1622
|
+
return /* @__PURE__ */ jsxRuntime.jsx(NavbarMobileMenu, { open, onClose: handleClose, title: "Mobile Navigation", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-screen-sm mx-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
1623
|
+
mobileNavigationSlot,
|
|
1624
|
+
renderSocialLinks,
|
|
1625
|
+
renderMobileAuthActions
|
|
1626
|
+
] }) }) });
|
|
1627
|
+
}
|
|
1628
|
+
return /* @__PURE__ */ jsxRuntime.jsx(NavbarMobileMenu, { open, onClose: handleClose, title: "Mobile Navigation", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-screen-sm mx-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
1629
|
+
/* @__PURE__ */ jsxRuntime.jsx(Accordion, { type: "multiple", className: "w-full", children: mobileNavigation.map((item, index) => {
|
|
1630
|
+
if (item.links && item.links.length > 0) {
|
|
1631
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1632
|
+
AccordionItem,
|
|
1633
|
+
{
|
|
1634
|
+
value: `nav-${index}`,
|
|
1635
|
+
className: "border-b-0",
|
|
1636
|
+
children: [
|
|
1637
|
+
/* @__PURE__ */ jsxRuntime.jsx(AccordionTrigger, { className: "h-15 items-center p-0 px-4! text-base leading-[3.75] font-normal text-muted-foreground hover:bg-muted hover:no-underline", children: item.title }),
|
|
1638
|
+
/* @__PURE__ */ jsxRuntime.jsx(AccordionContent, { className: "overflow-x-none", children: item.links.map((link, linkIndex) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1639
|
+
Pressable,
|
|
1640
|
+
{
|
|
1641
|
+
href: getLinkUrl(link),
|
|
1642
|
+
className: "flex min-h-12 items-center gap-2 rounded-lg px-4 text-muted-foreground transition-colors duration-300 hover:bg-muted hover:text-foreground",
|
|
1643
|
+
onClick: handleClose,
|
|
1644
|
+
children: [
|
|
1645
|
+
link.icon ? link.icon : link.iconName ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1646
|
+
DynamicIcon,
|
|
1647
|
+
{
|
|
1648
|
+
name: link.iconName,
|
|
1649
|
+
size: 16,
|
|
1650
|
+
className: "stroke-muted-foreground"
|
|
1651
|
+
}
|
|
1652
|
+
) : null,
|
|
1653
|
+
link.label
|
|
1654
|
+
]
|
|
1655
|
+
},
|
|
1656
|
+
`mobile-link-${linkIndex}`
|
|
1657
|
+
)) })
|
|
1658
|
+
]
|
|
1659
|
+
},
|
|
1660
|
+
`nav-item-${index}`
|
|
1661
|
+
);
|
|
1662
|
+
}
|
|
1663
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1664
|
+
Pressable,
|
|
1665
|
+
{
|
|
1666
|
+
href: item.url,
|
|
1667
|
+
className: "flex h-15 items-center rounded-md p-0 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",
|
|
1668
|
+
onClick: handleClose,
|
|
1669
|
+
children: item.title
|
|
1670
|
+
},
|
|
1671
|
+
`nav-link-${index}`
|
|
1672
|
+
);
|
|
1673
|
+
}) }),
|
|
1674
|
+
renderSocialLinks,
|
|
1675
|
+
renderMobileAuthActions
|
|
1676
|
+
] }) }) });
|
|
1598
1677
|
};
|
|
1599
1678
|
|
|
1600
1679
|
exports.NavbarImagePreview = NavbarImagePreview;
|
|
@@ -6,6 +6,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
6
6
|
import { cva } from 'class-variance-authority';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { Img } from '@page-speed/img';
|
|
9
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
9
10
|
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
10
11
|
|
|
11
12
|
// components/blocks/navbars/navbar-image-preview.tsx
|
|
@@ -970,6 +971,66 @@ var NavbarLogo = ({
|
|
|
970
971
|
}
|
|
971
972
|
);
|
|
972
973
|
};
|
|
974
|
+
function Accordion({
|
|
975
|
+
...props
|
|
976
|
+
}) {
|
|
977
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
|
|
978
|
+
}
|
|
979
|
+
function AccordionItem({
|
|
980
|
+
className,
|
|
981
|
+
...props
|
|
982
|
+
}) {
|
|
983
|
+
return /* @__PURE__ */ jsx(
|
|
984
|
+
AccordionPrimitive.Item,
|
|
985
|
+
{
|
|
986
|
+
"data-slot": "accordion-item",
|
|
987
|
+
className: cn("border-b ", className),
|
|
988
|
+
...props
|
|
989
|
+
}
|
|
990
|
+
);
|
|
991
|
+
}
|
|
992
|
+
function AccordionTrigger({
|
|
993
|
+
className,
|
|
994
|
+
children,
|
|
995
|
+
...props
|
|
996
|
+
}) {
|
|
997
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
998
|
+
AccordionPrimitive.Trigger,
|
|
999
|
+
{
|
|
1000
|
+
"data-slot": "accordion-trigger",
|
|
1001
|
+
className: cn(
|
|
1002
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-center justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
1003
|
+
className
|
|
1004
|
+
),
|
|
1005
|
+
...props,
|
|
1006
|
+
children: [
|
|
1007
|
+
children,
|
|
1008
|
+
/* @__PURE__ */ jsx(
|
|
1009
|
+
DynamicIcon,
|
|
1010
|
+
{
|
|
1011
|
+
name: "lucide/chevron-down",
|
|
1012
|
+
className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"
|
|
1013
|
+
}
|
|
1014
|
+
)
|
|
1015
|
+
]
|
|
1016
|
+
}
|
|
1017
|
+
) });
|
|
1018
|
+
}
|
|
1019
|
+
function AccordionContent({
|
|
1020
|
+
className,
|
|
1021
|
+
children,
|
|
1022
|
+
...props
|
|
1023
|
+
}) {
|
|
1024
|
+
return /* @__PURE__ */ jsx(
|
|
1025
|
+
AccordionPrimitive.Content,
|
|
1026
|
+
{
|
|
1027
|
+
"data-slot": "accordion-content",
|
|
1028
|
+
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
1029
|
+
...props,
|
|
1030
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("pt-0 pb-4", className), children })
|
|
1031
|
+
}
|
|
1032
|
+
);
|
|
1033
|
+
}
|
|
973
1034
|
function NavigationMenu({
|
|
974
1035
|
className,
|
|
975
1036
|
children,
|
|
@@ -1138,7 +1199,7 @@ var NavbarMobileMenu = ({
|
|
|
1138
1199
|
"data-state": open ? "open" : "closed",
|
|
1139
1200
|
children: [
|
|
1140
1201
|
/* @__PURE__ */ jsx("div", { className: "sr-only", children: /* @__PURE__ */ jsx("h2", { children: title }) }),
|
|
1141
|
-
/* @__PURE__ */ jsx("div", { className: "absolute top-
|
|
1202
|
+
/* @__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(
|
|
1142
1203
|
"button",
|
|
1143
1204
|
{
|
|
1144
1205
|
onClick: onClose,
|
|
@@ -1457,7 +1518,7 @@ var DesktopMenuItem = ({
|
|
|
1457
1518
|
onMouseLeave: handleMouseLeave,
|
|
1458
1519
|
children: /* @__PURE__ */ jsxs("div", { children: [
|
|
1459
1520
|
/* @__PURE__ */ jsx("h3", { className: "text-sm leading-normal font-medium", children: link.label }),
|
|
1460
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs leading-normal
|
|
1521
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs leading-normal", children: link.description })
|
|
1461
1522
|
] })
|
|
1462
1523
|
}
|
|
1463
1524
|
) }, `desktop-nav-sublink-${linkIndex}`)) })
|
|
@@ -1485,44 +1546,17 @@ var MobileNavigationMenu = ({
|
|
|
1485
1546
|
authActions,
|
|
1486
1547
|
authActionsSlot
|
|
1487
1548
|
}) => {
|
|
1488
|
-
const
|
|
1489
|
-
if (mobileNavigationSlot) return mobileNavigationSlot;
|
|
1490
|
-
if (!mobileNavigation || mobileNavigation.length === 0) return null;
|
|
1491
|
-
return /* @__PURE__ */ jsx("div", { className: "grid w-full grid-cols-2 gap-x-4 gap-y-10", children: mobileNavigation.map((item, index) => /* @__PURE__ */ jsxs(
|
|
1492
|
-
"div",
|
|
1493
|
-
{
|
|
1494
|
-
className: cn(
|
|
1495
|
-
"flex flex-col gap-4 text-primary-foreground",
|
|
1496
|
-
item.className
|
|
1497
|
-
),
|
|
1498
|
-
children: [
|
|
1499
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground uppercase", children: item.title }),
|
|
1500
|
-
/* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-3", children: item.links?.map((link, i) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
1501
|
-
Pressable,
|
|
1502
|
-
{
|
|
1503
|
-
href: getLinkUrl(link),
|
|
1504
|
-
className: cn(
|
|
1505
|
-
"text-primary-foreground leading-normal font-medium",
|
|
1506
|
-
index === 0 ? "text-2xl" : "text-base"
|
|
1507
|
-
),
|
|
1508
|
-
children: link.label
|
|
1509
|
-
}
|
|
1510
|
-
) }, `mobile-nav-link-${i}`)) })
|
|
1511
|
-
]
|
|
1512
|
-
},
|
|
1513
|
-
`mobile-menu-item-${index}`
|
|
1514
|
-
)) });
|
|
1515
|
-
}, [mobileNavigationSlot, mobileNavigation]);
|
|
1549
|
+
const handleClose = () => setOpen(false);
|
|
1516
1550
|
const renderSocialLinks = useMemo(() => {
|
|
1517
1551
|
if (socialLinksSlot) return socialLinksSlot;
|
|
1518
1552
|
if (!socialLinks || socialLinks.length === 0) return null;
|
|
1519
|
-
return /* @__PURE__ */ jsxs("div", { className: "
|
|
1520
|
-
/* @__PURE__ */ jsx("div", { className: "text-
|
|
1521
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-4", children: socialLinks.map((link, index) => /* @__PURE__ */ jsxs(
|
|
1553
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 mt-6", children: [
|
|
1554
|
+
/* @__PURE__ */ jsx("div", { className: "px-4 text-[10px] text-muted-foreground uppercase", children: "SOCIAL" }),
|
|
1555
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-4 px-4", children: socialLinks.map((link, index) => /* @__PURE__ */ jsxs(
|
|
1522
1556
|
Pressable,
|
|
1523
1557
|
{
|
|
1524
1558
|
href: link.url,
|
|
1525
|
-
|
|
1559
|
+
onClick: handleClose,
|
|
1526
1560
|
children: [
|
|
1527
1561
|
link.icon ?? (link.iconName && /* @__PURE__ */ jsx(DynamicIcon, { name: link.iconName, size: 20 })),
|
|
1528
1562
|
!link.icon && !link.iconName && link.label
|
|
@@ -1531,11 +1565,11 @@ var MobileNavigationMenu = ({
|
|
|
1531
1565
|
`social-link-${index}`
|
|
1532
1566
|
)) })
|
|
1533
1567
|
] });
|
|
1534
|
-
}, [socialLinksSlot, socialLinks]);
|
|
1568
|
+
}, [socialLinksSlot, socialLinks, handleClose]);
|
|
1535
1569
|
const renderMobileAuthActions = useMemo(() => {
|
|
1536
1570
|
if (authActionsSlot) return authActionsSlot;
|
|
1537
1571
|
if (!authActions || authActions.length === 0) return null;
|
|
1538
|
-
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-
|
|
1572
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 mt-6", children: authActions.map((action, index) => {
|
|
1539
1573
|
const {
|
|
1540
1574
|
label,
|
|
1541
1575
|
icon,
|
|
@@ -1549,6 +1583,7 @@ var MobileNavigationMenu = ({
|
|
|
1549
1583
|
{
|
|
1550
1584
|
asButton: true,
|
|
1551
1585
|
className: cn("w-full", actionClassName),
|
|
1586
|
+
onClick: handleClose,
|
|
1552
1587
|
...pressableProps,
|
|
1553
1588
|
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1554
1589
|
icon,
|
|
@@ -1559,20 +1594,63 @@ var MobileNavigationMenu = ({
|
|
|
1559
1594
|
index
|
|
1560
1595
|
);
|
|
1561
1596
|
}) });
|
|
1562
|
-
}, [authActionsSlot, authActions]);
|
|
1563
|
-
|
|
1564
|
-
NavbarMobileMenu,
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1597
|
+
}, [authActionsSlot, authActions, handleClose]);
|
|
1598
|
+
if (mobileNavigationSlot) {
|
|
1599
|
+
return /* @__PURE__ */ jsx(NavbarMobileMenu, { open, onClose: handleClose, title: "Mobile Navigation", children: /* @__PURE__ */ jsx("div", { className: "max-w-screen-sm mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
1600
|
+
mobileNavigationSlot,
|
|
1601
|
+
renderSocialLinks,
|
|
1602
|
+
renderMobileAuthActions
|
|
1603
|
+
] }) }) });
|
|
1604
|
+
}
|
|
1605
|
+
return /* @__PURE__ */ jsx(NavbarMobileMenu, { open, onClose: handleClose, title: "Mobile Navigation", children: /* @__PURE__ */ jsx("div", { className: "max-w-screen-sm mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
1606
|
+
/* @__PURE__ */ jsx(Accordion, { type: "multiple", className: "w-full", children: mobileNavigation.map((item, index) => {
|
|
1607
|
+
if (item.links && item.links.length > 0) {
|
|
1608
|
+
return /* @__PURE__ */ jsxs(
|
|
1609
|
+
AccordionItem,
|
|
1610
|
+
{
|
|
1611
|
+
value: `nav-${index}`,
|
|
1612
|
+
className: "border-b-0",
|
|
1613
|
+
children: [
|
|
1614
|
+
/* @__PURE__ */ jsx(AccordionTrigger, { className: "h-15 items-center p-0 px-4! text-base leading-[3.75] font-normal text-muted-foreground hover:bg-muted hover:no-underline", children: item.title }),
|
|
1615
|
+
/* @__PURE__ */ jsx(AccordionContent, { className: "overflow-x-none", children: item.links.map((link, linkIndex) => /* @__PURE__ */ jsxs(
|
|
1616
|
+
Pressable,
|
|
1617
|
+
{
|
|
1618
|
+
href: getLinkUrl(link),
|
|
1619
|
+
className: "flex min-h-12 items-center gap-2 rounded-lg px-4 text-muted-foreground transition-colors duration-300 hover:bg-muted hover:text-foreground",
|
|
1620
|
+
onClick: handleClose,
|
|
1621
|
+
children: [
|
|
1622
|
+
link.icon ? link.icon : link.iconName ? /* @__PURE__ */ jsx(
|
|
1623
|
+
DynamicIcon,
|
|
1624
|
+
{
|
|
1625
|
+
name: link.iconName,
|
|
1626
|
+
size: 16,
|
|
1627
|
+
className: "stroke-muted-foreground"
|
|
1628
|
+
}
|
|
1629
|
+
) : null,
|
|
1630
|
+
link.label
|
|
1631
|
+
]
|
|
1632
|
+
},
|
|
1633
|
+
`mobile-link-${linkIndex}`
|
|
1634
|
+
)) })
|
|
1635
|
+
]
|
|
1636
|
+
},
|
|
1637
|
+
`nav-item-${index}`
|
|
1638
|
+
);
|
|
1639
|
+
}
|
|
1640
|
+
return /* @__PURE__ */ jsx(
|
|
1641
|
+
Pressable,
|
|
1642
|
+
{
|
|
1643
|
+
href: item.url,
|
|
1644
|
+
className: "flex h-15 items-center rounded-md p-0 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",
|
|
1645
|
+
onClick: handleClose,
|
|
1646
|
+
children: item.title
|
|
1647
|
+
},
|
|
1648
|
+
`nav-link-${index}`
|
|
1649
|
+
);
|
|
1650
|
+
}) }),
|
|
1651
|
+
renderSocialLinks,
|
|
1652
|
+
renderMobileAuthActions
|
|
1653
|
+
] }) }) });
|
|
1576
1654
|
};
|
|
1577
1655
|
|
|
1578
1656
|
export { NavbarImagePreview };
|
|
@@ -1222,7 +1222,7 @@ var NavbarMobileMenu = ({
|
|
|
1222
1222
|
"data-state": open ? "open" : "closed",
|
|
1223
1223
|
children: [
|
|
1224
1224
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sr-only", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: title }) }),
|
|
1225
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-
|
|
1225
|
+
/* @__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(
|
|
1226
1226
|
"button",
|
|
1227
1227
|
{
|
|
1228
1228
|
onClick: onClose,
|
package/dist/navbar-mega-menu.js
CHANGED
|
@@ -1199,7 +1199,7 @@ var NavbarMobileMenu = ({
|
|
|
1199
1199
|
"data-state": open ? "open" : "closed",
|
|
1200
1200
|
children: [
|
|
1201
1201
|
/* @__PURE__ */ jsx("div", { className: "sr-only", children: /* @__PURE__ */ jsx("h2", { children: title }) }),
|
|
1202
|
-
/* @__PURE__ */ jsx("div", { className: "absolute top-
|
|
1202
|
+
/* @__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(
|
|
1203
1203
|
"button",
|
|
1204
1204
|
{
|
|
1205
1205
|
onClick: onClose,
|