@moontra/moonui-pro 2.20.2 → 2.20.3
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 +176 -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,377 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import React, { useState, useEffect } from 'react'
|
|
4
|
-
import { Button } from '../ui/button'
|
|
5
|
-
import { Input } from '../ui/input'
|
|
6
|
-
import { Label } from '../ui/label'
|
|
7
|
-
import { Textarea } from '../ui/textarea'
|
|
8
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select'
|
|
9
|
-
import {
|
|
10
|
-
Dialog,
|
|
11
|
-
DialogContent,
|
|
12
|
-
DialogDescription,
|
|
13
|
-
DialogHeader,
|
|
14
|
-
DialogTitle,
|
|
15
|
-
DialogFooter,
|
|
16
|
-
} from '../ui/dialog'
|
|
17
|
-
import { CalendarEvent } from './index'
|
|
18
|
-
import { Calendar, Clock, MapPin, Palette, Type } from 'lucide-react'
|
|
19
|
-
import { cn } from '../../lib/utils'
|
|
20
|
-
|
|
21
|
-
interface EventDialogProps {
|
|
22
|
-
open: boolean
|
|
23
|
-
onOpenChange: (open: boolean) => void
|
|
24
|
-
event?: CalendarEvent | null
|
|
25
|
-
selectedDate?: Date | null
|
|
26
|
-
onSave: (event: Omit<CalendarEvent, 'id'> & { id?: string }) => void
|
|
27
|
-
onDelete?: (eventId: string) => void
|
|
28
|
-
mode?: 'create' | 'edit'
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const EVENT_TYPES = [
|
|
32
|
-
{ value: 'meeting', label: 'Meeting', color: '#3b82f6' },
|
|
33
|
-
{ value: 'task', label: 'Task', color: '#10b981' },
|
|
34
|
-
{ value: 'reminder', label: 'Reminder', color: '#f59e0b' },
|
|
35
|
-
{ value: 'event', label: 'Event', color: '#8b5cf6' },
|
|
36
|
-
] as const
|
|
37
|
-
|
|
38
|
-
const PRESET_COLORS = [
|
|
39
|
-
'#3b82f6', '#10b981', '#f59e0b', '#8b5cf6',
|
|
40
|
-
'#ef4444', '#06b6d4', '#84cc16', '#f97316',
|
|
41
|
-
'#ec4899', '#6366f1', '#14b8a6', '#eab308',
|
|
42
|
-
'#f43f5e', '#a855f7', '#22c55e', '#64748b',
|
|
43
|
-
]
|
|
44
|
-
|
|
45
|
-
export function EventDialog({
|
|
46
|
-
open,
|
|
47
|
-
onOpenChange,
|
|
48
|
-
event,
|
|
49
|
-
selectedDate,
|
|
50
|
-
onSave,
|
|
51
|
-
onDelete,
|
|
52
|
-
mode = 'create'
|
|
53
|
-
}: EventDialogProps) {
|
|
54
|
-
const [formData, setFormData] = useState<{
|
|
55
|
-
title: string
|
|
56
|
-
description: string
|
|
57
|
-
date: string
|
|
58
|
-
startTime: string
|
|
59
|
-
endTime: string
|
|
60
|
-
location: string
|
|
61
|
-
type: 'meeting' | 'task' | 'reminder' | 'event' | 'birthday' | 'holiday' | 'conference'
|
|
62
|
-
color: string
|
|
63
|
-
attendees: string
|
|
64
|
-
}>({
|
|
65
|
-
title: '',
|
|
66
|
-
description: '',
|
|
67
|
-
date: '',
|
|
68
|
-
startTime: '',
|
|
69
|
-
endTime: '',
|
|
70
|
-
location: '',
|
|
71
|
-
type: 'meeting',
|
|
72
|
-
color: '#3b82f6',
|
|
73
|
-
attendees: ''
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
const [errors, setErrors] = useState<Record<string, string>>({})
|
|
77
|
-
const [isSubmitting, setIsSubmitting] = useState(false)
|
|
78
|
-
|
|
79
|
-
// Initialize form data
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
if (mode === 'edit' && event) {
|
|
82
|
-
setFormData({
|
|
83
|
-
title: event.title || '',
|
|
84
|
-
description: event.description || '',
|
|
85
|
-
date: event.date.toISOString().split('T')[0],
|
|
86
|
-
startTime: event.startTime || '',
|
|
87
|
-
endTime: event.endTime || '',
|
|
88
|
-
location: event.location || '',
|
|
89
|
-
type: event.type || 'meeting',
|
|
90
|
-
color: event.color || '#3b82f6',
|
|
91
|
-
attendees: event.attendees?.join(', ') || ''
|
|
92
|
-
})
|
|
93
|
-
} else if (mode === 'create') {
|
|
94
|
-
const dateStr = selectedDate ? selectedDate.toISOString().split('T')[0] : new Date().toISOString().split('T')[0]
|
|
95
|
-
setFormData({
|
|
96
|
-
title: '',
|
|
97
|
-
description: '',
|
|
98
|
-
date: dateStr,
|
|
99
|
-
startTime: '',
|
|
100
|
-
endTime: '',
|
|
101
|
-
location: '',
|
|
102
|
-
type: 'meeting',
|
|
103
|
-
color: '#3b82f6',
|
|
104
|
-
attendees: ''
|
|
105
|
-
})
|
|
106
|
-
}
|
|
107
|
-
setErrors({})
|
|
108
|
-
}, [event, selectedDate, mode, open])
|
|
109
|
-
|
|
110
|
-
const validateForm = () => {
|
|
111
|
-
const newErrors: Record<string, string> = {}
|
|
112
|
-
|
|
113
|
-
if (!formData.title.trim()) {
|
|
114
|
-
newErrors.title = 'Title is required'
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (!formData.date) {
|
|
118
|
-
newErrors.date = 'Date is required'
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (formData.startTime && formData.endTime) {
|
|
122
|
-
if (formData.startTime >= formData.endTime) {
|
|
123
|
-
newErrors.endTime = 'End time must be after start time'
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
setErrors(newErrors)
|
|
128
|
-
return Object.keys(newErrors).length === 0
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const handleSubmit = async (e: React.FormEvent) => {
|
|
132
|
-
e.preventDefault()
|
|
133
|
-
|
|
134
|
-
if (!validateForm()) {
|
|
135
|
-
return
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
setIsSubmitting(true)
|
|
139
|
-
|
|
140
|
-
try {
|
|
141
|
-
const eventData = {
|
|
142
|
-
...(mode === 'edit' && event ? { id: event.id } : {}),
|
|
143
|
-
title: formData.title.trim(),
|
|
144
|
-
description: formData.description.trim(),
|
|
145
|
-
date: new Date(formData.date + 'T00:00:00'),
|
|
146
|
-
startTime: formData.startTime || undefined,
|
|
147
|
-
endTime: formData.endTime || undefined,
|
|
148
|
-
location: formData.location.trim() || undefined,
|
|
149
|
-
type: formData.type,
|
|
150
|
-
color: formData.color,
|
|
151
|
-
attendees: formData.attendees
|
|
152
|
-
? formData.attendees.split(',').map(a => a.trim()).filter(Boolean)
|
|
153
|
-
: undefined
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
await onSave(eventData)
|
|
157
|
-
onOpenChange(false)
|
|
158
|
-
} catch (error) {
|
|
159
|
-
console.error('Error saving event:', error)
|
|
160
|
-
} finally {
|
|
161
|
-
setIsSubmitting(false)
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
const handleDelete = () => {
|
|
166
|
-
if (event && onDelete) {
|
|
167
|
-
onDelete(event.id)
|
|
168
|
-
onOpenChange(false)
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
const handleTypeChange = (type: string) => {
|
|
173
|
-
const selectedType = EVENT_TYPES.find(t => t.value === type)
|
|
174
|
-
setFormData(prev => ({
|
|
175
|
-
...prev,
|
|
176
|
-
type: type as typeof formData.type,
|
|
177
|
-
color: selectedType?.color || prev.color
|
|
178
|
-
}))
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return (
|
|
182
|
-
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
183
|
-
<DialogContent className="sm:max-w-[500px]">
|
|
184
|
-
<DialogHeader>
|
|
185
|
-
<DialogTitle className="flex items-center gap-2">
|
|
186
|
-
<Calendar className="w-5 h-5" />
|
|
187
|
-
{mode === 'create' ? 'Create Event' : 'Edit Event'}
|
|
188
|
-
</DialogTitle>
|
|
189
|
-
<DialogDescription>
|
|
190
|
-
{mode === 'create'
|
|
191
|
-
? 'Add a new event to your calendar.'
|
|
192
|
-
: 'Edit the event details.'}
|
|
193
|
-
</DialogDescription>
|
|
194
|
-
</DialogHeader>
|
|
195
|
-
|
|
196
|
-
<form onSubmit={handleSubmit} className="space-y-4">
|
|
197
|
-
{/* Title */}
|
|
198
|
-
<div className="space-y-2">
|
|
199
|
-
<Label htmlFor="title">Title *</Label>
|
|
200
|
-
<Input
|
|
201
|
-
id="title"
|
|
202
|
-
value={formData.title}
|
|
203
|
-
onChange={(e) => setFormData(prev => ({ ...prev, title: e.target.value }))}
|
|
204
|
-
placeholder="Event title"
|
|
205
|
-
className={cn(errors.title && "border-red-500")}
|
|
206
|
-
/>
|
|
207
|
-
{errors.title && <p className="text-sm text-red-500">{errors.title}</p>}
|
|
208
|
-
</div>
|
|
209
|
-
|
|
210
|
-
{/* Description */}
|
|
211
|
-
<div className="space-y-2">
|
|
212
|
-
<Label htmlFor="description">Description</Label>
|
|
213
|
-
<Textarea
|
|
214
|
-
id="description"
|
|
215
|
-
value={formData.description}
|
|
216
|
-
onChange={(e) => setFormData(prev => ({ ...prev, description: e.target.value }))}
|
|
217
|
-
placeholder="Event description (optional)"
|
|
218
|
-
rows={3}
|
|
219
|
-
/>
|
|
220
|
-
</div>
|
|
221
|
-
|
|
222
|
-
{/* Date and Time */}
|
|
223
|
-
<div className="grid grid-cols-3 gap-4">
|
|
224
|
-
<div className="space-y-2">
|
|
225
|
-
<Label htmlFor="date">Date *</Label>
|
|
226
|
-
<Input
|
|
227
|
-
id="date"
|
|
228
|
-
type="date"
|
|
229
|
-
value={formData.date}
|
|
230
|
-
onChange={(e) => setFormData(prev => ({ ...prev, date: e.target.value }))}
|
|
231
|
-
className={cn(errors.date && "border-red-500")}
|
|
232
|
-
/>
|
|
233
|
-
{errors.date && <p className="text-sm text-red-500">{errors.date}</p>}
|
|
234
|
-
</div>
|
|
235
|
-
|
|
236
|
-
<div className="space-y-2">
|
|
237
|
-
<Label htmlFor="startTime">Start Time</Label>
|
|
238
|
-
<Input
|
|
239
|
-
id="startTime"
|
|
240
|
-
type="time"
|
|
241
|
-
value={formData.startTime}
|
|
242
|
-
onChange={(e) => setFormData(prev => ({ ...prev, startTime: e.target.value }))}
|
|
243
|
-
placeholder="09:00"
|
|
244
|
-
/>
|
|
245
|
-
</div>
|
|
246
|
-
|
|
247
|
-
<div className="space-y-2">
|
|
248
|
-
<Label htmlFor="endTime">End Time</Label>
|
|
249
|
-
<Input
|
|
250
|
-
id="endTime"
|
|
251
|
-
type="time"
|
|
252
|
-
value={formData.endTime}
|
|
253
|
-
onChange={(e) => setFormData(prev => ({ ...prev, endTime: e.target.value }))}
|
|
254
|
-
placeholder="10:00"
|
|
255
|
-
className={cn(errors.endTime && "border-red-500")}
|
|
256
|
-
/>
|
|
257
|
-
{errors.endTime && <p className="text-sm text-red-500">{errors.endTime}</p>}
|
|
258
|
-
</div>
|
|
259
|
-
</div>
|
|
260
|
-
|
|
261
|
-
{/* Location */}
|
|
262
|
-
<div className="space-y-2">
|
|
263
|
-
<Label htmlFor="location" className="flex items-center gap-2">
|
|
264
|
-
<MapPin className="w-4 h-4" />
|
|
265
|
-
Location
|
|
266
|
-
</Label>
|
|
267
|
-
<Input
|
|
268
|
-
id="location"
|
|
269
|
-
value={formData.location}
|
|
270
|
-
onChange={(e) => setFormData(prev => ({ ...prev, location: e.target.value }))}
|
|
271
|
-
placeholder="Meeting room, address, or link"
|
|
272
|
-
/>
|
|
273
|
-
</div>
|
|
274
|
-
|
|
275
|
-
{/* Type and Color */}
|
|
276
|
-
<div className="grid grid-cols-2 gap-4">
|
|
277
|
-
<div className="space-y-2">
|
|
278
|
-
<Label className="flex items-center gap-2">
|
|
279
|
-
<Type className="w-4 h-4" />
|
|
280
|
-
Type
|
|
281
|
-
</Label>
|
|
282
|
-
<Select value={formData.type} onValueChange={handleTypeChange}>
|
|
283
|
-
<SelectTrigger>
|
|
284
|
-
<SelectValue />
|
|
285
|
-
</SelectTrigger>
|
|
286
|
-
<SelectContent>
|
|
287
|
-
{EVENT_TYPES.map((type) => (
|
|
288
|
-
<SelectItem key={type.value} value={type.value}>
|
|
289
|
-
<div className="flex items-center gap-2">
|
|
290
|
-
<div
|
|
291
|
-
className="w-3 h-3 rounded-full"
|
|
292
|
-
style={{ backgroundColor: type.color }}
|
|
293
|
-
/>
|
|
294
|
-
{type.label}
|
|
295
|
-
</div>
|
|
296
|
-
</SelectItem>
|
|
297
|
-
))}
|
|
298
|
-
</SelectContent>
|
|
299
|
-
</Select>
|
|
300
|
-
</div>
|
|
301
|
-
|
|
302
|
-
<div className="space-y-2">
|
|
303
|
-
<Label className="flex items-center gap-2">
|
|
304
|
-
<Palette className="w-4 h-4" />
|
|
305
|
-
Color
|
|
306
|
-
</Label>
|
|
307
|
-
<div className="space-y-2">
|
|
308
|
-
<div className="flex items-center gap-2">
|
|
309
|
-
<input
|
|
310
|
-
type="color"
|
|
311
|
-
value={formData.color}
|
|
312
|
-
onChange={(e) => setFormData(prev => ({ ...prev, color: e.target.value }))}
|
|
313
|
-
className="w-8 h-8 rounded border cursor-pointer flex-shrink-0"
|
|
314
|
-
/>
|
|
315
|
-
<span className="text-sm text-muted-foreground">Custom color</span>
|
|
316
|
-
</div>
|
|
317
|
-
<div className="grid grid-cols-8 gap-1">
|
|
318
|
-
{PRESET_COLORS.map((color) => (
|
|
319
|
-
<button
|
|
320
|
-
key={color}
|
|
321
|
-
type="button"
|
|
322
|
-
onClick={() => setFormData(prev => ({ ...prev, color }))}
|
|
323
|
-
className={cn(
|
|
324
|
-
"w-full aspect-square rounded border-2 hover:scale-110 transition-transform",
|
|
325
|
-
formData.color === color ? "border-foreground shadow-sm" : "border-transparent"
|
|
326
|
-
)}
|
|
327
|
-
style={{ backgroundColor: color }}
|
|
328
|
-
aria-label={`Select color ${color}`}
|
|
329
|
-
/>
|
|
330
|
-
))}
|
|
331
|
-
</div>
|
|
332
|
-
</div>
|
|
333
|
-
</div>
|
|
334
|
-
</div>
|
|
335
|
-
|
|
336
|
-
{/* Attendees */}
|
|
337
|
-
<div className="space-y-2">
|
|
338
|
-
<Label htmlFor="attendees">Attendees</Label>
|
|
339
|
-
<Input
|
|
340
|
-
id="attendees"
|
|
341
|
-
value={formData.attendees}
|
|
342
|
-
onChange={(e) => setFormData(prev => ({ ...prev, attendees: e.target.value }))}
|
|
343
|
-
placeholder="John Doe, Jane Smith (comma-separated)"
|
|
344
|
-
/>
|
|
345
|
-
</div>
|
|
346
|
-
|
|
347
|
-
<DialogFooter className="gap-2">
|
|
348
|
-
{mode === 'edit' && onDelete && (
|
|
349
|
-
<Button
|
|
350
|
-
type="button"
|
|
351
|
-
variant="destructive"
|
|
352
|
-
onClick={handleDelete}
|
|
353
|
-
className="mr-auto"
|
|
354
|
-
>
|
|
355
|
-
Delete Event
|
|
356
|
-
</Button>
|
|
357
|
-
)}
|
|
358
|
-
<Button
|
|
359
|
-
type="button"
|
|
360
|
-
variant="outline"
|
|
361
|
-
onClick={() => onOpenChange(false)}
|
|
362
|
-
disabled={isSubmitting}
|
|
363
|
-
>
|
|
364
|
-
Cancel
|
|
365
|
-
</Button>
|
|
366
|
-
<Button type="submit" disabled={isSubmitting}>
|
|
367
|
-
{isSubmitting
|
|
368
|
-
? (mode === 'create' ? 'Creating...' : 'Saving...')
|
|
369
|
-
: (mode === 'create' ? 'Create Event' : 'Save Changes')
|
|
370
|
-
}
|
|
371
|
-
</Button>
|
|
372
|
-
</DialogFooter>
|
|
373
|
-
</form>
|
|
374
|
-
</DialogContent>
|
|
375
|
-
</Dialog>
|
|
376
|
-
)
|
|
377
|
-
}
|