@moontra/moonui-pro 2.4.6 → 2.5.0
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 +127 -25
- package/dist/index.mjs +2023 -186
- package/package.json +4 -1
- package/src/components/advanced-chart/index.tsx +11 -1
- package/src/components/dashboard/dashboard-grid.tsx +327 -0
- package/src/components/dashboard/demo.tsx +308 -0
- package/src/components/dashboard/index.tsx +683 -275
- package/src/components/dashboard/time-range-picker.tsx +267 -0
- package/src/components/dashboard/types.ts +222 -0
- package/src/components/dashboard/widgets/activity-feed.tsx +344 -0
- package/src/components/dashboard/widgets/chart-widget.tsx +418 -0
- package/src/components/dashboard/widgets/metric-card.tsx +343 -0
- package/src/components/index.ts +2 -2
- package/src/components/ui/calendar.tsx +65 -0
- package/src/components/ui/index.ts +12 -0
- package/src/components/ui/scroll-area.tsx +47 -0
- package/src/components/ui/sheet.tsx +139 -0
package/dist/index.mjs
CHANGED
|
@@ -3,10 +3,11 @@ import { twMerge } from 'tailwind-merge';
|
|
|
3
3
|
import * as t from 'react';
|
|
4
4
|
import t__default, { useState, useRef, useCallback, forwardRef, createContext, useContext, useMemo, useEffect, useDebugValue, Component, useLayoutEffect } from 'react';
|
|
5
5
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
6
|
-
import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronRight, Circle, ChevronUp, Lock, Sparkles, Plus, ChevronLeft, Calendar, Edit, Trash2, Clock, MapPin, User, GripVertical, MessageCircle, Paperclip, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, Code as Code$1, Type, Heading1, Heading2, Heading3, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, CheckSquare, Quote, Palette, Highlighter, Link2, Image as Image$1, Table as Table$1, Settings, Undo, Redo, Eye, RefreshCw, Wand2, Maximize, FileText, Languages, TrendingUp, TrendingDown, ZoomOut, ZoomIn, Download, FileSpreadsheet, FileJson, Maximize2, Move,
|
|
6
|
+
import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronRight, Circle, ChevronUp, Lock, Sparkles, Plus, ChevronLeft, Calendar as Calendar$1, Edit, Trash2, Clock, MapPin, User, GripVertical, MessageCircle, Paperclip, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, Code as Code$1, Type, Heading1, Heading2, Heading3, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, CheckSquare, Quote, Palette, Highlighter, Link2, Image as Image$1, Table as Table$1, Settings, Undo, Redo, Eye, RefreshCw, Wand2, Maximize, FileText, Languages, TrendingUp, TrendingDown, ZoomOut, ZoomIn, Download, FileSpreadsheet, FileJson, Maximize2, Move, Menu, Bell, Edit3, LayoutGrid, Upload, Share2, Save, CheckCircle2, Filter, FileDown, ArrowUp, ArrowDown, ArrowUpDown, ChevronsLeft, ChevronsRight, ExternalLink, CalendarIcon, DollarSign, Users, Github, Star, GitFork, Activity, Server, EyeOff, RotateCw, Zap, Monitor, Timer, Cpu, MemoryStick, HardDrive, Network, CheckCircle, BarChart3, Video, Music, Archive, File, Columns, XCircle, Grip, Unlock, Minimize2, Map as Map$1, Target, MoreVertical, BellOff, ArrowDownRight, ArrowUpRight } from 'lucide-react';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
9
9
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
10
|
+
import { DayPicker } from 'react-day-picker';
|
|
10
11
|
import { motion, AnimatePresence, useMotionValue, useSpring, useTransform, animate } from 'framer-motion';
|
|
11
12
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
12
13
|
import ReactDOM3 from 'react-dom';
|
|
@@ -16,6 +17,7 @@ import { createDialogScope } from '@radix-ui/react-dialog';
|
|
|
16
17
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
17
18
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
18
19
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
20
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
19
21
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
20
22
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
21
23
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
@@ -25,6 +27,9 @@ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
|
25
27
|
import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';
|
|
26
28
|
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector.js';
|
|
27
29
|
import { ResponsiveContainer, LineChart, Line, RadialBarChart, Tooltip, Legend, RadialBar, RadarChart, PolarGrid, PolarAngleAxis, PolarRadiusAxis, Radar, ScatterChart, CartesianGrid, XAxis, YAxis, Scatter, PieChart, Pie, Cell, AreaChart, Area, ReferenceLine, Brush, BarChart, Bar, ReferenceArea } from 'recharts';
|
|
30
|
+
import { startOfDay, endOfDay, subDays, startOfWeek, endOfWeek, startOfMonth, endOfMonth, format, formatDistanceToNow } from 'date-fns';
|
|
31
|
+
import GridLayout from 'react-grid-layout';
|
|
32
|
+
import 'react-grid-layout/css/styles.css';
|
|
28
33
|
import { DragDropContext, Droppable, Draggable } from '@hello-pangea/dnd';
|
|
29
34
|
import { useForm } from 'react-hook-form';
|
|
30
35
|
import { flexRender, useReactTable, getCoreRowModel, getPaginationRowModel, getSortedRowModel, getFilteredRowModel } from '@tanstack/react-table';
|
|
@@ -2535,6 +2540,56 @@ var MoonUIButtonPro = t.forwardRef(
|
|
|
2535
2540
|
}
|
|
2536
2541
|
);
|
|
2537
2542
|
MoonUIButtonPro.displayName = "MoonUIButtonPro";
|
|
2543
|
+
function Calendar({
|
|
2544
|
+
className,
|
|
2545
|
+
classNames,
|
|
2546
|
+
showOutsideDays = true,
|
|
2547
|
+
...props
|
|
2548
|
+
}) {
|
|
2549
|
+
return /* @__PURE__ */ jsx(
|
|
2550
|
+
DayPicker,
|
|
2551
|
+
{
|
|
2552
|
+
showOutsideDays,
|
|
2553
|
+
className: cn("p-3", className),
|
|
2554
|
+
classNames: {
|
|
2555
|
+
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
2556
|
+
month: "space-y-4",
|
|
2557
|
+
caption: "flex justify-center pt-1 relative items-center",
|
|
2558
|
+
caption_label: "text-sm font-medium",
|
|
2559
|
+
nav: "space-x-1 flex items-center",
|
|
2560
|
+
nav_button: cn(
|
|
2561
|
+
moonUIButtonProVariants({ variant: "outline" }),
|
|
2562
|
+
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
2563
|
+
),
|
|
2564
|
+
nav_button_previous: "absolute left-1",
|
|
2565
|
+
nav_button_next: "absolute right-1",
|
|
2566
|
+
table: "w-full border-collapse space-y-1",
|
|
2567
|
+
head_row: "flex",
|
|
2568
|
+
head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
|
2569
|
+
row: "flex w-full mt-2",
|
|
2570
|
+
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
2571
|
+
day: cn(
|
|
2572
|
+
moonUIButtonProVariants({ variant: "ghost" }),
|
|
2573
|
+
"h-9 w-9 p-0 font-normal aria-selected:opacity-100"
|
|
2574
|
+
),
|
|
2575
|
+
day_range_end: "day-range-end",
|
|
2576
|
+
day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
|
2577
|
+
day_today: "bg-accent text-accent-foreground",
|
|
2578
|
+
day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
|
|
2579
|
+
day_disabled: "text-muted-foreground opacity-50",
|
|
2580
|
+
day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
|
|
2581
|
+
day_hidden: "invisible",
|
|
2582
|
+
...classNames
|
|
2583
|
+
},
|
|
2584
|
+
components: {
|
|
2585
|
+
// IconLeft: () => <ChevronLeft className="h-4 w-4" />,
|
|
2586
|
+
// IconRight: () => <ChevronRight className="h-4 w-4" />,
|
|
2587
|
+
},
|
|
2588
|
+
...props
|
|
2589
|
+
}
|
|
2590
|
+
);
|
|
2591
|
+
}
|
|
2592
|
+
Calendar.displayName = "Calendar";
|
|
2538
2593
|
cva("", {
|
|
2539
2594
|
variants: {
|
|
2540
2595
|
hover: {
|
|
@@ -3791,7 +3846,7 @@ var me = t.forwardRef((r2, o) => {
|
|
|
3791
3846
|
var e;
|
|
3792
3847
|
return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []);
|
|
3793
3848
|
}
|
|
3794
|
-
function
|
|
3849
|
+
function X17(e) {
|
|
3795
3850
|
let s = V()[e];
|
|
3796
3851
|
s && E.setState("value", s.getAttribute(T));
|
|
3797
3852
|
}
|
|
@@ -3806,10 +3861,10 @@ var me = t.forwardRef((r2, o) => {
|
|
|
3806
3861
|
s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce);
|
|
3807
3862
|
i ? E.setState("value", i.getAttribute(T)) : Q(e);
|
|
3808
3863
|
}
|
|
3809
|
-
let oe = () =>
|
|
3864
|
+
let oe = () => X17(V().length - 1), ie3 = (e) => {
|
|
3810
3865
|
e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1);
|
|
3811
3866
|
}, se = (e) => {
|
|
3812
|
-
e.preventDefault(), e.metaKey ?
|
|
3867
|
+
e.preventDefault(), e.metaKey ? X17(0) : e.altKey ? re(-1) : Q(-1);
|
|
3813
3868
|
};
|
|
3814
3869
|
return t.createElement(Primitive2.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
|
|
3815
3870
|
var s;
|
|
@@ -3836,7 +3891,7 @@ var me = t.forwardRef((r2, o) => {
|
|
|
3836
3891
|
break;
|
|
3837
3892
|
}
|
|
3838
3893
|
case "Home": {
|
|
3839
|
-
e.preventDefault(),
|
|
3894
|
+
e.preventDefault(), X17(0);
|
|
3840
3895
|
break;
|
|
3841
3896
|
}
|
|
3842
3897
|
case "End": {
|
|
@@ -5105,6 +5160,36 @@ var MoonUIRadioItemWithLabelPro = t.forwardRef(({
|
|
|
5105
5160
|
] });
|
|
5106
5161
|
});
|
|
5107
5162
|
MoonUIRadioItemWithLabelPro.displayName = "RadioItemWithLabelPro";
|
|
5163
|
+
var ScrollArea = t.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
5164
|
+
ScrollAreaPrimitive.Root,
|
|
5165
|
+
{
|
|
5166
|
+
ref,
|
|
5167
|
+
className: cn("relative overflow-hidden", className),
|
|
5168
|
+
...props,
|
|
5169
|
+
children: [
|
|
5170
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
5171
|
+
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
5172
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
5173
|
+
]
|
|
5174
|
+
}
|
|
5175
|
+
));
|
|
5176
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
5177
|
+
var ScrollBar = t.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5178
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
5179
|
+
{
|
|
5180
|
+
ref,
|
|
5181
|
+
orientation,
|
|
5182
|
+
className: cn(
|
|
5183
|
+
"flex touch-none select-none transition-colors",
|
|
5184
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
5185
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
5186
|
+
className
|
|
5187
|
+
),
|
|
5188
|
+
...props,
|
|
5189
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
5190
|
+
}
|
|
5191
|
+
));
|
|
5192
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
5108
5193
|
var MoonUISelectPro = SelectPrimitive.Root;
|
|
5109
5194
|
MoonUISelectPro.displayName = "MoonUISelectPro";
|
|
5110
5195
|
var MoonUISelectGroupPro = SelectPrimitive.Group;
|
|
@@ -5379,6 +5464,103 @@ var MoonUISeparatorPro = t.forwardRef(
|
|
|
5379
5464
|
)
|
|
5380
5465
|
);
|
|
5381
5466
|
MoonUISeparatorPro.displayName = SeparatorPrimitive.Root.displayName;
|
|
5467
|
+
var Sheet = DialogPrimitive.Root;
|
|
5468
|
+
var SheetTrigger = DialogPrimitive.Trigger;
|
|
5469
|
+
var SheetClose = DialogPrimitive.Close;
|
|
5470
|
+
var SheetPortal = DialogPrimitive.Portal;
|
|
5471
|
+
var SheetOverlay = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5472
|
+
DialogPrimitive.Overlay,
|
|
5473
|
+
{
|
|
5474
|
+
className: cn(
|
|
5475
|
+
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
5476
|
+
className
|
|
5477
|
+
),
|
|
5478
|
+
...props,
|
|
5479
|
+
ref
|
|
5480
|
+
}
|
|
5481
|
+
));
|
|
5482
|
+
SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
5483
|
+
var sheetVariants = cva(
|
|
5484
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
5485
|
+
{
|
|
5486
|
+
variants: {
|
|
5487
|
+
side: {
|
|
5488
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
5489
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
5490
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
5491
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
5492
|
+
}
|
|
5493
|
+
},
|
|
5494
|
+
defaultVariants: {
|
|
5495
|
+
side: "right"
|
|
5496
|
+
}
|
|
5497
|
+
}
|
|
5498
|
+
);
|
|
5499
|
+
var SheetContent = t.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
5500
|
+
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
5501
|
+
/* @__PURE__ */ jsxs(
|
|
5502
|
+
DialogPrimitive.Content,
|
|
5503
|
+
{
|
|
5504
|
+
ref,
|
|
5505
|
+
className: cn(sheetVariants({ side }), className),
|
|
5506
|
+
...props,
|
|
5507
|
+
children: [
|
|
5508
|
+
children,
|
|
5509
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 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 data-[state=open]:bg-secondary", children: [
|
|
5510
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
5511
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
5512
|
+
] })
|
|
5513
|
+
]
|
|
5514
|
+
}
|
|
5515
|
+
)
|
|
5516
|
+
] }));
|
|
5517
|
+
SheetContent.displayName = DialogPrimitive.Content.displayName;
|
|
5518
|
+
var SheetHeader = ({
|
|
5519
|
+
className,
|
|
5520
|
+
...props
|
|
5521
|
+
}) => /* @__PURE__ */ jsx(
|
|
5522
|
+
"div",
|
|
5523
|
+
{
|
|
5524
|
+
className: cn(
|
|
5525
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
5526
|
+
className
|
|
5527
|
+
),
|
|
5528
|
+
...props
|
|
5529
|
+
}
|
|
5530
|
+
);
|
|
5531
|
+
SheetHeader.displayName = "SheetHeader";
|
|
5532
|
+
var SheetFooter = ({
|
|
5533
|
+
className,
|
|
5534
|
+
...props
|
|
5535
|
+
}) => /* @__PURE__ */ jsx(
|
|
5536
|
+
"div",
|
|
5537
|
+
{
|
|
5538
|
+
className: cn(
|
|
5539
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
5540
|
+
className
|
|
5541
|
+
),
|
|
5542
|
+
...props
|
|
5543
|
+
}
|
|
5544
|
+
);
|
|
5545
|
+
SheetFooter.displayName = "SheetFooter";
|
|
5546
|
+
var SheetTitle = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5547
|
+
DialogPrimitive.Title,
|
|
5548
|
+
{
|
|
5549
|
+
ref,
|
|
5550
|
+
className: cn("text-lg font-semibold text-foreground", className),
|
|
5551
|
+
...props
|
|
5552
|
+
}
|
|
5553
|
+
));
|
|
5554
|
+
SheetTitle.displayName = DialogPrimitive.Title.displayName;
|
|
5555
|
+
var SheetDescription = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5556
|
+
DialogPrimitive.Description,
|
|
5557
|
+
{
|
|
5558
|
+
ref,
|
|
5559
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
5560
|
+
...props
|
|
5561
|
+
}
|
|
5562
|
+
));
|
|
5563
|
+
SheetDescription.displayName = DialogPrimitive.Description.displayName;
|
|
5382
5564
|
function MoonUISkeletonPro({
|
|
5383
5565
|
className,
|
|
5384
5566
|
...props
|
|
@@ -6296,7 +6478,7 @@ var Toggle = t.forwardRef((props, forwardedRef) => {
|
|
|
6296
6478
|
);
|
|
6297
6479
|
});
|
|
6298
6480
|
Toggle.displayName = NAME;
|
|
6299
|
-
var
|
|
6481
|
+
var Root18 = Toggle;
|
|
6300
6482
|
var MoonUItoggleVariantsPro = cva(
|
|
6301
6483
|
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
6302
6484
|
{
|
|
@@ -6318,14 +6500,14 @@ var MoonUItoggleVariantsPro = cva(
|
|
|
6318
6500
|
}
|
|
6319
6501
|
);
|
|
6320
6502
|
var MoonUITogglePro = t.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6321
|
-
|
|
6503
|
+
Root18,
|
|
6322
6504
|
{
|
|
6323
6505
|
ref,
|
|
6324
6506
|
className: cn(MoonUItoggleVariantsPro({ variant, size, className })),
|
|
6325
6507
|
...props
|
|
6326
6508
|
}
|
|
6327
6509
|
));
|
|
6328
|
-
MoonUITogglePro.displayName =
|
|
6510
|
+
MoonUITogglePro.displayName = Root18.displayName;
|
|
6329
6511
|
var MoonUITooltipProviderPro = TooltipPrimitive.Provider;
|
|
6330
6512
|
var tooltipVariants = cva(
|
|
6331
6513
|
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
@@ -7457,7 +7639,7 @@ function EventDialog({
|
|
|
7457
7639
|
return /* @__PURE__ */ jsx(MoonUIDialogPro, { open, onOpenChange, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: "sm:max-w-[500px]", children: [
|
|
7458
7640
|
/* @__PURE__ */ jsxs(MoonUIDialogHeaderPro, { children: [
|
|
7459
7641
|
/* @__PURE__ */ jsxs(MoonUIDialogTitlePro, { className: "flex items-center gap-2", children: [
|
|
7460
|
-
/* @__PURE__ */ jsx(Calendar, { className: "w-5 h-5" }),
|
|
7642
|
+
/* @__PURE__ */ jsx(Calendar$1, { className: "w-5 h-5" }),
|
|
7461
7643
|
mode === "create" ? "Create Event" : "Edit Event"
|
|
7462
7644
|
] }),
|
|
7463
7645
|
/* @__PURE__ */ jsx(MoonUIDialogDescriptionPro, { children: mode === "create" ? "Add a new event to your calendar." : "Edit the event details." })
|
|
@@ -7659,7 +7841,7 @@ var EVENT_COLORS = {
|
|
|
7659
7841
|
reminder: "bg-yellow-500",
|
|
7660
7842
|
event: "bg-purple-500"
|
|
7661
7843
|
};
|
|
7662
|
-
function
|
|
7844
|
+
function Calendar3({
|
|
7663
7845
|
events = [],
|
|
7664
7846
|
onEventClick,
|
|
7665
7847
|
onEventAdd,
|
|
@@ -7829,7 +8011,7 @@ function Calendar2({
|
|
|
7829
8011
|
/* @__PURE__ */ jsx(MoonUICardHeaderPro, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
7830
8012
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
7831
8013
|
/* @__PURE__ */ jsxs(MoonUICardTitlePro, { className: "flex items-center gap-2", children: [
|
|
7832
|
-
/* @__PURE__ */ jsx(Calendar, { className: "h-5 w-5" }),
|
|
8014
|
+
/* @__PURE__ */ jsx(Calendar$1, { className: "h-5 w-5" }),
|
|
7833
8015
|
"Calendar"
|
|
7834
8016
|
] }),
|
|
7835
8017
|
/* @__PURE__ */ jsxs(MoonUICardDescriptionPro, { children: [
|
|
@@ -8265,7 +8447,7 @@ function Kanban({
|
|
|
8265
8447
|
"flex items-center gap-1",
|
|
8266
8448
|
isOverdue(card.dueDate) && "text-destructive"
|
|
8267
8449
|
), children: [
|
|
8268
|
-
/* @__PURE__ */ jsx(Calendar, { className: "h-3 w-3" }),
|
|
8450
|
+
/* @__PURE__ */ jsx(Calendar$1, { className: "h-3 w-3" }),
|
|
8269
8451
|
/* @__PURE__ */ jsx("span", { children: formatDate(card.dueDate) })
|
|
8270
8452
|
] })
|
|
8271
8453
|
] }),
|
|
@@ -48887,7 +49069,7 @@ function Timeline({
|
|
|
48887
49069
|
/* @__PURE__ */ jsx("span", { children: event.metadata.duration })
|
|
48888
49070
|
] }),
|
|
48889
49071
|
event.metadata.location && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
48890
|
-
/* @__PURE__ */ jsx(Calendar, { className: "h-3 w-3" }),
|
|
49072
|
+
/* @__PURE__ */ jsx(Calendar$1, { className: "h-3 w-3" }),
|
|
48891
49073
|
/* @__PURE__ */ jsx("span", { children: event.metadata.location })
|
|
48892
49074
|
] }),
|
|
48893
49075
|
event.metadata.comments && event.metadata.comments > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
@@ -49149,14 +49331,18 @@ function AdvancedChart({
|
|
|
49149
49331
|
}, [selectedTheme]);
|
|
49150
49332
|
const gradientId = t__default.useId();
|
|
49151
49333
|
const trend = t__default.useMemo(() => {
|
|
49152
|
-
if (!data.length || !series.length)
|
|
49334
|
+
if (!data || !Array.isArray(data) || !data.length || !series || !Array.isArray(series) || !series.length)
|
|
49153
49335
|
return null;
|
|
49154
49336
|
const firstSeries = series[0];
|
|
49337
|
+
if (!firstSeries || !firstSeries.dataKey)
|
|
49338
|
+
return null;
|
|
49155
49339
|
const values = data.map((d) => Number(d[firstSeries.dataKey])).filter((v) => !isNaN(v));
|
|
49156
49340
|
if (values.length < 2)
|
|
49157
49341
|
return null;
|
|
49158
49342
|
const first2 = values[0];
|
|
49159
49343
|
const last = values[values.length - 1];
|
|
49344
|
+
if (first2 === 0)
|
|
49345
|
+
return null;
|
|
49160
49346
|
const change = (last - first2) / first2 * 100;
|
|
49161
49347
|
return {
|
|
49162
49348
|
direction: change > 0 ? "up" : change < 0 ? "down" : "neutral",
|
|
@@ -49179,9 +49365,9 @@ function AdvancedChart({
|
|
|
49179
49365
|
toggleSeriesVisibility(entry.dataKey);
|
|
49180
49366
|
}
|
|
49181
49367
|
};
|
|
49182
|
-
const handleExport = (
|
|
49368
|
+
const handleExport = (format2) => {
|
|
49183
49369
|
if (onExport) {
|
|
49184
|
-
onExport(
|
|
49370
|
+
onExport(format2);
|
|
49185
49371
|
}
|
|
49186
49372
|
};
|
|
49187
49373
|
const handleZoom = (direction) => {
|
|
@@ -49210,6 +49396,9 @@ function AdvancedChart({
|
|
|
49210
49396
|
);
|
|
49211
49397
|
}) });
|
|
49212
49398
|
const renderChart = () => {
|
|
49399
|
+
if (!data || !Array.isArray(data) || !series || !Array.isArray(series)) {
|
|
49400
|
+
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: "No data available" });
|
|
49401
|
+
}
|
|
49213
49402
|
const commonProps = {
|
|
49214
49403
|
data,
|
|
49215
49404
|
width: typeof width === "string" ? void 0 : width,
|
|
@@ -49998,43 +50187,147 @@ function AdvancedChart({
|
|
|
49998
50187
|
}
|
|
49999
50188
|
);
|
|
50000
50189
|
}
|
|
50001
|
-
|
|
50002
|
-
|
|
50003
|
-
|
|
50004
|
-
|
|
50005
|
-
danger: "text-red-600",
|
|
50006
|
-
info: "text-purple-600"
|
|
50007
|
-
};
|
|
50008
|
-
var WIDGET_SIZES = {
|
|
50009
|
-
sm: "col-span-1",
|
|
50010
|
-
md: "col-span-2",
|
|
50011
|
-
lg: "col-span-3",
|
|
50012
|
-
xl: "col-span-4"
|
|
50013
|
-
};
|
|
50014
|
-
function Dashboard({
|
|
50015
|
-
metrics = [],
|
|
50016
|
-
widgets = [],
|
|
50017
|
-
onMetricClick,
|
|
50018
|
-
onWidgetAction,
|
|
50190
|
+
function MetricCard({
|
|
50191
|
+
data,
|
|
50192
|
+
onClick,
|
|
50193
|
+
onAction,
|
|
50019
50194
|
className,
|
|
50020
|
-
|
|
50021
|
-
|
|
50022
|
-
|
|
50023
|
-
|
|
50024
|
-
onRefresh,
|
|
50025
|
-
loading = false
|
|
50195
|
+
showSparkline = true,
|
|
50196
|
+
showForecast = false,
|
|
50197
|
+
interactive = true,
|
|
50198
|
+
glassmorphism = false
|
|
50026
50199
|
}) {
|
|
50027
|
-
const [
|
|
50028
|
-
const
|
|
50029
|
-
|
|
50030
|
-
|
|
50031
|
-
|
|
50032
|
-
|
|
50033
|
-
|
|
50034
|
-
|
|
50035
|
-
|
|
50200
|
+
const [isHovered, setIsHovered] = t__default.useState(false);
|
|
50201
|
+
const colorClasses = {
|
|
50202
|
+
primary: "text-blue-600 dark:text-blue-400",
|
|
50203
|
+
success: "text-green-600 dark:text-green-400",
|
|
50204
|
+
warning: "text-yellow-600 dark:text-yellow-400",
|
|
50205
|
+
danger: "text-red-600 dark:text-red-400",
|
|
50206
|
+
info: "text-purple-600 dark:text-purple-400"
|
|
50207
|
+
};
|
|
50208
|
+
const getChangeColor = (type) => {
|
|
50209
|
+
switch (type) {
|
|
50210
|
+
case "increase":
|
|
50211
|
+
return "text-green-600 dark:text-green-400";
|
|
50212
|
+
case "decrease":
|
|
50213
|
+
return "text-red-600 dark:text-red-400";
|
|
50214
|
+
default:
|
|
50215
|
+
return "text-gray-600 dark:text-gray-400";
|
|
50216
|
+
}
|
|
50217
|
+
};
|
|
50218
|
+
const getChangeIcon = (type) => {
|
|
50219
|
+
switch (type) {
|
|
50220
|
+
case "increase":
|
|
50221
|
+
return /* @__PURE__ */ jsx(ArrowUpRight, { className: "h-4 w-4" });
|
|
50222
|
+
case "decrease":
|
|
50223
|
+
return /* @__PURE__ */ jsx(ArrowDownRight, { className: "h-4 w-4" });
|
|
50224
|
+
default:
|
|
50225
|
+
return /* @__PURE__ */ jsx(Minus, { className: "h-4 w-4" });
|
|
50036
50226
|
}
|
|
50037
50227
|
};
|
|
50228
|
+
const renderSparkline = () => {
|
|
50229
|
+
if (!data.sparkline || data.sparkline.length < 2)
|
|
50230
|
+
return null;
|
|
50231
|
+
const max = Math.max(...data.sparkline);
|
|
50232
|
+
const min = Math.min(...data.sparkline);
|
|
50233
|
+
const range = max - min || 1;
|
|
50234
|
+
const points = data.sparkline.map((value, index) => {
|
|
50235
|
+
const x = index / (data.sparkline.length - 1) * 100;
|
|
50236
|
+
const y = 100 - (value - min) / range * 100;
|
|
50237
|
+
return `${x},${y}`;
|
|
50238
|
+
}).join(" ");
|
|
50239
|
+
const gradientId = `gradient-${data.id}`;
|
|
50240
|
+
return /* @__PURE__ */ jsx(
|
|
50241
|
+
motion.div,
|
|
50242
|
+
{
|
|
50243
|
+
className: "absolute bottom-0 left-0 right-0 h-16 overflow-hidden rounded-b-lg opacity-20",
|
|
50244
|
+
initial: { opacity: 0 },
|
|
50245
|
+
animate: { opacity: isHovered ? 0.3 : 0.2 },
|
|
50246
|
+
transition: { duration: 0.2 },
|
|
50247
|
+
children: /* @__PURE__ */ jsxs(
|
|
50248
|
+
"svg",
|
|
50249
|
+
{
|
|
50250
|
+
className: "w-full h-full",
|
|
50251
|
+
viewBox: "0 0 100 100",
|
|
50252
|
+
preserveAspectRatio: "none",
|
|
50253
|
+
children: [
|
|
50254
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
|
|
50255
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "currentColor", stopOpacity: "0.3" }),
|
|
50256
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "currentColor", stopOpacity: "0" })
|
|
50257
|
+
] }) }),
|
|
50258
|
+
/* @__PURE__ */ jsx(
|
|
50259
|
+
"polyline",
|
|
50260
|
+
{
|
|
50261
|
+
fill: "none",
|
|
50262
|
+
stroke: "currentColor",
|
|
50263
|
+
strokeWidth: "2",
|
|
50264
|
+
points,
|
|
50265
|
+
className: colorClasses[data.color || "primary"]
|
|
50266
|
+
}
|
|
50267
|
+
),
|
|
50268
|
+
/* @__PURE__ */ jsx(
|
|
50269
|
+
"polygon",
|
|
50270
|
+
{
|
|
50271
|
+
fill: `url(#${gradientId})`,
|
|
50272
|
+
points: `0,100 ${points} 100,100`,
|
|
50273
|
+
className: colorClasses[data.color || "primary"]
|
|
50274
|
+
}
|
|
50275
|
+
)
|
|
50276
|
+
]
|
|
50277
|
+
}
|
|
50278
|
+
)
|
|
50279
|
+
}
|
|
50280
|
+
);
|
|
50281
|
+
};
|
|
50282
|
+
const renderProgress = () => {
|
|
50283
|
+
if (!data.target)
|
|
50284
|
+
return null;
|
|
50285
|
+
const currentValue = typeof data.value === "number" ? data.value : parseFloat(data.value);
|
|
50286
|
+
const progress = currentValue / data.target * 100;
|
|
50287
|
+
return /* @__PURE__ */ jsxs(
|
|
50288
|
+
motion.div,
|
|
50289
|
+
{
|
|
50290
|
+
className: "mt-3",
|
|
50291
|
+
initial: { opacity: 0, y: 10 },
|
|
50292
|
+
animate: { opacity: 1, y: 0 },
|
|
50293
|
+
transition: { delay: 0.1 },
|
|
50294
|
+
children: [
|
|
50295
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-xs text-muted-foreground mb-1", children: [
|
|
50296
|
+
/* @__PURE__ */ jsx("span", { children: "Progress to target" }),
|
|
50297
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
50298
|
+
progress.toFixed(1),
|
|
50299
|
+
"%"
|
|
50300
|
+
] })
|
|
50301
|
+
] }),
|
|
50302
|
+
/* @__PURE__ */ jsx("div", { className: "h-1.5 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
50303
|
+
motion.div,
|
|
50304
|
+
{
|
|
50305
|
+
className: cn(
|
|
50306
|
+
"h-full rounded-full",
|
|
50307
|
+
progress >= 100 ? "bg-green-500" : "bg-primary"
|
|
50308
|
+
),
|
|
50309
|
+
initial: { width: 0 },
|
|
50310
|
+
animate: { width: `${Math.min(progress, 100)}%` },
|
|
50311
|
+
transition: { duration: 0.5, ease: "easeOut" }
|
|
50312
|
+
}
|
|
50313
|
+
) }),
|
|
50314
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-xs text-muted-foreground mt-1", children: [
|
|
50315
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
50316
|
+
currentValue,
|
|
50317
|
+
" ",
|
|
50318
|
+
data.unit
|
|
50319
|
+
] }),
|
|
50320
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
50321
|
+
"Target: ",
|
|
50322
|
+
data.target,
|
|
50323
|
+
" ",
|
|
50324
|
+
data.unit
|
|
50325
|
+
] })
|
|
50326
|
+
] })
|
|
50327
|
+
]
|
|
50328
|
+
}
|
|
50329
|
+
);
|
|
50330
|
+
};
|
|
50038
50331
|
const formatValue = (value) => {
|
|
50039
50332
|
if (typeof value === "number") {
|
|
50040
50333
|
if (value >= 1e6) {
|
|
@@ -50046,159 +50339,1703 @@ function Dashboard({
|
|
|
50046
50339
|
}
|
|
50047
50340
|
return value.toString();
|
|
50048
50341
|
};
|
|
50049
|
-
const
|
|
50050
|
-
|
|
50051
|
-
|
|
50052
|
-
|
|
50053
|
-
|
|
50054
|
-
|
|
50055
|
-
|
|
50056
|
-
|
|
50057
|
-
|
|
50342
|
+
const cardVariants = {
|
|
50343
|
+
initial: { opacity: 0, y: 20 },
|
|
50344
|
+
animate: {
|
|
50345
|
+
opacity: 1,
|
|
50346
|
+
y: 0,
|
|
50347
|
+
transition: { duration: 0.3, ease: "easeOut" }
|
|
50348
|
+
},
|
|
50349
|
+
hover: interactive ? {
|
|
50350
|
+
y: -2,
|
|
50351
|
+
transition: { duration: 0.2 }
|
|
50352
|
+
} : {}
|
|
50058
50353
|
};
|
|
50059
|
-
|
|
50060
|
-
|
|
50061
|
-
|
|
50062
|
-
|
|
50063
|
-
|
|
50064
|
-
|
|
50065
|
-
|
|
50066
|
-
|
|
50354
|
+
return /* @__PURE__ */ jsx(
|
|
50355
|
+
motion.div,
|
|
50356
|
+
{
|
|
50357
|
+
variants: cardVariants,
|
|
50358
|
+
initial: "initial",
|
|
50359
|
+
animate: "animate",
|
|
50360
|
+
whileHover: "hover",
|
|
50361
|
+
onHoverStart: () => setIsHovered(true),
|
|
50362
|
+
onHoverEnd: () => setIsHovered(false),
|
|
50363
|
+
children: /* @__PURE__ */ jsxs(
|
|
50364
|
+
MoonUICardPro,
|
|
50365
|
+
{
|
|
50366
|
+
className: cn(
|
|
50367
|
+
"relative overflow-hidden cursor-pointer transition-all duration-300",
|
|
50368
|
+
interactive && "hover:shadow-lg hover:shadow-primary/5",
|
|
50369
|
+
glassmorphism && "bg-background/60 backdrop-blur-md border-white/10",
|
|
50370
|
+
className
|
|
50371
|
+
),
|
|
50372
|
+
onClick,
|
|
50373
|
+
children: [
|
|
50374
|
+
glassmorphism && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-br from-primary/5 to-transparent" }),
|
|
50375
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-4 pb-2", children: [
|
|
50376
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
50377
|
+
/* @__PURE__ */ jsx(
|
|
50378
|
+
motion.div,
|
|
50379
|
+
{
|
|
50380
|
+
className: cn(
|
|
50381
|
+
"p-2 rounded-lg",
|
|
50382
|
+
glassmorphism ? "bg-white/10 backdrop-blur" : "bg-muted"
|
|
50383
|
+
),
|
|
50384
|
+
whileHover: { scale: 1.05 },
|
|
50385
|
+
whileTap: { scale: 0.95 },
|
|
50386
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("h-5 w-5", colorClasses[data.color || "primary"]), children: data.icon })
|
|
50387
|
+
}
|
|
50388
|
+
),
|
|
50389
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-muted-foreground", children: data.title }) })
|
|
50390
|
+
] }),
|
|
50391
|
+
interactive && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
50392
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
50393
|
+
MoonUIButtonPro,
|
|
50394
|
+
{
|
|
50395
|
+
variant: "ghost",
|
|
50396
|
+
size: "sm",
|
|
50397
|
+
className: "h-8 w-8 p-0",
|
|
50398
|
+
onClick: (e) => e.stopPropagation(),
|
|
50399
|
+
children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-4 w-4" })
|
|
50400
|
+
}
|
|
50401
|
+
) }),
|
|
50402
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
|
|
50403
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAction?.("fullscreen"), children: [
|
|
50404
|
+
/* @__PURE__ */ jsx(Maximize2, { className: "mr-2 h-4 w-4" }),
|
|
50405
|
+
"Fullscreen"
|
|
50406
|
+
] }),
|
|
50407
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAction?.("export"), children: [
|
|
50408
|
+
/* @__PURE__ */ jsx(Download, { className: "mr-2 h-4 w-4" }),
|
|
50409
|
+
"Export Data"
|
|
50410
|
+
] }),
|
|
50411
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAction?.("share"), children: [
|
|
50412
|
+
/* @__PURE__ */ jsx(Share2, { className: "mr-2 h-4 w-4" }),
|
|
50413
|
+
"Share"
|
|
50414
|
+
] })
|
|
50415
|
+
] })
|
|
50416
|
+
] })
|
|
50417
|
+
] }),
|
|
50418
|
+
/* @__PURE__ */ jsxs("div", { className: "px-4 pb-4", children: [
|
|
50419
|
+
/* @__PURE__ */ jsx(MoonUITooltipProviderPro, { children: /* @__PURE__ */ jsxs(MoonUITooltipPro, { children: [
|
|
50420
|
+
/* @__PURE__ */ jsx(MoonUITooltipTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
50421
|
+
motion.div,
|
|
50422
|
+
{
|
|
50423
|
+
className: "text-3xl font-bold tracking-tight",
|
|
50424
|
+
animate: {
|
|
50425
|
+
scale: isHovered ? 1.02 : 1
|
|
50426
|
+
},
|
|
50427
|
+
transition: { duration: 0.2 },
|
|
50428
|
+
children: [
|
|
50429
|
+
formatValue(data.value),
|
|
50430
|
+
data.unit && /* @__PURE__ */ jsx("span", { className: "text-lg ml-1 text-muted-foreground", children: data.unit })
|
|
50431
|
+
]
|
|
50432
|
+
}
|
|
50433
|
+
) }),
|
|
50434
|
+
/* @__PURE__ */ jsx(MoonUITooltipContentPro, { children: /* @__PURE__ */ jsxs("p", { children: [
|
|
50435
|
+
"Exact value: ",
|
|
50436
|
+
data.value,
|
|
50437
|
+
" ",
|
|
50438
|
+
data.unit
|
|
50439
|
+
] }) })
|
|
50440
|
+
] }) }),
|
|
50441
|
+
data.change && /* @__PURE__ */ jsxs(
|
|
50442
|
+
motion.div,
|
|
50443
|
+
{
|
|
50444
|
+
className: cn(
|
|
50445
|
+
"flex items-center gap-1 text-sm mt-2",
|
|
50446
|
+
getChangeColor(data.change.type)
|
|
50447
|
+
),
|
|
50448
|
+
initial: { opacity: 0, x: -10 },
|
|
50449
|
+
animate: { opacity: 1, x: 0 },
|
|
50450
|
+
transition: { delay: 0.1 },
|
|
50451
|
+
children: [
|
|
50452
|
+
getChangeIcon(data.change.type),
|
|
50453
|
+
/* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
|
|
50454
|
+
data.change.type === "neutral" ? "" : data.change.type === "increase" ? "+" : "-",
|
|
50455
|
+
Math.abs(data.change.value),
|
|
50456
|
+
"%"
|
|
50457
|
+
] }),
|
|
50458
|
+
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
50459
|
+
"from ",
|
|
50460
|
+
data.change.period
|
|
50461
|
+
] })
|
|
50462
|
+
]
|
|
50463
|
+
}
|
|
50464
|
+
),
|
|
50465
|
+
showForecast && data.forecast && /* @__PURE__ */ jsxs(
|
|
50466
|
+
motion.div,
|
|
50467
|
+
{
|
|
50468
|
+
className: "flex items-center gap-1 text-xs text-muted-foreground mt-1",
|
|
50469
|
+
initial: { opacity: 0 },
|
|
50470
|
+
animate: { opacity: 1 },
|
|
50471
|
+
transition: { delay: 0.2 },
|
|
50472
|
+
children: [
|
|
50473
|
+
/* @__PURE__ */ jsx(TrendingUp, { className: "h-3 w-3" }),
|
|
50474
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
50475
|
+
"Forecast: ",
|
|
50476
|
+
formatValue(data.forecast),
|
|
50477
|
+
" ",
|
|
50478
|
+
data.unit
|
|
50479
|
+
] })
|
|
50480
|
+
]
|
|
50481
|
+
}
|
|
50482
|
+
),
|
|
50483
|
+
renderProgress()
|
|
50484
|
+
] }),
|
|
50485
|
+
showSparkline && renderSparkline()
|
|
50486
|
+
]
|
|
50487
|
+
}
|
|
50488
|
+
)
|
|
50067
50489
|
}
|
|
50068
|
-
|
|
50069
|
-
|
|
50070
|
-
|
|
50490
|
+
);
|
|
50491
|
+
}
|
|
50492
|
+
var CHART_COLORS = {
|
|
50493
|
+
default: ["#3b82f6", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6", "#ec4899"],
|
|
50494
|
+
pastel: ["#93c5fd", "#86efac", "#fcd34d", "#fca5a5", "#c4b5fd", "#fbcfe8"],
|
|
50495
|
+
vibrant: ["#2563eb", "#059669", "#d97706", "#dc2626", "#7c3aed", "#db2777"],
|
|
50496
|
+
monochrome: ["#1f2937", "#374151", "#4b5563", "#6b7280", "#9ca3af", "#d1d5db"]
|
|
50497
|
+
};
|
|
50498
|
+
function ChartWidget({
|
|
50499
|
+
id,
|
|
50500
|
+
title,
|
|
50501
|
+
description,
|
|
50502
|
+
data,
|
|
50503
|
+
className,
|
|
50504
|
+
height = 300,
|
|
50505
|
+
onAction,
|
|
50506
|
+
loading = false,
|
|
50507
|
+
refreshing = false,
|
|
50508
|
+
glassmorphism = false,
|
|
50509
|
+
interactive = true
|
|
50510
|
+
}) {
|
|
50511
|
+
const [colorScheme, setColorScheme] = t__default.useState("default");
|
|
50512
|
+
const [isFullscreen, setIsFullscreen] = t__default.useState(false);
|
|
50513
|
+
const colors = CHART_COLORS[colorScheme];
|
|
50514
|
+
const CustomTooltip2 = ({ active, payload, label }) => {
|
|
50515
|
+
if (!active || !payload)
|
|
50516
|
+
return null;
|
|
50071
50517
|
return /* @__PURE__ */ jsxs(
|
|
50072
|
-
|
|
50518
|
+
motion.div,
|
|
50073
50519
|
{
|
|
50520
|
+
initial: { opacity: 0, scale: 0.9 },
|
|
50521
|
+
animate: { opacity: 1, scale: 1 },
|
|
50074
50522
|
className: cn(
|
|
50075
|
-
"
|
|
50076
|
-
|
|
50523
|
+
"p-3 rounded-lg shadow-lg",
|
|
50524
|
+
glassmorphism ? "bg-background/80 backdrop-blur-md border border-white/10" : "bg-background border"
|
|
50077
50525
|
),
|
|
50078
|
-
onClick: () => onMetricClick?.(metric),
|
|
50079
50526
|
children: [
|
|
50080
|
-
/* @__PURE__ */
|
|
50081
|
-
|
|
50082
|
-
/* @__PURE__ */ jsx(
|
|
50527
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: label }),
|
|
50528
|
+
payload.map((entry, index) => /* @__PURE__ */ jsxs("p", { className: "text-sm mt-1", children: [
|
|
50529
|
+
/* @__PURE__ */ jsx(
|
|
50530
|
+
"span",
|
|
50531
|
+
{
|
|
50532
|
+
className: "inline-block w-3 h-3 rounded-full mr-2",
|
|
50533
|
+
style: { backgroundColor: entry.color }
|
|
50534
|
+
}
|
|
50535
|
+
),
|
|
50536
|
+
entry.name,
|
|
50537
|
+
": ",
|
|
50538
|
+
entry.value
|
|
50539
|
+
] }, index))
|
|
50540
|
+
]
|
|
50541
|
+
}
|
|
50542
|
+
);
|
|
50543
|
+
};
|
|
50544
|
+
const renderChart = () => {
|
|
50545
|
+
if (!data.data || data.data.length === 0) {
|
|
50546
|
+
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: "No data available" });
|
|
50547
|
+
}
|
|
50548
|
+
const chartProps = {
|
|
50549
|
+
data: data.data,
|
|
50550
|
+
margin: { top: 5, right: 30, left: 20, bottom: 5 }
|
|
50551
|
+
};
|
|
50552
|
+
switch (data.type) {
|
|
50553
|
+
case "line":
|
|
50554
|
+
return /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(LineChart, { ...chartProps, children: [
|
|
50555
|
+
/* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", className: "opacity-30" }),
|
|
50556
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: "name" }),
|
|
50557
|
+
/* @__PURE__ */ jsx(YAxis, {}),
|
|
50558
|
+
/* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(CustomTooltip2, {}) }),
|
|
50559
|
+
interactive && /* @__PURE__ */ jsx(Legend, {}),
|
|
50560
|
+
Object.keys(data.data[0]).filter((key) => key !== "name").map((key, index) => /* @__PURE__ */ jsx(
|
|
50561
|
+
Line,
|
|
50562
|
+
{
|
|
50563
|
+
type: "monotone",
|
|
50564
|
+
dataKey: key,
|
|
50565
|
+
stroke: colors[index % colors.length],
|
|
50566
|
+
strokeWidth: 2,
|
|
50567
|
+
dot: { r: 4 },
|
|
50568
|
+
activeDot: { r: 6 }
|
|
50569
|
+
},
|
|
50570
|
+
key
|
|
50571
|
+
))
|
|
50572
|
+
] }) });
|
|
50573
|
+
case "bar":
|
|
50574
|
+
return /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(BarChart, { ...chartProps, children: [
|
|
50575
|
+
/* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", className: "opacity-30" }),
|
|
50576
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: "name" }),
|
|
50577
|
+
/* @__PURE__ */ jsx(YAxis, {}),
|
|
50578
|
+
/* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(CustomTooltip2, {}) }),
|
|
50579
|
+
interactive && /* @__PURE__ */ jsx(Legend, {}),
|
|
50580
|
+
Object.keys(data.data[0]).filter((key) => key !== "name").map((key, index) => /* @__PURE__ */ jsx(
|
|
50581
|
+
Bar,
|
|
50582
|
+
{
|
|
50583
|
+
dataKey: key,
|
|
50584
|
+
fill: colors[index % colors.length],
|
|
50585
|
+
radius: [4, 4, 0, 0]
|
|
50586
|
+
},
|
|
50587
|
+
key
|
|
50588
|
+
))
|
|
50589
|
+
] }) });
|
|
50590
|
+
case "area":
|
|
50591
|
+
return /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(AreaChart, { ...chartProps, children: [
|
|
50592
|
+
/* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", className: "opacity-30" }),
|
|
50593
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: "name" }),
|
|
50594
|
+
/* @__PURE__ */ jsx(YAxis, {}),
|
|
50595
|
+
/* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(CustomTooltip2, {}) }),
|
|
50596
|
+
interactive && /* @__PURE__ */ jsx(Legend, {}),
|
|
50597
|
+
Object.keys(data.data[0]).filter((key) => key !== "name").map((key, index) => /* @__PURE__ */ jsx(
|
|
50598
|
+
Area,
|
|
50599
|
+
{
|
|
50600
|
+
type: "monotone",
|
|
50601
|
+
dataKey: key,
|
|
50602
|
+
stroke: colors[index % colors.length],
|
|
50603
|
+
fill: colors[index % colors.length],
|
|
50604
|
+
fillOpacity: 0.2
|
|
50605
|
+
},
|
|
50606
|
+
key
|
|
50607
|
+
))
|
|
50608
|
+
] }) });
|
|
50609
|
+
case "pie":
|
|
50610
|
+
case "donut":
|
|
50611
|
+
return /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(PieChart, { children: [
|
|
50612
|
+
/* @__PURE__ */ jsx(
|
|
50613
|
+
Pie,
|
|
50614
|
+
{
|
|
50615
|
+
data: data.data,
|
|
50616
|
+
cx: "50%",
|
|
50617
|
+
cy: "50%",
|
|
50618
|
+
labelLine: false,
|
|
50619
|
+
label: interactive,
|
|
50620
|
+
outerRadius: data.type === "donut" ? 80 : 100,
|
|
50621
|
+
innerRadius: data.type === "donut" ? 50 : 0,
|
|
50622
|
+
fill: "#8884d8",
|
|
50623
|
+
dataKey: "value",
|
|
50624
|
+
children: data.data.map((entry, index) => /* @__PURE__ */ jsx(Cell, { fill: colors[index % colors.length] }, `cell-${index}`))
|
|
50625
|
+
}
|
|
50626
|
+
),
|
|
50627
|
+
/* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(CustomTooltip2, {}) }),
|
|
50628
|
+
interactive && /* @__PURE__ */ jsx(Legend, {})
|
|
50629
|
+
] }) });
|
|
50630
|
+
case "radar":
|
|
50631
|
+
return /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(RadarChart, { data: data.data, children: [
|
|
50632
|
+
/* @__PURE__ */ jsx(PolarGrid, {}),
|
|
50633
|
+
/* @__PURE__ */ jsx(PolarAngleAxis, { dataKey: "subject" }),
|
|
50634
|
+
/* @__PURE__ */ jsx(PolarRadiusAxis, {}),
|
|
50635
|
+
Object.keys(data.data[0]).filter((key) => key !== "subject").map((key, index) => /* @__PURE__ */ jsx(
|
|
50636
|
+
Radar,
|
|
50637
|
+
{
|
|
50638
|
+
name: key,
|
|
50639
|
+
dataKey: key,
|
|
50640
|
+
stroke: colors[index % colors.length],
|
|
50641
|
+
fill: colors[index % colors.length],
|
|
50642
|
+
fillOpacity: 0.3
|
|
50643
|
+
},
|
|
50644
|
+
key
|
|
50645
|
+
)),
|
|
50646
|
+
/* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(CustomTooltip2, {}) }),
|
|
50647
|
+
interactive && /* @__PURE__ */ jsx(Legend, {})
|
|
50648
|
+
] }) });
|
|
50649
|
+
default:
|
|
50650
|
+
return null;
|
|
50651
|
+
}
|
|
50652
|
+
};
|
|
50653
|
+
const cardVariants = {
|
|
50654
|
+
initial: { opacity: 0, scale: 0.95 },
|
|
50655
|
+
animate: {
|
|
50656
|
+
opacity: 1,
|
|
50657
|
+
scale: 1,
|
|
50658
|
+
transition: { duration: 0.3, ease: "easeOut" }
|
|
50659
|
+
}
|
|
50660
|
+
};
|
|
50661
|
+
return /* @__PURE__ */ jsx(
|
|
50662
|
+
motion.div,
|
|
50663
|
+
{
|
|
50664
|
+
variants: cardVariants,
|
|
50665
|
+
initial: "initial",
|
|
50666
|
+
animate: "animate",
|
|
50667
|
+
className: cn(isFullscreen && "fixed inset-4 z-50"),
|
|
50668
|
+
children: /* @__PURE__ */ jsxs(MoonUICardPro, { className: cn(
|
|
50669
|
+
"relative overflow-hidden transition-all duration-300",
|
|
50670
|
+
glassmorphism && "bg-background/60 backdrop-blur-md border-white/10",
|
|
50671
|
+
isFullscreen && "h-full",
|
|
50672
|
+
className
|
|
50673
|
+
), children: [
|
|
50674
|
+
/* @__PURE__ */ jsxs(MoonUICardHeaderPro, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
50675
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
50676
|
+
/* @__PURE__ */ jsx(MoonUICardTitlePro, { className: "text-base font-semibold", children: title }),
|
|
50677
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: description })
|
|
50083
50678
|
] }),
|
|
50084
|
-
/* @__PURE__ */ jsxs(
|
|
50085
|
-
/* @__PURE__ */ jsx(
|
|
50086
|
-
|
|
50087
|
-
|
|
50088
|
-
|
|
50089
|
-
|
|
50090
|
-
|
|
50091
|
-
|
|
50092
|
-
|
|
50093
|
-
|
|
50094
|
-
|
|
50679
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
50680
|
+
refreshing && /* @__PURE__ */ jsx(
|
|
50681
|
+
motion.div,
|
|
50682
|
+
{
|
|
50683
|
+
animate: { rotate: 360 },
|
|
50684
|
+
transition: { duration: 1, repeat: Infinity, ease: "linear" },
|
|
50685
|
+
children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4 text-muted-foreground" })
|
|
50686
|
+
}
|
|
50687
|
+
),
|
|
50688
|
+
interactive && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
50689
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-4 w-4" }) }) }),
|
|
50690
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", className: "w-48", children: [
|
|
50691
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => {
|
|
50692
|
+
setIsFullscreen(!isFullscreen);
|
|
50693
|
+
onAction?.("fullscreen", { fullscreen: !isFullscreen });
|
|
50694
|
+
}, children: [
|
|
50695
|
+
/* @__PURE__ */ jsx(Maximize2, { className: "mr-2 h-4 w-4" }),
|
|
50696
|
+
isFullscreen ? "Exit Fullscreen" : "Fullscreen"
|
|
50697
|
+
] }),
|
|
50698
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuSubPro, { children: [
|
|
50699
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuSubTriggerPro, { children: [
|
|
50700
|
+
/* @__PURE__ */ jsx(Palette, { className: "mr-2 h-4 w-4" }),
|
|
50701
|
+
"Color Scheme"
|
|
50702
|
+
] }),
|
|
50703
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuSubContentPro, { children: Object.keys(CHART_COLORS).map((scheme2) => /* @__PURE__ */ jsx(
|
|
50704
|
+
MoonUIDropdownMenuItemPro,
|
|
50705
|
+
{
|
|
50706
|
+
onClick: () => setColorScheme(scheme2),
|
|
50707
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
50708
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1", children: CHART_COLORS[scheme2].slice(0, 3).map((color, i) => /* @__PURE__ */ jsx(
|
|
50709
|
+
"div",
|
|
50710
|
+
{
|
|
50711
|
+
className: "w-3 h-3 rounded-full",
|
|
50712
|
+
style: { backgroundColor: color }
|
|
50713
|
+
},
|
|
50714
|
+
i
|
|
50715
|
+
)) }),
|
|
50716
|
+
/* @__PURE__ */ jsx("span", { className: "capitalize", children: scheme2 })
|
|
50717
|
+
] })
|
|
50718
|
+
},
|
|
50719
|
+
scheme2
|
|
50720
|
+
)) })
|
|
50721
|
+
] }),
|
|
50722
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
|
|
50723
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAction?.("export", { format: "png" }), children: [
|
|
50724
|
+
/* @__PURE__ */ jsx(Download, { className: "mr-2 h-4 w-4" }),
|
|
50725
|
+
"Export as PNG"
|
|
50726
|
+
] }),
|
|
50727
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAction?.("export", { format: "csv" }), children: [
|
|
50728
|
+
/* @__PURE__ */ jsx(Download, { className: "mr-2 h-4 w-4" }),
|
|
50729
|
+
"Export Data"
|
|
50730
|
+
] }),
|
|
50731
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
|
|
50732
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAction?.("filter"), children: [
|
|
50733
|
+
/* @__PURE__ */ jsx(Filter, { className: "mr-2 h-4 w-4" }),
|
|
50734
|
+
"Filter Data"
|
|
50735
|
+
] }),
|
|
50736
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAction?.("settings"), children: [
|
|
50737
|
+
/* @__PURE__ */ jsx(Settings, { className: "mr-2 h-4 w-4" }),
|
|
50738
|
+
"Chart Settings"
|
|
50739
|
+
] })
|
|
50095
50740
|
] })
|
|
50096
|
-
] })
|
|
50097
|
-
metric.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: metric.description })
|
|
50741
|
+
] })
|
|
50098
50742
|
] })
|
|
50099
|
-
]
|
|
50100
|
-
|
|
50101
|
-
|
|
50102
|
-
|
|
50743
|
+
] }),
|
|
50744
|
+
/* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-0 px-4 pb-4", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: loading ? /* @__PURE__ */ jsx(
|
|
50745
|
+
motion.div,
|
|
50746
|
+
{
|
|
50747
|
+
initial: { opacity: 0 },
|
|
50748
|
+
animate: { opacity: 1 },
|
|
50749
|
+
exit: { opacity: 0 },
|
|
50750
|
+
className: "flex items-center justify-center",
|
|
50751
|
+
style: { height },
|
|
50752
|
+
children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
50753
|
+
/* @__PURE__ */ jsx("div", { className: "animate-pulse bg-muted h-4 w-32 rounded" }),
|
|
50754
|
+
/* @__PURE__ */ jsx("div", { className: "animate-pulse bg-muted h-4 w-24 rounded" }),
|
|
50755
|
+
/* @__PURE__ */ jsx("div", { className: "animate-pulse bg-muted h-4 w-28 rounded" })
|
|
50756
|
+
] })
|
|
50757
|
+
},
|
|
50758
|
+
"loading"
|
|
50759
|
+
) : /* @__PURE__ */ jsx(
|
|
50760
|
+
motion.div,
|
|
50761
|
+
{
|
|
50762
|
+
initial: { opacity: 0, y: 10 },
|
|
50763
|
+
animate: { opacity: 1, y: 0 },
|
|
50764
|
+
exit: { opacity: 0, y: -10 },
|
|
50765
|
+
transition: { duration: 0.3 },
|
|
50766
|
+
children: renderChart()
|
|
50767
|
+
},
|
|
50768
|
+
"chart"
|
|
50769
|
+
) }) })
|
|
50770
|
+
] })
|
|
50771
|
+
}
|
|
50772
|
+
);
|
|
50773
|
+
}
|
|
50774
|
+
function ActivityFeed({
|
|
50775
|
+
items,
|
|
50776
|
+
title = "Activity Feed",
|
|
50777
|
+
className,
|
|
50778
|
+
height = 400,
|
|
50779
|
+
onItemClick,
|
|
50780
|
+
onAction,
|
|
50781
|
+
loading = false,
|
|
50782
|
+
showFilters = true,
|
|
50783
|
+
showNotifications = true,
|
|
50784
|
+
glassmorphism = false,
|
|
50785
|
+
realtime = false
|
|
50786
|
+
}) {
|
|
50787
|
+
const [filter, setFilter] = t__default.useState("all");
|
|
50788
|
+
const [notificationsEnabled, setNotificationsEnabled] = t__default.useState(true);
|
|
50789
|
+
const [newItems, setNewItems] = t__default.useState([]);
|
|
50790
|
+
t__default.useEffect(() => {
|
|
50791
|
+
if (!realtime)
|
|
50792
|
+
return;
|
|
50793
|
+
const interval = setInterval(() => {
|
|
50794
|
+
const randomItem = {
|
|
50795
|
+
id: `new-${Date.now()}`,
|
|
50796
|
+
type: ["info", "success", "warning", "error"][Math.floor(Math.random() * 4)],
|
|
50797
|
+
title: "New activity",
|
|
50798
|
+
description: "Something happened just now",
|
|
50799
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
50800
|
+
user: {
|
|
50801
|
+
name: "System",
|
|
50802
|
+
avatar: void 0
|
|
50803
|
+
}
|
|
50804
|
+
};
|
|
50805
|
+
setNewItems((prev) => [randomItem, ...prev].slice(0, 3));
|
|
50806
|
+
setTimeout(() => {
|
|
50807
|
+
setNewItems((prev) => prev.filter((item) => item.id !== randomItem.id));
|
|
50808
|
+
}, 5e3);
|
|
50809
|
+
}, 1e4);
|
|
50810
|
+
return () => clearInterval(interval);
|
|
50811
|
+
}, [realtime]);
|
|
50812
|
+
const getTypeIcon = (type) => {
|
|
50813
|
+
switch (type) {
|
|
50814
|
+
case "info":
|
|
50815
|
+
return /* @__PURE__ */ jsx(Info, { className: "h-4 w-4" });
|
|
50816
|
+
case "success":
|
|
50817
|
+
return /* @__PURE__ */ jsx(CheckCircle, { className: "h-4 w-4" });
|
|
50818
|
+
case "warning":
|
|
50819
|
+
return /* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" });
|
|
50820
|
+
case "error":
|
|
50821
|
+
return /* @__PURE__ */ jsx(XCircle, { className: "h-4 w-4" });
|
|
50822
|
+
}
|
|
50103
50823
|
};
|
|
50104
|
-
const
|
|
50105
|
-
|
|
50106
|
-
|
|
50107
|
-
|
|
50108
|
-
|
|
50109
|
-
|
|
50110
|
-
|
|
50824
|
+
const getTypeColor = (type) => {
|
|
50825
|
+
switch (type) {
|
|
50826
|
+
case "info":
|
|
50827
|
+
return "text-blue-500 bg-blue-100 dark:bg-blue-900/20";
|
|
50828
|
+
case "success":
|
|
50829
|
+
return "text-green-500 bg-green-100 dark:bg-green-900/20";
|
|
50830
|
+
case "warning":
|
|
50831
|
+
return "text-yellow-500 bg-yellow-100 dark:bg-yellow-900/20";
|
|
50832
|
+
case "error":
|
|
50833
|
+
return "text-red-500 bg-red-100 dark:bg-red-900/20";
|
|
50834
|
+
}
|
|
50835
|
+
};
|
|
50836
|
+
const filteredItems = [...newItems, ...items].filter(
|
|
50837
|
+
(item) => filter === "all" || item.type === filter
|
|
50838
|
+
);
|
|
50839
|
+
const renderActivityItem = (item, isNew = false) => /* @__PURE__ */ jsxs(
|
|
50840
|
+
motion.div,
|
|
50841
|
+
{
|
|
50842
|
+
layout: true,
|
|
50843
|
+
initial: { opacity: 0, x: -20 },
|
|
50844
|
+
animate: { opacity: 1, x: 0 },
|
|
50845
|
+
exit: { opacity: 0, x: 20 },
|
|
50846
|
+
whileHover: { x: 4 },
|
|
50847
|
+
transition: { duration: 0.2 },
|
|
50848
|
+
className: cn(
|
|
50849
|
+
"group relative flex gap-3 p-3 rounded-lg cursor-pointer transition-colors",
|
|
50850
|
+
"hover:bg-muted/50",
|
|
50851
|
+
isNew && "bg-primary/5 border-l-2 border-primary"
|
|
50852
|
+
),
|
|
50853
|
+
onClick: () => onItemClick?.(item),
|
|
50854
|
+
children: [
|
|
50855
|
+
/* @__PURE__ */ jsx("div", { className: "absolute left-7 top-12 bottom-0 w-px bg-border" }),
|
|
50856
|
+
/* @__PURE__ */ jsx("div", { className: "relative z-10 flex-shrink-0", children: item.user?.avatar ? /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-8 w-8", children: [
|
|
50857
|
+
/* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: item.user.avatar }),
|
|
50858
|
+
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { children: item.user.name[0] })
|
|
50859
|
+
] }) : /* @__PURE__ */ jsx("div", { className: cn(
|
|
50860
|
+
"h-8 w-8 rounded-full flex items-center justify-center",
|
|
50861
|
+
getTypeColor(item.type)
|
|
50862
|
+
), children: item.icon || getTypeIcon(item.type) }) }),
|
|
50863
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
50864
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
50865
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
50866
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm font-medium leading-tight", children: [
|
|
50867
|
+
item.user?.name && /* @__PURE__ */ jsxs("span", { className: "text-foreground", children: [
|
|
50868
|
+
item.user.name,
|
|
50869
|
+
" "
|
|
50870
|
+
] }),
|
|
50871
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: item.title })
|
|
50872
|
+
] }),
|
|
50873
|
+
item.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-0.5 line-clamp-2", children: item.description })
|
|
50874
|
+
] }),
|
|
50875
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground whitespace-nowrap", children: [
|
|
50876
|
+
/* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }),
|
|
50877
|
+
formatDistanceToNow(item.timestamp, { addSuffix: true })
|
|
50878
|
+
] })
|
|
50879
|
+
] }),
|
|
50880
|
+
isNew && /* @__PURE__ */ jsx(
|
|
50881
|
+
motion.div,
|
|
50882
|
+
{
|
|
50883
|
+
initial: { scale: 0 },
|
|
50884
|
+
animate: { scale: 1 },
|
|
50885
|
+
className: "inline-block mt-1",
|
|
50886
|
+
children: /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "default", className: "text-xs", children: "New" })
|
|
50887
|
+
}
|
|
50888
|
+
)
|
|
50111
50889
|
] }),
|
|
50890
|
+
/* @__PURE__ */ jsx("div", { className: "opacity-0 group-hover:opacity-100 transition-opacity", children: /* @__PURE__ */ jsx(
|
|
50891
|
+
MoonUIButtonPro,
|
|
50892
|
+
{
|
|
50893
|
+
variant: "ghost",
|
|
50894
|
+
size: "sm",
|
|
50895
|
+
className: "h-6 w-6 p-0",
|
|
50896
|
+
onClick: (e) => {
|
|
50897
|
+
e.stopPropagation();
|
|
50898
|
+
onAction?.("more", item);
|
|
50899
|
+
},
|
|
50900
|
+
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-3 w-3" })
|
|
50901
|
+
}
|
|
50902
|
+
) })
|
|
50903
|
+
]
|
|
50904
|
+
},
|
|
50905
|
+
item.id
|
|
50906
|
+
);
|
|
50907
|
+
return /* @__PURE__ */ jsxs(MoonUICardPro, { className: cn(
|
|
50908
|
+
"relative overflow-hidden",
|
|
50909
|
+
glassmorphism && "bg-background/60 backdrop-blur-md border-white/10",
|
|
50910
|
+
className
|
|
50911
|
+
), children: [
|
|
50912
|
+
/* @__PURE__ */ jsxs(MoonUICardHeaderPro, { className: "flex flex-row items-center justify-between space-y-0 pb-3", children: [
|
|
50913
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
50914
|
+
/* @__PURE__ */ jsx(Activity, { className: "h-4 w-4 text-muted-foreground" }),
|
|
50915
|
+
/* @__PURE__ */ jsx(MoonUICardTitlePro, { className: "text-base font-semibold", children: title }),
|
|
50916
|
+
realtime && /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "secondary", className: "text-xs", children: [
|
|
50917
|
+
/* @__PURE__ */ jsx("span", { className: "mr-1 h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse" }),
|
|
50918
|
+
"Live"
|
|
50919
|
+
] })
|
|
50920
|
+
] }),
|
|
50921
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
50922
|
+
showFilters && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
50923
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "ghost", size: "sm", className: "h-8 px-2", children: [
|
|
50924
|
+
/* @__PURE__ */ jsx(Filter, { className: "h-4 w-4 mr-1" }),
|
|
50925
|
+
filter !== "all" && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "ml-1", children: filter })
|
|
50926
|
+
] }) }),
|
|
50927
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
|
|
50928
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => setFilter("all"), children: "All Activities" }),
|
|
50929
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
|
|
50930
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setFilter("info"), children: [
|
|
50931
|
+
/* @__PURE__ */ jsx(Info, { className: "mr-2 h-4 w-4 text-blue-500" }),
|
|
50932
|
+
"Information"
|
|
50933
|
+
] }),
|
|
50934
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setFilter("success"), children: [
|
|
50935
|
+
/* @__PURE__ */ jsx(CheckCircle, { className: "mr-2 h-4 w-4 text-green-500" }),
|
|
50936
|
+
"Success"
|
|
50937
|
+
] }),
|
|
50938
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setFilter("warning"), children: [
|
|
50939
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "mr-2 h-4 w-4 text-yellow-500" }),
|
|
50940
|
+
"Warning"
|
|
50941
|
+
] }),
|
|
50942
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setFilter("error"), children: [
|
|
50943
|
+
/* @__PURE__ */ jsx(XCircle, { className: "mr-2 h-4 w-4 text-red-500" }),
|
|
50944
|
+
"Error"
|
|
50945
|
+
] })
|
|
50946
|
+
] })
|
|
50947
|
+
] }),
|
|
50948
|
+
showNotifications && /* @__PURE__ */ jsx(
|
|
50949
|
+
MoonUIButtonPro,
|
|
50950
|
+
{
|
|
50951
|
+
variant: "ghost",
|
|
50952
|
+
size: "sm",
|
|
50953
|
+
className: "h-8 w-8 p-0",
|
|
50954
|
+
onClick: () => {
|
|
50955
|
+
setNotificationsEnabled(!notificationsEnabled);
|
|
50956
|
+
onAction?.("notifications", { enabled: !notificationsEnabled });
|
|
50957
|
+
},
|
|
50958
|
+
children: notificationsEnabled ? /* @__PURE__ */ jsx(Bell, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(BellOff, { className: "h-4 w-4 text-muted-foreground" })
|
|
50959
|
+
}
|
|
50960
|
+
),
|
|
50112
50961
|
/* @__PURE__ */ jsx(
|
|
50113
50962
|
MoonUIButtonPro,
|
|
50114
50963
|
{
|
|
50115
50964
|
variant: "ghost",
|
|
50116
50965
|
size: "sm",
|
|
50117
|
-
|
|
50118
|
-
|
|
50966
|
+
className: "h-8 w-8 p-0",
|
|
50967
|
+
onClick: () => onAction?.("refresh"),
|
|
50968
|
+
children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" })
|
|
50119
50969
|
}
|
|
50120
50970
|
)
|
|
50121
|
-
] })
|
|
50122
|
-
|
|
50123
|
-
|
|
50971
|
+
] })
|
|
50972
|
+
] }),
|
|
50973
|
+
/* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-0", children: /* @__PURE__ */ jsx(ScrollArea, { className: "px-4 pb-4", style: { height }, children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: loading ? /* @__PURE__ */ jsx(
|
|
50974
|
+
motion.div,
|
|
50975
|
+
{
|
|
50976
|
+
initial: { opacity: 0 },
|
|
50977
|
+
animate: { opacity: 1 },
|
|
50978
|
+
exit: { opacity: 0 },
|
|
50979
|
+
className: "space-y-3",
|
|
50980
|
+
children: [...Array(5)].map((_, i) => /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
50981
|
+
/* @__PURE__ */ jsx("div", { className: "h-8 w-8 rounded-full bg-muted animate-pulse" }),
|
|
50982
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
50983
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded animate-pulse" }),
|
|
50984
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-3/4 animate-pulse" })
|
|
50985
|
+
] })
|
|
50986
|
+
] }, i))
|
|
50987
|
+
},
|
|
50988
|
+
"loading"
|
|
50989
|
+
) : filteredItems.length === 0 ? /* @__PURE__ */ jsxs(
|
|
50990
|
+
motion.div,
|
|
50991
|
+
{
|
|
50992
|
+
initial: { opacity: 0 },
|
|
50993
|
+
animate: { opacity: 1 },
|
|
50994
|
+
className: "flex flex-col items-center justify-center py-12 text-muted-foreground",
|
|
50995
|
+
children: [
|
|
50996
|
+
/* @__PURE__ */ jsx(Activity, { className: "h-8 w-8 mb-2" }),
|
|
50997
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: "No activities to show" })
|
|
50998
|
+
]
|
|
50999
|
+
},
|
|
51000
|
+
"empty"
|
|
51001
|
+
) : /* @__PURE__ */ jsx("div", { className: "space-y-1", children: filteredItems.map(
|
|
51002
|
+
(item) => renderActivityItem(item, newItems.some((newItem) => newItem.id === item.id))
|
|
51003
|
+
) }) }) }) })
|
|
51004
|
+
] });
|
|
51005
|
+
}
|
|
51006
|
+
|
|
51007
|
+
// node_modules/react-resizable/css/styles.css
|
|
51008
|
+
styleInject(".react-resizable {\n position: relative;\n}\n.react-resizable-handle {\n position: absolute;\n width: 20px;\n height: 20px;\n background-repeat: no-repeat;\n background-origin: content-box;\n box-sizing: border-box;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+);\n background-position: bottom right;\n padding: 0 3px 3px 0;\n}\n.react-resizable-handle-sw {\n bottom: 0;\n left: 0;\n cursor: sw-resize;\n transform: rotate(90deg);\n}\n.react-resizable-handle-se {\n bottom: 0;\n right: 0;\n cursor: se-resize;\n}\n.react-resizable-handle-nw {\n top: 0;\n left: 0;\n cursor: nw-resize;\n transform: rotate(180deg);\n}\n.react-resizable-handle-ne {\n top: 0;\n right: 0;\n cursor: ne-resize;\n transform: rotate(270deg);\n}\n.react-resizable-handle-w,\n.react-resizable-handle-e {\n top: 50%;\n margin-top: -10px;\n cursor: ew-resize;\n}\n.react-resizable-handle-w {\n left: 0;\n transform: rotate(135deg);\n}\n.react-resizable-handle-e {\n right: 0;\n transform: rotate(315deg);\n}\n.react-resizable-handle-n,\n.react-resizable-handle-s {\n left: 50%;\n margin-left: -10px;\n cursor: ns-resize;\n}\n.react-resizable-handle-n {\n top: 0;\n transform: rotate(225deg);\n}\n.react-resizable-handle-s {\n bottom: 0;\n transform: rotate(45deg);\n}\n");
|
|
51009
|
+
function DashboardGrid({
|
|
51010
|
+
widgets,
|
|
51011
|
+
onLayoutChange,
|
|
51012
|
+
onWidgetRemove,
|
|
51013
|
+
onWidgetAction,
|
|
51014
|
+
editMode = false,
|
|
51015
|
+
className,
|
|
51016
|
+
glassmorphism = false,
|
|
51017
|
+
breakpoints = { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 },
|
|
51018
|
+
cols = { lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 },
|
|
51019
|
+
rowHeight = 60,
|
|
51020
|
+
margin = [16, 16],
|
|
51021
|
+
containerPadding = [0, 0]
|
|
51022
|
+
}) {
|
|
51023
|
+
t__default.useState({});
|
|
51024
|
+
const [currentBreakpoint, setCurrentBreakpoint] = t__default.useState("lg");
|
|
51025
|
+
const [lockedWidgets, setLockedWidgets] = t__default.useState(/* @__PURE__ */ new Set());
|
|
51026
|
+
const [fullscreenWidget, setFullscreenWidget] = t__default.useState(null);
|
|
51027
|
+
const generateLayout = () => {
|
|
51028
|
+
return widgets.map((widget) => ({
|
|
51029
|
+
i: widget.id,
|
|
51030
|
+
x: widget.position.x,
|
|
51031
|
+
y: widget.position.y,
|
|
51032
|
+
w: widget.size.w,
|
|
51033
|
+
h: widget.size.h,
|
|
51034
|
+
minW: widget.size.minW || 2,
|
|
51035
|
+
maxW: widget.size.maxW || 12,
|
|
51036
|
+
minH: widget.size.minH || 2,
|
|
51037
|
+
maxH: widget.size.maxH || 8,
|
|
51038
|
+
isDraggable: editMode && !lockedWidgets.has(widget.id) && widget.permissions?.canMove !== false,
|
|
51039
|
+
isResizable: editMode && !lockedWidgets.has(widget.id) && widget.permissions?.canResize !== false
|
|
51040
|
+
}));
|
|
50124
51041
|
};
|
|
50125
|
-
const
|
|
50126
|
-
{
|
|
50127
|
-
|
|
50128
|
-
|
|
50129
|
-
|
|
50130
|
-
|
|
50131
|
-
|
|
50132
|
-
|
|
50133
|
-
|
|
50134
|
-
|
|
50135
|
-
|
|
50136
|
-
|
|
50137
|
-
|
|
50138
|
-
|
|
50139
|
-
|
|
50140
|
-
|
|
50141
|
-
},
|
|
50142
|
-
{
|
|
50143
|
-
id: "active-sessions",
|
|
50144
|
-
title: "Active Sessions",
|
|
50145
|
-
value: 1234,
|
|
50146
|
-
change: { value: 2, type: "decrease", period: "last hour" },
|
|
50147
|
-
icon: /* @__PURE__ */ jsx(Activity, { className: "h-4 w-4" }),
|
|
50148
|
-
color: "warning"
|
|
50149
|
-
},
|
|
50150
|
-
{
|
|
50151
|
-
id: "conversion-rate",
|
|
50152
|
-
title: "Conversion Rate",
|
|
50153
|
-
value: "3.2%",
|
|
50154
|
-
change: { value: 0.3, type: "increase", period: "last week" },
|
|
50155
|
-
icon: /* @__PURE__ */ jsx(TrendingUp, { className: "h-4 w-4" }),
|
|
50156
|
-
color: "info"
|
|
51042
|
+
const toggleWidgetLock = (widgetId) => {
|
|
51043
|
+
setLockedWidgets((prev) => {
|
|
51044
|
+
const newSet = new Set(prev);
|
|
51045
|
+
if (newSet.has(widgetId)) {
|
|
51046
|
+
newSet.delete(widgetId);
|
|
51047
|
+
} else {
|
|
51048
|
+
newSet.add(widgetId);
|
|
51049
|
+
}
|
|
51050
|
+
return newSet;
|
|
51051
|
+
});
|
|
51052
|
+
};
|
|
51053
|
+
const toggleFullscreen = (widgetId) => {
|
|
51054
|
+
if (fullscreenWidget === widgetId) {
|
|
51055
|
+
setFullscreenWidget(null);
|
|
51056
|
+
} else {
|
|
51057
|
+
setFullscreenWidget(widgetId);
|
|
50157
51058
|
}
|
|
50158
|
-
|
|
50159
|
-
const
|
|
50160
|
-
|
|
50161
|
-
|
|
50162
|
-
|
|
50163
|
-
|
|
50164
|
-
|
|
50165
|
-
|
|
50166
|
-
|
|
50167
|
-
|
|
50168
|
-
|
|
50169
|
-
|
|
50170
|
-
|
|
50171
|
-
|
|
50172
|
-
|
|
50173
|
-
|
|
51059
|
+
};
|
|
51060
|
+
const renderWidget = (widget) => {
|
|
51061
|
+
const isLocked = lockedWidgets.has(widget.id);
|
|
51062
|
+
const isFullscreen = fullscreenWidget === widget.id;
|
|
51063
|
+
const widgetContent = () => {
|
|
51064
|
+
switch (widget.type) {
|
|
51065
|
+
case "metric":
|
|
51066
|
+
return /* @__PURE__ */ jsx(
|
|
51067
|
+
MetricCard,
|
|
51068
|
+
{
|
|
51069
|
+
data: widget.data,
|
|
51070
|
+
onAction: (action) => onWidgetAction?.(widget.id, action),
|
|
51071
|
+
glassmorphism
|
|
51072
|
+
}
|
|
51073
|
+
);
|
|
51074
|
+
case "chart":
|
|
51075
|
+
return /* @__PURE__ */ jsx(
|
|
51076
|
+
ChartWidget,
|
|
51077
|
+
{
|
|
51078
|
+
id: widget.id,
|
|
51079
|
+
title: widget.title,
|
|
51080
|
+
description: widget.description,
|
|
51081
|
+
data: widget.data,
|
|
51082
|
+
loading: widget.loading,
|
|
51083
|
+
glassmorphism,
|
|
51084
|
+
onAction: (action, data) => onWidgetAction?.(widget.id, action, data)
|
|
51085
|
+
}
|
|
51086
|
+
);
|
|
51087
|
+
case "activity":
|
|
51088
|
+
return /* @__PURE__ */ jsx(
|
|
51089
|
+
ActivityFeed,
|
|
51090
|
+
{
|
|
51091
|
+
items: widget.data?.items || [],
|
|
51092
|
+
title: widget.title,
|
|
51093
|
+
loading: widget.loading,
|
|
51094
|
+
glassmorphism,
|
|
51095
|
+
realtime: widget.data?.realtime,
|
|
51096
|
+
onAction: (action, data) => onWidgetAction?.(widget.id, action, data)
|
|
51097
|
+
}
|
|
51098
|
+
);
|
|
51099
|
+
default:
|
|
51100
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: [
|
|
51101
|
+
"Widget type not supported: ",
|
|
51102
|
+
widget.type
|
|
51103
|
+
] });
|
|
51104
|
+
}
|
|
51105
|
+
};
|
|
51106
|
+
return /* @__PURE__ */ jsxs(
|
|
51107
|
+
motion.div,
|
|
51108
|
+
{
|
|
51109
|
+
className: cn(
|
|
51110
|
+
"relative group h-full",
|
|
51111
|
+
isFullscreen && "!fixed !inset-4 !z-50 !h-auto !w-auto"
|
|
51112
|
+
),
|
|
51113
|
+
layout: !isFullscreen,
|
|
51114
|
+
transition: { duration: 0.2 },
|
|
51115
|
+
children: [
|
|
51116
|
+
/* @__PURE__ */ jsx("div", { className: "h-full", children: widgetContent() }),
|
|
51117
|
+
editMode && !isFullscreen && /* @__PURE__ */ jsx(
|
|
51118
|
+
motion.div,
|
|
51119
|
+
{
|
|
51120
|
+
initial: { opacity: 0 },
|
|
51121
|
+
animate: { opacity: 1 },
|
|
51122
|
+
className: "absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
51123
|
+
children: /* @__PURE__ */ jsxs("div", { className: cn(
|
|
51124
|
+
"flex items-center gap-1 p-1 rounded-lg",
|
|
51125
|
+
glassmorphism ? "bg-background/80 backdrop-blur-sm" : "bg-background/95",
|
|
51126
|
+
"border shadow-sm"
|
|
51127
|
+
), children: [
|
|
51128
|
+
!isLocked && /* @__PURE__ */ jsx("div", { className: "drag-handle cursor-move p-1 hover:bg-muted rounded", children: /* @__PURE__ */ jsx(Grip, { className: "h-4 w-4" }) }),
|
|
51129
|
+
/* @__PURE__ */ jsx(
|
|
51130
|
+
MoonUIButtonPro,
|
|
51131
|
+
{
|
|
51132
|
+
variant: "ghost",
|
|
51133
|
+
size: "sm",
|
|
51134
|
+
className: "h-6 w-6 p-0",
|
|
51135
|
+
onClick: () => toggleWidgetLock(widget.id),
|
|
51136
|
+
children: isLocked ? /* @__PURE__ */ jsx(Lock, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(Unlock, { className: "h-3 w-3" })
|
|
51137
|
+
}
|
|
51138
|
+
),
|
|
51139
|
+
/* @__PURE__ */ jsx(
|
|
51140
|
+
MoonUIButtonPro,
|
|
51141
|
+
{
|
|
51142
|
+
variant: "ghost",
|
|
51143
|
+
size: "sm",
|
|
51144
|
+
className: "h-6 w-6 p-0",
|
|
51145
|
+
onClick: () => toggleFullscreen(widget.id),
|
|
51146
|
+
children: /* @__PURE__ */ jsx(Maximize2, { className: "h-3 w-3" })
|
|
51147
|
+
}
|
|
51148
|
+
),
|
|
51149
|
+
/* @__PURE__ */ jsx(
|
|
51150
|
+
MoonUIButtonPro,
|
|
51151
|
+
{
|
|
51152
|
+
variant: "ghost",
|
|
51153
|
+
size: "sm",
|
|
51154
|
+
className: "h-6 w-6 p-0",
|
|
51155
|
+
onClick: () => onWidgetAction?.(widget.id, "settings"),
|
|
51156
|
+
children: /* @__PURE__ */ jsx(Settings, { className: "h-3 w-3" })
|
|
51157
|
+
}
|
|
51158
|
+
),
|
|
51159
|
+
widget.permissions?.canDelete !== false && /* @__PURE__ */ jsx(
|
|
51160
|
+
MoonUIButtonPro,
|
|
51161
|
+
{
|
|
51162
|
+
variant: "ghost",
|
|
51163
|
+
size: "sm",
|
|
51164
|
+
className: "h-6 w-6 p-0 text-destructive hover:text-destructive",
|
|
51165
|
+
onClick: () => onWidgetRemove?.(widget.id),
|
|
51166
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
|
|
51167
|
+
}
|
|
51168
|
+
)
|
|
51169
|
+
] })
|
|
51170
|
+
}
|
|
51171
|
+
),
|
|
51172
|
+
isFullscreen && /* @__PURE__ */ jsx(
|
|
51173
|
+
motion.div,
|
|
51174
|
+
{
|
|
51175
|
+
initial: { opacity: 0, y: -10 },
|
|
51176
|
+
animate: { opacity: 1, y: 0 },
|
|
51177
|
+
className: "absolute top-4 right-4 z-10",
|
|
51178
|
+
children: /* @__PURE__ */ jsxs(
|
|
51179
|
+
MoonUIButtonPro,
|
|
51180
|
+
{
|
|
51181
|
+
variant: "outline",
|
|
51182
|
+
size: "sm",
|
|
51183
|
+
onClick: () => toggleFullscreen(widget.id),
|
|
51184
|
+
children: [
|
|
51185
|
+
/* @__PURE__ */ jsx(Minimize2, { className: "h-4 w-4 mr-2" }),
|
|
51186
|
+
"Exit Fullscreen"
|
|
51187
|
+
]
|
|
51188
|
+
}
|
|
51189
|
+
)
|
|
51190
|
+
}
|
|
51191
|
+
)
|
|
51192
|
+
]
|
|
51193
|
+
},
|
|
51194
|
+
widget.id
|
|
51195
|
+
);
|
|
51196
|
+
};
|
|
51197
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
|
|
51198
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: fullscreenWidget ? (
|
|
51199
|
+
// Fullscreen widget
|
|
51200
|
+
/* @__PURE__ */ jsx(
|
|
51201
|
+
motion.div,
|
|
50174
51202
|
{
|
|
50175
|
-
|
|
50176
|
-
|
|
50177
|
-
|
|
50178
|
-
|
|
50179
|
-
|
|
50180
|
-
"Refresh"
|
|
50181
|
-
]
|
|
51203
|
+
initial: { opacity: 0 },
|
|
51204
|
+
animate: { opacity: 1 },
|
|
51205
|
+
exit: { opacity: 0 },
|
|
51206
|
+
className: "fixed inset-0 z-40 bg-background",
|
|
51207
|
+
children: widgets.filter((w2) => w2.id === fullscreenWidget).map(renderWidget)
|
|
50182
51208
|
}
|
|
50183
51209
|
)
|
|
51210
|
+
) : (
|
|
51211
|
+
// Grid layout
|
|
51212
|
+
/* @__PURE__ */ jsx(
|
|
51213
|
+
GridLayout,
|
|
51214
|
+
{
|
|
51215
|
+
className: "layout",
|
|
51216
|
+
layout: generateLayout(),
|
|
51217
|
+
cols: cols[currentBreakpoint] || cols.lg,
|
|
51218
|
+
rowHeight,
|
|
51219
|
+
width: 1200,
|
|
51220
|
+
margin,
|
|
51221
|
+
containerPadding,
|
|
51222
|
+
onLayoutChange: (layout) => {
|
|
51223
|
+
onLayoutChange?.(layout);
|
|
51224
|
+
},
|
|
51225
|
+
onBreakpointChange: (breakpoint) => {
|
|
51226
|
+
setCurrentBreakpoint(breakpoint);
|
|
51227
|
+
},
|
|
51228
|
+
draggableHandle: ".drag-handle",
|
|
51229
|
+
isDraggable: editMode,
|
|
51230
|
+
isResizable: editMode,
|
|
51231
|
+
compactType: "vertical",
|
|
51232
|
+
preventCollision: false,
|
|
51233
|
+
children: widgets.map((widget) => /* @__PURE__ */ jsx("div", { children: renderWidget(widget) }, widget.id))
|
|
51234
|
+
}
|
|
51235
|
+
)
|
|
51236
|
+
) }),
|
|
51237
|
+
editMode && !fullscreenWidget && /* @__PURE__ */ jsx(
|
|
51238
|
+
motion.div,
|
|
51239
|
+
{
|
|
51240
|
+
initial: { opacity: 0 },
|
|
51241
|
+
animate: { opacity: 0.1 },
|
|
51242
|
+
className: "absolute inset-0 pointer-events-none",
|
|
51243
|
+
style: {
|
|
51244
|
+
backgroundImage: `
|
|
51245
|
+
repeating-linear-gradient(
|
|
51246
|
+
0deg,
|
|
51247
|
+
var(--border) 0px,
|
|
51248
|
+
transparent 1px,
|
|
51249
|
+
transparent ${rowHeight + margin[1]}px,
|
|
51250
|
+
var(--border) ${rowHeight + margin[1]}px
|
|
51251
|
+
),
|
|
51252
|
+
repeating-linear-gradient(
|
|
51253
|
+
90deg,
|
|
51254
|
+
var(--border) 0px,
|
|
51255
|
+
transparent 1px,
|
|
51256
|
+
transparent ${100 / cols[currentBreakpoint]}%,
|
|
51257
|
+
var(--border) ${100 / cols[currentBreakpoint]}%
|
|
51258
|
+
)
|
|
51259
|
+
`
|
|
51260
|
+
}
|
|
51261
|
+
}
|
|
51262
|
+
)
|
|
51263
|
+
] });
|
|
51264
|
+
}
|
|
51265
|
+
var PRESET_RANGES = [
|
|
51266
|
+
{
|
|
51267
|
+
label: "Today",
|
|
51268
|
+
value: "today",
|
|
51269
|
+
getRange: () => ({
|
|
51270
|
+
start: startOfDay(/* @__PURE__ */ new Date()),
|
|
51271
|
+
end: endOfDay(/* @__PURE__ */ new Date()),
|
|
51272
|
+
label: "Today",
|
|
51273
|
+
preset: "today"
|
|
51274
|
+
})
|
|
51275
|
+
},
|
|
51276
|
+
{
|
|
51277
|
+
label: "Yesterday",
|
|
51278
|
+
value: "yesterday",
|
|
51279
|
+
getRange: () => ({
|
|
51280
|
+
start: startOfDay(subDays(/* @__PURE__ */ new Date(), 1)),
|
|
51281
|
+
end: endOfDay(subDays(/* @__PURE__ */ new Date(), 1)),
|
|
51282
|
+
label: "Yesterday",
|
|
51283
|
+
preset: "yesterday"
|
|
51284
|
+
})
|
|
51285
|
+
},
|
|
51286
|
+
{
|
|
51287
|
+
label: "Last 7 days",
|
|
51288
|
+
value: "last7days",
|
|
51289
|
+
getRange: () => ({
|
|
51290
|
+
start: startOfDay(subDays(/* @__PURE__ */ new Date(), 6)),
|
|
51291
|
+
end: endOfDay(/* @__PURE__ */ new Date()),
|
|
51292
|
+
label: "Last 7 days",
|
|
51293
|
+
preset: "last7days"
|
|
51294
|
+
})
|
|
51295
|
+
},
|
|
51296
|
+
{
|
|
51297
|
+
label: "Last 30 days",
|
|
51298
|
+
value: "last30days",
|
|
51299
|
+
getRange: () => ({
|
|
51300
|
+
start: startOfDay(subDays(/* @__PURE__ */ new Date(), 29)),
|
|
51301
|
+
end: endOfDay(/* @__PURE__ */ new Date()),
|
|
51302
|
+
label: "Last 30 days",
|
|
51303
|
+
preset: "last30days"
|
|
51304
|
+
})
|
|
51305
|
+
},
|
|
51306
|
+
{
|
|
51307
|
+
label: "This week",
|
|
51308
|
+
value: "thisWeek",
|
|
51309
|
+
getRange: () => ({
|
|
51310
|
+
start: startOfWeek(/* @__PURE__ */ new Date()),
|
|
51311
|
+
end: endOfWeek(/* @__PURE__ */ new Date()),
|
|
51312
|
+
label: "This week",
|
|
51313
|
+
preset: "custom"
|
|
51314
|
+
})
|
|
51315
|
+
},
|
|
51316
|
+
{
|
|
51317
|
+
label: "This month",
|
|
51318
|
+
value: "thisMonth",
|
|
51319
|
+
getRange: () => ({
|
|
51320
|
+
start: startOfMonth(/* @__PURE__ */ new Date()),
|
|
51321
|
+
end: endOfMonth(/* @__PURE__ */ new Date()),
|
|
51322
|
+
label: "This month",
|
|
51323
|
+
preset: "thisMonth"
|
|
51324
|
+
})
|
|
51325
|
+
},
|
|
51326
|
+
{
|
|
51327
|
+
label: "Last month",
|
|
51328
|
+
value: "lastMonth",
|
|
51329
|
+
getRange: () => {
|
|
51330
|
+
const lastMonth = subDays(startOfMonth(/* @__PURE__ */ new Date()), 1);
|
|
51331
|
+
return {
|
|
51332
|
+
start: startOfMonth(lastMonth),
|
|
51333
|
+
end: endOfMonth(lastMonth),
|
|
51334
|
+
label: "Last month",
|
|
51335
|
+
preset: "lastMonth"
|
|
51336
|
+
};
|
|
51337
|
+
}
|
|
51338
|
+
}
|
|
51339
|
+
];
|
|
51340
|
+
function TimeRangePicker({
|
|
51341
|
+
value,
|
|
51342
|
+
onChange,
|
|
51343
|
+
className,
|
|
51344
|
+
showPresets = true,
|
|
51345
|
+
showComparison = false,
|
|
51346
|
+
glassmorphism = false
|
|
51347
|
+
}) {
|
|
51348
|
+
const [isOpen, setIsOpen] = t__default.useState(false);
|
|
51349
|
+
const [customRange, setCustomRange] = t__default.useState({});
|
|
51350
|
+
const [comparisonEnabled, setComparisonEnabled] = t__default.useState(false);
|
|
51351
|
+
const currentRange = value || PRESET_RANGES[2].getRange();
|
|
51352
|
+
const formatRange = (range) => {
|
|
51353
|
+
if (range.preset && range.preset !== "custom") {
|
|
51354
|
+
return range.label;
|
|
51355
|
+
}
|
|
51356
|
+
return `${format(range.start, "MMM d")} - ${format(range.end, "MMM d, yyyy")}`;
|
|
51357
|
+
};
|
|
51358
|
+
const handlePresetSelect = (preset) => {
|
|
51359
|
+
const range = preset.getRange();
|
|
51360
|
+
onChange?.(range);
|
|
51361
|
+
setIsOpen(false);
|
|
51362
|
+
};
|
|
51363
|
+
const handleCustomRangeSelect = () => {
|
|
51364
|
+
if (customRange.from && customRange.to) {
|
|
51365
|
+
onChange?.({
|
|
51366
|
+
start: startOfDay(customRange.from),
|
|
51367
|
+
end: endOfDay(customRange.to),
|
|
51368
|
+
label: `${format(customRange.from, "MMM d")} - ${format(customRange.to, "MMM d, yyyy")}`,
|
|
51369
|
+
preset: "custom"
|
|
51370
|
+
});
|
|
51371
|
+
setIsOpen(false);
|
|
51372
|
+
}
|
|
51373
|
+
};
|
|
51374
|
+
return /* @__PURE__ */ jsxs(MoonUIPopoverPro, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
51375
|
+
/* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
51376
|
+
MoonUIButtonPro,
|
|
51377
|
+
{
|
|
51378
|
+
variant: "outline",
|
|
51379
|
+
className: cn(
|
|
51380
|
+
"justify-start text-left font-normal",
|
|
51381
|
+
glassmorphism && "bg-background/60 backdrop-blur-sm border-white/10",
|
|
51382
|
+
!value && "text-muted-foreground",
|
|
51383
|
+
className
|
|
51384
|
+
),
|
|
51385
|
+
children: [
|
|
51386
|
+
/* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }),
|
|
51387
|
+
formatRange(currentRange),
|
|
51388
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "ml-auto h-4 w-4 opacity-50" })
|
|
51389
|
+
]
|
|
51390
|
+
}
|
|
51391
|
+
) }),
|
|
51392
|
+
/* @__PURE__ */ jsx(
|
|
51393
|
+
MoonUIPopoverContentPro,
|
|
51394
|
+
{
|
|
51395
|
+
className: cn(
|
|
51396
|
+
"w-auto p-0",
|
|
51397
|
+
glassmorphism && "bg-background/95 backdrop-blur-md border-white/10"
|
|
51398
|
+
),
|
|
51399
|
+
align: "start",
|
|
51400
|
+
children: /* @__PURE__ */ jsx(
|
|
51401
|
+
motion.div,
|
|
51402
|
+
{
|
|
51403
|
+
initial: { opacity: 0, y: -10 },
|
|
51404
|
+
animate: { opacity: 1, y: 0 },
|
|
51405
|
+
transition: { duration: 0.2 },
|
|
51406
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
|
|
51407
|
+
showPresets && /* @__PURE__ */ jsxs("div", { className: "border-r p-3", children: [
|
|
51408
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-2 pb-2", children: [
|
|
51409
|
+
/* @__PURE__ */ jsx(Clock, { className: "h-4 w-4 text-muted-foreground" }),
|
|
51410
|
+
/* @__PURE__ */ jsx("h4", { className: "text-sm font-medium", children: "Quick Select" })
|
|
51411
|
+
] }),
|
|
51412
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-1", children: PRESET_RANGES.map((preset) => /* @__PURE__ */ jsx(
|
|
51413
|
+
motion.button,
|
|
51414
|
+
{
|
|
51415
|
+
whileHover: { x: 2 },
|
|
51416
|
+
whileTap: { scale: 0.98 },
|
|
51417
|
+
onClick: () => handlePresetSelect(preset),
|
|
51418
|
+
className: cn(
|
|
51419
|
+
"w-full text-left px-2 py-1.5 text-sm rounded-md transition-colors",
|
|
51420
|
+
"hover:bg-muted",
|
|
51421
|
+
currentRange.preset === preset.value && "bg-primary text-primary-foreground"
|
|
51422
|
+
),
|
|
51423
|
+
children: preset.label
|
|
51424
|
+
},
|
|
51425
|
+
preset.value
|
|
51426
|
+
)) }),
|
|
51427
|
+
showComparison && /* @__PURE__ */ jsx("div", { className: "mt-4 pt-4 border-t", children: /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 px-2 cursor-pointer", children: [
|
|
51428
|
+
/* @__PURE__ */ jsx(
|
|
51429
|
+
"input",
|
|
51430
|
+
{
|
|
51431
|
+
type: "checkbox",
|
|
51432
|
+
checked: comparisonEnabled,
|
|
51433
|
+
onChange: (e) => setComparisonEnabled(e.target.checked),
|
|
51434
|
+
className: "rounded"
|
|
51435
|
+
}
|
|
51436
|
+
),
|
|
51437
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: "Compare to previous period" })
|
|
51438
|
+
] }) })
|
|
51439
|
+
] }),
|
|
51440
|
+
/* @__PURE__ */ jsxs("div", { className: "p-3", children: [
|
|
51441
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-2 pb-2", children: [
|
|
51442
|
+
/* @__PURE__ */ jsx(CalendarIcon, { className: "h-4 w-4 text-muted-foreground" }),
|
|
51443
|
+
/* @__PURE__ */ jsx("h4", { className: "text-sm font-medium", children: "Custom Range" })
|
|
51444
|
+
] }),
|
|
51445
|
+
/* @__PURE__ */ jsx(
|
|
51446
|
+
Calendar,
|
|
51447
|
+
{
|
|
51448
|
+
mode: "range",
|
|
51449
|
+
selected: {
|
|
51450
|
+
from: customRange.from,
|
|
51451
|
+
to: customRange.to
|
|
51452
|
+
},
|
|
51453
|
+
onSelect: (range) => setCustomRange(range || {}),
|
|
51454
|
+
numberOfMonths: 2,
|
|
51455
|
+
className: "rounded-md"
|
|
51456
|
+
}
|
|
51457
|
+
),
|
|
51458
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pt-3 px-2", children: [
|
|
51459
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: customRange.from && customRange.to && /* @__PURE__ */ jsxs("span", { children: [
|
|
51460
|
+
Math.ceil((customRange.to.getTime() - customRange.from.getTime()) / (1e3 * 60 * 60 * 24)),
|
|
51461
|
+
" days selected"
|
|
51462
|
+
] }) }),
|
|
51463
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
51464
|
+
/* @__PURE__ */ jsx(
|
|
51465
|
+
MoonUIButtonPro,
|
|
51466
|
+
{
|
|
51467
|
+
variant: "ghost",
|
|
51468
|
+
size: "sm",
|
|
51469
|
+
onClick: () => {
|
|
51470
|
+
setCustomRange({});
|
|
51471
|
+
setIsOpen(false);
|
|
51472
|
+
},
|
|
51473
|
+
children: "Cancel"
|
|
51474
|
+
}
|
|
51475
|
+
),
|
|
51476
|
+
/* @__PURE__ */ jsx(
|
|
51477
|
+
MoonUIButtonPro,
|
|
51478
|
+
{
|
|
51479
|
+
size: "sm",
|
|
51480
|
+
onClick: handleCustomRangeSelect,
|
|
51481
|
+
disabled: !customRange.from || !customRange.to,
|
|
51482
|
+
children: "Apply"
|
|
51483
|
+
}
|
|
51484
|
+
)
|
|
51485
|
+
] })
|
|
51486
|
+
] })
|
|
51487
|
+
] })
|
|
51488
|
+
] })
|
|
51489
|
+
}
|
|
51490
|
+
)
|
|
51491
|
+
}
|
|
51492
|
+
)
|
|
51493
|
+
] });
|
|
51494
|
+
}
|
|
51495
|
+
var DASHBOARD_TEMPLATES = [
|
|
51496
|
+
{
|
|
51497
|
+
id: "analytics",
|
|
51498
|
+
name: "Analytics Dashboard",
|
|
51499
|
+
description: "Comprehensive analytics with metrics and charts",
|
|
51500
|
+
category: "analytics",
|
|
51501
|
+
theme: "analytics",
|
|
51502
|
+
widgets: [
|
|
51503
|
+
{
|
|
51504
|
+
type: "metric",
|
|
51505
|
+
title: "Total Revenue",
|
|
51506
|
+
size: { w: 3, h: 2 },
|
|
51507
|
+
position: { x: 0, y: 0 },
|
|
51508
|
+
data: {
|
|
51509
|
+
id: "revenue",
|
|
51510
|
+
title: "Total Revenue",
|
|
51511
|
+
value: 125430,
|
|
51512
|
+
change: { value: 12, type: "increase", period: "last month" },
|
|
51513
|
+
color: "success",
|
|
51514
|
+
icon: /* @__PURE__ */ jsx(DollarSign, { className: "h-4 w-4" }),
|
|
51515
|
+
sparkline: [100, 120, 115, 125, 130, 128, 132],
|
|
51516
|
+
unit: "$"
|
|
51517
|
+
}
|
|
51518
|
+
},
|
|
51519
|
+
{
|
|
51520
|
+
type: "metric",
|
|
51521
|
+
title: "Active Users",
|
|
51522
|
+
size: { w: 3, h: 2 },
|
|
51523
|
+
position: { x: 3, y: 0 },
|
|
51524
|
+
data: {
|
|
51525
|
+
id: "users",
|
|
51526
|
+
title: "Active Users",
|
|
51527
|
+
value: 2543,
|
|
51528
|
+
change: { value: 8, type: "increase", period: "last week" },
|
|
51529
|
+
color: "primary",
|
|
51530
|
+
icon: /* @__PURE__ */ jsx(Users, { className: "h-4 w-4" }),
|
|
51531
|
+
sparkline: [200, 220, 210, 230, 225, 240, 254]
|
|
51532
|
+
}
|
|
51533
|
+
},
|
|
51534
|
+
{
|
|
51535
|
+
type: "chart",
|
|
51536
|
+
title: "Revenue Trend",
|
|
51537
|
+
size: { w: 6, h: 4 },
|
|
51538
|
+
position: { x: 0, y: 2 },
|
|
51539
|
+
data: {
|
|
51540
|
+
type: "area",
|
|
51541
|
+
data: [
|
|
51542
|
+
{ name: "Jan", revenue: 4e3, profit: 2400 },
|
|
51543
|
+
{ name: "Feb", revenue: 3e3, profit: 1398 },
|
|
51544
|
+
{ name: "Mar", revenue: 5e3, profit: 3200 },
|
|
51545
|
+
{ name: "Apr", revenue: 4500, profit: 2900 },
|
|
51546
|
+
{ name: "May", revenue: 6e3, profit: 3800 },
|
|
51547
|
+
{ name: "Jun", revenue: 5500, profit: 3400 }
|
|
51548
|
+
]
|
|
51549
|
+
}
|
|
51550
|
+
},
|
|
51551
|
+
{
|
|
51552
|
+
type: "activity",
|
|
51553
|
+
title: "Recent Activity",
|
|
51554
|
+
size: { w: 3, h: 6 },
|
|
51555
|
+
position: { x: 9, y: 0 },
|
|
51556
|
+
data: {
|
|
51557
|
+
realtime: true,
|
|
51558
|
+
items: [
|
|
51559
|
+
{
|
|
51560
|
+
id: "1",
|
|
51561
|
+
type: "success",
|
|
51562
|
+
title: "completed a purchase",
|
|
51563
|
+
description: "Order #12345 - $250.00",
|
|
51564
|
+
timestamp: new Date(Date.now() - 1e3 * 60 * 5),
|
|
51565
|
+
user: { name: "John Doe" }
|
|
51566
|
+
},
|
|
51567
|
+
{
|
|
51568
|
+
id: "2",
|
|
51569
|
+
type: "info",
|
|
51570
|
+
title: "signed up",
|
|
51571
|
+
description: "New user registration",
|
|
51572
|
+
timestamp: new Date(Date.now() - 1e3 * 60 * 15),
|
|
51573
|
+
user: { name: "Jane Smith" }
|
|
51574
|
+
}
|
|
51575
|
+
]
|
|
51576
|
+
}
|
|
51577
|
+
}
|
|
51578
|
+
]
|
|
51579
|
+
},
|
|
51580
|
+
{
|
|
51581
|
+
id: "sales",
|
|
51582
|
+
name: "Sales Dashboard",
|
|
51583
|
+
description: "Track sales performance and targets",
|
|
51584
|
+
category: "sales",
|
|
51585
|
+
theme: "sales",
|
|
51586
|
+
widgets: [
|
|
51587
|
+
// Sales-specific widgets
|
|
51588
|
+
]
|
|
51589
|
+
},
|
|
51590
|
+
{
|
|
51591
|
+
id: "monitoring",
|
|
51592
|
+
name: "System Monitoring",
|
|
51593
|
+
description: "Monitor system health and performance",
|
|
51594
|
+
category: "operations",
|
|
51595
|
+
theme: "monitoring",
|
|
51596
|
+
widgets: [
|
|
51597
|
+
// Monitoring widgets
|
|
51598
|
+
]
|
|
51599
|
+
}
|
|
51600
|
+
];
|
|
51601
|
+
var WIDGET_TYPE_ICONS = {
|
|
51602
|
+
metric: /* @__PURE__ */ jsx(BarChart3, { className: "h-4 w-4" }),
|
|
51603
|
+
chart: /* @__PURE__ */ jsx(Activity, { className: "h-4 w-4" }),
|
|
51604
|
+
table: /* @__PURE__ */ jsx(Table$1, { className: "h-4 w-4" }),
|
|
51605
|
+
map: /* @__PURE__ */ jsx(Map$1, { className: "h-4 w-4" }),
|
|
51606
|
+
activity: /* @__PURE__ */ jsx(Clock, { className: "h-4 w-4" }),
|
|
51607
|
+
calendar: /* @__PURE__ */ jsx(Calendar$1, { className: "h-4 w-4" }),
|
|
51608
|
+
progress: /* @__PURE__ */ jsx(Target, { className: "h-4 w-4" }),
|
|
51609
|
+
comparison: /* @__PURE__ */ jsx(TrendingUp, { className: "h-4 w-4" })
|
|
51610
|
+
};
|
|
51611
|
+
var THEME_COLORS = {
|
|
51612
|
+
analytics: "from-blue-500/10 to-purple-500/10",
|
|
51613
|
+
sales: "from-green-500/10 to-emerald-500/10",
|
|
51614
|
+
monitoring: "from-orange-500/10 to-red-500/10",
|
|
51615
|
+
finance: "from-indigo-500/10 to-blue-500/10",
|
|
51616
|
+
custom: "from-gray-500/10 to-gray-600/10"
|
|
51617
|
+
};
|
|
51618
|
+
function Dashboard({
|
|
51619
|
+
config,
|
|
51620
|
+
widgets: initialWidgets = [],
|
|
51621
|
+
templates = DASHBOARD_TEMPLATES,
|
|
51622
|
+
onConfigChange,
|
|
51623
|
+
onWidgetAdd,
|
|
51624
|
+
onWidgetRemove,
|
|
51625
|
+
onWidgetUpdate,
|
|
51626
|
+
onExport,
|
|
51627
|
+
onImport,
|
|
51628
|
+
className,
|
|
51629
|
+
showHeader = true,
|
|
51630
|
+
title = "Dashboard",
|
|
51631
|
+
description = "Real-time analytics and insights",
|
|
51632
|
+
editable = true,
|
|
51633
|
+
realtime = false,
|
|
51634
|
+
glassmorphism = true
|
|
51635
|
+
}) {
|
|
51636
|
+
const [editMode, setEditMode] = t__default.useState(false);
|
|
51637
|
+
const [widgets, setWidgets] = t__default.useState(initialWidgets);
|
|
51638
|
+
const [selectedTheme, setSelectedTheme] = t__default.useState("analytics");
|
|
51639
|
+
const [timeRange, setTimeRange] = t__default.useState();
|
|
51640
|
+
const [searchQuery, setSearchQuery] = t__default.useState("");
|
|
51641
|
+
const [showWidgetLibrary, setShowWidgetLibrary] = t__default.useState(false);
|
|
51642
|
+
const [showTemplates, setShowTemplates] = t__default.useState(false);
|
|
51643
|
+
const [refreshing, setRefreshing] = t__default.useState(false);
|
|
51644
|
+
const [notifications, setNotifications] = t__default.useState(3);
|
|
51645
|
+
t__default.useEffect(() => {
|
|
51646
|
+
if (!realtime)
|
|
51647
|
+
return;
|
|
51648
|
+
const interval = setInterval(() => {
|
|
51649
|
+
setWidgets((prev) => prev.map((widget) => {
|
|
51650
|
+
if (widget.type === "metric" && widget.data) {
|
|
51651
|
+
const newValue = typeof widget.data.value === "number" ? widget.data.value + Math.floor(Math.random() * 10 - 5) : widget.data.value;
|
|
51652
|
+
return {
|
|
51653
|
+
...widget,
|
|
51654
|
+
data: {
|
|
51655
|
+
...widget.data,
|
|
51656
|
+
value: newValue,
|
|
51657
|
+
lastUpdated: /* @__PURE__ */ new Date()
|
|
51658
|
+
}
|
|
51659
|
+
};
|
|
51660
|
+
}
|
|
51661
|
+
return widget;
|
|
51662
|
+
}));
|
|
51663
|
+
}, 5e3);
|
|
51664
|
+
return () => clearInterval(interval);
|
|
51665
|
+
}, [realtime]);
|
|
51666
|
+
const handleAddWidget = (type) => {
|
|
51667
|
+
const newWidget = {
|
|
51668
|
+
id: `widget-${Date.now()}`,
|
|
51669
|
+
type,
|
|
51670
|
+
title: `New ${type} Widget`,
|
|
51671
|
+
size: { w: 3, h: 3 },
|
|
51672
|
+
position: { x: 0, y: 0 },
|
|
51673
|
+
data: generateDefaultData(type)
|
|
51674
|
+
};
|
|
51675
|
+
setWidgets((prev) => [...prev, newWidget]);
|
|
51676
|
+
onWidgetAdd?.(newWidget);
|
|
51677
|
+
setShowWidgetLibrary(false);
|
|
51678
|
+
};
|
|
51679
|
+
const applyTemplate = (template) => {
|
|
51680
|
+
const newWidgets = template.widgets.map((w2, index) => ({
|
|
51681
|
+
...w2,
|
|
51682
|
+
id: `widget-${Date.now()}-${index}`
|
|
51683
|
+
}));
|
|
51684
|
+
setWidgets(newWidgets);
|
|
51685
|
+
setSelectedTheme(template.theme);
|
|
51686
|
+
setShowTemplates(false);
|
|
51687
|
+
};
|
|
51688
|
+
const generateDefaultData = (type) => {
|
|
51689
|
+
switch (type) {
|
|
51690
|
+
case "metric":
|
|
51691
|
+
return {
|
|
51692
|
+
id: "new-metric",
|
|
51693
|
+
title: "New Metric",
|
|
51694
|
+
value: 0,
|
|
51695
|
+
icon: /* @__PURE__ */ jsx(BarChart3, { className: "h-4 w-4" }),
|
|
51696
|
+
color: "primary"
|
|
51697
|
+
};
|
|
51698
|
+
case "chart":
|
|
51699
|
+
return {
|
|
51700
|
+
type: "line",
|
|
51701
|
+
data: [
|
|
51702
|
+
{ name: "Mon", value: 100 },
|
|
51703
|
+
{ name: "Tue", value: 120 },
|
|
51704
|
+
{ name: "Wed", value: 110 },
|
|
51705
|
+
{ name: "Thu", value: 130 },
|
|
51706
|
+
{ name: "Fri", value: 125 }
|
|
51707
|
+
]
|
|
51708
|
+
};
|
|
51709
|
+
case "activity":
|
|
51710
|
+
return {
|
|
51711
|
+
items: [],
|
|
51712
|
+
realtime: true
|
|
51713
|
+
};
|
|
51714
|
+
default:
|
|
51715
|
+
return {};
|
|
51716
|
+
}
|
|
51717
|
+
};
|
|
51718
|
+
const WidgetLibrary = () => /* @__PURE__ */ jsx(Sheet, { open: showWidgetLibrary, onOpenChange: setShowWidgetLibrary, children: /* @__PURE__ */ jsxs(SheetContent, { className: cn(
|
|
51719
|
+
"w-[400px] sm:w-[540px]",
|
|
51720
|
+
glassmorphism && "bg-background/95 backdrop-blur-md"
|
|
51721
|
+
), children: [
|
|
51722
|
+
/* @__PURE__ */ jsxs(SheetHeader, { children: [
|
|
51723
|
+
/* @__PURE__ */ jsx(SheetTitle, { children: "Widget Library" }),
|
|
51724
|
+
/* @__PURE__ */ jsx(SheetDescription, { children: "Add widgets to customize your dashboard" })
|
|
50184
51725
|
] }),
|
|
50185
|
-
/* @__PURE__ */
|
|
50186
|
-
|
|
50187
|
-
|
|
50188
|
-
|
|
50189
|
-
|
|
50190
|
-
|
|
51726
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-6 space-y-4", children: [
|
|
51727
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
51728
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-3 h-4 w-4 text-muted-foreground" }),
|
|
51729
|
+
/* @__PURE__ */ jsx(
|
|
51730
|
+
MoonUIInputPro,
|
|
51731
|
+
{
|
|
51732
|
+
placeholder: "Search widgets...",
|
|
51733
|
+
value: searchQuery,
|
|
51734
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
51735
|
+
className: "pl-10"
|
|
51736
|
+
}
|
|
51737
|
+
)
|
|
50191
51738
|
] }),
|
|
50192
|
-
/* @__PURE__ */
|
|
50193
|
-
|
|
50194
|
-
|
|
51739
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "h-[calc(100vh-200px)]", children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4", children: Object.entries(WIDGET_TYPE_ICONS).filter(([type]) => type.toLowerCase().includes(searchQuery.toLowerCase())).map(([type, icon]) => /* @__PURE__ */ jsx(
|
|
51740
|
+
motion.div,
|
|
51741
|
+
{
|
|
51742
|
+
whileHover: { scale: 1.02 },
|
|
51743
|
+
whileTap: { scale: 0.98 },
|
|
51744
|
+
children: /* @__PURE__ */ jsxs(
|
|
51745
|
+
MoonUIButtonPro,
|
|
51746
|
+
{
|
|
51747
|
+
variant: "outline",
|
|
51748
|
+
className: "w-full h-24 flex-col gap-2",
|
|
51749
|
+
onClick: () => handleAddWidget(type),
|
|
51750
|
+
children: [
|
|
51751
|
+
/* @__PURE__ */ jsx("div", { className: "p-2 rounded-lg bg-muted", children: icon }),
|
|
51752
|
+
/* @__PURE__ */ jsx("span", { className: "capitalize text-sm", children: type })
|
|
51753
|
+
]
|
|
51754
|
+
}
|
|
51755
|
+
)
|
|
51756
|
+
},
|
|
51757
|
+
type
|
|
51758
|
+
)) }) })
|
|
51759
|
+
] })
|
|
51760
|
+
] }) });
|
|
51761
|
+
const TemplateGallery = () => /* @__PURE__ */ jsx(MoonUIDialogPro, { open: showTemplates, onOpenChange: setShowTemplates, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: cn(
|
|
51762
|
+
"max-w-4xl",
|
|
51763
|
+
glassmorphism && "bg-background/95 backdrop-blur-md"
|
|
51764
|
+
), children: [
|
|
51765
|
+
/* @__PURE__ */ jsxs(MoonUIDialogHeaderPro, { children: [
|
|
51766
|
+
/* @__PURE__ */ jsx(MoonUIDialogTitlePro, { children: "Dashboard Templates" }),
|
|
51767
|
+
/* @__PURE__ */ jsx(MoonUIDialogDescriptionPro, { children: "Start with a pre-built template or create your own" })
|
|
51768
|
+
] }),
|
|
51769
|
+
/* @__PURE__ */ jsxs(MoonUITabsPro, { defaultValue: "all", className: "mt-4", children: [
|
|
51770
|
+
/* @__PURE__ */ jsxs(MoonUITabsListPro, { children: [
|
|
51771
|
+
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "all", children: "All Templates" }),
|
|
51772
|
+
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "analytics", children: "Analytics" }),
|
|
51773
|
+
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "sales", children: "Sales" }),
|
|
51774
|
+
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "operations", children: "Operations" })
|
|
50195
51775
|
] }),
|
|
50196
|
-
/* @__PURE__ */
|
|
50197
|
-
|
|
50198
|
-
|
|
50199
|
-
|
|
51776
|
+
/* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "all", className: "mt-4", children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-4", children: templates.map((template) => /* @__PURE__ */ jsx(
|
|
51777
|
+
motion.div,
|
|
51778
|
+
{
|
|
51779
|
+
whileHover: { y: -4 },
|
|
51780
|
+
className: "cursor-pointer",
|
|
51781
|
+
onClick: () => applyTemplate(template),
|
|
51782
|
+
children: /* @__PURE__ */ jsxs("div", { className: cn(
|
|
51783
|
+
"relative overflow-hidden rounded-lg border p-4 hover:shadow-lg transition-all",
|
|
51784
|
+
"bg-gradient-to-br",
|
|
51785
|
+
THEME_COLORS[template.theme]
|
|
51786
|
+
), children: [
|
|
51787
|
+
template.isPro && /* @__PURE__ */ jsx(MoonUIBadgePro, { className: "absolute top-2 right-2", variant: "secondary", children: "PRO" }),
|
|
51788
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold mb-1", children: template.name }),
|
|
51789
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: template.description }),
|
|
51790
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
51791
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
51792
|
+
template.widgets.length,
|
|
51793
|
+
" widgets"
|
|
51794
|
+
] }),
|
|
51795
|
+
/* @__PURE__ */ jsx("span", { children: "\u2022" }),
|
|
51796
|
+
/* @__PURE__ */ jsx("span", { className: "capitalize", children: template.category })
|
|
51797
|
+
] })
|
|
51798
|
+
] })
|
|
51799
|
+
},
|
|
51800
|
+
template.id
|
|
51801
|
+
)) }) })
|
|
50200
51802
|
] })
|
|
50201
|
-
] });
|
|
51803
|
+
] }) });
|
|
51804
|
+
return /* @__PURE__ */ jsxs(
|
|
51805
|
+
motion.div,
|
|
51806
|
+
{
|
|
51807
|
+
className: cn(
|
|
51808
|
+
"w-full min-h-screen",
|
|
51809
|
+
glassmorphism && "bg-gradient-to-br",
|
|
51810
|
+
glassmorphism && THEME_COLORS[selectedTheme],
|
|
51811
|
+
className
|
|
51812
|
+
),
|
|
51813
|
+
initial: { opacity: 0 },
|
|
51814
|
+
animate: { opacity: 1 },
|
|
51815
|
+
transition: { duration: 0.5 },
|
|
51816
|
+
children: [
|
|
51817
|
+
showHeader && /* @__PURE__ */ jsxs(
|
|
51818
|
+
motion.div,
|
|
51819
|
+
{
|
|
51820
|
+
className: cn(
|
|
51821
|
+
"sticky top-0 z-30 border-b",
|
|
51822
|
+
glassmorphism ? "bg-background/80 backdrop-blur-md" : "bg-background"
|
|
51823
|
+
),
|
|
51824
|
+
initial: { y: -50 },
|
|
51825
|
+
animate: { y: 0 },
|
|
51826
|
+
transition: { type: "spring", stiffness: 300, damping: 30 },
|
|
51827
|
+
children: [
|
|
51828
|
+
/* @__PURE__ */ jsx("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
51829
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
51830
|
+
/* @__PURE__ */ jsx(
|
|
51831
|
+
motion.div,
|
|
51832
|
+
{
|
|
51833
|
+
whileHover: { scale: 1.05 },
|
|
51834
|
+
whileTap: { scale: 0.95 },
|
|
51835
|
+
children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "sm", className: "lg:hidden", children: /* @__PURE__ */ jsx(Menu, { className: "h-5 w-5" }) })
|
|
51836
|
+
}
|
|
51837
|
+
),
|
|
51838
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
51839
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
51840
|
+
/* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold tracking-tight", children: title }),
|
|
51841
|
+
realtime && /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "secondary", className: "animate-pulse", children: [
|
|
51842
|
+
/* @__PURE__ */ jsx("span", { className: "mr-1 h-1.5 w-1.5 rounded-full bg-green-500" }),
|
|
51843
|
+
"Real-time"
|
|
51844
|
+
] })
|
|
51845
|
+
] }),
|
|
51846
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description })
|
|
51847
|
+
] })
|
|
51848
|
+
] }),
|
|
51849
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
51850
|
+
/* @__PURE__ */ jsx(
|
|
51851
|
+
TimeRangePicker,
|
|
51852
|
+
{
|
|
51853
|
+
value: timeRange,
|
|
51854
|
+
onChange: setTimeRange,
|
|
51855
|
+
glassmorphism
|
|
51856
|
+
}
|
|
51857
|
+
),
|
|
51858
|
+
/* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "ghost", size: "sm", className: "relative", children: [
|
|
51859
|
+
/* @__PURE__ */ jsx(Bell, { className: "h-4 w-4" }),
|
|
51860
|
+
notifications > 0 && /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-1 h-4 w-4 rounded-full bg-destructive text-[10px] font-medium text-destructive-foreground flex items-center justify-center", children: notifications })
|
|
51861
|
+
] }) }),
|
|
51862
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
51863
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsx(Palette, { className: "h-4 w-4" }) }) }),
|
|
51864
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
|
|
51865
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => setSelectedTheme("analytics"), children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
51866
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-4 rounded bg-gradient-to-br from-blue-500 to-purple-500" }),
|
|
51867
|
+
"Analytics"
|
|
51868
|
+
] }) }),
|
|
51869
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => setSelectedTheme("sales"), children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
51870
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-4 rounded bg-gradient-to-br from-green-500 to-emerald-500" }),
|
|
51871
|
+
"Sales"
|
|
51872
|
+
] }) }),
|
|
51873
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => setSelectedTheme("monitoring"), children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
51874
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-4 rounded bg-gradient-to-br from-orange-500 to-red-500" }),
|
|
51875
|
+
"Monitoring"
|
|
51876
|
+
] }) })
|
|
51877
|
+
] })
|
|
51878
|
+
] }),
|
|
51879
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
51880
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", size: "sm", children: [
|
|
51881
|
+
/* @__PURE__ */ jsx(Settings, { className: "h-4 w-4 mr-2" }),
|
|
51882
|
+
"Actions"
|
|
51883
|
+
] }) }),
|
|
51884
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", className: "w-48", children: [
|
|
51885
|
+
editable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51886
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setEditMode(!editMode), children: [
|
|
51887
|
+
/* @__PURE__ */ jsx(Edit3, { className: "mr-2 h-4 w-4" }),
|
|
51888
|
+
editMode ? "Exit Edit Mode" : "Edit Layout"
|
|
51889
|
+
] }),
|
|
51890
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setShowWidgetLibrary(true), children: [
|
|
51891
|
+
/* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
|
|
51892
|
+
"Add Widget"
|
|
51893
|
+
] }),
|
|
51894
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setShowTemplates(true), children: [
|
|
51895
|
+
/* @__PURE__ */ jsx(LayoutGrid, { className: "mr-2 h-4 w-4" }),
|
|
51896
|
+
"Templates"
|
|
51897
|
+
] }),
|
|
51898
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {})
|
|
51899
|
+
] }),
|
|
51900
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuSubPro, { children: [
|
|
51901
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuSubTriggerPro, { children: [
|
|
51902
|
+
/* @__PURE__ */ jsx(Download, { className: "mr-2 h-4 w-4" }),
|
|
51903
|
+
"Export"
|
|
51904
|
+
] }),
|
|
51905
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuSubContentPro, { children: [
|
|
51906
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => onExport?.("json"), children: "As JSON" }),
|
|
51907
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => onExport?.("pdf"), children: "As PDF" }),
|
|
51908
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => onExport?.("png"), children: "As Image" })
|
|
51909
|
+
] })
|
|
51910
|
+
] }),
|
|
51911
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
|
|
51912
|
+
/* @__PURE__ */ jsx(Upload, { className: "mr-2 h-4 w-4" }),
|
|
51913
|
+
"Import"
|
|
51914
|
+
] }),
|
|
51915
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
|
|
51916
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setRefreshing(true), children: [
|
|
51917
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "mr-2 h-4 w-4" }),
|
|
51918
|
+
"Refresh Data"
|
|
51919
|
+
] }),
|
|
51920
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
|
|
51921
|
+
/* @__PURE__ */ jsx(Share2, { className: "mr-2 h-4 w-4" }),
|
|
51922
|
+
"Share Dashboard"
|
|
51923
|
+
] })
|
|
51924
|
+
] })
|
|
51925
|
+
] })
|
|
51926
|
+
] })
|
|
51927
|
+
] }) }),
|
|
51928
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: editMode && /* @__PURE__ */ jsx(
|
|
51929
|
+
motion.div,
|
|
51930
|
+
{
|
|
51931
|
+
initial: { height: 0, opacity: 0 },
|
|
51932
|
+
animate: { height: "auto", opacity: 1 },
|
|
51933
|
+
exit: { height: 0, opacity: 0 },
|
|
51934
|
+
className: "bg-primary/10 border-t border-primary/20",
|
|
51935
|
+
children: /* @__PURE__ */ jsxs("div", { className: "px-6 py-2 flex items-center justify-between", children: [
|
|
51936
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
51937
|
+
/* @__PURE__ */ jsx(Sparkles, { className: "h-4 w-4 text-primary" }),
|
|
51938
|
+
/* @__PURE__ */ jsx("span", { children: "Edit mode enabled - Drag widgets to rearrange" })
|
|
51939
|
+
] }),
|
|
51940
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
51941
|
+
/* @__PURE__ */ jsxs(
|
|
51942
|
+
MoonUIButtonPro,
|
|
51943
|
+
{
|
|
51944
|
+
variant: "ghost",
|
|
51945
|
+
size: "sm",
|
|
51946
|
+
onClick: () => setEditMode(false),
|
|
51947
|
+
children: [
|
|
51948
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4 mr-1" }),
|
|
51949
|
+
"Cancel"
|
|
51950
|
+
]
|
|
51951
|
+
}
|
|
51952
|
+
),
|
|
51953
|
+
/* @__PURE__ */ jsxs(
|
|
51954
|
+
MoonUIButtonPro,
|
|
51955
|
+
{
|
|
51956
|
+
variant: "primary",
|
|
51957
|
+
size: "sm",
|
|
51958
|
+
onClick: () => {
|
|
51959
|
+
setEditMode(false);
|
|
51960
|
+
},
|
|
51961
|
+
children: [
|
|
51962
|
+
/* @__PURE__ */ jsx(Save, { className: "h-4 w-4 mr-1" }),
|
|
51963
|
+
"Save Changes"
|
|
51964
|
+
]
|
|
51965
|
+
}
|
|
51966
|
+
)
|
|
51967
|
+
] })
|
|
51968
|
+
] })
|
|
51969
|
+
}
|
|
51970
|
+
) })
|
|
51971
|
+
]
|
|
51972
|
+
}
|
|
51973
|
+
),
|
|
51974
|
+
/* @__PURE__ */ jsx("div", { className: "p-6", children: widgets.length === 0 ? (
|
|
51975
|
+
// Empty state
|
|
51976
|
+
/* @__PURE__ */ jsxs(
|
|
51977
|
+
motion.div,
|
|
51978
|
+
{
|
|
51979
|
+
initial: { opacity: 0, scale: 0.9 },
|
|
51980
|
+
animate: { opacity: 1, scale: 1 },
|
|
51981
|
+
className: "flex flex-col items-center justify-center min-h-[400px] text-center",
|
|
51982
|
+
children: [
|
|
51983
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
51984
|
+
"p-4 rounded-full mb-4",
|
|
51985
|
+
glassmorphism ? "bg-background/60 backdrop-blur-sm" : "bg-muted"
|
|
51986
|
+
), children: /* @__PURE__ */ jsx(LayoutGrid, { className: "h-8 w-8 text-muted-foreground" }) }),
|
|
51987
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "No widgets added yet" }),
|
|
51988
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: "Start by adding widgets or choosing a template" }),
|
|
51989
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
51990
|
+
/* @__PURE__ */ jsxs(MoonUIButtonPro, { onClick: () => setShowWidgetLibrary(true), children: [
|
|
51991
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-2" }),
|
|
51992
|
+
"Add Widget"
|
|
51993
|
+
] }),
|
|
51994
|
+
/* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", onClick: () => setShowTemplates(true), children: [
|
|
51995
|
+
/* @__PURE__ */ jsx(LayoutGrid, { className: "h-4 w-4 mr-2" }),
|
|
51996
|
+
"Browse Templates"
|
|
51997
|
+
] })
|
|
51998
|
+
] })
|
|
51999
|
+
]
|
|
52000
|
+
}
|
|
52001
|
+
)
|
|
52002
|
+
) : (
|
|
52003
|
+
// Dashboard grid
|
|
52004
|
+
/* @__PURE__ */ jsx(
|
|
52005
|
+
DashboardGrid,
|
|
52006
|
+
{
|
|
52007
|
+
widgets,
|
|
52008
|
+
onLayoutChange: (layout) => {
|
|
52009
|
+
const updatedWidgets = widgets.map((widget) => {
|
|
52010
|
+
const layoutItem = layout.find((l) => l.i === widget.id);
|
|
52011
|
+
if (layoutItem) {
|
|
52012
|
+
return {
|
|
52013
|
+
...widget,
|
|
52014
|
+
position: { x: layoutItem.x, y: layoutItem.y },
|
|
52015
|
+
size: { ...widget.size, w: layoutItem.w, h: layoutItem.h }
|
|
52016
|
+
};
|
|
52017
|
+
}
|
|
52018
|
+
return widget;
|
|
52019
|
+
});
|
|
52020
|
+
setWidgets(updatedWidgets);
|
|
52021
|
+
},
|
|
52022
|
+
onWidgetRemove: (widgetId) => {
|
|
52023
|
+
setWidgets((prev) => prev.filter((w2) => w2.id !== widgetId));
|
|
52024
|
+
onWidgetRemove?.(widgetId);
|
|
52025
|
+
},
|
|
52026
|
+
onWidgetAction: (widgetId, action, data) => {
|
|
52027
|
+
console.log("Widget action:", widgetId, action, data);
|
|
52028
|
+
},
|
|
52029
|
+
editMode,
|
|
52030
|
+
glassmorphism
|
|
52031
|
+
}
|
|
52032
|
+
)
|
|
52033
|
+
) }),
|
|
52034
|
+
/* @__PURE__ */ jsx(WidgetLibrary, {}),
|
|
52035
|
+
/* @__PURE__ */ jsx(TemplateGallery, {})
|
|
52036
|
+
]
|
|
52037
|
+
}
|
|
52038
|
+
);
|
|
50202
52039
|
}
|
|
50203
52040
|
function DraggableList({
|
|
50204
52041
|
items,
|
|
@@ -51371,7 +53208,7 @@ var OptimizedImageInternal = ({
|
|
|
51371
53208
|
width,
|
|
51372
53209
|
height,
|
|
51373
53210
|
quality = 75,
|
|
51374
|
-
format = "auto",
|
|
53211
|
+
format: format2 = "auto",
|
|
51375
53212
|
lazy = true,
|
|
51376
53213
|
blur: blur2 = true,
|
|
51377
53214
|
priority = false,
|
|
@@ -51410,7 +53247,7 @@ var OptimizedImageInternal = ({
|
|
|
51410
53247
|
params.set("f", options.format);
|
|
51411
53248
|
return optimizedUrl;
|
|
51412
53249
|
};
|
|
51413
|
-
const optimizedSrc = getOptimizedSrc(src, { width, height, quality, format });
|
|
53250
|
+
const optimizedSrc = getOptimizedSrc(src, { width, height, quality, format: format2 });
|
|
51414
53251
|
const handleImageLoad = () => {
|
|
51415
53252
|
setIsLoaded(true);
|
|
51416
53253
|
setIsLoading(false);
|
|
@@ -51574,7 +53411,7 @@ var OptimizedImageInternal = ({
|
|
|
51574
53411
|
] }),
|
|
51575
53412
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
51576
53413
|
"Format: ",
|
|
51577
|
-
|
|
53414
|
+
format2
|
|
51578
53415
|
] })
|
|
51579
53416
|
]
|
|
51580
53417
|
}
|
|
@@ -53475,11 +55312,11 @@ function downloadFile(content, filename, mimeType) {
|
|
|
53475
55312
|
URL.revokeObjectURL(url);
|
|
53476
55313
|
}
|
|
53477
55314
|
async function exportData(data, options) {
|
|
53478
|
-
const { format, filename = "data-export", columns, includeHeaders = true } = options;
|
|
55315
|
+
const { format: format2, filename = "data-export", columns, includeHeaders = true } = options;
|
|
53479
55316
|
let content;
|
|
53480
55317
|
let mimeType;
|
|
53481
55318
|
let extension;
|
|
53482
|
-
switch (
|
|
55319
|
+
switch (format2) {
|
|
53483
55320
|
case "csv":
|
|
53484
55321
|
content = dataToCSV(data, columns, includeHeaders);
|
|
53485
55322
|
mimeType = "text/csv;charset=utf-8;";
|
|
@@ -53493,7 +55330,7 @@ async function exportData(data, options) {
|
|
|
53493
55330
|
case "xlsx":
|
|
53494
55331
|
throw new Error("XLSX export requires additional dependencies. Use CSV format instead.");
|
|
53495
55332
|
default:
|
|
53496
|
-
throw new Error(`Unsupported export format: ${
|
|
55333
|
+
throw new Error(`Unsupported export format: ${format2}`);
|
|
53497
55334
|
}
|
|
53498
55335
|
const finalFilename = `${filename}-${( new Date()).toISOString().split("T")[0]}.${extension}`;
|
|
53499
55336
|
downloadFile(content, finalFilename, mimeType);
|
|
@@ -53976,11 +55813,11 @@ function DataTable({
|
|
|
53976
55813
|
rowSelection: features.rowSelection !== false || selectable,
|
|
53977
55814
|
export: features.export !== false || exportable
|
|
53978
55815
|
});
|
|
53979
|
-
const handleExport = async (
|
|
55816
|
+
const handleExport = async (format2) => {
|
|
53980
55817
|
const selectedRows = table.getFilteredSelectedRowModel().rows;
|
|
53981
55818
|
const dataToExport = selectedRows.length > 0 ? selectedRows.map((row) => row.original) : table.getFilteredRowModel().rows.map((row) => row.original);
|
|
53982
55819
|
if (typeof exportable === "object" && exportable.onExport) {
|
|
53983
|
-
exportable.onExport(dataToExport,
|
|
55820
|
+
exportable.onExport(dataToExport, format2);
|
|
53984
55821
|
return;
|
|
53985
55822
|
}
|
|
53986
55823
|
if (onExport) {
|
|
@@ -53990,7 +55827,7 @@ function DataTable({
|
|
|
53990
55827
|
const filename = typeof exportable === "object" && exportable.filename ? exportable.filename : "data-export";
|
|
53991
55828
|
const visibleColumns = getVisibleColumns(columns, columnVisibility);
|
|
53992
55829
|
await exportData(dataToExport, {
|
|
53993
|
-
format,
|
|
55830
|
+
format: format2,
|
|
53994
55831
|
filename,
|
|
53995
55832
|
columns: visibleColumns,
|
|
53996
55833
|
includeHeaders: true
|
|
@@ -54366,7 +56203,7 @@ __export(enhanced_exports, {
|
|
|
54366
56203
|
DialogProFooter: () => DialogProFooter,
|
|
54367
56204
|
DialogProHeader: () => DialogProHeader,
|
|
54368
56205
|
DialogProTitle: () => DialogProTitle,
|
|
54369
|
-
DialogProTrigger: () =>
|
|
56206
|
+
DialogProTrigger: () => DialogTrigger2,
|
|
54370
56207
|
EnhancedCardDescription: () => EnhancedCardDescription,
|
|
54371
56208
|
EnhancedCardTitle: () => EnhancedCardTitle,
|
|
54372
56209
|
badgeVariants: () => badgeVariants,
|
|
@@ -54899,7 +56736,7 @@ var CardProFooter = t__default.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
54899
56736
|
));
|
|
54900
56737
|
CardProFooter.displayName = "CardProFooter";
|
|
54901
56738
|
var Dialog = DialogPrimitive.Root;
|
|
54902
|
-
var
|
|
56739
|
+
var DialogTrigger2 = DialogPrimitive.Trigger;
|
|
54903
56740
|
var DialogPortal = DialogPrimitive.Portal;
|
|
54904
56741
|
var DialogClose = DialogPrimitive.Close;
|
|
54905
56742
|
var DialogProOverlay = t.forwardRef(({ className, blur: blur2 = "md", variant = "default", ...props }, ref) => {
|
|
@@ -55248,4 +57085,4 @@ var BadgePro = t__default.forwardRef(({
|
|
|
55248
57085
|
});
|
|
55249
57086
|
BadgePro.displayName = "BadgePro";
|
|
55250
57087
|
|
|
55251
|
-
export { MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, AdvancedChart, AdvancedForms, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle, AnimatedButton, MoonUIAspectRatioPro as AspectRatio, MoonUIAvatarPro as Avatar, MoonUIAvatarFallbackPro as AvatarFallback, MoonUIAvatarImagePro as AvatarImage, MoonUIBadgePro as Badge, MoonUIBreadcrumbPro as Breadcrumb, MoonUIBreadcrumbEllipsisPro as BreadcrumbEllipsis, MoonUIBreadcrumbItemPro as BreadcrumbItem, MoonUIBreadcrumbLinkPro as BreadcrumbLink, MoonUIBreadcrumbListPro as BreadcrumbList, MoonUIBreadcrumbPagePro as BreadcrumbPage, MoonUIBreadcrumbSeparatorPro as BreadcrumbSeparator, MoonUIButtonPro as Button,
|
|
57088
|
+
export { MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, Calendar3 as AdvancedCalendar, AdvancedChart, AdvancedForms, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle, AnimatedButton, MoonUIAspectRatioPro as AspectRatio, MoonUIAvatarPro as Avatar, MoonUIAvatarFallbackPro as AvatarFallback, MoonUIAvatarImagePro as AvatarImage, MoonUIBadgePro as Badge, MoonUIBreadcrumbPro as Breadcrumb, MoonUIBreadcrumbEllipsisPro as BreadcrumbEllipsis, MoonUIBreadcrumbItemPro as BreadcrumbItem, MoonUIBreadcrumbLinkPro as BreadcrumbLink, MoonUIBreadcrumbListPro as BreadcrumbList, MoonUIBreadcrumbPagePro as BreadcrumbPage, MoonUIBreadcrumbSeparatorPro as BreadcrumbSeparator, MoonUIButtonPro as Button, Calendar, MoonUICardPro as Card, MoonUICardContentPro as CardContent, MoonUICardDescriptionPro as CardDescription, MoonUICardFooterPro as CardFooter, MoonUICardHeaderPro as CardHeader, MoonUICardTitlePro as CardTitle, MoonUICheckboxPro as Checkbox, MoonUICollapsiblePro as Collapsible, MoonUICollapsibleContentPro as CollapsibleContent, MoonUICollapsibleTriggerPro as CollapsibleTrigger, MoonUIColorPickerPro as ColorPicker, MoonUICommandPro as Command, MoonUICommandDialogPro as CommandDialog, MoonUICommandEmptyPro as CommandEmpty, MoonUICommandGroupPro as CommandGroup, MoonUICommandInputPro as CommandInput, MoonUICommandItemPro as CommandItem, MoonUICommandListPro as CommandList, MoonUICommandSeparatorPro as CommandSeparator, MoonUICommandShortcutPro as CommandShortcut, Dashboard, DataTable, MoonUIDialogPro as Dialog, MoonUIDialogClosePro as DialogClose, MoonUIDialogContentPro as DialogContent, MoonUIDialogDescriptionPro as DialogDescription, MoonUIDialogFooterPro as DialogFooter, MoonUIDialogHeaderPro as DialogHeader, MoonUIDialogTitlePro as DialogTitle, MoonUIDialogTriggerPro as DialogTrigger, DraggableList, MoonUIDropdownMenuPro as DropdownMenu, MoonUIDropdownMenuCheckboxItemPro as DropdownMenuCheckboxItem, MoonUIDropdownMenuContentPro as DropdownMenuContent, MoonUIDropdownMenuGroupPro as DropdownMenuGroup, MoonUIDropdownMenuItemPro as DropdownMenuItem, MoonUIDropdownMenuLabelPro as DropdownMenuLabel, MoonUIDropdownMenuPortalPro as DropdownMenuPortal, MoonUIDropdownMenuRadioGroupPro as DropdownMenuRadioGroup, MoonUIDropdownMenuRadioItemPro as DropdownMenuRadioItem, MoonUIDropdownMenuSeparatorPro as DropdownMenuSeparator, MoonUIDropdownMenuShortcutPro as DropdownMenuShortcut, MoonUIDropdownMenuSubPro as DropdownMenuSub, MoonUIDropdownMenuSubContentPro as DropdownMenuSubContent, MoonUIDropdownMenuSubTriggerPro as DropdownMenuSubTrigger, MoonUIDropdownMenuTriggerPro as DropdownMenuTrigger, enhanced_exports as Enhanced, ErrorBoundary, FileUpload, FloatingActionButton, GitHubStars, HealthCheck, HoverCard3D, MoonUIInputPro as Input, Kanban, MoonUILabelPro as Label, LazyComponent, LazyImage, LazyList, MagneticButton, MemoryAnalytics, MemoryEfficientData, MoonUIAccordionContentPro, MoonUIAccordionItemPro, MoonUIAccordionPro, MoonUIAccordionTriggerPro, MoonUIAlertDescriptionPro, MoonUIAlertPro, MoonUIAlertTitlePro, MoonUIAspectRatioPro, MoonUIAvatarFallbackPro, MoonUIAvatarImagePro, MoonUIAvatarPro, MoonUIBadgePro, MoonUIBreadcrumbEllipsisPro, MoonUIBreadcrumbItemPro, MoonUIBreadcrumbLinkPro, MoonUIBreadcrumbListPro, MoonUIBreadcrumbPagePro, MoonUIBreadcrumbPro, MoonUIBreadcrumbSeparatorPro, MoonUIButtonPro, MoonUICardContentPro, MoonUICardDescriptionPro, MoonUICardFooterPro, MoonUICardHeaderPro, MoonUICardPro, MoonUICardTitlePro, MoonUICheckboxPro, MoonUICollapsibleContentPro, MoonUICollapsiblePro, MoonUICollapsibleTriggerPro, MoonUIColorPickerPro, MoonUICommandDialogPro, MoonUICommandEmptyPro, MoonUICommandGroupPro, MoonUICommandInputPro, MoonUICommandItemPro, MoonUICommandListPro, MoonUICommandPro, MoonUICommandSeparatorPro, MoonUICommandShortcutPro, MoonUIDialogClosePro, MoonUIDialogContentPro, MoonUIDialogDescriptionPro, MoonUIDialogFooterPro, MoonUIDialogHeaderPro, MoonUIDialogPro, MoonUIDialogTitlePro, MoonUIDialogTriggerPro, MoonUIDropdownMenuCheckboxItemPro, MoonUIDropdownMenuContentPro, MoonUIDropdownMenuGroupPro, MoonUIDropdownMenuItemPro, MoonUIDropdownMenuLabelPro, MoonUIDropdownMenuPortalPro, MoonUIDropdownMenuPro, MoonUIDropdownMenuRadioGroupPro, MoonUIDropdownMenuRadioItemPro, MoonUIDropdownMenuSeparatorPro, MoonUIDropdownMenuShortcutPro, MoonUIDropdownMenuSubContentPro, MoonUIDropdownMenuSubPro, MoonUIDropdownMenuSubTriggerPro, MoonUIDropdownMenuTriggerPro, MoonUIInputPro, MoonUILabelPro, MoonUIPaginationContentPro, MoonUIPaginationEllipsisPro, MoonUIPaginationItemPro, MoonUIPaginationLinkPro, MoonUIPaginationNextPro, MoonUIPaginationPreviousPro, MoonUIPaginationPro, MoonUIPopoverContentPro, MoonUIPopoverPro, MoonUIPopoverTriggerPro, MoonUIProgressPro, MoonUIRadioGroupContextPro, MoonUIRadioGroupItemPro, MoonUIRadioGroupPro, MoonUIRadioItemWithLabelPro, MoonUIRadioLabelPro, MoonUISelectContentPro, MoonUISelectGroupPro, MoonUISelectItemPro, MoonUISelectLabelPro, MoonUISelectPro, MoonUISelectSeparatorPro, MoonUISelectTriggerPro, MoonUISelectValuePro, MoonUISeparatorPro, MoonUISkeletonPro, MoonUISliderPro, MoonUISwitchPro, MoonUITableBodyPro, MoonUITableCaptionPro, MoonUITableCellPro, MoonUITableFooterPro, MoonUITableHeadPro, MoonUITableHeaderPro, MoonUITablePro, MoonUITableRowPro, MoonUITabsContentPro, MoonUITabsListPro, MoonUITabsPro, MoonUITabsTriggerPro, MoonUITextareaPro, MoonUIToastPro, MoonUITogglePro, MoonUITooltipContentPro, MoonUITooltipPro, MoonUITooltipProviderPro, MoonUITooltipTriggerPro, MoonUIalertVariantsPro, MoonUIaspectRatioVariantsPro, MoonUIbreadcrumbVariantsPro, MoonUIcollapsibleContentVariantsPro, MoonUIcollapsibleTriggerVariantsPro, MoonUIcommandVariantsPro, MoonUIradioGroupItemVariantsPro, MoonUItableVariantsPro, MoonUItoggleVariantsPro, OptimizedImage, MoonUIPaginationPro as Pagination, MoonUIPaginationContentPro as PaginationContent, MoonUIPaginationEllipsisPro as PaginationEllipsis, MoonUIPaginationItemPro as PaginationItem, MoonUIPaginationLinkPro as PaginationLink, MoonUIPaginationNextPro as PaginationNext, MoonUIPaginationPreviousPro as PaginationPrevious, PerformanceDebugger, PerformanceMonitor, PinchZoom, MoonUIPopoverPro as Popover, MoonUIPopoverContentPro as PopoverContent, MoonUIPopoverTriggerPro as PopoverTrigger, MoonUIProgressPro as Progress, MoonUIRadioGroupPro as RadioGroup, MoonUIRadioGroupContextPro as RadioGroupContext, MoonUIRadioGroupItemPro as RadioGroupItem, MoonUIRadioItemWithLabelPro as RadioItemWithLabel, MoonUIRadioLabelPro as RadioLabel, RichTextEditor, ScrollArea, ScrollBar, MoonUISelectPro as Select, MoonUISelectContentPro as SelectContent, MoonUISelectGroupPro as SelectGroup, MoonUISelectItemPro as SelectItem, MoonUISelectLabelPro as SelectLabel, MoonUISelectSeparatorPro as SelectSeparator, MoonUISelectTriggerPro as SelectTrigger, MoonUISelectValuePro as SelectValue, SelectableVirtualList, MoonUISeparatorPro as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, MoonUISkeletonPro as Skeleton, MoonUISliderPro as Slider, SpotlightCard, SwipeableCard, MoonUISwitchPro as Switch, MoonUITablePro as Table, MoonUITableBodyPro as TableBody, MoonUITableCaptionPro as TableCaption, MoonUITableCellPro as TableCell, MoonUITableFooterPro as TableFooter, MoonUITableHeadPro as TableHead, MoonUITableHeaderPro as TableHeader, MoonUITableRowPro as TableRow, MoonUITabsPro as Tabs, MoonUITabsContentPro as TabsContent, MoonUITabsListPro as TabsList, MoonUITabsTriggerPro as TabsTrigger, MoonUITextareaPro as Textarea, Timeline, MoonUIToastPro as Toast, MoonUITogglePro as Toggle, MoonUITooltipPro as Tooltip, MoonUITooltipContentPro as TooltipContent, MoonUITooltipProviderPro as TooltipProvider, MoonUITooltipTriggerPro as TooltipTrigger, VirtualList, MoonUIalertVariantsPro as alertVariants, animatedButtonVariants, MoonUIaspectRatioVariantsPro as aspectRatioVariants, moonUIBadgeVariantsPro as badgeVariants, MoonUIbreadcrumbVariantsPro as breadcrumbVariants, moonUIButtonProVariants as buttonVariants, cn, MoonUIcollapsibleContentVariantsPro as collapsibleContentVariants, MoonUIcollapsibleTriggerVariantsPro as collapsibleTriggerVariants, MoonUIcommandVariantsPro as commandVariants, getExpandableColumn, moonUIBadgeVariantsPro, moonUIButtonProVariants, moonUISeparatorVariantsPro, MoonUIradioGroupItemVariantsPro as radioGroupItemVariants, moonUISeparatorVariantsPro as separatorVariants, MoonUItableVariantsPro as tableVariants, MoonUItoggleVariantsPro as toggleVariants, useExpandableRows, useStreamingData, useVirtualList };
|