@moontra/moonui-pro 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index.js → index.mjs} +659 -2
- package/package.json +3 -2
- package/scripts/postinstall.js +8 -4
|
@@ -5,13 +5,15 @@ import { motion, useMotionValue, useTransform, animate } from 'framer-motion';
|
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
|
-
import { Loader2, ChevronDown, ChevronUp, Check, X, ChevronRight, Circle, Lock, Sparkles, Calendar, ChevronLeft, Edit, Trash2, Clock, MapPin, User, Plus, MoreHorizontal, 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, Table as Table$1, Settings, Undo, Redo, Eye, RefreshCw, Wand2, Maximize, FileText, Languages } from 'lucide-react';
|
|
8
|
+
import { Loader2, ChevronDown, ChevronUp, Check, X, ChevronRight, Circle, Lock, Sparkles, Calendar, ChevronLeft, Edit, Trash2, Clock, MapPin, User, Plus, MoreHorizontal, 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, Table as Table$1, Settings, Undo, Redo, Eye, RefreshCw, Wand2, Maximize, FileText, Languages, TrendingUp, TrendingDown, Minus, Download, Maximize2, Activity, Star, ExternalLink, BarChart3, Users, DollarSign, CheckCircle2, AlertCircle, XCircle, ArrowDownRight, ArrowUpRight } from 'lucide-react';
|
|
9
9
|
import * as ReactDOM from 'react-dom';
|
|
10
10
|
import ReactDOM__default, { createPortal, flushSync } from 'react-dom';
|
|
11
11
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
12
12
|
import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';
|
|
13
13
|
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector.js';
|
|
14
14
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
15
|
+
import { cn as cn$1 } from '@moontra/moonui';
|
|
16
|
+
import { ResponsiveContainer, ScatterChart, CartesianGrid, XAxis, YAxis, Tooltip as Tooltip$1, Legend, Scatter, PieChart, Pie, Cell, AreaChart, Area, ReferenceLine, Brush, BarChart, Bar, LineChart, Line, ReferenceArea } from 'recharts';
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* @moontra/moonui-pro v2.0.9
|
|
@@ -54340,5 +54342,660 @@ var SwipeableCard = React50__default.forwardRef(
|
|
|
54340
54342
|
}
|
|
54341
54343
|
);
|
|
54342
54344
|
SwipeableCard.displayName = "SwipeableCard";
|
|
54345
|
+
var EVENT_COLORS2 = {
|
|
54346
|
+
success: "bg-green-500 border-green-500",
|
|
54347
|
+
warning: "bg-yellow-500 border-yellow-500",
|
|
54348
|
+
error: "bg-red-500 border-red-500",
|
|
54349
|
+
info: "bg-blue-500 border-blue-500",
|
|
54350
|
+
pending: "bg-gray-400 border-gray-400"
|
|
54351
|
+
};
|
|
54352
|
+
var EVENT_ICONS = {
|
|
54353
|
+
success: /* @__PURE__ */ jsx(CheckCircle2, { className: "h-4 w-4 text-white" }),
|
|
54354
|
+
warning: /* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 text-white" }),
|
|
54355
|
+
error: /* @__PURE__ */ jsx(XCircle, { className: "h-4 w-4 text-white" }),
|
|
54356
|
+
info: /* @__PURE__ */ jsx(Circle, { className: "h-4 w-4 text-white" }),
|
|
54357
|
+
pending: /* @__PURE__ */ jsx(Clock, { className: "h-4 w-4 text-white" })
|
|
54358
|
+
};
|
|
54359
|
+
var EVENT_TEXT_COLORS = {
|
|
54360
|
+
success: "text-green-700",
|
|
54361
|
+
warning: "text-yellow-700",
|
|
54362
|
+
error: "text-red-700",
|
|
54363
|
+
info: "text-blue-700",
|
|
54364
|
+
pending: "text-gray-700"
|
|
54365
|
+
};
|
|
54366
|
+
function Timeline({
|
|
54367
|
+
events,
|
|
54368
|
+
onEventClick,
|
|
54369
|
+
className,
|
|
54370
|
+
showUserInfo = true,
|
|
54371
|
+
showMetadata = true,
|
|
54372
|
+
showRelativeTime = true,
|
|
54373
|
+
groupByDate = false,
|
|
54374
|
+
orientation = "vertical",
|
|
54375
|
+
compact = false,
|
|
54376
|
+
interactive = true
|
|
54377
|
+
}) {
|
|
54378
|
+
const sortedEvents = [...events].sort((a, b) => b.date.getTime() - a.date.getTime());
|
|
54379
|
+
const formatDate = (date) => {
|
|
54380
|
+
return date.toLocaleDateString("en-US", {
|
|
54381
|
+
year: "numeric",
|
|
54382
|
+
month: "long",
|
|
54383
|
+
day: "numeric"
|
|
54384
|
+
});
|
|
54385
|
+
};
|
|
54386
|
+
const formatTime = (date) => {
|
|
54387
|
+
return date.toLocaleTimeString("en-US", {
|
|
54388
|
+
hour: "2-digit",
|
|
54389
|
+
minute: "2-digit",
|
|
54390
|
+
hour12: true
|
|
54391
|
+
});
|
|
54392
|
+
};
|
|
54393
|
+
const getRelativeTime = (date) => {
|
|
54394
|
+
const now = /* @__PURE__ */ new Date();
|
|
54395
|
+
const diffInSeconds = Math.floor((now.getTime() - date.getTime()) / 1e3);
|
|
54396
|
+
if (diffInSeconds < 60) {
|
|
54397
|
+
return "Just now";
|
|
54398
|
+
} else if (diffInSeconds < 3600) {
|
|
54399
|
+
const minutes = Math.floor(diffInSeconds / 60);
|
|
54400
|
+
return `${minutes} minute${minutes > 1 ? "s" : ""} ago`;
|
|
54401
|
+
} else if (diffInSeconds < 86400) {
|
|
54402
|
+
const hours = Math.floor(diffInSeconds / 3600);
|
|
54403
|
+
return `${hours} hour${hours > 1 ? "s" : ""} ago`;
|
|
54404
|
+
} else if (diffInSeconds < 2592e3) {
|
|
54405
|
+
const days = Math.floor(diffInSeconds / 86400);
|
|
54406
|
+
return `${days} day${days > 1 ? "s" : ""} ago`;
|
|
54407
|
+
} else {
|
|
54408
|
+
return formatDate(date);
|
|
54409
|
+
}
|
|
54410
|
+
};
|
|
54411
|
+
const getInitials = (name) => {
|
|
54412
|
+
return name.split(" ").map((n) => n[0]).join("").toUpperCase();
|
|
54413
|
+
};
|
|
54414
|
+
const groupEventsByDate = (events2) => {
|
|
54415
|
+
const groups = {};
|
|
54416
|
+
events2.forEach((event) => {
|
|
54417
|
+
const dateKey = formatDate(event.date);
|
|
54418
|
+
if (!groups[dateKey]) {
|
|
54419
|
+
groups[dateKey] = [];
|
|
54420
|
+
}
|
|
54421
|
+
groups[dateKey].push(event);
|
|
54422
|
+
});
|
|
54423
|
+
return groups;
|
|
54424
|
+
};
|
|
54425
|
+
const handleEventClick = (event) => {
|
|
54426
|
+
if (interactive && onEventClick) {
|
|
54427
|
+
onEventClick(event);
|
|
54428
|
+
}
|
|
54429
|
+
};
|
|
54430
|
+
const renderEvent = (event, index2, isLast) => {
|
|
54431
|
+
const eventColor = event.color || EVENT_COLORS2[event.type];
|
|
54432
|
+
const eventIcon = event.icon || EVENT_ICONS[event.type];
|
|
54433
|
+
const textColor = EVENT_TEXT_COLORS[event.type];
|
|
54434
|
+
return /* @__PURE__ */ jsxs(
|
|
54435
|
+
"div",
|
|
54436
|
+
{
|
|
54437
|
+
className: cn$1(
|
|
54438
|
+
"relative flex gap-4",
|
|
54439
|
+
compact ? "pb-4" : "pb-8",
|
|
54440
|
+
interactive && "cursor-pointer hover:bg-muted/50 rounded-lg p-2 -m-2 transition-colors"
|
|
54441
|
+
),
|
|
54442
|
+
onClick: () => handleEventClick(event),
|
|
54443
|
+
children: [
|
|
54444
|
+
orientation === "vertical" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
54445
|
+
/* @__PURE__ */ jsx("div", { className: cn$1(
|
|
54446
|
+
"flex items-center justify-center w-8 h-8 rounded-full border-2 bg-background",
|
|
54447
|
+
eventColor
|
|
54448
|
+
), children: eventIcon }),
|
|
54449
|
+
!isLast && /* @__PURE__ */ jsx("div", { className: "w-0.5 h-full bg-border mt-2" })
|
|
54450
|
+
] }),
|
|
54451
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
54452
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
54453
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
54454
|
+
/* @__PURE__ */ jsx("h4", { className: cn$1(
|
|
54455
|
+
"font-medium text-sm",
|
|
54456
|
+
compact ? "mb-1" : "mb-2"
|
|
54457
|
+
), children: event.title }),
|
|
54458
|
+
event.description && /* @__PURE__ */ jsx("p", { className: cn$1(
|
|
54459
|
+
"text-muted-foreground text-sm",
|
|
54460
|
+
compact ? "mb-1" : "mb-2"
|
|
54461
|
+
), children: event.description })
|
|
54462
|
+
] }),
|
|
54463
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
54464
|
+
showRelativeTime ? /* @__PURE__ */ jsx("span", { children: getRelativeTime(event.date) }) : /* @__PURE__ */ jsx("span", { children: formatTime(event.date) }),
|
|
54465
|
+
/* @__PURE__ */ jsx(Badge, { variant: "outline", className: cn$1("text-xs", textColor), children: event.type })
|
|
54466
|
+
] })
|
|
54467
|
+
] }),
|
|
54468
|
+
showUserInfo && event.user && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
54469
|
+
/* @__PURE__ */ jsxs(Avatar, { className: "h-6 w-6", children: [
|
|
54470
|
+
/* @__PURE__ */ jsx(AvatarImage, { src: event.user.avatar }),
|
|
54471
|
+
/* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: getInitials(event.user.name) })
|
|
54472
|
+
] }),
|
|
54473
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: event.user.name })
|
|
54474
|
+
] }),
|
|
54475
|
+
showMetadata && event.metadata && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
|
|
54476
|
+
event.metadata.duration && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
54477
|
+
/* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }),
|
|
54478
|
+
/* @__PURE__ */ jsx("span", { children: event.metadata.duration })
|
|
54479
|
+
] }),
|
|
54480
|
+
event.metadata.location && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
54481
|
+
/* @__PURE__ */ jsx(Calendar, { className: "h-3 w-3" }),
|
|
54482
|
+
/* @__PURE__ */ jsx("span", { children: event.metadata.location })
|
|
54483
|
+
] }),
|
|
54484
|
+
event.metadata.comments && event.metadata.comments > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
54485
|
+
/* @__PURE__ */ jsx(MessageCircle, { className: "h-3 w-3" }),
|
|
54486
|
+
/* @__PURE__ */ jsx("span", { children: event.metadata.comments })
|
|
54487
|
+
] }),
|
|
54488
|
+
event.metadata.attachments && event.metadata.attachments > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
54489
|
+
/* @__PURE__ */ jsx(Paperclip, { className: "h-3 w-3" }),
|
|
54490
|
+
/* @__PURE__ */ jsx("span", { children: event.metadata.attachments })
|
|
54491
|
+
] }),
|
|
54492
|
+
event.metadata.externalLink && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
54493
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3" }),
|
|
54494
|
+
/* @__PURE__ */ jsx("span", { children: "View details" })
|
|
54495
|
+
] })
|
|
54496
|
+
] }),
|
|
54497
|
+
event.metadata?.tags && event.metadata.tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mt-2", children: event.metadata.tags.map((tag, tagIndex) => /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: tag }, tagIndex)) })
|
|
54498
|
+
] })
|
|
54499
|
+
]
|
|
54500
|
+
},
|
|
54501
|
+
event.id
|
|
54502
|
+
);
|
|
54503
|
+
};
|
|
54504
|
+
const renderGroupedEvents = () => {
|
|
54505
|
+
const groups = groupEventsByDate(sortedEvents);
|
|
54506
|
+
return Object.entries(groups).map(([date, events2], groupIndex) => /* @__PURE__ */ jsxs("div", { className: "mb-8", children: [
|
|
54507
|
+
/* @__PURE__ */ jsx("div", { className: "sticky top-0 bg-background/80 backdrop-blur-sm border-b p-2 mb-4", children: /* @__PURE__ */ jsx("h3", { className: "font-medium text-sm text-muted-foreground", children: date }) }),
|
|
54508
|
+
events2.map((event, index2) => renderEvent(event, index2, index2 === events2.length - 1))
|
|
54509
|
+
] }, date));
|
|
54510
|
+
};
|
|
54511
|
+
return /* @__PURE__ */ jsxs(Card, { className: cn$1("w-full", className), children: [
|
|
54512
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
54513
|
+
/* @__PURE__ */ jsxs(CardTitle, { className: "flex items-center gap-2", children: [
|
|
54514
|
+
/* @__PURE__ */ jsx(Clock, { className: "h-5 w-5" }),
|
|
54515
|
+
"Timeline"
|
|
54516
|
+
] }),
|
|
54517
|
+
/* @__PURE__ */ jsxs(CardDescription, { children: [
|
|
54518
|
+
sortedEvents.length,
|
|
54519
|
+
" event",
|
|
54520
|
+
sortedEvents.length !== 1 ? "s" : "",
|
|
54521
|
+
" tracked"
|
|
54522
|
+
] })
|
|
54523
|
+
] }),
|
|
54524
|
+
/* @__PURE__ */ jsx(CardContent, { children: sortedEvents.length > 0 ? /* @__PURE__ */ jsx("div", { className: cn$1(
|
|
54525
|
+
"space-y-0",
|
|
54526
|
+
orientation === "horizontal" && "flex overflow-x-auto gap-6"
|
|
54527
|
+
), children: groupByDate ? renderGroupedEvents() : sortedEvents.map(
|
|
54528
|
+
(event, index2) => renderEvent(event, index2, index2 === sortedEvents.length - 1)
|
|
54529
|
+
) }) : /* @__PURE__ */ jsxs("div", { className: "text-center py-8", children: [
|
|
54530
|
+
/* @__PURE__ */ jsx(Clock, { className: "h-12 w-12 mx-auto mb-4 text-muted-foreground" }),
|
|
54531
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "No events to display" })
|
|
54532
|
+
] }) })
|
|
54533
|
+
] });
|
|
54534
|
+
}
|
|
54535
|
+
var DEFAULT_COLORS = [
|
|
54536
|
+
"#3b82f6",
|
|
54537
|
+
"#ef4444",
|
|
54538
|
+
"#10b981",
|
|
54539
|
+
"#f59e0b",
|
|
54540
|
+
"#8b5cf6",
|
|
54541
|
+
"#06b6d4",
|
|
54542
|
+
"#f97316",
|
|
54543
|
+
"#84cc16",
|
|
54544
|
+
"#ec4899",
|
|
54545
|
+
"#6366f1"
|
|
54546
|
+
];
|
|
54547
|
+
function AdvancedChart({
|
|
54548
|
+
data,
|
|
54549
|
+
type,
|
|
54550
|
+
series,
|
|
54551
|
+
title,
|
|
54552
|
+
subtitle,
|
|
54553
|
+
height = 400,
|
|
54554
|
+
width = "100%",
|
|
54555
|
+
xAxisKey = "name",
|
|
54556
|
+
yAxisKey,
|
|
54557
|
+
showGrid = true,
|
|
54558
|
+
showTooltip = true,
|
|
54559
|
+
showLegend = true,
|
|
54560
|
+
showBrush = false,
|
|
54561
|
+
showReference = false,
|
|
54562
|
+
referenceLines = [],
|
|
54563
|
+
referenceAreas = [],
|
|
54564
|
+
colors = DEFAULT_COLORS,
|
|
54565
|
+
className,
|
|
54566
|
+
onDataPointClick,
|
|
54567
|
+
onExport,
|
|
54568
|
+
onRefresh,
|
|
54569
|
+
customTooltip,
|
|
54570
|
+
customLegend,
|
|
54571
|
+
loading = false,
|
|
54572
|
+
error = null,
|
|
54573
|
+
animated = true,
|
|
54574
|
+
responsive = true
|
|
54575
|
+
}) {
|
|
54576
|
+
const [isFullscreen, setIsFullscreen] = React50__default.useState(false);
|
|
54577
|
+
const chartRef = React50__default.useRef(null);
|
|
54578
|
+
const trend = React50__default.useMemo(() => {
|
|
54579
|
+
if (!data.length || !series.length)
|
|
54580
|
+
return null;
|
|
54581
|
+
const firstSeries = series[0];
|
|
54582
|
+
const values = data.map((d) => Number(d[firstSeries.dataKey])).filter((v) => !isNaN(v));
|
|
54583
|
+
if (values.length < 2)
|
|
54584
|
+
return null;
|
|
54585
|
+
const first2 = values[0];
|
|
54586
|
+
const last = values[values.length - 1];
|
|
54587
|
+
const change = (last - first2) / first2 * 100;
|
|
54588
|
+
return {
|
|
54589
|
+
direction: change > 0 ? "up" : change < 0 ? "down" : "neutral",
|
|
54590
|
+
percentage: Math.abs(change).toFixed(1)
|
|
54591
|
+
};
|
|
54592
|
+
}, [data, series]);
|
|
54593
|
+
const handleExport = (format) => {
|
|
54594
|
+
if (onExport) {
|
|
54595
|
+
onExport(format);
|
|
54596
|
+
}
|
|
54597
|
+
};
|
|
54598
|
+
const renderChart = () => {
|
|
54599
|
+
const commonProps = {
|
|
54600
|
+
data,
|
|
54601
|
+
width: typeof width === "string" ? void 0 : width,
|
|
54602
|
+
height,
|
|
54603
|
+
margin: { top: 20, right: 30, left: 20, bottom: 20 }
|
|
54604
|
+
// onClick: onDataPointClick,
|
|
54605
|
+
};
|
|
54606
|
+
const visibleSeries = series.filter((s) => !s.hide);
|
|
54607
|
+
switch (type) {
|
|
54608
|
+
case "line":
|
|
54609
|
+
return /* @__PURE__ */ jsxs(LineChart, { ...commonProps, children: [
|
|
54610
|
+
showGrid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
54611
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey }),
|
|
54612
|
+
/* @__PURE__ */ jsx(YAxis, {}),
|
|
54613
|
+
showTooltip && /* @__PURE__ */ jsx(Tooltip$1, {}),
|
|
54614
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
54615
|
+
visibleSeries.map((s, index2) => /* @__PURE__ */ jsx(
|
|
54616
|
+
Line,
|
|
54617
|
+
{
|
|
54618
|
+
type: s.type || "monotone",
|
|
54619
|
+
dataKey: s.dataKey,
|
|
54620
|
+
stroke: s.color || colors[index2 % colors.length],
|
|
54621
|
+
strokeWidth: s.strokeWidth || 2,
|
|
54622
|
+
name: s.name,
|
|
54623
|
+
animationDuration: animated ? 1e3 : 0
|
|
54624
|
+
},
|
|
54625
|
+
s.dataKey
|
|
54626
|
+
)),
|
|
54627
|
+
showReference && referenceLines.map((ref, index2) => /* @__PURE__ */ jsx(
|
|
54628
|
+
ReferenceLine,
|
|
54629
|
+
{
|
|
54630
|
+
y: ref.value,
|
|
54631
|
+
stroke: ref.color || "#666",
|
|
54632
|
+
strokeDasharray: "5 5",
|
|
54633
|
+
label: ref.label
|
|
54634
|
+
},
|
|
54635
|
+
index2
|
|
54636
|
+
)),
|
|
54637
|
+
showReference && referenceAreas.map((ref, index2) => /* @__PURE__ */ jsx(
|
|
54638
|
+
ReferenceArea,
|
|
54639
|
+
{
|
|
54640
|
+
x1: ref.x1,
|
|
54641
|
+
x2: ref.x2,
|
|
54642
|
+
fill: ref.color || "#f0f0f0",
|
|
54643
|
+
fillOpacity: 0.3,
|
|
54644
|
+
label: ref.label
|
|
54645
|
+
},
|
|
54646
|
+
index2
|
|
54647
|
+
)),
|
|
54648
|
+
showBrush && /* @__PURE__ */ jsx(Brush, {})
|
|
54649
|
+
] });
|
|
54650
|
+
case "bar":
|
|
54651
|
+
return /* @__PURE__ */ jsxs(BarChart, { ...commonProps, children: [
|
|
54652
|
+
showGrid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
54653
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey }),
|
|
54654
|
+
/* @__PURE__ */ jsx(YAxis, {}),
|
|
54655
|
+
showTooltip && /* @__PURE__ */ jsx(Tooltip$1, {}),
|
|
54656
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
54657
|
+
visibleSeries.map((s, index2) => /* @__PURE__ */ jsx(
|
|
54658
|
+
Bar,
|
|
54659
|
+
{
|
|
54660
|
+
dataKey: s.dataKey,
|
|
54661
|
+
fill: s.color || colors[index2 % colors.length],
|
|
54662
|
+
name: s.name,
|
|
54663
|
+
animationDuration: animated ? 1e3 : 0
|
|
54664
|
+
},
|
|
54665
|
+
s.dataKey
|
|
54666
|
+
)),
|
|
54667
|
+
showReference && referenceLines.map((ref, index2) => /* @__PURE__ */ jsx(
|
|
54668
|
+
ReferenceLine,
|
|
54669
|
+
{
|
|
54670
|
+
y: ref.value,
|
|
54671
|
+
stroke: ref.color || "#666",
|
|
54672
|
+
strokeDasharray: "5 5",
|
|
54673
|
+
label: ref.label
|
|
54674
|
+
},
|
|
54675
|
+
index2
|
|
54676
|
+
)),
|
|
54677
|
+
showBrush && /* @__PURE__ */ jsx(Brush, {})
|
|
54678
|
+
] });
|
|
54679
|
+
case "area":
|
|
54680
|
+
return /* @__PURE__ */ jsxs(AreaChart, { ...commonProps, children: [
|
|
54681
|
+
showGrid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
54682
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey }),
|
|
54683
|
+
/* @__PURE__ */ jsx(YAxis, {}),
|
|
54684
|
+
showTooltip && /* @__PURE__ */ jsx(Tooltip$1, {}),
|
|
54685
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
54686
|
+
visibleSeries.map((s, index2) => /* @__PURE__ */ jsx(
|
|
54687
|
+
Area,
|
|
54688
|
+
{
|
|
54689
|
+
type: s.type || "monotone",
|
|
54690
|
+
dataKey: s.dataKey,
|
|
54691
|
+
stroke: s.color || colors[index2 % colors.length],
|
|
54692
|
+
fill: s.color || colors[index2 % colors.length],
|
|
54693
|
+
fillOpacity: s.fillOpacity || 0.3,
|
|
54694
|
+
name: s.name,
|
|
54695
|
+
animationDuration: animated ? 1e3 : 0
|
|
54696
|
+
},
|
|
54697
|
+
s.dataKey
|
|
54698
|
+
)),
|
|
54699
|
+
showReference && referenceLines.map((ref, index2) => /* @__PURE__ */ jsx(
|
|
54700
|
+
ReferenceLine,
|
|
54701
|
+
{
|
|
54702
|
+
y: ref.value,
|
|
54703
|
+
stroke: ref.color || "#666",
|
|
54704
|
+
strokeDasharray: "5 5",
|
|
54705
|
+
label: ref.label
|
|
54706
|
+
},
|
|
54707
|
+
index2
|
|
54708
|
+
)),
|
|
54709
|
+
showBrush && /* @__PURE__ */ jsx(Brush, {})
|
|
54710
|
+
] });
|
|
54711
|
+
case "pie":
|
|
54712
|
+
return /* @__PURE__ */ jsxs(PieChart, { ...commonProps, children: [
|
|
54713
|
+
showTooltip && /* @__PURE__ */ jsx(Tooltip$1, {}),
|
|
54714
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
54715
|
+
/* @__PURE__ */ jsx(
|
|
54716
|
+
Pie,
|
|
54717
|
+
{
|
|
54718
|
+
data,
|
|
54719
|
+
dataKey: series[0]?.dataKey || "value",
|
|
54720
|
+
nameKey: xAxisKey,
|
|
54721
|
+
cx: "50%",
|
|
54722
|
+
cy: "50%",
|
|
54723
|
+
outerRadius: Math.min(height, typeof width === "number" ? width : 400) / 3,
|
|
54724
|
+
animationDuration: animated ? 1e3 : 0,
|
|
54725
|
+
children: data.map((entry, index2) => /* @__PURE__ */ jsx(Cell, { fill: colors[index2 % colors.length] }, `cell-${index2}`))
|
|
54726
|
+
}
|
|
54727
|
+
)
|
|
54728
|
+
] });
|
|
54729
|
+
case "scatter":
|
|
54730
|
+
return /* @__PURE__ */ jsxs(ScatterChart, { ...commonProps, children: [
|
|
54731
|
+
showGrid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
54732
|
+
/* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey }),
|
|
54733
|
+
/* @__PURE__ */ jsx(YAxis, { dataKey: yAxisKey }),
|
|
54734
|
+
showTooltip && /* @__PURE__ */ jsx(Tooltip$1, {}),
|
|
54735
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
54736
|
+
visibleSeries.map((s, index2) => /* @__PURE__ */ jsx(
|
|
54737
|
+
Scatter,
|
|
54738
|
+
{
|
|
54739
|
+
dataKey: s.dataKey,
|
|
54740
|
+
fill: s.color || colors[index2 % colors.length],
|
|
54741
|
+
name: s.name,
|
|
54742
|
+
animationDuration: animated ? 1e3 : 0
|
|
54743
|
+
},
|
|
54744
|
+
s.dataKey
|
|
54745
|
+
))
|
|
54746
|
+
] });
|
|
54747
|
+
default:
|
|
54748
|
+
return /* @__PURE__ */ jsx("div", { children: "Unsupported chart type" });
|
|
54749
|
+
}
|
|
54750
|
+
};
|
|
54751
|
+
if (loading) {
|
|
54752
|
+
return /* @__PURE__ */ jsx(Card, { className: cn$1("w-full", className), children: /* @__PURE__ */ jsx(CardContent, { className: "flex items-center justify-center", style: { height }, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
54753
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4 animate-spin" }),
|
|
54754
|
+
/* @__PURE__ */ jsx("span", { children: "Loading chart..." })
|
|
54755
|
+
] }) }) });
|
|
54756
|
+
}
|
|
54757
|
+
if (error) {
|
|
54758
|
+
return /* @__PURE__ */ jsx(Card, { className: cn$1("w-full", className), children: /* @__PURE__ */ jsx(CardContent, { className: "flex items-center justify-center", style: { height }, children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
54759
|
+
/* @__PURE__ */ jsx("p", { className: "text-destructive mb-2", children: error }),
|
|
54760
|
+
onRefresh && /* @__PURE__ */ jsxs(Button, { variant: "outline", onClick: onRefresh, children: [
|
|
54761
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "mr-2 h-4 w-4" }),
|
|
54762
|
+
"Retry"
|
|
54763
|
+
] })
|
|
54764
|
+
] }) }) });
|
|
54765
|
+
}
|
|
54766
|
+
return /* @__PURE__ */ jsxs(Card, { className: cn$1("w-full", className), ref: chartRef, children: [
|
|
54767
|
+
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
54768
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
54769
|
+
/* @__PURE__ */ jsxs(CardTitle, { className: "text-base font-medium", children: [
|
|
54770
|
+
title,
|
|
54771
|
+
trend && /* @__PURE__ */ jsxs("span", { className: "ml-2 inline-flex items-center", children: [
|
|
54772
|
+
trend.direction === "up" && /* @__PURE__ */ jsx(TrendingUp, { className: "h-4 w-4 text-green-500" }),
|
|
54773
|
+
trend.direction === "down" && /* @__PURE__ */ jsx(TrendingDown, { className: "h-4 w-4 text-red-500" }),
|
|
54774
|
+
trend.direction === "neutral" && /* @__PURE__ */ jsx(Minus, { className: "h-4 w-4 text-gray-500" }),
|
|
54775
|
+
/* @__PURE__ */ jsxs("span", { className: cn$1(
|
|
54776
|
+
"ml-1 text-sm",
|
|
54777
|
+
trend.direction === "up" && "text-green-500",
|
|
54778
|
+
trend.direction === "down" && "text-red-500",
|
|
54779
|
+
trend.direction === "neutral" && "text-gray-500"
|
|
54780
|
+
), children: [
|
|
54781
|
+
trend.percentage,
|
|
54782
|
+
"%"
|
|
54783
|
+
] })
|
|
54784
|
+
] })
|
|
54785
|
+
] }),
|
|
54786
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: subtitle })
|
|
54787
|
+
] }),
|
|
54788
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-1", children: [
|
|
54789
|
+
onRefresh && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onRefresh, children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" }) }),
|
|
54790
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsx(Settings, { className: "h-4 w-4" }) }),
|
|
54791
|
+
onExport && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: () => handleExport("png"), children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }) }),
|
|
54792
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: () => setIsFullscreen(!isFullscreen), children: /* @__PURE__ */ jsx(Maximize2, { className: "h-4 w-4" }) })
|
|
54793
|
+
] })
|
|
54794
|
+
] }),
|
|
54795
|
+
/* @__PURE__ */ jsx(CardContent, { children: responsive ? /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: renderChart() }) : /* @__PURE__ */ jsx("div", { style: { width: "100%", height: `${height}px` }, children: renderChart() }) })
|
|
54796
|
+
] });
|
|
54797
|
+
}
|
|
54798
|
+
var METRIC_COLORS = {
|
|
54799
|
+
primary: "text-blue-600",
|
|
54800
|
+
success: "text-green-600",
|
|
54801
|
+
warning: "text-yellow-600",
|
|
54802
|
+
danger: "text-red-600",
|
|
54803
|
+
info: "text-purple-600"
|
|
54804
|
+
};
|
|
54805
|
+
var WIDGET_SIZES = {
|
|
54806
|
+
sm: "col-span-1",
|
|
54807
|
+
md: "col-span-2",
|
|
54808
|
+
lg: "col-span-3",
|
|
54809
|
+
xl: "col-span-4"
|
|
54810
|
+
};
|
|
54811
|
+
function Dashboard({
|
|
54812
|
+
metrics = [],
|
|
54813
|
+
widgets = [],
|
|
54814
|
+
onMetricClick,
|
|
54815
|
+
onWidgetAction,
|
|
54816
|
+
className,
|
|
54817
|
+
showHeader = true,
|
|
54818
|
+
title = "Dashboard",
|
|
54819
|
+
description = "Overview of your key metrics and performance",
|
|
54820
|
+
refreshable = true,
|
|
54821
|
+
onRefresh,
|
|
54822
|
+
loading = false
|
|
54823
|
+
}) {
|
|
54824
|
+
const [refreshing, setRefreshing] = React50__default.useState(false);
|
|
54825
|
+
const handleRefresh = async () => {
|
|
54826
|
+
if (onRefresh) {
|
|
54827
|
+
setRefreshing(true);
|
|
54828
|
+
try {
|
|
54829
|
+
await onRefresh();
|
|
54830
|
+
} finally {
|
|
54831
|
+
setRefreshing(false);
|
|
54832
|
+
}
|
|
54833
|
+
}
|
|
54834
|
+
};
|
|
54835
|
+
const formatValue = (value) => {
|
|
54836
|
+
if (typeof value === "number") {
|
|
54837
|
+
if (value >= 1e6) {
|
|
54838
|
+
return (value / 1e6).toFixed(1) + "M";
|
|
54839
|
+
} else if (value >= 1e3) {
|
|
54840
|
+
return (value / 1e3).toFixed(1) + "K";
|
|
54841
|
+
}
|
|
54842
|
+
return value.toLocaleString();
|
|
54843
|
+
}
|
|
54844
|
+
return value.toString();
|
|
54845
|
+
};
|
|
54846
|
+
const getChangeIcon = (type) => {
|
|
54847
|
+
switch (type) {
|
|
54848
|
+
case "increase":
|
|
54849
|
+
return /* @__PURE__ */ jsx(ArrowUpRight, { className: "h-4 w-4" });
|
|
54850
|
+
case "decrease":
|
|
54851
|
+
return /* @__PURE__ */ jsx(ArrowDownRight, { className: "h-4 w-4" });
|
|
54852
|
+
case "neutral":
|
|
54853
|
+
return /* @__PURE__ */ jsx(Minus, { className: "h-4 w-4" });
|
|
54854
|
+
}
|
|
54855
|
+
};
|
|
54856
|
+
const getChangeColor = (type) => {
|
|
54857
|
+
switch (type) {
|
|
54858
|
+
case "increase":
|
|
54859
|
+
return "text-green-600";
|
|
54860
|
+
case "decrease":
|
|
54861
|
+
return "text-red-600";
|
|
54862
|
+
case "neutral":
|
|
54863
|
+
return "text-gray-600";
|
|
54864
|
+
}
|
|
54865
|
+
};
|
|
54866
|
+
const renderMetricCard = (metric) => {
|
|
54867
|
+
const colorClass = metric.color ? METRIC_COLORS[metric.color] : "text-foreground";
|
|
54868
|
+
return /* @__PURE__ */ jsxs(
|
|
54869
|
+
Card,
|
|
54870
|
+
{
|
|
54871
|
+
className: cn$1(
|
|
54872
|
+
"cursor-pointer hover:shadow-md transition-shadow",
|
|
54873
|
+
onMetricClick && "hover:bg-muted/50"
|
|
54874
|
+
),
|
|
54875
|
+
onClick: () => onMetricClick?.(metric),
|
|
54876
|
+
children: [
|
|
54877
|
+
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
54878
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-sm font-medium", children: metric.title }),
|
|
54879
|
+
/* @__PURE__ */ jsx("div", { className: cn$1("h-4 w-4", colorClass), children: metric.icon })
|
|
54880
|
+
] }),
|
|
54881
|
+
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
54882
|
+
/* @__PURE__ */ jsx("div", { className: "text-2xl font-bold", children: formatValue(metric.value) }),
|
|
54883
|
+
metric.change && /* @__PURE__ */ jsxs("div", { className: cn$1(
|
|
54884
|
+
"flex items-center text-xs mt-1",
|
|
54885
|
+
getChangeColor(metric.change.type)
|
|
54886
|
+
), children: [
|
|
54887
|
+
getChangeIcon(metric.change.type),
|
|
54888
|
+
/* @__PURE__ */ jsxs("span", { className: "ml-1", children: [
|
|
54889
|
+
Math.abs(metric.change.value),
|
|
54890
|
+
"% from ",
|
|
54891
|
+
metric.change.period
|
|
54892
|
+
] })
|
|
54893
|
+
] }),
|
|
54894
|
+
metric.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: metric.description })
|
|
54895
|
+
] })
|
|
54896
|
+
]
|
|
54897
|
+
},
|
|
54898
|
+
metric.id
|
|
54899
|
+
);
|
|
54900
|
+
};
|
|
54901
|
+
const renderWidget = (widget) => {
|
|
54902
|
+
const sizeClass = WIDGET_SIZES[widget.size || "md"];
|
|
54903
|
+
return /* @__PURE__ */ jsxs(Card, { className: cn$1("h-fit", sizeClass), children: [
|
|
54904
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
54905
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
54906
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-base", children: widget.title }),
|
|
54907
|
+
widget.description && /* @__PURE__ */ jsx(CardDescription, { className: "mt-1", children: widget.description })
|
|
54908
|
+
] }),
|
|
54909
|
+
/* @__PURE__ */ jsx(
|
|
54910
|
+
Button,
|
|
54911
|
+
{
|
|
54912
|
+
variant: "ghost",
|
|
54913
|
+
size: "sm",
|
|
54914
|
+
onClick: () => onWidgetAction?.(widget.id, "menu"),
|
|
54915
|
+
children: /* @__PURE__ */ jsx(BarChart3, { className: "h-4 w-4" })
|
|
54916
|
+
}
|
|
54917
|
+
)
|
|
54918
|
+
] }) }),
|
|
54919
|
+
/* @__PURE__ */ jsx(CardContent, { children: widget.loading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-32", children: /* @__PURE__ */ jsx("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-primary" }) }) : widget.error ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-32 text-destructive", children: /* @__PURE__ */ jsx("p", { className: "text-sm", children: widget.error }) }) : widget.content })
|
|
54920
|
+
] }, widget.id);
|
|
54921
|
+
};
|
|
54922
|
+
const defaultMetrics = [
|
|
54923
|
+
{
|
|
54924
|
+
id: "total-users",
|
|
54925
|
+
title: "Total Users",
|
|
54926
|
+
value: 2543,
|
|
54927
|
+
change: { value: 12, type: "increase", period: "last month" },
|
|
54928
|
+
icon: /* @__PURE__ */ jsx(Users, { className: "h-4 w-4" }),
|
|
54929
|
+
color: "primary"
|
|
54930
|
+
},
|
|
54931
|
+
{
|
|
54932
|
+
id: "revenue",
|
|
54933
|
+
title: "Revenue",
|
|
54934
|
+
value: "$12,345",
|
|
54935
|
+
change: { value: 8, type: "increase", period: "last month" },
|
|
54936
|
+
icon: /* @__PURE__ */ jsx(DollarSign, { className: "h-4 w-4" }),
|
|
54937
|
+
color: "success"
|
|
54938
|
+
},
|
|
54939
|
+
{
|
|
54940
|
+
id: "active-sessions",
|
|
54941
|
+
title: "Active Sessions",
|
|
54942
|
+
value: 1234,
|
|
54943
|
+
change: { value: 2, type: "decrease", period: "last hour" },
|
|
54944
|
+
icon: /* @__PURE__ */ jsx(Activity, { className: "h-4 w-4" }),
|
|
54945
|
+
color: "warning"
|
|
54946
|
+
},
|
|
54947
|
+
{
|
|
54948
|
+
id: "conversion-rate",
|
|
54949
|
+
title: "Conversion Rate",
|
|
54950
|
+
value: "3.2%",
|
|
54951
|
+
change: { value: 0.3, type: "increase", period: "last week" },
|
|
54952
|
+
icon: /* @__PURE__ */ jsx(TrendingUp, { className: "h-4 w-4" }),
|
|
54953
|
+
color: "info"
|
|
54954
|
+
}
|
|
54955
|
+
];
|
|
54956
|
+
const displayMetrics = metrics.length > 0 ? metrics : defaultMetrics;
|
|
54957
|
+
if (loading) {
|
|
54958
|
+
return /* @__PURE__ */ jsx("div", { className: cn$1("w-full", className), children: /* @__PURE__ */ jsxs("div", { className: "animate-pulse space-y-4", children: [
|
|
54959
|
+
/* @__PURE__ */ jsx("div", { className: "h-8 bg-muted rounded w-1/4" }),
|
|
54960
|
+
/* @__PURE__ */ jsx("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: [...Array(4)].map((_, i) => /* @__PURE__ */ jsx("div", { className: "h-32 bg-muted rounded" }, i)) })
|
|
54961
|
+
] }) });
|
|
54962
|
+
}
|
|
54963
|
+
return /* @__PURE__ */ jsxs("div", { className: cn$1("w-full space-y-6", className), children: [
|
|
54964
|
+
showHeader && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
54965
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
54966
|
+
/* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold tracking-tight", children: title }),
|
|
54967
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: description })
|
|
54968
|
+
] }),
|
|
54969
|
+
refreshable && /* @__PURE__ */ jsxs(
|
|
54970
|
+
Button,
|
|
54971
|
+
{
|
|
54972
|
+
variant: "outline",
|
|
54973
|
+
onClick: handleRefresh,
|
|
54974
|
+
disabled: refreshing,
|
|
54975
|
+
children: [
|
|
54976
|
+
refreshing ? /* @__PURE__ */ jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-primary mr-2" }) : /* @__PURE__ */ jsx(Activity, { className: "h-4 w-4 mr-2" }),
|
|
54977
|
+
"Refresh"
|
|
54978
|
+
]
|
|
54979
|
+
}
|
|
54980
|
+
)
|
|
54981
|
+
] }),
|
|
54982
|
+
/* @__PURE__ */ jsx("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: displayMetrics.map(renderMetricCard) }),
|
|
54983
|
+
widgets.length > 0 && /* @__PURE__ */ jsx("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: widgets.map(renderWidget) }),
|
|
54984
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pt-4 border-t", children: [
|
|
54985
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", children: [
|
|
54986
|
+
/* @__PURE__ */ jsx(Download, { className: "h-4 w-4 mr-2" }),
|
|
54987
|
+
"Export Data"
|
|
54988
|
+
] }),
|
|
54989
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", children: [
|
|
54990
|
+
/* @__PURE__ */ jsx(Calendar, { className: "h-4 w-4 mr-2" }),
|
|
54991
|
+
"Schedule Report"
|
|
54992
|
+
] }),
|
|
54993
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", children: [
|
|
54994
|
+
/* @__PURE__ */ jsx(Star, { className: "h-4 w-4 mr-2" }),
|
|
54995
|
+
"Save View"
|
|
54996
|
+
] })
|
|
54997
|
+
] })
|
|
54998
|
+
] });
|
|
54999
|
+
}
|
|
54343
55000
|
|
|
54344
|
-
export { Calendar2 as Calendar, Kanban, MemoryAnalytics, MemoryEfficientData, RichTextEditor, SelectableVirtualList, SwipeableCard, VirtualList, useStreamingData, useVirtualList };
|
|
55001
|
+
export { AdvancedChart, Calendar2 as Calendar, Dashboard, Kanban, MemoryAnalytics, MemoryEfficientData, RichTextEditor, SelectableVirtualList, SwipeableCard, Timeline, VirtualList, useStreamingData, useVirtualList };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -70,11 +70,12 @@
|
|
|
70
70
|
},
|
|
71
71
|
"homepage": "https://moonui.dev",
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@moontra/moonui": "
|
|
73
|
+
"@moontra/moonui": "^2.0.6",
|
|
74
74
|
"react": ">=18.0.0",
|
|
75
75
|
"react-dom": ">=18.0.0"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
+
"@moontra/moonui-pro": "^2.0.9",
|
|
78
79
|
"@radix-ui/react-accordion": "^1.2.11",
|
|
79
80
|
"@radix-ui/react-avatar": "^1.1.10",
|
|
80
81
|
"@radix-ui/react-checkbox": "^1.3.2",
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import https from 'https';
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import os from 'os';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
7
11
|
|
|
8
12
|
// ANSI color codes for console output
|
|
9
13
|
const colors = {
|