@moontra/moonui-pro 3.4.9 → 3.4.11
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/cdn/index.global.js +126 -126
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +43 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3930,6 +3930,12 @@ interface NavbarConfig {
|
|
|
3930
3930
|
sections: NavbarSection[];
|
|
3931
3931
|
branding?: {
|
|
3932
3932
|
logo?: React__default.ReactNode;
|
|
3933
|
+
/** Logo to show when navbar is scrolled (falls back to logo if not provided) */
|
|
3934
|
+
logoSmall?: React__default.ReactNode;
|
|
3935
|
+
/** Logo to show in light mode (falls back to logo if not provided) */
|
|
3936
|
+
logoLight?: React__default.ReactNode;
|
|
3937
|
+
/** Logo to show in dark mode (falls back to logo if not provided) */
|
|
3938
|
+
logoDark?: React__default.ReactNode;
|
|
3933
3939
|
title?: string;
|
|
3934
3940
|
href?: string;
|
|
3935
3941
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -78992,6 +78992,7 @@ function NavbarInternal({
|
|
|
78992
78992
|
const [isCommandOpen, setIsCommandOpen] = useState(false);
|
|
78993
78993
|
const [searchValue, setSearchValue] = useState("");
|
|
78994
78994
|
const [currentTheme, setCurrentTheme] = useState(theme);
|
|
78995
|
+
const [isDarkMode, setIsDarkMode] = useState(false);
|
|
78995
78996
|
const navRef = useRef(null);
|
|
78996
78997
|
const { scrolled, hidden, scrollProgress, isMinimal } = useNavbarScroll({
|
|
78997
78998
|
sticky,
|
|
@@ -79031,6 +79032,17 @@ function NavbarInternal({
|
|
|
79031
79032
|
const isDark = root.classList.contains("dark");
|
|
79032
79033
|
const currentDomTheme = isDark ? "dark" : "light";
|
|
79033
79034
|
setCurrentTheme(theme || currentDomTheme);
|
|
79035
|
+
setIsDarkMode(isDark);
|
|
79036
|
+
const observer = new MutationObserver((mutations) => {
|
|
79037
|
+
mutations.forEach((mutation) => {
|
|
79038
|
+
if (mutation.attributeName === "class") {
|
|
79039
|
+
const isDark2 = root.classList.contains("dark");
|
|
79040
|
+
setIsDarkMode(isDark2);
|
|
79041
|
+
}
|
|
79042
|
+
});
|
|
79043
|
+
});
|
|
79044
|
+
observer.observe(root, { attributes: true });
|
|
79045
|
+
return () => observer.disconnect();
|
|
79034
79046
|
} else {
|
|
79035
79047
|
setCurrentTheme(theme);
|
|
79036
79048
|
}
|
|
@@ -79050,6 +79062,14 @@ function NavbarInternal({
|
|
|
79050
79062
|
document.addEventListener("keydown", handleKeyDown3);
|
|
79051
79063
|
return () => document.removeEventListener("keydown", handleKeyDown3);
|
|
79052
79064
|
}, [keyboardShortcuts, enableCommandAI, onCommandAIOpen]);
|
|
79065
|
+
const getActiveLogo = useCallback(() => {
|
|
79066
|
+
if (!branding?.logo)
|
|
79067
|
+
return null;
|
|
79068
|
+
const isScrolled = framerScroll.isScrolled || scrolled;
|
|
79069
|
+
const scrollLogo = isScrolled && branding.logoSmall ? branding.logoSmall : null;
|
|
79070
|
+
const themeLogo = isDarkMode ? branding.logoDark || null : branding.logoLight || null;
|
|
79071
|
+
return scrollLogo || themeLogo || branding.logo;
|
|
79072
|
+
}, [branding, framerScroll.isScrolled, scrolled, isDarkMode]);
|
|
79053
79073
|
const handleItemClick = useCallback(
|
|
79054
79074
|
(item) => {
|
|
79055
79075
|
if (item.action) {
|
|
@@ -79154,7 +79174,7 @@ function NavbarInternal({
|
|
|
79154
79174
|
/* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "icon", className: "md:hidden", children: /* @__PURE__ */ jsx(Menu, { className: "h-5 w-5" }) }) }),
|
|
79155
79175
|
/* @__PURE__ */ jsx(SheetContent, { side: mobileMenuPosition, className: "w-80 p-0", children: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col", children: [
|
|
79156
79176
|
/* @__PURE__ */ jsx("div", { className: "flex items-center p-4 border-b", children: branding && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
79157
|
-
|
|
79177
|
+
getActiveLogo(),
|
|
79158
79178
|
branding.title && /* @__PURE__ */ jsx("span", { className: "font-semibold text-lg", children: branding.title })
|
|
79159
79179
|
] }) }),
|
|
79160
79180
|
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-4", children: !hideNavItems && sections.map((section) => /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
@@ -79357,7 +79377,17 @@ function NavbarInternal({
|
|
|
79357
79377
|
},
|
|
79358
79378
|
className: "flex items-center gap-2",
|
|
79359
79379
|
children: [
|
|
79360
|
-
|
|
79380
|
+
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(
|
|
79381
|
+
motion.div,
|
|
79382
|
+
{
|
|
79383
|
+
initial: { opacity: 0, scale: 0.9 },
|
|
79384
|
+
animate: { opacity: 1, scale: 1 },
|
|
79385
|
+
exit: { opacity: 0, scale: 0.9 },
|
|
79386
|
+
transition: { duration: 0.2, ease: "easeInOut" },
|
|
79387
|
+
children: getActiveLogo()
|
|
79388
|
+
},
|
|
79389
|
+
`logo-${framerScroll.isScrolled ? "scrolled" : "default"}-${isDarkMode ? "dark" : "light"}`
|
|
79390
|
+
) }),
|
|
79361
79391
|
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: branding.title && !isMobile && !framerScroll.isScrolled && /* @__PURE__ */ jsx(
|
|
79362
79392
|
motion.span,
|
|
79363
79393
|
{
|
|
@@ -79817,7 +79847,17 @@ function NavbarInternal({
|
|
|
79817
79847
|
},
|
|
79818
79848
|
className: "flex items-center gap-2",
|
|
79819
79849
|
children: [
|
|
79820
|
-
|
|
79850
|
+
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(
|
|
79851
|
+
motion.div,
|
|
79852
|
+
{
|
|
79853
|
+
initial: { opacity: 0, scale: 0.9 },
|
|
79854
|
+
animate: { opacity: 1, scale: 1 },
|
|
79855
|
+
exit: { opacity: 0, scale: 0.9 },
|
|
79856
|
+
transition: { duration: 0.2, ease: "easeInOut" },
|
|
79857
|
+
children: getActiveLogo()
|
|
79858
|
+
},
|
|
79859
|
+
`logo-${framerScroll.isScrolled ? "scrolled" : "default"}-${isDarkMode ? "dark" : "light"}`
|
|
79860
|
+
) }),
|
|
79821
79861
|
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: branding.title && !isMobile && !framerScroll.isScrolled && /* @__PURE__ */ jsx(
|
|
79822
79862
|
motion.span,
|
|
79823
79863
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.11",
|
|
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",
|