calendarkit-pro 1.1.0 → 1.2.1
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/README.md +0 -1
- package/dist/index.d.mts +75 -44
- package/dist/index.d.ts +75 -44
- package/dist/index.js +765 -508
- package/dist/index.mjs +709 -437
- package/package.json +29 -6
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
import React15__default, { useState, useId, useMemo, useCallback, useEffect, useRef } from 'react';
|
|
3
|
-
import { useDraggable, useSensors, useSensor, PointerSensor, DndContext, DragOverlay, useDroppable } from '@dnd-kit/core';
|
|
4
|
-
import { createSnapModifier, restrictToWindowEdges } from '@dnd-kit/modifiers';
|
|
5
|
-
import { motion, AnimatePresence } from 'framer-motion';
|
|
6
|
-
import { format, differenceInMinutes, subDays, addDays, differenceInMilliseconds, startOfWeek, endOfWeek, eachDayOfInterval, isSameMonth, isToday, isSameDay, startOfDay, addWeeks, addMonths, subWeeks, subMonths, startOfMonth, endOfMonth, isTomorrow } from 'date-fns';
|
|
7
|
-
import { cva } from 'class-variance-authority';
|
|
8
|
-
import { clsx } from 'clsx';
|
|
9
|
-
import { twMerge } from 'tailwind-merge';
|
|
10
|
-
import { Menu, ChevronLeft, ChevronRight, Sun, Moon, CalendarDays, CalendarRange, Calendar, ListTodo, Plus, ChevronDown, Globe, Clock, Users, Paperclip, Bell, Edit3, Copy, Trash2, X, Edit2, MapPin, ExternalLink, AlignLeft, File, Download, BellRing, Check, Repeat, Tag } from 'lucide-react';
|
|
11
|
-
import { toZonedTime, fromZonedTime } from 'date-fns-tz';
|
|
12
|
-
import { CSS } from '@dnd-kit/utilities';
|
|
13
|
-
import { RRule } from 'rrule';
|
|
1
|
+
"use client";
|
|
14
2
|
|
|
3
|
+
// src/index.tsx
|
|
4
|
+
import React18, { useId, useState as useState6, useMemo as useMemo4 } from "react";
|
|
5
|
+
import { DndContext, useSensor, useSensors, PointerSensor, DragOverlay } from "@dnd-kit/core";
|
|
6
|
+
import { createSnapModifier, restrictToWindowEdges } from "@dnd-kit/modifiers";
|
|
7
|
+
import { AnimatePresence as AnimatePresence3, motion as motion4 } from "framer-motion";
|
|
8
|
+
|
|
9
|
+
// src/components/CalendarHeader.tsx
|
|
10
|
+
import React2 from "react";
|
|
11
|
+
import { format } from "date-fns";
|
|
12
|
+
|
|
13
|
+
// src/components/ui/button.tsx
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
|
|
17
|
+
// src/utils.ts
|
|
18
|
+
import { clsx } from "clsx";
|
|
19
|
+
import { twMerge } from "tailwind-merge";
|
|
15
20
|
function cn(...inputs) {
|
|
16
21
|
return twMerge(clsx(inputs));
|
|
17
22
|
}
|
|
23
|
+
var isEventDragDisabled = (event) => event?.draggable === false;
|
|
24
|
+
var isEventResizeDisabled = (event) => event?.resizable === false || event?.resizable === void 0 && isEventDragDisabled(event);
|
|
18
25
|
|
|
19
26
|
// src/components/ui/button.tsx
|
|
20
27
|
var buttonVariants = cva(
|
|
@@ -42,10 +49,10 @@ var buttonVariants = cva(
|
|
|
42
49
|
}
|
|
43
50
|
}
|
|
44
51
|
);
|
|
45
|
-
var Button =
|
|
46
|
-
({ className, variant, size,
|
|
52
|
+
var Button = React.forwardRef(
|
|
53
|
+
({ className, variant, size, ...props }, ref) => {
|
|
47
54
|
const Comp = "button";
|
|
48
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ React.createElement(
|
|
49
56
|
Comp,
|
|
50
57
|
{
|
|
51
58
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -56,6 +63,9 @@ var Button = React15.forwardRef(
|
|
|
56
63
|
}
|
|
57
64
|
);
|
|
58
65
|
Button.displayName = "Button";
|
|
66
|
+
|
|
67
|
+
// src/components/CalendarHeader.tsx
|
|
68
|
+
import { ChevronLeft, ChevronRight, Menu, Moon, Sun, CalendarDays, CalendarRange, Calendar, ListTodo } from "lucide-react";
|
|
59
69
|
var CalendarHeader = ({
|
|
60
70
|
currentDate,
|
|
61
71
|
onPrev,
|
|
@@ -78,7 +88,7 @@ var CalendarHeader = ({
|
|
|
78
88
|
{ key: "day", icon: Calendar },
|
|
79
89
|
{ key: "agenda", icon: ListTodo }
|
|
80
90
|
];
|
|
81
|
-
return /* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ React2.createElement("div", { className: "flex flex-col md:flex-row items-center justify-between px-3 md:px-5 py-3 border-b-[0px] border-border/50 bg-gradient-to-r from-background via-background to-muted/20 gap-3 md:gap-0 min-h-[64px]" }, /* @__PURE__ */ React2.createElement("div", { className: "flex items-center gap-2 w-full md:w-auto justify-between md:justify-start" }, /* @__PURE__ */ React2.createElement("div", { className: "flex items-center gap-2 md:gap-3" }, /* @__PURE__ */ React2.createElement(
|
|
82
92
|
Button,
|
|
83
93
|
{
|
|
84
94
|
variant: "ghost",
|
|
@@ -86,8 +96,8 @@ var CalendarHeader = ({
|
|
|
86
96
|
className: "text-muted-foreground hover:text-foreground hover:bg-accent/80 rounded-xl h-10 w-10 hidden md:inline-flex transition-all duration-200",
|
|
87
97
|
onClick: onMenuClick
|
|
88
98
|
},
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
), /* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ React2.createElement(Menu, { className: "h-5 w-5" })
|
|
100
|
+
), /* @__PURE__ */ React2.createElement(
|
|
91
101
|
Button,
|
|
92
102
|
{
|
|
93
103
|
variant: "outline",
|
|
@@ -95,7 +105,7 @@ var CalendarHeader = ({
|
|
|
95
105
|
className: "h-9 px-5 rounded-xl text-sm font-medium hidden sm:inline-flex border-[0.5px] border-border/60 hover:border-primary/40 hover:bg-primary/5 hover:text-primary transition-all duration-200"
|
|
96
106
|
},
|
|
97
107
|
translations.today
|
|
98
|
-
), /* @__PURE__ */
|
|
108
|
+
), /* @__PURE__ */ React2.createElement("div", { className: "flex items-center bg-muted/40 rounded-xl p-0.5" }, /* @__PURE__ */ React2.createElement(
|
|
99
109
|
Button,
|
|
100
110
|
{
|
|
101
111
|
variant: "ghost",
|
|
@@ -103,8 +113,8 @@ var CalendarHeader = ({
|
|
|
103
113
|
onClick: onPrev,
|
|
104
114
|
className: "rounded-lg h-8 w-8 hover:bg-background/80 transition-all duration-200"
|
|
105
115
|
},
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
), /* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ React2.createElement(ChevronLeft, { className: "h-4 w-4 text-muted-foreground" })
|
|
117
|
+
), /* @__PURE__ */ React2.createElement(
|
|
108
118
|
Button,
|
|
109
119
|
{
|
|
110
120
|
variant: "ghost",
|
|
@@ -112,8 +122,8 @@ var CalendarHeader = ({
|
|
|
112
122
|
onClick: onNext,
|
|
113
123
|
className: "rounded-lg h-8 w-8 hover:bg-background/80 transition-all duration-200"
|
|
114
124
|
},
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
)), /* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ React2.createElement(ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
|
|
126
|
+
)), /* @__PURE__ */ React2.createElement("div", { className: "ml-2 md:ml-4" }, /* @__PURE__ */ React2.createElement("h2", { className: "text-lg md:text-xl font-semibold text-foreground whitespace-nowrap capitalize tracking-tight" }, format(currentDate, "MMMM yyyy", { locale }))))), /* @__PURE__ */ React2.createElement("div", { className: "flex items-center gap-2 md:gap-3 w-full md:w-auto justify-end" }, onLanguageChange && language && /* @__PURE__ */ React2.createElement(
|
|
117
127
|
Button,
|
|
118
128
|
{
|
|
119
129
|
variant: "ghost",
|
|
@@ -122,7 +132,7 @@ var CalendarHeader = ({
|
|
|
122
132
|
className: "h-9 px-3 rounded-xl text-xs font-semibold text-muted-foreground hover:text-foreground hover:bg-accent/80 transition-all duration-200 uppercase tracking-wider"
|
|
123
133
|
},
|
|
124
134
|
language
|
|
125
|
-
), onThemeToggle && /* @__PURE__ */
|
|
135
|
+
), onThemeToggle && /* @__PURE__ */ React2.createElement(
|
|
126
136
|
Button,
|
|
127
137
|
{
|
|
128
138
|
variant: "ghost",
|
|
@@ -130,8 +140,8 @@ var CalendarHeader = ({
|
|
|
130
140
|
className: "rounded-xl h-9 w-9 hover:bg-accent/80 transition-all duration-200",
|
|
131
141
|
onClick: onThemeToggle
|
|
132
142
|
},
|
|
133
|
-
isDarkMode ? /* @__PURE__ */
|
|
134
|
-
), !hideViewSwitcher && /* @__PURE__ */
|
|
143
|
+
isDarkMode ? /* @__PURE__ */ React2.createElement(Sun, { className: "h-4 w-4 text-amber-500" }) : /* @__PURE__ */ React2.createElement(Moon, { className: "h-4 w-4 text-muted-foreground" })
|
|
144
|
+
), !hideViewSwitcher && /* @__PURE__ */ React2.createElement("div", { className: "flex items-center bg-muted/50 backdrop-blur-sm rounded-xl p-1" }, viewConfig.map(({ key, icon: Icon }) => /* @__PURE__ */ React2.createElement(
|
|
135
145
|
Button,
|
|
136
146
|
{
|
|
137
147
|
key,
|
|
@@ -143,32 +153,55 @@ var CalendarHeader = ({
|
|
|
143
153
|
view === key ? "bg-background shadow-sm text-foreground font-medium border-[0.5px] border-border/50" : "text-muted-foreground hover:text-foreground hover:bg-background/50"
|
|
144
154
|
)
|
|
145
155
|
},
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ React2.createElement(Icon, { className: "h-3.5 w-3.5" }),
|
|
157
|
+
/* @__PURE__ */ React2.createElement("span", { className: "hidden sm:inline" }, translations[key])
|
|
148
158
|
)))));
|
|
149
159
|
};
|
|
160
|
+
|
|
161
|
+
// src/components/Sidebar.tsx
|
|
162
|
+
import React4, { useState, useEffect } from "react";
|
|
163
|
+
import { Plus, ChevronDown, Globe } from "lucide-react";
|
|
164
|
+
|
|
165
|
+
// src/components/MiniCalendar.tsx
|
|
166
|
+
import React3 from "react";
|
|
167
|
+
import { format as format3, isSameMonth, isSameDay, isToday, addMonths, subMonths } from "date-fns";
|
|
168
|
+
|
|
169
|
+
// src/lib/date.ts
|
|
170
|
+
import { startOfMonth, endOfMonth, startOfWeek, endOfWeek, eachDayOfInterval, format as format2 } from "date-fns";
|
|
150
171
|
var getMonthGrid = (date, weekStartOn = 0) => {
|
|
151
172
|
const monthStart = startOfMonth(date);
|
|
152
|
-
const monthEnd = endOfMonth(monthStart);
|
|
153
|
-
const startDate = startOfWeek(monthStart, { weekStartsOn: weekStartOn });
|
|
154
|
-
const endDate = endOfWeek(monthEnd, { weekStartsOn: weekStartOn });
|
|
155
173
|
return eachDayOfInterval({
|
|
156
|
-
start:
|
|
157
|
-
end:
|
|
174
|
+
start: startOfWeek(monthStart, { weekStartsOn: weekStartOn }),
|
|
175
|
+
end: endOfWeek(endOfMonth(monthStart), { weekStartsOn: weekStartOn })
|
|
158
176
|
});
|
|
159
177
|
};
|
|
178
|
+
var uses24HourClock = (locale) => {
|
|
179
|
+
if (!locale) return false;
|
|
180
|
+
return !/[ap]\.?m/i.test(format2(new Date(2e3, 0, 1, 13, 0), "p", { locale }));
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// src/components/MiniCalendar.tsx
|
|
184
|
+
import { ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
160
185
|
var MiniCalendar = ({
|
|
161
186
|
currentDate,
|
|
162
187
|
onDateChange,
|
|
163
188
|
onViewChange,
|
|
164
|
-
className
|
|
189
|
+
className,
|
|
190
|
+
locale
|
|
165
191
|
}) => {
|
|
166
|
-
const [viewDate, setViewDate] =
|
|
167
|
-
|
|
192
|
+
const [viewDate, setViewDate] = React3.useState(currentDate);
|
|
193
|
+
React3.useEffect(() => {
|
|
168
194
|
setViewDate(currentDate);
|
|
169
195
|
}, [currentDate]);
|
|
170
|
-
const
|
|
171
|
-
const
|
|
196
|
+
const weekStartsOn = locale?.options?.weekStartsOn ?? 0;
|
|
197
|
+
const days = React3.useMemo(
|
|
198
|
+
() => getMonthGrid(viewDate, weekStartsOn),
|
|
199
|
+
[viewDate, weekStartsOn]
|
|
200
|
+
);
|
|
201
|
+
const weekDays = locale?.localize ? [0, 1, 2, 3, 4, 5, 6].map((d) => {
|
|
202
|
+
const dayIndex = (d + weekStartsOn) % 7;
|
|
203
|
+
return locale.localize.day(dayIndex, { width: "narrow" });
|
|
204
|
+
}) : ["S", "M", "T", "W", "T", "F", "S"];
|
|
172
205
|
const handlePrev = () => {
|
|
173
206
|
const newDate = subMonths(viewDate, 1);
|
|
174
207
|
setViewDate(newDate);
|
|
@@ -185,7 +218,7 @@ var MiniCalendar = ({
|
|
|
185
218
|
onDateChange(day);
|
|
186
219
|
if (onViewChange) onViewChange("day");
|
|
187
220
|
};
|
|
188
|
-
return /* @__PURE__ */
|
|
221
|
+
return /* @__PURE__ */ React3.createElement("div", { className: cn("px-4 w-[260px]", className) }, /* @__PURE__ */ React3.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React3.createElement("span", { className: "text-sm font-semibold text-foreground capitalize" }, format3(viewDate, "MMMM yyyy", { locale })), /* @__PURE__ */ React3.createElement("div", { className: "flex items-center bg-muted/40 rounded-lg p-0.5" }, /* @__PURE__ */ React3.createElement(
|
|
189
222
|
Button,
|
|
190
223
|
{
|
|
191
224
|
variant: "ghost",
|
|
@@ -194,8 +227,8 @@ var MiniCalendar = ({
|
|
|
194
227
|
onClick: handlePrev,
|
|
195
228
|
"aria-label": "Previous month"
|
|
196
229
|
},
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
), /* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ React3.createElement(ChevronLeft2, { className: "h-4 w-4" })
|
|
231
|
+
), /* @__PURE__ */ React3.createElement(
|
|
199
232
|
Button,
|
|
200
233
|
{
|
|
201
234
|
variant: "ghost",
|
|
@@ -204,12 +237,12 @@ var MiniCalendar = ({
|
|
|
204
237
|
onClick: handleNext,
|
|
205
238
|
"aria-label": "Next month"
|
|
206
239
|
},
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
))), /* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ React3.createElement(ChevronRight2, { className: "h-4 w-4" })
|
|
241
|
+
))), /* @__PURE__ */ React3.createElement("div", { className: "grid grid-cols-7 gap-y-2 text-center mb-2" }, weekDays.map((day, i) => /* @__PURE__ */ React3.createElement("div", { key: `${day}-${i}`, className: "text-[10px] text-muted-foreground/70 font-semibold uppercase" }, day))), /* @__PURE__ */ React3.createElement("div", { className: "grid grid-cols-7 gap-y-1 text-center" }, days.map((day) => {
|
|
209
242
|
const isSelected = isSameDay(day, currentDate);
|
|
210
243
|
const isCurrentMonth = isSameMonth(day, viewDate);
|
|
211
244
|
const isTodayDate = isToday(day);
|
|
212
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ React3.createElement(
|
|
213
246
|
"button",
|
|
214
247
|
{
|
|
215
248
|
key: day.toISOString(),
|
|
@@ -222,10 +255,14 @@ var MiniCalendar = ({
|
|
|
222
255
|
!isSelected && isTodayDate && "bg-primary/10 text-primary ring-1 ring-primary/30"
|
|
223
256
|
)
|
|
224
257
|
},
|
|
225
|
-
|
|
258
|
+
format3(day, "d")
|
|
226
259
|
);
|
|
227
260
|
})));
|
|
228
261
|
};
|
|
262
|
+
|
|
263
|
+
// src/components/Sidebar.tsx
|
|
264
|
+
import { toZonedTime } from "date-fns-tz";
|
|
265
|
+
import { format as format4 } from "date-fns";
|
|
229
266
|
var Sidebar = ({
|
|
230
267
|
currentDate,
|
|
231
268
|
onDateChange,
|
|
@@ -237,7 +274,8 @@ var Sidebar = ({
|
|
|
237
274
|
readOnly,
|
|
238
275
|
calendars,
|
|
239
276
|
onCalendarToggle,
|
|
240
|
-
translations
|
|
277
|
+
translations,
|
|
278
|
+
locale
|
|
241
279
|
}) => {
|
|
242
280
|
const [calendarsOpen, setCalendarsOpen] = useState(true);
|
|
243
281
|
const [timezoneOpen, setTimezoneOpen] = useState(false);
|
|
@@ -259,12 +297,12 @@ var Sidebar = ({
|
|
|
259
297
|
if (!tz || !now) return "LOC";
|
|
260
298
|
try {
|
|
261
299
|
return new Intl.DateTimeFormat("en-US", { timeZone: tz, timeZoneName: "short" }).formatToParts(now).find((part) => part.type === "timeZoneName")?.value || "";
|
|
262
|
-
} catch
|
|
300
|
+
} catch {
|
|
263
301
|
return "";
|
|
264
302
|
}
|
|
265
303
|
};
|
|
266
304
|
const timezones = [
|
|
267
|
-
{ value: "", label: "Local Time", acronym: "LOC" },
|
|
305
|
+
{ value: "", label: translations?.localTime || "Local Time", acronym: "LOC" },
|
|
268
306
|
{ value: "UTC", label: "UTC", acronym: "UTC" },
|
|
269
307
|
{ value: "America/New_York", label: "New York", acronym: "EST" },
|
|
270
308
|
{ value: "America/Chicago", label: "Chicago", acronym: "CST" },
|
|
@@ -280,56 +318,56 @@ var Sidebar = ({
|
|
|
280
318
|
];
|
|
281
319
|
const formatTzLabel = (tz, showTime = true) => {
|
|
282
320
|
if (!hasMounted || !now || !showTime) {
|
|
283
|
-
return /* @__PURE__ */
|
|
321
|
+
return /* @__PURE__ */ React4.createElement("span", null, tz.label);
|
|
284
322
|
}
|
|
285
323
|
let time = "";
|
|
286
324
|
let acronym = tz.acronym;
|
|
287
325
|
try {
|
|
288
326
|
if (!tz.value) {
|
|
289
|
-
time =
|
|
327
|
+
time = format4(now, "HH:mm");
|
|
290
328
|
try {
|
|
291
329
|
acronym = new Intl.DateTimeFormat("en-US", { timeZoneName: "short" }).formatToParts(now).find((part) => part.type === "timeZoneName")?.value || "LOC";
|
|
292
|
-
} catch
|
|
330
|
+
} catch {
|
|
293
331
|
}
|
|
294
332
|
} else {
|
|
295
333
|
const zDate = toZonedTime(now, tz.value);
|
|
296
|
-
time =
|
|
334
|
+
time = format4(zDate, "HH:mm");
|
|
297
335
|
const dynAcronym = getAcronym(tz.value);
|
|
298
336
|
if (dynAcronym && !dynAcronym.includes("GMT") && !dynAcronym.includes("Time")) {
|
|
299
337
|
acronym = dynAcronym;
|
|
300
338
|
}
|
|
301
339
|
}
|
|
302
|
-
} catch
|
|
303
|
-
return /* @__PURE__ */
|
|
340
|
+
} catch {
|
|
341
|
+
return /* @__PURE__ */ React4.createElement("span", null, tz.label);
|
|
304
342
|
}
|
|
305
|
-
return /* @__PURE__ */
|
|
343
|
+
return /* @__PURE__ */ React4.createElement("div", { className: "flex justify-between w-full" }, /* @__PURE__ */ React4.createElement("span", null, tz.label), /* @__PURE__ */ React4.createElement("span", { className: "text-muted-foreground ml-2 tabular-nums" }, time, " ", /* @__PURE__ */ React4.createElement("span", { className: "text-xs opacity-75" }, "(", acronym, ")")));
|
|
306
344
|
};
|
|
307
345
|
const selectedTzObj = timezones.find((t) => t.value === (timezone || ""));
|
|
308
346
|
const selectedTimezoneLabel = selectedTzObj ? formatTzLabel(selectedTzObj) : translations?.localTime || "Local Time";
|
|
309
|
-
return /* @__PURE__ */
|
|
347
|
+
return /* @__PURE__ */ React4.createElement("div", { className: cn("flex flex-col w-[260px] overflow-x-hidden h-full bg-gradient-to-b scrollbar-hide from-background via-background to-muted/10 pt-4 pb-4 overflow-y-auto hidden lg:flex", className) }, !readOnly && /* @__PURE__ */ React4.createElement("div", { className: "px-4 mb-6" }, /* @__PURE__ */ React4.createElement(
|
|
310
348
|
Button,
|
|
311
349
|
{
|
|
312
350
|
className: "w-full rounded-2xl shadow-lg bg-primary text-primary-foreground hover:bg-primary/90 h-12 gap-3 justify-center transition-all duration-300 hover:shadow-xl hover:shadow-primary/20 hover:scale-[1.02] active:scale-[0.98] font-semibold",
|
|
313
351
|
onClick: onEventCreate
|
|
314
352
|
},
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
)), /* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ React4.createElement(Plus, { className: "w-5 h-5" }),
|
|
354
|
+
/* @__PURE__ */ React4.createElement("span", { className: "text-sm" }, translations?.create || "Create")
|
|
355
|
+
)), /* @__PURE__ */ React4.createElement(MiniCalendar, { currentDate, onDateChange, onViewChange, locale }), /* @__PURE__ */ React4.createElement("div", { className: "flex-1 px-4 space-y-5 mt-5" }, /* @__PURE__ */ React4.createElement("div", { className: "bg-muted/20 rounded-2xl p-3 border-[0px] border-border/30" }, /* @__PURE__ */ React4.createElement(
|
|
318
356
|
"div",
|
|
319
357
|
{
|
|
320
358
|
className: "flex items-center justify-between cursor-pointer hover:bg-accent/50 p-2 -m-1 rounded-xl mb-2 transition-all duration-200",
|
|
321
359
|
onClick: () => setCalendarsOpen(!calendarsOpen)
|
|
322
360
|
},
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
), calendarsOpen && /* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ React4.createElement("span", { className: "text-sm font-semibold text-foreground" }, translations?.calendars || "Calendars"),
|
|
362
|
+
/* @__PURE__ */ React4.createElement(ChevronDown, { className: cn("w-4 h-4 text-muted-foreground transition-transform duration-200", calendarsOpen && "rotate-180") })
|
|
363
|
+
), calendarsOpen && /* @__PURE__ */ React4.createElement("div", { className: "space-y-1" }, displayCalendars.map((cal) => /* @__PURE__ */ React4.createElement(
|
|
326
364
|
"div",
|
|
327
365
|
{
|
|
328
366
|
key: cal.id,
|
|
329
367
|
className: "flex items-center gap-3 py-2 px-2 hover:bg-accent/60 rounded-xl cursor-pointer group transition-all duration-200",
|
|
330
368
|
onClick: () => onCalendarToggle?.(cal.id, !(cal.active ?? true))
|
|
331
369
|
},
|
|
332
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ React4.createElement("div", { className: "relative flex items-center justify-center" }, /* @__PURE__ */ React4.createElement(
|
|
333
371
|
"input",
|
|
334
372
|
{
|
|
335
373
|
type: "checkbox",
|
|
@@ -342,7 +380,7 @@ var Sidebar = ({
|
|
|
342
380
|
style: { "--primary-color": cal.color },
|
|
343
381
|
"data-cal-id": cal.id
|
|
344
382
|
}
|
|
345
|
-
), /* @__PURE__ */
|
|
383
|
+
), /* @__PURE__ */ React4.createElement("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none opacity-0 peer-checked:opacity-100 transition-opacity" }, /* @__PURE__ */ React4.createElement("svg", { className: "w-3.5 h-3.5 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3 }, /* @__PURE__ */ React4.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }))), /* @__PURE__ */ React4.createElement("style", null, `
|
|
346
384
|
input[type="checkbox"][data-cal-id="${cal.id}"]:checked {
|
|
347
385
|
background-color: ${cal.color} !important;
|
|
348
386
|
border-color: ${cal.color} !important;
|
|
@@ -351,23 +389,23 @@ var Sidebar = ({
|
|
|
351
389
|
--tw-ring-color: ${cal.color}40 !important;
|
|
352
390
|
}
|
|
353
391
|
`)),
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ React4.createElement("div", { className: "flex items-center gap-2 flex-1 min-w-0" }, /* @__PURE__ */ React4.createElement("span", { className: "text-sm text-foreground/90 truncate font-medium" }, cal.label)),
|
|
393
|
+
/* @__PURE__ */ React4.createElement(
|
|
356
394
|
"div",
|
|
357
395
|
{
|
|
358
396
|
className: "w-2 h-2 rounded-full opacity-60 group-hover:opacity-100 transition-opacity",
|
|
359
397
|
style: { backgroundColor: cal.color }
|
|
360
398
|
}
|
|
361
399
|
)
|
|
362
|
-
))))), /* @__PURE__ */
|
|
400
|
+
))))), /* @__PURE__ */ React4.createElement("div", { className: "mt-auto px-4 pt-5" }, /* @__PURE__ */ React4.createElement("div", { className: "bg-muted/20 rounded-2xl p-3" }, /* @__PURE__ */ React4.createElement("div", { className: "flex items-center gap-2 mb-3" }, /* @__PURE__ */ React4.createElement("div", { className: "p-1.5 bg-primary/10 rounded-lg" }, /* @__PURE__ */ React4.createElement(Globe, { className: "w-4 h-4 text-primary" })), /* @__PURE__ */ React4.createElement("span", { className: "text-sm font-semibold text-foreground" }, translations?.timezone || "Timezone")), /* @__PURE__ */ React4.createElement("div", { className: "relative" }, /* @__PURE__ */ React4.createElement(
|
|
363
401
|
"button",
|
|
364
402
|
{
|
|
365
403
|
onClick: () => setTimezoneOpen(!timezoneOpen),
|
|
366
404
|
className: "w-full flex items-center justify-between bg-blue-200/40 hover:bg-blue-200/80 rounded-xl py-2.5 pl-4 pr-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary/50 transition-all duration-200 text-left"
|
|
367
405
|
},
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
), timezoneOpen && /* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ React4.createElement("div", { className: "flex-1 truncate mr-2 font-medium" }, selectedTimezoneLabel),
|
|
407
|
+
/* @__PURE__ */ React4.createElement(ChevronDown, { className: cn("w-4 h-4 text-muted-foreground transition-transform duration-200", timezoneOpen && "rotate-180") })
|
|
408
|
+
), timezoneOpen && /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setTimezoneOpen(false) }), /* @__PURE__ */ React4.createElement("div", { className: "absolute bottom-full left-0 w-full mb-2 bg-background rounded-xl shadow-2xl z-50 max-h-[260px] overflow-y-auto p-1.5 animate-in fade-in zoom-in-95 duration-200 backdrop-blur-none" }, timezones.map((tz) => /* @__PURE__ */ React4.createElement(
|
|
371
409
|
"div",
|
|
372
410
|
{
|
|
373
411
|
key: tz.value,
|
|
@@ -383,10 +421,22 @@ var Sidebar = ({
|
|
|
383
421
|
formatTzLabel(tz)
|
|
384
422
|
))))))));
|
|
385
423
|
};
|
|
424
|
+
|
|
425
|
+
// src/views/MonthView.tsx
|
|
426
|
+
import React7, { useMemo, useCallback } from "react";
|
|
427
|
+
import { format as format5, isSameMonth as isSameMonth2, isToday as isToday2, startOfWeek as startOfWeek2, endOfWeek as endOfWeek2, eachDayOfInterval as eachDayOfInterval2 } from "date-fns";
|
|
428
|
+
import { toZonedTime as toZonedTime2 } from "date-fns-tz";
|
|
429
|
+
|
|
430
|
+
// src/components/dnd/DraggableEvent.tsx
|
|
431
|
+
import React5 from "react";
|
|
432
|
+
import { useDraggable } from "@dnd-kit/core";
|
|
433
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
386
434
|
var DraggableEvent = ({ event, children, className, style: propStyle, ...props }) => {
|
|
435
|
+
const dragDisabled = isEventDragDisabled(event);
|
|
387
436
|
const { attributes, listeners, setNodeRef, transform, isDragging } = useDraggable({
|
|
388
437
|
id: event.id,
|
|
389
|
-
data: { event }
|
|
438
|
+
data: { event },
|
|
439
|
+
disabled: dragDisabled
|
|
390
440
|
});
|
|
391
441
|
const style = {
|
|
392
442
|
...propStyle,
|
|
@@ -400,7 +450,7 @@ var DraggableEvent = ({ event, children, className, style: propStyle, ...props }
|
|
|
400
450
|
opacity: isDragging ? 0 : propStyle?.opacity
|
|
401
451
|
// Hiding original element completely
|
|
402
452
|
};
|
|
403
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ React5.createElement(
|
|
404
454
|
"div",
|
|
405
455
|
{
|
|
406
456
|
ref: setNodeRef,
|
|
@@ -408,11 +458,15 @@ var DraggableEvent = ({ event, children, className, style: propStyle, ...props }
|
|
|
408
458
|
...listeners,
|
|
409
459
|
...attributes,
|
|
410
460
|
...props,
|
|
411
|
-
className: cn("touch-none", className)
|
|
461
|
+
className: cn(!dragDisabled && "touch-none", className)
|
|
412
462
|
},
|
|
413
463
|
children
|
|
414
464
|
);
|
|
415
465
|
};
|
|
466
|
+
|
|
467
|
+
// src/components/dnd/DroppableCell.tsx
|
|
468
|
+
import React6 from "react";
|
|
469
|
+
import { useDroppable } from "@dnd-kit/core";
|
|
416
470
|
var DroppableCell = ({ id, date, resourceId, children, className, style, onClick }) => {
|
|
417
471
|
const { isOver, setNodeRef } = useDroppable({
|
|
418
472
|
id,
|
|
@@ -421,7 +475,7 @@ var DroppableCell = ({ id, date, resourceId, children, className, style, onClick
|
|
|
421
475
|
const minutes = date.getMinutes();
|
|
422
476
|
const quarterClass = minutes === 0 ? "hover:bg-blue-50/50 dark:hover:bg-blue-900/10" : minutes === 15 ? "hover:bg-blue-50/80 dark:hover:bg-blue-900/20" : minutes === 30 ? "hover:bg-blue-100/50 dark:hover:bg-blue-900/30" : "hover:bg-blue-100/80 dark:hover:bg-blue-900/40";
|
|
423
477
|
const activeQuarterClass = minutes === 0 ? "bg-blue-50/50 dark:bg-blue-900/10 ring-2 ring-primary ring-inset" : minutes === 15 ? "bg-blue-50/80 dark:bg-blue-900/20 ring-2 ring-primary ring-inset" : minutes === 30 ? "bg-blue-100/50 dark:bg-blue-900/30 ring-2 ring-primary ring-inset" : "bg-blue-100/80 dark:bg-blue-900/40 ring-2 ring-primary ring-inset";
|
|
424
|
-
return /* @__PURE__ */
|
|
478
|
+
return /* @__PURE__ */ React6.createElement(
|
|
425
479
|
"div",
|
|
426
480
|
{
|
|
427
481
|
ref: setNodeRef,
|
|
@@ -438,7 +492,7 @@ var DroppableCell = ({ id, date, resourceId, children, className, style, onClick
|
|
|
438
492
|
};
|
|
439
493
|
|
|
440
494
|
// src/views/MonthView.tsx
|
|
441
|
-
var EventItem =
|
|
495
|
+
var EventItem = React7.memo(({ event, onEventClick }) => /* @__PURE__ */ React7.createElement(DraggableEvent, { event }, /* @__PURE__ */ React7.createElement(
|
|
442
496
|
"div",
|
|
443
497
|
{
|
|
444
498
|
className: cn(
|
|
@@ -456,7 +510,7 @@ var EventItem = React15__default.memo(({ event, onEventClick }) => /* @__PURE__
|
|
|
456
510
|
onEventClick?.(event);
|
|
457
511
|
}
|
|
458
512
|
},
|
|
459
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ React7.createElement("span", { className: "font-medium" }, event.title)
|
|
460
514
|
)));
|
|
461
515
|
EventItem.displayName = "EventItem";
|
|
462
516
|
var MonthView = ({
|
|
@@ -467,20 +521,24 @@ var MonthView = ({
|
|
|
467
521
|
timezone,
|
|
468
522
|
locale
|
|
469
523
|
}) => {
|
|
470
|
-
const
|
|
524
|
+
const weekStartsOn = locale?.options?.weekStartsOn ?? 1;
|
|
525
|
+
const days = useMemo(
|
|
526
|
+
() => getMonthGrid(currentDate, weekStartsOn),
|
|
527
|
+
[currentDate, weekStartsOn]
|
|
528
|
+
);
|
|
471
529
|
const weekDays = useMemo(() => {
|
|
472
|
-
const start =
|
|
473
|
-
const end =
|
|
474
|
-
return
|
|
475
|
-
}, [currentDate]);
|
|
530
|
+
const start = startOfWeek2(currentDate, { weekStartsOn });
|
|
531
|
+
const end = endOfWeek2(currentDate, { weekStartsOn });
|
|
532
|
+
return eachDayOfInterval2({ start, end });
|
|
533
|
+
}, [currentDate, weekStartsOn]);
|
|
476
534
|
const getZonedDate = useCallback((date) => {
|
|
477
|
-
return timezone ?
|
|
535
|
+
return timezone ? toZonedTime2(date, timezone) : date;
|
|
478
536
|
}, [timezone]);
|
|
479
537
|
const eventsByDay = useMemo(() => {
|
|
480
538
|
const map = /* @__PURE__ */ new Map();
|
|
481
539
|
events.forEach((event) => {
|
|
482
540
|
const zonedStart = getZonedDate(event.start);
|
|
483
|
-
const key =
|
|
541
|
+
const key = format5(zonedStart, "yyyy-MM-dd");
|
|
484
542
|
if (!map.has(key)) {
|
|
485
543
|
map.set(key, []);
|
|
486
544
|
}
|
|
@@ -488,19 +546,19 @@ var MonthView = ({
|
|
|
488
546
|
});
|
|
489
547
|
return map;
|
|
490
548
|
}, [events, getZonedDate]);
|
|
491
|
-
return /* @__PURE__ */
|
|
549
|
+
return /* @__PURE__ */ React7.createElement("div", { className: "flex flex-col h-full bg-background border-[0.5px] scrollbar-hide border-border/50 rounded-2xl overflow-hidden min-w-[800px] md:min-w-0 shadow-sm" }, /* @__PURE__ */ React7.createElement("div", { className: "overflow-y-auto flex-1 relative" }, /* @__PURE__ */ React7.createElement("div", { className: "grid grid-cols-7 border-b-[0.5px] border-border/50 bg-gradient-to-r from-muted/30 via-muted/40 to-muted/30 sticky top-0 z-20 backdrop-blur-sm" }, weekDays.map((day) => /* @__PURE__ */ React7.createElement(
|
|
492
550
|
"div",
|
|
493
551
|
{
|
|
494
552
|
key: day.toISOString(),
|
|
495
553
|
className: "py-3 text-center text-xs font-semibold text-muted-foreground border-r-[0.5px] border-border/30 last:border-r-0 uppercase tracking-wider"
|
|
496
554
|
},
|
|
497
|
-
|
|
498
|
-
))), /* @__PURE__ */
|
|
499
|
-
const dayKey =
|
|
555
|
+
format5(day, "EEE", { locale })
|
|
556
|
+
))), /* @__PURE__ */ React7.createElement("div", { className: "grid grid-cols-7", style: { gridAutoRows: "130px" } }, days.map((day) => {
|
|
557
|
+
const dayKey = format5(day, "yyyy-MM-dd");
|
|
500
558
|
const dayEvents = eventsByDay.get(dayKey) || [];
|
|
501
|
-
const isCurrentMonth =
|
|
559
|
+
const isCurrentMonth = isSameMonth2(day, currentDate);
|
|
502
560
|
const cellId = day.toISOString();
|
|
503
|
-
return /* @__PURE__ */
|
|
561
|
+
return /* @__PURE__ */ React7.createElement(
|
|
504
562
|
DroppableCell,
|
|
505
563
|
{
|
|
506
564
|
key: cellId,
|
|
@@ -509,18 +567,26 @@ var MonthView = ({
|
|
|
509
567
|
className: cn(
|
|
510
568
|
"h-[130px] p-2 border-b-[0.5px] border-r-[0.5px] border-border/30 last:border-r-0 relative transition-all duration-200 hover:bg-accent/5 flex flex-col gap-1.5 overflow-hidden group",
|
|
511
569
|
!isCurrentMonth && "bg-muted/5 text-muted-foreground/60",
|
|
512
|
-
|
|
570
|
+
isToday2(day) && "bg-primary/5 ring-1 ring-inset ring-primary/20"
|
|
513
571
|
),
|
|
514
572
|
onClick: () => onDateClick?.(day)
|
|
515
573
|
},
|
|
516
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ React7.createElement("div", { className: "flex justify-between items-start" }, /* @__PURE__ */ React7.createElement("div", { className: cn(
|
|
517
575
|
"text-sm font-semibold w-7 h-7 flex items-center justify-center rounded-full transition-all duration-200",
|
|
518
|
-
|
|
519
|
-
) },
|
|
520
|
-
/* @__PURE__ */
|
|
576
|
+
isToday2(day) ? "bg-primary text-primary-foreground shadow-md shadow-primary/30" : "group-hover:bg-accent"
|
|
577
|
+
) }, format5(day, "d", { locale })), dayEvents.length > 0 && /* @__PURE__ */ React7.createElement("div", { className: "text-[10px] font-medium text-muted-foreground/60 bg-muted/50 px-1.5 py-0.5 rounded-full" }, dayEvents.length)),
|
|
578
|
+
/* @__PURE__ */ React7.createElement("div", { className: "flex-1 flex flex-col gap-1 scrollbar-hide overflow-y-auto overflow-x-hidden" }, dayEvents.slice(0, 4).map((event) => /* @__PURE__ */ React7.createElement(EventItem, { key: `${event.id}-${dayKey}`, event, onEventClick })), dayEvents.length > 4 && /* @__PURE__ */ React7.createElement("div", { className: "text-[10px] text-primary font-semibold text-center py-1 px-2 rounded-md bg-primary/5 hover:bg-primary/10 cursor-pointer transition-colors" }, "+", dayEvents.length - 4, " more"))
|
|
521
579
|
);
|
|
522
580
|
}))));
|
|
523
581
|
};
|
|
582
|
+
|
|
583
|
+
// src/views/WeekView.tsx
|
|
584
|
+
import React9 from "react";
|
|
585
|
+
import { format as format6, isSameDay as isSameDay2, differenceInMinutes, isToday as isToday3, startOfWeek as startOfWeek3, endOfWeek as endOfWeek3, eachDayOfInterval as eachDayOfInterval3 } from "date-fns";
|
|
586
|
+
import { toZonedTime as toZonedTime3 } from "date-fns-tz";
|
|
587
|
+
|
|
588
|
+
// src/components/dnd/ResizableEvent.tsx
|
|
589
|
+
import React8, { useState as useState2, useRef, useCallback as useCallback2 } from "react";
|
|
524
590
|
var ResizableEvent = ({
|
|
525
591
|
event,
|
|
526
592
|
hourHeight,
|
|
@@ -531,12 +597,14 @@ var ResizableEvent = ({
|
|
|
531
597
|
style,
|
|
532
598
|
readonly
|
|
533
599
|
}) => {
|
|
534
|
-
const
|
|
535
|
-
const [
|
|
600
|
+
const resizeLocked = readonly || isEventResizeDisabled(event);
|
|
601
|
+
const [isResizing, setIsResizing] = useState2(false);
|
|
602
|
+
const [resizeHeight, setResizeHeight] = useState2(null);
|
|
536
603
|
const containerRef = useRef(null);
|
|
537
604
|
const startYRef = useRef(0);
|
|
538
605
|
const startHeightRef = useRef(0);
|
|
539
|
-
const
|
|
606
|
+
const resizeHeightRef = useRef(null);
|
|
607
|
+
const handleResizeStart = useCallback2((e) => {
|
|
540
608
|
e.preventDefault();
|
|
541
609
|
e.stopPropagation();
|
|
542
610
|
const clientY = "touches" in e ? e.touches[0].clientY : e.clientY;
|
|
@@ -553,13 +621,15 @@ var ResizableEvent = ({
|
|
|
553
621
|
// Minimum height based on minDuration
|
|
554
622
|
startHeightRef.current + snappedDelta
|
|
555
623
|
);
|
|
624
|
+
resizeHeightRef.current = newHeight;
|
|
556
625
|
setResizeHeight(newHeight);
|
|
557
626
|
};
|
|
558
627
|
const handleEnd = () => {
|
|
559
628
|
setIsResizing(false);
|
|
560
|
-
|
|
629
|
+
const finalHeight = resizeHeightRef.current;
|
|
630
|
+
if (finalHeight !== null && containerRef.current && onResize) {
|
|
561
631
|
const originalHeight = startHeightRef.current;
|
|
562
|
-
const heightDiff =
|
|
632
|
+
const heightDiff = finalHeight - originalHeight;
|
|
563
633
|
const minutesDiff = heightDiff / hourHeight * 60;
|
|
564
634
|
const newEnd = new Date(event.end);
|
|
565
635
|
newEnd.setMinutes(newEnd.getMinutes() + minutesDiff);
|
|
@@ -567,6 +637,7 @@ var ResizableEvent = ({
|
|
|
567
637
|
onResize(event, newEnd);
|
|
568
638
|
}
|
|
569
639
|
}
|
|
640
|
+
resizeHeightRef.current = null;
|
|
570
641
|
setResizeHeight(null);
|
|
571
642
|
document.removeEventListener("mousemove", handleMove);
|
|
572
643
|
document.removeEventListener("mouseup", handleEnd);
|
|
@@ -577,8 +648,11 @@ var ResizableEvent = ({
|
|
|
577
648
|
document.addEventListener("mouseup", handleEnd);
|
|
578
649
|
document.addEventListener("touchmove", handleMove, { passive: false });
|
|
579
650
|
document.addEventListener("touchend", handleEnd);
|
|
580
|
-
}, [event, hourHeight, minDuration, onResize
|
|
581
|
-
|
|
651
|
+
}, [event, hourHeight, minDuration, onResize]);
|
|
652
|
+
const handlePointerDown = useCallback2((e) => {
|
|
653
|
+
e.stopPropagation();
|
|
654
|
+
}, []);
|
|
655
|
+
return /* @__PURE__ */ React8.createElement(
|
|
582
656
|
"div",
|
|
583
657
|
{
|
|
584
658
|
ref: containerRef,
|
|
@@ -589,24 +663,25 @@ var ResizableEvent = ({
|
|
|
589
663
|
}
|
|
590
664
|
},
|
|
591
665
|
children,
|
|
592
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ React8.createElement(
|
|
593
667
|
"div",
|
|
594
668
|
{
|
|
595
669
|
className: cn(
|
|
596
|
-
|
|
670
|
+
resizeLocked ? "cursor-default" : "cursor-ns-resize group-hover:opacity-100",
|
|
597
671
|
"absolute bottom-0 left-0 right-0 h-3 z-20 flex items-center justify-center",
|
|
598
672
|
"opacity-0 transition-opacity",
|
|
599
673
|
isResizing && "opacity-100"
|
|
600
674
|
),
|
|
601
|
-
|
|
602
|
-
|
|
675
|
+
onPointerDown: resizeLocked ? void 0 : handlePointerDown,
|
|
676
|
+
onMouseDown: resizeLocked ? void 0 : handleResizeStart,
|
|
677
|
+
onTouchStart: resizeLocked ? void 0 : handleResizeStart
|
|
603
678
|
},
|
|
604
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ React8.createElement("div", { className: cn(
|
|
605
680
|
"w-8 h-1 rounded-full transition-all",
|
|
606
681
|
isResizing ? "bg-primary" : "bg-muted-foreground/30 group-hover:bg-primary/50"
|
|
607
682
|
) })
|
|
608
683
|
),
|
|
609
|
-
isResizing && /* @__PURE__ */
|
|
684
|
+
isResizing && /* @__PURE__ */ React8.createElement("div", { className: "absolute inset-0 border-2 border-primary border-dashed rounded-md pointer-events-none bg-primary/5" })
|
|
610
685
|
);
|
|
611
686
|
};
|
|
612
687
|
|
|
@@ -621,29 +696,26 @@ var WeekView = ({
|
|
|
621
696
|
locale,
|
|
622
697
|
readonly
|
|
623
698
|
}) => {
|
|
624
|
-
const
|
|
625
|
-
const
|
|
626
|
-
const
|
|
699
|
+
const weekStartsOn = locale?.options?.weekStartsOn ?? 1;
|
|
700
|
+
const start = startOfWeek3(currentDate, { weekStartsOn });
|
|
701
|
+
const end = endOfWeek3(currentDate, { weekStartsOn });
|
|
702
|
+
const weekDays = eachDayOfInterval3({ start, end });
|
|
627
703
|
const hours = Array.from({ length: 24 }, (_, i) => i);
|
|
628
704
|
const hourHeight = 60;
|
|
629
|
-
const scrollContainerRef =
|
|
630
|
-
const [now, setNow] =
|
|
631
|
-
|
|
705
|
+
const scrollContainerRef = React9.useRef(null);
|
|
706
|
+
const [now, setNow] = React9.useState(/* @__PURE__ */ new Date());
|
|
707
|
+
React9.useEffect(() => {
|
|
632
708
|
const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
|
|
633
709
|
return () => clearInterval(interval);
|
|
634
710
|
}, []);
|
|
635
|
-
|
|
711
|
+
React9.useEffect(() => {
|
|
636
712
|
if (scrollContainerRef.current) {
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
const offsetHour = 4;
|
|
640
|
-
return (currentHour - offsetHour) * hourHeight;
|
|
641
|
-
};
|
|
642
|
-
scrollContainerRef.current.scrollTop = scrollToActualTime();
|
|
713
|
+
const offsetHour = 4;
|
|
714
|
+
scrollContainerRef.current.scrollTop = ((/* @__PURE__ */ new Date()).getHours() - offsetHour) * hourHeight;
|
|
643
715
|
}
|
|
644
716
|
}, []);
|
|
645
717
|
const getZonedDate = (date) => {
|
|
646
|
-
return timezone ?
|
|
718
|
+
return timezone ? toZonedTime3(date, timezone) : date;
|
|
647
719
|
};
|
|
648
720
|
const zonedNow = getZonedDate(/* @__PURE__ */ new Date());
|
|
649
721
|
const getTimezoneDisplay = (tz) => {
|
|
@@ -651,60 +723,60 @@ var WeekView = ({
|
|
|
651
723
|
let displayTime = "";
|
|
652
724
|
let acronym = "";
|
|
653
725
|
if (!tz) {
|
|
654
|
-
displayTime =
|
|
726
|
+
displayTime = format6(date, "HH:mm");
|
|
655
727
|
try {
|
|
656
728
|
acronym = new Intl.DateTimeFormat("en-US", { timeZoneName: "short" }).formatToParts(date).find((part) => part.type === "timeZoneName")?.value || "";
|
|
657
|
-
} catch
|
|
729
|
+
} catch {
|
|
658
730
|
acronym = "LOC";
|
|
659
731
|
}
|
|
660
732
|
} else {
|
|
661
733
|
try {
|
|
662
|
-
const zDate =
|
|
663
|
-
displayTime =
|
|
734
|
+
const zDate = toZonedTime3(date, tz);
|
|
735
|
+
displayTime = format6(zDate, "HH:mm");
|
|
664
736
|
acronym = new Intl.DateTimeFormat("en-US", { timeZone: tz, timeZoneName: "short" }).formatToParts(date).find((part) => part.type === "timeZoneName")?.value || "";
|
|
665
|
-
} catch
|
|
666
|
-
displayTime =
|
|
737
|
+
} catch {
|
|
738
|
+
displayTime = format6(date, "HH:mm");
|
|
667
739
|
acronym = tz;
|
|
668
740
|
}
|
|
669
741
|
}
|
|
670
|
-
return /* @__PURE__ */
|
|
742
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "flex flex-col items-center justify-center leading-tight" }, /* @__PURE__ */ React9.createElement("span", null, displayTime), /* @__PURE__ */ React9.createElement("span", { className: "text-[10px] opacity-75" }, "(", acronym, ")"));
|
|
671
743
|
};
|
|
672
|
-
const
|
|
673
|
-
const
|
|
674
|
-
const
|
|
675
|
-
|
|
744
|
+
const is24h = uses24HourClock(locale);
|
|
745
|
+
const timeFormat = is24h ? "H:mm" : "h a";
|
|
746
|
+
const eventTimeFormat = is24h ? "H:mm" : "h:mm a";
|
|
747
|
+
const nowFormat = is24h ? "H:mm" : "h:mm";
|
|
748
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "flex flex-col h-full bg-background border-[0.5px] border-border/50 rounded-2xl overflow-hidden min-w-[800px] md:min-w-0 shadow-sm" }, /* @__PURE__ */ React9.createElement(
|
|
676
749
|
"div",
|
|
677
750
|
{
|
|
678
751
|
ref: scrollContainerRef,
|
|
679
|
-
className: "flex-1 overflow-y-auto scrollbar-hide relative bg-background scroll-smooth"
|
|
680
|
-
style: { scrollbarGutter: "stable" }
|
|
752
|
+
className: "flex-1 overflow-y-auto scrollbar-hide relative bg-background scroll-smooth"
|
|
681
753
|
},
|
|
682
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ React9.createElement("div", { className: "flex border-b-[0.5px] border-border/50 bg-gradient-to-r from-muted/20 via-background to-muted/20 z-20 sticky top-0 backdrop-blur-sm" }, /* @__PURE__ */ React9.createElement("div", { className: "flex-none p-3 text-center text-xs font-semibold text-muted-foreground w-16 flex items-center justify-center border-r-[0.5px] border-border/30 bg-muted/10" }, getTimezoneDisplay(timezone)), /* @__PURE__ */ React9.createElement("div", { className: "flex-1 grid grid-cols-7" }, weekDays.map((day, index) => /* @__PURE__ */ React9.createElement("div", { key: day.toISOString(), className: cn("py-3 px-2 text-center", index > 0 && "border-l-[0.5px] border-border/30") }, /* @__PURE__ */ React9.createElement("div", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5" }, format6(day, "EEE", { locale })), /* @__PURE__ */ React9.createElement("div", { className: cn(
|
|
683
755
|
"w-9 h-9 flex items-center justify-center rounded-xl mx-auto text-sm font-semibold transition-all duration-200",
|
|
684
|
-
|
|
685
|
-
) },
|
|
686
|
-
/* @__PURE__ */
|
|
756
|
+
isToday3(day) ? "bg-primary text-primary-foreground shadow-lg shadow-primary/30 scale-110" : "text-foreground hover:bg-accent/80"
|
|
757
|
+
) }, format6(day, "d", { locale })))))),
|
|
758
|
+
/* @__PURE__ */ React9.createElement(
|
|
687
759
|
"div",
|
|
688
760
|
{
|
|
689
761
|
className: "flex min-w-full relative",
|
|
690
762
|
style: { height: hours.length * hourHeight }
|
|
691
763
|
},
|
|
692
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ React9.createElement("div", { className: "flex-none w-16 border-r-[0.5px] border-border/30 relative bg-muted/5" }, hours.map((hour) => /* @__PURE__ */ React9.createElement(
|
|
693
765
|
"div",
|
|
694
766
|
{
|
|
695
767
|
key: hour,
|
|
696
768
|
className: "relative w-full text-[11px] text-muted-foreground/80 text-right pr-3 font-medium tabular-nums box-border",
|
|
697
769
|
style: { height: hourHeight }
|
|
698
770
|
},
|
|
699
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ React9.createElement("span", { className: "block -translate-y-1/2" }, hour !== 0 && format6((/* @__PURE__ */ new Date()).setHours(hour, 0, 0, 0), timeFormat, { locale }))
|
|
700
772
|
))),
|
|
701
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ React9.createElement("div", { className: "flex-1 grid grid-cols-7 relative" }, weekDays.map((day, dayIndex) => {
|
|
702
774
|
const dayEvents = events.filter((e) => {
|
|
703
775
|
const zonedStart = getZonedDate(e.start);
|
|
704
|
-
return
|
|
776
|
+
return isSameDay2(zonedStart, day);
|
|
705
777
|
});
|
|
706
|
-
return /* @__PURE__ */
|
|
707
|
-
return /* @__PURE__ */
|
|
778
|
+
return /* @__PURE__ */ React9.createElement("div", { key: day.toISOString(), className: cn("relative h-full", dayIndex > 0 && "border-l-[0.5px] border-border/30") }, hours.map((hour) => {
|
|
779
|
+
return /* @__PURE__ */ React9.createElement(
|
|
708
780
|
"div",
|
|
709
781
|
{
|
|
710
782
|
key: hour,
|
|
@@ -715,7 +787,7 @@ var WeekView = ({
|
|
|
715
787
|
const cellDate = new Date(day);
|
|
716
788
|
cellDate.setHours(hour, minute, 0, 0);
|
|
717
789
|
const cellId = cellDate.toISOString();
|
|
718
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ React9.createElement(
|
|
719
791
|
DroppableCell,
|
|
720
792
|
{
|
|
721
793
|
key: minute,
|
|
@@ -727,7 +799,7 @@ var WeekView = ({
|
|
|
727
799
|
top: `${minute / 60 * 100}%`
|
|
728
800
|
}
|
|
729
801
|
},
|
|
730
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ React9.createElement(
|
|
731
803
|
"div",
|
|
732
804
|
{
|
|
733
805
|
className: "w-full h-full bg-transparent cursor-pointer",
|
|
@@ -761,7 +833,7 @@ var WeekView = ({
|
|
|
761
833
|
const top = startMinutes / 60 * hourHeight;
|
|
762
834
|
const height = durationMinutes / 60 * hourHeight;
|
|
763
835
|
const isShortEvent = durationMinutes < 60;
|
|
764
|
-
return /* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ React9.createElement(
|
|
765
837
|
DraggableEvent,
|
|
766
838
|
{
|
|
767
839
|
key: `${event.id}-${day.toISOString()}`,
|
|
@@ -776,7 +848,7 @@ var WeekView = ({
|
|
|
776
848
|
paddingRight: count > 1 ? "2px" : "0"
|
|
777
849
|
}
|
|
778
850
|
},
|
|
779
|
-
/* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ React9.createElement(
|
|
780
852
|
ResizableEvent,
|
|
781
853
|
{
|
|
782
854
|
readonly,
|
|
@@ -786,13 +858,13 @@ var WeekView = ({
|
|
|
786
858
|
className: "h-full",
|
|
787
859
|
style: { height: "100%" }
|
|
788
860
|
},
|
|
789
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ React9.createElement(
|
|
790
862
|
"div",
|
|
791
863
|
{
|
|
792
864
|
className: cn(
|
|
793
865
|
"rounded-md border shadow-sm transition-all hover:shadow-md group overflow-hidden relative",
|
|
794
866
|
"glass",
|
|
795
|
-
readonly ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
867
|
+
readonly || isEventDragDisabled(event) ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
796
868
|
!event.color && "border-primary/20 bg-primary/10",
|
|
797
869
|
isShortEvent ? "px-1 flex items-center justify-center" : "p-2",
|
|
798
870
|
// Add active border for overlapped events to distinguish them
|
|
@@ -811,14 +883,14 @@ var WeekView = ({
|
|
|
811
883
|
},
|
|
812
884
|
title: count > 1 ? `${event.title} (${index + 1}/${count})` : void 0
|
|
813
885
|
},
|
|
814
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ React9.createElement("div", { className: "flex flex-col h-full overflow-hidden w-full" }, /* @__PURE__ */ React9.createElement("div", { className: cn(
|
|
815
887
|
"font-semibold truncate text-foreground/90 leading-tight",
|
|
816
888
|
isShortEvent ? "text-xs text-center" : "text-xs"
|
|
817
|
-
) }, event.title), !isShortEvent && /* @__PURE__ */
|
|
889
|
+
) }, event.title), !isShortEvent && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { className: "text-[10px] text-muted-foreground truncate mt-0.5 font-medium leading-tight" }, format6(zonedEventStart, eventTimeFormat, { locale }), " - ", format6(zonedEventEnd, eventTimeFormat, { locale })), event.description && height > 50 && /* @__PURE__ */ React9.createElement("div", { className: "text-[10px] text-muted-foreground/80 truncate mt-1 leading-tight opacity-80" }, event.description)), count > 1 && !isShortEvent && /* @__PURE__ */ React9.createElement("div", { className: "absolute top-1 right-1 bg-background/80 backdrop-blur-sm rounded-full w-4 h-4 flex items-center justify-center text-[9px] font-bold text-muted-foreground border border-border shadow-sm" }, count))
|
|
818
890
|
)
|
|
819
891
|
)
|
|
820
892
|
);
|
|
821
|
-
}),
|
|
893
|
+
}), isToday3(day) && /* @__PURE__ */ React9.createElement(
|
|
822
894
|
"div",
|
|
823
895
|
{
|
|
824
896
|
className: "absolute left-0 right-0 z-20 pointer-events-none flex items-center",
|
|
@@ -826,12 +898,12 @@ var WeekView = ({
|
|
|
826
898
|
top: `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight}px`
|
|
827
899
|
}
|
|
828
900
|
},
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
-
/* @__PURE__ */
|
|
901
|
+
/* @__PURE__ */ React9.createElement("div", { className: "h-[2px] w-full bg-gradient-to-r from-primary via-primary to-primary/50" }),
|
|
902
|
+
/* @__PURE__ */ React9.createElement("div", { className: "absolute -left-1.5 w-3 h-3 bg-primary rounded-full shadow-lg shadow-primary/40 ring-2 ring-background animate-pulse" })
|
|
831
903
|
));
|
|
832
904
|
}))
|
|
833
905
|
),
|
|
834
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ React9.createElement(
|
|
835
907
|
"div",
|
|
836
908
|
{
|
|
837
909
|
className: "absolute left-0 w-16 pointer-events-none z-30 flex justify-end pr-2",
|
|
@@ -839,10 +911,15 @@ var WeekView = ({
|
|
|
839
911
|
top: `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight + 80}px`
|
|
840
912
|
}
|
|
841
913
|
},
|
|
842
|
-
/* @__PURE__ */
|
|
914
|
+
/* @__PURE__ */ React9.createElement("span", { className: "text-[10px] font-bold text-primary-foreground bg-primary px-1.5 py-0.5 rounded-md shadow-md -translate-y-1/2 backdrop-blur-none" }, format6(zonedNow, nowFormat, { locale }))
|
|
843
915
|
)
|
|
844
916
|
));
|
|
845
917
|
};
|
|
918
|
+
|
|
919
|
+
// src/views/DayView.tsx
|
|
920
|
+
import React10 from "react";
|
|
921
|
+
import { format as format7, differenceInMinutes as differenceInMinutes2, isToday as isToday4, isSameDay as isSameDay3 } from "date-fns";
|
|
922
|
+
import { toZonedTime as toZonedTime4 } from "date-fns-tz";
|
|
846
923
|
var DayView = ({
|
|
847
924
|
currentDate,
|
|
848
925
|
events,
|
|
@@ -855,42 +932,39 @@ var DayView = ({
|
|
|
855
932
|
}) => {
|
|
856
933
|
const hours = Array.from({ length: 24 }, (_, i) => i);
|
|
857
934
|
const hourHeight = 80;
|
|
858
|
-
const scrollContainerRef =
|
|
859
|
-
const [now, setNow] =
|
|
860
|
-
|
|
935
|
+
const scrollContainerRef = React10.useRef(null);
|
|
936
|
+
const [now, setNow] = React10.useState(/* @__PURE__ */ new Date());
|
|
937
|
+
React10.useEffect(() => {
|
|
861
938
|
const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
|
|
862
939
|
return () => clearInterval(interval);
|
|
863
940
|
}, []);
|
|
864
|
-
|
|
941
|
+
React10.useEffect(() => {
|
|
865
942
|
if (scrollContainerRef.current) {
|
|
866
|
-
const
|
|
867
|
-
|
|
868
|
-
const offsetHour = 3;
|
|
869
|
-
return (currentHour - offsetHour) * hourHeight;
|
|
870
|
-
};
|
|
871
|
-
scrollContainerRef.current.scrollTop = scrollToActualTime();
|
|
943
|
+
const offsetHour = 3;
|
|
944
|
+
scrollContainerRef.current.scrollTop = ((/* @__PURE__ */ new Date()).getHours() - offsetHour) * hourHeight;
|
|
872
945
|
}
|
|
873
946
|
}, []);
|
|
874
947
|
const getZonedDate = (date) => {
|
|
875
|
-
return timezone ?
|
|
948
|
+
return timezone ? toZonedTime4(date, timezone) : date;
|
|
876
949
|
};
|
|
877
950
|
const zonedNow = getZonedDate(now);
|
|
878
951
|
const dayEvents = events.filter((e) => {
|
|
879
952
|
const zonedStart = getZonedDate(e.start);
|
|
880
|
-
return
|
|
953
|
+
return isSameDay3(zonedStart, currentDate);
|
|
881
954
|
});
|
|
882
|
-
const
|
|
883
|
-
const
|
|
884
|
-
const
|
|
885
|
-
|
|
955
|
+
const is24h = uses24HourClock(locale);
|
|
956
|
+
const timeFormat = is24h ? "H:mm" : "h a";
|
|
957
|
+
const eventTimeFormat = is24h ? "H:mm" : "h:mm a";
|
|
958
|
+
const nowFormat = is24h ? "H:mm" : "h:mm a";
|
|
959
|
+
return /* @__PURE__ */ React10.createElement("div", { className: "flex flex-col h-full bg-background border-[0.5px] border-border/50 rounded-2xl overflow-hidden shadow-sm" }, /* @__PURE__ */ React10.createElement("div", { className: "px-6 py-4 border-b-[0.5px] border-border/50 bg-gradient-to-r from-muted/20 via-background to-muted/20 text-center shrink-0" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-center gap-3" }, /* @__PURE__ */ React10.createElement("h2", { className: "text-xl font-semibold capitalize text-foreground" }, format7(currentDate, "EEEE, MMMM d, yyyy", { locale })), isToday4(currentDate) && /* @__PURE__ */ React10.createElement("span", { className: "text-xs font-semibold bg-primary text-primary-foreground px-3 py-1 rounded-full shadow-md shadow-primary/20" }, "Today"))), /* @__PURE__ */ React10.createElement("div", { ref: scrollContainerRef, className: "flex-1 overflow-y-auto relative" }, /* @__PURE__ */ React10.createElement("div", { className: "flex relative", style: { height: hours.length * hourHeight } }, /* @__PURE__ */ React10.createElement("div", { className: "w-20 bg-muted/5 border-r-[0.5px] border-border/30 relative" }, hours.map((hour) => /* @__PURE__ */ React10.createElement(
|
|
886
960
|
"div",
|
|
887
961
|
{
|
|
888
962
|
key: hour,
|
|
889
963
|
className: "relative w-full",
|
|
890
964
|
style: { height: hourHeight }
|
|
891
965
|
},
|
|
892
|
-
hour !== 0 && /* @__PURE__ */
|
|
893
|
-
)),
|
|
966
|
+
hour !== 0 && /* @__PURE__ */ React10.createElement("span", { className: "absolute w-full text-center -top-3 left-1/2 -translate-x-1/2 text-[11px] text-muted-foreground/80 font-medium tabular-nums bg-background px-1.5 py-0.5 rounded-md" }, format7((/* @__PURE__ */ new Date()).setHours(hour, 0, 0, 0), timeFormat, { locale }))
|
|
967
|
+
)), isToday4(currentDate) && /* @__PURE__ */ React10.createElement(
|
|
894
968
|
"div",
|
|
895
969
|
{
|
|
896
970
|
className: "absolute left-0 w-full pointer-events-none z-30 flex justify-end pr-2",
|
|
@@ -898,9 +972,9 @@ var DayView = ({
|
|
|
898
972
|
top: `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight}px`
|
|
899
973
|
}
|
|
900
974
|
},
|
|
901
|
-
/* @__PURE__ */
|
|
902
|
-
)), /* @__PURE__ */
|
|
903
|
-
return /* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ React10.createElement("span", { className: "text-[10px] font-bold text-white bg-primary px-2 py-1 rounded-lg shadow-md shadow-primary/30 -translate-y-1/2" }, format7(zonedNow, nowFormat, { locale }))
|
|
976
|
+
)), /* @__PURE__ */ React10.createElement("div", { className: "flex-1 relative" }, hours.map((hour) => {
|
|
977
|
+
return /* @__PURE__ */ React10.createElement(
|
|
904
978
|
"div",
|
|
905
979
|
{
|
|
906
980
|
key: hour,
|
|
@@ -911,7 +985,7 @@ var DayView = ({
|
|
|
911
985
|
const cellDate = new Date(currentDate);
|
|
912
986
|
cellDate.setHours(hour, minute, 0, 0);
|
|
913
987
|
const cellId = cellDate.toISOString();
|
|
914
|
-
return /* @__PURE__ */
|
|
988
|
+
return /* @__PURE__ */ React10.createElement(
|
|
915
989
|
DroppableCell,
|
|
916
990
|
{
|
|
917
991
|
key: minute,
|
|
@@ -923,7 +997,7 @@ var DayView = ({
|
|
|
923
997
|
top: `${minute / 60 * 100}%`
|
|
924
998
|
}
|
|
925
999
|
},
|
|
926
|
-
/* @__PURE__ */
|
|
1000
|
+
/* @__PURE__ */ React10.createElement(
|
|
927
1001
|
"div",
|
|
928
1002
|
{
|
|
929
1003
|
className: "h-full w-full bg-transparent cursor-pointer",
|
|
@@ -952,11 +1026,11 @@ var DayView = ({
|
|
|
952
1026
|
const zonedStart = getZonedDate(event.start);
|
|
953
1027
|
const zonedEnd = getZonedDate(event.end);
|
|
954
1028
|
const startMinutes = zonedStart.getHours() * 60 + zonedStart.getMinutes();
|
|
955
|
-
const durationMinutes =
|
|
1029
|
+
const durationMinutes = differenceInMinutes2(zonedEnd, zonedStart);
|
|
956
1030
|
const top = startMinutes / 60 * hourHeight;
|
|
957
1031
|
const height = durationMinutes / 60 * hourHeight;
|
|
958
1032
|
const isShortEvent = durationMinutes < 45;
|
|
959
|
-
return /* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ React10.createElement(
|
|
960
1034
|
DraggableEvent,
|
|
961
1035
|
{
|
|
962
1036
|
key: `${event.id}-${currentDate.toISOString()}`,
|
|
@@ -970,7 +1044,7 @@ var DayView = ({
|
|
|
970
1044
|
paddingRight: count > 1 ? "2px" : "0"
|
|
971
1045
|
}
|
|
972
1046
|
},
|
|
973
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ React10.createElement(
|
|
974
1048
|
ResizableEvent,
|
|
975
1049
|
{
|
|
976
1050
|
readonly,
|
|
@@ -980,13 +1054,13 @@ var DayView = ({
|
|
|
980
1054
|
className: "h-full",
|
|
981
1055
|
style: { height: "100%" }
|
|
982
1056
|
},
|
|
983
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ React10.createElement(
|
|
984
1058
|
"div",
|
|
985
1059
|
{
|
|
986
1060
|
className: cn(
|
|
987
1061
|
"h-full rounded-lg border-[0.5px] shadow-sm overflow-hidden transition-all hover:shadow-lg hover:z-20 group",
|
|
988
1062
|
"glass backdrop-blur-sm",
|
|
989
|
-
readonly ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
1063
|
+
readonly || isEventDragDisabled(event) ? "cursor-default" : "cursor-grab active:cursor-grabbing",
|
|
990
1064
|
!event.color && "bg-primary/10 border-primary/20",
|
|
991
1065
|
isShortEvent ? "px-2 flex items-center" : "px-3 py-2",
|
|
992
1066
|
count > 1 && "border-l-4"
|
|
@@ -1003,15 +1077,15 @@ var DayView = ({
|
|
|
1003
1077
|
},
|
|
1004
1078
|
title: count > 1 ? `${event.title} (${index + 1}/${count})` : void 0
|
|
1005
1079
|
},
|
|
1006
|
-
/* @__PURE__ */
|
|
1080
|
+
/* @__PURE__ */ React10.createElement("div", { className: "flex flex-col h-full overflow-hidden w-full" }, /* @__PURE__ */ React10.createElement("div", { className: cn(
|
|
1007
1081
|
"font-semibold truncate leading-tight",
|
|
1008
1082
|
isShortEvent ? "text-xs" : "text-sm",
|
|
1009
1083
|
event.color ? "text-foreground" : "text-foreground/90"
|
|
1010
|
-
) }, event.title), !isShortEvent && /* @__PURE__ */
|
|
1084
|
+
) }, event.title), !isShortEvent && /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-muted-foreground mt-0.5 font-medium" }, format7(zonedStart, eventTimeFormat, { locale }), " - ", format7(zonedEnd, eventTimeFormat, { locale })), event.description && height > 60 && /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-muted-foreground/80 mt-1 line-clamp-2" }, event.description)), count > 1 && !isShortEvent && /* @__PURE__ */ React10.createElement("div", { className: "absolute top-1.5 right-1.5 bg-background/90 backdrop-blur-sm rounded-full w-5 h-5 flex items-center justify-center text-[10px] font-bold text-muted-foreground border border-border shadow-sm" }, count))
|
|
1011
1085
|
)
|
|
1012
1086
|
)
|
|
1013
1087
|
);
|
|
1014
|
-
}),
|
|
1088
|
+
}), isToday4(currentDate) && /* @__PURE__ */ React10.createElement(
|
|
1015
1089
|
"div",
|
|
1016
1090
|
{
|
|
1017
1091
|
className: "absolute left-0 right-0 z-20 pointer-events-none flex items-center",
|
|
@@ -1019,45 +1093,62 @@ var DayView = ({
|
|
|
1019
1093
|
top: `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight}px`
|
|
1020
1094
|
}
|
|
1021
1095
|
},
|
|
1022
|
-
/* @__PURE__ */
|
|
1023
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ React10.createElement("div", { className: "h-[2px] w-full bg-gradient-to-r from-primary via-primary to-primary/50" }),
|
|
1097
|
+
/* @__PURE__ */ React10.createElement("div", { className: "absolute -left-1.5 w-3 h-3 bg-primary rounded-full shadow-lg shadow-primary/40 ring-2 ring-background animate-pulse" })
|
|
1024
1098
|
)))));
|
|
1025
1099
|
};
|
|
1026
|
-
|
|
1100
|
+
|
|
1101
|
+
// src/views/AgendaView.tsx
|
|
1102
|
+
import React12, { useMemo as useMemo2 } from "react";
|
|
1103
|
+
import { format as format8, isSameDay as isSameDay4, isToday as isToday5, isTomorrow, addDays, startOfDay, differenceInMinutes as differenceInMinutes3 } from "date-fns";
|
|
1104
|
+
|
|
1105
|
+
// src/components/EmptyState.tsx
|
|
1106
|
+
import React11 from "react";
|
|
1107
|
+
import { Plus as Plus2 } from "lucide-react";
|
|
1108
|
+
var AgendaEmptyState = ({ onCreateEvent, translations }) => /* @__PURE__ */ React11.createElement("div", { className: "flex flex-col items-center justify-center h-full min-h-[400px] py-12" }, /* @__PURE__ */ React11.createElement("div", { className: "relative mb-8" }, /* @__PURE__ */ React11.createElement("div", { className: "p-8 bg-gradient-to-br from-green-50 to-blue-50 dark:from-green-900/10 dark:to-blue-900/10 rounded-3xl border border-border/30" }, /* @__PURE__ */ React11.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React11.createElement("div", { className: "w-12 h-12 rounded-2xl bg-green-100 dark:bg-green-900/30 flex items-center justify-center" }, /* @__PURE__ */ React11.createElement("svg", { className: "w-6 h-6 text-green-600 dark:text-green-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2 }, /* @__PURE__ */ React11.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }))), /* @__PURE__ */ React11.createElement("div", { className: "text-left" }, /* @__PURE__ */ React11.createElement("div", { className: "font-medium text-foreground" }, translations?.allCaughtUp || "All caught up!"), /* @__PURE__ */ React11.createElement("div", { className: "text-sm text-muted-foreground" }, translations?.noEventsScheduled || "No events scheduled"))))), /* @__PURE__ */ React11.createElement("div", { className: "text-center max-w-sm" }, /* @__PURE__ */ React11.createElement("h3", { className: "text-lg font-semibold text-foreground mb-2" }, translations?.noUpcoming || "Your schedule is clear"), /* @__PURE__ */ React11.createElement("p", { className: "text-sm text-muted-foreground mb-6" }, translations?.noUpcomingHint || "No upcoming events to show. Create a new event to start planning."), onCreateEvent && /* @__PURE__ */ React11.createElement(
|
|
1027
1109
|
"button",
|
|
1028
1110
|
{
|
|
1029
1111
|
onClick: onCreateEvent,
|
|
1030
1112
|
className: "inline-flex items-center gap-2 px-5 py-2.5 bg-primary text-primary-foreground rounded-xl font-medium text-sm shadow-lg shadow-primary/20 hover:shadow-xl hover:shadow-primary/30 hover:scale-105 active:scale-95 transition-all duration-200"
|
|
1031
1113
|
},
|
|
1032
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ React11.createElement(Plus2, { className: "w-4 h-4" }),
|
|
1033
1115
|
translations?.createEvent || "Create Event"
|
|
1034
1116
|
)));
|
|
1117
|
+
|
|
1118
|
+
// src/views/AgendaView.tsx
|
|
1119
|
+
import { motion } from "framer-motion";
|
|
1120
|
+
import { Clock, Users, Paperclip, Bell } from "lucide-react";
|
|
1035
1121
|
var formatDuration = (start, end) => {
|
|
1036
|
-
const minutes =
|
|
1122
|
+
const minutes = differenceInMinutes3(end, start);
|
|
1037
1123
|
if (minutes < 60) return `${minutes}m`;
|
|
1038
1124
|
const hours = Math.floor(minutes / 60);
|
|
1039
1125
|
const remainingMinutes = minutes % 60;
|
|
1040
1126
|
if (remainingMinutes === 0) return `${hours}h`;
|
|
1041
1127
|
return `${hours}h ${remainingMinutes}m`;
|
|
1042
1128
|
};
|
|
1043
|
-
var getDateLabel = (date) => {
|
|
1044
|
-
if (
|
|
1045
|
-
if (isTomorrow(date)) return "Tomorrow";
|
|
1046
|
-
return
|
|
1129
|
+
var getDateLabel = (date, locale, translations) => {
|
|
1130
|
+
if (isToday5(date)) return translations?.today || "Today";
|
|
1131
|
+
if (isTomorrow(date)) return translations?.tomorrow || "Tomorrow";
|
|
1132
|
+
return format8(date, "EEEE", { locale });
|
|
1047
1133
|
};
|
|
1048
1134
|
var AgendaView = ({
|
|
1049
1135
|
currentDate,
|
|
1050
1136
|
events,
|
|
1051
1137
|
onEventClick,
|
|
1052
|
-
onCreateEvent
|
|
1138
|
+
onCreateEvent,
|
|
1139
|
+
locale,
|
|
1140
|
+
translations
|
|
1053
1141
|
}) => {
|
|
1054
|
-
const
|
|
1142
|
+
const is24h = uses24HourClock(locale);
|
|
1143
|
+
const timePattern = is24h ? "H:mm" : "h:mm a";
|
|
1144
|
+
const compactTimePattern = is24h ? "H:mm" : "h:mm";
|
|
1145
|
+
const groupedEvents = useMemo2(() => {
|
|
1055
1146
|
const startDate = startOfDay(currentDate);
|
|
1056
1147
|
const groups = [];
|
|
1057
1148
|
const sortedEvents = [...events].sort((a, b) => a.start.getTime() - b.start.getTime());
|
|
1058
1149
|
for (let i = 0; i < 30; i++) {
|
|
1059
1150
|
const day = addDays(startDate, i);
|
|
1060
|
-
const dayEvents = sortedEvents.filter((event) =>
|
|
1151
|
+
const dayEvents = sortedEvents.filter((event) => isSameDay4(event.start, day));
|
|
1061
1152
|
if (dayEvents.length > 0) {
|
|
1062
1153
|
groups.push({ date: day, events: dayEvents });
|
|
1063
1154
|
}
|
|
@@ -1077,7 +1168,7 @@ var AgendaView = ({
|
|
|
1077
1168
|
hidden: { opacity: 0, x: -20 },
|
|
1078
1169
|
show: { opacity: 1, x: 0 }
|
|
1079
1170
|
};
|
|
1080
|
-
return /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col h-full bg-background overflow-y-auto" }, groupedEvents.length === 0 ? /* @__PURE__ */ React12.createElement(AgendaEmptyState, { onCreateEvent, translations }) : /* @__PURE__ */ React12.createElement(
|
|
1081
1172
|
motion.div,
|
|
1082
1173
|
{
|
|
1083
1174
|
className: "max-w-3xl mx-auto w-full pb-10 px-4 md:px-6",
|
|
@@ -1085,21 +1176,21 @@ var AgendaView = ({
|
|
|
1085
1176
|
initial: "hidden",
|
|
1086
1177
|
animate: "show"
|
|
1087
1178
|
},
|
|
1088
|
-
groupedEvents.map((group
|
|
1179
|
+
groupedEvents.map((group) => /* @__PURE__ */ React12.createElement(
|
|
1089
1180
|
motion.div,
|
|
1090
1181
|
{
|
|
1091
1182
|
key: group.date.toISOString(),
|
|
1092
1183
|
className: "relative",
|
|
1093
1184
|
variants: item
|
|
1094
1185
|
},
|
|
1095
|
-
/* @__PURE__ */
|
|
1186
|
+
/* @__PURE__ */ React12.createElement("div", { className: "sticky top-0 bg-background/95 backdrop-blur-md py-4 z-10 border-b border-border/50" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React12.createElement("div", { className: cn(
|
|
1096
1187
|
"flex flex-col items-center justify-center w-16 h-16 rounded-2xl transition-all",
|
|
1097
|
-
|
|
1098
|
-
) }, /* @__PURE__ */
|
|
1188
|
+
isToday5(group.date) ? "bg-primary text-primary-foreground shadow-lg shadow-primary/30" : "bg-muted/50 text-foreground"
|
|
1189
|
+
) }, /* @__PURE__ */ React12.createElement("span", { className: "text-2xl font-bold leading-none" }, format8(group.date, "d")), /* @__PURE__ */ React12.createElement("span", { className: "text-xs font-medium uppercase tracking-wide opacity-80" }, format8(group.date, "MMM", { locale }))), /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React12.createElement("span", { className: cn(
|
|
1099
1190
|
"text-lg font-semibold",
|
|
1100
|
-
|
|
1101
|
-
) }, getDateLabel(group.date)), /* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */
|
|
1191
|
+
isToday5(group.date) && "text-primary"
|
|
1192
|
+
) }, getDateLabel(group.date, locale, translations)), /* @__PURE__ */ React12.createElement("span", { className: "text-sm text-muted-foreground" }, group.events.length, " ", group.events.length !== 1 ? translations?.eventPlural || "events" : translations?.eventSingular || "event")))),
|
|
1193
|
+
/* @__PURE__ */ React12.createElement("div", { className: "py-4 space-y-3" }, group.events.map((event) => /* @__PURE__ */ React12.createElement(
|
|
1103
1194
|
motion.div,
|
|
1104
1195
|
{
|
|
1105
1196
|
key: event.id,
|
|
@@ -1113,26 +1204,30 @@ var AgendaView = ({
|
|
|
1113
1204
|
whileHover: { scale: 1.01, y: -2 },
|
|
1114
1205
|
transition: { duration: 0.2 }
|
|
1115
1206
|
},
|
|
1116
|
-
/* @__PURE__ */
|
|
1207
|
+
/* @__PURE__ */ React12.createElement(
|
|
1117
1208
|
"div",
|
|
1118
1209
|
{
|
|
1119
1210
|
className: "absolute left-0 top-3 bottom-3 w-1 rounded-full",
|
|
1120
1211
|
style: { backgroundColor: event.color || "var(--primary)" }
|
|
1121
1212
|
}
|
|
1122
1213
|
),
|
|
1123
|
-
/* @__PURE__ */
|
|
1124
|
-
/* @__PURE__ */
|
|
1214
|
+
/* @__PURE__ */ React12.createElement("div", { className: "flex flex-col items-center min-w-[70px] pl-2" }, event.allDay ? /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React12.createElement("span", { className: "text-xs font-semibold text-muted-foreground bg-muted/80 px-2.5 py-1 rounded-full" }, translations?.allDay || "All Day")) : /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React12.createElement("span", { className: "text-base font-semibold text-foreground" }, format8(event.start, compactTimePattern, { locale })), !is24h && /* @__PURE__ */ React12.createElement("span", { className: "text-xs text-muted-foreground uppercase" }, format8(event.start, "a")), /* @__PURE__ */ React12.createElement("div", { className: "w-px h-3 bg-border my-1" }), /* @__PURE__ */ React12.createElement("span", { className: "text-xs text-muted-foreground/70 font-medium" }, formatDuration(event.start, event.end)))),
|
|
1215
|
+
/* @__PURE__ */ React12.createElement("div", { className: "flex-1 min-w-0 space-y-2" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-start justify-between gap-2" }, /* @__PURE__ */ React12.createElement("h4", { className: "text-base font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-1" }, event.title), /* @__PURE__ */ React12.createElement(
|
|
1125
1216
|
"div",
|
|
1126
1217
|
{
|
|
1127
1218
|
className: "w-3 h-3 rounded-full shrink-0 mt-1.5",
|
|
1128
1219
|
style: { backgroundColor: event.color || "var(--primary)" }
|
|
1129
1220
|
}
|
|
1130
|
-
)), event.description && /* @__PURE__ */
|
|
1131
|
-
/* @__PURE__ */
|
|
1221
|
+
)), event.description && /* @__PURE__ */ React12.createElement("p", { className: "text-sm text-muted-foreground line-clamp-2 leading-relaxed" }, event.description), /* @__PURE__ */ React12.createElement("div", { className: "flex flex-wrap items-center gap-3 pt-1" }, !event.allDay && /* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React12.createElement(Clock, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React12.createElement("span", null, format8(event.start, timePattern, { locale }), " - ", format8(event.end, timePattern, { locale }))), event.guests && event.guests.length > 0 && /* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React12.createElement(Users, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React12.createElement("span", null, event.guests.length, " ", event.guests.length !== 1 ? translations?.guestsCount || "guests" : translations?.guestCount || "guest")), event.attachments && event.attachments.length > 0 && /* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React12.createElement(Paperclip, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React12.createElement("span", null, event.attachments.length)), event.reminders && event.reminders.length > 0 && /* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React12.createElement(Bell, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React12.createElement("span", null, event.reminders.length)))),
|
|
1222
|
+
/* @__PURE__ */ React12.createElement("div", { className: "absolute right-4 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity" }, /* @__PURE__ */ React12.createElement("svg", { className: "w-5 h-5 text-muted-foreground", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ React12.createElement("path", { d: "M9 18l6-6-6-6" })))
|
|
1132
1223
|
)))
|
|
1133
1224
|
))
|
|
1134
1225
|
));
|
|
1135
1226
|
};
|
|
1227
|
+
|
|
1228
|
+
// src/views/ResourceView.tsx
|
|
1229
|
+
import React13, { useRef as useRef2 } from "react";
|
|
1230
|
+
import { format as format9, startOfDay as startOfDay2, differenceInMinutes as differenceInMinutes4, isSameDay as isSameDay5 } from "date-fns";
|
|
1136
1231
|
var ResourceView = ({
|
|
1137
1232
|
currentDate,
|
|
1138
1233
|
events,
|
|
@@ -1141,16 +1236,16 @@ var ResourceView = ({
|
|
|
1141
1236
|
onTimeSlotClick,
|
|
1142
1237
|
locale
|
|
1143
1238
|
}) => {
|
|
1144
|
-
const containerRef =
|
|
1239
|
+
const containerRef = useRef2(null);
|
|
1145
1240
|
const hours = Array.from({ length: 24 }, (_, i) => i);
|
|
1146
1241
|
const hourWidth = 100;
|
|
1147
|
-
const timeFormat = locale
|
|
1242
|
+
const timeFormat = uses24HourClock(locale) ? "H:mm" : "h a";
|
|
1148
1243
|
const getEventStyle = (event) => {
|
|
1149
1244
|
const start = new Date(event.start);
|
|
1150
1245
|
const end = new Date(event.end);
|
|
1151
|
-
const dayStart =
|
|
1152
|
-
const startMinutes =
|
|
1153
|
-
const durationMinutes =
|
|
1246
|
+
const dayStart = startOfDay2(currentDate);
|
|
1247
|
+
const startMinutes = differenceInMinutes4(start, dayStart);
|
|
1248
|
+
const durationMinutes = differenceInMinutes4(end, start);
|
|
1154
1249
|
const left = startMinutes / 60 * hourWidth;
|
|
1155
1250
|
const width = durationMinutes / 60 * hourWidth;
|
|
1156
1251
|
return {
|
|
@@ -1159,19 +1254,19 @@ var ResourceView = ({
|
|
|
1159
1254
|
// Min width for visibility
|
|
1160
1255
|
};
|
|
1161
1256
|
};
|
|
1162
|
-
return /* @__PURE__ */
|
|
1257
|
+
return /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col h-full bg-background overflow-hidden" }, /* @__PURE__ */ React13.createElement("div", { className: "flex border-b border-border bg-muted/20" }, /* @__PURE__ */ React13.createElement("div", { className: "w-48 shrink-0 border-r border-border p-4 font-semibold text-sm bg-background sticky left-0 z-20" }, "Resources"), /* @__PURE__ */ React13.createElement("div", { className: "flex overflow-hidden" }, /* @__PURE__ */ React13.createElement("div", { className: "flex relative", style: { width: hours.length * hourWidth } }, hours.map((hour) => /* @__PURE__ */ React13.createElement(
|
|
1163
1258
|
"div",
|
|
1164
1259
|
{
|
|
1165
1260
|
key: hour,
|
|
1166
1261
|
className: "border-r border-border/50 text-xs text-muted-foreground p-2 font-medium shrink-0",
|
|
1167
1262
|
style: { width: hourWidth }
|
|
1168
1263
|
},
|
|
1169
|
-
|
|
1170
|
-
))))), /* @__PURE__ */
|
|
1264
|
+
format9((/* @__PURE__ */ new Date()).setHours(hour, 0, 0, 0), timeFormat, { locale })
|
|
1265
|
+
))))), /* @__PURE__ */ React13.createElement("div", { className: "flex-1 overflow-auto relative", ref: containerRef }, /* @__PURE__ */ React13.createElement("div", { className: "min-w-fit" }, resources.map((resource) => {
|
|
1171
1266
|
const resourceEvents = events.filter(
|
|
1172
|
-
(e) => e.resourceId === resource.id &&
|
|
1267
|
+
(e) => e.resourceId === resource.id && isSameDay5(new Date(e.start), currentDate)
|
|
1173
1268
|
);
|
|
1174
|
-
return /* @__PURE__ */
|
|
1269
|
+
return /* @__PURE__ */ React13.createElement("div", { key: resource.id, className: "flex border-b border-border min-h-[100px]" }, /* @__PURE__ */ React13.createElement("div", { className: "w-48 shrink-0 border-r border-border p-4 bg-background sticky left-0 z-10 flex items-center gap-3" }, resource.avatar ? /* @__PURE__ */ React13.createElement("img", { src: resource.avatar, alt: resource.label, className: "w-8 h-8 rounded-full object-cover" }) : /* @__PURE__ */ React13.createElement("div", { className: "w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-xs font-bold text-primary" }, resource.label.substring(0, 2).toUpperCase()), /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React13.createElement("span", { className: "text-sm font-medium" }, resource.label), /* @__PURE__ */ React13.createElement("span", { className: "text-xs text-muted-foreground" }, "ID: ", resource.id))), /* @__PURE__ */ React13.createElement("div", { className: "relative flex", style: { width: hours.length * hourWidth } }, hours.map((hour) => /* @__PURE__ */ React13.createElement(
|
|
1175
1270
|
"div",
|
|
1176
1271
|
{
|
|
1177
1272
|
key: hour,
|
|
@@ -1182,7 +1277,7 @@ var ResourceView = ({
|
|
|
1182
1277
|
const slotDate = new Date(currentDate);
|
|
1183
1278
|
slotDate.setHours(hour, minute, 0, 0);
|
|
1184
1279
|
const slotId = `${resource.id}-${slotDate.toISOString()}`;
|
|
1185
|
-
return /* @__PURE__ */
|
|
1280
|
+
return /* @__PURE__ */ React13.createElement(
|
|
1186
1281
|
DroppableCell,
|
|
1187
1282
|
{
|
|
1188
1283
|
key: minute,
|
|
@@ -1196,7 +1291,7 @@ var ResourceView = ({
|
|
|
1196
1291
|
}
|
|
1197
1292
|
);
|
|
1198
1293
|
})
|
|
1199
|
-
)), resourceEvents.map((event) => /* @__PURE__ */
|
|
1294
|
+
)), resourceEvents.map((event) => /* @__PURE__ */ React13.createElement(
|
|
1200
1295
|
DraggableEvent,
|
|
1201
1296
|
{
|
|
1202
1297
|
key: event.id,
|
|
@@ -1213,10 +1308,17 @@ var ResourceView = ({
|
|
|
1213
1308
|
color: "#fff"
|
|
1214
1309
|
}
|
|
1215
1310
|
},
|
|
1216
|
-
/* @__PURE__ */
|
|
1311
|
+
/* @__PURE__ */ React13.createElement("div", { className: "truncate" }, event.title)
|
|
1217
1312
|
))));
|
|
1218
1313
|
}))));
|
|
1219
1314
|
};
|
|
1315
|
+
|
|
1316
|
+
// src/components/EventModal.tsx
|
|
1317
|
+
import React15, { useState as useState3, useEffect as useEffect3 } from "react";
|
|
1318
|
+
|
|
1319
|
+
// src/components/ui/Modal.tsx
|
|
1320
|
+
import React14, { useEffect as useEffect2, useRef as useRef3 } from "react";
|
|
1321
|
+
import { X } from "lucide-react";
|
|
1220
1322
|
var Modal = ({
|
|
1221
1323
|
isOpen,
|
|
1222
1324
|
onClose,
|
|
@@ -1225,8 +1327,8 @@ var Modal = ({
|
|
|
1225
1327
|
className,
|
|
1226
1328
|
hideHeader = false
|
|
1227
1329
|
}) => {
|
|
1228
|
-
const overlayRef =
|
|
1229
|
-
|
|
1330
|
+
const overlayRef = useRef3(null);
|
|
1331
|
+
useEffect2(() => {
|
|
1230
1332
|
const handleEscape = (e) => {
|
|
1231
1333
|
if (e.key === "Escape") {
|
|
1232
1334
|
onClose();
|
|
@@ -1240,14 +1342,14 @@ var Modal = ({
|
|
|
1240
1342
|
};
|
|
1241
1343
|
}, [isOpen, onClose]);
|
|
1242
1344
|
if (!isOpen) return null;
|
|
1243
|
-
return /* @__PURE__ */
|
|
1345
|
+
return /* @__PURE__ */ React14.createElement("div", { className: "absolute inset-0 z-50 flex items-center justify-center p-4 bg-black/40 backdrop-blur-md animate-in fade-in duration-300" }, /* @__PURE__ */ React14.createElement(
|
|
1244
1346
|
"div",
|
|
1245
1347
|
{
|
|
1246
1348
|
ref: overlayRef,
|
|
1247
1349
|
className: "absolute inset-0",
|
|
1248
1350
|
onClick: onClose
|
|
1249
1351
|
}
|
|
1250
|
-
), /* @__PURE__ */
|
|
1352
|
+
), /* @__PURE__ */ React14.createElement(
|
|
1251
1353
|
"div",
|
|
1252
1354
|
{
|
|
1253
1355
|
className: cn(
|
|
@@ -1255,7 +1357,7 @@ var Modal = ({
|
|
|
1255
1357
|
className
|
|
1256
1358
|
)
|
|
1257
1359
|
},
|
|
1258
|
-
!hideHeader && /* @__PURE__ */
|
|
1360
|
+
!hideHeader && /* @__PURE__ */ React14.createElement("div", { className: "flex items-center justify-between px-6 py-4 border-b border-border/50 shrink-0 bg-gradient-to-r from-muted/20 to-background" }, /* @__PURE__ */ React14.createElement("h3", { className: "text-lg font-semibold text-foreground" }, title), /* @__PURE__ */ React14.createElement(
|
|
1259
1361
|
Button,
|
|
1260
1362
|
{
|
|
1261
1363
|
variant: "ghost",
|
|
@@ -1263,12 +1365,37 @@ var Modal = ({
|
|
|
1263
1365
|
onClick: onClose,
|
|
1264
1366
|
className: "h-9 w-9 p-0 rounded-xl hover:bg-accent/80 transition-all duration-200"
|
|
1265
1367
|
},
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ React14.createElement(X, { className: "h-4 w-4" }),
|
|
1369
|
+
/* @__PURE__ */ React14.createElement("span", { className: "sr-only" }, "Close")
|
|
1268
1370
|
)),
|
|
1269
|
-
/* @__PURE__ */
|
|
1371
|
+
/* @__PURE__ */ React14.createElement("div", { className: cn("overflow-y-auto flex-1", !hideHeader && "p-6") }, children)
|
|
1270
1372
|
));
|
|
1271
1373
|
};
|
|
1374
|
+
|
|
1375
|
+
// src/components/EventModal.tsx
|
|
1376
|
+
import { format as format10, differenceInMinutes as differenceInMinutes5 } from "date-fns";
|
|
1377
|
+
import { motion as motion2, AnimatePresence } from "framer-motion";
|
|
1378
|
+
import {
|
|
1379
|
+
Clock as Clock2,
|
|
1380
|
+
MapPin,
|
|
1381
|
+
AlignLeft,
|
|
1382
|
+
Trash2,
|
|
1383
|
+
X as X2,
|
|
1384
|
+
Edit2,
|
|
1385
|
+
Users as Users2,
|
|
1386
|
+
Paperclip as Paperclip2,
|
|
1387
|
+
File,
|
|
1388
|
+
Calendar as Calendar2,
|
|
1389
|
+
ChevronDown as ChevronDown2,
|
|
1390
|
+
Check,
|
|
1391
|
+
Download,
|
|
1392
|
+
Bell as Bell2,
|
|
1393
|
+
BellRing,
|
|
1394
|
+
Plus as Plus3,
|
|
1395
|
+
Repeat,
|
|
1396
|
+
Tag,
|
|
1397
|
+
ExternalLink
|
|
1398
|
+
} from "lucide-react";
|
|
1272
1399
|
var REMINDER_OPTIONS = [
|
|
1273
1400
|
{ value: 0, label: "At time of event" },
|
|
1274
1401
|
{ value: 5, label: "5 minutes before" },
|
|
@@ -1310,13 +1437,10 @@ var EventModal = ({
|
|
|
1310
1437
|
initialDate,
|
|
1311
1438
|
onSave,
|
|
1312
1439
|
onDelete,
|
|
1313
|
-
calendars
|
|
1314
|
-
eventTypes,
|
|
1315
|
-
translations
|
|
1440
|
+
calendars
|
|
1316
1441
|
}) => {
|
|
1317
|
-
const [mode, setMode] =
|
|
1318
|
-
const [
|
|
1319
|
-
const [formData, setFormData] = useState({
|
|
1442
|
+
const [mode, setMode] = useState3("create");
|
|
1443
|
+
const [formData, setFormData] = useState3({
|
|
1320
1444
|
title: "",
|
|
1321
1445
|
description: "",
|
|
1322
1446
|
location: "",
|
|
@@ -1330,10 +1454,10 @@ var EventModal = ({
|
|
|
1330
1454
|
attachments: [],
|
|
1331
1455
|
reminders: [{ id: "1", type: "notification", time: 30, label: "30 minutes before" }]
|
|
1332
1456
|
});
|
|
1333
|
-
const [isCalendarDropdownOpen, setIsCalendarDropdownOpen] =
|
|
1334
|
-
const [isColorPickerOpen, setIsColorPickerOpen] =
|
|
1335
|
-
const [isReminderDropdownOpen, setIsReminderDropdownOpen] =
|
|
1336
|
-
const [isGuestsDropdownOpen, setIsGuestsDropdownOpen] =
|
|
1457
|
+
const [isCalendarDropdownOpen, setIsCalendarDropdownOpen] = useState3(false);
|
|
1458
|
+
const [isColorPickerOpen, setIsColorPickerOpen] = useState3(false);
|
|
1459
|
+
const [isReminderDropdownOpen, setIsReminderDropdownOpen] = useState3(false);
|
|
1460
|
+
const [isGuestsDropdownOpen, setIsGuestsDropdownOpen] = useState3(false);
|
|
1337
1461
|
const fakeGuests = [
|
|
1338
1462
|
"alice@example.com",
|
|
1339
1463
|
"bob@example.com",
|
|
@@ -1341,9 +1465,8 @@ var EventModal = ({
|
|
|
1341
1465
|
"diana@example.com",
|
|
1342
1466
|
"evan@example.com"
|
|
1343
1467
|
];
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
useEffect(() => {
|
|
1468
|
+
const [selectedGuests, setSelectedGuests] = useState3([]);
|
|
1469
|
+
useEffect3(() => {
|
|
1347
1470
|
if (isOpen) {
|
|
1348
1471
|
if (event) {
|
|
1349
1472
|
setMode("view");
|
|
@@ -1373,7 +1496,6 @@ var EventModal = ({
|
|
|
1373
1496
|
reminders: [{ id: "1", type: "notification", time: 30, label: "30 minutes before" }]
|
|
1374
1497
|
});
|
|
1375
1498
|
setSelectedGuests([]);
|
|
1376
|
-
setActiveTab("details");
|
|
1377
1499
|
}
|
|
1378
1500
|
}
|
|
1379
1501
|
}, [isOpen, event, initialDate, calendars]);
|
|
@@ -1408,7 +1530,7 @@ var EventModal = ({
|
|
|
1408
1530
|
};
|
|
1409
1531
|
const formatDateForInput = (date) => {
|
|
1410
1532
|
if (!date) return "";
|
|
1411
|
-
return
|
|
1533
|
+
return format10(date, "yyyy-MM-dd'T'HH:mm");
|
|
1412
1534
|
};
|
|
1413
1535
|
const handleDateChange = (field, value) => {
|
|
1414
1536
|
const date = new Date(value);
|
|
@@ -1458,14 +1580,14 @@ var EventModal = ({
|
|
|
1458
1580
|
};
|
|
1459
1581
|
const getDurationText = () => {
|
|
1460
1582
|
if (!formData.start || !formData.end) return "";
|
|
1461
|
-
const mins =
|
|
1583
|
+
const mins = differenceInMinutes5(formData.end, formData.start);
|
|
1462
1584
|
if (mins < 60) return `${mins} min`;
|
|
1463
1585
|
const hours = Math.floor(mins / 60);
|
|
1464
1586
|
const remainingMins = mins % 60;
|
|
1465
1587
|
if (remainingMins === 0) return `${hours} hr`;
|
|
1466
1588
|
return `${hours} hr ${remainingMins} min`;
|
|
1467
1589
|
};
|
|
1468
|
-
const renderViewMode = () => /* @__PURE__ */
|
|
1590
|
+
const renderViewMode = () => /* @__PURE__ */ React15.createElement("div", { className: "flex flex-col bg-background overflow-hidden w-full max-h-[90vh]" }, /* @__PURE__ */ React15.createElement(
|
|
1469
1591
|
"div",
|
|
1470
1592
|
{
|
|
1471
1593
|
className: "relative px-6 pt-6 pb-8",
|
|
@@ -1473,65 +1595,65 @@ var EventModal = ({
|
|
|
1473
1595
|
background: `linear-gradient(135deg, ${event?.color || "#3b82f6"}15 0%, transparent 100%)`
|
|
1474
1596
|
}
|
|
1475
1597
|
},
|
|
1476
|
-
/* @__PURE__ */
|
|
1598
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex items-center justify-between mb-6" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement(
|
|
1477
1599
|
"div",
|
|
1478
1600
|
{
|
|
1479
1601
|
className: "w-3 h-3 rounded-full",
|
|
1480
1602
|
style: { backgroundColor: event?.color || "#3b82f6" }
|
|
1481
1603
|
}
|
|
1482
|
-
), /* @__PURE__ */
|
|
1604
|
+
), /* @__PURE__ */ React15.createElement("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider" }, calendars?.find((c) => c.id === event?.calendarId)?.label || "Event")), /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React15.createElement(
|
|
1483
1605
|
"button",
|
|
1484
1606
|
{
|
|
1485
1607
|
onClick: () => setMode("edit"),
|
|
1486
1608
|
className: "p-2 hover:bg-background/80 rounded-lg transition-all text-muted-foreground hover:text-foreground",
|
|
1487
1609
|
title: "Edit"
|
|
1488
1610
|
},
|
|
1489
|
-
/* @__PURE__ */
|
|
1490
|
-
), /* @__PURE__ */
|
|
1611
|
+
/* @__PURE__ */ React15.createElement(Edit2, { className: "w-4 h-4" })
|
|
1612
|
+
), /* @__PURE__ */ React15.createElement(
|
|
1491
1613
|
"button",
|
|
1492
1614
|
{
|
|
1493
1615
|
onClick: handleDelete,
|
|
1494
1616
|
className: "p-2 hover:bg-destructive/10 rounded-lg transition-all text-muted-foreground hover:text-destructive",
|
|
1495
1617
|
title: "Delete"
|
|
1496
1618
|
},
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
), /* @__PURE__ */
|
|
1619
|
+
/* @__PURE__ */ React15.createElement(Trash2, { className: "w-4 h-4" })
|
|
1620
|
+
), /* @__PURE__ */ React15.createElement(
|
|
1499
1621
|
"button",
|
|
1500
1622
|
{
|
|
1501
1623
|
onClick: onClose,
|
|
1502
1624
|
className: "p-2 hover:bg-background/80 rounded-lg transition-all text-muted-foreground hover:text-foreground",
|
|
1503
1625
|
title: "Close"
|
|
1504
1626
|
},
|
|
1505
|
-
/* @__PURE__ */
|
|
1627
|
+
/* @__PURE__ */ React15.createElement(X2, { className: "w-4 h-4" })
|
|
1506
1628
|
))),
|
|
1507
|
-
/* @__PURE__ */
|
|
1508
|
-
/* @__PURE__ */
|
|
1509
|
-
), /* @__PURE__ */
|
|
1510
|
-
|
|
1629
|
+
/* @__PURE__ */ React15.createElement("h1", { className: "text-2xl font-bold text-foreground mb-3 leading-tight" }, event?.title || "(No title)"),
|
|
1630
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-3 text-sm" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2 px-3 py-1.5 bg-background/60 backdrop-blur-sm rounded-lg border border-border/30" }, /* @__PURE__ */ React15.createElement(Calendar2, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15.createElement("span", { className: "font-medium" }, event?.start && format10(new Date(event.start), "EEE, MMM d"))), /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2 px-3 py-1.5 bg-background/60 backdrop-blur-sm rounded-lg border border-border/30" }, /* @__PURE__ */ React15.createElement(Clock2, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15.createElement("span", { className: "font-medium" }, event?.start && format10(new Date(event.start), "h:mm a"), " \u2013 ", event?.end && format10(new Date(event.end), "h:mm a"))))
|
|
1631
|
+
), /* @__PURE__ */ React15.createElement("div", { className: "px-6 pb-6 space-y-4 overflow-y-auto flex-1" }, event?.location && /* @__PURE__ */ React15.createElement(
|
|
1632
|
+
motion2.div,
|
|
1511
1633
|
{
|
|
1512
1634
|
initial: { opacity: 0, y: 10 },
|
|
1513
1635
|
animate: { opacity: 1, y: 0 },
|
|
1514
1636
|
className: "flex items-start gap-3 p-4 rounded-2xl bg-muted/30 border border-border/30 group hover:bg-muted/50 transition-all cursor-pointer"
|
|
1515
1637
|
},
|
|
1516
|
-
/* @__PURE__ */
|
|
1517
|
-
/* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
-
), event?.guests && event.guests.length > 0 && /* @__PURE__ */
|
|
1520
|
-
|
|
1638
|
+
/* @__PURE__ */ React15.createElement("div", { className: "p-2 bg-primary/10 rounded-xl" }, /* @__PURE__ */ React15.createElement(MapPin, { className: "w-5 h-5 text-primary" })),
|
|
1639
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React15.createElement("p", { className: "text-sm font-medium text-foreground" }, event.location), /* @__PURE__ */ React15.createElement("p", { className: "text-xs text-muted-foreground mt-0.5" }, "Click to open in maps")),
|
|
1640
|
+
/* @__PURE__ */ React15.createElement(ExternalLink, { className: "w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
|
|
1641
|
+
), event?.guests && event.guests.length > 0 && /* @__PURE__ */ React15.createElement(
|
|
1642
|
+
motion2.div,
|
|
1521
1643
|
{
|
|
1522
1644
|
initial: { opacity: 0, y: 10 },
|
|
1523
1645
|
animate: { opacity: 1, y: 0 },
|
|
1524
1646
|
transition: { delay: 0.05 },
|
|
1525
1647
|
className: "space-y-3"
|
|
1526
1648
|
},
|
|
1527
|
-
/* @__PURE__ */
|
|
1528
|
-
/* @__PURE__ */
|
|
1649
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement(Users2, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15.createElement("span", { className: "text-sm font-medium text-foreground" }, event.guests.length, " ", event.guests.length > 1 ? "Guests" : "Guest"))),
|
|
1650
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex flex-wrap gap-2" }, event.guests.map((email, index) => /* @__PURE__ */ React15.createElement(
|
|
1529
1651
|
"div",
|
|
1530
1652
|
{
|
|
1531
1653
|
key: index,
|
|
1532
1654
|
className: "flex items-center gap-2 px-3 py-2 rounded-xl bg-muted/30 border border-border/30 hover:bg-muted/50 transition-all cursor-pointer group"
|
|
1533
1655
|
},
|
|
1534
|
-
/* @__PURE__ */
|
|
1656
|
+
/* @__PURE__ */ React15.createElement(
|
|
1535
1657
|
"div",
|
|
1536
1658
|
{
|
|
1537
1659
|
className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold text-white",
|
|
@@ -1539,18 +1661,18 @@ var EventModal = ({
|
|
|
1539
1661
|
},
|
|
1540
1662
|
email[0].toUpperCase()
|
|
1541
1663
|
),
|
|
1542
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React15.createElement("p", { className: "text-sm font-medium text-foreground" }, email.split("@")[0]), /* @__PURE__ */ React15.createElement("p", { className: "text-xs text-muted-foreground truncate" }, email))
|
|
1543
1665
|
)))
|
|
1544
|
-
), event?.reminders && event.reminders.length > 0 && /* @__PURE__ */
|
|
1545
|
-
|
|
1666
|
+
), event?.reminders && event.reminders.length > 0 && /* @__PURE__ */ React15.createElement(
|
|
1667
|
+
motion2.div,
|
|
1546
1668
|
{
|
|
1547
1669
|
initial: { opacity: 0, y: 10 },
|
|
1548
1670
|
animate: { opacity: 1, y: 0 },
|
|
1549
1671
|
transition: { delay: 0.1 },
|
|
1550
1672
|
className: "flex items-center gap-3"
|
|
1551
1673
|
},
|
|
1552
|
-
/* @__PURE__ */
|
|
1553
|
-
/* @__PURE__ */
|
|
1674
|
+
/* @__PURE__ */ React15.createElement("div", { className: "p-2 bg-amber-500/10 rounded-xl" }, /* @__PURE__ */ React15.createElement(Bell2, { className: "w-4 h-4 text-amber-500" })),
|
|
1675
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex flex-wrap gap-2" }, event.reminders.map((reminder) => /* @__PURE__ */ React15.createElement(
|
|
1554
1676
|
"span",
|
|
1555
1677
|
{
|
|
1556
1678
|
key: reminder.id,
|
|
@@ -1558,45 +1680,45 @@ var EventModal = ({
|
|
|
1558
1680
|
},
|
|
1559
1681
|
reminder.label || `${reminder.time} min before`
|
|
1560
1682
|
)))
|
|
1561
|
-
), event?.description && /* @__PURE__ */
|
|
1562
|
-
|
|
1683
|
+
), event?.description && /* @__PURE__ */ React15.createElement(
|
|
1684
|
+
motion2.div,
|
|
1563
1685
|
{
|
|
1564
1686
|
initial: { opacity: 0, y: 10 },
|
|
1565
1687
|
animate: { opacity: 1, y: 0 },
|
|
1566
1688
|
transition: { delay: 0.15 },
|
|
1567
1689
|
className: "space-y-2"
|
|
1568
1690
|
},
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
-
/* @__PURE__ */
|
|
1571
|
-
), event?.attachments && event.attachments.length > 0 && /* @__PURE__ */
|
|
1572
|
-
|
|
1691
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement(AlignLeft, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15.createElement("span", { className: "text-sm font-medium text-foreground" }, "Notes")),
|
|
1692
|
+
/* @__PURE__ */ React15.createElement("div", { className: "text-sm text-foreground/80 whitespace-pre-wrap leading-relaxed pl-6 p-3 rounded-xl bg-muted/20 border border-border/30" }, event.description)
|
|
1693
|
+
), event?.attachments && event.attachments.length > 0 && /* @__PURE__ */ React15.createElement(
|
|
1694
|
+
motion2.div,
|
|
1573
1695
|
{
|
|
1574
1696
|
initial: { opacity: 0, y: 10 },
|
|
1575
1697
|
animate: { opacity: 1, y: 0 },
|
|
1576
1698
|
transition: { delay: 0.2 },
|
|
1577
1699
|
className: "space-y-2"
|
|
1578
1700
|
},
|
|
1579
|
-
/* @__PURE__ */
|
|
1580
|
-
/* @__PURE__ */
|
|
1701
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement(Paperclip2, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15.createElement("span", { className: "text-sm font-medium text-foreground" }, "Attachments")),
|
|
1702
|
+
/* @__PURE__ */ React15.createElement("div", { className: "grid gap-2" }, event.attachments.map((att) => /* @__PURE__ */ React15.createElement(
|
|
1581
1703
|
"div",
|
|
1582
1704
|
{
|
|
1583
1705
|
key: att.id,
|
|
1584
1706
|
onClick: () => handleDownload(att),
|
|
1585
1707
|
className: "flex items-center gap-3 p-3 rounded-xl border border-border/30 bg-muted/20 hover:bg-muted/40 transition-all cursor-pointer group"
|
|
1586
1708
|
},
|
|
1587
|
-
/* @__PURE__ */
|
|
1588
|
-
/* @__PURE__ */
|
|
1589
|
-
/* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ React15.createElement("div", { className: "p-2 bg-primary/10 rounded-lg" }, /* @__PURE__ */ React15.createElement(File, { className: "w-4 h-4 text-primary" })),
|
|
1710
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React15.createElement("p", { className: "text-sm font-medium text-foreground truncate" }, att.name), /* @__PURE__ */ React15.createElement("p", { className: "text-xs text-muted-foreground" }, att.size)),
|
|
1711
|
+
/* @__PURE__ */ React15.createElement(Download, { className: "w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
|
|
1590
1712
|
)))
|
|
1591
1713
|
)));
|
|
1592
|
-
const renderEditMode = () => /* @__PURE__ */
|
|
1714
|
+
const renderEditMode = () => /* @__PURE__ */ React15.createElement("form", { onSubmit: handleSubmit, className: "flex flex-col bg-background overflow-hidden w-full max-h-[85vh]" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center justify-between px-5 py-4 border-b border-border/50 shrink-0" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React15.createElement(
|
|
1593
1715
|
"button",
|
|
1594
1716
|
{
|
|
1595
1717
|
type: "button",
|
|
1596
1718
|
onClick: () => setIsColorPickerOpen(!isColorPickerOpen),
|
|
1597
1719
|
className: "relative p-1"
|
|
1598
1720
|
},
|
|
1599
|
-
/* @__PURE__ */
|
|
1721
|
+
/* @__PURE__ */ React15.createElement(
|
|
1600
1722
|
"div",
|
|
1601
1723
|
{
|
|
1602
1724
|
className: "w-5 h-5 rounded-full cursor-pointer hover:scale-110 transition-transform",
|
|
@@ -1606,7 +1728,7 @@ var EventModal = ({
|
|
|
1606
1728
|
}
|
|
1607
1729
|
}
|
|
1608
1730
|
),
|
|
1609
|
-
isColorPickerOpen && /* @__PURE__ */
|
|
1731
|
+
isColorPickerOpen && /* @__PURE__ */ React15.createElement("div", { className: "absolute top-full left-0 mt-2 p-2 bg-background border border-border rounded-xl shadow-xl z-50 flex flex-wrap gap-1.5 w-[180px]" }, COLOR_PALETTE.map((color) => /* @__PURE__ */ React15.createElement(
|
|
1610
1732
|
"button",
|
|
1611
1733
|
{
|
|
1612
1734
|
key: color,
|
|
@@ -1622,15 +1744,15 @@ var EventModal = ({
|
|
|
1622
1744
|
style: { backgroundColor: color, color }
|
|
1623
1745
|
}
|
|
1624
1746
|
)))
|
|
1625
|
-
), /* @__PURE__ */
|
|
1747
|
+
), /* @__PURE__ */ React15.createElement("h2", { className: "text-lg font-semibold text-foreground" }, mode === "edit" ? "Edit Event" : "New Event")), /* @__PURE__ */ React15.createElement(
|
|
1626
1748
|
"button",
|
|
1627
1749
|
{
|
|
1628
1750
|
type: "button",
|
|
1629
1751
|
onClick: onClose,
|
|
1630
1752
|
className: "p-2 hover:bg-accent rounded-xl transition-all text-muted-foreground hover:text-foreground"
|
|
1631
1753
|
},
|
|
1632
|
-
/* @__PURE__ */
|
|
1633
|
-
)), /* @__PURE__ */
|
|
1754
|
+
/* @__PURE__ */ React15.createElement(X2, { className: "w-4 h-4" })
|
|
1755
|
+
)), /* @__PURE__ */ React15.createElement("div", { className: "flex-1 overflow-y-auto" }, /* @__PURE__ */ React15.createElement("div", { className: "px-5 py-4 space-y-5" }, /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
|
|
1634
1756
|
"input",
|
|
1635
1757
|
{
|
|
1636
1758
|
type: "text",
|
|
@@ -1641,7 +1763,7 @@ var EventModal = ({
|
|
|
1641
1763
|
onChange: (e) => setFormData({ ...formData, title: e.target.value }),
|
|
1642
1764
|
placeholder: "Add title"
|
|
1643
1765
|
}
|
|
1644
|
-
)), /* @__PURE__ */
|
|
1766
|
+
)), /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-3 p-4 rounded-2xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React15.createElement("div", { className: "p-2 bg-primary/10 rounded-xl shrink-0" }, /* @__PURE__ */ React15.createElement(Clock2, { className: "w-5 h-5 text-primary" })), /* @__PURE__ */ React15.createElement("div", { className: "flex-1 grid grid-cols-2 gap-3" }, /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement("label", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1 block" }, "Start"), /* @__PURE__ */ React15.createElement(
|
|
1645
1767
|
"input",
|
|
1646
1768
|
{
|
|
1647
1769
|
type: "datetime-local",
|
|
@@ -1649,7 +1771,7 @@ var EventModal = ({
|
|
|
1649
1771
|
value: formatDateForInput(formData.start),
|
|
1650
1772
|
onChange: (e) => handleDateChange("start", e.target.value)
|
|
1651
1773
|
}
|
|
1652
|
-
)), /* @__PURE__ */
|
|
1774
|
+
)), /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement("label", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1 block" }, "End"), /* @__PURE__ */ React15.createElement(
|
|
1653
1775
|
"input",
|
|
1654
1776
|
{
|
|
1655
1777
|
type: "datetime-local",
|
|
@@ -1657,16 +1779,16 @@ var EventModal = ({
|
|
|
1657
1779
|
value: formatDateForInput(formData.end),
|
|
1658
1780
|
onChange: (e) => handleDateChange("end", e.target.value)
|
|
1659
1781
|
}
|
|
1660
|
-
)))), getDurationText() && /* @__PURE__ */
|
|
1782
|
+
)))), getDurationText() && /* @__PURE__ */ React15.createElement("div", { className: "flex justify-center" }, /* @__PURE__ */ React15.createElement("span", { className: "text-xs font-medium px-3 py-1 rounded-full bg-primary/10 text-primary" }, getDurationText())), /* @__PURE__ */ React15.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement(Bell2, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15.createElement("span", { className: "text-sm font-medium text-foreground" }, "Reminders")), /* @__PURE__ */ React15.createElement("div", { className: "relative" }, /* @__PURE__ */ React15.createElement(
|
|
1661
1783
|
"button",
|
|
1662
1784
|
{
|
|
1663
1785
|
type: "button",
|
|
1664
1786
|
onClick: () => setIsReminderDropdownOpen(!isReminderDropdownOpen),
|
|
1665
1787
|
className: "flex items-center gap-1 text-xs font-medium text-primary hover:text-primary/80 transition-colors"
|
|
1666
1788
|
},
|
|
1667
|
-
/* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ React15.createElement(Plus3, { className: "w-3.5 h-3.5" }),
|
|
1668
1790
|
"Add"
|
|
1669
|
-
), isReminderDropdownOpen && /* @__PURE__ */
|
|
1791
|
+
), isReminderDropdownOpen && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsReminderDropdownOpen(false) }), /* @__PURE__ */ React15.createElement("div", { className: "absolute right-0 top-full mt-1 w-48 bg-background border border-border rounded-xl shadow-xl z-50 py-1 max-h-60 overflow-y-auto" }, REMINDER_OPTIONS.map((option) => /* @__PURE__ */ React15.createElement(
|
|
1670
1792
|
"button",
|
|
1671
1793
|
{
|
|
1672
1794
|
key: option.value,
|
|
@@ -1675,58 +1797,58 @@ var EventModal = ({
|
|
|
1675
1797
|
className: "w-full px-3 py-2 text-left text-sm hover:bg-accent transition-colors"
|
|
1676
1798
|
},
|
|
1677
1799
|
option.label
|
|
1678
|
-
)))))), formData.reminders && formData.reminders.length > 0 && /* @__PURE__ */
|
|
1800
|
+
)))))), formData.reminders && formData.reminders.length > 0 && /* @__PURE__ */ React15.createElement("div", { className: "flex flex-wrap gap-2" }, formData.reminders.map((reminder) => /* @__PURE__ */ React15.createElement(
|
|
1679
1801
|
"div",
|
|
1680
1802
|
{
|
|
1681
1803
|
key: reminder.id,
|
|
1682
1804
|
className: "flex items-center gap-2 px-3 py-1.5 rounded-full bg-amber-500/10 border border-amber-500/20"
|
|
1683
1805
|
},
|
|
1684
|
-
/* @__PURE__ */
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
/* @__PURE__ */
|
|
1806
|
+
/* @__PURE__ */ React15.createElement(BellRing, { className: "w-3.5 h-3.5 text-amber-500" }),
|
|
1807
|
+
/* @__PURE__ */ React15.createElement("span", { className: "text-xs font-medium text-amber-600 dark:text-amber-400" }, reminder.label),
|
|
1808
|
+
/* @__PURE__ */ React15.createElement(
|
|
1687
1809
|
"button",
|
|
1688
1810
|
{
|
|
1689
1811
|
type: "button",
|
|
1690
1812
|
onClick: () => removeReminder(reminder.id),
|
|
1691
1813
|
className: "p-0.5 hover:bg-amber-500/20 rounded-full transition-colors"
|
|
1692
1814
|
},
|
|
1693
|
-
/* @__PURE__ */
|
|
1815
|
+
/* @__PURE__ */ React15.createElement(X2, { className: "w-3 h-3 text-amber-500" })
|
|
1694
1816
|
)
|
|
1695
|
-
)))), /* @__PURE__ */
|
|
1817
|
+
)))), /* @__PURE__ */ React15.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement(Users2, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15.createElement("span", { className: "text-sm font-medium text-foreground" }, "Guests")), /* @__PURE__ */ React15.createElement("div", { className: "relative" }, /* @__PURE__ */ React15.createElement(
|
|
1696
1818
|
"button",
|
|
1697
1819
|
{
|
|
1698
1820
|
type: "button",
|
|
1699
1821
|
onClick: () => setIsGuestsDropdownOpen(!isGuestsDropdownOpen),
|
|
1700
1822
|
className: "w-full flex items-center justify-between px-4 py-3 bg-muted/20 border border-border/30 rounded-xl text-sm text-left hover:bg-muted/30 transition-all"
|
|
1701
1823
|
},
|
|
1702
|
-
/* @__PURE__ */
|
|
1703
|
-
/* @__PURE__ */
|
|
1704
|
-
), isGuestsDropdownOpen && /* @__PURE__ */
|
|
1824
|
+
/* @__PURE__ */ React15.createElement("span", { className: selectedGuests.length > 0 ? "text-foreground font-medium" : "text-muted-foreground" }, selectedGuests.length > 0 ? `${selectedGuests.length} guest${selectedGuests.length > 1 ? "s" : ""} added` : "Add guests"),
|
|
1825
|
+
/* @__PURE__ */ React15.createElement(ChevronDown2, { className: cn("w-4 h-4 text-muted-foreground transition-transform", isGuestsDropdownOpen && "rotate-180") })
|
|
1826
|
+
), isGuestsDropdownOpen && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsGuestsDropdownOpen(false) }), /* @__PURE__ */ React15.createElement("div", { className: "absolute z-50 w-full mt-2 bg-background border border-border rounded-xl shadow-xl max-h-48 overflow-y-auto" }, fakeGuests.map((email) => /* @__PURE__ */ React15.createElement(
|
|
1705
1827
|
"div",
|
|
1706
1828
|
{
|
|
1707
1829
|
key: email,
|
|
1708
1830
|
className: "px-4 py-3 hover:bg-accent cursor-pointer flex items-center gap-3 transition-colors",
|
|
1709
1831
|
onClick: () => toggleGuest(email)
|
|
1710
1832
|
},
|
|
1711
|
-
/* @__PURE__ */
|
|
1833
|
+
/* @__PURE__ */ React15.createElement("div", { className: cn(
|
|
1712
1834
|
"w-5 h-5 rounded-md border-2 flex items-center justify-center transition-all",
|
|
1713
1835
|
selectedGuests.includes(email) ? "bg-primary border-primary" : "border-border"
|
|
1714
|
-
) }, selectedGuests.includes(email) && /* @__PURE__ */
|
|
1715
|
-
/* @__PURE__ */
|
|
1836
|
+
) }, selectedGuests.includes(email) && /* @__PURE__ */ React15.createElement(Check, { className: "w-3 h-3 text-primary-foreground" })),
|
|
1837
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement(
|
|
1716
1838
|
"div",
|
|
1717
1839
|
{
|
|
1718
1840
|
className: "w-7 h-7 rounded-full flex items-center justify-center text-xs font-semibold text-white",
|
|
1719
1841
|
style: { backgroundColor: `hsl(${fakeGuests.indexOf(email) * 60}, 70%, 50%)` }
|
|
1720
1842
|
},
|
|
1721
1843
|
email[0].toUpperCase()
|
|
1722
|
-
), /* @__PURE__ */
|
|
1723
|
-
))))), selectedGuests.length > 0 && /* @__PURE__ */
|
|
1844
|
+
), /* @__PURE__ */ React15.createElement("span", { className: "text-sm" }, email))
|
|
1845
|
+
))))), selectedGuests.length > 0 && /* @__PURE__ */ React15.createElement("div", { className: "flex flex-wrap gap-2 mt-2" }, selectedGuests.map((email) => /* @__PURE__ */ React15.createElement(
|
|
1724
1846
|
"div",
|
|
1725
1847
|
{
|
|
1726
1848
|
key: email,
|
|
1727
1849
|
className: "flex items-center gap-2 pl-1 pr-2 py-1 bg-muted/30 border border-border/30 rounded-full"
|
|
1728
1850
|
},
|
|
1729
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ React15.createElement(
|
|
1730
1852
|
"div",
|
|
1731
1853
|
{
|
|
1732
1854
|
className: "w-6 h-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",
|
|
@@ -1734,17 +1856,17 @@ var EventModal = ({
|
|
|
1734
1856
|
},
|
|
1735
1857
|
email[0].toUpperCase()
|
|
1736
1858
|
),
|
|
1737
|
-
/* @__PURE__ */
|
|
1738
|
-
/* @__PURE__ */
|
|
1859
|
+
/* @__PURE__ */ React15.createElement("span", { className: "text-xs font-medium text-foreground" }, email.split("@")[0]),
|
|
1860
|
+
/* @__PURE__ */ React15.createElement(
|
|
1739
1861
|
"button",
|
|
1740
1862
|
{
|
|
1741
1863
|
type: "button",
|
|
1742
1864
|
onClick: () => toggleGuest(email),
|
|
1743
1865
|
className: "p-0.5 hover:bg-destructive/10 rounded-full transition-colors"
|
|
1744
1866
|
},
|
|
1745
|
-
/* @__PURE__ */
|
|
1867
|
+
/* @__PURE__ */ React15.createElement(X2, { className: "w-3 h-3 text-muted-foreground" })
|
|
1746
1868
|
)
|
|
1747
|
-
)))), /* @__PURE__ */
|
|
1869
|
+
)))), /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-3 p-3 rounded-xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React15.createElement(MapPin, { className: "w-5 h-5 text-muted-foreground shrink-0" }), /* @__PURE__ */ React15.createElement(
|
|
1748
1870
|
"input",
|
|
1749
1871
|
{
|
|
1750
1872
|
type: "text",
|
|
@@ -1753,7 +1875,7 @@ var EventModal = ({
|
|
|
1753
1875
|
value: formData.location || "",
|
|
1754
1876
|
onChange: (e) => setFormData({ ...formData, location: e.target.value })
|
|
1755
1877
|
}
|
|
1756
|
-
)), /* @__PURE__ */
|
|
1878
|
+
)), /* @__PURE__ */ React15.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement(AlignLeft, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15.createElement("span", { className: "text-sm font-medium text-foreground" }, "Notes")), /* @__PURE__ */ React15.createElement(
|
|
1757
1879
|
"textarea",
|
|
1758
1880
|
{
|
|
1759
1881
|
className: "w-full bg-muted/20 border border-border/30 rounded-xl px-4 py-3 text-sm min-h-[100px] resize-none text-foreground placeholder-muted-foreground focus:border-primary focus:ring-2 focus:ring-primary/20 transition-all",
|
|
@@ -1761,7 +1883,7 @@ var EventModal = ({
|
|
|
1761
1883
|
value: formData.description || "",
|
|
1762
1884
|
onChange: (e) => setFormData({ ...formData, description: e.target.value })
|
|
1763
1885
|
}
|
|
1764
|
-
)), /* @__PURE__ */
|
|
1886
|
+
)), /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-3 p-3 rounded-xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React15.createElement(Repeat, { className: "w-5 h-5 text-muted-foreground shrink-0" }), /* @__PURE__ */ React15.createElement(
|
|
1765
1887
|
"select",
|
|
1766
1888
|
{
|
|
1767
1889
|
className: "flex-1 bg-transparent text-sm text-foreground focus:outline-none cursor-pointer",
|
|
@@ -1780,28 +1902,28 @@ var EventModal = ({
|
|
|
1780
1902
|
}
|
|
1781
1903
|
}
|
|
1782
1904
|
},
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
/* @__PURE__ */
|
|
1785
|
-
/* @__PURE__ */
|
|
1786
|
-
/* @__PURE__ */
|
|
1787
|
-
/* @__PURE__ */
|
|
1788
|
-
)), /* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ React15.createElement("option", { value: "" }, "Does not repeat"),
|
|
1906
|
+
/* @__PURE__ */ React15.createElement("option", { value: "DAILY" }, "Daily"),
|
|
1907
|
+
/* @__PURE__ */ React15.createElement("option", { value: "WEEKLY" }, "Weekly"),
|
|
1908
|
+
/* @__PURE__ */ React15.createElement("option", { value: "MONTHLY" }, "Monthly"),
|
|
1909
|
+
/* @__PURE__ */ React15.createElement("option", { value: "YEARLY" }, "Yearly")
|
|
1910
|
+
)), /* @__PURE__ */ React15.createElement("div", { className: "flex items-center justify-between p-3 rounded-xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement(Tag, { className: "w-5 h-5 text-muted-foreground" }), /* @__PURE__ */ React15.createElement("span", { className: "text-sm text-foreground" }, "Calendar")), /* @__PURE__ */ React15.createElement("div", { className: "relative" }, /* @__PURE__ */ React15.createElement(
|
|
1789
1911
|
"button",
|
|
1790
1912
|
{
|
|
1791
1913
|
type: "button",
|
|
1792
1914
|
onClick: () => setIsCalendarDropdownOpen(!isCalendarDropdownOpen),
|
|
1793
1915
|
className: "flex items-center gap-2 px-3 py-1.5 bg-background border border-border/50 rounded-lg text-sm hover:bg-accent/50 transition-all"
|
|
1794
1916
|
},
|
|
1795
|
-
/* @__PURE__ */
|
|
1917
|
+
/* @__PURE__ */ React15.createElement(
|
|
1796
1918
|
"div",
|
|
1797
1919
|
{
|
|
1798
1920
|
className: "w-3 h-3 rounded-full",
|
|
1799
1921
|
style: { backgroundColor: calendars?.find((c) => c.id === formData.calendarId)?.color || "#3b82f6" }
|
|
1800
1922
|
}
|
|
1801
1923
|
),
|
|
1802
|
-
/* @__PURE__ */
|
|
1803
|
-
/* @__PURE__ */
|
|
1804
|
-
), isCalendarDropdownOpen && /* @__PURE__ */
|
|
1924
|
+
/* @__PURE__ */ React15.createElement("span", { className: "font-medium" }, calendars?.find((c) => c.id === formData.calendarId)?.label || "Select"),
|
|
1925
|
+
/* @__PURE__ */ React15.createElement(ChevronDown2, { className: "w-3.5 h-3.5 text-muted-foreground" })
|
|
1926
|
+
), isCalendarDropdownOpen && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsCalendarDropdownOpen(false) }), /* @__PURE__ */ React15.createElement("div", { className: "absolute right-0 bottom-full mb-2 w-48 bg-background border border-border rounded-xl shadow-xl z-50 py-1" }, calendars?.map((cal) => /* @__PURE__ */ React15.createElement(
|
|
1805
1927
|
"button",
|
|
1806
1928
|
{
|
|
1807
1929
|
key: cal.id,
|
|
@@ -1816,19 +1938,19 @@ var EventModal = ({
|
|
|
1816
1938
|
setIsCalendarDropdownOpen(false);
|
|
1817
1939
|
}
|
|
1818
1940
|
},
|
|
1819
|
-
/* @__PURE__ */
|
|
1820
|
-
/* @__PURE__ */
|
|
1821
|
-
formData.calendarId === cal.id && /* @__PURE__ */
|
|
1822
|
-
)))))))), /* @__PURE__ */
|
|
1941
|
+
/* @__PURE__ */ React15.createElement("div", { className: "w-3 h-3 rounded-full", style: { backgroundColor: cal.color } }),
|
|
1942
|
+
/* @__PURE__ */ React15.createElement("span", { className: "flex-1 text-sm" }, cal.label),
|
|
1943
|
+
formData.calendarId === cal.id && /* @__PURE__ */ React15.createElement(Check, { className: "w-4 h-4 text-primary" })
|
|
1944
|
+
)))))))), /* @__PURE__ */ React15.createElement("div", { className: "px-5 py-4 border-t border-border/50 flex items-center justify-between bg-muted/10 shrink-0" }, mode === "edit" && /* @__PURE__ */ React15.createElement(
|
|
1823
1945
|
"button",
|
|
1824
1946
|
{
|
|
1825
1947
|
type: "button",
|
|
1826
1948
|
onClick: handleDelete,
|
|
1827
1949
|
className: "flex items-center gap-2 px-4 py-2 text-destructive hover:bg-destructive/10 rounded-xl transition-all text-sm font-medium"
|
|
1828
1950
|
},
|
|
1829
|
-
/* @__PURE__ */
|
|
1951
|
+
/* @__PURE__ */ React15.createElement(Trash2, { className: "w-4 h-4" }),
|
|
1830
1952
|
"Delete"
|
|
1831
|
-
), mode === "create" && /* @__PURE__ */
|
|
1953
|
+
), mode === "create" && /* @__PURE__ */ React15.createElement("div", null), /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement(
|
|
1832
1954
|
"button",
|
|
1833
1955
|
{
|
|
1834
1956
|
type: "button",
|
|
@@ -1836,7 +1958,7 @@ var EventModal = ({
|
|
|
1836
1958
|
className: "px-4 py-2.5 text-muted-foreground hover:text-foreground font-medium text-sm rounded-xl transition-all hover:bg-accent"
|
|
1837
1959
|
},
|
|
1838
1960
|
"Cancel"
|
|
1839
|
-
), /* @__PURE__ */
|
|
1961
|
+
), /* @__PURE__ */ React15.createElement(
|
|
1840
1962
|
"button",
|
|
1841
1963
|
{
|
|
1842
1964
|
type: "submit",
|
|
@@ -1844,8 +1966,8 @@ var EventModal = ({
|
|
|
1844
1966
|
},
|
|
1845
1967
|
mode === "edit" ? "Save Changes" : "Create Event"
|
|
1846
1968
|
))));
|
|
1847
|
-
return /* @__PURE__ */
|
|
1848
|
-
|
|
1969
|
+
return /* @__PURE__ */ React15.createElement(Modal, { isOpen, onClose, hideHeader: true, className: "p-0 overflow-hidden max-w-lg rounded-2xl shadow-2xl" }, /* @__PURE__ */ React15.createElement(AnimatePresence, { mode: "wait" }, mode === "view" && event ? /* @__PURE__ */ React15.createElement(
|
|
1970
|
+
motion2.div,
|
|
1849
1971
|
{
|
|
1850
1972
|
key: "view",
|
|
1851
1973
|
initial: { opacity: 0 },
|
|
@@ -1854,8 +1976,8 @@ var EventModal = ({
|
|
|
1854
1976
|
transition: { duration: 0.15 }
|
|
1855
1977
|
},
|
|
1856
1978
|
renderViewMode()
|
|
1857
|
-
) : /* @__PURE__ */
|
|
1858
|
-
|
|
1979
|
+
) : /* @__PURE__ */ React15.createElement(
|
|
1980
|
+
motion2.div,
|
|
1859
1981
|
{
|
|
1860
1982
|
key: "edit",
|
|
1861
1983
|
initial: { opacity: 0 },
|
|
@@ -1866,9 +1988,12 @@ var EventModal = ({
|
|
|
1866
1988
|
renderEditMode()
|
|
1867
1989
|
)));
|
|
1868
1990
|
};
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1991
|
+
|
|
1992
|
+
// src/components/Skeleton.tsx
|
|
1993
|
+
import React16 from "react";
|
|
1994
|
+
var Skeleton = ({ className, style }) => /* @__PURE__ */ React16.createElement("div", { className: cn("animate-pulse bg-muted/40 rounded", className), style });
|
|
1995
|
+
var MonthViewSkeleton = () => /* @__PURE__ */ React16.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden" }, /* @__PURE__ */ React16.createElement("div", { className: "grid grid-cols-7 border-b border-border/50 bg-muted/10" }, Array.from({ length: 7 }).map((_, i) => /* @__PURE__ */ React16.createElement("div", { key: i, className: "py-3 px-2 text-center border-r border-border/30 last:border-r-0" }, /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-4 w-8 mx-auto" })))), /* @__PURE__ */ React16.createElement("div", { className: "grid grid-cols-7 flex-1" }, Array.from({ length: 35 }).map((_, i) => /* @__PURE__ */ React16.createElement("div", { key: i, className: "min-h-[120px] border-r border-b border-border/30 p-2" }, /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-4 w-6 mb-2" }), /* @__PURE__ */ React16.createElement("div", { className: "space-y-1" }, Math.random() > 0.5 && /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-5 w-full rounded-md" }), Math.random() > 0.7 && /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-5 w-3/4 rounded-md" }))))));
|
|
1996
|
+
var WeekViewSkeleton = () => /* @__PURE__ */ React16.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden" }, /* @__PURE__ */ React16.createElement("div", { className: "flex border-b border-border/50 bg-muted/10" }, /* @__PURE__ */ React16.createElement("div", { className: "w-16 p-3 border-r border-border/30" }, /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-8 w-10 mx-auto" })), /* @__PURE__ */ React16.createElement("div", { className: "flex-1 grid grid-cols-7" }, Array.from({ length: 7 }).map((_, i) => /* @__PURE__ */ React16.createElement("div", { key: i, className: "py-3 px-2 text-center border-r border-border/30 last:border-r-0" }, /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-3 w-8 mx-auto mb-1" }), /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-8 w-8 mx-auto rounded-xl" }))))), /* @__PURE__ */ React16.createElement("div", { className: "flex flex-1", style: { height: "600px" } }, /* @__PURE__ */ React16.createElement("div", { className: "w-16 border-r border-border/30" }, Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ React16.createElement("div", { key: i, className: "h-[60px] relative" }, /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-4 w-10 absolute right-2 -translate-y-1/2" })))), /* @__PURE__ */ React16.createElement("div", { className: "flex-1 grid grid-cols-7 relative" }, Array.from({ length: 7 }).map((_, colIdx) => /* @__PURE__ */ React16.createElement("div", { key: colIdx, className: "relative border-r border-border/30 last:border-r-0" }, Array.from({ length: 10 }).map((_2, rowIdx) => /* @__PURE__ */ React16.createElement("div", { key: rowIdx, className: "h-[60px] border-b border-dashed border-border/20" })), Math.random() > 0.3 && /* @__PURE__ */ React16.createElement(
|
|
1872
1997
|
Skeleton,
|
|
1873
1998
|
{
|
|
1874
1999
|
className: "absolute rounded-md",
|
|
@@ -1880,20 +2005,25 @@ var WeekViewSkeleton = () => /* @__PURE__ */ React15__default.createElement("div
|
|
|
1880
2005
|
}
|
|
1881
2006
|
}
|
|
1882
2007
|
))))));
|
|
1883
|
-
var DayViewSkeleton = () => /* @__PURE__ */
|
|
2008
|
+
var DayViewSkeleton = () => /* @__PURE__ */ React16.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden" }, /* @__PURE__ */ React16.createElement("div", { className: "px-6 py-4 border-b border-border/50 bg-muted/10 text-center" }, /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-7 w-64 mx-auto" })), /* @__PURE__ */ React16.createElement("div", { className: "flex flex-1", style: { height: "600px" } }, /* @__PURE__ */ React16.createElement("div", { className: "w-20 border-r border-border/30 bg-muted/5" }, Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ React16.createElement("div", { key: i, className: "h-[80px] relative" }, /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-4 w-12 absolute left-1/2 -translate-x-1/2 -translate-y-1/2" })))), /* @__PURE__ */ React16.createElement("div", { className: "flex-1 relative" }, Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ React16.createElement("div", { key: i, className: "h-[80px] border-b border-dashed border-border/20" })), /* @__PURE__ */ React16.createElement(
|
|
1884
2009
|
Skeleton,
|
|
1885
2010
|
{
|
|
1886
2011
|
className: "absolute rounded-lg left-4 right-4",
|
|
1887
2012
|
style: { top: "160px", height: "120px" }
|
|
1888
2013
|
}
|
|
1889
|
-
), /* @__PURE__ */
|
|
2014
|
+
), /* @__PURE__ */ React16.createElement(
|
|
1890
2015
|
Skeleton,
|
|
1891
2016
|
{
|
|
1892
2017
|
className: "absolute rounded-lg left-4 right-4",
|
|
1893
2018
|
style: { top: "400px", height: "80px" }
|
|
1894
2019
|
}
|
|
1895
2020
|
))));
|
|
1896
|
-
var AgendaViewSkeleton = () => /* @__PURE__ */
|
|
2021
|
+
var AgendaViewSkeleton = () => /* @__PURE__ */ React16.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden p-6" }, /* @__PURE__ */ React16.createElement("div", { className: "space-y-6" }, Array.from({ length: 4 }).map((_, dayIdx) => /* @__PURE__ */ React16.createElement("div", { key: dayIdx }, /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-5 w-40 mb-4" }), /* @__PURE__ */ React16.createElement("div", { className: "space-y-3" }, Array.from({ length: 2 + Math.floor(Math.random() * 3) }).map((_2, eventIdx) => /* @__PURE__ */ React16.createElement("div", { key: eventIdx, className: "flex items-center gap-4 p-3 rounded-xl bg-muted/10" }, /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-10 w-10 rounded-lg" }), /* @__PURE__ */ React16.createElement("div", { className: "flex-1 space-y-2" }, /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-4 w-3/4" }), /* @__PURE__ */ React16.createElement(Skeleton, { className: "h-3 w-1/2" })))))))));
|
|
2022
|
+
|
|
2023
|
+
// src/components/ContextMenu.tsx
|
|
2024
|
+
import React17, { useState as useState4, useCallback as useCallback3, useEffect as useEffect4, useRef as useRef4 } from "react";
|
|
2025
|
+
import { Edit3, Trash2 as Trash22, Copy } from "lucide-react";
|
|
2026
|
+
import { AnimatePresence as AnimatePresence2, motion as motion3 } from "framer-motion";
|
|
1897
2027
|
var EventContextMenu = ({
|
|
1898
2028
|
event,
|
|
1899
2029
|
position,
|
|
@@ -1904,8 +2034,8 @@ var EventContextMenu = ({
|
|
|
1904
2034
|
customActions = [],
|
|
1905
2035
|
translations
|
|
1906
2036
|
}) => {
|
|
1907
|
-
const menuRef =
|
|
1908
|
-
|
|
2037
|
+
const menuRef = useRef4(null);
|
|
2038
|
+
useEffect4(() => {
|
|
1909
2039
|
const handleKeyDown = (e) => {
|
|
1910
2040
|
if (e.key === "Escape") {
|
|
1911
2041
|
onClose();
|
|
@@ -1916,7 +2046,7 @@ var EventContextMenu = ({
|
|
|
1916
2046
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1917
2047
|
}
|
|
1918
2048
|
}, [position, onClose]);
|
|
1919
|
-
|
|
2049
|
+
useEffect4(() => {
|
|
1920
2050
|
const handleClickOutside = (e) => {
|
|
1921
2051
|
if (menuRef.current && !menuRef.current.contains(e.target)) {
|
|
1922
2052
|
onClose();
|
|
@@ -1934,7 +2064,7 @@ var EventContextMenu = ({
|
|
|
1934
2064
|
...onEdit ? [{
|
|
1935
2065
|
id: "edit",
|
|
1936
2066
|
label: translations?.edit || "Edit",
|
|
1937
|
-
icon: /* @__PURE__ */
|
|
2067
|
+
icon: /* @__PURE__ */ React17.createElement(Edit3, { className: "w-4 h-4" }),
|
|
1938
2068
|
onClick: () => {
|
|
1939
2069
|
onEdit(event);
|
|
1940
2070
|
onClose();
|
|
@@ -1943,7 +2073,7 @@ var EventContextMenu = ({
|
|
|
1943
2073
|
...onDuplicate ? [{
|
|
1944
2074
|
id: "duplicate",
|
|
1945
2075
|
label: translations?.duplicate || "Duplicate",
|
|
1946
|
-
icon: /* @__PURE__ */
|
|
2076
|
+
icon: /* @__PURE__ */ React17.createElement(Copy, { className: "w-4 h-4" }),
|
|
1947
2077
|
onClick: () => {
|
|
1948
2078
|
onDuplicate(event);
|
|
1949
2079
|
onClose();
|
|
@@ -1953,7 +2083,7 @@ var EventContextMenu = ({
|
|
|
1953
2083
|
...onDelete ? [{
|
|
1954
2084
|
id: "delete",
|
|
1955
2085
|
label: translations?.delete || "Delete",
|
|
1956
|
-
icon: /* @__PURE__ */
|
|
2086
|
+
icon: /* @__PURE__ */ React17.createElement(Trash22, { className: "w-4 h-4" }),
|
|
1957
2087
|
onClick: () => {
|
|
1958
2088
|
onDelete(event.id);
|
|
1959
2089
|
onClose();
|
|
@@ -1965,8 +2095,8 @@ var EventContextMenu = ({
|
|
|
1965
2095
|
x: Math.min(position.x, window.innerWidth - 200),
|
|
1966
2096
|
y: Math.min(position.y, window.innerHeight - (actions.length * 44 + 80))
|
|
1967
2097
|
};
|
|
1968
|
-
return /* @__PURE__ */
|
|
1969
|
-
|
|
2098
|
+
return /* @__PURE__ */ React17.createElement(AnimatePresence2, null, /* @__PURE__ */ React17.createElement(
|
|
2099
|
+
motion3.div,
|
|
1970
2100
|
{
|
|
1971
2101
|
ref: menuRef,
|
|
1972
2102
|
initial: { opacity: 0, scale: 0.95, y: -5 },
|
|
@@ -1979,14 +2109,14 @@ var EventContextMenu = ({
|
|
|
1979
2109
|
top: adjustedPosition.y
|
|
1980
2110
|
}
|
|
1981
2111
|
},
|
|
1982
|
-
/* @__PURE__ */
|
|
2112
|
+
/* @__PURE__ */ React17.createElement("div", { className: "px-3 py-2 border-b-[0.5px] border-border bg-muted/30" }, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React17.createElement(
|
|
1983
2113
|
"div",
|
|
1984
2114
|
{
|
|
1985
2115
|
className: "w-2.5 h-2.5 rounded-full shrink-0",
|
|
1986
2116
|
style: { backgroundColor: event.color || "var(--primary)" }
|
|
1987
2117
|
}
|
|
1988
|
-
), /* @__PURE__ */
|
|
1989
|
-
/* @__PURE__ */
|
|
2118
|
+
), /* @__PURE__ */ React17.createElement("span", { className: "text-sm font-medium truncate text-foreground" }, event.title))),
|
|
2119
|
+
/* @__PURE__ */ React17.createElement("div", { className: "py-1" }, actions.map((action, index) => /* @__PURE__ */ React17.createElement(React17.Fragment, { key: action.id }, index > 0 && action.variant === "danger" && /* @__PURE__ */ React17.createElement("div", { className: "h-px bg-border my-1" }), /* @__PURE__ */ React17.createElement(
|
|
1990
2120
|
"button",
|
|
1991
2121
|
{
|
|
1992
2122
|
onClick: action.onClick,
|
|
@@ -1998,13 +2128,13 @@ var EventContextMenu = ({
|
|
|
1998
2128
|
)
|
|
1999
2129
|
},
|
|
2000
2130
|
action.icon,
|
|
2001
|
-
/* @__PURE__ */
|
|
2131
|
+
/* @__PURE__ */ React17.createElement("span", null, action.label)
|
|
2002
2132
|
))))
|
|
2003
2133
|
));
|
|
2004
2134
|
};
|
|
2005
2135
|
var useEventContextMenu = () => {
|
|
2006
|
-
const [contextMenu, setContextMenu] =
|
|
2007
|
-
const openContextMenu =
|
|
2136
|
+
const [contextMenu, setContextMenu] = useState4({ event: null, position: null });
|
|
2137
|
+
const openContextMenu = useCallback3((event, e) => {
|
|
2008
2138
|
e.preventDefault();
|
|
2009
2139
|
e.stopPropagation();
|
|
2010
2140
|
setContextMenu({
|
|
@@ -2012,7 +2142,7 @@ var useEventContextMenu = () => {
|
|
|
2012
2142
|
position: { x: e.clientX, y: e.clientY }
|
|
2013
2143
|
});
|
|
2014
2144
|
}, []);
|
|
2015
|
-
const closeContextMenu =
|
|
2145
|
+
const closeContextMenu = useCallback3(() => {
|
|
2016
2146
|
setContextMenu({ event: null, position: null });
|
|
2017
2147
|
}, []);
|
|
2018
2148
|
return {
|
|
@@ -2023,6 +2153,146 @@ var useEventContextMenu = () => {
|
|
|
2023
2153
|
};
|
|
2024
2154
|
};
|
|
2025
2155
|
|
|
2156
|
+
// src/locales/index.ts
|
|
2157
|
+
var en = {
|
|
2158
|
+
today: "Today",
|
|
2159
|
+
month: "Month",
|
|
2160
|
+
week: "Week",
|
|
2161
|
+
day: "Day",
|
|
2162
|
+
agenda: "Agenda",
|
|
2163
|
+
resource: "Resources",
|
|
2164
|
+
createEvent: "Create Event",
|
|
2165
|
+
editEvent: "Edit Event",
|
|
2166
|
+
delete: "Delete",
|
|
2167
|
+
save: "Save",
|
|
2168
|
+
cancel: "Cancel",
|
|
2169
|
+
title: "Add title",
|
|
2170
|
+
start: "Start",
|
|
2171
|
+
end: "End",
|
|
2172
|
+
allDay: "All Day",
|
|
2173
|
+
description: "Description",
|
|
2174
|
+
repeat: "Repeat",
|
|
2175
|
+
noRepeat: "Does not repeat",
|
|
2176
|
+
selectCalendar: "Select Calendar",
|
|
2177
|
+
selectType: "Select Type",
|
|
2178
|
+
daily: "Daily",
|
|
2179
|
+
weekly: "Weekly",
|
|
2180
|
+
monthly: "Monthly",
|
|
2181
|
+
yearly: "Yearly",
|
|
2182
|
+
search: "Search events...",
|
|
2183
|
+
allTypes: "All Types",
|
|
2184
|
+
timezone: "Time zone",
|
|
2185
|
+
localTime: "Local Time",
|
|
2186
|
+
create: "Create",
|
|
2187
|
+
calendars: "Calendars",
|
|
2188
|
+
event: "Event",
|
|
2189
|
+
task: "Task",
|
|
2190
|
+
appointmentSchedule: "Appointment schedule",
|
|
2191
|
+
new: "New",
|
|
2192
|
+
dateAndTime: "Date & Time",
|
|
2193
|
+
whosJoining: "Who's joining?",
|
|
2194
|
+
suggestedTimes: "Suggested times for guests",
|
|
2195
|
+
viewSuggestions: "View suggestions",
|
|
2196
|
+
whereWillItBe: "Where will it be?",
|
|
2197
|
+
location: "Enter address",
|
|
2198
|
+
descriptionAndAttachments: "Description",
|
|
2199
|
+
dragAndDrop: "Drag & drop files or",
|
|
2200
|
+
guests: "Guests",
|
|
2201
|
+
addGuests: "Add guests",
|
|
2202
|
+
addAttachment: "Upload files",
|
|
2203
|
+
moreOptions: "More options",
|
|
2204
|
+
doesNotRepeat: "Does not repeat",
|
|
2205
|
+
locationHelpText: 'Enter a physical address (e.g. "123 Main St") to generate the map.',
|
|
2206
|
+
notes: "Notes...",
|
|
2207
|
+
guestCount: "guest",
|
|
2208
|
+
guestsCount: "guests",
|
|
2209
|
+
repeatFor: "Repeat for",
|
|
2210
|
+
times: "times",
|
|
2211
|
+
until: "Until",
|
|
2212
|
+
endRepeat: "End repeat",
|
|
2213
|
+
never: "Never",
|
|
2214
|
+
afterOccurrences: "After occurrences",
|
|
2215
|
+
onDate: "On date",
|
|
2216
|
+
tomorrow: "Tomorrow",
|
|
2217
|
+
edit: "Edit",
|
|
2218
|
+
duplicate: "Duplicate",
|
|
2219
|
+
eventSingular: "event",
|
|
2220
|
+
eventPlural: "events",
|
|
2221
|
+
allCaughtUp: "All caught up!",
|
|
2222
|
+
noEventsScheduled: "No events scheduled",
|
|
2223
|
+
noUpcoming: "Your schedule is clear",
|
|
2224
|
+
noUpcomingHint: "No upcoming events to show. Create a new event to start planning."
|
|
2225
|
+
};
|
|
2226
|
+
var fr = {
|
|
2227
|
+
today: "Aujourd'hui",
|
|
2228
|
+
month: "Mois",
|
|
2229
|
+
week: "Semaine",
|
|
2230
|
+
day: "Jour",
|
|
2231
|
+
agenda: "Agenda",
|
|
2232
|
+
resource: "Ressources",
|
|
2233
|
+
createEvent: "Cr\xE9er un \xE9v\xE9nement",
|
|
2234
|
+
editEvent: "Modifier l'\xE9v\xE9nement",
|
|
2235
|
+
delete: "Supprimer",
|
|
2236
|
+
save: "Enregistrer",
|
|
2237
|
+
cancel: "Annuler",
|
|
2238
|
+
title: "Ajouter un titre",
|
|
2239
|
+
start: "D\xE9but",
|
|
2240
|
+
end: "Fin",
|
|
2241
|
+
allDay: "Toute la journ\xE9e",
|
|
2242
|
+
description: "Description",
|
|
2243
|
+
repeat: "R\xE9p\xE9ter",
|
|
2244
|
+
noRepeat: "Ne se r\xE9p\xE8te pas",
|
|
2245
|
+
selectCalendar: "S\xE9lectionner un calendrier",
|
|
2246
|
+
selectType: "S\xE9lectionner un type",
|
|
2247
|
+
daily: "Quotidien",
|
|
2248
|
+
weekly: "Hebdomadaire",
|
|
2249
|
+
monthly: "Mensuel",
|
|
2250
|
+
yearly: "Annuel",
|
|
2251
|
+
search: "Rechercher...",
|
|
2252
|
+
allTypes: "Tous les types",
|
|
2253
|
+
timezone: "Fuseau horaire",
|
|
2254
|
+
localTime: "Heure locale",
|
|
2255
|
+
create: "Cr\xE9er",
|
|
2256
|
+
calendars: "Calendriers",
|
|
2257
|
+
event: "\xC9v\xE9nement",
|
|
2258
|
+
task: "T\xE2che",
|
|
2259
|
+
appointmentSchedule: "Planning de rendez-vous",
|
|
2260
|
+
new: "Nouveau",
|
|
2261
|
+
dateAndTime: "Date et heure",
|
|
2262
|
+
whosJoining: "Qui participe ?",
|
|
2263
|
+
suggestedTimes: "Horaires sugg\xE9r\xE9s",
|
|
2264
|
+
viewSuggestions: "Voir les suggestions",
|
|
2265
|
+
whereWillItBe: "O\xF9 aura lieu ?",
|
|
2266
|
+
location: "Entrer une adresse",
|
|
2267
|
+
descriptionAndAttachments: "Description",
|
|
2268
|
+
dragAndDrop: "Glisser-d\xE9poser des fichiers ou",
|
|
2269
|
+
guests: "Invit\xE9s",
|
|
2270
|
+
addGuests: "Ajouter des invit\xE9s",
|
|
2271
|
+
addAttachment: "T\xE9l\xE9charger des fichiers",
|
|
2272
|
+
moreOptions: "Plus d'options",
|
|
2273
|
+
doesNotRepeat: "Ne se r\xE9p\xE8te pas",
|
|
2274
|
+
locationHelpText: 'Entrez une adresse physique (ex: "123 Rue Principale") pour g\xE9n\xE9rer la carte.',
|
|
2275
|
+
notes: "Notes...",
|
|
2276
|
+
guestCount: "invit\xE9",
|
|
2277
|
+
guestsCount: "invit\xE9s",
|
|
2278
|
+
repeatFor: "R\xE9p\xE9ter pendant",
|
|
2279
|
+
times: "fois",
|
|
2280
|
+
until: "Jusqu'au",
|
|
2281
|
+
endRepeat: "Fin de r\xE9p\xE9tition",
|
|
2282
|
+
never: "Jamais",
|
|
2283
|
+
afterOccurrences: "Apr\xE8s occurrences",
|
|
2284
|
+
onDate: "\xC0 la date",
|
|
2285
|
+
tomorrow: "Demain",
|
|
2286
|
+
edit: "Modifier",
|
|
2287
|
+
duplicate: "Dupliquer",
|
|
2288
|
+
eventSingular: "\xE9v\xE9nement",
|
|
2289
|
+
eventPlural: "\xE9v\xE9nements",
|
|
2290
|
+
allCaughtUp: "Tout est \xE0 jour !",
|
|
2291
|
+
noEventsScheduled: "Aucun \xE9v\xE9nement pr\xE9vu",
|
|
2292
|
+
noUpcoming: "Votre planning est libre",
|
|
2293
|
+
noUpcomingHint: "Aucun \xE9v\xE9nement \xE0 venir. Cr\xE9ez un nouvel \xE9v\xE9nement pour commencer \xE0 planifier."
|
|
2294
|
+
};
|
|
2295
|
+
|
|
2026
2296
|
// src/lib/theme.ts
|
|
2027
2297
|
function colorToHsl(color) {
|
|
2028
2298
|
let r = 0, g = 0, b = 0;
|
|
@@ -2048,7 +2318,7 @@ function colorToHsl(color) {
|
|
|
2048
2318
|
const min = Math.min(r, g, b);
|
|
2049
2319
|
let h = 0;
|
|
2050
2320
|
let s = 0;
|
|
2051
|
-
|
|
2321
|
+
const l = (max + min) / 2;
|
|
2052
2322
|
if (max !== min) {
|
|
2053
2323
|
const d = max - min;
|
|
2054
2324
|
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
@@ -2101,6 +2371,20 @@ function getThemeStyles(theme) {
|
|
|
2101
2371
|
}
|
|
2102
2372
|
return styles;
|
|
2103
2373
|
}
|
|
2374
|
+
|
|
2375
|
+
// src/hooks/useCalendarLogic.ts
|
|
2376
|
+
import { useState as useState5, useMemo as useMemo3 } from "react";
|
|
2377
|
+
import {
|
|
2378
|
+
addMonths as addMonths2,
|
|
2379
|
+
subMonths as subMonths2,
|
|
2380
|
+
addWeeks,
|
|
2381
|
+
subWeeks,
|
|
2382
|
+
addDays as addDays2,
|
|
2383
|
+
subDays,
|
|
2384
|
+
differenceInMilliseconds
|
|
2385
|
+
} from "date-fns";
|
|
2386
|
+
import { toZonedTime as toZonedTime5, fromZonedTime } from "date-fns-tz";
|
|
2387
|
+
import { RRule } from "rrule";
|
|
2104
2388
|
var useCalendarLogic = ({
|
|
2105
2389
|
events,
|
|
2106
2390
|
view: controlledView,
|
|
@@ -2114,18 +2398,18 @@ var useCalendarLogic = ({
|
|
|
2114
2398
|
readOnly,
|
|
2115
2399
|
timezone
|
|
2116
2400
|
}) => {
|
|
2117
|
-
const [internalView, setInternalView] =
|
|
2118
|
-
const [internalDate, setInternalDate] =
|
|
2119
|
-
const [isSidebarOpen, setIsSidebarOpen] =
|
|
2120
|
-
const [isModalOpen, setIsModalOpen] =
|
|
2121
|
-
const [selectedEvent, setSelectedEvent] =
|
|
2122
|
-
const [modalInitialDate, setModalInitialDate] =
|
|
2401
|
+
const [internalView, setInternalView] = useState5("week");
|
|
2402
|
+
const [internalDate, setInternalDate] = useState5(/* @__PURE__ */ new Date());
|
|
2403
|
+
const [isSidebarOpen, setIsSidebarOpen] = useState5(true);
|
|
2404
|
+
const [isModalOpen, setIsModalOpen] = useState5(false);
|
|
2405
|
+
const [selectedEvent, setSelectedEvent] = useState5(null);
|
|
2406
|
+
const [modalInitialDate, setModalInitialDate] = useState5(void 0);
|
|
2123
2407
|
const view = controlledView ?? internalView;
|
|
2124
2408
|
const currentDate = controlledDate ?? internalDate;
|
|
2125
|
-
const expandedEvents =
|
|
2409
|
+
const expandedEvents = useMemo3(() => {
|
|
2126
2410
|
const allEvents = [];
|
|
2127
2411
|
const rangeStart = subDays(currentDate, 365);
|
|
2128
|
-
const rangeEnd =
|
|
2412
|
+
const rangeEnd = addDays2(currentDate, 365);
|
|
2129
2413
|
events.forEach((event) => {
|
|
2130
2414
|
if (event.recurrence) {
|
|
2131
2415
|
try {
|
|
@@ -2176,7 +2460,7 @@ var useCalendarLogic = ({
|
|
|
2176
2460
|
const handlePrev = () => {
|
|
2177
2461
|
switch (view) {
|
|
2178
2462
|
case "month":
|
|
2179
|
-
handleDateChange(
|
|
2463
|
+
handleDateChange(subMonths2(currentDate, 1));
|
|
2180
2464
|
break;
|
|
2181
2465
|
case "week":
|
|
2182
2466
|
handleDateChange(subWeeks(currentDate, 1));
|
|
@@ -2193,17 +2477,17 @@ var useCalendarLogic = ({
|
|
|
2193
2477
|
const handleNext = () => {
|
|
2194
2478
|
switch (view) {
|
|
2195
2479
|
case "month":
|
|
2196
|
-
handleDateChange(
|
|
2480
|
+
handleDateChange(addMonths2(currentDate, 1));
|
|
2197
2481
|
break;
|
|
2198
2482
|
case "week":
|
|
2199
2483
|
handleDateChange(addWeeks(currentDate, 1));
|
|
2200
2484
|
break;
|
|
2201
2485
|
case "day":
|
|
2202
2486
|
case "resource":
|
|
2203
|
-
handleDateChange(
|
|
2487
|
+
handleDateChange(addDays2(currentDate, 1));
|
|
2204
2488
|
break;
|
|
2205
2489
|
case "agenda":
|
|
2206
|
-
handleDateChange(
|
|
2490
|
+
handleDateChange(addDays2(currentDate, 7));
|
|
2207
2491
|
break;
|
|
2208
2492
|
}
|
|
2209
2493
|
};
|
|
@@ -2275,7 +2559,7 @@ var useCalendarLogic = ({
|
|
|
2275
2559
|
let newStart;
|
|
2276
2560
|
if (view === "month") {
|
|
2277
2561
|
if (timezone) {
|
|
2278
|
-
const zonedOriginal =
|
|
2562
|
+
const zonedOriginal = toZonedTime5(originalStart, timezone);
|
|
2279
2563
|
const zonedNew = new Date(overDate);
|
|
2280
2564
|
zonedNew.setHours(zonedOriginal.getHours());
|
|
2281
2565
|
zonedNew.setMinutes(zonedOriginal.getMinutes());
|
|
@@ -2340,6 +2624,12 @@ var useCalendarLogic = ({
|
|
|
2340
2624
|
handleDragEnd
|
|
2341
2625
|
};
|
|
2342
2626
|
};
|
|
2627
|
+
|
|
2628
|
+
// src/index.tsx
|
|
2629
|
+
import { differenceInMinutes as differenceInMinutes6, format as format11 } from "date-fns";
|
|
2630
|
+
|
|
2631
|
+
// src/hooks/useSwipeGesture.ts
|
|
2632
|
+
import { useRef as useRef5, useCallback as useCallback4, useEffect as useEffect5 } from "react";
|
|
2343
2633
|
var useSwipeGesture = (options) => {
|
|
2344
2634
|
const {
|
|
2345
2635
|
onSwipeLeft,
|
|
@@ -2351,9 +2641,9 @@ var useSwipeGesture = (options) => {
|
|
|
2351
2641
|
allowedTime = 500,
|
|
2352
2642
|
enabled = true
|
|
2353
2643
|
} = options;
|
|
2354
|
-
const touchInfoRef =
|
|
2355
|
-
const elementRef =
|
|
2356
|
-
const handleTouchStart =
|
|
2644
|
+
const touchInfoRef = useRef5(null);
|
|
2645
|
+
const elementRef = useRef5(null);
|
|
2646
|
+
const handleTouchStart = useCallback4((e) => {
|
|
2357
2647
|
if (!enabled) return;
|
|
2358
2648
|
const touch = e.touches[0];
|
|
2359
2649
|
touchInfoRef.current = {
|
|
@@ -2362,7 +2652,7 @@ var useSwipeGesture = (options) => {
|
|
|
2362
2652
|
startTime: Date.now()
|
|
2363
2653
|
};
|
|
2364
2654
|
}, [enabled]);
|
|
2365
|
-
const handleTouchEnd =
|
|
2655
|
+
const handleTouchEnd = useCallback4((e) => {
|
|
2366
2656
|
if (!enabled || !touchInfoRef.current) return;
|
|
2367
2657
|
const touch = e.changedTouches[0];
|
|
2368
2658
|
const { startX, startY, startTime } = touchInfoRef.current;
|
|
@@ -2386,7 +2676,7 @@ var useSwipeGesture = (options) => {
|
|
|
2386
2676
|
}
|
|
2387
2677
|
touchInfoRef.current = null;
|
|
2388
2678
|
}, [enabled, threshold, restraint, allowedTime, onSwipeLeft, onSwipeRight, onSwipeUp, onSwipeDown]);
|
|
2389
|
-
|
|
2679
|
+
useEffect5(() => {
|
|
2390
2680
|
const element = elementRef.current;
|
|
2391
2681
|
if (!element) return;
|
|
2392
2682
|
element.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
@@ -2442,7 +2732,7 @@ var Scheduler = ({
|
|
|
2442
2732
|
locale
|
|
2443
2733
|
// Date-fns locale
|
|
2444
2734
|
}) => {
|
|
2445
|
-
const [activeDragEvent, setActiveDragEvent] =
|
|
2735
|
+
const [activeDragEvent, setActiveDragEvent] = useState6(null);
|
|
2446
2736
|
const {
|
|
2447
2737
|
contextMenuEvent,
|
|
2448
2738
|
contextMenuPosition,
|
|
@@ -2509,33 +2799,12 @@ var Scheduler = ({
|
|
|
2509
2799
|
};
|
|
2510
2800
|
const id = useId();
|
|
2511
2801
|
const swipeRef = useViewSwipe(handlePrev, handleNext, true);
|
|
2802
|
+
const languagePack = language === "fr" ? fr : en;
|
|
2512
2803
|
const t = {
|
|
2513
|
-
|
|
2514
|
-
month: "Month",
|
|
2515
|
-
week: "Week",
|
|
2516
|
-
day: "Day",
|
|
2517
|
-
agenda: "Agenda",
|
|
2518
|
-
resource: "Resource",
|
|
2519
|
-
createEvent: "Create Event",
|
|
2520
|
-
editEvent: "Edit Event",
|
|
2521
|
-
delete: "Delete",
|
|
2522
|
-
save: "Save",
|
|
2523
|
-
cancel: "Cancel",
|
|
2524
|
-
title: "Title",
|
|
2525
|
-
start: "Start",
|
|
2526
|
-
end: "End",
|
|
2527
|
-
allDay: "All Day",
|
|
2528
|
-
description: "Description",
|
|
2529
|
-
repeat: "Repeat",
|
|
2530
|
-
noRepeat: "Does not repeat",
|
|
2531
|
-
selectCalendar: "Select Calendar",
|
|
2532
|
-
selectType: "Select Type",
|
|
2533
|
-
daily: "Daily",
|
|
2534
|
-
weekly: "Weekly",
|
|
2535
|
-
monthly: "Monthly",
|
|
2536
|
-
yearly: "Yearly",
|
|
2804
|
+
...languagePack,
|
|
2537
2805
|
...translations
|
|
2538
2806
|
};
|
|
2807
|
+
const overlayTimeFormat = uses24HourClock(locale) ? "H:mm" : "h:mm a";
|
|
2539
2808
|
const handleDragStart = (event) => {
|
|
2540
2809
|
const { active } = event;
|
|
2541
2810
|
const draggedEvent = expandedEvents.find((e) => e.id === active.id);
|
|
@@ -2553,20 +2822,20 @@ var Scheduler = ({
|
|
|
2553
2822
|
return 80;
|
|
2554
2823
|
}
|
|
2555
2824
|
if (view !== "week" && view !== "day") return void 0;
|
|
2556
|
-
const duration =
|
|
2825
|
+
const duration = differenceInMinutes6(activeDragEvent.end, activeDragEvent.start);
|
|
2557
2826
|
const hourHeight = view === "day" ? 80 : 60;
|
|
2558
2827
|
return duration / 60 * hourHeight;
|
|
2559
2828
|
};
|
|
2560
2829
|
const getDragWidth = () => {
|
|
2561
2830
|
if (view === "month") return "100%";
|
|
2562
2831
|
if (view === "resource" && activeDragEvent) {
|
|
2563
|
-
const duration =
|
|
2832
|
+
const duration = differenceInMinutes6(activeDragEvent.end, activeDragEvent.start);
|
|
2564
2833
|
const width = duration / 60 * 100;
|
|
2565
2834
|
return `${Math.max(width, 4)}px`;
|
|
2566
2835
|
}
|
|
2567
2836
|
return "150px";
|
|
2568
2837
|
};
|
|
2569
|
-
const filteredEvents =
|
|
2838
|
+
const filteredEvents = useMemo4(() => {
|
|
2570
2839
|
if (!calendars) return expandedEvents;
|
|
2571
2840
|
const activeCalendarIds = calendars.filter((c) => c.active !== false).map((c) => c.id);
|
|
2572
2841
|
return expandedEvents.filter((e) => {
|
|
@@ -2574,7 +2843,7 @@ var Scheduler = ({
|
|
|
2574
2843
|
return activeCalendarIds.includes(e.calendarId);
|
|
2575
2844
|
});
|
|
2576
2845
|
}, [expandedEvents, calendars]);
|
|
2577
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2578
2847
|
DndContext,
|
|
2579
2848
|
{
|
|
2580
2849
|
id,
|
|
@@ -2583,13 +2852,13 @@ var Scheduler = ({
|
|
|
2583
2852
|
onDragEnd: onDragEndWrapper,
|
|
2584
2853
|
modifiers
|
|
2585
2854
|
},
|
|
2586
|
-
/* @__PURE__ */
|
|
2855
|
+
/* @__PURE__ */ React18.createElement(
|
|
2587
2856
|
"div",
|
|
2588
2857
|
{
|
|
2589
2858
|
className: cn("flex flex-col h-full bg-background text-foreground relative", className),
|
|
2590
2859
|
style: getThemeStyles(theme)
|
|
2591
2860
|
},
|
|
2592
|
-
/* @__PURE__ */
|
|
2861
|
+
/* @__PURE__ */ React18.createElement(
|
|
2593
2862
|
CalendarHeader,
|
|
2594
2863
|
{
|
|
2595
2864
|
currentDate,
|
|
@@ -2608,8 +2877,8 @@ var Scheduler = ({
|
|
|
2608
2877
|
locale
|
|
2609
2878
|
}
|
|
2610
2879
|
),
|
|
2611
|
-
/* @__PURE__ */
|
|
2612
|
-
|
|
2880
|
+
/* @__PURE__ */ React18.createElement("div", { className: "flex flex-1 overflow-hidden" }, /* @__PURE__ */ React18.createElement(
|
|
2881
|
+
motion4.div,
|
|
2613
2882
|
{
|
|
2614
2883
|
className: cn(
|
|
2615
2884
|
"hidden md:block overflow-hidden"
|
|
@@ -2624,7 +2893,7 @@ var Scheduler = ({
|
|
|
2624
2893
|
ease: [0.4, 0, 0.2, 1]
|
|
2625
2894
|
}
|
|
2626
2895
|
},
|
|
2627
|
-
/* @__PURE__ */
|
|
2896
|
+
/* @__PURE__ */ React18.createElement(
|
|
2628
2897
|
Sidebar,
|
|
2629
2898
|
{
|
|
2630
2899
|
currentDate,
|
|
@@ -2637,11 +2906,12 @@ var Scheduler = ({
|
|
|
2637
2906
|
readOnly,
|
|
2638
2907
|
calendars,
|
|
2639
2908
|
onCalendarToggle,
|
|
2640
|
-
translations: t
|
|
2909
|
+
translations: t,
|
|
2910
|
+
locale
|
|
2641
2911
|
}
|
|
2642
2912
|
)
|
|
2643
|
-
), /* @__PURE__ */
|
|
2644
|
-
|
|
2913
|
+
), /* @__PURE__ */ React18.createElement("div", { className: "flex-1 flex flex-col overflow-hidden relative" }, isLoading ? /* @__PURE__ */ React18.createElement("div", { className: "flex-1 overflow-auto p-0 md:p-4" }, /* @__PURE__ */ React18.createElement("div", { className: "h-full min-w-full" }, view === "month" && /* @__PURE__ */ React18.createElement(MonthViewSkeleton, null), view === "week" && /* @__PURE__ */ React18.createElement(WeekViewSkeleton, null), view === "day" && /* @__PURE__ */ React18.createElement(DayViewSkeleton, null), view === "agenda" && /* @__PURE__ */ React18.createElement(AgendaViewSkeleton, null), view === "resource" && /* @__PURE__ */ React18.createElement(WeekViewSkeleton, null))) : /* @__PURE__ */ React18.createElement("div", { ref: swipeRef, className: "flex-1 overflow-auto p-0 md:p-4 touch-pan-y" }, /* @__PURE__ */ React18.createElement("div", { className: "h-full min-w-full" }, /* @__PURE__ */ React18.createElement(AnimatePresence3, { mode: "wait", initial: false }, /* @__PURE__ */ React18.createElement(
|
|
2914
|
+
motion4.div,
|
|
2645
2915
|
{
|
|
2646
2916
|
key: `${view}-${currentDate.toISOString()}-${timezone || "local"}`,
|
|
2647
2917
|
initial: { opacity: 0, scale: 0.98, y: 15 },
|
|
@@ -2665,7 +2935,7 @@ var Scheduler = ({
|
|
|
2665
2935
|
},
|
|
2666
2936
|
className: "h-full"
|
|
2667
2937
|
},
|
|
2668
|
-
view === "month" && /* @__PURE__ */
|
|
2938
|
+
view === "month" && /* @__PURE__ */ React18.createElement(
|
|
2669
2939
|
MonthView,
|
|
2670
2940
|
{
|
|
2671
2941
|
currentDate,
|
|
@@ -2676,7 +2946,7 @@ var Scheduler = ({
|
|
|
2676
2946
|
locale
|
|
2677
2947
|
}
|
|
2678
2948
|
),
|
|
2679
|
-
view === "week" && /* @__PURE__ */
|
|
2949
|
+
view === "week" && /* @__PURE__ */ React18.createElement(
|
|
2680
2950
|
WeekView,
|
|
2681
2951
|
{
|
|
2682
2952
|
currentDate,
|
|
@@ -2689,7 +2959,7 @@ var Scheduler = ({
|
|
|
2689
2959
|
readonly: readOnly
|
|
2690
2960
|
}
|
|
2691
2961
|
),
|
|
2692
|
-
view === "day" && /* @__PURE__ */
|
|
2962
|
+
view === "day" && /* @__PURE__ */ React18.createElement(
|
|
2693
2963
|
DayView,
|
|
2694
2964
|
{
|
|
2695
2965
|
currentDate,
|
|
@@ -2702,36 +2972,38 @@ var Scheduler = ({
|
|
|
2702
2972
|
readonly: readOnly
|
|
2703
2973
|
}
|
|
2704
2974
|
),
|
|
2705
|
-
view === "agenda" && /* @__PURE__ */
|
|
2975
|
+
view === "agenda" && /* @__PURE__ */ React18.createElement(
|
|
2706
2976
|
AgendaView,
|
|
2707
2977
|
{
|
|
2708
2978
|
currentDate,
|
|
2709
2979
|
events: filteredEvents,
|
|
2710
2980
|
onEventClick: handleEventClickInternal,
|
|
2711
|
-
onCreateEvent: handleCreateEvent
|
|
2981
|
+
onCreateEvent: handleCreateEvent,
|
|
2982
|
+
locale,
|
|
2983
|
+
translations: t
|
|
2712
2984
|
}
|
|
2713
2985
|
),
|
|
2714
|
-
view === "resource" && resources && /* @__PURE__ */
|
|
2986
|
+
view === "resource" && resources && /* @__PURE__ */ React18.createElement(
|
|
2715
2987
|
ResourceView,
|
|
2716
2988
|
{
|
|
2717
2989
|
currentDate,
|
|
2718
2990
|
events: filteredEvents,
|
|
2719
2991
|
resources,
|
|
2720
2992
|
onEventClick: handleEventClickInternal,
|
|
2721
|
-
onTimeSlotClick: (date
|
|
2993
|
+
onTimeSlotClick: (date) => {
|
|
2722
2994
|
if (readOnly) return;
|
|
2723
2995
|
handleTimeSlotClick(date);
|
|
2724
2996
|
},
|
|
2725
2997
|
locale
|
|
2726
2998
|
}
|
|
2727
2999
|
)
|
|
2728
|
-
)))), /* @__PURE__ */
|
|
3000
|
+
)))), /* @__PURE__ */ React18.createElement("div", { className: "md:hidden absolute bottom-6 right-6 z-50" }, /* @__PURE__ */ React18.createElement(
|
|
2729
3001
|
"button",
|
|
2730
3002
|
{
|
|
2731
3003
|
onClick: handleCreateEvent,
|
|
2732
3004
|
className: "w-14 h-14 bg-blue-600 rounded-full shadow-lg flex items-center justify-center text-white active:scale-90 transition-transform"
|
|
2733
3005
|
},
|
|
2734
|
-
/* @__PURE__ */
|
|
3006
|
+
/* @__PURE__ */ React18.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React18.createElement("path", { d: "M5 12h14" }), /* @__PURE__ */ React18.createElement("path", { d: "M12 5v14" }))
|
|
2735
3007
|
)))),
|
|
2736
3008
|
renderEventForm ? renderEventForm({
|
|
2737
3009
|
isOpen: isModalOpen,
|
|
@@ -2740,7 +3012,7 @@ var Scheduler = ({
|
|
|
2740
3012
|
initialDate: modalInitialDate,
|
|
2741
3013
|
onSave: handleModalSave,
|
|
2742
3014
|
onDelete: handleModalDelete
|
|
2743
|
-
}) : /* @__PURE__ */
|
|
3015
|
+
}) : /* @__PURE__ */ React18.createElement(
|
|
2744
3016
|
EventModal,
|
|
2745
3017
|
{
|
|
2746
3018
|
isOpen: isModalOpen,
|
|
@@ -2754,7 +3026,7 @@ var Scheduler = ({
|
|
|
2754
3026
|
translations: t
|
|
2755
3027
|
}
|
|
2756
3028
|
),
|
|
2757
|
-
/* @__PURE__ */
|
|
3029
|
+
/* @__PURE__ */ React18.createElement(
|
|
2758
3030
|
EventContextMenu,
|
|
2759
3031
|
{
|
|
2760
3032
|
event: contextMenuEvent,
|
|
@@ -2781,13 +3053,13 @@ var Scheduler = ({
|
|
|
2781
3053
|
closeContextMenu();
|
|
2782
3054
|
},
|
|
2783
3055
|
translations: {
|
|
2784
|
-
edit: t.editEvent || "Edit",
|
|
3056
|
+
edit: t.edit || t.editEvent || "Edit",
|
|
2785
3057
|
delete: t.delete || "Delete",
|
|
2786
|
-
duplicate: "Duplicate"
|
|
3058
|
+
duplicate: t.duplicate || "Duplicate"
|
|
2787
3059
|
}
|
|
2788
3060
|
}
|
|
2789
3061
|
),
|
|
2790
|
-
/* @__PURE__ */
|
|
3062
|
+
/* @__PURE__ */ React18.createElement(DragOverlay, { dropAnimation: null }, activeDragEvent ? /* @__PURE__ */ React18.createElement(
|
|
2791
3063
|
"div",
|
|
2792
3064
|
{
|
|
2793
3065
|
className: cn(
|
|
@@ -2805,18 +3077,18 @@ var Scheduler = ({
|
|
|
2805
3077
|
transform: "rotate(-2deg) scale(1.02)"
|
|
2806
3078
|
}
|
|
2807
3079
|
},
|
|
2808
|
-
/* @__PURE__ */
|
|
3080
|
+
/* @__PURE__ */ React18.createElement("div", { className: "p-2.5 h-full flex flex-col" }, /* @__PURE__ */ React18.createElement(
|
|
2809
3081
|
"div",
|
|
2810
3082
|
{
|
|
2811
3083
|
className: "absolute left-0 top-0 bottom-0 w-1 rounded-l-lg",
|
|
2812
3084
|
style: { backgroundColor: activeDragEvent.color || "var(--primary)" }
|
|
2813
3085
|
}
|
|
2814
|
-
), /* @__PURE__ */
|
|
3086
|
+
), /* @__PURE__ */ React18.createElement("div", { className: "pl-2" }, /* @__PURE__ */ React18.createElement("div", { className: "font-semibold truncate text-sm" }, activeDragEvent.title), (view === "week" || view === "day") && getDragHeight() && getDragHeight() > 40 && /* @__PURE__ */ React18.createElement("div", { className: "text-xs opacity-80 mt-0.5 flex items-center gap-1" }, /* @__PURE__ */ React18.createElement("svg", { className: "w-3 h-3", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ React18.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React18.createElement("path", { d: "M12 6v6l4 2" })), format11(activeDragEvent.start, overlayTimeFormat, { locale }), " - ", format11(activeDragEvent.end, overlayTimeFormat, { locale }))), /* @__PURE__ */ React18.createElement("div", { className: "absolute bottom-1.5 right-1.5 opacity-60" }, /* @__PURE__ */ React18.createElement("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React18.createElement("circle", { cx: "9", cy: "5", r: "1.5" }), /* @__PURE__ */ React18.createElement("circle", { cx: "15", cy: "5", r: "1.5" }), /* @__PURE__ */ React18.createElement("circle", { cx: "9", cy: "12", r: "1.5" }), /* @__PURE__ */ React18.createElement("circle", { cx: "15", cy: "12", r: "1.5" }), /* @__PURE__ */ React18.createElement("circle", { cx: "9", cy: "19", r: "1.5" }), /* @__PURE__ */ React18.createElement("circle", { cx: "15", cy: "19", r: "1.5" }))))
|
|
2815
3087
|
) : null)
|
|
2816
3088
|
)
|
|
2817
3089
|
);
|
|
2818
3090
|
};
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
3091
|
+
export {
|
|
3092
|
+
Scheduler,
|
|
3093
|
+
cn
|
|
3094
|
+
};
|