Skip to content

Your favorite shift management application!

feat: add color picker and all-day shift functionality to shift dialog

panteLx68305826d704
diff --git a/README.md b/README.md
index a611506..f80180b 100644
--- a/README.md
+++ b/README.md
@@ -48,7 +48,7 @@ A modern shift management application built with Next.js and SQLite. BetterShift
```bash
# Generate and apply database migrations
- npm run db:push
+ npm run db:migrate
```
4. **Start the development server**
@@ -76,7 +76,7 @@ A modern shift management application built with Next.js and SQLite. BetterShift
docker-compose up -d --build
# Generate and apply database migrations
- docker compose exec bettershift npm run db:push
+ docker compose exec bettershift npm run db:migrate
```
3. **Access the application**
diff --git a/app/api/presets/[id]/route.ts b/app/api/presets/[id]/route.ts
index d6d22d1..eefbd2f 100644
--- a/app/api/presets/[id]/route.ts
+++ b/app/api/presets/[id]/route.ts
@@ -11,16 +11,19 @@ export async function PATCH(
try {
const { id } = await params;
const body = await request.json();
- const { title, startTime, endTime, color, notes } = body;
+ const { title, startTime, endTime, color, notes, isSecondary, isAllDay } =
+ body;
const [updatedPreset] = await db
.update(shiftPresets)
.set({
title,
- startTime,
- endTime,
+ startTime: isAllDay ? "00:00" : startTime,
+ endTime: isAllDay ? "23:59" : endTime,
color,
notes: notes || null,
+ isSecondary: isSecondary !== undefined ? isSecondary : undefined,
+ isAllDay: isAllDay !== undefined ? isAllDay : undefined,
updatedAt: new Date(),
})
.where(eq(shiftPresets.id, id))
@@ -31,10 +34,11 @@ export async function PATCH(
.update(shifts)
.set({
title,
- startTime,
- endTime,
+ startTime: isAllDay ? "00:00" : startTime,
+ endTime: isAllDay ? "23:59" : endTime,
color,
notes: notes || null,
+ isAllDay: isAllDay !== undefined ? isAllDay : undefined,
updatedAt: new Date(),
})
.where(eq(shifts.presetId, id));
diff --git a/app/api/presets/route.ts b/app/api/presets/route.ts
index 47b0e6f..74f037a 100644
--- a/app/api/presets/route.ts
+++ b/app/api/presets/route.ts
@@ -34,9 +34,18 @@ export async function GET(request: NextRequest) {
export async function POST(request: NextRequest) {
try {
const body = await request.json();
- const { calendarId, title, startTime, endTime, color, notes } = body;
+ const {
+ calendarId,
+ title,
+ startTime,
+ endTime,
+ color,
+ notes,
+ isSecondary,
+ isAllDay,
+ } = body;
- if (!calendarId || !title || !startTime || !endTime) {
+ if (!calendarId || !title) {
return NextResponse.json(
{ error: "Missing required fields" },
{ status: 400 }
@@ -48,10 +57,12 @@ export async function POST(request: NextRequest) {
.values({
calendarId,
title,
- startTime,
- endTime,
+ startTime: isAllDay ? "00:00" : startTime,
+ endTime: isAllDay ? "23:59" : endTime,
color: color || "#3b82f6",
notes: notes || null,
+ isSecondary: isSecondary || false,
+ isAllDay: isAllDay || false,
})
.returning();
diff --git a/app/api/shifts/[id]/route.ts b/app/api/shifts/[id]/route.ts
index d249460..263f645 100644
--- a/app/api/shifts/[id]/route.ts
+++ b/app/api/shifts/[id]/route.ts
@@ -18,7 +18,10 @@ export async function GET(
startTime: shifts.startTime,
endTime: shifts.endTime,
title: shifts.title,
+ color: shifts.color,
notes: shifts.notes,
+ isAllDay: shifts.isAllDay,
+ isSecondary: shifts.isSecondary,
createdAt: shifts.createdAt,
updatedAt: shifts.updatedAt,
calendar: {
@@ -53,15 +56,26 @@ export async function PATCH(
try {
const { id } = await params;
const body = await request.json();
- const { date, startTime, endTime, title, color, notes } = body;
+ const {
+ date,
+ startTime,
+ endTime,
+ title,
+ color,
+ notes,
+ isAllDay,
+ isSecondary,
+ } = body;
const updateData: any = {};
if (date) updateData.date = new Date(date);
- if (startTime) updateData.startTime = startTime;
- if (endTime) updateData.endTime = endTime;
+ if (startTime !== undefined) updateData.startTime = startTime;
+ if (endTime !== undefined) updateData.endTime = endTime;
if (title) updateData.title = title;
if (color) updateData.color = color;
if (notes !== undefined) updateData.notes = notes;
+ if (isAllDay !== undefined) updateData.isAllDay = isAllDay;
+ if (isSecondary !== undefined) updateData.isSecondary = isSecondary;
const [shift] = await db
.update(shifts)
diff --git a/app/api/shifts/route.ts b/app/api/shifts/route.ts
index 899a0d6..3a8bcca 100644
--- a/app/api/shifts/route.ts
+++ b/app/api/shifts/route.ts
@@ -27,6 +27,8 @@ export async function GET(request: Request) {
title: shifts.title,
color: shifts.color,
notes: shifts.notes,
+ isAllDay: shifts.isAllDay,
+ isSecondary: shifts.isSecondary,
createdAt: shifts.createdAt,
updatedAt: shifts.updatedAt,
calendar: {
@@ -77,9 +79,11 @@ export async function POST(request: Request) {
color,
notes,
presetId,
+ isAllDay,
+ isSecondary,
} = body;
- if (!calendarId || !date || !startTime || !endTime || !title) {
+ if (!calendarId || !date || !title) {
return NextResponse.json(
{ error: "Missing required fields" },
{ status: 400 }
@@ -92,11 +96,13 @@ export async function POST(request: Request) {
calendarId,
presetId: presetId || null,
date: new Date(date),
- startTime,
- endTime,
+ startTime: isAllDay ? "00:00" : startTime,
+ endTime: isAllDay ? "23:59" : endTime,
title,
color: color || "#3b82f6",
notes: notes || null,
+ isAllDay: isAllDay || false,
+ isSecondary: isSecondary || false,
})
.returning();
diff --git a/app/page.tsx b/app/page.tsx
index 208f33e..fa188d3 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -216,6 +216,7 @@ function HomeContent() {
color: preset.color,
notes: preset.notes || "",
presetId: preset.id,
+ isAllDay: preset.isAllDay || false,
};
createShift(shiftData);
}
@@ -373,13 +374,19 @@ function HomeContent() {
: "#3b82f620",
borderLeft: `2px solid ${shift.color || "#3b82f6"}`,
}}
- title={`${shift.title} (${shift.startTime} - ${shift.endTime})`}
+ title={`${shift.title} ${
+ shift.isAllDay
+ ? "(All day)"
+ : `(${shift.startTime} - ${shift.endTime})`
+ }`}
>
<div className="font-medium truncate leading-tight">
{shift.title}
</div>
<div className="text-[9px] sm:text-[10px] opacity-70 leading-tight">
- {shift.startTime.substring(0, 5)}
+ {shift.isAllDay
+ ? "All day"
+ : shift.startTime.substring(0, 5)}
</div>
</div>
))}
@@ -513,6 +520,7 @@ function HomeContent() {
onSubmit={handleShiftSubmit}
selectedDate={selectedDate}
onPresetsChange={fetchPresets}
+ calendarId={selectedCalendar}
/>
</div>
);
diff --git a/components/preset-selector.tsx b/components/preset-selector.tsx
index 626d767..b4a575b 100644
--- a/components/preset-selector.tsx
+++ b/components/preset-selector.tsx
@@ -2,7 +2,7 @@
import { ShiftPreset } from "@/lib/db/schema";
import { Button } from "@/components/ui/button";
-import { Check, Settings, Plus } from "lucide-react";
+import { Check, Settings, Plus, ChevronDown, ChevronUp } from "lucide-react";
import { useState } from "react";
import {
Dialog,
@@ -13,6 +13,8 @@ import {
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Trash2 } from "lucide-react";
+import { Checkbox } from "@/components/ui/checkbox";
+import { ColorPicker } from "@/components/ui/color-picker";
interface PresetSelectorProps {
presets: ShiftPreset[];
@@ -51,7 +53,10 @@ export function PresetSelector({
endTime: "17:00",
color: PRESET_COLORS[0].value,
notes: "",
+ isSecondary: false,
+ isAllDay: false,
});
+ const [showSecondary, setShowSecondary] = useState(false);
const resetForm = () => {
setFormData({
@@ -60,6 +65,8 @@ export function PresetSelector({
endTime: "17:00",
color: PRESET_COLORS[0].value,
notes: "",
+ isSecondary: false,
+ isAllDay: false,
});
};
@@ -78,6 +85,8 @@ export function PresetSelector({
endTime: preset.endTime,
color: preset.color,
notes: preset.notes || "",
+ isSecondary: preset.isSecondary || false,
+ isAllDay: preset.isAllDay || false,
});
};
@@ -153,52 +162,141 @@ export function PresetSelector({
</Button>
</div>
) : (
- <div className="flex items-center gap-1.5 sm:gap-2 flex-wrap">
- {presets.map((preset) => (
+ <div className="space-y-2">
+ {/* Primary Presets */}
+ <div className="flex items-center gap-1.5 sm:gap-2 flex-wrap">
+ {presets
+ .filter((p) => !p.isSecondary)
+ .map((preset) => (
+ <Button
+ key={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,
+ }}
+ >
+ {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>All day</span>
+ ) : (
+ <>
+ <span className="sm:hidden">{preset.startTime}</span>
+ <span className="hidden sm:inline">
+ {preset.startTime} - {preset.endTime}
+ </span>
+ </>
+ )}
+ </span>
+ </Button>
+ ))}
<Button
- key={preset.id}
- variant={selectedPresetId === preset.id ? "default" : "outline"}
+ variant="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,
- }}
+ onClick={handleCreateNew}
+ className="gap-1 text-xs sm:text-sm px-2 sm:px-3 h-8 sm:h-9"
>
- {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 hidden sm:inline">
- {preset.startTime} - {preset.endTime}
- </span>
+ <Plus className="h-3 sm:h-4 w-3 sm:w-4" />
+ <span className="hidden xs:inline sm:inline">New Preset</span>
</Button>
- ))}
- <Button
- variant="outline"
- size="sm"
- onClick={handleCreateNew}
- className="gap-1 text-xs sm:text-sm px-2 sm:px-3 h-8 sm:h-9"
- >
- <Plus className="h-3 sm:h-4 w-3 sm:w-4" />
- <span className="hidden xs:inline sm:inline">New Preset</span>
- </Button>
- <Button
- variant="ghost"
- size="sm"
- onClick={() => setShowManageDialog(true)}
- className="h-8 sm:h-9 w-8 sm:w-9 p-0"
- >
- <Settings className="h-3 sm:h-4 w-3 sm:w-4" />
- </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => setShowManageDialog(true)}
+ className="h-8 sm:h-9 w-8 sm:w-9 p-0"
+ >
+ <Settings className="h-3 sm:h-4 w-3 sm:w-4" />
+ </Button>
+ </div>
+
+ {/* Secondary Presets - Collapsible */}
+ {presets.some((p) => p.isSecondary) && (
+ <div className="space-y-1.5">
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => setShowSecondary(!showSecondary)}
+ className="gap-1 text-xs text-muted-foreground h-6 px-2"
+ >
+ {showSecondary ? (
+ <ChevronUp className="h-3 w-3" />
+ ) : (
+ <ChevronDown className="h-3 w-3" />
+ )}
+ <span>
+ Secondary Presets (
+ {presets.filter((p) => p.isSecondary).length})
+ </span>
+ </Button>
+ {showSecondary && (
+ <div className="flex items-center gap-1.5 sm:gap-2 flex-wrap pl-2">
+ {presets
+ .filter((p) => p.isSecondary)
+ .map((preset) => (
+ <Button
+ key={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,
+ }}
+ >
+ {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>All day</span>
+ ) : (
+ <>
+ <span className="sm:hidden">
+ {preset.startTime}
+ </span>
+ <span className="hidden sm:inline">
+ {preset.startTime} - {preset.endTime}
+ </span>
+ </>
+ )}
+ </span>
+ </Button>
+ ))}
+ </div>
+ )}
+ </div>
+ )}
</div>
)}
@@ -226,7 +324,13 @@ export function PresetSelector({
<div className="flex-1">
<div className="font-medium">{preset.title}</div>
<div className="text-sm text-muted-foreground">
- {preset.startTime} - {preset.endTime}
+ {preset.isAllDay ? (
+ <span>All day</span>
+ ) : (
+ <>
+ {preset.startTime} - {preset.endTime}
+ </>
+ )}
</div>
</div>
<div className="flex gap-2">
@@ -262,27 +366,47 @@ export function PresetSelector({
}
}}
>
- <DialogContent className="sm:max-w-[425px]">
+ <DialogContent className="max-h-[90vh] overflow-y-auto overflow-x-hidden w-[95vw] max-w-[500px] p-4 sm:p-6">
<DialogHeader>
- <DialogTitle>
+ <DialogTitle className="text-base sm:text-lg">
{isCreatingNew ? "Create New Preset" : "Edit Preset"}
</DialogTitle>
</DialogHeader>
- <div className="space-y-4">
- <div className="space-y-2">
- <Label htmlFor="preset-title">Title</Label>
+ <div className="space-y-4 pb-2">
+ <div className="space-y-1.5">
+ <Label htmlFor="preset-title" className="text-sm">
+ Title
+ </Label>
<Input
id="preset-title"
- placeholder="e.g., Morning Shift, Evening Shift"
+ placeholder="e.g., Morning Shift"
value={formData.title}
onChange={(e) =>
setFormData({ ...formData, title: e.target.value })
}
+ className="text-base"
+ />
+ </div>
+ <div className="flex items-center space-x-2 py-1">
+ <Checkbox
+ id="preset-allday"
+ checked={formData.isAllDay}
+ onCheckedChange={(checked) =>
+ setFormData({ ...formData, isAllDay: !!checked })
+ }
/>
+ <Label
+ htmlFor="preset-allday"
+ className="text-sm font-medium cursor-pointer"
+ >
+ All-day shift
+ </Label>
</div>
- <div className="grid grid-cols-2 gap-4">
- <div className="space-y-2">
- <Label htmlFor="preset-start">Start Time</Label>
+ <div className="grid grid-cols-2 gap-3">
+ <div className="space-y-1.5">
+ <Label htmlFor="preset-start" className="text-sm">
+ Start Time
+ </Label>
<Input
id="preset-start"
type="time"
@@ -290,10 +414,14 @@ export function PresetSelector({
onChange={(e) =>
setFormData({ ...formData, startTime: e.target.value })
}
+ disabled={formData.isAllDay}
+ className="text-base"
/>
</div>
- <div className="space-y-2">
- <Label htmlFor="preset-end">End Time</Label>
+ <div className="space-y-1.5">
+ <Label htmlFor="preset-end" className="text-sm">
+ End Time
+ </Label>
<Input
id="preset-end"
type="time"
@@ -301,34 +429,21 @@ export function PresetSelector({
onChange={(e) =>
setFormData({ ...formData, endTime: e.target.value })
}
+ disabled={formData.isAllDay}
+ className="text-base"
/>
</div>
</div>
- <div className="space-y-2">
- <Label htmlFor="preset-color">Color</Label>
- <div className="grid grid-cols-8 gap-2">
- {PRESET_COLORS.map((colorOption) => (
- <button
- key={colorOption.value}
- type="button"
- onClick={() =>
- setFormData({ ...formData, color: colorOption.value })
- }
- className={`h-10 w-10 rounded-md transition-all hover:scale-110 ${
- formData.color === colorOption.value
- ? "ring-2 ring-offset-2 ring-foreground"
- : ""
- }`}
- style={{
- backgroundColor: colorOption.value,
- }}
- title={colorOption.name}
- />
- ))}
- </div>
- </div>
- <div className="space-y-2">
- <Label htmlFor="preset-notes">Notes (optional)</Label>
+ <ColorPicker
+ color={formData.color}
+ onChange={(color) => setFormData({ ...formData, color })}
+ label="Color"
+ presetColors={PRESET_COLORS}
+ />
+ <div className="space-y-1.5">
+ <Label htmlFor="preset-notes" className="text-sm">
+ Notes (optional)
+ </Label>
<Input
id="preset-notes"
placeholder="Additional information..."
@@ -336,9 +451,25 @@ export function PresetSelector({
onChange={(e) =>
setFormData({ ...formData, notes: e.target.value })
}
+ className="text-base"
/>
</div>
- <div className="flex justify-end gap-3">
+ <div className="flex items-center space-x-2 py-1">
+ <Checkbox
+ id="preset-secondary"
+ checked={formData.isSecondary}
+ onCheckedChange={(checked) =>
+ setFormData({ ...formData, isSecondary: !!checked })
+ }
+ />
+ <Label
+ htmlFor="preset-secondary"
+ className="text-sm font-normal cursor-pointer"
+ >
+ Mark as secondary (collapsed by default)
+ </Label>
+ </div>
+ <div className="flex gap-2 pt-2">
<Button
type="button"
variant="outline"
@@ -347,6 +478,7 @@ export function PresetSelector({
setIsCreatingNew(false);
resetForm();
}}
+ className="flex-1"
>
Cancel
</Button>
@@ -354,6 +486,7 @@ export function PresetSelector({
type="button"
onClick={handleSave}
disabled={!formData.title.trim()}
+ className="flex-1"
>
{isCreatingNew ? "Create" : "Save"}
</Button>
diff --git a/components/shift-card.tsx b/components/shift-card.tsx
index 0ab7088..4d3ec6f 100644
--- a/components/shift-card.tsx
+++ b/components/shift-card.tsx
@@ -22,9 +22,15 @@ export function ShiftCard({ shift, onDelete }: ShiftCardProps) {
{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">
- <span className="font-medium">{shift.startTime}</span>
- <span>→</span>
- <span className="font-medium">{shift.endTime}</span>
+ {shift.isAllDay ? (
+ <span className="font-medium">All day</span>
+ ) : (
+ <>
+ <span className="font-medium">{shift.startTime}</span>
+ <span>→</span>
+ <span className="font-medium">{shift.endTime}</span>
+ </>
+ )}
</div>
{shift.notes && (
<p className="text-[10px] sm:text-xs text-muted-foreground mt-1 sm:mt-1.5 line-clamp-2">
diff --git a/components/shift-dialog.tsx b/components/shift-dialog.tsx
index 4f952e3..792c829 100644
--- a/components/shift-dialog.tsx
+++ b/components/shift-dialog.tsx
@@ -22,6 +22,18 @@ import { ShiftWithCalendar } from "@/lib/types";
import { ShiftPreset } from "@/lib/db/schema";
import { formatDateToLocal } from "@/lib/date-utils";
import { Checkbox } from "@/components/ui/checkbox";
+import { ColorPicker } from "@/components/ui/color-picker";
+
+const PRESET_COLORS = [
+ { name: "Blue", value: "#3b82f6" },
+ { name: "Red", value: "#ef4444" },
+ { name: "Green", value: "#10b981" },
+ { name: "Amber", value: "#f59e0b" },
+ { name: "Violet", value: "#8b5cf6" },
+ { name: "Pink", value: "#ec4899" },
+ { name: "Cyan", value: "#06b6d4" },
+ { name: "Orange", value: "#f97316" },
+];
interface ShiftDialogProps {
open: boolean;
@@ -30,6 +42,7 @@ interface ShiftDialogProps {
selectedDate?: Date;
shift?: ShiftWithCalendar;
onPresetsChange?: () => void;
+ calendarId?: string;
}
export interface ShiftFormData {
@@ -40,6 +53,7 @@ export interface ShiftFormData {
color?: string;
notes?: string;
presetId?: string;
+ isAllDay?: boolean;
}
export function ShiftDialog({
@@ -49,6 +63,7 @@ export function ShiftDialog({
selectedDate,
shift,
onPresetsChange,
+ calendarId,
}: ShiftDialogProps) {
const [formData, setFormData] = useState<ShiftFormData>({
date:
@@ -61,6 +76,8 @@ export function ShiftDialog({
endTime: shift?.endTime || "17:00",
title: shift?.title || "",
notes: shift?.notes || "",
+ color: shift?.color || "#3b82f6",
+ isAllDay: false,
});
const [presets, setPresets] = useState<ShiftPreset[]>([]);
@@ -86,6 +103,8 @@ export function ShiftDialog({
endTime: shift?.endTime || "17:00",
title: shift?.title || "",
notes: shift?.notes || "",
+ color: shift?.color || "#3b82f6",
+ isAllDay: shift?.isAllDay || false,
});
setSaveAsPreset(!shift); // Enable auto-save for new shifts
setPresetName("");
@@ -103,18 +122,20 @@ export function ShiftDialog({
};
const handleSaveAsPreset = async (shiftData: ShiftFormData) => {
- if (!presetName.trim()) return;
+ if (!presetName.trim() || !calendarId) return;
try {
const response = await fetch("/api/presets", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
- name: presetName,
+ calendarId,
+ title: presetName,
startTime: shiftData.startTime,
endTime: shiftData.endTime,
- title: shiftData.title,
+ color: shiftData.color,
notes: shiftData.notes,
+ isAllDay: shiftData.isAllDay,
}),
});
await response.json();
@@ -135,17 +156,26 @@ export function ShiftDialog({
endTime: preset.endTime,
title: preset.title,
notes: preset.notes || "",
+ color: preset.color,
+ isAllDay: preset.isAllDay || false,
});
};
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
if (formData.title.trim()) {
- onSubmit(formData);
+ // If all-day, set default times for backend
+ const submitData = {
+ ...formData,
+ startTime: formData.isAllDay ? "00:00" : formData.startTime,
+ endTime: formData.isAllDay ? "23:59" : formData.endTime,
+ };
+
+ onSubmit(submitData);
// Save as preset if enabled and it's a new shift
if (!shift && saveAsPreset && presetName.trim()) {
- handleSaveAsPreset(formData);
+ handleSaveAsPreset(submitData);
}
if (!shift) {
@@ -157,6 +187,8 @@ export function ShiftDialog({
endTime: "17:00",
title: "",
notes: "",
+ color: "#3b82f6",
+ isAllDay: false,
});
setPresetName("");
}
@@ -208,30 +240,49 @@ export function ShiftDialog({
}
/>
</div>
- <div className="grid grid-cols-2 gap-4">
- <div className="space-y-2">
- <Label htmlFor="startTime">Start Time</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">End Time</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 py-2">
+ <Checkbox
+ id="allDay"
+ checked={formData.isAllDay}
+ onCheckedChange={(checked) =>
+ setFormData({ ...formData, isAllDay: !!checked })
+ }
+ />
+ <Label
+ htmlFor="allDay"
+ className="text-sm font-medium cursor-pointer"
+ >
+ All-day shift
+ </Label>
</div>
+
+ {!formData.isAllDay && (
+ <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-2">
+ <Label htmlFor="startTime">Start Time</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">End Time</Label>
+ <Input
+ id="endTime"
+ type="time"
+ value={formData.endTime}
+ onChange={(e) =>
+ setFormData({ ...formData, endTime: e.target.value })
+ }
+ />
+ </div>
+ </div>
+ )}
<div className="space-y-2">
<Label htmlFor="title">Title</Label>
<Input
@@ -256,6 +307,12 @@ export function ShiftDialog({
rows={3}
/>
</div>
+ <ColorPicker
+ color={formData.color || "#3b82f6"}
+ onChange={(color) => setFormData({ ...formData, color })}
+ label="Color"
+ presetColors={PRESET_COLORS}
+ />
{/* Auto-Save as Preset */}
{!shift && (
diff --git a/components/ui/color-picker.tsx b/components/ui/color-picker.tsx
new file mode 100644
index 0000000..0f1f0ab
--- /dev/null
+++ b/components/ui/color-picker.tsx
@@ -0,0 +1,97 @@
+"use client";
+
+import { useState } from "react";
+import { HexColorPicker } from "react-colorful";
+import { Label } from "@/components/ui/label";
+import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from "@/components/ui/dialog";
+
+interface ColorPickerProps {
+ color: string;
+ onChange: (color: string) => void;
+ label?: string;
+ presetColors?: { name: string; value: string }[];
+}
+
+export function ColorPicker({
+ color,
+ onChange,
+ label = "Color",
+ presetColors = [],
+}: ColorPickerProps) {
+ const [open, setOpen] = useState(false);
+
+ return (
+ <div className="space-y-2">
+ {label && <Label>{label}</Label>}
+ <div className="flex flex-wrap gap-2">
+ {/* Preset Colors */}
+ {presetColors.map((preset) => (
+ <button
+ key={preset.value}
+ type="button"
+ onClick={() => onChange(preset.value)}
+ className={`w-8 h-8 rounded-md border-2 transition-all ${
+ color === preset.value
+ ? "border-foreground scale-110"
+ : "border-muted-foreground/20 hover:border-muted-foreground/50"
+ }`}
+ style={{ backgroundColor: preset.value }}
+ title={preset.name}
+ />
+ ))}
+
+ {/* Custom Color Picker Button */}
+ <Dialog open={open} onOpenChange={setOpen}>
+ <DialogTrigger asChild>
+ <Button
+ type="button"
+ variant="outline"
+ className="h-8 px-3 gap-2 border-2 border-dashed relative"
+ title="Custom color"
+ >
+ <div
+ className="w-5 h-5 rounded border-2 border-foreground/20"
+ style={{ backgroundColor: color }}
+ />
+ <span className="text-xs font-medium">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>
+ </DialogHeader>
+ <div className="space-y-4">
+ <HexColorPicker color={color} onChange={onChange} />
+ <div className="flex items-center gap-2">
+ <input
+ type="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"
+ placeholder="#000000"
+ />
+ <Button
+ type="button"
+ onClick={() => setOpen(false)}
+ variant="default"
+ >
+ OK
+ </Button>
+ </div>
+ </div>
+ </DialogContent>
+ </Dialog>
+ </div>
+ </div>
+ );
+}
diff --git a/drizzle/0001_marvelous_gunslinger.sql b/drizzle/0001_marvelous_gunslinger.sql
new file mode 100644
index 0000000..f031a91
--- /dev/null
+++ b/drizzle/0001_marvelous_gunslinger.sql
@@ -0,0 +1,4 @@
+ALTER TABLE `shift_presets` ADD `is_secondary` integer DEFAULT false NOT NULL;--> statement-breakpoint
+ALTER TABLE `shift_presets` ADD `is_all_day` integer DEFAULT false NOT NULL;--> statement-breakpoint
+ALTER TABLE `shifts` ADD `is_all_day` integer DEFAULT false NOT NULL;--> statement-breakpoint
+ALTER TABLE `shifts` ADD `is_secondary` integer DEFAULT false NOT NULL;
diff --git a/drizzle/meta/0001_snapshot.json b/drizzle/meta/0001_snapshot.json
new file mode 100644
index 0000000..9979f5f
--- /dev/null
+++ b/drizzle/meta/0001_snapshot.json
@@ -0,0 +1,289 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "3c04e502-20c3-4cd1-8331-df0a2aabad5d",
+ "prevId": "72db8ba4-ca59-4ec8-b865-93a49b9e2a59",
+ "tables": {
+ "calendars": {
+ "name": "calendars",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'#3b82f6'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shift_presets": {
+ "name": "shift_presets",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "calendar_id": {
+ "name": "calendar_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "start_time": {
+ "name": "start_time",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "end_time": {
+ "name": "end_time",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'#3b82f6'"
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_secondary": {
+ "name": "is_secondary",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "shift_presets_calendar_id_calendars_id_fk": {
+ "name": "shift_presets_calendar_id_calendars_id_fk",
+ "tableFrom": "shift_presets",
+ "tableTo": "calendars",
+ "columnsFrom": [
+ "calendar_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "shifts": {
+ "name": "shifts",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "calendar_id": {
+ "name": "calendar_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "preset_id": {
+ "name": "preset_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "date": {
+ "name": "date",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "start_time": {
+ "name": "start_time",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "end_time": {
+ "name": "end_time",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'#3b82f6'"
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "is_all_day": {
+ "name": "is_all_day",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "CURRENT_TIMESTAMP"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "shifts_calendar_id_calendars_id_fk": {
+ "name": "shifts_calendar_id_calendars_id_fk",
+ "tableFrom": "shifts",
+ "tableTo": "calendars",
+ "columnsFrom": [
+ "calendar_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "shifts_preset_id_shift_presets_id_fk": {
+ "name": "shifts_preset_id_shift_presets_id_fk",
+ "tableFrom": "shifts",
+ "tableTo": "shift_presets",
+ "columnsFrom": [
+ "preset_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json
index 4ee86c2..85a7408 100644
--- a/drizzle/meta/_journal.json
+++ b/drizzle/meta/_journal.json
@@ -8,6 +8,13 @@
"when": 1763688289585,
"tag": "0000_magical_starjammers",
"breakpoints": true
+ },
+ {
+ "idx": 1,
+ "version": "6",
+ "when": 1763767949322,
+ "tag": "0001_marvelous_gunslinger",
+ "breakpoints": true
}
]
-}
\ No newline at end of file
+}
diff --git a/lib/db/schema.ts b/lib/db/schema.ts
index 1b810a0..ef25fa0 100644
--- a/lib/db/schema.ts
+++ b/lib/db/schema.ts
@@ -31,6 +31,10 @@ export const shifts = sqliteTable("shifts", {
title: text("title").notNull(),
color: text("color").notNull().default("#3b82f6"),
notes: text("notes"),
+ isAllDay: integer("is_all_day", { mode: "boolean" }).notNull().default(false),
+ isSecondary: integer("is_secondary", { mode: "boolean" })
+ .notNull()
+ .default(false),
createdAt: integer("created_at", { mode: "timestamp" })
.notNull()
.default(sql`CURRENT_TIMESTAMP`),
@@ -51,6 +55,10 @@ export const shiftPresets = sqliteTable("shift_presets", {
endTime: text("end_time").notNull(),
color: text("color").notNull().default("#3b82f6"),
notes: text("notes"),
+ isSecondary: integer("is_secondary", { mode: "boolean" })
+ .notNull()
+ .default(false),
+ isAllDay: integer("is_all_day", { mode: "boolean" }).notNull().default(false),
createdAt: integer("created_at", { mode: "timestamp" })
.notNull()
.default(sql`CURRENT_TIMESTAMP`),
diff --git a/lib/types.ts b/lib/types.ts
index f1b68bf..cf0966b 100644
--- a/lib/types.ts
+++ b/lib/types.ts
@@ -24,6 +24,7 @@ export interface ShiftWithCalendar {
title: string;
color: string;
notes?: string | null;
+ isAllDay?: boolean;
createdAt: Date | null;
updatedAt: Date | null;
}
diff --git a/package-lock.json b/package-lock.json
index 2a6910b..d526762 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "bettershift",
- "version": "0.1.0",
+ "version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "bettershift",
- "version": "0.1.0",
+ "version": "1.0.0",
"dependencies": {
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-dialog": "^1.1.15",
@@ -18,10 +18,12 @@
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"dotenv": "^17.2.3",
+ "drizzle-kit": "^0.31.7",
"drizzle-orm": "^0.44.7",
"lucide-react": "^0.554.0",
"next": "16.0.3",
"react": "19.2.0",
+ "react-colorful": "^5.6.1",
"react-day-picker": "^9.11.1",
"react-dom": "19.2.0",
"tailwind-merge": "^3.4.0"
@@ -32,10 +34,10 @@
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
- "drizzle-kit": "^0.31.7",
"eslint": "^9",
"eslint-config-next": "16.0.3",
"tailwindcss": "^4",
+ "tsx": "^4.20.6",
"tw-animate-css": "^1.4.0",
"typescript": "^5"
}
@@ -303,7 +305,6 @@
"version": "0.10.2",
"resolved": "https://registry.npmjs.org/@drizzle-team/brocli/-/brocli-0.10.2.tgz",
"integrity": "sha512-z33Il7l5dKjUgGULTqBsQBQwckHh5AbIuxhdsIxDDiZAzBOrZO6q9ogcWC65kU382AfynTfgNumVcNIjuIua6w==",
- "dev": true,
"license": "Apache-2.0"
},
"node_modules/@emnapi/core": {
@@ -344,7 +345,6 @@
"resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.3.2.tgz",
"integrity": "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==",
"deprecated": "Merged into tsx: https://tsx.is",
- "dev": true,
"license": "MIT",
"dependencies": {
"esbuild": "~0.18.20",
@@ -358,7 +358,6 @@
"cpu": [
"arm"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -375,7 +374,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -392,7 +390,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -409,7 +406,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -426,7 +422,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -443,7 +438,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -460,7 +454,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -477,7 +470,6 @@
"cpu": [
"arm"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -494,7 +486,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -511,7 +502,6 @@
"cpu": [
"ia32"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -528,7 +518,6 @@
"cpu": [
"loong64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -545,7 +534,6 @@
"cpu": [
"mips64el"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -562,7 +550,6 @@
"cpu": [
"ppc64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -579,7 +566,6 @@
"cpu": [
"riscv64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -596,7 +582,6 @@
"cpu": [
"s390x"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -613,7 +598,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -630,7 +614,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -647,7 +630,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -664,7 +646,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -681,7 +662,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -698,7 +678,6 @@
"cpu": [
"ia32"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -715,7 +694,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -729,7 +707,6 @@
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz",
"integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==",
- "dev": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
@@ -768,7 +745,6 @@
"resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.6.5.tgz",
"integrity": "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==",
"deprecated": "Merged into tsx: https://tsx.is",
- "dev": true,
"license": "MIT",
"dependencies": {
"@esbuild-kit/core-utils": "^3.3.2",
@@ -782,7 +758,6 @@
"cpu": [
"ppc64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -799,7 +774,6 @@
"cpu": [
"arm"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -816,7 +790,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -833,7 +806,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -850,7 +822,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -867,7 +838,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -884,7 +854,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -901,7 +870,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -918,7 +886,6 @@
"cpu": [
"arm"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -935,7 +902,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -952,7 +918,6 @@
"cpu": [
"ia32"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -969,7 +934,6 @@
"cpu": [
"loong64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -986,7 +950,6 @@
"cpu": [
"mips64el"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1003,7 +966,6 @@
"cpu": [
"ppc64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1020,7 +982,6 @@
"cpu": [
"riscv64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1037,7 +998,6 @@
"cpu": [
"s390x"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1054,7 +1014,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1071,7 +1030,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1088,7 +1046,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1105,7 +1062,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1122,7 +1078,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1139,7 +1094,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1156,7 +1110,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1173,7 +1126,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1190,7 +1142,6 @@
"cpu": [
"ia32"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1207,7 +1158,6 @@
"cpu": [
"x64"
],
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -4260,7 +4210,6 @@
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
- "dev": true,
"license": "MIT"
},
"node_modules/call-bind": {
@@ -4530,7 +4479,6 @@
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
- "dev": true,
"license": "MIT",
"dependencies": {
"ms": "^2.1.3"
@@ -4655,7 +4603,6 @@
"version": "0.31.7",
"resolved": "https://registry.npmjs.org/drizzle-kit/-/drizzle-kit-0.31.7.tgz",
"integrity": "sha512-hOzRGSdyKIU4FcTSFYGKdXEjFsncVwHZ43gY3WU5Bz9j5Iadp6Rh6hxLSQ1IWXpKLBKt/d5y1cpSPcV+FcoQ1A==",
- "dev": true,
"license": "MIT",
"dependencies": {
"@drizzle-team/brocli": "^0.10.2",
@@ -5025,7 +4972,6 @@
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
"integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
- "dev": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
@@ -5067,7 +5013,6 @@
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/esbuild-register/-/esbuild-register-3.6.0.tgz",
"integrity": "sha512-H2/S7Pm8a9CL1uhp9OvjwrBh5Pvx0H8qVOxNu8Wed9Y7qv56MPtq+GGM8RJpq6glYJn9Wspr8uw7l55uyinNeg==",
- "dev": true,
"license": "MIT",
"dependencies": {
"debug": "^4.3.4"
@@ -5685,6 +5630,21 @@
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
"license": "MIT"
},
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
@@ -5816,7 +5776,6 @@
"version": "4.13.0",
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.0.tgz",
"integrity": "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==",
- "dev": true,
"license": "MIT",
"dependencies": {
"resolve-pkg-maps": "^1.0.0"
@@ -7084,7 +7043,6 @@
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
- "dev": true,
"license": "MIT"
},
"node_modules/nanoid": {
@@ -7665,6 +7623,16 @@
"node": ">=0.10.0"
}
},
+ "node_modules/react-colorful": {
+ "version": "5.6.1",
+ "resolved": "https://registry.npmjs.org/react-colorful/-/react-colorful-5.6.1.tgz",
+ "integrity": "sha512-1exovf0uGTGyq5mXQT0zgQ80uvj2PCwvF8zY1RN9/vbJVSjSo3fsB/4L3ObbF7u70NduSiK4xu4Y6q1MHoUGEw==",
+ "license": "MIT",
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
"node_modules/react-day-picker": {
"version": "9.11.1",
"resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-9.11.1.tgz",
@@ -7867,7 +7835,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
"integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
- "dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
@@ -8254,7 +8221,6 @@
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true,
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
@@ -8273,7 +8239,6 @@
"version": "0.5.21",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
"integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
- "dev": true,
"license": "MIT",
"dependencies": {
"buffer-from": "^1.0.0",
@@ -8660,6 +8625,26 @@
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"license": "0BSD"
},
+ "node_modules/tsx": {
+ "version": "4.20.6",
+ "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.6.tgz",
+ "integrity": "sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "esbuild": "~0.25.0",
+ "get-tsconfig": "^4.7.5"
+ },
+ "bin": {
+ "tsx": "dist/cli.mjs"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ }
+ },
"node_modules/tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
diff --git a/package.json b/package.json
index a0f45bf..1b13637 100644
--- a/package.json
+++ b/package.json
@@ -23,11 +23,12 @@
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"dotenv": "^17.2.3",
- "drizzle-orm": "^0.44.7",
"drizzle-kit": "^0.31.7",
+ "drizzle-orm": "^0.44.7",
"lucide-react": "^0.554.0",
"next": "16.0.3",
"react": "19.2.0",
+ "react-colorful": "^5.6.1",
"react-day-picker": "^9.11.1",
"react-dom": "19.2.0",
"tailwind-merge": "^3.4.0"