@moontra/moonui-pro 2.20.2 → 2.20.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/package.json +8 -3
- package/plugin/index.d.ts +86 -0
- package/plugin/index.js +308 -0
- package/scripts/postinstall.js +191 -23
- package/src/components/advanced-chart/index.tsx +0 -1246
- package/src/components/advanced-forms/index.tsx +0 -585
- package/src/components/animated-button/index.tsx +0 -385
- package/src/components/calendar/event-dialog.tsx +0 -377
- package/src/components/calendar/index.tsx +0 -1220
- package/src/components/calendar-pro/index.tsx +0 -1697
- package/src/components/color-picker/index.tsx +0 -432
- package/src/components/credit-card-input/index.tsx +0 -406
- package/src/components/dashboard/dashboard-grid.tsx +0 -480
- package/src/components/dashboard/demo.tsx +0 -425
- package/src/components/dashboard/index.tsx +0 -1046
- package/src/components/dashboard/time-range-picker.tsx +0 -336
- package/src/components/dashboard/types.ts +0 -225
- package/src/components/dashboard/widgets/activity-feed.tsx +0 -349
- package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
- package/src/components/dashboard/widgets/comparison-widget.tsx +0 -177
- package/src/components/dashboard/widgets/index.ts +0 -5
- package/src/components/dashboard/widgets/metric-card.tsx +0 -363
- package/src/components/dashboard/widgets/progress-widget.tsx +0 -113
- package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
- package/src/components/data-table/data-table-column-toggle.tsx +0 -169
- package/src/components/data-table/data-table-export.ts +0 -156
- package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
- package/src/components/data-table/index.tsx +0 -845
- package/src/components/draggable-list/index.tsx +0 -100
- package/src/components/error-boundary/index.tsx +0 -232
- package/src/components/file-upload/index.tsx +0 -1660
- package/src/components/floating-action-button/index.tsx +0 -206
- package/src/components/form-wizard/form-wizard-context.tsx +0 -335
- package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
- package/src/components/form-wizard/form-wizard-progress.tsx +0 -329
- package/src/components/form-wizard/form-wizard-step.tsx +0 -111
- package/src/components/form-wizard/index.tsx +0 -102
- package/src/components/form-wizard/types.ts +0 -77
- package/src/components/gesture-drawer/index.tsx +0 -551
- package/src/components/github-stars/github-api.ts +0 -426
- package/src/components/github-stars/hooks.ts +0 -517
- package/src/components/github-stars/index.tsx +0 -375
- package/src/components/github-stars/types.ts +0 -148
- package/src/components/github-stars/variants.tsx +0 -515
- package/src/components/health-check/index.tsx +0 -439
- package/src/components/hover-card-3d/index.tsx +0 -529
- package/src/components/index.ts +0 -130
- package/src/components/internal/index.ts +0 -78
- package/src/components/kanban/add-card-modal.tsx +0 -502
- package/src/components/kanban/card-detail-modal.tsx +0 -761
- package/src/components/kanban/index.ts +0 -13
- package/src/components/kanban/kanban.tsx +0 -1689
- package/src/components/kanban/types.ts +0 -168
- package/src/components/lazy-component/index.tsx +0 -823
- package/src/components/license-error/index.tsx +0 -31
- package/src/components/magnetic-button/index.tsx +0 -216
- package/src/components/memory-efficient-data/index.tsx +0 -1018
- package/src/components/moonui-quiz-form/index.tsx +0 -817
- package/src/components/navbar/index.tsx +0 -781
- package/src/components/optimized-image/index.tsx +0 -425
- package/src/components/performance-debugger/index.tsx +0 -613
- package/src/components/performance-monitor/index.tsx +0 -808
- package/src/components/phone-number-input/index.tsx +0 -343
- package/src/components/phone-number-input/phone-number-input-simple.tsx +0 -167
- package/src/components/pinch-zoom/index.tsx +0 -566
- package/src/components/quiz-form/index.tsx +0 -479
- package/src/components/rich-text-editor/index.tsx +0 -2322
- package/src/components/rich-text-editor/slash-commands-extension.ts +0 -230
- package/src/components/rich-text-editor/slash-commands.css +0 -35
- package/src/components/rich-text-editor/table-styles.css +0 -65
- package/src/components/sidebar/index.tsx +0 -884
- package/src/components/spotlight-card/index.tsx +0 -191
- package/src/components/swipeable-card/index.tsx +0 -100
- package/src/components/timeline/index.tsx +0 -1183
- package/src/components/ui/accordion.tsx +0 -581
- package/src/components/ui/alert-dialog.tsx +0 -141
- package/src/components/ui/alert.tsx +0 -141
- package/src/components/ui/aspect-ratio.tsx +0 -245
- package/src/components/ui/avatar.tsx +0 -155
- package/src/components/ui/badge.tsx +0 -230
- package/src/components/ui/breadcrumb.tsx +0 -216
- package/src/components/ui/button.tsx +0 -228
- package/src/components/ui/calendar.tsx +0 -387
- package/src/components/ui/card.tsx +0 -216
- package/src/components/ui/checkbox.tsx +0 -259
- package/src/components/ui/collapsible.tsx +0 -631
- package/src/components/ui/color-picker.tsx +0 -97
- package/src/components/ui/command.tsx +0 -948
- package/src/components/ui/dialog.tsx +0 -752
- package/src/components/ui/dropdown-menu.tsx +0 -706
- package/src/components/ui/gesture-drawer.tsx +0 -11
- package/src/components/ui/hover-card.tsx +0 -29
- package/src/components/ui/index.ts +0 -222
- package/src/components/ui/input.tsx +0 -224
- package/src/components/ui/label.tsx +0 -29
- package/src/components/ui/lightbox.tsx +0 -606
- package/src/components/ui/magnetic-button.tsx +0 -129
- package/src/components/ui/media-gallery.tsx +0 -611
- package/src/components/ui/navigation-menu.tsx +0 -130
- package/src/components/ui/pagination.tsx +0 -125
- package/src/components/ui/popover.tsx +0 -185
- package/src/components/ui/progress.tsx +0 -30
- package/src/components/ui/radio-group.tsx +0 -257
- package/src/components/ui/scroll-area.tsx +0 -47
- package/src/components/ui/select.tsx +0 -378
- package/src/components/ui/separator.tsx +0 -145
- package/src/components/ui/sheet.tsx +0 -139
- package/src/components/ui/skeleton.tsx +0 -20
- package/src/components/ui/slider.tsx +0 -354
- package/src/components/ui/spotlight-card.tsx +0 -119
- package/src/components/ui/switch.tsx +0 -86
- package/src/components/ui/table.tsx +0 -331
- package/src/components/ui/tabs-pro.tsx +0 -542
- package/src/components/ui/tabs.tsx +0 -54
- package/src/components/ui/textarea.tsx +0 -28
- package/src/components/ui/toast.tsx +0 -317
- package/src/components/ui/toggle.tsx +0 -119
- package/src/components/ui/tooltip.tsx +0 -151
- package/src/components/virtual-list/index.tsx +0 -668
- package/src/hooks/use-chart.ts +0 -205
- package/src/hooks/use-data-table.ts +0 -182
- package/src/hooks/use-docs-pro-access.ts +0 -13
- package/src/hooks/use-license-check.ts +0 -65
- package/src/hooks/use-subscription.ts +0 -19
- package/src/hooks/use-toast.ts +0 -15
- package/src/index.ts +0 -22
- package/src/lib/ai-providers.ts +0 -377
- package/src/lib/component-metadata.ts +0 -18
- package/src/lib/micro-interactions.ts +0 -255
- package/src/lib/paddle.ts +0 -17
- package/src/lib/utils.ts +0 -6
- package/src/patterns/login-form/index.tsx +0 -276
- package/src/patterns/login-form/types.ts +0 -67
- package/src/setupTests.ts +0 -41
- package/src/styles/advanced-chart.css +0 -239
- package/src/styles/calendar.css +0 -35
- package/src/styles/design-system.css +0 -363
- package/src/styles/index.css +0 -681
- package/src/styles/tailwind.css +0 -7
- package/src/styles/tokens.css +0 -455
- package/src/types/next-auth.d.ts +0 -21
- package/src/use-intersection-observer.tsx +0 -154
- package/src/use-local-storage.tsx +0 -71
- package/src/use-paddle.ts +0 -138
- package/src/use-performance-optimizer.ts +0 -389
- package/src/use-pro-access.ts +0 -141
- package/src/use-scroll-animation.ts +0 -219
- package/src/use-subscription.ts +0 -37
- package/src/use-toast.ts +0 -32
- package/src/utils/chart-helpers.ts +0 -357
- package/src/utils/cn.ts +0 -6
- package/src/utils/data-processing.ts +0 -151
- package/src/utils/license-validator.tsx +0 -183
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import React from 'react'
|
|
4
|
-
import { Check, Columns, Search } from 'lucide-react'
|
|
5
|
-
import {
|
|
6
|
-
DropdownMenu,
|
|
7
|
-
DropdownMenuContent,
|
|
8
|
-
DropdownMenuItem,
|
|
9
|
-
DropdownMenuLabel,
|
|
10
|
-
DropdownMenuSeparator,
|
|
11
|
-
DropdownMenuTrigger,
|
|
12
|
-
} from '../ui/dropdown-menu'
|
|
13
|
-
import { Button } from '../ui/button'
|
|
14
|
-
import { Input } from '../ui/input'
|
|
15
|
-
import { cn } from '../../lib/utils'
|
|
16
|
-
|
|
17
|
-
interface DataTableColumnToggleProps {
|
|
18
|
-
table: any // Table instance from @tanstack/react-table
|
|
19
|
-
trigger?: React.ReactNode
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function DataTableColumnToggle({ table, trigger }: DataTableColumnToggleProps) {
|
|
23
|
-
const [search, setSearch] = React.useState('')
|
|
24
|
-
|
|
25
|
-
// Get all columns that can be hidden
|
|
26
|
-
const columns = table
|
|
27
|
-
.getAllColumns()
|
|
28
|
-
.filter((column: any) =>
|
|
29
|
-
column.getCanHide() &&
|
|
30
|
-
column.id !== 'select' &&
|
|
31
|
-
column.id !== 'actions' &&
|
|
32
|
-
column.id !== 'expander'
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
// Filter columns based on search
|
|
36
|
-
const filteredColumns = React.useMemo(() => {
|
|
37
|
-
if (!search) return columns
|
|
38
|
-
|
|
39
|
-
return columns.filter((column: any) => {
|
|
40
|
-
const header = column.columnDef.header
|
|
41
|
-
const headerText = typeof header === 'string'
|
|
42
|
-
? header
|
|
43
|
-
: column.id
|
|
44
|
-
|
|
45
|
-
return headerText.toLowerCase().includes(search.toLowerCase())
|
|
46
|
-
})
|
|
47
|
-
}, [columns, search])
|
|
48
|
-
|
|
49
|
-
// Count visible columns
|
|
50
|
-
const visibleCount = columns.filter((col: any) => col.getIsVisible()).length
|
|
51
|
-
|
|
52
|
-
const handleToggleAll = (visible: boolean) => {
|
|
53
|
-
table.toggleAllColumnsVisible(visible)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<DropdownMenu>
|
|
58
|
-
<DropdownMenuTrigger asChild>
|
|
59
|
-
{trigger || (
|
|
60
|
-
<Button variant="outline" size="sm" className="gap-2">
|
|
61
|
-
<Columns className="h-4 w-4" />
|
|
62
|
-
Columns
|
|
63
|
-
{visibleCount < columns.length && (
|
|
64
|
-
<span className="ml-1 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs">
|
|
65
|
-
{visibleCount}/{columns.length}
|
|
66
|
-
</span>
|
|
67
|
-
)}
|
|
68
|
-
</Button>
|
|
69
|
-
)}
|
|
70
|
-
</DropdownMenuTrigger>
|
|
71
|
-
<DropdownMenuContent align="end" className="w-56">
|
|
72
|
-
<DropdownMenuLabel>Toggle Columns</DropdownMenuLabel>
|
|
73
|
-
|
|
74
|
-
{/* Search input for many columns */}
|
|
75
|
-
{columns.length > 5 && (
|
|
76
|
-
<>
|
|
77
|
-
<div className="px-2 py-1.5">
|
|
78
|
-
<div className="relative">
|
|
79
|
-
<Search className="absolute left-2 top-2.5 h-3 w-3 text-muted-foreground" />
|
|
80
|
-
<Input
|
|
81
|
-
placeholder="Search columns..."
|
|
82
|
-
value={search}
|
|
83
|
-
onChange={(e) => setSearch(e.target.value)}
|
|
84
|
-
className="h-8 pl-7 text-xs"
|
|
85
|
-
/>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
<DropdownMenuSeparator />
|
|
89
|
-
</>
|
|
90
|
-
)}
|
|
91
|
-
|
|
92
|
-
{/* Quick actions */}
|
|
93
|
-
<div className="flex items-center justify-between px-2 py-1.5">
|
|
94
|
-
<Button
|
|
95
|
-
variant="ghost"
|
|
96
|
-
size="sm"
|
|
97
|
-
className="h-7 text-xs"
|
|
98
|
-
onClick={() => handleToggleAll(true)}
|
|
99
|
-
>
|
|
100
|
-
Show all
|
|
101
|
-
</Button>
|
|
102
|
-
<Button
|
|
103
|
-
variant="ghost"
|
|
104
|
-
size="sm"
|
|
105
|
-
className="h-7 text-xs"
|
|
106
|
-
onClick={() => handleToggleAll(false)}
|
|
107
|
-
>
|
|
108
|
-
Hide all
|
|
109
|
-
</Button>
|
|
110
|
-
</div>
|
|
111
|
-
|
|
112
|
-
<DropdownMenuSeparator />
|
|
113
|
-
|
|
114
|
-
{/* Column list */}
|
|
115
|
-
<div className="max-h-64 overflow-y-auto">
|
|
116
|
-
{filteredColumns.length === 0 ? (
|
|
117
|
-
<div className="px-2 py-4 text-center text-xs text-muted-foreground">
|
|
118
|
-
No columns found
|
|
119
|
-
</div>
|
|
120
|
-
) : (
|
|
121
|
-
filteredColumns.map((column: any) => {
|
|
122
|
-
const isVisible = column.getIsVisible()
|
|
123
|
-
const header = column.columnDef.header
|
|
124
|
-
const headerText = typeof header === 'string'
|
|
125
|
-
? header
|
|
126
|
-
: column.id
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
<DropdownMenuItem
|
|
130
|
-
key={column.id}
|
|
131
|
-
className={cn(
|
|
132
|
-
"cursor-pointer",
|
|
133
|
-
!isVisible && "text-muted-foreground"
|
|
134
|
-
)}
|
|
135
|
-
onSelect={(e) => {
|
|
136
|
-
e.preventDefault()
|
|
137
|
-
column.toggleVisibility()
|
|
138
|
-
}}
|
|
139
|
-
>
|
|
140
|
-
<div className="flex items-center gap-2 flex-1">
|
|
141
|
-
<div className={cn(
|
|
142
|
-
"flex h-4 w-4 items-center justify-center rounded-sm border",
|
|
143
|
-
isVisible
|
|
144
|
-
? "border-primary bg-primary text-primary-foreground"
|
|
145
|
-
: "border-muted-foreground"
|
|
146
|
-
)}>
|
|
147
|
-
{isVisible && <Check className="h-3 w-3" />}
|
|
148
|
-
</div>
|
|
149
|
-
<span className="truncate">{headerText}</span>
|
|
150
|
-
</div>
|
|
151
|
-
</DropdownMenuItem>
|
|
152
|
-
)
|
|
153
|
-
})
|
|
154
|
-
)}
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
{/* Summary */}
|
|
158
|
-
{columns.length > 0 && (
|
|
159
|
-
<>
|
|
160
|
-
<DropdownMenuSeparator />
|
|
161
|
-
<div className="px-2 py-1.5 text-xs text-muted-foreground text-center">
|
|
162
|
-
{visibleCount} of {columns.length} columns visible
|
|
163
|
-
</div>
|
|
164
|
-
</>
|
|
165
|
-
)}
|
|
166
|
-
</DropdownMenuContent>
|
|
167
|
-
</DropdownMenu>
|
|
168
|
-
)
|
|
169
|
-
}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Export utilities for DataTable component
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export type ExportFormat = 'csv' | 'json' | 'xlsx';
|
|
6
|
-
|
|
7
|
-
export interface ExportOptions {
|
|
8
|
-
filename?: string;
|
|
9
|
-
format: ExportFormat;
|
|
10
|
-
columns?: string[];
|
|
11
|
-
includeHeaders?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Convert data to CSV format
|
|
16
|
-
*/
|
|
17
|
-
export function dataToCSV<T extends Record<string, any>>(
|
|
18
|
-
data: T[],
|
|
19
|
-
columns?: string[],
|
|
20
|
-
includeHeaders = true
|
|
21
|
-
): string {
|
|
22
|
-
if (data.length === 0) return '';
|
|
23
|
-
|
|
24
|
-
// Get columns from first item if not provided
|
|
25
|
-
const cols = columns || Object.keys(data[0]);
|
|
26
|
-
|
|
27
|
-
// Build CSV content
|
|
28
|
-
const rows: string[] = [];
|
|
29
|
-
|
|
30
|
-
// Add headers
|
|
31
|
-
if (includeHeaders) {
|
|
32
|
-
const headers = cols.map(col => {
|
|
33
|
-
// Handle column names with special characters
|
|
34
|
-
const value = String(col);
|
|
35
|
-
return value.includes(',') || value.includes('"') || value.includes('\n')
|
|
36
|
-
? `"${value.replace(/"/g, '""')}"`
|
|
37
|
-
: value;
|
|
38
|
-
});
|
|
39
|
-
rows.push(headers.join(','));
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Add data rows
|
|
43
|
-
data.forEach(item => {
|
|
44
|
-
const row = cols.map(col => {
|
|
45
|
-
const value = item[col];
|
|
46
|
-
|
|
47
|
-
// Handle different value types
|
|
48
|
-
if (value === null || value === undefined) return '';
|
|
49
|
-
if (value instanceof Date) return value.toISOString();
|
|
50
|
-
if (typeof value === 'object') return JSON.stringify(value);
|
|
51
|
-
|
|
52
|
-
const stringValue = String(value);
|
|
53
|
-
return stringValue.includes(',') || stringValue.includes('"') || stringValue.includes('\n')
|
|
54
|
-
? `"${stringValue.replace(/"/g, '""')}"`
|
|
55
|
-
: stringValue;
|
|
56
|
-
});
|
|
57
|
-
rows.push(row.join(','));
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
return rows.join('\n');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Convert data to JSON format
|
|
65
|
-
*/
|
|
66
|
-
export function dataToJSON<T>(data: T[], columns?: string[]): string {
|
|
67
|
-
if (!columns || columns.length === 0) {
|
|
68
|
-
return JSON.stringify(data, null, 2);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Filter data to include only specified columns
|
|
72
|
-
const filteredData = data.map(item => {
|
|
73
|
-
const filtered: Record<string, any> = {};
|
|
74
|
-
columns.forEach(col => {
|
|
75
|
-
if (col in (item as any)) {
|
|
76
|
-
filtered[col] = (item as any)[col];
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
return filtered;
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
return JSON.stringify(filteredData, null, 2);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Download data as a file
|
|
87
|
-
*/
|
|
88
|
-
export function downloadFile(content: string, filename: string, mimeType: string): void {
|
|
89
|
-
const blob = new Blob([content], { type: mimeType });
|
|
90
|
-
const url = URL.createObjectURL(blob);
|
|
91
|
-
const link = document.createElement('a');
|
|
92
|
-
|
|
93
|
-
link.href = url;
|
|
94
|
-
link.download = filename;
|
|
95
|
-
document.body.appendChild(link);
|
|
96
|
-
link.click();
|
|
97
|
-
|
|
98
|
-
// Cleanup
|
|
99
|
-
document.body.removeChild(link);
|
|
100
|
-
URL.revokeObjectURL(url);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Export data to the specified format
|
|
105
|
-
*/
|
|
106
|
-
export async function exportData<T extends Record<string, any>>(
|
|
107
|
-
data: T[],
|
|
108
|
-
options: ExportOptions
|
|
109
|
-
): Promise<void> {
|
|
110
|
-
const { format, filename = 'data-export', columns, includeHeaders = true } = options;
|
|
111
|
-
|
|
112
|
-
let content: string;
|
|
113
|
-
let mimeType: string;
|
|
114
|
-
let extension: string;
|
|
115
|
-
|
|
116
|
-
switch (format) {
|
|
117
|
-
case 'csv':
|
|
118
|
-
content = dataToCSV(data, columns, includeHeaders);
|
|
119
|
-
mimeType = 'text/csv;charset=utf-8;';
|
|
120
|
-
extension = 'csv';
|
|
121
|
-
break;
|
|
122
|
-
|
|
123
|
-
case 'json':
|
|
124
|
-
content = dataToJSON(data, columns);
|
|
125
|
-
mimeType = 'application/json;charset=utf-8;';
|
|
126
|
-
extension = 'json';
|
|
127
|
-
break;
|
|
128
|
-
|
|
129
|
-
case 'xlsx':
|
|
130
|
-
// For XLSX, we'll need to use a library like xlsx or exceljs
|
|
131
|
-
// For now, we'll throw an error indicating it's not implemented
|
|
132
|
-
throw new Error('XLSX export requires additional dependencies. Use CSV format instead.');
|
|
133
|
-
|
|
134
|
-
default:
|
|
135
|
-
throw new Error(`Unsupported export format: ${format}`);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const finalFilename = `${filename}-${new Date().toISOString().split('T')[0]}.${extension}`;
|
|
139
|
-
downloadFile(content, finalFilename, mimeType);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Get visible columns from column definitions
|
|
144
|
-
*/
|
|
145
|
-
export function getVisibleColumns<T>(
|
|
146
|
-
columns: Array<{ id?: string; accessorKey?: string; header?: any }>,
|
|
147
|
-
columnVisibility: Record<string, boolean>
|
|
148
|
-
): string[] {
|
|
149
|
-
return columns
|
|
150
|
-
.filter(col => {
|
|
151
|
-
const key = col.id || col.accessorKey;
|
|
152
|
-
return key && columnVisibility[key] !== false;
|
|
153
|
-
})
|
|
154
|
-
.map(col => col.id || col.accessorKey!)
|
|
155
|
-
.filter(Boolean);
|
|
156
|
-
}
|