@moontra/moonui-pro 2.24.4 → 2.24.6
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 +5 -0
- package/dist/index.global.js +105 -105
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +146 -61
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4,11 +4,11 @@ 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, Phone, Globe, Upload, 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, Palette, Undo, Redo, Edit, GripVertical, Type, Heading1, Heading2, Heading3, CheckSquare, Highlighter, Link2, Table as Table$1, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Languages, Lightbulb, BarChart3, Music, Archive, File, FileSpreadsheet, FileJson, FileDown, ArrowUp, ArrowDown, ArrowUpDown, ChevronsLeft, ChevronsRight, CheckCircle, Star, Shield, Award, Gem, Flame, Menu, Calendar as Calendar$1, Repeat, MapPin, Users, User, Move, EyeOff, Timer, Square, Cpu, Target, GitBranch, ArrowRight, MoreVertical, Trash, TrendingUp, MessageCircle, Paperclip, Printer, TrendingDown, Bell, CheckCheck, Settings2, LogOut, Edit3, LayoutGrid, Share2, Save, Github, Activity, Server, Monitor, MemoryStick, HardDrive, Network, Columns, Pin, Sun, Moon, Send, Tag, Flag, CalendarIcon, DollarSign, Trophy, Grip, Unlock, Map as Map$1, GitFork, Package
|
|
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, Phone, Globe, Upload, 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, Palette, Undo, Redo, Edit, GripVertical, Type, Heading1, Heading2, Heading3, CheckSquare, Highlighter, Link2, Table as Table$1, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Languages, Lightbulb, BarChart3, Music, Archive, File, FileSpreadsheet, FileJson, FileDown, ArrowUp, ArrowDown, ArrowUpDown, ChevronsLeft, ChevronsRight, CheckCircle, Star, Shield, Award, Gem, Flame, Menu, Calendar as Calendar$1, Repeat, MapPin, Users, User, Move, EyeOff, Timer, Square, Cpu, Target, GitBranch, ArrowRight, MoreVertical, Trash, TrendingUp, MessageCircle, Paperclip, Printer, TrendingDown, Bell, CheckCheck, Settings2, LogOut, Edit3, LayoutGrid, Share2, Save, Github, Activity, Server, Monitor, MemoryStick, HardDrive, Network, Columns, Pin, Sun, Moon, Send, Tag, Flag, BellOff, CalendarIcon, DollarSign, Trophy, ArrowDownRight, ArrowUpRight, Grip, Unlock, Map as Map$1, 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';
|
|
11
|
-
import { format, addMonths, subMonths, startOfMonth, endOfMonth, eachDayOfInterval, getDay, startOfWeek, endOfWeek, isSameMonth, isToday, isSameDay, startOfDay, endOfDay, subDays
|
|
11
|
+
import { format, addMonths, subMonths, startOfMonth, endOfMonth, eachDayOfInterval, getDay, startOfWeek, endOfWeek, isSameMonth, isToday, isSameDay, formatDistanceToNow, startOfDay, endOfDay, subDays } from 'date-fns';
|
|
12
12
|
import { motion, AnimatePresence, useAnimation, useMotionValue, animate, useSpring, useTransform, Reorder, useDragControls } from 'framer-motion';
|
|
13
13
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
14
14
|
import * as ReactDOM2 from 'react-dom';
|
|
@@ -65043,6 +65043,11 @@ function DashboardInternal({
|
|
|
65043
65043
|
editable = true,
|
|
65044
65044
|
realtime = false,
|
|
65045
65045
|
glassmorphism = true,
|
|
65046
|
+
children,
|
|
65047
|
+
mode = "widgets",
|
|
65048
|
+
contentClassName,
|
|
65049
|
+
sidebarPosition = "none",
|
|
65050
|
+
sidebarContent,
|
|
65046
65051
|
notifications = [],
|
|
65047
65052
|
onNotificationClick,
|
|
65048
65053
|
onNotificationMarkAsRead,
|
|
@@ -65582,66 +65587,146 @@ function DashboardInternal({
|
|
|
65582
65587
|
]
|
|
65583
65588
|
}
|
|
65584
65589
|
),
|
|
65585
|
-
|
|
65586
|
-
//
|
|
65587
|
-
/* @__PURE__ */ jsxs(
|
|
65588
|
-
|
|
65589
|
-
|
|
65590
|
-
|
|
65591
|
-
|
|
65592
|
-
|
|
65593
|
-
|
|
65594
|
-
|
|
65595
|
-
|
|
65596
|
-
|
|
65597
|
-
|
|
65598
|
-
|
|
65599
|
-
|
|
65600
|
-
|
|
65601
|
-
|
|
65602
|
-
|
|
65603
|
-
|
|
65604
|
-
|
|
65605
|
-
|
|
65606
|
-
|
|
65607
|
-
|
|
65608
|
-
|
|
65609
|
-
|
|
65610
|
-
|
|
65611
|
-
|
|
65612
|
-
|
|
65613
|
-
|
|
65614
|
-
|
|
65615
|
-
|
|
65616
|
-
|
|
65617
|
-
|
|
65618
|
-
widgets,
|
|
65619
|
-
onLayoutChange: (layout) => {
|
|
65620
|
-
const updatedWidgets = widgets.map((widget) => {
|
|
65621
|
-
const layoutItem = layout.find((l) => l.i === widget.id);
|
|
65622
|
-
if (layoutItem) {
|
|
65623
|
-
return {
|
|
65624
|
-
...widget,
|
|
65625
|
-
position: { x: layoutItem.x, y: layoutItem.y },
|
|
65626
|
-
size: { ...widget.size, w: layoutItem.w, h: layoutItem.h }
|
|
65627
|
-
};
|
|
65590
|
+
mode === "children" ? (
|
|
65591
|
+
// Children mode - use as layout wrapper
|
|
65592
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex-1", contentClassName), children: [
|
|
65593
|
+
sidebarPosition !== "none" && sidebarContent && /* @__PURE__ */ jsxs("div", { className: "flex", children: [
|
|
65594
|
+
sidebarPosition === "left" && /* @__PURE__ */ jsx("div", { className: cn(
|
|
65595
|
+
"w-64 border-r",
|
|
65596
|
+
glassmorphism ? "bg-background/60 backdrop-blur-md" : "bg-background"
|
|
65597
|
+
), children: /* @__PURE__ */ jsx("div", { className: "p-6", children: sidebarContent }) }),
|
|
65598
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 p-6", children }),
|
|
65599
|
+
sidebarPosition === "right" && /* @__PURE__ */ jsx("div", { className: cn(
|
|
65600
|
+
"w-64 border-l",
|
|
65601
|
+
glassmorphism ? "bg-background/60 backdrop-blur-md" : "bg-background"
|
|
65602
|
+
), children: /* @__PURE__ */ jsx("div", { className: "p-6", children: sidebarContent }) })
|
|
65603
|
+
] }),
|
|
65604
|
+
sidebarPosition === "none" && /* @__PURE__ */ jsx("div", { className: "p-6", children })
|
|
65605
|
+
] })
|
|
65606
|
+
) : mode === "hybrid" ? (
|
|
65607
|
+
// Hybrid mode - both children and widgets
|
|
65608
|
+
/* @__PURE__ */ jsxs("div", { className: "flex", children: [
|
|
65609
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 p-6", children }),
|
|
65610
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
65611
|
+
"w-80 border-l p-6",
|
|
65612
|
+
glassmorphism ? "bg-background/60 backdrop-blur-md" : "bg-background"
|
|
65613
|
+
), children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
65614
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
65615
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold", children: "Widgets" }),
|
|
65616
|
+
editable && /* @__PURE__ */ jsx(
|
|
65617
|
+
MoonUIButtonPro,
|
|
65618
|
+
{
|
|
65619
|
+
variant: "ghost",
|
|
65620
|
+
size: "sm",
|
|
65621
|
+
onClick: () => setShowWidgetLibrary(true),
|
|
65622
|
+
children: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" })
|
|
65628
65623
|
}
|
|
65629
|
-
|
|
65630
|
-
|
|
65631
|
-
|
|
65632
|
-
|
|
65633
|
-
|
|
65634
|
-
|
|
65635
|
-
|
|
65636
|
-
|
|
65637
|
-
|
|
65638
|
-
|
|
65639
|
-
|
|
65640
|
-
|
|
65641
|
-
|
|
65642
|
-
|
|
65643
|
-
|
|
65644
|
-
|
|
65624
|
+
)
|
|
65625
|
+
] }),
|
|
65626
|
+
widgets.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "text-center text-muted-foreground py-8", children: [
|
|
65627
|
+
/* @__PURE__ */ jsx(LayoutGrid, { className: "h-8 w-8 mx-auto mb-2 opacity-20" }),
|
|
65628
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: "No widgets" }),
|
|
65629
|
+
editable && /* @__PURE__ */ jsx(
|
|
65630
|
+
MoonUIButtonPro,
|
|
65631
|
+
{
|
|
65632
|
+
variant: "ghost",
|
|
65633
|
+
size: "sm",
|
|
65634
|
+
className: "mt-2",
|
|
65635
|
+
onClick: () => setShowWidgetLibrary(true),
|
|
65636
|
+
children: "Add Widget"
|
|
65637
|
+
}
|
|
65638
|
+
)
|
|
65639
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "space-y-4", children: widgets.map((widget) => /* @__PURE__ */ jsxs("div", { className: "border rounded-lg p-4", children: [
|
|
65640
|
+
widget.type === "metric" && widget.data && /* @__PURE__ */ jsx(
|
|
65641
|
+
MetricCard,
|
|
65642
|
+
{
|
|
65643
|
+
data: widget.data,
|
|
65644
|
+
glassmorphism
|
|
65645
|
+
}
|
|
65646
|
+
),
|
|
65647
|
+
widget.type === "chart" && widget.data && /* @__PURE__ */ jsx(
|
|
65648
|
+
ChartWidget,
|
|
65649
|
+
{
|
|
65650
|
+
id: widget.id,
|
|
65651
|
+
title: widget.title,
|
|
65652
|
+
data: widget.data,
|
|
65653
|
+
glassmorphism
|
|
65654
|
+
}
|
|
65655
|
+
),
|
|
65656
|
+
widget.type === "activity" && widget.data && /* @__PURE__ */ jsx(
|
|
65657
|
+
ActivityFeed,
|
|
65658
|
+
{
|
|
65659
|
+
items: widget.data.items || [],
|
|
65660
|
+
title: widget.title,
|
|
65661
|
+
glassmorphism
|
|
65662
|
+
}
|
|
65663
|
+
)
|
|
65664
|
+
] }, widget.id)) })
|
|
65665
|
+
] }) })
|
|
65666
|
+
] })
|
|
65667
|
+
) : (
|
|
65668
|
+
// Default widgets mode
|
|
65669
|
+
/* @__PURE__ */ jsx("div", { className: "p-6", children: widgets.length === 0 ? (
|
|
65670
|
+
// Empty state
|
|
65671
|
+
/* @__PURE__ */ jsxs(
|
|
65672
|
+
motion.div,
|
|
65673
|
+
{
|
|
65674
|
+
initial: { opacity: 0, scale: 0.9 },
|
|
65675
|
+
animate: { opacity: 1, scale: 1 },
|
|
65676
|
+
className: "flex flex-col items-center justify-center min-h-[400px] text-center",
|
|
65677
|
+
children: [
|
|
65678
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
65679
|
+
"p-4 rounded-full mb-4",
|
|
65680
|
+
glassmorphism ? "bg-background/60 backdrop-blur-sm" : "bg-muted"
|
|
65681
|
+
), children: /* @__PURE__ */ jsx(LayoutGrid, { className: "h-8 w-8 text-muted-foreground" }) }),
|
|
65682
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "No widgets added yet" }),
|
|
65683
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: "Start by adding widgets or choosing a template" }),
|
|
65684
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
65685
|
+
/* @__PURE__ */ jsxs(MoonUIButtonPro, { onClick: () => setShowWidgetLibrary(true), children: [
|
|
65686
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-2" }),
|
|
65687
|
+
"Add Widget"
|
|
65688
|
+
] }),
|
|
65689
|
+
/* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", onClick: () => setShowTemplates(true), children: [
|
|
65690
|
+
/* @__PURE__ */ jsx(LayoutGrid, { className: "h-4 w-4 mr-2" }),
|
|
65691
|
+
"Browse Templates"
|
|
65692
|
+
] })
|
|
65693
|
+
] })
|
|
65694
|
+
]
|
|
65695
|
+
}
|
|
65696
|
+
)
|
|
65697
|
+
) : (
|
|
65698
|
+
// Dashboard grid
|
|
65699
|
+
/* @__PURE__ */ jsx(
|
|
65700
|
+
DashboardGrid,
|
|
65701
|
+
{
|
|
65702
|
+
widgets,
|
|
65703
|
+
onLayoutChange: (layout) => {
|
|
65704
|
+
const updatedWidgets = widgets.map((widget) => {
|
|
65705
|
+
const layoutItem = layout.find((l) => l.i === widget.id);
|
|
65706
|
+
if (layoutItem) {
|
|
65707
|
+
return {
|
|
65708
|
+
...widget,
|
|
65709
|
+
position: { x: layoutItem.x, y: layoutItem.y },
|
|
65710
|
+
size: { ...widget.size, w: layoutItem.w, h: layoutItem.h }
|
|
65711
|
+
};
|
|
65712
|
+
}
|
|
65713
|
+
return widget;
|
|
65714
|
+
});
|
|
65715
|
+
setWidgets(updatedWidgets);
|
|
65716
|
+
},
|
|
65717
|
+
onWidgetRemove: (widgetId) => {
|
|
65718
|
+
setWidgets((prev) => prev.filter((w) => w.id !== widgetId));
|
|
65719
|
+
onWidgetRemove?.(widgetId);
|
|
65720
|
+
},
|
|
65721
|
+
onWidgetAction: (widgetId, action, data) => {
|
|
65722
|
+
console.log("Widget action:", widgetId, action, data);
|
|
65723
|
+
},
|
|
65724
|
+
editMode,
|
|
65725
|
+
glassmorphism
|
|
65726
|
+
}
|
|
65727
|
+
)
|
|
65728
|
+
) })
|
|
65729
|
+
),
|
|
65645
65730
|
/* @__PURE__ */ jsx(WidgetLibrary, {}),
|
|
65646
65731
|
/* @__PURE__ */ jsx(TemplateGallery, {})
|
|
65647
65732
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.24.
|
|
3
|
+
"version": "2.24.6",
|
|
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",
|