@moontra/moonui-pro 2.26.1 → 2.26.3
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.d.ts +1 -0
- package/dist/index.global.js +118 -110
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +98 -19
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
4
4
|
import * as t from 'react';
|
|
5
5
|
import t__default, { useState, useMemo, useCallback, useRef, useEffect, forwardRef, createContext, useContext, useLayoutEffect, useDebugValue, Component } from 'react';
|
|
6
6
|
import * as AccordionPrimitive2 from '@radix-ui/react-accordion';
|
|
7
|
-
import { Loader2, Play, ExternalLink, ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Minus, Clock, ChevronUp, Search, Mic, MicOff, Settings, RefreshCw, Zap, ChevronRight, Crown, Circle, ChevronLeft, Plus, Lock, Sparkles, ZoomOut, ZoomIn, Pause, VolumeX, Volume2, Download, Maximize2, Filter, Image as Image$1, Video, RotateCw, Minimize2, BarChart3, Menu, Bell, CheckCheck, CheckCircle, Palette, User, Settings2, LogOut, Edit3, LayoutGrid, Upload, Share2, Save, Phone, Globe, Eye, CheckCircle2, RotateCcw, Copy, Share, Trash2, CreditCard, XCircle, HelpCircle, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, Quote, Code as Code$1, Link as Link$1, Undo, Redo, Edit, GripVertical, Type, Heading1, Heading2, Heading3, CheckSquare, Highlighter, Link2, Table as Table$1, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Languages, Lightbulb, MoreVertical, TrendingUp, Activity, BellOff, Target, ArrowUpRight, ArrowDownRight, CalendarIcon, MapPin, Navigation, ArrowUp, ArrowDown, ArrowUpDown, Calendar as Calendar$1, DollarSign, Users, Map as Map$1, Music, Archive, File, FileSpreadsheet, FileJson, FileDown, ChevronsLeft, ChevronsRight, Star, Shield, Award, Gem, Flame, Repeat, Move, EyeOff, Timer, Square, Cpu, GitBranch, ArrowRight, Trash, MessageCircle, Paperclip, Printer, TrendingDown, Grip, Unlock, Github, Server, Monitor, MemoryStick, HardDrive, Network, Columns, PlusCircle, Pin, Sun, Moon, Send, Tag, Flag, Trophy, GitFork, Package } from 'lucide-react';
|
|
7
|
+
import { Loader2, Play, ExternalLink, ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Minus, Clock, ChevronUp, Search, Mic, MicOff, Settings, RefreshCw, Zap, ChevronRight, Crown, Circle, ChevronLeft, Plus, Lock, Sparkles, ZoomOut, ZoomIn, Pause, VolumeX, Volume2, Download, Maximize2, Filter, Image as Image$1, Video, RotateCw, Minimize2, BarChart3, Menu, Bell, CheckCheck, CheckCircle, Palette, User, Settings2, LogOut, Edit3, LayoutGrid, Upload, Share2, Save, Phone, Globe, Eye, CheckCircle2, RotateCcw, Copy, Share, Trash2, CreditCard, XCircle, HelpCircle, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, Quote, Code as Code$1, Link as Link$1, Undo, Redo, Edit, GripVertical, Type, Heading1, Heading2, Heading3, CheckSquare, Highlighter, Link2, Table as Table$1, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Languages, Lightbulb, MoreVertical, TrendingUp, Activity, BellOff, Target, ArrowUpRight, ArrowDownRight, CalendarIcon, MapPin, Navigation, ArrowUp, ArrowDown, ArrowUpDown, Calendar as Calendar$1, DollarSign, Users, Map as Map$1, Music, Archive, File, FileSpreadsheet, FileJson, FileDown, ChevronsLeft, ChevronsRight, Star, Shield, Award, Gem, Flame, Repeat, Move, EyeOff, Timer, Square, Cpu, GitBranch, ArrowRight, Trash, MessageCircle, Paperclip, Printer, TrendingDown, Grip, Unlock, Github, Server, Monitor, MemoryStick, HardDrive, Network, Columns, PlusCircle, Pin, Sun, Moon, Home, Send, Tag, Flag, Trophy, GitFork, Package } from 'lucide-react';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
10
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
@@ -74687,12 +74687,16 @@ function SidebarInternal({
|
|
|
74687
74687
|
const handleItemClick = useCallback((item) => {
|
|
74688
74688
|
if (item.action) {
|
|
74689
74689
|
item.action();
|
|
74690
|
-
} else if (item.href
|
|
74690
|
+
} else if (item.href) {
|
|
74691
74691
|
if (enableNProgress) {
|
|
74692
74692
|
NProgress.start();
|
|
74693
74693
|
setTimeout(() => NProgress.done(), 500);
|
|
74694
74694
|
}
|
|
74695
|
-
onNavigate
|
|
74695
|
+
if (onNavigate) {
|
|
74696
|
+
onNavigate(item.href);
|
|
74697
|
+
} else {
|
|
74698
|
+
window.location.href = item.href;
|
|
74699
|
+
}
|
|
74696
74700
|
if (isMobile) {
|
|
74697
74701
|
setIsOpen(false);
|
|
74698
74702
|
}
|
|
@@ -75165,7 +75169,7 @@ function NavbarInternal({
|
|
|
75165
75169
|
}) {
|
|
75166
75170
|
const [isMobile, setIsMobile] = useState(false);
|
|
75167
75171
|
const [isOpen, setIsOpen] = useState(false);
|
|
75168
|
-
useState(false);
|
|
75172
|
+
const [isSearchOpen, setIsSearchOpen] = useState(false);
|
|
75169
75173
|
const [isCommandOpen, setIsCommandOpen] = useState(false);
|
|
75170
75174
|
const [searchValue, setSearchValue] = useState("");
|
|
75171
75175
|
const [scrolled, setScrolled] = useState(false);
|
|
@@ -75234,12 +75238,16 @@ function NavbarInternal({
|
|
|
75234
75238
|
const handleItemClick = useCallback((item) => {
|
|
75235
75239
|
if (item.action) {
|
|
75236
75240
|
item.action();
|
|
75237
|
-
} else if (item.href
|
|
75241
|
+
} else if (item.href) {
|
|
75238
75242
|
if (enableNProgress) {
|
|
75239
75243
|
NProgress.start();
|
|
75240
75244
|
setTimeout(() => NProgress.done(), 500);
|
|
75241
75245
|
}
|
|
75242
|
-
onNavigate
|
|
75246
|
+
if (onNavigate) {
|
|
75247
|
+
onNavigate(item.href);
|
|
75248
|
+
} else {
|
|
75249
|
+
window.location.href = item.href;
|
|
75250
|
+
}
|
|
75243
75251
|
if (isMobile) {
|
|
75244
75252
|
setIsOpen(false);
|
|
75245
75253
|
}
|
|
@@ -75683,28 +75691,99 @@ function NavbarInternal({
|
|
|
75683
75691
|
}
|
|
75684
75692
|
),
|
|
75685
75693
|
/* @__PURE__ */ jsxs(MoonUICommandListPro, { children: [
|
|
75686
|
-
/* @__PURE__ */ jsx(MoonUICommandEmptyPro, { children: "
|
|
75687
|
-
|
|
75694
|
+
/* @__PURE__ */ jsx(MoonUICommandEmptyPro, { children: enableCommandAI ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center py-6", children: [
|
|
75695
|
+
/* @__PURE__ */ jsx(Sparkles, { className: "h-8 w-8 text-muted-foreground mb-2" }),
|
|
75696
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "No results found" }),
|
|
75697
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "Try searching for pages, actions, or commands" })
|
|
75698
|
+
] }) : "No results found." }),
|
|
75699
|
+
enableCommandAI && !searchValue && /* @__PURE__ */ jsxs(MoonUICommandGroupPro, { heading: "Quick Actions", children: [
|
|
75700
|
+
/* @__PURE__ */ jsxs(MoonUICommandItemPro, { onSelect: () => {
|
|
75701
|
+
const homeItem = { id: "home", title: "Go Home", href: "/" };
|
|
75702
|
+
onCommandAISelect?.(homeItem);
|
|
75703
|
+
handleItemClick(homeItem);
|
|
75704
|
+
setIsCommandOpen(false);
|
|
75705
|
+
}, children: [
|
|
75706
|
+
/* @__PURE__ */ jsx(Home, { className: "mr-2 h-4 w-4" }),
|
|
75707
|
+
"Go Home",
|
|
75708
|
+
/* @__PURE__ */ jsx("kbd", { className: "ml-auto text-xs", children: "\u2318H" })
|
|
75709
|
+
] }),
|
|
75710
|
+
/* @__PURE__ */ jsxs(MoonUICommandItemPro, { onSelect: () => {
|
|
75711
|
+
setIsSearchOpen(true);
|
|
75712
|
+
setIsCommandOpen(false);
|
|
75713
|
+
onCommandAISelect?.({ id: "search", title: "Search", action: () => setIsSearchOpen(true) });
|
|
75714
|
+
}, children: [
|
|
75715
|
+
/* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4" }),
|
|
75716
|
+
"Search",
|
|
75717
|
+
/* @__PURE__ */ jsx("kbd", { className: "ml-auto text-xs", children: "\u2318S" })
|
|
75718
|
+
] }),
|
|
75719
|
+
showThemeToggle && /* @__PURE__ */ jsxs(MoonUICommandItemPro, { onSelect: () => {
|
|
75720
|
+
const newTheme = theme === "dark" ? "light" : "dark";
|
|
75721
|
+
onThemeChange?.(newTheme);
|
|
75722
|
+
setIsCommandOpen(false);
|
|
75723
|
+
}, children: [
|
|
75724
|
+
theme === "dark" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75725
|
+
/* @__PURE__ */ jsx(Sun, { className: "mr-2 h-4 w-4" }),
|
|
75726
|
+
"Switch to Light Mode"
|
|
75727
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75728
|
+
/* @__PURE__ */ jsx(Moon, { className: "mr-2 h-4 w-4" }),
|
|
75729
|
+
"Switch to Dark Mode"
|
|
75730
|
+
] }),
|
|
75731
|
+
/* @__PURE__ */ jsx("kbd", { className: "ml-auto text-xs", children: "\u2318T" })
|
|
75732
|
+
] })
|
|
75733
|
+
] }),
|
|
75734
|
+
sections.map((section) => {
|
|
75735
|
+
const filteredItems = section.items.filter(
|
|
75736
|
+
(item) => !searchValue || item.title.toLowerCase().includes(searchValue.toLowerCase()) || item.description?.toLowerCase().includes(searchValue.toLowerCase())
|
|
75737
|
+
);
|
|
75738
|
+
if (filteredItems.length === 0)
|
|
75739
|
+
return null;
|
|
75740
|
+
return /* @__PURE__ */ jsx(MoonUICommandGroupPro, { heading: enableCommandAI ? "Navigation" : section.id, children: filteredItems.map((item) => /* @__PURE__ */ jsxs(
|
|
75741
|
+
MoonUICommandItemPro,
|
|
75742
|
+
{
|
|
75743
|
+
disabled: item.disabled,
|
|
75744
|
+
onSelect: () => {
|
|
75745
|
+
if (enableCommandAI) {
|
|
75746
|
+
onCommandAISelect?.(item);
|
|
75747
|
+
}
|
|
75748
|
+
handleItemClick(item);
|
|
75749
|
+
setIsCommandOpen(false);
|
|
75750
|
+
},
|
|
75751
|
+
children: [
|
|
75752
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
75753
|
+
item.icon && /* @__PURE__ */ jsx("span", { children: item.icon }),
|
|
75754
|
+
item.title
|
|
75755
|
+
] }),
|
|
75756
|
+
item.badge && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: item.badgeVariant || "secondary", className: "ml-auto", children: item.badge }),
|
|
75757
|
+
item.description && enableCommandAI && /* @__PURE__ */ jsx("span", { className: "ml-2 text-xs text-muted-foreground", children: item.description })
|
|
75758
|
+
]
|
|
75759
|
+
},
|
|
75760
|
+
item.id
|
|
75761
|
+
)) }, section.id);
|
|
75762
|
+
}),
|
|
75763
|
+
enableCommandAI && userMenu?.items && /* @__PURE__ */ jsx(MoonUICommandGroupPro, { heading: "Account", children: userMenu.items.map((item) => /* @__PURE__ */ jsx(
|
|
75688
75764
|
MoonUICommandItemPro,
|
|
75689
75765
|
{
|
|
75690
75766
|
disabled: item.disabled,
|
|
75691
75767
|
onSelect: () => {
|
|
75692
|
-
|
|
75693
|
-
|
|
75768
|
+
const commandItem = {
|
|
75769
|
+
...item,
|
|
75770
|
+
action: item.onClick || item.action
|
|
75771
|
+
};
|
|
75772
|
+
if (commandItem.action) {
|
|
75773
|
+
commandItem.action();
|
|
75774
|
+
} else if (commandItem.href) {
|
|
75775
|
+
window.location.href = commandItem.href;
|
|
75694
75776
|
}
|
|
75695
|
-
|
|
75777
|
+
onCommandAISelect?.(commandItem);
|
|
75696
75778
|
setIsCommandOpen(false);
|
|
75697
75779
|
},
|
|
75698
|
-
children: [
|
|
75699
|
-
/* @__PURE__ */
|
|
75700
|
-
|
|
75701
|
-
|
|
75702
|
-
] }),
|
|
75703
|
-
item.description && enableCommandAI && /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: item.description })
|
|
75704
|
-
]
|
|
75780
|
+
children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
75781
|
+
item.icon && /* @__PURE__ */ jsx("span", { children: item.icon }),
|
|
75782
|
+
item.title
|
|
75783
|
+
] })
|
|
75705
75784
|
},
|
|
75706
75785
|
item.id
|
|
75707
|
-
)) }
|
|
75786
|
+
)) })
|
|
75708
75787
|
] })
|
|
75709
75788
|
]
|
|
75710
75789
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.26.
|
|
3
|
+
"version": "2.26.3",
|
|
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",
|