From b474b8a41c856141f13368f836f288a3172e330f Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Mon, 13 Oct 2025 22:35:37 +0100 Subject: [PATCH] WIP admin page --- frontend/package.json | 7 +- .../lib/components/ui/button/button.svelte | 49 +- .../src/lib/components/ui/card/card.svelte | 9 +- .../lib/components/ui/file-drop-zone.svelte | 71 ++ .../src/lib/components/ui/input/input.svelte | 7 +- .../components/ui/separator/separator.svelte | 3 +- .../components/ui/textarea/textarea.svelte | 3 +- frontend/src/lib/stores/auth.svelte.ts | 2 +- frontend/src/routes/admin/+page.svelte | 976 ++++++++++++++++++ init-scripts/init-script.sql | 7 +- 10 files changed, 1097 insertions(+), 37 deletions(-) create mode 100644 frontend/src/lib/components/ui/file-drop-zone.svelte create mode 100644 frontend/src/routes/admin/+page.svelte diff --git a/frontend/package.json b/frontend/package.json index 65e5d0e..e5f682a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -17,7 +17,7 @@ "@eslint/compat": "^1.2.5", "@eslint/js": "^9.22.0", "@internationalized/date": "^3.9.0", - "@lucide/svelte": "^0.515.0", + "@lucide/svelte": "^0.544.0", "@sveltejs/adapter-auto": "^6.0.0", "@sveltejs/adapter-static": "^3.0.9", "@sveltejs/kit": "^2.22.0", @@ -25,7 +25,7 @@ "@tailwindcss/vite": "^4.0.0", "@types/node": "^22", "@types/swiper": "^5.4.3", - "bits-ui": "^2.10.0", + "bits-ui": "^2.11.5", "clsx": "^2.1.1", "eslint": "^9.22.0", "eslint-config-prettier": "^10.0.1", @@ -36,12 +36,13 @@ "prettier": "^3.4.2", "prettier-plugin-svelte": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.11", + "shadcn-svelte": "^1.0.8", "svelte": "^5.0.0", "svelte-check": "^4.0.0", "svelte-sonner": "^1.0.5", "sveltekit-superforms": "^2.27.1", "tailwind-merge": "^3.3.1", - "tailwind-variants": "^1.0.0", + "tailwind-variants": "^3.1.1", "tailwindcss": "^4.0.0", "tw-animate-css": "^1.3.8", "typescript": "^5.0.0", diff --git a/frontend/src/lib/components/ui/button/button.svelte b/frontend/src/lib/components/ui/button/button.svelte index 6cd6f79..2105474 100644 --- a/frontend/src/lib/components/ui/button/button.svelte +++ b/frontend/src/lib/components/ui/button/button.svelte @@ -1,37 +1,38 @@ + +
{ + // Allow keyboard users to trigger the click with Enter or Space + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + openFileSelect(); + } + }} + class="rounded-lg border-2 border-dashed p-6 text-center transition-colors + {dragging ? 'border-primary bg-primary/5' : 'border-gray-300'}" +> + + + {@render children?.()} +
diff --git a/frontend/src/lib/components/ui/input/input.svelte b/frontend/src/lib/components/ui/input/input.svelte index 19c6dae..960167d 100644 --- a/frontend/src/lib/components/ui/input/input.svelte +++ b/frontend/src/lib/components/ui/input/input.svelte @@ -15,6 +15,7 @@ type, files = $bindable(), class: className, + "data-slot": dataSlot = "input", ...restProps }: Props = $props(); @@ -22,9 +23,9 @@ {#if type === "file"} > = $props();