@moontra/moonui-pro 2.1.3 → 2.1.4
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 +61 -1
- package/dist/index.mjs +478 -11
- package/package.json +1 -1
- package/src/components/file-upload/index.tsx +9 -6
- package/src/components/index.ts +7 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import React__default, { ReactNode, ErrorInfo } from 'react';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
6
7
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
7
8
|
|
|
8
9
|
declare const animatedButtonVariants: (props?: ({
|
|
@@ -670,6 +671,65 @@ interface PerformanceMonitorProps {
|
|
|
670
671
|
}
|
|
671
672
|
declare const PerformanceMonitor: React__default.FC<PerformanceMonitorProps>;
|
|
672
673
|
|
|
674
|
+
interface FileUploadProps {
|
|
675
|
+
accept?: string;
|
|
676
|
+
multiple?: boolean;
|
|
677
|
+
maxSize?: number;
|
|
678
|
+
maxFiles?: number;
|
|
679
|
+
onUpload?: (files: File[]) => Promise<void>;
|
|
680
|
+
onRemove?: (file: File) => void;
|
|
681
|
+
className?: string;
|
|
682
|
+
disabled?: boolean;
|
|
683
|
+
showPreview?: boolean;
|
|
684
|
+
allowedTypes?: string[];
|
|
685
|
+
}
|
|
686
|
+
declare function FileUpload({ accept, multiple, maxSize, // 10MB default
|
|
687
|
+
maxFiles, onUpload, onRemove, className, disabled, showPreview, allowedTypes }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
688
|
+
|
|
689
|
+
interface DataTableProps<TData, TValue> {
|
|
690
|
+
columns: ColumnDef<TData, TValue>[];
|
|
691
|
+
data: TData[];
|
|
692
|
+
searchable?: boolean;
|
|
693
|
+
filterable?: boolean;
|
|
694
|
+
exportable?: boolean;
|
|
695
|
+
selectable?: boolean;
|
|
696
|
+
pagination?: boolean;
|
|
697
|
+
pageSize?: number;
|
|
698
|
+
className?: string;
|
|
699
|
+
onRowSelect?: (rows: TData[]) => void;
|
|
700
|
+
onExport?: (data: TData[]) => void;
|
|
701
|
+
features?: {
|
|
702
|
+
sorting?: boolean;
|
|
703
|
+
filtering?: boolean;
|
|
704
|
+
pagination?: boolean;
|
|
705
|
+
search?: boolean;
|
|
706
|
+
columnVisibility?: boolean;
|
|
707
|
+
rowSelection?: boolean;
|
|
708
|
+
export?: boolean | string[];
|
|
709
|
+
density?: boolean;
|
|
710
|
+
fullscreen?: boolean;
|
|
711
|
+
print?: boolean;
|
|
712
|
+
};
|
|
713
|
+
theme?: {
|
|
714
|
+
headerBg?: string;
|
|
715
|
+
headerText?: string;
|
|
716
|
+
borderColor?: string;
|
|
717
|
+
rowHoverBg?: string;
|
|
718
|
+
selectedRowBg?: string;
|
|
719
|
+
};
|
|
720
|
+
texts?: {
|
|
721
|
+
searchPlaceholder?: string;
|
|
722
|
+
noResults?: string;
|
|
723
|
+
rowsPerPage?: string;
|
|
724
|
+
selectedRows?: string;
|
|
725
|
+
exportButton?: string;
|
|
726
|
+
columnsButton?: string;
|
|
727
|
+
densityButton?: string;
|
|
728
|
+
filterButton?: string;
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
declare function DataTable<TData, TValue>({ columns, data, searchable, filterable, exportable, selectable, pagination, pageSize, className, onRowSelect, onExport, features, theme, texts, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
732
|
+
|
|
673
733
|
declare const enhancedButtonVariants: (props?: ({
|
|
674
734
|
variant?: "default" | "glow" | "outline" | "gradient" | "link" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
675
735
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
@@ -787,4 +847,4 @@ declare namespace index {
|
|
|
787
847
|
};
|
|
788
848
|
}
|
|
789
849
|
|
|
790
|
-
export { AdvancedChart, AdvancedFormField, AdvancedForms, AdvancedFormsProps, AnimatedButton, AnimatedButtonProps, Calendar, CalendarEvent, ChartType, ColorPicker, ColorPickerProps, Dashboard, DraggableList, DraggableListProps, index as Enhanced, ErrorBoundary, FloatingActionButton, FloatingActionButtonProps, GitHubRepository, GitHubStars, GitHubStarsProps, HealthCheck, HealthCheckEndpoint, HealthCheckProps, HealthCheckResult, HoverCard3D, HoverCard3DProps, Kanban, LazyComponent, LazyImage, LazyImageProps, LazyList, LazyListProps, MagneticButton, MagneticButtonProps, MemoryAnalytics, MemoryAnalyticsProps, MemoryConfig, MemoryEfficientData, MemoryEfficientDataProps, MemoryStats, OptimizedImage, OptimizedImageProps, PerformanceAlert, PerformanceDebugger, PerformanceDebuggerProps, PerformanceEntry, PerformanceMetric, PerformanceMetrics, PerformanceMonitor, PerformanceMonitorProps, PinchZoom, RichTextEditor, SelectableVirtualList, SelectableVirtualListProps, SpotlightCard, SpotlightCardProps, SwipeableCard, Timeline, VirtualList, VirtualListProps, animatedButtonVariants, useStreamingData, useVirtualList };
|
|
850
|
+
export { AdvancedChart, AdvancedFormField, AdvancedForms, AdvancedFormsProps, AnimatedButton, AnimatedButtonProps, Calendar, CalendarEvent, ChartType, ColorPicker, ColorPickerProps, Dashboard, DataTable, DraggableList, DraggableListProps, index as Enhanced, ErrorBoundary, FileUpload, FloatingActionButton, FloatingActionButtonProps, GitHubRepository, GitHubStars, GitHubStarsProps, HealthCheck, HealthCheckEndpoint, HealthCheckProps, HealthCheckResult, HoverCard3D, HoverCard3DProps, Kanban, LazyComponent, LazyImage, LazyImageProps, LazyList, LazyListProps, MagneticButton, MagneticButtonProps, MemoryAnalytics, MemoryAnalyticsProps, MemoryConfig, MemoryEfficientData, MemoryEfficientDataProps, MemoryStats, OptimizedImage, OptimizedImageProps, PerformanceAlert, PerformanceDebugger, PerformanceDebuggerProps, PerformanceEntry, PerformanceMetric, PerformanceMetrics, PerformanceMonitor, PerformanceMonitorProps, PinchZoom, RichTextEditor, SelectableVirtualList, SelectableVirtualListProps, SpotlightCard, SpotlightCardProps, SwipeableCard, Timeline, VirtualList, VirtualListProps, animatedButtonVariants, useStreamingData, useVirtualList };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React16 from 'react';
|
|
2
2
|
import React16__default, { useState, useRef, useCallback, forwardRef, createContext, useContext, useMemo, useEffect, useDebugValue, Component, useLayoutEffect } from 'react';
|
|
3
3
|
import { motion, AnimatePresence, useMotionValue, useSpring, useTransform, animate } from 'framer-motion';
|
|
4
|
-
import { Loader2, Lock, Sparkles, Plus, ChevronDown, ChevronUp, Check, X, ChevronRight, Circle, Minus, Calendar, ChevronLeft, Edit, Trash2, Clock, MapPin, User, 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 as Image$1, Table as Table$1, Settings, Undo, Redo, Eye, RefreshCw, Wand2, Maximize, FileText, Languages, TrendingUp, TrendingDown, Download, Maximize2, Activity, Star, ExternalLink, BarChart3, Users, DollarSign, Copy, RotateCcw, Github, GitFork, Server, EyeOff, ZoomOut, ZoomIn, RotateCw, Zap, Monitor, Timer, AlertTriangle, Cpu, MemoryStick, HardDrive, Network, CheckCircle,
|
|
4
|
+
import { Loader2, Lock, Sparkles, Plus, ChevronDown, ChevronUp, Check, X, ChevronRight, Circle, Minus, Calendar, ChevronLeft, Edit, Trash2, Clock, MapPin, User, 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 as Image$1, Table as Table$1, Settings, Undo, Redo, Eye, RefreshCw, Wand2, Maximize, FileText, Languages, TrendingUp, TrendingDown, Download, Maximize2, Activity, Star, Upload, CheckCircle2, AlertCircle, Search, Filter, ArrowUp, ArrowDown, ArrowUpDown, ChevronsLeft, ChevronsRight, ExternalLink, BarChart3, Users, DollarSign, Copy, RotateCcw, Github, GitFork, Server, EyeOff, ZoomOut, ZoomIn, RotateCw, Zap, Monitor, Timer, AlertTriangle, Cpu, MemoryStick, HardDrive, Network, CheckCircle, Video, Music, Archive, File, XCircle, ArrowDownRight, ArrowUpRight } from 'lucide-react';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
@@ -25,6 +25,7 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
|
25
25
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
26
26
|
import { createSlot } from '@radix-ui/react-slot';
|
|
27
27
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
28
|
+
import { useReactTable, getCoreRowModel, getPaginationRowModel, getSortedRowModel, getFilteredRowModel, flexRender } from '@tanstack/react-table';
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* @moontra/moonui-pro v2.0.9
|
|
@@ -49684,7 +49685,7 @@ var PerformanceMonitorInternal = ({
|
|
|
49684
49685
|
}
|
|
49685
49686
|
if (newAlerts.length > 0) {
|
|
49686
49687
|
setAlerts((prev) => [...newAlerts, ...prev].slice(0, 20));
|
|
49687
|
-
newAlerts.forEach((
|
|
49688
|
+
newAlerts.forEach((alert2) => onAlert?.(alert2));
|
|
49688
49689
|
}
|
|
49689
49690
|
}, [alertThresholds, onAlert]);
|
|
49690
49691
|
const updateMetrics = useCallback(async () => {
|
|
@@ -50068,7 +50069,7 @@ var PerformanceMonitorInternal = ({
|
|
|
50068
50069
|
}
|
|
50069
50070
|
)
|
|
50070
50071
|
] }),
|
|
50071
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-96 overflow-y-auto", children: /* @__PURE__ */ jsx(AnimatePresence, { children: alerts.map((
|
|
50072
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-96 overflow-y-auto", children: /* @__PURE__ */ jsx(AnimatePresence, { children: alerts.map((alert2, index) => /* @__PURE__ */ jsx(
|
|
50072
50073
|
motion.div,
|
|
50073
50074
|
{
|
|
50074
50075
|
initial: { opacity: 0, x: -20 },
|
|
@@ -50077,22 +50078,22 @@ var PerformanceMonitorInternal = ({
|
|
|
50077
50078
|
transition: { delay: index * 0.05 },
|
|
50078
50079
|
children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, { className: "p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
50079
50080
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
50080
|
-
|
|
50081
|
+
alert2.type === "critical" ? /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4 text-red-500" }) : alert2.type === "warning" ? /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4 text-yellow-500" }) : /* @__PURE__ */ jsx(CheckCircle, { className: "h-4 w-4 text-blue-500" }),
|
|
50081
50082
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
50082
|
-
/* @__PURE__ */ jsx("div", { className: "font-medium text-sm", children:
|
|
50083
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children:
|
|
50083
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium text-sm", children: alert2.metric }),
|
|
50084
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: alert2.message })
|
|
50084
50085
|
] })
|
|
50085
50086
|
] }),
|
|
50086
50087
|
/* @__PURE__ */ jsxs("div", { className: "text-right text-sm", children: [
|
|
50087
50088
|
/* @__PURE__ */ jsxs("div", { className: "font-medium", children: [
|
|
50088
|
-
|
|
50089
|
-
|
|
50089
|
+
alert2.value.toFixed(1),
|
|
50090
|
+
alert2.metric === "Network" ? "ms" : "%"
|
|
50090
50091
|
] }),
|
|
50091
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children:
|
|
50092
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: alert2.timestamp.toLocaleTimeString() })
|
|
50092
50093
|
] })
|
|
50093
50094
|
] }) }) })
|
|
50094
50095
|
},
|
|
50095
|
-
|
|
50096
|
+
alert2.id
|
|
50096
50097
|
)) }) }),
|
|
50097
50098
|
alerts.length === 0 && /* @__PURE__ */ jsxs("div", { className: "text-center py-8", children: [
|
|
50098
50099
|
/* @__PURE__ */ jsx(CheckCircle, { className: "h-12 w-12 mx-auto mb-4 text-green-500" }),
|
|
@@ -50162,6 +50163,472 @@ var PerformanceMonitor = ({ className, ...props }) => {
|
|
|
50162
50163
|
}
|
|
50163
50164
|
return /* @__PURE__ */ jsx(PerformanceMonitorInternal, { className, ...props });
|
|
50164
50165
|
};
|
|
50166
|
+
var getFileIcon = (type) => {
|
|
50167
|
+
if (type.startsWith("image/"))
|
|
50168
|
+
return /* @__PURE__ */ jsx(Image$1, { className: "h-4 w-4" });
|
|
50169
|
+
if (type.startsWith("video/"))
|
|
50170
|
+
return /* @__PURE__ */ jsx(Video, { className: "h-4 w-4" });
|
|
50171
|
+
if (type.startsWith("audio/"))
|
|
50172
|
+
return /* @__PURE__ */ jsx(Music, { className: "h-4 w-4" });
|
|
50173
|
+
if (type.includes("pdf"))
|
|
50174
|
+
return /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" });
|
|
50175
|
+
if (type.includes("zip") || type.includes("rar"))
|
|
50176
|
+
return /* @__PURE__ */ jsx(Archive, { className: "h-4 w-4" });
|
|
50177
|
+
return /* @__PURE__ */ jsx(File, { className: "h-4 w-4" });
|
|
50178
|
+
};
|
|
50179
|
+
var formatFileSize = (bytes) => {
|
|
50180
|
+
if (bytes === 0)
|
|
50181
|
+
return "0 Bytes";
|
|
50182
|
+
const k = 1024;
|
|
50183
|
+
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
50184
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
50185
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
|
50186
|
+
};
|
|
50187
|
+
function FileUpload({
|
|
50188
|
+
accept = "*",
|
|
50189
|
+
multiple = false,
|
|
50190
|
+
maxSize = 10,
|
|
50191
|
+
// 10MB default
|
|
50192
|
+
maxFiles = 5,
|
|
50193
|
+
onUpload,
|
|
50194
|
+
onRemove,
|
|
50195
|
+
className,
|
|
50196
|
+
disabled = false,
|
|
50197
|
+
showPreview = true,
|
|
50198
|
+
allowedTypes = []
|
|
50199
|
+
}) {
|
|
50200
|
+
const { hasProAccess, isLoading } = useSubscription();
|
|
50201
|
+
if (!isLoading && !hasProAccess) {
|
|
50202
|
+
return /* @__PURE__ */ jsx(Card, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(CardContent, { className: "py-12 text-center", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md mx-auto space-y-4", children: [
|
|
50203
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto", children: /* @__PURE__ */ jsx(Lock, { className: "h-6 w-6 text-purple-600 dark:text-purple-400" }) }),
|
|
50204
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
50205
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-2", children: "Pro Feature" }),
|
|
50206
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: "File Upload is available exclusively to MoonUI Pro subscribers." }),
|
|
50207
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-3 justify-center", children: /* @__PURE__ */ jsx("a", { href: "/pricing", children: /* @__PURE__ */ jsxs(Button, { size: "sm", children: [
|
|
50208
|
+
/* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
|
|
50209
|
+
"Upgrade to Pro"
|
|
50210
|
+
] }) }) })
|
|
50211
|
+
] })
|
|
50212
|
+
] }) }) });
|
|
50213
|
+
}
|
|
50214
|
+
const [files, setFiles] = React16__default.useState([]);
|
|
50215
|
+
const [isDragOver, setIsDragOver] = React16__default.useState(false);
|
|
50216
|
+
const [isUploading, setIsUploading] = React16__default.useState(false);
|
|
50217
|
+
const fileInputRef = React16__default.useRef(null);
|
|
50218
|
+
const validateFile = (file) => {
|
|
50219
|
+
if (file.size > maxSize * 1024 * 1024) {
|
|
50220
|
+
return `File size must be less than ${maxSize}MB`;
|
|
50221
|
+
}
|
|
50222
|
+
if (allowedTypes.length > 0 && !allowedTypes.includes(file.type)) {
|
|
50223
|
+
return `File type ${file.type} is not allowed`;
|
|
50224
|
+
}
|
|
50225
|
+
return null;
|
|
50226
|
+
};
|
|
50227
|
+
const handleFileSelect = async (selectedFiles) => {
|
|
50228
|
+
if (!selectedFiles || disabled)
|
|
50229
|
+
return;
|
|
50230
|
+
const fileArray = Array.from(selectedFiles);
|
|
50231
|
+
if (files.length + fileArray.length > maxFiles) {
|
|
50232
|
+
alert(`Maximum ${maxFiles} files allowed`);
|
|
50233
|
+
return;
|
|
50234
|
+
}
|
|
50235
|
+
const validFiles = [];
|
|
50236
|
+
const invalidFiles = [];
|
|
50237
|
+
fileArray.forEach((file) => {
|
|
50238
|
+
const error = validateFile(file);
|
|
50239
|
+
if (error) {
|
|
50240
|
+
invalidFiles.push(`${file.name}: ${error}`);
|
|
50241
|
+
} else {
|
|
50242
|
+
validFiles.push({
|
|
50243
|
+
file,
|
|
50244
|
+
id: Math.random().toString(36).substr(2, 9),
|
|
50245
|
+
status: "uploading",
|
|
50246
|
+
progress: 0
|
|
50247
|
+
});
|
|
50248
|
+
}
|
|
50249
|
+
});
|
|
50250
|
+
if (invalidFiles.length > 0) {
|
|
50251
|
+
alert(invalidFiles.join("\n"));
|
|
50252
|
+
}
|
|
50253
|
+
if (validFiles.length === 0)
|
|
50254
|
+
return;
|
|
50255
|
+
setFiles((prev) => [...prev, ...validFiles]);
|
|
50256
|
+
setIsUploading(true);
|
|
50257
|
+
if (onUpload) {
|
|
50258
|
+
try {
|
|
50259
|
+
await onUpload(validFiles.map((f) => f.file));
|
|
50260
|
+
setFiles((prev) => prev.map(
|
|
50261
|
+
(f) => validFiles.find((vf) => vf.id === f.id) ? { ...f, status: "success", progress: 100 } : f
|
|
50262
|
+
));
|
|
50263
|
+
} catch (error) {
|
|
50264
|
+
setFiles((prev) => prev.map(
|
|
50265
|
+
(f) => validFiles.find((vf) => vf.id === f.id) ? { ...f, status: "error", error: "Upload failed" } : f
|
|
50266
|
+
));
|
|
50267
|
+
}
|
|
50268
|
+
} else {
|
|
50269
|
+
for (const validFile of validFiles) {
|
|
50270
|
+
const interval = setInterval(() => {
|
|
50271
|
+
setFiles((prev) => prev.map(
|
|
50272
|
+
(f) => f.id === validFile.id && f.progress < 100 ? { ...f, progress: f.progress + 10 } : f
|
|
50273
|
+
));
|
|
50274
|
+
}, 100);
|
|
50275
|
+
setTimeout(() => {
|
|
50276
|
+
clearInterval(interval);
|
|
50277
|
+
setFiles((prev) => prev.map(
|
|
50278
|
+
(f) => f.id === validFile.id ? { ...f, status: "success", progress: 100 } : f
|
|
50279
|
+
));
|
|
50280
|
+
}, 1e3);
|
|
50281
|
+
}
|
|
50282
|
+
}
|
|
50283
|
+
setIsUploading(false);
|
|
50284
|
+
};
|
|
50285
|
+
const handleRemove = (fileToRemove) => {
|
|
50286
|
+
setFiles((prev) => prev.filter((f) => f.id !== fileToRemove.id));
|
|
50287
|
+
if (onRemove) {
|
|
50288
|
+
onRemove(fileToRemove.file);
|
|
50289
|
+
}
|
|
50290
|
+
};
|
|
50291
|
+
const handleDrop = (e) => {
|
|
50292
|
+
e.preventDefault();
|
|
50293
|
+
setIsDragOver(false);
|
|
50294
|
+
handleFileSelect(e.dataTransfer.files);
|
|
50295
|
+
};
|
|
50296
|
+
const handleDragOver = (e) => {
|
|
50297
|
+
e.preventDefault();
|
|
50298
|
+
setIsDragOver(true);
|
|
50299
|
+
};
|
|
50300
|
+
const handleDragLeave = (e) => {
|
|
50301
|
+
e.preventDefault();
|
|
50302
|
+
setIsDragOver(false);
|
|
50303
|
+
};
|
|
50304
|
+
const handleClick2 = () => {
|
|
50305
|
+
if (!disabled) {
|
|
50306
|
+
fileInputRef.current?.click();
|
|
50307
|
+
}
|
|
50308
|
+
};
|
|
50309
|
+
return /* @__PURE__ */ jsxs(Card, { className: cn("w-full", className), children: [
|
|
50310
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
50311
|
+
/* @__PURE__ */ jsxs(CardTitle, { className: "flex items-center gap-2", children: [
|
|
50312
|
+
/* @__PURE__ */ jsx(Upload, { className: "h-5 w-5" }),
|
|
50313
|
+
"File Upload"
|
|
50314
|
+
] }),
|
|
50315
|
+
/* @__PURE__ */ jsxs(CardDescription, { children: [
|
|
50316
|
+
multiple ? `Upload up to ${maxFiles} files` : "Upload a file",
|
|
50317
|
+
" (max ",
|
|
50318
|
+
maxSize,
|
|
50319
|
+
"MB each)"
|
|
50320
|
+
] })
|
|
50321
|
+
] }),
|
|
50322
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "space-y-4", children: [
|
|
50323
|
+
/* @__PURE__ */ jsxs(
|
|
50324
|
+
"div",
|
|
50325
|
+
{
|
|
50326
|
+
className: cn(
|
|
50327
|
+
"border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors",
|
|
50328
|
+
isDragOver ? "border-primary bg-primary/5" : "border-muted-foreground/25",
|
|
50329
|
+
disabled && "cursor-not-allowed opacity-50"
|
|
50330
|
+
),
|
|
50331
|
+
onDrop: handleDrop,
|
|
50332
|
+
onDragOver: handleDragOver,
|
|
50333
|
+
onDragLeave: handleDragLeave,
|
|
50334
|
+
onClick: handleClick2,
|
|
50335
|
+
children: [
|
|
50336
|
+
/* @__PURE__ */ jsx(Upload, { className: "h-10 w-10 mx-auto mb-4 text-muted-foreground" }),
|
|
50337
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-2", children: "Drag and drop files here, or click to select" }),
|
|
50338
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: accept === "*" ? "Any file type" : `Accepted types: ${accept}` })
|
|
50339
|
+
]
|
|
50340
|
+
}
|
|
50341
|
+
),
|
|
50342
|
+
/* @__PURE__ */ jsx(
|
|
50343
|
+
"input",
|
|
50344
|
+
{
|
|
50345
|
+
ref: fileInputRef,
|
|
50346
|
+
type: "file",
|
|
50347
|
+
accept,
|
|
50348
|
+
multiple,
|
|
50349
|
+
onChange: (e) => handleFileSelect(e.target.files),
|
|
50350
|
+
className: "hidden",
|
|
50351
|
+
disabled
|
|
50352
|
+
}
|
|
50353
|
+
),
|
|
50354
|
+
files.length > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
50355
|
+
/* @__PURE__ */ jsxs("h4", { className: "text-sm font-medium", children: [
|
|
50356
|
+
"Uploaded Files (",
|
|
50357
|
+
files.length,
|
|
50358
|
+
")"
|
|
50359
|
+
] }),
|
|
50360
|
+
files.map((uploadedFile) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 p-3 border rounded-lg", children: [
|
|
50361
|
+
/* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: getFileIcon(uploadedFile.file.type) }),
|
|
50362
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
50363
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
50364
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: uploadedFile.file.name }),
|
|
50365
|
+
/* @__PURE__ */ jsxs(Badge, { variant: uploadedFile.status === "success" ? "success" : uploadedFile.status === "error" ? "destructive" : "secondary", children: [
|
|
50366
|
+
uploadedFile.status === "uploading" && /* @__PURE__ */ jsx(Loader2, { className: "h-3 w-3 mr-1 animate-spin" }),
|
|
50367
|
+
uploadedFile.status === "success" && /* @__PURE__ */ jsx(CheckCircle2, { className: "h-3 w-3 mr-1" }),
|
|
50368
|
+
uploadedFile.status === "error" && /* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3 mr-1" }),
|
|
50369
|
+
uploadedFile.status
|
|
50370
|
+
] })
|
|
50371
|
+
] }),
|
|
50372
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mt-1", children: [
|
|
50373
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: formatFileSize(uploadedFile.file.size) }),
|
|
50374
|
+
uploadedFile.status === "uploading" && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
50375
|
+
uploadedFile.progress,
|
|
50376
|
+
"%"
|
|
50377
|
+
] })
|
|
50378
|
+
] }),
|
|
50379
|
+
uploadedFile.status === "uploading" && /* @__PURE__ */ jsx("div", { className: "mt-2 h-2 bg-secondary rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
50380
|
+
"div",
|
|
50381
|
+
{
|
|
50382
|
+
className: "h-full bg-primary transition-all duration-300 ease-out",
|
|
50383
|
+
style: { width: `${uploadedFile.progress}%` }
|
|
50384
|
+
}
|
|
50385
|
+
) }),
|
|
50386
|
+
uploadedFile.error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive mt-1", children: uploadedFile.error })
|
|
50387
|
+
] }),
|
|
50388
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
50389
|
+
uploadedFile.status === "success" && showPreview && uploadedFile.file.type.startsWith("image/") && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }) }),
|
|
50390
|
+
/* @__PURE__ */ jsx(
|
|
50391
|
+
Button,
|
|
50392
|
+
{
|
|
50393
|
+
variant: "ghost",
|
|
50394
|
+
size: "sm",
|
|
50395
|
+
onClick: () => handleRemove(uploadedFile),
|
|
50396
|
+
disabled: uploadedFile.status === "uploading",
|
|
50397
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
50398
|
+
}
|
|
50399
|
+
)
|
|
50400
|
+
] })
|
|
50401
|
+
] }, uploadedFile.id))
|
|
50402
|
+
] }),
|
|
50403
|
+
isUploading && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
50404
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
50405
|
+
"Uploading files..."
|
|
50406
|
+
] })
|
|
50407
|
+
] })
|
|
50408
|
+
] });
|
|
50409
|
+
}
|
|
50410
|
+
function DataTable({
|
|
50411
|
+
columns,
|
|
50412
|
+
data,
|
|
50413
|
+
searchable = true,
|
|
50414
|
+
filterable = true,
|
|
50415
|
+
exportable = true,
|
|
50416
|
+
selectable = false,
|
|
50417
|
+
pagination = true,
|
|
50418
|
+
pageSize = 10,
|
|
50419
|
+
className,
|
|
50420
|
+
onRowSelect,
|
|
50421
|
+
onExport,
|
|
50422
|
+
features = {},
|
|
50423
|
+
theme = {},
|
|
50424
|
+
texts = {}
|
|
50425
|
+
}) {
|
|
50426
|
+
const { hasProAccess, isLoading } = useSubscription();
|
|
50427
|
+
if (!isLoading && !hasProAccess) {
|
|
50428
|
+
return /* @__PURE__ */ jsx(Card, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(CardContent, { className: "py-12 text-center", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md mx-auto space-y-4", children: [
|
|
50429
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto", children: /* @__PURE__ */ jsx(Lock, { className: "h-6 w-6 text-purple-600 dark:text-purple-400" }) }),
|
|
50430
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
50431
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-2", children: "Pro Feature" }),
|
|
50432
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: "Data Table is available exclusively to MoonUI Pro subscribers." }),
|
|
50433
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-3 justify-center", children: /* @__PURE__ */ jsx("a", { href: "/pricing", children: /* @__PURE__ */ jsxs(Button, { size: "sm", children: [
|
|
50434
|
+
/* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
|
|
50435
|
+
"Upgrade to Pro"
|
|
50436
|
+
] }) }) })
|
|
50437
|
+
] })
|
|
50438
|
+
] }) }) });
|
|
50439
|
+
}
|
|
50440
|
+
const [sorting, setSorting] = React16__default.useState([]);
|
|
50441
|
+
const [columnFilters, setColumnFilters] = React16__default.useState([]);
|
|
50442
|
+
const [columnVisibility, setColumnVisibility] = React16__default.useState({});
|
|
50443
|
+
const [rowSelection, setRowSelection] = React16__default.useState({});
|
|
50444
|
+
const [globalFilter, setGlobalFilter] = React16__default.useState("");
|
|
50445
|
+
const table = useReactTable({
|
|
50446
|
+
data,
|
|
50447
|
+
columns,
|
|
50448
|
+
onSortingChange: setSorting,
|
|
50449
|
+
onColumnFiltersChange: setColumnFilters,
|
|
50450
|
+
getCoreRowModel: getCoreRowModel(),
|
|
50451
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
50452
|
+
getSortedRowModel: getSortedRowModel(),
|
|
50453
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
50454
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
50455
|
+
onRowSelectionChange: setRowSelection,
|
|
50456
|
+
onGlobalFilterChange: setGlobalFilter,
|
|
50457
|
+
globalFilterFn: "includesString",
|
|
50458
|
+
state: {
|
|
50459
|
+
sorting,
|
|
50460
|
+
columnFilters,
|
|
50461
|
+
columnVisibility,
|
|
50462
|
+
rowSelection,
|
|
50463
|
+
globalFilter
|
|
50464
|
+
},
|
|
50465
|
+
initialState: {
|
|
50466
|
+
pagination: {
|
|
50467
|
+
pageSize
|
|
50468
|
+
}
|
|
50469
|
+
}
|
|
50470
|
+
});
|
|
50471
|
+
React16__default.useEffect(() => {
|
|
50472
|
+
if (onRowSelect && selectable) {
|
|
50473
|
+
const selectedRows = table.getFilteredSelectedRowModel().rows.map((row) => row.original);
|
|
50474
|
+
onRowSelect(selectedRows);
|
|
50475
|
+
}
|
|
50476
|
+
}, [rowSelection, onRowSelect, selectable, table]);
|
|
50477
|
+
({
|
|
50478
|
+
sorting: features.sorting !== false,
|
|
50479
|
+
filtering: features.filtering !== false || filterable,
|
|
50480
|
+
pagination: features.pagination !== false || pagination,
|
|
50481
|
+
search: features.search !== false || searchable,
|
|
50482
|
+
columnVisibility: features.columnVisibility !== false,
|
|
50483
|
+
rowSelection: features.rowSelection !== false || selectable,
|
|
50484
|
+
export: features.export !== false || exportable
|
|
50485
|
+
});
|
|
50486
|
+
const handleExport = () => {
|
|
50487
|
+
if (onExport) {
|
|
50488
|
+
const selectedRows = table.getFilteredSelectedRowModel().rows;
|
|
50489
|
+
const dataToExport = selectedRows.length > 0 ? selectedRows.map((row) => row.original) : table.getFilteredRowModel().rows.map((row) => row.original);
|
|
50490
|
+
onExport(dataToExport);
|
|
50491
|
+
}
|
|
50492
|
+
};
|
|
50493
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), children: [
|
|
50494
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
50495
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
50496
|
+
searchable && /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
50497
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
50498
|
+
/* @__PURE__ */ jsx(
|
|
50499
|
+
Input,
|
|
50500
|
+
{
|
|
50501
|
+
placeholder: "Search all columns...",
|
|
50502
|
+
value: globalFilter,
|
|
50503
|
+
onChange: (e) => setGlobalFilter(e.target.value),
|
|
50504
|
+
className: "pl-8 w-64"
|
|
50505
|
+
}
|
|
50506
|
+
)
|
|
50507
|
+
] }),
|
|
50508
|
+
filterable && /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", children: [
|
|
50509
|
+
/* @__PURE__ */ jsx(Filter, { className: "mr-2 h-4 w-4" }),
|
|
50510
|
+
"Filters"
|
|
50511
|
+
] })
|
|
50512
|
+
] }),
|
|
50513
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
50514
|
+
exportable && /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: handleExport, children: [
|
|
50515
|
+
/* @__PURE__ */ jsx(Download, { className: "mr-2 h-4 w-4" }),
|
|
50516
|
+
"Export"
|
|
50517
|
+
] }),
|
|
50518
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", children: [
|
|
50519
|
+
/* @__PURE__ */ jsx(Settings, { className: "mr-2 h-4 w-4" }),
|
|
50520
|
+
"Columns"
|
|
50521
|
+
] })
|
|
50522
|
+
] })
|
|
50523
|
+
] }),
|
|
50524
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs("table", { className: "w-full", children: [
|
|
50525
|
+
/* @__PURE__ */ jsx("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", { className: "border-b", children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(
|
|
50526
|
+
"th",
|
|
50527
|
+
{
|
|
50528
|
+
className: "h-12 px-4 text-left align-middle font-medium text-muted-foreground",
|
|
50529
|
+
children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs(
|
|
50530
|
+
"div",
|
|
50531
|
+
{
|
|
50532
|
+
className: cn(
|
|
50533
|
+
"flex items-center space-x-2",
|
|
50534
|
+
header.column.getCanSort() && "cursor-pointer select-none"
|
|
50535
|
+
),
|
|
50536
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
50537
|
+
children: [
|
|
50538
|
+
flexRender(header.column.columnDef.header, header.getContext()),
|
|
50539
|
+
header.column.getCanSort() && /* @__PURE__ */ jsx("div", { className: "ml-2", children: header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx(ArrowDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ArrowUpDown, { className: "h-4 w-4" }) })
|
|
50540
|
+
]
|
|
50541
|
+
}
|
|
50542
|
+
)
|
|
50543
|
+
},
|
|
50544
|
+
header.id
|
|
50545
|
+
)) }, headerGroup.id)) }),
|
|
50546
|
+
/* @__PURE__ */ jsx("tbody", { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(
|
|
50547
|
+
"tr",
|
|
50548
|
+
{
|
|
50549
|
+
className: cn(
|
|
50550
|
+
"border-b transition-colors hover:bg-muted/50",
|
|
50551
|
+
row.getIsSelected() && "bg-muted"
|
|
50552
|
+
),
|
|
50553
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx("td", { className: "p-4 align-middle", children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
50554
|
+
},
|
|
50555
|
+
row.id
|
|
50556
|
+
)) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: columns.length, className: "h-24 text-center", children: "No results found." }) }) })
|
|
50557
|
+
] }) }),
|
|
50558
|
+
pagination && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-2", children: [
|
|
50559
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 text-sm text-muted-foreground", children: selectable && table.getFilteredSelectedRowModel().rows.length > 0 && /* @__PURE__ */ jsxs("span", { children: [
|
|
50560
|
+
table.getFilteredSelectedRowModel().rows.length,
|
|
50561
|
+
" of",
|
|
50562
|
+
" ",
|
|
50563
|
+
table.getFilteredRowModel().rows.length,
|
|
50564
|
+
" row(s) selected."
|
|
50565
|
+
] }) }),
|
|
50566
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
|
|
50567
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
50568
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: "Rows per page" }),
|
|
50569
|
+
/* @__PURE__ */ jsx(
|
|
50570
|
+
"select",
|
|
50571
|
+
{
|
|
50572
|
+
value: table.getState().pagination.pageSize,
|
|
50573
|
+
onChange: (e) => table.setPageSize(Number(e.target.value)),
|
|
50574
|
+
className: "h-8 w-[70px] rounded border border-input bg-background px-3 py-1 text-sm",
|
|
50575
|
+
children: [10, 20, 30, 40, 50].map((pageSize2) => /* @__PURE__ */ jsx("option", { value: pageSize2, children: pageSize2 }, pageSize2))
|
|
50576
|
+
}
|
|
50577
|
+
)
|
|
50578
|
+
] }),
|
|
50579
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
|
|
50580
|
+
"Page ",
|
|
50581
|
+
table.getState().pagination.pageIndex + 1,
|
|
50582
|
+
" of",
|
|
50583
|
+
" ",
|
|
50584
|
+
table.getPageCount()
|
|
50585
|
+
] }),
|
|
50586
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
50587
|
+
/* @__PURE__ */ jsx(
|
|
50588
|
+
Button,
|
|
50589
|
+
{
|
|
50590
|
+
variant: "outline",
|
|
50591
|
+
className: "hidden h-8 w-8 p-0 lg:flex",
|
|
50592
|
+
onClick: () => table.setPageIndex(0),
|
|
50593
|
+
disabled: !table.getCanPreviousPage(),
|
|
50594
|
+
children: /* @__PURE__ */ jsx(ChevronsLeft, { className: "h-4 w-4" })
|
|
50595
|
+
}
|
|
50596
|
+
),
|
|
50597
|
+
/* @__PURE__ */ jsx(
|
|
50598
|
+
Button,
|
|
50599
|
+
{
|
|
50600
|
+
variant: "outline",
|
|
50601
|
+
className: "h-8 w-8 p-0",
|
|
50602
|
+
onClick: () => table.previousPage(),
|
|
50603
|
+
disabled: !table.getCanPreviousPage(),
|
|
50604
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
|
|
50605
|
+
}
|
|
50606
|
+
),
|
|
50607
|
+
/* @__PURE__ */ jsx(
|
|
50608
|
+
Button,
|
|
50609
|
+
{
|
|
50610
|
+
variant: "outline",
|
|
50611
|
+
className: "h-8 w-8 p-0",
|
|
50612
|
+
onClick: () => table.nextPage(),
|
|
50613
|
+
disabled: !table.getCanNextPage(),
|
|
50614
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
50615
|
+
}
|
|
50616
|
+
),
|
|
50617
|
+
/* @__PURE__ */ jsx(
|
|
50618
|
+
Button,
|
|
50619
|
+
{
|
|
50620
|
+
variant: "outline",
|
|
50621
|
+
className: "hidden h-8 w-8 p-0 lg:flex",
|
|
50622
|
+
onClick: () => table.setPageIndex(table.getPageCount() - 1),
|
|
50623
|
+
disabled: !table.getCanNextPage(),
|
|
50624
|
+
children: /* @__PURE__ */ jsx(ChevronsRight, { className: "h-4 w-4" })
|
|
50625
|
+
}
|
|
50626
|
+
)
|
|
50627
|
+
] })
|
|
50628
|
+
] })
|
|
50629
|
+
] })
|
|
50630
|
+
] });
|
|
50631
|
+
}
|
|
50165
50632
|
|
|
50166
50633
|
// src/components/enhanced/index.ts
|
|
50167
50634
|
var enhanced_exports = {};
|
|
@@ -51061,4 +51528,4 @@ var BadgePro = React16__default.forwardRef(({
|
|
|
51061
51528
|
});
|
|
51062
51529
|
BadgePro.displayName = "BadgePro";
|
|
51063
51530
|
|
|
51064
|
-
export { AdvancedChart, AdvancedForms, AnimatedButton, Calendar2 as Calendar, ColorPicker2 as ColorPicker, Dashboard, DraggableList, enhanced_exports as Enhanced, ErrorBoundary, FloatingActionButton, GitHubStars, HealthCheck, HoverCard3D, Kanban, LazyComponent, LazyImage, LazyList, MagneticButton, MemoryAnalytics, MemoryEfficientData, OptimizedImage, PerformanceDebugger, PerformanceMonitor, PinchZoom, RichTextEditor, SelectableVirtualList, SpotlightCard, SwipeableCard, Timeline, VirtualList, animatedButtonVariants, useStreamingData, useVirtualList };
|
|
51531
|
+
export { AdvancedChart, AdvancedForms, AnimatedButton, Calendar2 as Calendar, ColorPicker2 as ColorPicker, Dashboard, DataTable, DraggableList, enhanced_exports as Enhanced, ErrorBoundary, FileUpload, FloatingActionButton, GitHubStars, HealthCheck, HoverCard3D, Kanban, LazyComponent, LazyImage, LazyList, MagneticButton, MemoryAnalytics, MemoryEfficientData, OptimizedImage, PerformanceDebugger, PerformanceMonitor, PinchZoom, RichTextEditor, SelectableVirtualList, SpotlightCard, SwipeableCard, Timeline, VirtualList, animatedButtonVariants, useStreamingData, useVirtualList };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
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",
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import React from 'react'
|
|
4
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '
|
|
5
|
-
import { Button } from '
|
|
6
|
-
import {
|
|
7
|
-
import { Badge } from './badge'
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../ui/card'
|
|
5
|
+
import { Button } from '../ui/button'
|
|
6
|
+
import { Badge } from '../ui/badge'
|
|
8
7
|
import {
|
|
9
8
|
Upload,
|
|
10
9
|
File,
|
|
@@ -22,7 +21,6 @@ import {
|
|
|
22
21
|
Sparkles
|
|
23
22
|
} from 'lucide-react'
|
|
24
23
|
import { cn } from '../../lib/utils'
|
|
25
|
-
import { useDocsProAccess } from '@/components/docs/docs-pro-provider'
|
|
26
24
|
import { useSubscription } from '../../hooks/use-subscription'
|
|
27
25
|
|
|
28
26
|
interface FileUploadProps {
|
|
@@ -316,7 +314,12 @@ export function FileUpload({
|
|
|
316
314
|
</div>
|
|
317
315
|
|
|
318
316
|
{uploadedFile.status === 'uploading' && (
|
|
319
|
-
<
|
|
317
|
+
<div className="mt-2 h-2 bg-secondary rounded-full overflow-hidden">
|
|
318
|
+
<div
|
|
319
|
+
className="h-full bg-primary transition-all duration-300 ease-out"
|
|
320
|
+
style={{ width: `${uploadedFile.progress}%` }}
|
|
321
|
+
/>
|
|
322
|
+
</div>
|
|
320
323
|
)}
|
|
321
324
|
|
|
322
325
|
{uploadedFile.error && (
|
package/src/components/index.ts
CHANGED
|
@@ -73,4 +73,10 @@ export * from "./optimized-image"
|
|
|
73
73
|
export * from "./performance-debugger"
|
|
74
74
|
|
|
75
75
|
// Performance Monitor
|
|
76
|
-
export * from "./performance-monitor"
|
|
76
|
+
export * from "./performance-monitor"
|
|
77
|
+
|
|
78
|
+
// File Upload
|
|
79
|
+
export * from "./file-upload"
|
|
80
|
+
|
|
81
|
+
// Data Table
|
|
82
|
+
export * from "./data-table"
|