Your favorite shift management application!
feat: update ShiftStats component styles and default state, enhance ColorPicker with translations and improved UI, refactor Dialog component for better container handling, and update localization files for German and English languages
panteLx9ac573eb1899
diff --git a/app/layout.tsx b/app/layout.tsxindex 5600dc5..2fe3e3c 100644--- a/app/layout.tsx+++ b/app/layout.tsx@@ -1,7 +1,8 @@-import type { Metadata } from "next";+import type { Metadata, Viewport } from "next";import { Geist, Geist_Mono } from "next/font/google";import { NextIntlClientProvider } from "next-intl";import { getMessages, getLocale } from "next-intl/server";+import { Toaster } from "sonner";import "./globals.css";const geistSans = Geist({@@ -19,6 +20,14 @@ export const metadata: Metadata = {description: "Manage your work shifts with ease",};+export const viewport: Viewport = {+ width: "device-width",+ initialScale: 1,+ maximumScale: 1,+ userScalable: false,+ themeColor: [{ media: "(prefers-color-scheme: dark)", color: "#0a0a0a" }],+};+export default async function RootLayout({children,}: Readonly<{@@ -34,6 +43,18 @@ export default async function RootLayout({><NextIntlClientProvider messages={messages} locale={locale}>{children}+ <Toaster+ position="bottom-left"+ richColors+ closeButton+ theme="dark"+ toastOptions={{+ className: "text-sm",+ style: {+ padding: "12px 16px",+ },+ }}+ /></NextIntlClientProvider></body></html>diff --git a/app/page.tsx b/app/page.tsxindex a78e44f..7e98c70 100644--- a/app/page.tsx+++ b/app/page.tsx@@ -27,6 +27,8 @@ import {Plus,ChevronLeft,ChevronRight,+ ChevronUp,+ ChevronDown,Calendar as CalendarIcon,StickyNote,} from "lucide-react";@@ -45,6 +47,8 @@ import {import { de, enUS } from "date-fns/locale";import { ShiftPreset, CalendarNote } from "@/lib/db/schema";import { formatDateToLocal } from "@/lib/date-utils";+import { toast } from "sonner";+import { motion, AnimatePresence } from "motion/react";function HomeContent() {const router = useRouter();@@ -87,6 +91,7 @@ function HomeContent() {const [loading, setLoading] = useState(true);const [statsRefreshTrigger, setStatsRefreshTrigger] = useState(0);const [isTogglingShift, setIsTogglingShift] = useState(false);+ const [showShiftsSection, setShowShiftsSection] = useState(false);const pollingIntervalRef = useRef<NodeJS.Timeout | null>(null);// Fetch calendars on mount and setup cleanup@@ -218,8 +223,10 @@ function HomeContent() {const newCalendar = await response.json();setCalendars([...calendars, newCalendar]);setSelectedCalendar(newCalendar.id);+ toast.success(t("calendar.created"));} catch (error) {console.error("Failed to create calendar:", error);+ toast.error(t("calendar.createError"));}};@@ -241,7 +248,7 @@ function HomeContent() {const response = await fetch(url, { method: "DELETE" });if (response.status === 401) {- alert(t("password.errorIncorrect"));+ toast.error(t("password.errorIncorrect"));return;}@@ -261,9 +268,11 @@ function HomeContent() {setShowDeleteCalendarDialog(false);setCalendarToDelete(undefined);+ toast.success(t("calendar.deleted"));}} catch (error) {console.error("Failed to delete calendar:", error);+ toast.error(t("calendar.deleteError"));}};@@ -303,11 +312,13 @@ function HomeContent() {setShifts((shifts) =>shifts.map((s) => (s.id === tempId ? newShift : s)));+ toast.success(t("shift.created"));} catch (error) {console.error("Failed to create shift:", error);// Rollback optimistic update on errorsetShifts((shifts) => shifts.filter((s) => s.id !== tempId));setStatsRefreshTrigger((prev) => prev + 1);+ toast.error(t("shift.createError"));}};@@ -334,8 +345,10 @@ function HomeContent() {const updatedShift = await response.json();setShifts(shifts.map((s) => (s.id === id ? updatedShift : s)));setStatsRefreshTrigger((prev) => prev + 1);+ toast.success(t("shift.updated"));} catch (error) {console.error("Failed to update shift:", error);+ toast.error(t("shift.updateError"));}};@@ -361,8 +374,10 @@ function HomeContent() {setShifts(shifts.filter((s) => s.id !== id));setStatsRefreshTrigger((prev) => prev + 1);+ toast.success(t("shift.deleted"));} catch (error) {console.error("Failed to delete shift:", error);+ toast.error(t("shift.deleteError"));}};@@ -431,8 +446,10 @@ function HomeContent() {});const newNote = await response.json();setNotes([...notes, newNote]);+ toast.success(t("note.created"));} catch (error) {console.error("Failed to create note:", error);+ toast.error(t("note.createError"));}};@@ -445,8 +462,10 @@ function HomeContent() {});const updatedNote = await response.json();setNotes(notes.map((n) => (n.id === noteId ? updatedNote : n)));+ toast.success(t("note.updated"));} catch (error) {console.error("Failed to update note:", error);+ toast.error(t("note.updateError"));}};@@ -454,8 +473,10 @@ function HomeContent() {try {await fetch(`/api/notes/${noteId}`, { method: "DELETE" });setNotes(notes.filter((n) => n.id !== noteId));+ toast.success(t("note.deleted"));} catch (error) {console.error("Failed to delete note:", error);+ toast.error(t("note.deleteError"));}};@@ -513,6 +534,46 @@ function HomeContent() {createShift(formData);};+ const handleManualShiftCreation = async () => {+ if (!selectedCalendar) return;++ try {+ const password = localStorage.getItem(+ `calendar_password_${selectedCalendar}`+ );++ // Verify password if calendar is protected+ const response = await fetch(+ `/api/calendars/${selectedCalendar}/verify-password`,+ {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ password }),+ }+ );++ const data = await response.json();++ if (data.protected && !data.valid) {+ // Password required or invalid+ localStorage.removeItem(`calendar_password_${selectedCalendar}`);+ setPendingAction({+ type: "edit",+ presetAction: handleManualShiftCreation,+ });+ setShowPasswordDialog(true);+ return;+ }++ // Password valid or not required, open shift dialog+ setSelectedDate(new Date());+ setShowShiftDialog(true);+ } catch (error) {+ console.error("Failed to verify password:", error);+ toast.error(t("password.errorVerification"));+ }+ };+const handleAddShift = async (date: Date) => {// Prevent multiple simultaneous toggles (debouncing)if (isTogglingShift) return;@@ -590,12 +651,16 @@ function HomeContent() {// Rollback on errorsetShifts(shifts);setStatsRefreshTrigger((prev) => prev + 1);+ toast.error(t("shift.deleteError"));+ } else {+ toast.success(t("shift.deleted"));}} catch (error) {console.error("Failed to delete shift:", error);// Rollback on errorsetShifts(shifts);setStatsRefreshTrigger((prev) => prev + 1);+ toast.error(t("shift.deleteError"));}} else {// Toggle: add the shift@@ -637,8 +702,28 @@ function HomeContent() {if (loading) {return (- <div className="min-h-screen flex items-center justify-center">- <div className="text-muted-foreground">Loading...</div>+ <div className="min-h-screen flex items-center justify-center bg-gradient-to-b from-background to-muted/20">+ <motion.div+ className="text-center space-y-4"+ initial={{ opacity: 0, scale: 0.9 }}+ animate={{ opacity: 1, scale: 1 }}+ >+ <motion.div+ animate={{+ rotate: 360,+ }}+ transition={{+ duration: 2,+ repeat: Infinity,+ ease: "linear",+ }}+ >+ <CalendarIcon className="h-12 w-12 sm:h-16 sm:w-16 mx-auto text-primary" />+ </motion.div>+ <p className="text-sm sm:text-base text-muted-foreground font-medium">+ {t("common.loading")}+ </p>+ </motion.div></div>);}@@ -647,17 +732,38 @@ function HomeContent() {return (<div className="min-h-screen flex flex-col"><div className="flex-1 flex items-center justify-center p-4">- <div className="text-center space-y-4 max-w-md">- <CalendarIcon className="h-16 w-16 mx-auto text-muted-foreground" />- <h1 className="text-2xl font-bold">{t("onboarding.welcome")}</h1>- <p className="text-muted-foreground">- {t("onboarding.description")}- </p>- <Button onClick={() => setShowCalendarDialog(true)} size="lg">- <Plus className="mr-2 h-4 w-4" />- {t("onboarding.createCalendar")}- </Button>- </div>+ <motion.div+ className="text-center space-y-6 max-w-md"+ initial={{ opacity: 0, y: 20 }}+ animate={{ opacity: 1, y: 0 }}+ >+ <motion.div+ initial={{ scale: 0 }}+ animate={{ scale: 1 }}+ transition={{ delay: 0.1, type: "spring", stiffness: 200 }}+ className="w-20 h-20 mx-auto rounded-full bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center"+ >+ <CalendarIcon className="h-10 w-10 text-primary" />+ </motion.div>+ <div className="space-y-3">+ <h1 className="text-2xl sm:text-3xl font-bold">+ {t("onboarding.welcome")}+ </h1>+ <p className="text-muted-foreground text-sm sm:text-base leading-relaxed">+ {t("onboarding.description")}+ </p>+ </div>+ <motion.div whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }}>+ <Button+ onClick={() => setShowCalendarDialog(true)}+ size="lg"+ className="h-12 px-8 text-base font-semibold shadow-lg shadow-primary/20"+ >+ <Plus className="mr-2 h-5 w-5" />+ {t("onboarding.createCalendar")}+ </Button>+ </motion.div>+ </motion.div></div><div className="border-t bg-background"><div className="container max-w-4xl mx-auto p-3 sm:p-4 flex justify-center">@@ -676,32 +782,55 @@ function HomeContent() {return (<div className="min-h-screen flex flex-col">{/* Header - Desktop: Horizontal, Mobile: Compact with Dialog */}- <div className="sticky top-0 z-10 bg-gradient-to-b from-background via-background to-background/95 border-b shadow-sm">+ <div className="sticky top-0 z-10 bg-background/80 backdrop-blur-xl border-b border-border/50 shadow-sm"><div className="container max-w-4xl mx-auto p-3 sm:p-4"><div className="space-y-3 sm:space-y-4">{/* Desktop: Logo + Calendar Selector in one line */}<div className="hidden sm:flex items-center justify-between gap-4">{/* Logo Section */}- <div className="flex items-center gap-3">+ <motion.div+ className="flex items-center gap-3"+ initial={{ opacity: 0, x: -20 }}+ animate={{ opacity: 1, x: 0 }}+ transition={{ duration: 0.3 }}+ ><div className="relative shrink-0">- <div className="w-11 h-11 rounded-xl bg-gradient-to-br from-primary via-primary/90 to-primary/70 flex items-center justify-center shadow-lg shadow-primary/20 ring-2 ring-primary/10">- <CalendarIcon className="h-5 w-5 text-primary-foreground" />+ <div className="w-12 h-12 rounded-2xl bg-gradient-to-br from-primary via-primary/90 to-primary/70 flex items-center justify-center shadow-xl shadow-primary/30 ring-2 ring-primary/20">+ <CalendarIcon className="h-6 w-6 text-primary-foreground" /></div>- <div className="absolute -bottom-1 -right-1 w-3.5 h-3.5 bg-green-500 rounded-full border-2 border-background"></div>+ <div className="absolute -bottom-0.5 -right-0.5 w-4 h-4 bg-green-500 rounded-full border-2 border-background animate-pulse"></div></div><div>- <h1 className="text-xl font-bold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text text-transparent">+ <h1 className="text-xl font-bold bg-gradient-to-r from-foreground via-foreground to-foreground/70 bg-clip-text">{t("app.title")}</h1>- <p className="text-xs text-muted-foreground">+ <p className="text-xs text-muted-foreground font-medium">{t("app.subtitle", { default: "Organize your shifts" })}</p></div>- </div>+ </motion.div>{/* Calendar Selector - Desktop */}- <div className="flex items-center gap-2 min-w-0 flex-1 max-w-md">- <div className="w-1 h-8 bg-primary rounded-full"></div>+ <motion.div+ className="flex items-center gap-3 min-w-0 flex-1 max-w-md bg-muted/30 rounded-xl p-2 border border-border/50"+ initial={{ opacity: 0, x: 20 }}+ animate={{ opacity: 1, x: 0 }}+ transition={{ duration: 0.3, delay: 0.1 }}+ >+ <div+ className="w-1 h-8 bg-gradient-to-b rounded-full transition-colors duration-300"+ style={{+ backgroundImage: selectedCalendar+ ? `linear-gradient(to bottom, ${+ calendars.find((c) => c.id === selectedCalendar)+ ?.color || "hsl(var(--primary))"+ }, ${+ calendars.find((c) => c.id === selectedCalendar)+ ?.color || "hsl(var(--primary))"+ }80)`+ : "linear-gradient(to bottom, hsl(var(--primary)), hsl(var(--primary) / 0.5))",+ }}+ ></div><div className="flex-1 min-w-0"><CalendarSelectorcalendars={calendars}@@ -712,26 +841,39 @@ function HomeContent() {onDelete={initiateDeleteCalendar}/></div>- </div>+ </motion.div></div>{/* Mobile: Logo Icon + Calendar Card */}<div className="sm:hidden flex items-center gap-2">{/* Logo Icon Only */}<div className="relative shrink-0">- <div className="w-9 h-9 rounded-xl bg-gradient-to-br from-primary via-primary/90 to-primary/70 flex items-center justify-center shadow-lg shadow-primary/20 ring-2 ring-primary/10">- <CalendarIcon className="h-4.5 w-4.5 text-primary-foreground" />+ <div className="w-10 h-10 rounded-xl bg-gradient-to-br from-primary via-primary/90 to-primary/70 flex items-center justify-center shadow-lg shadow-primary/30 ring-2 ring-primary/20">+ <CalendarIcon className="h-5 w-5 text-primary-foreground" /></div>- <div className="absolute -bottom-1 -right-1 w-2.5 h-2.5 bg-green-500 rounded-full border-2 border-background"></div>+ <div className="absolute -bottom-0.5 -right-0.5 w-3 h-3 bg-green-500 rounded-full border-2 border-background"></div></div>{/* Calendar Selection Card */}<buttononClick={() => setShowMobileCalendarDialog(true)}- className="flex-1 bg-card/50 backdrop-blur-sm border rounded-lg p-2.5 flex items-center justify-between gap-2 hover:bg-accent/50 transition-colors active:scale-[0.98]"+ className="flex-1 bg-muted/30 backdrop-blur-sm border border-border/50 rounded-xl p-3 flex items-center justify-between gap-2 hover:bg-accent/50 transition-all active:scale-[0.98] shadow-sm">- <div className="flex items-center gap-2 min-w-0 flex-1">- <div className="w-1 h-8 bg-primary rounded-full"></div>+ <div className="flex items-center gap-2.5 min-w-0 flex-1">+ <div+ className="w-1 h-9 bg-gradient-to-b rounded-full transition-colors duration-300"+ style={{+ backgroundImage: selectedCalendar+ ? `linear-gradient(to bottom, ${+ calendars.find((c) => c.id === selectedCalendar)+ ?.color || "hsl(var(--primary))"+ }, ${+ calendars.find((c) => c.id === selectedCalendar)+ ?.color || "hsl(var(--primary))"+ }80)`+ : "linear-gradient(to bottom, hsl(var(--primary)), hsl(var(--primary) / 0.5))",+ }}+ ></div><div className="min-w-0 flex-1 text-left"><p className="text-[10px] text-muted-foreground font-medium">{t("calendar.select", {@@ -771,19 +913,19 @@ function HomeContent() {open={showMobileCalendarDialog}onOpenChange={setShowMobileCalendarDialog}>- <DialogContent className="sm:max-w-md">- <DialogHeader>- <DialogTitle className="flex items-center gap-2">- <div className="w-1 h-5 bg-primary rounded-full"></div>+ <DialogContent className="sm:max-w-md p-0 gap-0 border border-border/50 bg-gradient-to-b from-background via-background to-muted/30 backdrop-blur-xl shadow-2xl">+ <DialogHeader className="border-b border-border/50 bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-6 pb-5 space-y-1.5">+ <DialogTitle className="flex items-center gap-2.5 text-xl font-semibold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text">+ <div className="w-1 h-5 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>{t("calendar.select", { default: "Your BetterShift Calendar" })}</DialogTitle>- <DialogDescription>+ <DialogDescription className="text-sm text-muted-foreground">{t("calendar.selectDescription", {default: "Choose a calendar to manage your shifts",})}</DialogDescription></DialogHeader>- <div className="space-y-4 py-4">+ <div className="p-6"><CalendarSelectorcalendars={calendars}selectedId={selectedCalendar}@@ -807,30 +949,41 @@ function HomeContent() {{/* Month Navigation */}<div className="container max-w-4xl mx-auto px-1 py-3 sm:p-4 flex-1">- <div className="flex items-center justify-between mb-3 sm:mb-4 px-2 sm:px-0">+ <motion.div+ className="flex items-center justify-between mb-4 sm:mb-5 px-2 sm:px-0"+ initial={{ opacity: 0, y: -10 }}+ animate={{ opacity: 1, y: 0 }}+ transition={{ duration: 0.3 }}+ ><Buttonvariant="outline"size="icon"- className="h-8 w-8 sm:h-10 sm:w-10"+ className="h-10 w-10 sm:h-11 sm:w-11 rounded-full active:scale-95 transition-transform"onClick={() => setCurrentDate(subMonths(currentDate, 1))}>- <ChevronLeft className="h-4 w-4" />+ <ChevronLeft className="h-5 w-5" /></Button>- <h2 className="text-base sm:text-xl font-semibold">+ <motion.h2+ className="text-lg sm:text-xl font-bold"+ key={format(currentDate, "MMMM yyyy")}+ initial={{ opacity: 0, y: 10 }}+ animate={{ opacity: 1, y: 0 }}+ transition={{ duration: 0.2 }}+ >{format(currentDate, "MMMM yyyy", { locale: dateLocale })}- </h2>+ </motion.h2><Buttonvariant="outline"size="icon"- className="h-8 w-8 sm:h-10 sm:w-10"+ className="h-10 w-10 sm:h-11 sm:w-11 rounded-full active:scale-95 transition-transform"onClick={() => setCurrentDate(addMonths(currentDate, 1))}>- <ChevronRight className="h-4 w-4" />+ <ChevronRight className="h-5 w-5" /></Button>- </div>+ </motion.div>{/* Calendar Grid */}- <div className="grid grid-cols-7 gap-px sm:gap-1 mb-6">+ <div className="grid grid-cols-7 gap-0 sm:gap-1.5 mb-6">{[t("calendar_grid.monday"),t("calendar_grid.tuesday"),@@ -842,7 +995,7 @@ function HomeContent() {].map((day) => (<divkey={day}- className="text-center text-xs sm:text-xs font-medium text-muted-foreground p-0.5 sm:p-2"+ className="text-center text-[11px] sm:text-xs font-semibold text-muted-foreground p-1 sm:p-2">{day}</div>@@ -865,7 +1018,7 @@ function HomeContent() {};return (- <button+ <motion.buttonkey={idx}onClick={() => handleAddShift(day)}onContextMenu={(e) => handleDayRightClick(e, day)}@@ -873,13 +1026,14 @@ function HomeContent() {onTouchEnd={handleTouchEnd}onTouchMove={handleTouchEnd}disabled={false}+ whileTap={{ scale: 0.95 }}style={{WebkitUserSelect: "none",userSelect: "none",WebkitTouchCallout: "none",}}className={`- min-h-24 sm:min-h-24 px-0.5 py-1 sm:p-2 rounded-md text-sm transition-all relative flex flex-col border-2+ min-h-25 sm:min-h-28 px-1 py-1.5 sm:p-2.5 rounded-md sm:rounded-lg text-sm transition-all relative flex flex-col border sm:border-2${isCurrentMonth? "text-foreground"@@ -887,32 +1041,34 @@ function HomeContent() {}${isTodayDate- ? "border-primary shadow-md shadow-primary/20 bg-primary/5"- : "border-transparent"+ ? "border-primary shadow-lg shadow-primary/20 bg-primary/5 ring-2 ring-primary/20"+ : "border-border/30 sm:border-border/50"}${isCurrentMonth- ? "hover:bg-accent cursor-pointer active:bg-accent/80"+ ? "hover:bg-accent cursor-pointer active:bg-accent/80 hover:border-border": selectedPresetId? "cursor-not-allowed": "cursor-pointer"}- ${!isCurrentMonth ? "opacity-50" : ""}+ ${!isCurrentMonth ? "opacity-40" : ""}`}><div- className={`text-xs sm:text-xs font-medium mb-0.5 flex items-center justify-between ${- isTodayDate ? "text-primary font-bold" : ""+ className={`text-sm sm:text-sm font-semibold mb-1 flex items-center justify-between ${+ isTodayDate ? "text-primary" : ""}`}><span>{day.getDate()}</span>{dayNote && (- <div+ <motion.divclassName="group/note relative"onClick={(e) => handleNoteIconClick(e, day)}title={dayNote.note}+ whileHover={{ scale: 1.1 }}+ whileTap={{ scale: 0.9 }}>- <StickyNote className="h-3 w-3 text-amber-500 cursor-pointer hover:text-amber-600 transition-colors" />+ <StickyNote className="h-3.5 w-3.5 text-orange-500 cursor-pointer hover:text-orange-600 transition-colors" />{/* Tooltip for desktop */}<div className="hidden sm:block absolute z-50 bottom-full right-0 mb-1 invisible group-hover/note:visible opacity-0 group-hover/note:opacity-100 transition-opacity duration-200"><div className="bg-popover text-popover-foreground text-xs rounded-md shadow-lg border p-2 max-w-[200px] whitespace-normal break-words">@@ -920,14 +1076,21 @@ function HomeContent() {<div className="absolute top-full right-2 -mt-1 border-4 border-transparent border-t-popover"></div></div></div>- </div>+ </motion.div>)}</div>- <div className="flex-1 space-y-0.5 overflow-hidden">+ <div className="flex-1 space-y-0.5 sm:space-y-1 overflow-hidden">{dayShifts.slice(0, 2).map((shift) => (- <div+ <motion.divkey={shift.id}- className="text-[10px] sm:text-xs px-0.5 sm:px-1 py-0.5 sm:py-0.5 rounded truncate"+ initial={{ opacity: 0, y: 8 }}+ animate={{ opacity: 1, y: 0 }}+ exit={{ opacity: 0, y: -8 }}+ transition={{+ duration: 0.15,+ ease: "easeOut",+ }}+ className="text-[10px] sm:text-xs px-0.5 py-0.5 sm:px-1.5 sm:py-1 rounded"style={{backgroundColor: shift.color? `${shift.color}20`@@ -940,7 +1103,7 @@ function HomeContent() {: `(${shift.startTime} - ${shift.endTime})`}`}>- <div className="font-medium truncate leading-tight">+ <div className="font-semibold line-clamp-2 leading-[1.1] sm:leading-tight">{shift.title}</div><div className="text-[9px] sm:text-[10px] opacity-70 leading-tight">@@ -948,34 +1111,41 @@ function HomeContent() {? t("shift.allDay"): shift.startTime.substring(0, 5)}</div>- </div>+ </motion.div>))}{dayShifts.length > 2 && (- <div className="text-[9px] sm:text-[10px] text-muted-foreground text-center">+ <div className="text-[10px] sm:text-xs text-muted-foreground font-medium text-center pt-0.5">+{dayShifts.length - 2}</div>)}</div>- </button>+ </motion.button>);})}</div>{/* Note Hint */}- <div className="px-2 sm:px-0 mb-3">- <div className="bg-muted/30 border border-muted/50 rounded-md p-2 sm:p-2.5">- <div className="flex items-start gap-2">- <StickyNote className="h-3.5 w-3.5 text-amber-500 shrink-0 mt-0.5" />- <div>+ <motion.div+ className="px-2 sm:px-0 mb-4"+ initial={{ opacity: 0, y: 10 }}+ animate={{ opacity: 1, y: 0 }}+ transition={{ delay: 0.3 }}+ >+ <div className="bg-gradient-to-r from-primary/10 to-primary/5 border border-primary/20 rounded-xl p-3 sm:p-3.5 backdrop-blur-sm">+ <div className="flex items-center gap-2.5">+ <div className="shrink-0 w-8 h-8 rounded-lg bg-primary/20 flex items-center justify-center">+ <StickyNote className="h-4 w-4 text-orange-500" />+ </div>+ <div className="flex-1">{/* Mobile hint */}- <p className="text-[11px] sm:hidden text-muted-foreground leading-snug">+ <p className="text-xs sm:hidden text-foreground/80 leading-relaxed">{t("note.hintMobile", {default:"Long press on a day to open notes. The note icon shows existing notes.",})}</p>{/* Desktop hint */}- <p className="hidden sm:block text-xs text-muted-foreground leading-snug">+ <p className="hidden sm:block text-sm text-foreground/80 leading-relaxed">{t("note.hintDesktop", {default:"Right-click on a day to open notes. The note icon shows existing notes.",@@ -984,7 +1154,7 @@ function HomeContent() {</div></div></div>- </div>+ </motion.div>{/* Shifts List */}<div className="space-y-3 sm:space-y-4 px-2 sm:px-0">@@ -995,116 +1165,190 @@ function HomeContent() {refreshTrigger={statsRefreshTrigger}/>- <div className="flex items-center justify-between flex-wrap gap-2">- <h3 className="text-lg sm:text-xl font-bold">{t("shift.title")}</h3>- {shifts.length > 0 && (- <div className="flex gap-2 sm:gap-3 text-xs sm:text-sm">- <div className="px-2 sm:px-3 py-1 bg-primary/10 rounded-full">- <span className="font-semibold text-primary">- {- shifts.filter((shift) => {- if (!shift.date) return false;- const shiftDate = new Date(shift.date);- return (- shiftDate.getMonth() === currentDate.getMonth() &&- shiftDate.getFullYear() === currentDate.getFullYear()- );- }).length- }- </span>- <span className="text-muted-foreground ml-1">- <span className="hidden sm:inline">- {t("shift.shiftsThisMonth")}- </span>- <span className="sm:hidden">{t("shift.shifts")}</span>- </span>- </div>- </div>- )}- </div>-- {shifts.length === 0 ? (- <div className="border-2 border-dashed rounded-lg p-8 sm:p-12 text-center space-y-3 sm:space-y-4">- <div className="flex justify-center">- <div className="h-12 w-12 sm:h-16 sm:w-16 rounded-full bg-muted flex items-center justify-center">- <CalendarIcon className="h-6 w-6 sm:h-8 sm:w-8 text-muted-foreground" />+ <div className="border border-border/50 rounded-xl bg-gradient-to-b from-card/80 via-card/60 to-card/40 backdrop-blur-sm overflow-hidden shadow-lg">+ <button+ onClick={() => setShowShiftsSection(!showShiftsSection)}+ className="w-full px-3 sm:px-4 py-3 sm:py-3.5 flex items-center justify-between hover:bg-primary/5 transition-all"+ >+ <div className="flex items-center gap-2.5">+ <div className="w-9 h-9 rounded-xl bg-gradient-to-br from-primary to-primary/70 flex items-center justify-center shadow-lg shadow-primary/20">+ <CalendarIcon className="h-4 w-4 sm:h-5 sm:w-5 text-primary-foreground" /></div>+ <h3 className="text-sm sm:text-base font-semibold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text">+ {t("shift.title")}+ </h3></div>- <div className="space-y-1 sm:space-y-2">- <h4 className="font-semibold text-base sm:text-lg">- {t("shift.noShifts")}- </h4>- <p className="text-xs sm:text-sm text-muted-foreground max-w-md mx-auto">- {presets.length === 0- ? t("shift.createPresetFirst")- : t("shift.noShiftsDescription")}- </p>- </div>- </div>- ) : (- <div className="space-y-2 sm:space-y-3">- {Object.entries(- shifts- .filter((shift) => {- if (!shift.date) return false;- const shiftDate = new Date(shift.date);+ <div className="flex items-center gap-3">+ {!showShiftsSection &&+ (() => {+ const shiftsInMonth = shifts.filter((shift) => {+ if (!shift.date) return false;+ const shiftDate = new Date(shift.date);+ return (+ shiftDate.getMonth() === currentDate.getMonth() &&+ shiftDate.getFullYear() === currentDate.getFullYear()+ );+ }).length;return (- shiftDate.getMonth() === currentDate.getMonth() &&- shiftDate.getFullYear() === currentDate.getFullYear()+ shiftsInMonth > 0 && (+ <div className="px-3 py-1.5 bg-primary/10 rounded-full">+ <span className="font-semibold text-primary text-xs sm:text-sm">+ {shiftsInMonth}+ </span>+ </div>+ ));- })- .sort(- (a, b) =>- (a.date ? new Date(a.date).getTime() : 0) -- (b.date ? new Date(b.date).getTime() : 0)- )- .reduce((acc, shift) => {- const dateKey = shift.date- ? format(new Date(shift.date), "yyyy-MM-dd")- : "unknown";- if (!acc[dateKey]) acc[dateKey] = [];- acc[dateKey].push(shift);- return acc;- }, {} as Record<string, ShiftWithCalendar[]>)- ).map(([dateKey, dayShifts]) => (- <div- key={dateKey}- className="border rounded-lg overflow-hidden"- >- <div className="bg-muted/50 px-3 sm:px-4 py-1.5 sm:py-2 border-b">- <div className="flex items-center justify-between">- <div className="font-semibold text-xs sm:text-sm">- {dayShifts[0].date &&- format(- new Date(dayShifts[0].date),- "EEEE, MMMM d, yyyy",- { locale: dateLocale }- )}- </div>- <div className="text-[10px] sm:text-xs text-muted-foreground">- {dayShifts.length}{" "}- {dayShifts.length === 1- ? t("shift.shift_one")- : t("shift.shifts")}+ })()}+ {showShiftsSection ? (+ <ChevronUp className="h-4 w-4 text-muted-foreground" />+ ) : (+ <ChevronDown className="h-4 w-4 text-muted-foreground" />+ )}+ </div>+ </button>++ {showShiftsSection && (+ <div className="border-t border-border/30 bg-muted/20 p-3 sm:p-4">+ {shifts.filter((shift) => {+ if (!shift.date) return false;+ const shiftDate = new Date(shift.date);+ return (+ shiftDate.getMonth() === currentDate.getMonth() &&+ shiftDate.getFullYear() === currentDate.getFullYear()+ );+ }).length === 0 ? (+ <motion.div+ className="border-2 border-dashed border-border/50 rounded-xl p-10 sm:p-14 text-center space-y-4 sm:space-y-5"+ initial={{ opacity: 0, scale: 0.95 }}+ animate={{ opacity: 1, scale: 1 }}+ transition={{ duration: 0.3 }}+ >+ <motion.div+ className="flex justify-center"+ initial={{ scale: 0 }}+ animate={{ scale: 1 }}+ transition={{+ delay: 0.1,+ type: "spring",+ stiffness: 200,+ }}+ >+ <div className="h-16 w-16 sm:h-20 sm:w-20 rounded-full bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center shadow-lg">+ <CalendarIcon className="h-8 w-8 sm:h-10 sm:w-10 text-primary/70" /></div>+ </motion.div>+ <div className="space-y-2 sm:space-y-2.5">+ <h4 className="font-bold text-lg sm:text-xl text-foreground/90">+ {t("shift.noShiftsInMonth", {+ default: "No shifts this month",+ })}+ </h4>+ <p className="text-sm sm:text-base text-muted-foreground max-w-md mx-auto leading-relaxed">+ {t("shift.noShiftsInMonthDescription", {+ default:+ "Add shifts by clicking on days in the calendar above.",+ })}+ </p></div>- </div>- <div className="p-2 sm:p-3 grid gap-1.5 sm:gap-2 sm:grid-cols-2">- {dayShifts.map((shift) => (- <ShiftCard- key={shift.id}- shift={shift}- onDelete={deleteShift}- />- ))}- </div>- </div>- ))}- </div>- )}+ </motion.div>+ ) : (+ <AnimatePresence mode="popLayout">+ <motion.div+ className="space-y-3 sm:space-y-4"+ initial={{ opacity: 0 }}+ animate={{ opacity: 1 }}+ transition={{ staggerChildren: 0.05 }}+ >+ {Object.entries(+ shifts+ .filter((shift) => {+ if (!shift.date) return false;+ const shiftDate = new Date(shift.date);+ return (+ shiftDate.getMonth() === currentDate.getMonth() &&+ shiftDate.getFullYear() ===+ currentDate.getFullYear()+ );+ })+ .sort(+ (a, b) =>+ (a.date ? new Date(a.date).getTime() : 0) -+ (b.date ? new Date(b.date).getTime() : 0)+ )+ .reduce((acc, shift) => {+ const dateKey = shift.date+ ? format(new Date(shift.date), "yyyy-MM-dd")+ : "unknown";+ if (!acc[dateKey]) acc[dateKey] = [];+ acc[dateKey].push(shift);+ return acc;+ }, {} as Record<string, ShiftWithCalendar[]>)+ ).map(([dateKey, dayShifts], index) => (+ <motion.div+ key={dateKey}+ className="border border-border/50 rounded-xl overflow-hidden shadow-sm hover:shadow-md transition-all bg-gradient-to-b from-card via-card to-muted/20"+ initial={{ opacity: 0, y: 20 }}+ animate={{ opacity: 1, y: 0 }}+ transition={{ delay: index * 0.05 }}+ layout+ >+ <div className="bg-gradient-to-r from-primary/10 via-primary/5 to-transparent px-4 sm:px-5 py-2.5 sm:py-3 border-b border-border/30">+ <div className="flex items-center justify-between">+ <div className="font-bold text-sm sm:text-base flex items-center gap-2">+ <div className="w-1 h-5 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {dayShifts[0].date &&+ format(+ new Date(dayShifts[0].date),+ "EEEE, MMMM d, yyyy",+ { locale: dateLocale }+ )}+ </div>+ <div className="text-xs sm:text-sm px-2.5 py-1 bg-primary/15 text-primary rounded-full font-semibold shadow-sm">+ {dayShifts.length}{" "}+ {dayShifts.length === 1+ ? t("shift.shift_one")+ : t("shift.shifts")}+ </div>+ </div>+ </div>+ <div className="p-3 sm:p-4 grid gap-2 sm:gap-3 sm:grid-cols-2">+ {dayShifts.map((shift) => (+ <ShiftCard+ key={shift.id}+ shift={shift}+ onDelete={deleteShift}+ />+ ))}+ </div>+ </motion.div>+ ))}+ </motion.div>+ </AnimatePresence>+ )}+ </div>+ )}+ </div></div></div>+ {/* Floating Action Button for Manual Shift Creation */}+ {selectedCalendar && (+ <motion.div+ className="fixed bottom-6 right-6 z-50"+ initial={{ scale: 0, opacity: 0 }}+ animate={{ scale: 1, opacity: 1 }}+ transition={{ delay: 0.5, type: "spring", stiffness: 200 }}+ >+ <Button+ size="lg"+ className="h-14 w-14 sm:h-16 sm:w-16 rounded-full shadow-2xl shadow-primary/30 hover:shadow-primary/50 transition-all"+ onClick={handleManualShiftCreation}+ >+ <Plus className="h-6 w-6 sm:h-7 sm:w-7" />+ </Button>+ </motion.div>+ )}+{/* Dialogs */}<CalendarDialogopen={showCalendarDialog}diff --git a/components/calendar-dialog.tsx b/components/calendar-dialog.tsxindex 997180c..2bb10db 100644--- a/components/calendar-dialog.tsx+++ b/components/calendar-dialog.tsx@@ -2,6 +2,7 @@import { useState } from "react";import { useTranslations } from "next-intl";+import { motion } from "motion/react";import {Dialog,DialogContent,@@ -60,45 +61,80 @@ export function CalendarDialog({return (<Dialog open={open} onOpenChange={onOpenChange}>- <DialogContent className="sm:max-w-[425px]">- <DialogHeader>- <DialogTitle>{t("calendar.create")}</DialogTitle>- <DialogDescription>+ <DialogContent className="sm:max-w-[480px] p-0 gap-0 border border-border/50 bg-gradient-to-b from-background via-background to-muted/30 backdrop-blur-xl shadow-2xl">+ <DialogHeader className="border-b border-border/50 bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-6 pb-5 space-y-1.5">+ <DialogTitle className="text-xl font-semibold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text">+ {t("calendar.create")}+ </DialogTitle>+ <DialogDescription className="text-sm text-muted-foreground">{t("calendar.createDescription", {default: "Create a new calendar to organize your shifts",})}</DialogDescription></DialogHeader>- <form onSubmit={handleSubmit} className="space-y-4">- <div className="space-y-2">- <Label htmlFor="name">{t("calendar.name")}</Label>+ <form onSubmit={handleSubmit} className="p-6 space-y-6">+ <div className="space-y-2.5">+ <Label+ htmlFor="name"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {t("calendar.name")}+ </Label><Inputid="name"placeholder={t("calendar.namePlaceholder")}value={name}onChange={(e) => setName(e.target.value)}+ className="h-11 border-border/50 focus:border-primary/50 focus:ring-primary/20 bg-background/50 backdrop-blur-sm transition-all"autoFocus/></div>- <div className="space-y-2">- <Label>{t("calendar.color")}</Label>- <div className="grid grid-cols-8 gap-2">+ <div className="space-y-3">+ <Label className="text-sm font-medium flex items-center gap-2">+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {t("calendar.color")}+ </Label>+ <div className="grid grid-cols-4 gap-3 p-4 bg-muted/30 rounded-xl border border-border/30">{PRESET_COLORS.map((color) => (<buttonkey={color}type="button"- className={`h-10 w-10 rounded-md transition-all ${- selectedColor === color- ? "ring-2 ring-offset-2 ring-white"- : ""- }`}- style={{ backgroundColor: color }}onClick={() => setSelectedColor(color)}- />+ className={`+ relative w-full aspect-square rounded-xl transition-all duration-200+ hover:scale-110 active:scale-95+ ${+ selectedColor === color+ ? "ring-4 ring-primary/30 shadow-lg scale-105"+ : "ring-2 ring-border/20 hover:ring-border/40"+ }+ `}+ style={{+ backgroundColor: color,+ boxShadow:+ selectedColor === color+ ? `0 8px 24px ${color}40`+ : `0 2px 8px ${color}20`,+ }}+ aria-label={color}+ >+ {selectedColor === color && (+ <motion.div+ initial={{ scale: 0 }}+ animate={{ scale: 1 }}+ className="absolute inset-0 flex items-center justify-center"+ >+ <div className="w-6 h-6 rounded-full bg-white/90 backdrop-blur-sm flex items-center justify-center shadow-lg">+ <div className="w-2 h-2 bg-primary rounded-full"></div>+ </div>+ </motion.div>+ )}+ </button>))}</div></div>- <div className="space-y-3 pt-2 border-t">+ <div className="space-y-3 p-4 bg-primary/5 border border-primary/20 rounded-xl"><div className="flex items-center space-x-2"><Checkboxid="usePassword"@@ -107,33 +143,48 @@ export function CalendarDialog({/><LabelhtmlFor="usePassword"- className="text-sm font-normal cursor-pointer"+ className="text-sm font-medium cursor-pointer flex items-center gap-2">+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>{t("password.optional")}</Label></div>{usePassword && (- <div className="space-y-2">- <Label htmlFor="password">{t("password.password")}</Label>+ <motion.div+ initial={{ opacity: 0, height: 0 }}+ animate={{ opacity: 1, height: "auto" }}+ exit={{ opacity: 0, height: 0 }}+ transition={{ duration: 0.2 }}+ className="space-y-2 pt-1"+ >+ <Label htmlFor="password" className="text-sm">+ {t("password.password")}+ </Label><Inputid="password"type="password"placeholder={t("password.passwordPlaceholder")}value={password}onChange={(e) => setPassword(e.target.value)}+ className="h-10 border-primary/30 focus:border-primary/50 focus:ring-primary/20 bg-background/80"/>- </div>+ </motion.div>)}</div>- <div className="flex justify-end gap-3">+ <div className="flex gap-2.5 pt-2"><Buttontype="button"variant="outline"onClick={() => onOpenChange(false)}+ className="flex-1 h-11 border-border/50 hover:bg-muted/50">{t("common.cancel")}</Button>- <Button type="submit" disabled={!name.trim()}>+ <Button+ type="submit"+ disabled={!name.trim()}+ className="flex-1 h-11 bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg shadow-primary/25 disabled:opacity-50 disabled:shadow-none"+ >{t("common.create")} {t("calendar.title")}</Button></div>diff --git a/components/calendar-selector.tsx b/components/calendar-selector.tsxindex 7ffaddf..6a2d47d 100644--- a/components/calendar-selector.tsx+++ b/components/calendar-selector.tsx@@ -10,7 +10,7 @@ import {SelectValue,} from "@/components/ui/select";import { Button } from "@/components/ui/button";-import { Plus, Settings, Trash2 } from "lucide-react";+import { Plus, KeyRound, Trash2 } from "lucide-react";interface CalendarSelectorProps {calendars: CalendarWithCount[];@@ -59,7 +59,7 @@ export function CalendarSelector({className="h-9 w-9 sm:h-10 sm:w-10"title={t("calendar.managePassword")}>- <Settings className="h-4 w-4" />+ <KeyRound className="h-4 w-4" /></Button>)}{onDelete && selectedId && (diff --git a/components/delete-calendar-dialog.tsx b/components/delete-calendar-dialog.tsxindex 0d03b89..ab2b28d 100644--- a/components/delete-calendar-dialog.tsx+++ b/components/delete-calendar-dialog.tsx@@ -46,18 +46,21 @@ export function DeleteCalendarDialog({return (<Dialog open={open} onOpenChange={onOpenChange}>- <DialogContent className="sm:max-w-md">- <DialogHeader>- <DialogTitle className="flex items-center gap-2 text-destructive">- <AlertTriangle className="h-5 w-5" />+ <DialogContent className="sm:max-w-[480px] p-0 gap-0 border border-destructive/50 bg-gradient-to-b from-background via-background to-destructive/5 backdrop-blur-xl shadow-2xl shadow-destructive/10">+ <DialogHeader className="border-b border-destructive/30 bg-gradient-to-r from-destructive/15 via-destructive/10 to-transparent p-6 pb-5 space-y-1.5">+ <DialogTitle className="flex items-center gap-2.5 text-destructive text-xl font-semibold">+ <div className="w-10 h-10 rounded-xl bg-gradient-to-br from-destructive to-destructive/80 flex items-center justify-center shadow-lg shadow-destructive/30">+ <AlertTriangle className="h-5 w-5 text-white" />+ </div>{t("calendar.deleteCalendar")}</DialogTitle><DialogDescription asChild>- <div className="space-y-2 pt-2">- <div className="font-semibold">+ <div className="space-y-2.5 pt-2 pl-12">+ <div className="font-semibold text-foreground flex items-center gap-2">+ <div className="w-1 h-4 bg-gradient-to-b from-destructive to-destructive/50 rounded-full"></div>{t("calendar.deleteConfirm", { name: calendarName })}</div>- <div className="text-sm text-muted-foreground">+ <div className="text-sm text-muted-foreground bg-destructive/5 p-3 rounded-lg border border-destructive/20">{t("calendar.deleteWarning", {default:"This action cannot be undone. All shifts, presets, and notes will be permanently deleted.",@@ -66,30 +69,42 @@ export function DeleteCalendarDialog({</div></DialogDescription></DialogHeader>- <form onSubmit={handleSubmit} className="space-y-4">+ <form onSubmit={handleSubmit} className="p-6 space-y-5">{hasPassword && (- <div className="space-y-2">- <Label htmlFor="password">{t("password.password")}</Label>+ <div className="space-y-2.5">+ <Label+ htmlFor="password"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-destructive to-destructive/50 rounded-full"></div>+ {t("password.password")}+ </Label><Inputid="password"type="password"value={password}onChange={(e) => setPassword(e.target.value)}placeholder={t("password.passwordPlaceholder")}+ className="h-11 border-destructive/30 focus:border-destructive/50 focus:ring-destructive/20 bg-background/50"requiredautoFocus/></div>)}- <DialogFooter className="gap-2">+ <DialogFooter className="gap-2.5 pt-2"><Buttontype="button"variant="outline"onClick={() => onOpenChange(false)}+ className="flex-1 sm:flex-none h-11 border-border/50 hover:bg-muted/50">{t("common.cancel")}</Button>- <Button type="submit" variant="destructive">+ <Button+ type="submit"+ variant="destructive"+ className="flex-1 sm:flex-none h-11 shadow-lg shadow-destructive/25"+ >{t("common.delete")}</Button></DialogFooter>diff --git a/components/manage-password-dialog.tsx b/components/manage-password-dialog.tsxindex 8fd6618..8f9c25d 100644--- a/components/manage-password-dialog.tsx+++ b/components/manage-password-dialog.tsx@@ -2,6 +2,7 @@import { useState, useEffect } from "react";import { useTranslations } from "next-intl";+import { motion } from "motion/react";import {Dialog,DialogContent,@@ -114,21 +115,28 @@ export function ManagePasswordDialog({return (<Dialog open={open} onOpenChange={onOpenChange}>- <DialogContent className="sm:max-w-[425px]">- <DialogHeader>- <DialogTitle>+ <DialogContent className="sm:max-w-[480px] p-0 gap-0 border border-border/50 bg-gradient-to-b from-background via-background to-muted/30 backdrop-blur-xl shadow-2xl">+ <DialogHeader className="border-b border-border/50 bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-6 pb-5 space-y-1.5">+ <DialogTitle className="text-xl font-semibold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text">{t("password.manage", { name: calendarName })}</DialogTitle>- <DialogDescription>- {hasPassword- ? t("password.currentlyProtected")- : t("password.notProtected")}+ <DialogDescription asChild>+ <div className="text-sm text-muted-foreground flex items-center gap-2">+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {hasPassword+ ? t("password.currentlyProtected")+ : t("password.notProtected")}+ </div></DialogDescription></DialogHeader>- <form onSubmit={handleSubmit} className="space-y-4">+ <form onSubmit={handleSubmit} className="p-6 space-y-5">{hasPassword && (- <div className="space-y-2">- <Label htmlFor="currentPassword">+ <div className="space-y-2.5">+ <Label+ htmlFor="currentPassword"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>{t("password.currentPassword")}</Label><Input@@ -137,13 +145,14 @@ export function ManagePasswordDialog({value={currentPassword}onChange={(e) => setCurrentPassword(e.target.value)}placeholder={t("password.currentPasswordPlaceholder")}+ className="h-11 border-primary/30 focus:border-primary/50 focus:ring-primary/20 bg-background/50"autoFocus/></div>)}{hasPassword && (- <div className="flex items-center space-x-2">+ <div className="flex items-center space-x-2 p-3 bg-muted/30 rounded-lg border border-border/30"><Checkboxid="removePassword"checked={removePassword}@@ -151,7 +160,7 @@ export function ManagePasswordDialog({/><LabelhtmlFor="removePassword"- className="text-sm font-normal cursor-pointer"+ className="text-sm font-medium cursor-pointer">{t("password.removePassword")}</Label>@@ -159,9 +168,19 @@ export function ManagePasswordDialog({)}{!removePassword && (- <>- <div className="space-y-2">- <Label htmlFor="newPassword">+ <motion.div+ initial={{ opacity: 0, height: 0 }}+ animate={{ opacity: 1, height: "auto" }}+ exit={{ opacity: 0, height: 0 }}+ transition={{ duration: 0.2 }}+ className="space-y-4"+ >+ <div className="space-y-2.5">+ <Label+ htmlFor="newPassword"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>{hasPassword? t("password.newPassword"): t("password.password")}@@ -172,12 +191,17 @@ export function ManagePasswordDialog({value={newPassword}onChange={(e) => setNewPassword(e.target.value)}placeholder={t("password.newPasswordPlaceholder")}+ className="h-11 border-primary/30 focus:border-primary/50 focus:ring-primary/20 bg-background/50"autoFocus={!hasPassword}/></div>- <div className="space-y-2">- <Label htmlFor="confirmPassword">+ <div className="space-y-2.5">+ <Label+ htmlFor="confirmPassword"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>{t("password.confirmPassword")}</Label><Input@@ -186,22 +210,32 @@ export function ManagePasswordDialog({value={confirmPassword}onChange={(e) => setConfirmPassword(e.target.value)}placeholder={t("password.confirmPasswordPlaceholder")}+ className="h-11 border-primary/30 focus:border-primary/50 focus:ring-primary/20 bg-background/50"/></div>- </>+ </motion.div>)}- {error && <p className="text-sm text-red-500">{error}</p>}+ {error && (+ <p className="text-sm text-red-500 flex items-center gap-1.5 bg-red-500/10 p-3 rounded-lg border border-red-500/20">+ {error}+ </p>+ )}- <div className="flex justify-end gap-2">+ <div className="flex gap-2.5 pt-2"><Buttontype="button"variant="outline"onClick={() => onOpenChange(false)}+ className="flex-1 h-11 border-border/50 hover:bg-muted/50">{t("common.cancel")}</Button>- <Button type="submit" disabled={loading}>+ <Button+ type="submit"+ disabled={loading}+ className="flex-1 h-11 bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg shadow-primary/25 disabled:opacity-50 disabled:shadow-none"+ >{loading ? t("common.loading") : t("common.save")}</Button></div>diff --git a/components/note-dialog.tsx b/components/note-dialog.tsxindex 123c4a4..2523c6a 100644--- a/components/note-dialog.tsx+++ b/components/note-dialog.tsx@@ -2,6 +2,8 @@import { useState, useEffect } from "react";import { useTranslations } from "next-intl";+import { motion } from "motion/react";+import { StickyNote } from "lucide-react";import {Dialog,DialogContent,@@ -68,44 +70,67 @@ export function NoteDialog({return (<Dialog open={open} onOpenChange={onOpenChange}>- <DialogContent>- <DialogHeader>- <DialogTitle>{note ? t("note.edit") : t("note.create")}</DialogTitle>- <DialogDescription>{formattedDate}</DialogDescription>+ <DialogContent className="sm:max-w-[480px] p-0 gap-0 border border-border/50 bg-gradient-to-b from-background via-background to-muted/30 backdrop-blur-xl shadow-2xl">+ <DialogHeader className="border-b border-border/50 bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-6 pb-5 space-y-1.5">+ <DialogTitle className="text-xl font-semibold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text flex items-center gap-2">+ <div className="w-9 h-9 rounded-xl bg-gradient-to-br from-primary to-primary/70 flex items-center justify-center shadow-lg shadow-primary/30">+ <StickyNote className="h-5 w-5 text-white" />+ </div>+ {note ? t("note.edit") : t("note.create")}+ </DialogTitle>+ <DialogDescription asChild>+ <div className="text-sm text-muted-foreground flex items-center gap-2 pl-11">+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {formattedDate}+ </div>+ </DialogDescription></DialogHeader>- <form onSubmit={handleSubmit} className="space-y-4">- <div className="space-y-2">- <Label htmlFor="note">{t("note.note")}</Label>+ <form onSubmit={handleSubmit} className="p-6 space-y-5">+ <div className="space-y-2.5">+ <Label+ htmlFor="note"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {t("note.note")}+ </Label><Textareaid="note"value={noteText}onChange={(e) => setNoteText(e.target.value)}placeholder={t("note.notePlaceholder")}- className="min-h-[100px]"+ className="min-h-[120px] border-primary/30 focus:border-primary/50 focus:ring-primary/20 bg-primary/5 backdrop-blur-sm resize-none"required/></div>- <div className="flex justify-between">+ <div className="flex justify-between items-center pt-2"><div>{note && onDelete && (<Buttontype="button"variant="destructive"onClick={handleDelete}+ className="h-11 shadow-lg hover:shadow-xl transition-all">{t("common.delete")}</Button>)}</div>- <div className="flex gap-2">+ <div className="flex gap-2.5"><Buttontype="button"variant="outline"onClick={() => onOpenChange(false)}+ className="h-11 border-border/50 hover:bg-muted/50">{t("common.cancel")}</Button>- <Button type="submit">{t("common.save")}</Button>+ <Button+ type="submit"+ className="h-11 bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg shadow-primary/25"+ >+ {t("common.save")}+ </Button></div></div></form>diff --git a/components/password-dialog.tsx b/components/password-dialog.tsxindex 6ea68d7..165a544 100644--- a/components/password-dialog.tsx+++ b/components/password-dialog.tsx@@ -75,37 +75,56 @@ export function PasswordDialog({return (<Dialog open={open} onOpenChange={onOpenChange}>- <DialogContent className="sm:max-w-[425px]">- <DialogHeader>- <DialogTitle>+ <DialogContent className="sm:max-w-[440px] p-0 gap-0 border border-border/50 bg-gradient-to-b from-background via-background to-muted/30 backdrop-blur-xl shadow-2xl">+ <DialogHeader className="border-b border-border/50 bg-gradient-to-r from-red-500/10 via-red-500/5 to-transparent p-6 pb-5 space-y-1.5">+ <DialogTitle className="text-xl font-semibold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text">{t("password.password")} {t("common.required")}</DialogTitle>- <DialogDescription>- {t("password.enter", { name: calendarName })}+ <DialogDescription asChild>+ <div className="text-sm text-muted-foreground flex items-center gap-2">+ <div className="w-1 h-4 bg-gradient-to-b from-red-500 to-red-500/50 rounded-full"></div>+ {t("password.enter", { name: calendarName })}+ </div></DialogDescription></DialogHeader>- <form onSubmit={handleSubmit} className="space-y-4">- <div className="space-y-2">- <Label htmlFor="password">{t("password.password")}</Label>+ <form onSubmit={handleSubmit} className="p-6 space-y-5">+ <div className="space-y-2.5">+ <Label+ htmlFor="password"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-red-500 to-red-500/50 rounded-full"></div>+ {t("password.password")}+ </Label><Inputid="password"type="password"value={password}onChange={(e) => setPassword(e.target.value)}placeholder={t("password.enterCalendarPassword")}+ className="h-11 border-red-500/30 focus:border-red-500/50 focus:ring-red-500/20 bg-background/50"autoFocus/>- {error && <p className="text-sm text-red-500">{error}</p>}+ {error && (+ <p className="text-sm text-red-500 flex items-center gap-1.5 bg-red-500/10 p-2 rounded-lg border border-red-500/20">+ {error}+ </p>+ )}</div>- <div className="flex justify-end gap-2">+ <div className="flex gap-2.5 pt-2"><Buttontype="button"variant="outline"onClick={() => onOpenChange(false)}+ className="flex-1 h-11 border-border/50 hover:bg-muted/50">{t("common.cancel")}</Button>- <Button type="submit" disabled={loading || !password}>+ <Button+ type="submit"+ disabled={loading || !password}+ className="flex-1 h-11 bg-gradient-to-r from-red-500 to-red-500/90 hover:from-red-500/90 hover:to-red-500/80 shadow-lg shadow-red-500/25 disabled:opacity-50 disabled:shadow-none"+ >{loading ? t("common.loading") : t("password.unlock")}</Button></div>diff --git a/components/preset-selector.tsx b/components/preset-selector.tsxindex b404ff9..db8ca09 100644--- a/components/preset-selector.tsx+++ b/components/preset-selector.tsx@@ -17,6 +17,8 @@ import { Label } from "@/components/ui/label";import { Trash2 } from "lucide-react";import { Checkbox } from "@/components/ui/checkbox";import { ColorPicker } from "@/components/ui/color-picker";+import { motion } from "motion/react";+import { toast } from "sonner";interface PresetSelectorProps {presets: ShiftPreset[];@@ -165,6 +167,7 @@ export function PresetSelector({password,}),});+ toast.success(t("preset.created"));} else if (editingPreset) {// Update existing presetawait fetch(`/api/presets/${editingPreset.id}`, {@@ -172,6 +175,7 @@ export function PresetSelector({headers: { "Content-Type": "application/json" },body: JSON.stringify({ ...formData, password }),});+ toast.success(t("preset.updated"));// Refresh shifts as they may have been updatedif (onShiftsChange) onShiftsChange();@@ -182,6 +186,7 @@ export function PresetSelector({resetForm();} catch (error) {console.error("Failed to save preset:", error);+ toast.error(t("preset.saveError"));}};@@ -224,8 +229,10 @@ export function PresetSelector({onPresetsChange();// Refresh shifts as they may have been deletedif (onShiftsChange) onShiftsChange();+ toast.success(t("preset.deleted"));} catch (error) {console.error("Failed to delete preset:", error);+ toast.error(t("preset.deleteError"));}};@@ -253,49 +260,60 @@ export function PresetSelector({</Button></div>) : (- <div className="space-y-2">+ <div className="space-y-3">{/* Primary Presets */}<div className="flex items-center gap-1.5 sm:gap-2 flex-wrap">{presets.filter((p) => !p.isSecondary).map((preset) => (- <Button+ <motion.divkey={preset.id}- variant={- selectedPresetId === preset.id ? "default" : "outline"- }- size="sm"- onClick={() =>- onSelectPreset(- selectedPresetId === preset.id ? undefined : preset.id- )- }- className="relative text-xs sm:text-sm px-2 sm:px-3 h-8 sm:h-9"- style={{- backgroundColor:- selectedPresetId === preset.id ? preset.color : undefined,- borderColor: preset.color,- }}+ whileTap={{ scale: 0.95 }}+ initial={{ opacity: 0, scale: 0.9 }}+ animate={{ opacity: 1, scale: 1 }}>- {selectedPresetId === preset.id && (- <Check className="mr-1 h-3 w-3" />- )}- <span className="font-medium truncate max-w-[80px] sm:max-w-none">- {preset.title}- </span>- <span className="ml-1 text-[10px] sm:text-xs opacity-70">- {preset.isAllDay ? (- <span>{t("shift.allDay")}</span>- ) : (- <>- <span className="sm:hidden">{preset.startTime}</span>- <span className="hidden sm:inline">- {preset.startTime} - {preset.endTime}- </span>- </>+ <Button+ variant={+ selectedPresetId === preset.id ? "default" : "outline"+ }+ size="sm"+ onClick={() =>+ onSelectPreset(+ selectedPresetId === preset.id ? undefined : preset.id+ )+ }+ className="relative text-[11px] sm:text-sm px-2 sm:px-4 h-8 sm:h-10 rounded-full font-semibold transition-all"+ style={{+ backgroundColor:+ selectedPresetId === preset.id+ ? preset.color+ : undefined,+ borderColor: preset.color,+ borderWidth: "2px",+ }}+ >+ {selectedPresetId === preset.id && (+ <Check className="mr-1 sm:mr-1.5 h-3 sm:h-3.5 w-3 sm:w-3.5" />)}- </span>- </Button>+ <span className="truncate max-w-[80px] sm:max-w-none">+ {preset.title}+ </span>+ <span className="ml-1 sm:ml-1.5 text-[9px] sm:text-xs opacity-80">+ {preset.isAllDay ? (+ <span>{t("shift.allDay")}</span>+ ) : (+ <>+ <span className="sm:hidden">+ {preset.startTime.substring(0, 5)}+ </span>+ <span className="hidden sm:inline">+ {preset.startTime} - {preset.endTime}+ </span>+ </>+ )}+ </span>+ </Button>+ </motion.div>))}<Buttonvariant="outline"@@ -395,20 +413,22 @@ export function PresetSelector({{/* Manage Presets Dialog */}<Dialog open={showManageDialog} onOpenChange={setShowManageDialog}>- <DialogContent className="sm:max-w-[500px] max-h-[85vh] flex flex-col">- <DialogHeader>- <DialogTitle>{t("preset.manage")}</DialogTitle>- <DialogDescription>+ <DialogContent className="sm:max-w-[520px] max-h-[85vh] flex flex-col p-0 gap-0 border border-border/50 bg-gradient-to-b from-background via-background to-muted/30 backdrop-blur-xl shadow-2xl">+ <DialogHeader className="border-b border-border/50 bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-6 pb-5 space-y-1.5">+ <DialogTitle className="text-xl font-semibold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text">+ {t("preset.manage")}+ </DialogTitle>+ <DialogDescription className="text-sm text-muted-foreground">{t("preset.manageDescription", {default: "Edit or delete your shift presets",})}</DialogDescription></DialogHeader>- <div className="space-y-3 overflow-y-auto flex-1 pr-2">+ <div className="space-y-3 overflow-y-auto flex-1 p-6"><ButtononClick={handleCreateNew}- className="w-full"- variant="outline"+ className="w-full h-11 bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg shadow-primary/25"+ variant="default"><Plus className="mr-2 h-4 w-4" />{t("preset.createNew")}@@ -416,12 +436,18 @@ export function PresetSelector({{presets.map((preset) => (<divkey={preset.id}- className="flex items-center justify-between p-3 rounded-lg border"+ className="flex items-center justify-between p-4 rounded-xl border border-border/50 bg-muted/20 hover:bg-muted/30 transition-all"style={{ borderLeftColor: preset.color, borderLeftWidth: 4 }}><div className="flex-1">- <div className="font-medium">{preset.title}</div>- <div className="text-sm text-muted-foreground">+ <div className="font-semibold flex items-center gap-2">+ <div+ className="w-1 h-4 rounded-full"+ style={{ backgroundColor: preset.color }}+ ></div>+ {preset.title}+ </div>+ <div className="text-sm text-muted-foreground mt-1">{preset.isAllDay ? (<span>{t("shift.allDay")}</span>) : (@@ -436,6 +462,7 @@ export function PresetSelector({variant="outline"size="sm"onClick={() => handleEditPreset(preset)}+ className="h-9">{t("common.edit")}</Button>@@ -443,6 +470,7 @@ export function PresetSelector({variant="ghost"size="sm"onClick={() => handleDeletePreset(preset.id)}+ className="h-9 w-9 p-0 text-destructive hover:text-destructive hover:bg-destructive/10"><Trash2 className="h-4 w-4" /></Button>@@ -464,12 +492,12 @@ export function PresetSelector({}}}>- <DialogContent className="max-h-[90vh] overflow-y-auto overflow-x-hidden w-[95vw] max-w-[500px] p-4 sm:p-6">- <DialogHeader>- <DialogTitle className="text-base sm:text-lg">+ <DialogContent className="max-h-[90vh] overflow-y-auto overflow-x-hidden w-[95vw] max-w-[520px] p-0 gap-0 border border-border/50 bg-gradient-to-b from-background via-background to-muted/30 backdrop-blur-xl shadow-2xl">+ <DialogHeader className="border-b border-border/50 bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-6 pb-5 space-y-1.5">+ <DialogTitle className="text-xl font-semibold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text">{isCreatingNew ? t("preset.createNew") : t("preset.edit")}</DialogTitle>- <DialogDescription className="text-sm">+ <DialogDescription className="text-sm text-muted-foreground">{isCreatingNew? t("preset.createDescription", {default: "Create a new preset for quick shift creation",@@ -479,9 +507,13 @@ export function PresetSelector({})}</DialogDescription></DialogHeader>- <div className="space-y-4 pb-2">- <div className="space-y-1.5">- <Label htmlFor="preset-title" className="text-sm">+ <div className="space-y-5 p-6">+ <div className="space-y-2.5">+ <Label+ htmlFor="preset-title"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>{t("shift.titleLabel")}</Label><Input@@ -491,10 +523,10 @@ export function PresetSelector({onChange={(e) =>setFormData({ ...formData, title: e.target.value })}- className="text-base"+ className="h-11 border-border/50 focus:border-primary/50 focus:ring-primary/20 bg-background/50"/></div>- <div className="flex items-center space-x-2 py-1">+ <div className="flex items-center space-x-2 p-3 bg-muted/30 rounded-lg border border-border/30"><Checkboxid="preset-allday"checked={formData.isAllDay}@@ -509,46 +541,56 @@ export function PresetSelector({{t("shift.allDayShift")}</Label></div>- <div className="grid grid-cols-2 gap-3">- <div className="space-y-1.5">- <Label htmlFor="preset-start" className="text-sm">- {t("shift.startTime")}- </Label>- <Input- id="preset-start"- type="time"- value={formData.startTime}- onChange={(e) =>- setFormData({ ...formData, startTime: e.target.value })- }- disabled={formData.isAllDay}- className="text-base"- />- </div>- <div className="space-y-1.5">- <Label htmlFor="preset-end" className="text-sm">- {t("shift.endTime")}- </Label>- <Input- id="preset-end"- type="time"- value={formData.endTime}- onChange={(e) =>- setFormData({ ...formData, endTime: e.target.value })- }- disabled={formData.isAllDay}- className="text-base"- />- </div>- </div>+ {!formData.isAllDay && (+ <motion.div+ initial={{ opacity: 0, height: 0 }}+ animate={{ opacity: 1, height: "auto" }}+ exit={{ opacity: 0, height: 0 }}+ transition={{ duration: 0.2 }}+ className="grid grid-cols-2 gap-3"+ >+ <div className="space-y-2">+ <Label htmlFor="preset-start" className="text-sm font-medium">+ {t("shift.startTime")}+ </Label>+ <Input+ id="preset-start"+ type="time"+ value={formData.startTime}+ onChange={(e) =>+ setFormData({ ...formData, startTime: e.target.value })+ }+ className="h-11 border-border/50 focus:border-primary/50 focus:ring-primary/20 bg-background/50"+ />+ </div>+ <div className="space-y-2">+ <Label htmlFor="preset-end" className="text-sm font-medium">+ {t("shift.endTime")}+ </Label>+ <Input+ id="preset-end"+ type="time"+ value={formData.endTime}+ onChange={(e) =>+ setFormData({ ...formData, endTime: e.target.value })+ }+ className="h-11 border-border/50 focus:border-primary/50 focus:ring-primary/20 bg-background/50"+ />+ </div>+ </motion.div>+ )}<ColorPickercolor={formData.color}onChange={(color) => setFormData({ ...formData, color })}label={t("shift.color")}presetColors={PRESET_COLORS}/>- <div className="space-y-1.5">- <Label htmlFor="preset-notes" className="text-sm">+ <div className="space-y-2.5">+ <Label+ htmlFor="preset-notes"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>{t("shift.notesOptional")}</Label><Input@@ -558,10 +600,10 @@ export function PresetSelector({onChange={(e) =>setFormData({ ...formData, notes: e.target.value })}- className="text-base"+ className="h-11 border-border/50 focus:border-primary/50 focus:ring-primary/20 bg-background/50"/></div>- <div className="flex items-center space-x-2 py-1">+ <div className="flex items-center space-x-2 p-3 bg-muted/30 rounded-lg border border-border/30"><Checkboxid="preset-secondary"checked={formData.isSecondary}@@ -571,12 +613,12 @@ export function PresetSelector({/><LabelhtmlFor="preset-secondary"- className="text-sm font-normal cursor-pointer"+ className="text-sm font-medium cursor-pointer">{t("preset.markAsSecondary")}</Label></div>- <div className="flex gap-2 pt-2">+ <div className="flex gap-2.5 pt-2"><Buttontype="button"variant="outline"@@ -585,7 +627,7 @@ export function PresetSelector({setIsCreatingNew(false);resetForm();}}- className="flex-1"+ className="flex-1 h-11 border-border/50 hover:bg-muted/50">{t("common.cancel")}</Button>@@ -593,7 +635,7 @@ export function PresetSelector({type="button"onClick={handleSave}disabled={!formData.title.trim()}- className="flex-1"+ className="flex-1 h-11 bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg shadow-primary/25 disabled:opacity-50 disabled:shadow-none">{isCreatingNew ? t("common.create") : t("common.save")}</Button>diff --git a/components/shift-card.tsx b/components/shift-card.tsxindex 21e964b..3506b50 100644--- a/components/shift-card.tsx+++ b/components/shift-card.tsx@@ -5,6 +5,7 @@ import { ShiftWithCalendar } from "@/lib/types";import { Card } from "@/components/ui/card";import { Button } from "@/components/ui/button";import { Trash2 } from "lucide-react";+import { motion } from "motion/react";interface ShiftCardProps {shift: ShiftWithCalendar;@@ -15,45 +16,53 @@ export function ShiftCard({ shift, onDelete }: ShiftCardProps) {const t = useTranslations();return (- <Card- className="p-2 sm:p-3 hover:shadow-md transition-all group relative overflow-hidden"- style={{ borderLeft: `4px solid ${shift.color || "#3b82f6"}` }}+ <motion.div+ initial={{ opacity: 0, y: 10 }}+ animate={{ opacity: 1, y: 0 }}+ exit={{ opacity: 0, scale: 0.95 }}+ transition={{ duration: 0.2 }}+ layout>- <div className="flex items-start justify-between gap-2">- <div className="flex-1 min-w-0">- <h3 className="font-semibold text-xs sm:text-sm truncate">- {shift.title}- </h3>- <div className="flex items-center gap-1 sm:gap-1.5 text-[10px] sm:text-xs text-muted-foreground mt-0.5">- {shift.isAllDay ? (- <span className="font-medium">{t("shift.allDay")}</span>- ) : (- <>- <span className="font-medium">{shift.startTime}</span>- <span>→</span>- <span className="font-medium">{shift.endTime}</span>- </>+ <Card+ className="p-3 sm:p-4 hover:shadow-lg active:scale-[0.98] transition-all group relative overflow-hidden border-l-4"+ style={{ borderLeftColor: shift.color || "#3b82f6" }}+ >+ <div className="flex items-start justify-between gap-3">+ <div className="flex-1 min-w-0">+ <h3 className="font-semibold text-sm sm:text-base truncate">+ {shift.title}+ </h3>+ <div className="flex items-center gap-2 text-xs sm:text-sm text-muted-foreground mt-1">+ {shift.isAllDay ? (+ <span className="font-medium">{t("shift.allDay")}</span>+ ) : (+ <>+ <span className="font-medium">{shift.startTime}</span>+ <span className="opacity-50">→</span>+ <span className="font-medium">{shift.endTime}</span>+ </>+ )}+ </div>+ {shift.notes && (+ <p className="text-xs sm:text-sm text-muted-foreground mt-2 line-clamp-2 leading-relaxed">+ {shift.notes}+ </p>)}</div>- {shift.notes && (- <p className="text-[10px] sm:text-xs text-muted-foreground mt-1 sm:mt-1.5 line-clamp-2">- {shift.notes}- </p>- )}+ <Button+ variant="ghost"+ size="icon"+ className="h-8 w-8 sm:h-9 sm:w-9 transition-all text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-950 flex-shrink-0 rounded-full"+ onClick={() => onDelete(shift.id)}+ >+ <Trash2 className="h-4 w-4" />+ </Button></div>- <Button- variant="ghost"- size="icon"- className="h-6 w-6 sm:h-7 sm:w-7 transition-opacity text-red-600 hover:text-red-700 hover:bg-red-50 flex-shrink-0"- onClick={() => onDelete(shift.id)}- >- <Trash2 className="h-3 w-3 sm:h-3.5 sm:w-3.5" />- </Button>- </div>- <div- className="absolute inset-0 opacity-[0.03] pointer-events-none"- style={{ backgroundColor: shift.color || "#3b82f6" }}- />- </Card>+ <div+ className="absolute inset-0 opacity-[0.05] pointer-events-none"+ style={{ backgroundColor: shift.color || "#3b82f6" }}+ />+ </Card>+ </motion.div>);}diff --git a/components/shift-dialog.tsx b/components/shift-dialog.tsxindex 15bac6f..51f4c4d 100644--- a/components/shift-dialog.tsx+++ b/components/shift-dialog.tsx@@ -2,6 +2,7 @@import { useState, useEffect } from "react";import { useTranslations } from "next-intl";+import { motion } from "motion/react";import {Dialog,DialogContent,@@ -84,7 +85,7 @@ export function ShiftDialog({});const [presets, setPresets] = useState<ShiftPreset[]>([]);- const [saveAsPreset, setSaveAsPreset] = useState(true); // Auto-save enabled by default+ const [saveAsPreset, setSaveAsPreset] = useState(false); // Auto-save disabled by defaultconst [presetName, setPresetName] = useState("");// Fetch presets on mount@@ -109,7 +110,7 @@ export function ShiftDialog({color: shift?.color || "#3b82f6",isAllDay: shift?.isAllDay || false,});- setSaveAsPreset(!shift); // Enable auto-save for new shifts+ setSaveAsPreset(false); // Disabled by defaultsetPresetName("");}}, [open, selectedDate, shift]);@@ -201,12 +202,12 @@ export function ShiftDialog({return (<Dialog open={open} onOpenChange={onOpenChange}>- <DialogContent className="sm:max-w-[425px]">- <DialogHeader>- <DialogTitle>+ <DialogContent className="sm:max-w-[520px] max-h-[90vh] flex flex-col p-0 gap-0 border border-border/50 bg-gradient-to-b from-background via-background to-muted/30 backdrop-blur-xl shadow-2xl">+ <DialogHeader className="border-b border-border/50 bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-6 pb-5 space-y-1.5 flex-shrink-0">+ <DialogTitle className="text-xl font-semibold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text">{shift ? t("shift.edit") : t("shift.create")}</DialogTitle>- <DialogDescription>+ <DialogDescription className="text-sm text-muted-foreground">{shift? t("shift.editDescription", {default: "Update the shift details",@@ -216,19 +217,22 @@ export function ShiftDialog({})}</DialogDescription></DialogHeader>- <form onSubmit={handleSubmit} className="space-y-4">- {/* Preset Selection */}- {!shift && presets.length > 0 && (- <div className="space-y-2">- <Label>{t("shift.selectPreset")}</Label>- <div className="flex gap-2">+ <form onSubmit={handleSubmit} className="flex flex-col flex-1 min-h-0">+ <div className="p-6 space-y-5 overflow-y-auto flex-1">+ {/* Preset Selection */}+ {!shift && presets.length > 0 && (+ <div className="space-y-2.5 p-4 bg-primary/5 border border-primary/20 rounded-xl">+ <Label className="text-sm font-medium flex items-center gap-2">+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {t("shift.selectPreset")}+ </Label><SelectonValueChange={(value) => {const preset = presets.find((p) => p.id === value);if (preset) applyPreset(preset);}}>- <SelectTrigger>+ <SelectTrigger className="h-11 border-primary/30 focus:border-primary/50 focus:ring-primary/20 bg-background/80"><SelectValue placeholder={t("shift.none")} /></SelectTrigger><SelectContent>@@ -240,135 +244,183 @@ export function ShiftDialog({</SelectContent></Select></div>- </div>- )}-- <div className="space-y-2">- <Label htmlFor="date">{t("shift.date")}</Label>- <Input- id="date"- type="date"- value={formData.date}- onChange={(e) =>- setFormData({ ...formData, date: e.target.value })- }- />- </div>+ )}- <div className="flex items-center space-x-2 py-2">- <Checkbox- id="allDay"- checked={formData.isAllDay}- onCheckedChange={(checked) =>- setFormData({ ...formData, isAllDay: !!checked })- }- />- <Label- htmlFor="allDay"- className="text-sm font-medium cursor-pointer"- >- {t("shift.allDayShift")}- </Label>- </div>+ <div className="space-y-2.5">+ <Label+ htmlFor="date"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {t("shift.date")}+ </Label>+ <Input+ id="date"+ type="date"+ value={formData.date}+ onChange={(e) =>+ setFormData({ ...formData, date: e.target.value })+ }+ className="h-11 border-border/50 focus:border-primary/50 focus:ring-primary/20 bg-background/50 backdrop-blur-sm"+ />+ </div>- {!formData.isAllDay && (- <div className="grid grid-cols-2 gap-4">- <div className="space-y-2">- <Label htmlFor="startTime">{t("shift.startTime")}</Label>- <Input- id="startTime"- type="time"- value={formData.startTime}- onChange={(e) =>- setFormData({ ...formData, startTime: e.target.value })- }- />- </div>- <div className="space-y-2">- <Label htmlFor="endTime">{t("shift.endTime")}</Label>- <Input- id="endTime"- type="time"- value={formData.endTime}- onChange={(e) =>- setFormData({ ...formData, endTime: e.target.value })- }- />- </div>+ <div className="flex items-center space-x-2 p-3 bg-muted/30 rounded-lg border border-border/30">+ <Checkbox+ id="allDay"+ checked={formData.isAllDay}+ onCheckedChange={(checked) =>+ setFormData({ ...formData, isAllDay: !!checked })+ }+ />+ <Label+ htmlFor="allDay"+ className="text-sm font-medium cursor-pointer"+ >+ {t("shift.allDayShift")}+ </Label></div>- )}- <div className="space-y-2">- <Label htmlFor="title">{t("shift.titleLabel")}</Label>- <Input- id="title"- placeholder={t("shift.titlePlaceholder")}- value={formData.title}- onChange={(e) =>- setFormData({ ...formData, title: e.target.value })- }- autoFocus- />- </div>- <div className="space-y-2">- <Label htmlFor="notes">{t("shift.notesOptional")}</Label>- <Textarea- id="notes"- placeholder={t("shift.notesPlaceholder")}- value={formData.notes}- onChange={(e) =>- setFormData({ ...formData, notes: e.target.value })- }- rows={3}- />- </div>- <ColorPicker- color={formData.color || "#3b82f6"}- onChange={(color) => setFormData({ ...formData, color })}- label={t("shift.color")}- presetColors={PRESET_COLORS}- />- {/* Auto-Save as Preset */}- {!shift && (- <div className="space-y-3 pt-2 border-t">- <div className="flex items-center space-x-2">- <Checkbox- id="savePreset"- checked={saveAsPreset}- onCheckedChange={(checked) =>- setSaveAsPreset(checked as boolean)- }- />- <Label- htmlFor="savePreset"- className="text-sm font-normal cursor-pointer"- >- {t("preset.saveAsPreset")}- </Label>- </div>- {saveAsPreset && (+ {!formData.isAllDay && (+ <motion.div+ initial={{ opacity: 0, height: 0 }}+ animate={{ opacity: 1, height: "auto" }}+ exit={{ opacity: 0, height: 0 }}+ transition={{ duration: 0.2 }}+ className="grid grid-cols-2 gap-3"+ >+ <div className="space-y-2">+ <Label htmlFor="startTime" className="text-sm font-medium">+ {t("shift.startTime")}+ </Label>+ <Input+ id="startTime"+ type="time"+ value={formData.startTime}+ onChange={(e) =>+ setFormData({ ...formData, startTime: e.target.value })+ }+ className="h-11 border-border/50 focus:border-primary/50 focus:ring-primary/20 bg-background/50"+ />+ </div><div className="space-y-2">- <Label htmlFor="presetName">{t("preset.presetName")}</Label>+ <Label htmlFor="endTime" className="text-sm font-medium">+ {t("shift.endTime")}+ </Label><Input- id="presetName"- placeholder={t("preset.presetNamePlaceholder")}- value={presetName}- onChange={(e) => setPresetName(e.target.value)}+ id="endTime"+ type="time"+ value={formData.endTime}+ onChange={(e) =>+ setFormData({ ...formData, endTime: e.target.value })+ }+ className="h-11 border-border/50 focus:border-primary/50 focus:ring-primary/20 bg-background/50"/></div>- )}+ </motion.div>+ )}+ <div className="space-y-2.5">+ <Label+ htmlFor="title"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {t("shift.titleLabel")}+ </Label>+ <Input+ id="title"+ placeholder={t("shift.titlePlaceholder")}+ value={formData.title}+ onChange={(e) =>+ setFormData({ ...formData, title: e.target.value })+ }+ className="h-11 border-border/50 focus:border-primary/50 focus:ring-primary/20 bg-background/50 backdrop-blur-sm"+ autoFocus+ /></div>- )}+ <div className="space-y-2.5">+ <Label+ htmlFor="notes"+ className="text-sm font-medium flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {t("shift.notesOptional")}+ </Label>+ <Textarea+ id="notes"+ placeholder={t("shift.notesPlaceholder")}+ value={formData.notes}+ onChange={(e) =>+ setFormData({ ...formData, notes: e.target.value })+ }+ rows={3}+ className="border-border/50 focus:border-primary/50 focus:ring-primary/20 bg-background/50 resize-none"+ />+ </div>+ <ColorPicker+ color={formData.color || "#3b82f6"}+ onChange={(color) => setFormData({ ...formData, color })}+ label={t("shift.color")}+ presetColors={PRESET_COLORS}+ />- <div className="flex justify-end gap-3">+ {/* Auto-Save as Preset */}+ {!shift && (+ <div className="space-y-3 p-4 bg-primary/5 border border-primary/20 rounded-xl">+ <div className="flex items-center space-x-2">+ <Checkbox+ id="savePreset"+ checked={saveAsPreset}+ onCheckedChange={(checked) =>+ setSaveAsPreset(checked as boolean)+ }+ />+ <Label+ htmlFor="savePreset"+ className="text-sm font-medium cursor-pointer flex items-center gap-2"+ >+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {t("preset.saveAsPreset")}+ </Label>+ </div>+ {saveAsPreset && (+ <motion.div+ initial={{ opacity: 0, height: 0 }}+ animate={{ opacity: 1, height: "auto" }}+ exit={{ opacity: 0, height: 0 }}+ transition={{ duration: 0.2 }}+ className="space-y-2 pt-1"+ >+ <Label htmlFor="presetName" className="text-sm">+ {t("preset.presetName")}+ </Label>+ <Input+ id="presetName"+ placeholder={t("preset.presetNamePlaceholder")}+ value={presetName}+ onChange={(e) => setPresetName(e.target.value)}+ className="h-10 border-primary/30 focus:border-primary/50 focus:ring-primary/20 bg-background/80"+ />+ </motion.div>+ )}+ </div>+ )}+ </div>++ <div className="border-t border-border/50 bg-muted/20 p-4 flex gap-2.5 flex-shrink-0"><Buttontype="button"variant="outline"onClick={() => onOpenChange(false)}+ className="flex-1 h-11 border-border/50 hover:bg-muted/50">{t("common.cancel")}</Button>- <Button type="submit" disabled={!formData.title.trim()}>+ <Button+ type="submit"+ disabled={!formData.title.trim()}+ className="flex-1 h-11 bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg shadow-primary/25 disabled:opacity-50 disabled:shadow-none"+ >{shift ? t("shift.saveChanges") : t("shift.addShift")}</Button></div>diff --git a/components/shift-stats.tsx b/components/shift-stats.tsxindex 07b7452..e3d4bf2 100644--- a/components/shift-stats.tsx+++ b/components/shift-stats.tsx@@ -27,7 +27,7 @@ export function ShiftStats({const [period, setPeriod] = useState<"week" | "month" | "year">("month");const [stats, setStats] = useState<ShiftStats | null>(null);const [loading, setLoading] = useState(false);- const [isExpanded, setIsExpanded] = useState(false);+ const [isExpanded, setIsExpanded] = useState(true);useEffect(() => {if (calendarId) {@@ -65,24 +65,28 @@ export function ShiftStats({: 0;return (- <div className="border rounded-lg bg-card/50 backdrop-blur-sm overflow-hidden">+ <div className="border border-border/50 rounded-xl bg-gradient-to-b from-card/80 via-card/60 to-card/40 backdrop-blur-sm overflow-hidden shadow-lg">{/* Header */}<buttononClick={() => setIsExpanded(!isExpanded)}- className="w-full px-3 sm:px-4 py-2.5 sm:py-3 flex items-center justify-between hover:bg-accent/50 transition-colors"+ className="w-full px-3 sm:px-4 py-3 sm:py-3.5 flex items-center justify-between hover:bg-primary/5 transition-all">- <div className="flex items-center gap-2">- <BarChart3 className="h-4 w-4 sm:h-5 sm:w-5 text-primary" />- <h3 className="text-sm sm:text-base font-semibold">+ <div className="flex items-center gap-2.5">+ <div className="w-9 h-9 rounded-xl bg-gradient-to-br from-primary to-primary/70 flex items-center justify-center shadow-lg shadow-primary/20">+ <BarChart3 className="h-4 w-4 sm:h-5 sm:w-5 text-primary-foreground" />+ </div>+ <h3 className="text-sm sm:text-base font-semibold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text">{t("stats.title")}</h3>- {!isExpanded && stats && totalShifts > 0 && (- <span className="text-xs sm:text-sm text-muted-foreground">- ({totalShifts} {t("stats.shiftsTotal")})- </span>- )}</div><div className="flex items-center gap-2">+ {!isExpanded && stats && totalShifts > 0 && (+ <div className="px-3 py-1.5 bg-primary/10 rounded-full">+ <span className="font-semibold text-primary text-xs sm:text-sm">+ {totalShifts}+ </span>+ </div>+ )}{!isExpanded && stats && totalShifts > 0 && (<div className="hidden sm:flex gap-1.5"><span@@ -136,14 +140,14 @@ export function ShiftStats({{/* Content */}{isExpanded && (- <div className="px-3 sm:px-4 pb-3 sm:pb-4 space-y-3 border-t">+ <div className="px-3 sm:px-4 pb-3 sm:pb-4 space-y-4 border-t border-border/30 bg-muted/20">{/* Period Selector - Mobile and Desktop when expanded */}- <div className="flex gap-2 pt-3">+ <div className="flex gap-2 pt-4"><Buttonvariant={period === "week" ? "default" : "outline"}size="sm"onClick={() => setPeriod("week")}- className="flex-1 sm:flex-none"+ className="flex-1 sm:flex-none h-9 transition-all shadow-sm">{t("stats.week")}</Button>@@ -151,7 +155,7 @@ export function ShiftStats({variant={period === "month" ? "default" : "outline"}size="sm"onClick={() => setPeriod("month")}- className="flex-1 sm:flex-none"+ className="flex-1 sm:flex-none h-9 transition-all shadow-sm">{t("stats.month")}</Button>@@ -159,7 +163,7 @@ export function ShiftStats({variant={period === "year" ? "default" : "outline"}size="sm"onClick={() => setPeriod("year")}- className="flex-1 sm:flex-none"+ className="flex-1 sm:flex-none h-9 transition-all shadow-sm">{t("stats.year")}</Button>@@ -167,16 +171,17 @@ export function ShiftStats({{/* Stats Display */}{loading ? (- <p className="text-sm text-muted-foreground py-4 text-center">+ <p className="text-sm text-muted-foreground py-6 text-center">{t("common.loading")}</p>) : stats && Object.keys(stats.stats).length > 0 ? (- <div className="space-y-3">- <div className="flex justify-between items-center pb-2 border-b">- <span className="font-semibold text-sm sm:text-base">+ <div className="space-y-3.5">+ <div className="flex justify-between items-center pb-2.5 border-b border-border/50">+ <span className="font-semibold text-sm sm:text-base flex items-center gap-2">+ <div className="w-1 h-5 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>{t("stats.total")}</span>- <span className="font-bold text-lg sm:text-xl">+ <span className="font-bold text-xl sm:text-2xl bg-gradient-to-r from-primary to-primary/70 bg-clip-text">{totalShifts}</span></div>@@ -185,21 +190,21 @@ export function ShiftStats({.map(([title, count]) => (<divkey={title}- className="flex justify-between items-center gap-3"+ className="flex justify-between items-center gap-3 p-2.5 rounded-lg bg-muted/30 border border-border/30 hover:bg-muted/50 transition-colors">- <span className="text-sm truncate flex-shrink min-w-0">+ <span className="text-sm font-medium truncate flex-shrink min-w-0">{title}</span><div className="flex items-center gap-2 sm:gap-3 flex-shrink-0">- <div className="w-24 sm:w-32 h-2 bg-secondary rounded-full overflow-hidden">+ <div className="w-20 sm:w-28 h-2.5 bg-muted rounded-full overflow-hidden border border-border/30"><div- className="h-full bg-primary transition-all"+ className="h-full bg-gradient-to-r from-primary to-primary/80 transition-all shadow-sm"style={{width: `${(count / totalShifts) * 100}%`,}}/></div>- <span className="font-semibold text-sm w-6 sm:w-8 text-right">+ <span className="font-bold text-sm w-6 sm:w-8 text-right">{count}</span></div>@@ -207,7 +212,7 @@ export function ShiftStats({))}</div>) : (- <p className="text-sm text-muted-foreground py-4 text-center">+ <p className="text-sm text-muted-foreground py-6 text-center">{t("stats.noData")}</p>)}diff --git a/components/ui/color-picker.tsx b/components/ui/color-picker.tsxindex 38c6356..56009c2 100644--- a/components/ui/color-picker.tsx+++ b/components/ui/color-picker.tsx@@ -1,6 +1,7 @@"use client";import { useState } from "react";+import { useTranslations } from "next-intl";import { HexColorPicker } from "react-colorful";import { Label } from "@/components/ui/label";import { Button } from "@/components/ui/button";@@ -27,10 +28,16 @@ export function ColorPicker({presetColors = [],}: ColorPickerProps) {const [open, setOpen] = useState(false);+ const t = useTranslations();return (- <div className="space-y-2">- {label && <Label>{label}</Label>}+ <div className="space-y-2.5">+ {label && (+ <Label className="text-sm font-medium flex items-center gap-2">+ <div className="w-1 h-4 bg-gradient-to-b from-primary to-primary/50 rounded-full"></div>+ {label}+ </Label>+ )}<div className="flex flex-wrap gap-2">{/* Preset Colors */}{presetColors.map((preset) => (@@ -38,12 +45,18 @@ export function ColorPicker({key={preset.value}type="button"onClick={() => onChange(preset.value)}- className={`w-8 h-8 rounded-md border-2 transition-all ${+ className={`w-10 h-10 rounded-lg border-2 transition-all ${color === preset.value- ? "border-foreground scale-110"- : "border-muted-foreground/20 hover:border-muted-foreground/50"+ ? "border-primary scale-110 shadow-lg"+ : "border-border/30 hover:border-border/60 hover:scale-105"}`}- style={{ backgroundColor: preset.value }}+ style={{+ backgroundColor: preset.value,+ boxShadow:+ color === preset.value+ ? `0 4px 12px ${preset.value}40`+ : "none",+ }}title={preset.name}/>))}@@ -54,40 +67,53 @@ export function ColorPicker({<Buttontype="button"variant="outline"- className="h-8 px-3 gap-2 border-2 border-dashed relative"- title="Custom color"+ className="h-10 px-3 gap-2 border-2 border-dashed border-border/50 hover:border-primary/50 relative transition-all"+ title={t("color.custom", { default: "Custom color" })}><divclassName="w-5 h-5 rounded border-2 border-foreground/20"style={{ backgroundColor: color }}/>- <span className="text-xs font-medium">Custom</span>+ <span className="text-xs font-medium">+ {t("color.custom", { default: "Custom" })}+ </span>{!presetColors.some((p) => p.value === color) && (<div className="absolute -top-1 -right-1 w-3 h-3 bg-primary rounded-full border-2 border-background" />)}</Button></DialogTrigger>- <DialogContent className="sm:max-w-md">- <DialogHeader>- <DialogTitle>Custom Color</DialogTitle>- <DialogDescription>- Choose a custom color using the color picker+ <DialogContent className="sm:max-w-md p-0 gap-0 border border-border/50 bg-gradient-to-b from-background via-background to-muted/30 backdrop-blur-xl shadow-2xl">+ <DialogHeader className="border-b border-border/50 bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-6 pb-5 space-y-1.5">+ <DialogTitle className="text-xl font-semibold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text">+ {t("color.customTitle", { default: "Custom Color" })}+ </DialogTitle>+ <DialogDescription className="text-sm text-muted-foreground">+ {t("color.customDescription", {+ default: "Choose a custom color using the color picker",+ })}</DialogDescription></DialogHeader>- <div className="space-y-4">- <HexColorPicker color={color} onChange={onChange} />- <div className="flex items-center gap-2">+ <div className="space-y-4 p-6">+ <div className="rounded-xl overflow-hidden border border-border/50 shadow-lg">+ <HexColorPicker+ color={color}+ onChange={onChange}+ className="w-full"+ />+ </div>+ <div className="flex items-center gap-2.5"><inputtype="text"value={color}onChange={(e) => onChange(e.target.value)}- className="flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm"+ className="flex h-11 w-full rounded-lg border border-border/50 bg-background/50 px-3 py-1 text-base shadow-sm transition-all focus:border-primary/50 focus:ring-2 focus:ring-primary/20 focus:outline-none"placeholder="#000000"/><Buttontype="button"onClick={() => setOpen(false)}variant="default"+ className="h-11 px-6 bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg shadow-primary/25">OK</Button>diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsxindex c5f4308..de0be6c 100644--- a/components/ui/dialog.tsx+++ b/components/ui/dialog.tsx@@ -54,8 +54,14 @@ function DialogContent({}: React.ComponentProps<typeof DialogPrimitive.Content> & {showCloseButton?: boolean;}) {+ const [container, setContainer] = React.useState<HTMLElement | null>(null);++ React.useEffect(() => {+ setContainer(document.body);+ }, []);+return (- <DialogPortal data-slot="dialog-portal">+ <DialogPortal data-slot="dialog-portal" container={container}><DialogOverlay /><DialogPrimitive.Contentdata-slot="dialog-content"diff --git a/messages/de.json b/messages/de.jsonindex 11f146f..071b91f 100644--- a/messages/de.json+++ b/messages/de.json@@ -5,14 +5,11 @@"delete": "Löschen","edit": "Bearbeiten","create": "Erstellen",- "close": "Schließen",- "confirm": "Bestätigen","loading": "Lädt...","required": "erforderlich"},"app": {"title": "BetterShift",- "description": "Verwalte deine Arbeitsschichten mit Leichtigkeit","subtitle": "Organisiere deine Schichten"},"calendar": {@@ -23,17 +20,22 @@"name": "Kalendername","namePlaceholder": "z.B. Meine Schichten","color": "Farbe",- "noCalendars": "Noch keine Kalender",- "createFirst": "Erstelle deinen ersten Kalender","managePassword": "Passwort verwalten","select": "Dein BetterShift Kalender","deleteCalendar": "Kalender löschen","deleteConfirm": "Kalender \"{name}\" wirklich löschen? Alle Schichten, Presets und Notizen werden ebenfalls gelöscht.","deleteWarning": "Diese Aktion kann nicht rückgängig gemacht werden. Alle Schichten, Presets und Notizen werden permanent gelöscht.",- "deleteSuccess": "Kalender erfolgreich gelöscht"+ "created": "Kalender erfolgreich erstellt",+ "deleted": "Kalender erfolgreich gelöscht",+ "createError": "Kalender konnte nicht erstellt werden",+ "deleteError": "Kalender konnte nicht gelöscht werden"+ },+ "color": {+ "custom": "Eigene Farbe",+ "customTitle": "Eigene Farbe wählen",+ "customDescription": "Wähle eine eigene Farbe mit dem Farbwähler"},"password": {- "use": "Passwort verwenden","optional": "Passwortschutz (optional)","password": "Passwort","passwordPlaceholder": "Passwort eingeben",@@ -44,8 +46,6 @@"confirmPassword": "Passwort bestätigen","confirmPasswordPlaceholder": "Passwort bestätigen","removePassword": "Passwort entfernen",- "setPassword": "Passwort setzen",- "updatePassword": "Passwort aktualisieren","manage": "Passwort für \"{name}\" verwalten","enter": "Passwort für \"{name}\" eingeben","enterCalendarPassword": "Kalenderpasswort eingeben",@@ -57,15 +57,18 @@"unlock": "Entsperren"},"note": {- "title": "Notizen","create": "Neue Notiz","edit": "Notiz bearbeiten",- "delete": "Notiz löschen","note": "Notiz","notePlaceholder": "z.B. Frühdienst weil nachmittags Friseur...",- "hint": "Notizen zu Tagen hinzufügen","hintMobile": "Langes Drücken auf einen Tag öffnet Notizen. Das Notiz-Icon zeigt vorhandene Notizen an.",- "hintDesktop": "Rechtsklick auf einen Tag öffnet Notizen. Das Notiz-Icon zeigt vorhandene Notizen an."+ "hintDesktop": "Rechtsklick auf einen Tag öffnet Notizen. Das Notiz-Icon zeigt vorhandene Notizen an.",+ "created": "Notiz erfolgreich erstellt",+ "updated": "Notiz erfolgreich aktualisiert",+ "deleted": "Notiz erfolgreich gelöscht",+ "createError": "Notiz konnte nicht erstellt werden",+ "updateError": "Notiz konnte nicht aktualisiert werden",+ "deleteError": "Notiz konnte nicht gelöscht werden"},"shift": {"title": "Schichten",@@ -73,56 +76,54 @@"createDescription": "Füge eine neue Schicht zu deinem Kalender hinzu","edit": "Schicht bearbeiten","editDescription": "Aktualisiere die Schichtdetails",- "delete": "Schicht löschen","date": "Datum","startTime": "Startzeit","endTime": "Endzeit",- "shiftTitle": "Schichttitel","titlePlaceholder": "z.B. Frühschicht","titleLabel": "Titel","color": "Farbe",- "notes": "Notizen","notesPlaceholder": "Zusätzliche Informationen...","notesOptional": "Notizen (optional)","allDay": "GT","allDayShift": "Ganztägige Schicht",- "noShifts": "Noch keine Schichten",- "noShiftsDescription": "Wähle oben eine Vorlage aus und klicke auf einen beliebigen Tag im Kalender, um deine Schichten hinzuzufügen.",- "createPresetFirst": "Erstelle zuerst eine Vorlage, dann klicke auf einen beliebigen Tag im Kalender, um deine Schichten hinzuzufügen.",- "shiftsThisMonth": "Schichten diesen Monat",+ "noShiftsInMonth": "Keine Schichten in diesem Monat",+ "noShiftsInMonthDescription": "Füge Schichten hinzu, indem du auf Tage im Kalender oben klickst.","shifts": "Schichten","shift_one": "Schicht",- "shift_other": "{count} Schichten","selectPreset": "Vorlage auswählen","none": "Keine","addShift": "Schicht hinzufügen",- "saveChanges": "Änderungen speichern"+ "saveChanges": "Änderungen speichern",+ "created": "Schicht erfolgreich erstellt",+ "updated": "Schicht erfolgreich aktualisiert",+ "deleted": "Schicht erfolgreich gelöscht",+ "createError": "Schicht konnte nicht erstellt werden",+ "updateError": "Schicht konnte nicht aktualisiert werden",+ "deleteError": "Schicht konnte nicht gelöscht werden"},"preset": {- "title": "Vorlage","create": "Neue Vorlage","createNew": "Neue Vorlage erstellen","createYourFirst": "Erstelle deine erste Vorlage","edit": "Vorlage bearbeiten",- "delete": "Vorlage löschen","manage": "Vorlagen verwalten","manageDescription": "Bearbeite oder lösche deine Schichtvorlagen","createDescription": "Erstelle eine neue Vorlage für eine schnelle Schichterstellung","editDescription": "Aktualisiere Vorlagendetails",- "name": "Vorlagenname","namePlaceholder": "z.B. Frühschicht","saveAsPreset": "Als Vorlage speichern","presetName": "Vorlagenname","presetNamePlaceholder": "z.B. Frühschicht, Spätschicht...","noPresets": "Noch keine Schichtvorlagen",- "createFirst": "Erstelle deine erste Schichtvorlage","createFirstDescription": "Erstelle deine erste Vorlage, um Schichten schnell zu deinem Kalender hinzuzufügen. Vorlagen speichern deine häufig genutzten Schichtzeiten und Details.",- "select": "Vorlage auswählen","deleteConfirm": "Diese Vorlage löschen? Alle aus dieser Vorlage erstellten Schichten werden ebenfalls gelöscht.",- "autoSaveEnabled": "Automatisches Speichern als Vorlage ist aktiviert",- "new": "Neu","secondaryPresets": "Sekundäre Vorlagen",- "markAsSecondary": "Als sekundär markieren (standardmäßig eingeklappt)"+ "markAsSecondary": "Als sekundär markieren (standardmäßig eingeklappt)",+ "created": "Vorlage erfolgreich erstellt",+ "updated": "Vorlage erfolgreich aktualisiert",+ "deleted": "Vorlage erfolgreich gelöscht",+ "saveError": "Vorlage konnte nicht gespeichert werden",+ "deleteError": "Vorlage konnte nicht gelöscht werden"},"calendar_grid": {"monday": "Mo",@@ -131,39 +132,16 @@"thursday": "Do","friday": "Fr","saturday": "Sa",- "sunday": "So",- "mondayFull": "Montag",- "tuesdayFull": "Dienstag",- "wednesdayFull": "Mittwoch",- "thursdayFull": "Donnerstag",- "fridayFull": "Freitag",- "saturdayFull": "Samstag",- "sundayFull": "Sonntag"- },- "language": {- "title": "Sprache",- "german": "Deutsch",- "english": "English",- "select": "Sprache wählen"- },- "colors": {- "blue": "Blau",- "red": "Rot",- "green": "Grün",- "amber": "Bernstein",- "violet": "Violett",- "pink": "Pink",- "cyan": "Cyan",- "orange": "Orange"+ "sunday": "So"},+"stats": {"title": "Schichtenstatistik","week": "Woche","month": "Monat","year": "Jahr","total": "Gesamt",- "noData": "Keine Schichten in diesem Zeitraum",- "shiftsTotal": "Schichten"+ "noData": "Keine Schichten in diesem Zeitraum"},"onboarding": {"welcome": "Willkommen bei BetterShift",diff --git a/messages/en.json b/messages/en.jsonindex 8e6e1c4..0358f57 100644--- a/messages/en.json+++ b/messages/en.json@@ -5,14 +5,11 @@"delete": "Delete","edit": "Edit","create": "Create",- "close": "Close",- "confirm": "Confirm","loading": "Loading...","required": "required"},"app": {"title": "BetterShift",- "description": "Manage your work shifts with ease","subtitle": "Organize your shifts"},"calendar": {@@ -23,17 +20,22 @@"name": "Calendar Name","namePlaceholder": "e.g., My Shifts","color": "Color",- "noCalendars": "No calendars yet",- "createFirst": "Create your first calendar","managePassword": "Manage Password","select": "Your BetterShift Calendar","deleteCalendar": "Delete Calendar","deleteConfirm": "Really delete calendar \"{name}\"? All shifts, presets and notes will also be deleted.","deleteWarning": "This action cannot be undone. All shifts, presets, and notes will be permanently deleted.",- "deleteSuccess": "Calendar deleted successfully"+ "created": "Calendar created successfully",+ "deleted": "Calendar deleted successfully",+ "createError": "Failed to create calendar",+ "deleteError": "Failed to delete calendar"+ },+ "color": {+ "custom": "Custom",+ "customTitle": "Custom Color",+ "customDescription": "Choose a custom color using the color picker"},"password": {- "use": "Use password","optional": "Password Protection (optional)","password": "Password","passwordPlaceholder": "Enter password",@@ -44,8 +46,6 @@"confirmPassword": "Confirm Password","confirmPasswordPlaceholder": "Confirm password","removePassword": "Remove Password",- "setPassword": "Set Password",- "updatePassword": "Update Password","manage": "Manage Password for \"{name}\"","enter": "Enter Password for \"{name}\"","enterCalendarPassword": "Enter calendar password",@@ -57,15 +57,18 @@"unlock": "Unlock"},"note": {- "title": "Notes","create": "New Note","edit": "Edit Note",- "delete": "Delete Note","note": "Note","notePlaceholder": "e.g., Early shift because appointment in the afternoon...",- "hint": "Add notes to days","hintMobile": "Long press on a day to open notes. The note icon shows existing notes.",- "hintDesktop": "Right-click on a day to open notes. The note icon shows existing notes."+ "hintDesktop": "Right-click on a day to open notes. The note icon shows existing notes.",+ "created": "Note created successfully",+ "updated": "Note updated successfully",+ "deleted": "Note deleted successfully",+ "createError": "Failed to create note",+ "updateError": "Failed to update note",+ "deleteError": "Failed to delete note"},"shift": {"title": "Shifts",@@ -73,56 +76,54 @@"createDescription": "Add a new shift to your calendar","edit": "Edit Shift","editDescription": "Update the shift details",- "delete": "Delete Shift","date": "Date","startTime": "Start Time","endTime": "End Time",- "shiftTitle": "Shift Title","titlePlaceholder": "e.g., Morning Shift","titleLabel": "Title","color": "Color",- "notes": "Notes","notesPlaceholder": "Additional information...","notesOptional": "Notes (optional)","allDay": "All Day","allDayShift": "All-day shift",- "noShifts": "No shifts yet",- "noShiftsDescription": "Select a preset above and click on any day in the calendar to add your shifts.",- "createPresetFirst": "Create a preset first, then click on any day in the calendar to add your shifts.",- "shiftsThisMonth": "shifts this month",+ "noShiftsInMonth": "No shifts this month",+ "noShiftsInMonthDescription": "Add shifts by clicking on days in the calendar above.","shifts": "shifts","shift_one": "shift",- "shift_other": "{count} shifts","selectPreset": "Select Preset","none": "None","addShift": "Add Shift",- "saveChanges": "Save Changes"+ "saveChanges": "Save Changes",+ "created": "Shift created successfully",+ "updated": "Shift updated successfully",+ "deleted": "Shift deleted successfully",+ "createError": "Failed to create shift",+ "updateError": "Failed to update shift",+ "deleteError": "Failed to delete shift"},"preset": {- "title": "Preset","create": "New Preset","createNew": "Create New Preset","createYourFirst": "Create Your First Preset","edit": "Edit Preset",- "delete": "Delete Preset","manage": "Manage Presets","manageDescription": "Edit or delete your shift presets","createDescription": "Create a new preset for quick shift creation","editDescription": "Update preset details",- "name": "Preset Name","namePlaceholder": "e.g., Morning Shift","saveAsPreset": "Save as preset","presetName": "Preset name","presetNamePlaceholder": "e.g., Morning Shift, Evening Shift...","noPresets": "No shift presets yet",- "createFirst": "Create your first shift preset","createFirstDescription": "Create your first preset to quickly add shifts to your calendar. Presets save your frequently used shift times and details.",- "select": "Select a preset","deleteConfirm": "Delete this preset? This will also delete all shifts created from this preset.",- "autoSaveEnabled": "Auto-save as preset is enabled",- "new": "New","secondaryPresets": "Secondary Presets",- "markAsSecondary": "Mark as secondary (collapsed by default)"+ "markAsSecondary": "Mark as secondary (collapsed by default)",+ "created": "Preset created successfully",+ "updated": "Preset updated successfully",+ "deleted": "Preset deleted successfully",+ "saveError": "Failed to save preset",+ "deleteError": "Failed to delete preset"},"calendar_grid": {"monday": "Mon",@@ -131,39 +132,16 @@"thursday": "Thu","friday": "Fri","saturday": "Sat",- "sunday": "Sun",- "mondayFull": "Monday",- "tuesdayFull": "Tuesday",- "wednesdayFull": "Wednesday",- "thursdayFull": "Thursday",- "fridayFull": "Friday",- "saturdayFull": "Saturday",- "sundayFull": "Sunday"- },- "language": {- "title": "Language",- "german": "Deutsch",- "english": "English",- "select": "Select Language"- },- "colors": {- "blue": "Blue",- "red": "Red",- "green": "Green",- "amber": "Amber",- "violet": "Violet",- "pink": "Pink",- "cyan": "Cyan",- "orange": "Orange"+ "sunday": "Sun"},+"stats": {"title": "Shift Statistics","week": "Week","month": "Month","year": "Year","total": "Total",- "noData": "No shifts in this period",- "shiftsTotal": "Shifts"+ "noData": "No shifts in this period"},"onboarding": {"welcome": "Welcome to BetterShift",diff --git a/package-lock.json b/package-lock.jsonindex 2a42fab..f80323f 100644--- a/package-lock.json+++ b/package-lock.json@@ -21,12 +21,14 @@"drizzle-kit": "^0.31.7","drizzle-orm": "^0.44.7","lucide-react": "^0.554.0",+ "motion": "^12.23.24","next": "16.0.3","next-intl": "^4.5.5","react": "19.2.0","react-colorful": "^5.6.1","react-day-picker": "^9.11.1","react-dom": "19.2.0",+ "sonner": "^2.0.7","tailwind-merge": "^3.4.0"},"devDependencies": {@@ -5871,6 +5873,33 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/framer-motion": {+ "version": "12.23.24",+ "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.23.24.tgz",+ "integrity": "sha512-HMi5HRoRCTou+3fb3h9oTLyJGBxHfW+HnNE25tAXOvVx/IvwMHK0cx7IR4a2ZU6sh3IX1Z+4ts32PcYBOqka8w==",+ "license": "MIT",+ "dependencies": {+ "motion-dom": "^12.23.23",+ "motion-utils": "^12.23.6",+ "tslib": "^2.4.0"+ },+ "peerDependencies": {+ "@emotion/is-prop-valid": "*",+ "react": "^18.0.0 || ^19.0.0",+ "react-dom": "^18.0.0 || ^19.0.0"+ },+ "peerDependenciesMeta": {+ "@emotion/is-prop-valid": {+ "optional": true+ },+ "react": {+ "optional": true+ },+ "react-dom": {+ "optional": true+ }+ }+ },"node_modules/fs-constants": {"version": "1.0.0","resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",@@ -7283,6 +7312,47 @@"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==","license": "MIT"},+ "node_modules/motion": {+ "version": "12.23.24",+ "resolved": "https://registry.npmjs.org/motion/-/motion-12.23.24.tgz",+ "integrity": "sha512-Rc5E7oe2YZ72N//S3QXGzbnXgqNrTESv8KKxABR20q2FLch9gHLo0JLyYo2hZ238bZ9Gx6cWhj9VO0IgwbMjCw==",+ "license": "MIT",+ "dependencies": {+ "framer-motion": "^12.23.24",+ "tslib": "^2.4.0"+ },+ "peerDependencies": {+ "@emotion/is-prop-valid": "*",+ "react": "^18.0.0 || ^19.0.0",+ "react-dom": "^18.0.0 || ^19.0.0"+ },+ "peerDependenciesMeta": {+ "@emotion/is-prop-valid": {+ "optional": true+ },+ "react": {+ "optional": true+ },+ "react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/motion-dom": {+ "version": "12.23.23",+ "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.23.23.tgz",+ "integrity": "sha512-n5yolOs0TQQBRUFImrRfs/+6X4p3Q4n1dUEqt/H58Vx7OW6RF+foWEgmTVDhIWJIMXOuNNL0apKH2S16en9eiA==",+ "license": "MIT",+ "dependencies": {+ "motion-utils": "^12.23.6"+ }+ },+ "node_modules/motion-utils": {+ "version": "12.23.6",+ "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.23.6.tgz",+ "integrity": "sha512-eAWoPgr4eFEOFfg2WjIsMoqJTW6Z8MTUCgn/GZ3VRpClWBdnbjryiA3ZSNLyxCTmCQx4RmYX6jX1iWHbenUPNQ==",+ "license": "MIT"+ },"node_modules/ms": {"version": "2.1.3","resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",@@ -8561,6 +8631,16 @@"simple-concat": "^1.0.0"}},+ "node_modules/sonner": {+ "version": "2.0.7",+ "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz",+ "integrity": "sha512-W6ZN4p58k8aDKA4XPcx2hpIQXBRAgyiWVkYhT7CvK6D3iAu7xjvVyhQHg2/iaKJZ1XVJ4r7XuwGL+WGEK37i9w==",+ "license": "MIT",+ "peerDependencies": {+ "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc",+ "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc"+ }+ },"node_modules/source-map": {"version": "0.6.1","resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",diff --git a/package.json b/package.jsonindex cf96545..7bada45 100644--- a/package.json+++ b/package.json@@ -26,12 +26,14 @@"drizzle-kit": "^0.31.7","drizzle-orm": "^0.44.7","lucide-react": "^0.554.0",+ "motion": "^12.23.24","next": "16.0.3","next-intl": "^4.5.5","react": "19.2.0","react-colorful": "^5.6.1","react-day-picker": "^9.11.1","react-dom": "19.2.0",+ "sonner": "^2.0.7","tailwind-merge": "^3.4.0"},"devDependencies": {