From 46993d2c9f09bd275d00cb81f9b31671720a6407 Mon Sep 17 00:00:00 2001 From: Yannick Le Duc Date: Mon, 25 Aug 2025 15:50:16 +0200 Subject: [PATCH] Meilleur design via Shadcn/ui --- components.json | 21 + package-lock.json | 909 +++++++++++++++++- package.json | 14 +- .../campaigns/[id]/participants/page.tsx | 462 +++++---- .../campaigns/[id]/propositions/page.tsx | 332 ++++--- src/app/admin/page.tsx | 479 ++++----- src/app/globals.css | 130 ++- src/app/page.tsx | 147 ++- src/components/AddParticipantModal.tsx | 156 ++- src/components/AddPropositionModal.tsx | 244 ++--- src/components/CreateCampaignModal.tsx | 243 ++--- src/components/DeleteCampaignModal.tsx | 148 ++- src/components/DeleteParticipantModal.tsx | 143 ++- src/components/DeletePropositionModal.tsx | 143 ++- src/components/EditCampaignModal.tsx | 268 +++--- src/components/EditParticipantModal.tsx | 162 ++-- src/components/EditPropositionModal.tsx | 248 +++-- src/components/Navigation.tsx | 68 ++ src/components/ui/avatar.tsx | 53 + src/components/ui/badge.tsx | 46 + src/components/ui/button.tsx | 59 ++ src/components/ui/card.tsx | 92 ++ src/components/ui/dialog.tsx | 143 +++ src/components/ui/input.tsx | 21 + src/components/ui/label.tsx | 24 + src/components/ui/progress.tsx | 31 + src/components/ui/select.tsx | 185 ++++ src/components/ui/sheet.tsx | 139 +++ src/components/ui/tabs.tsx | 66 ++ src/components/ui/textarea.tsx | 18 + src/lib/utils.ts | 6 + 31 files changed, 3536 insertions(+), 1664 deletions(-) create mode 100644 components.json create mode 100644 src/components/Navigation.tsx create mode 100644 src/components/ui/avatar.tsx create mode 100644 src/components/ui/badge.tsx create mode 100644 src/components/ui/button.tsx create mode 100644 src/components/ui/card.tsx create mode 100644 src/components/ui/dialog.tsx create mode 100644 src/components/ui/input.tsx create mode 100644 src/components/ui/label.tsx create mode 100644 src/components/ui/progress.tsx create mode 100644 src/components/ui/select.tsx create mode 100644 src/components/ui/sheet.tsx create mode 100644 src/components/ui/tabs.tsx create mode 100644 src/components/ui/textarea.tsx create mode 100644 src/lib/utils.ts diff --git a/components.json b/components.json new file mode 100644 index 0000000..0f21f26 --- /dev/null +++ b/components.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "", + "css": "src/app/globals.css", + "baseColor": "slate", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "iconLibrary": "lucide" +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 70cba1e..01daac9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,21 @@ "dependencies": { "@headlessui/react": "^2.2.7", "@heroicons/react": "^2.2.0", + "@radix-ui/react-avatar": "^1.1.10", + "@radix-ui/react-dialog": "^1.1.15", + "@radix-ui/react-label": "^2.1.7", + "@radix-ui/react-progress": "^1.1.7", + "@radix-ui/react-select": "^2.2.6", + "@radix-ui/react-slot": "^1.2.3", + "@radix-ui/react-tabs": "^1.1.13", "@supabase/supabase-js": "^2.56.0", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "lucide-react": "^0.541.0", "next": "15.5.0", "react": "19.1.0", - "react-dom": "19.1.0" + "react-dom": "19.1.0", + "tailwind-merge": "^3.3.1" }, "devDependencies": { "@eslint/eslintrc": "^3", @@ -24,6 +35,7 @@ "eslint": "^9", "eslint-config-next": "15.5.0", "tailwindcss": "^4", + "tw-animate-css": "^1.3.7", "typescript": "^5" } }, @@ -1048,6 +1060,715 @@ "node": ">=12.4.0" } }, + "node_modules/@radix-ui/number": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.1.tgz", + "integrity": "sha512-MkKCwxlXTgz6CFoJx3pCwn07GKp36+aZyu/u2Ln2VrA5DcdyCZkASEDBTd8x5whTQQL5CiYf4prXKLcgQdv29g==", + "license": "MIT" + }, + "node_modules/@radix-ui/primitive": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.3.tgz", + "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==", + "license": "MIT" + }, + "node_modules/@radix-ui/react-arrow": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.7.tgz", + "integrity": "sha512-F+M1tLhO+mlQaOWspE8Wstg+z6PwxwRd8oQ8IXceWz92kfAmalTRf0EjrouQeo7QssEPfCn05B4Ihs1K9WQ/7w==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-avatar": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.1.10.tgz", + "integrity": "sha512-V8piFfWapM5OmNCXTzVQY+E1rDa53zY+MQ4Y7356v4fFz6vqCyUtIz2rUD44ZEdwg78/jKmMJHj07+C/Z/rcog==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-is-hydrated": "0.1.0", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-collection": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.7.tgz", + "integrity": "sha512-Fh9rGN0MoI4ZFUNyfFVNU4y9LUz93u9/0K+yLgA2bwRojxM8JU1DyvvMBabnZPBgMWREAJvU2jjVzq+LrFUglw==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-slot": "1.2.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-compose-refs": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.2.tgz", + "integrity": "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-context": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.1.2.tgz", + "integrity": "sha512-jCi/QKUM2r1Ju5a3J64TH2A5SpKAgh0LpknyqdQ4m6DCV0xJ2HG1xARRwNGPQfi1SLdLWZ1OJz6F4OMBBNiGJA==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dialog": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.15.tgz", + "integrity": "sha512-TCglVRtzlffRNxRMEyR36DGBLJpeusFcgMVD9PZEzAKnUs1lKCgX5u9BmC2Yg+LL9MgZDugFFs1Vl+Jp4t/PGw==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-dismissable-layer": "1.1.11", + "@radix-ui/react-focus-guards": "1.1.3", + "@radix-ui/react-focus-scope": "1.1.7", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-portal": "1.1.9", + "@radix-ui/react-presence": "1.1.5", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-slot": "1.2.3", + "@radix-ui/react-use-controllable-state": "1.2.2", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.6.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-direction": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.1.tgz", + "integrity": "sha512-1UEWRX6jnOA2y4H5WczZ44gOOjTEmlqv1uNW4GAJEO5+bauCBhv8snY65Iw5/VOS/ghKN9gr2KjnLKxrsvoMVw==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.11.tgz", + "integrity": "sha512-Nqcp+t5cTB8BinFkZgXiMJniQH0PsUt2k51FUhbdfeKvc4ACcG2uQniY/8+h1Yv6Kza4Q7lD7PQV0z0oicE0Mg==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-escape-keydown": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-focus-guards": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.3.tgz", + "integrity": "sha512-0rFg/Rj2Q62NCm62jZw0QX7a3sz6QCQU0LpZdNrJX8byRGaGVTqbrW9jAoIAHyMQqsNpeZ81YgSizOt5WXq0Pw==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-focus-scope": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.7.tgz", + "integrity": "sha512-t2ODlkXBQyn7jkl6TNaw/MtVEVvIGelJDCG41Okq/KwUsJBwQ4XVZsHAVUkK4mBv3ewiAS3PGuUWuY2BoK4ZUw==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-callback-ref": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-id": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.1.tgz", + "integrity": "sha512-kGkGegYIdQsOb4XjsfM97rXsiHaBwco+hFI66oO4s9LU+PLAC5oJ7khdOVFxkhsmlbpUqDAvXw11CluXP+jkHg==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-label": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.7.tgz", + "integrity": "sha512-YT1GqPSL8kJn20djelMX7/cTRp/Y9w5IZHvfxQTVHrOqa2yMl7i/UfMqKRU5V7mEyKTrUVgJXhNQPVCG8PBLoQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-popper": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.2.8.tgz", + "integrity": "sha512-0NJQ4LFFUuWkE7Oxf0htBKS6zLkkjBH+hM1uk7Ng705ReR8m/uelduy1DBo0PyBXPKVnBA6YBlU94MBGXrSBCw==", + "license": "MIT", + "dependencies": { + "@floating-ui/react-dom": "^2.0.0", + "@radix-ui/react-arrow": "1.1.7", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-layout-effect": "1.1.1", + "@radix-ui/react-use-rect": "1.1.1", + "@radix-ui/react-use-size": "1.1.1", + "@radix-ui/rect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-portal": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.9.tgz", + "integrity": "sha512-bpIxvq03if6UNwXZ+HTK71JLh4APvnXntDc6XOX8UVq4XQOVl7lwok0AvIl+b8zgCw3fSaVTZMpAPPagXbKmHQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-presence": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.5.tgz", + "integrity": "sha512-/jfEwNDdQVBCNvjkGit4h6pMOzq8bHkopq458dPt2lMjx+eBQUohZNG9A7DtO/O5ukSbxuaNGXMjHicgwy6rQQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-primitive": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.3.tgz", + "integrity": "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-slot": "1.2.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-progress": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.1.7.tgz", + "integrity": "sha512-vPdg/tF6YC/ynuBIJlk1mm7Le0VgW6ub6J2UWnTQ7/D23KXcPI1qy+0vBkgKgd38RCMJavBXpB83HPNFMTb0Fg==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-roving-focus": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.11.tgz", + "integrity": "sha512-7A6S9jSgm/S+7MdtNDSb+IU859vQqJ/QAtcYQcfFC6W8RS4IxIZDldLR0xqCFZ6DCyrQLjLPsxtTNch5jVA4lA==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-collection": "1.1.7", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-controllable-state": "1.2.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-select": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.2.6.tgz", + "integrity": "sha512-I30RydO+bnn2PQztvo25tswPH+wFBjehVGtmagkU78yMdwTwVf12wnAOF+AeP8S2N8xD+5UPbGhkUfPyvT+mwQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/number": "1.1.1", + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-collection": "1.1.7", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-dismissable-layer": "1.1.11", + "@radix-ui/react-focus-guards": "1.1.3", + "@radix-ui/react-focus-scope": "1.1.7", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-popper": "1.2.8", + "@radix-ui/react-portal": "1.1.9", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-slot": "1.2.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-controllable-state": "1.2.2", + "@radix-ui/react-use-layout-effect": "1.1.1", + "@radix-ui/react-use-previous": "1.1.1", + "@radix-ui/react-visually-hidden": "1.2.3", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.6.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-slot": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz", + "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-tabs": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.1.13.tgz", + "integrity": "sha512-7xdcatg7/U+7+Udyoj2zodtI9H/IIopqo+YOIcZOq1nJwXWBZ9p8xiu5llXlekDbZkca79a/fozEYQXIA4sW6A==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-presence": "1.1.5", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-roving-focus": "1.1.11", + "@radix-ui/react-use-controllable-state": "1.2.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-callback-ref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.1.tgz", + "integrity": "sha512-FkBMwD+qbGQeMu1cOHnuGB6x4yzPjho8ap5WtbEJ26umhgqVXbhekKUQO+hZEL1vU92a3wHwdp0HAcqAUF5iDg==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-controllable-state": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.2.tgz", + "integrity": "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-effect-event": "0.0.2", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-effect-event": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.2.tgz", + "integrity": "sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-escape-keydown": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.1.tgz", + "integrity": "sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-callback-ref": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-is-hydrated": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.0.tgz", + "integrity": "sha512-U+UORVEq+cTnRIaostJv9AGdV3G6Y+zbVd+12e18jQ5A3c0xL03IhnHuiU4UV69wolOQp5GfR58NW/EgdQhwOA==", + "license": "MIT", + "dependencies": { + "use-sync-external-store": "^1.5.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-layout-effect": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.1.tgz", + "integrity": "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-previous": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.1.tgz", + "integrity": "sha512-2dHfToCj/pzca2Ck724OZ5L0EVrr3eHRNsG/b3xQJLA2hZpVCS99bLAX+hm1IHXDEnzU6by5z/5MIY794/a8NQ==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-rect": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.1.tgz", + "integrity": "sha512-QTYuDesS0VtuHNNvMh+CjlKJ4LJickCMUAqjlE3+j8w+RlRpwyX3apEQKGFzbZGdo7XNG1tXa+bQqIE7HIXT2w==", + "license": "MIT", + "dependencies": { + "@radix-ui/rect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-size": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.1.tgz", + "integrity": "sha512-ewrXRDTAqAXlkl6t/fkXWNAhFX9I+CkKlw6zjEwk86RSPKwZr3xpBRso655aqYafwtnbpHLj6toFzmd6xdVptQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-visually-hidden": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.3.tgz", + "integrity": "sha512-pzJq12tEaaIhqjbzpCuv/OypJY/BPavOofm+dbab+MHLajy277+1lLm6JFcGgF5eskJ6mquGirhXY2GD/8u8Ug==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/rect": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.1.tgz", + "integrity": "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==", + "license": "MIT" + }, "node_modules/@react-aria/focus": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/@react-aria/focus/-/focus-3.21.0.tgz", @@ -1596,7 +2317,7 @@ "version": "19.1.11", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.11.tgz", "integrity": "sha512-lr3jdBw/BGj49Eps7EvqlUaoeA0xpj3pc0RoJkHpYaCHkVK7i28dKyImLQb3JVlqs3aYSXf7qYuWOW/fgZnTXQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "csstype": "^3.0.2" @@ -1606,7 +2327,7 @@ "version": "19.1.7", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.1.7.tgz", "integrity": "sha512-i5ZzwYpqjmrKenzkoLM2Ibzt6mAsM7pxB6BCIouEVVmgiqaMj1TjaK7hnA36hbW5aZv20kx7Lw6hWzPWg0Rurw==", - "dev": true, + "devOptional": true, "license": "MIT", "peerDependencies": { "@types/react": "^19.0.0" @@ -2241,6 +2962,18 @@ "dev": true, "license": "Python-2.0" }, + "node_modules/aria-hidden": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.6.tgz", + "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/aria-query": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", @@ -2602,6 +3335,18 @@ "node": ">=18" } }, + "node_modules/class-variance-authority": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz", + "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==", + "license": "Apache-2.0", + "dependencies": { + "clsx": "^2.1.1" + }, + "funding": { + "url": "https://polar.sh/cva" + } + }, "node_modules/client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", @@ -2688,7 +3433,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/damerau-levenshtein": { @@ -2823,6 +3568,12 @@ "node": ">=8" } }, + "node_modules/detect-node-es": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", + "license": "MIT" + }, "node_modules/doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -3695,6 +4446,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-nonce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", + "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/get-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", @@ -4795,6 +5555,15 @@ "loose-envify": "cli.js" } }, + "node_modules/lucide-react": { + "version": "0.541.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.541.0.tgz", + "integrity": "sha512-s0Vircsu5WaGv2KoJZ5+SoxiAJ3UXV5KqEM3eIFDHaHkcLIFdIWgXtZ412+Gh02UsdS7Was+jvEpBvPCWQISlg==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/magic-string": { "version": "0.30.18", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.18.tgz", @@ -5399,6 +6168,75 @@ "dev": true, "license": "MIT" }, + "node_modules/react-remove-scroll": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.1.tgz", + "integrity": "sha512-HpMh8+oahmIdOuS5aFKKY6Pyog+FNaZV/XyJOq7b4YFwsFHe5yYfdbIalI4k3vU2nSDql7YskmUseHsRrJqIPA==", + "license": "MIT", + "dependencies": { + "react-remove-scroll-bar": "^2.3.7", + "react-style-singleton": "^2.2.3", + "tslib": "^2.1.0", + "use-callback-ref": "^1.3.3", + "use-sidecar": "^1.1.3" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-remove-scroll-bar": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz", + "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==", + "license": "MIT", + "dependencies": { + "react-style-singleton": "^2.2.2", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-style-singleton": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz", + "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==", + "license": "MIT", + "dependencies": { + "get-nonce": "^1.0.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -6015,6 +6853,16 @@ "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==", "license": "MIT" }, + "node_modules/tailwind-merge": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.3.1.tgz", + "integrity": "sha512-gBXpgUm/3rp1lMZZrM/w7D8GKqshif0zAymAhbCyIt8KMe+0v9DQ7cdYLR4FHH/cKpdTXb+A/tKKU3eolfsI+g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/dcastil" + } + }, "node_modules/tailwindcss": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.12.tgz", @@ -6153,6 +7001,16 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, + "node_modules/tw-animate-css": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/tw-animate-css/-/tw-animate-css-1.3.7.tgz", + "integrity": "sha512-lvLb3hTIpB5oGsk8JmLoAjeCHV58nKa2zHYn8yWOoG5JJusH3bhJlF2DLAZ/5NmJ+jyH3ssiAx/2KmbhavJy/A==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Wombosvideo" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -6328,6 +7186,49 @@ "punycode": "^2.1.0" } }, + "node_modules/use-callback-ref": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", + "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-sidecar": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", + "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", + "license": "MIT", + "dependencies": { + "detect-node-es": "^1.1.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/use-sync-external-store": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz", diff --git a/package.json b/package.json index 33be69a..1c79775 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,21 @@ "dependencies": { "@headlessui/react": "^2.2.7", "@heroicons/react": "^2.2.0", + "@radix-ui/react-avatar": "^1.1.10", + "@radix-ui/react-dialog": "^1.1.15", + "@radix-ui/react-label": "^2.1.7", + "@radix-ui/react-progress": "^1.1.7", + "@radix-ui/react-select": "^2.2.6", + "@radix-ui/react-slot": "^1.2.3", + "@radix-ui/react-tabs": "^1.1.13", "@supabase/supabase-js": "^2.56.0", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "lucide-react": "^0.541.0", "next": "15.5.0", "react": "19.1.0", - "react-dom": "19.1.0" + "react-dom": "19.1.0", + "tailwind-merge": "^3.3.1" }, "devDependencies": { "@eslint/eslintrc": "^3", @@ -25,6 +36,7 @@ "eslint": "^9", "eslint-config-next": "15.5.0", "tailwindcss": "^4", + "tw-animate-css": "^1.3.7", "typescript": "^5" } } diff --git a/src/app/admin/campaigns/[id]/participants/page.tsx b/src/app/admin/campaigns/[id]/participants/page.tsx index 47021e9..38c35ea 100644 --- a/src/app/admin/campaigns/[id]/participants/page.tsx +++ b/src/app/admin/campaigns/[id]/participants/page.tsx @@ -1,5 +1,4 @@ 'use client'; - import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useParams } from 'next/navigation'; @@ -8,14 +7,19 @@ import { campaignService, participantService, voteService } from '@/lib/services import AddParticipantModal from '@/components/AddParticipantModal'; import EditParticipantModal from '@/components/EditParticipantModal'; import DeleteParticipantModal from '@/components/DeleteParticipantModal'; +import { Button } from '@/components/ui/button'; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; +import { Badge } from '@/components/ui/badge'; +import { Avatar, AvatarFallback } from '@/components/ui/avatar'; +import { Input } from '@/components/ui/input'; +import Navigation from '@/components/Navigation'; +import { Users, User, Calendar, Mail, Vote, Copy, Check } from 'lucide-react'; -// Force dynamic rendering to avoid SSR issues with Supabase export const dynamic = 'force-dynamic'; export default function CampaignParticipantsPage() { const params = useParams(); const campaignId = params.id as string; - const [campaign, setCampaign] = useState(null); const [participants, setParticipants] = useState([]); const [loading, setLoading] = useState(true); @@ -26,20 +30,19 @@ export default function CampaignParticipantsPage() { const [copiedParticipantId, setCopiedParticipantId] = useState(null); useEffect(() => { - if (campaignId) { - loadData(); - } + loadData(); }, [campaignId]); const loadData = async () => { try { setLoading(true); const [campaigns, participantsWithVoteStatus] = await Promise.all([ - campaignService.getAll().then(campaigns => campaigns.find(c => c.id === campaignId)), + campaignService.getAll(), voteService.getParticipantVoteStatus(campaignId) ]); - setCampaign(campaigns || null); + const campaignData = campaigns.find(c => c.id === campaignId); + setCampaign(campaignData || null); setParticipants(participantsWithVoteStatus); } catch (error) { console.error('Erreur lors du chargement des données:', error); @@ -55,22 +58,36 @@ export default function CampaignParticipantsPage() { const handleParticipantEdited = () => { setShowEditModal(false); - setSelectedParticipant(null); loadData(); }; const handleParticipantDeleted = () => { setShowDeleteModal(false); - setSelectedParticipant(null); loadData(); }; + const getInitials = (firstName: string, lastName: string) => { + return `${firstName.charAt(0)}${lastName.charAt(0)}`.toUpperCase(); + }; + + const copyVoteLink = (participantId: string) => { + const voteUrl = `${window.location.origin}/campaigns/${campaignId}/vote/${participantId}`; + navigator.clipboard.writeText(voteUrl); + setCopiedParticipantId(participantId); + setTimeout(() => setCopiedParticipantId(null), 2000); + }; + if (loading) { return ( -
-
-
-

Chargement des participants...

+
+
+ +
+
+
+

Chargement des participants...

+
+
); @@ -78,232 +95,277 @@ export default function CampaignParticipantsPage() { if (!campaign) { return ( -
-
-

Campagne non trouvée

-

La campagne demandée n'existe pas.

- - Retour à l'administration - +
+
+ + + +
+ +
+

+ Campagne introuvable +

+

+ La campagne que vous recherchez n'existe pas ou a été supprimée. +

+ +
+
); } + const votedCount = participants.filter(p => p.has_voted).length; + const totalBudget = participants.reduce((sum, p) => sum + (p.total_voted_amount || 0), 0); + return ( -
-
+
+
+ + {/* Header */}
-
+
-
- - - - - Retour - -
-

Participants

-

- Campagne : {campaign.title} -

-
-
+

+ Participants +

+

+ {campaign.title} +

- +
- {/* Participants */} + {/* Stats Overview */} +
+ + +
+
+

Total Participants

+

{participants.length}

+
+
+ +
+
+
+
+ + + +
+
+

Ont voté

+

{votedCount}

+
+
+ +
+
+
+
+ + + +
+
+

Taux de participation

+

+ {participants.length > 0 ? Math.round((votedCount / participants.length) * 100) : 0}% +

+
+
+ 📊 +
+
+
+
+ + + +
+
+

Budget total voté

+

{totalBudget}€

+
+
+ 💰 +
+
+
+
+
+ + {/* Participants List */} {participants.length === 0 ? ( -
- - - -

Aucun participant

-

Commencez par ajouter votre premier participant.

-
- -
-
- ) : ( -
-
-

- Participants ({participants.length}) + + +
+ +
+

+ Aucun participant

-

- Liste de tous les participants pour cette campagne +

+ Aucun participant n'a encore été ajouté à cette campagne.

-

-
    - {participants.map((participant) => ( -
  • -
    -
    -
    -
    -
    - - {participant.first_name.charAt(0)}{participant.last_name.charAt(0)} - -
    -
    -
    -

    - {participant.first_name} {participant.last_name} -

    -

    - {participant.email} -

    -
    -
    -
    - - Inscrit le : {new Date(participant.created_at).toLocaleDateString('fr-FR')} - - + + + + ) : ( +
    + {participants.map((participant) => ( + + +
    +
    +
    + + {participant.first_name} {participant.last_name} + + {participant.has_voted ? 'A voté' : 'N\'a pas voté'} - - {participant.has_voted && participant.total_voted_amount && ( - - Total voté : {participant.total_voted_amount}€ - - )} +
    - - {campaign?.status === 'voting' && ( -
    -
    -
    -

    Lien de vote personnel

    -
    - - -
    -
    -
    -
    - )} + + {participant.email} +
    -
    - - + 🗑️ Supprimer +
    -
  • - ))} -
+ + + +
+ + + {getInitials(participant.first_name, participant.last_name)} + + +
+
+
+ + {participant.email} +
+
+ + {new Date(participant.created_at).toLocaleDateString('fr-FR')} +
+ {participant.has_voted && participant.total_voted_amount !== undefined && ( +
+ + {participant.total_voted_amount}€ votés +
+ )} +
+
+
+ + {/* Vote Link for voting campaigns */} + {campaign.status === 'voting' && ( + + +
+
+

+ Lien de vote personnel +

+
+ + +
+
+
+
+
+ )} +
+ + ))}
)} -
- {/* Modals */} - {showAddModal && ( + {/* Modals */} setShowAddModal(false)} onSuccess={handleParticipantAdded} campaignId={campaignId} - campaignTitle={campaign.title} /> - )} - - {showEditModal && selectedParticipant && ( - setShowEditModal(false)} - onSuccess={handleParticipantEdited} - participant={selectedParticipant} - /> - )} - - {showDeleteModal && selectedParticipant && ( - setShowDeleteModal(false)} - onSuccess={handleParticipantDeleted} - participant={selectedParticipant} - /> - )} + + {selectedParticipant && ( + setShowEditModal(false)} + onSuccess={handleParticipantEdited} + participant={selectedParticipant} + /> + )} + + {selectedParticipant && ( + setShowDeleteModal(false)} + onSuccess={handleParticipantDeleted} + participant={selectedParticipant} + /> + )} +
); } diff --git a/src/app/admin/campaigns/[id]/propositions/page.tsx b/src/app/admin/campaigns/[id]/propositions/page.tsx index 67f8975..2f81d39 100644 --- a/src/app/admin/campaigns/[id]/propositions/page.tsx +++ b/src/app/admin/campaigns/[id]/propositions/page.tsx @@ -1,5 +1,4 @@ 'use client'; - import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useParams } from 'next/navigation'; @@ -8,14 +7,18 @@ import { campaignService, propositionService } from '@/lib/services'; import AddPropositionModal from '@/components/AddPropositionModal'; import EditPropositionModal from '@/components/EditPropositionModal'; import DeletePropositionModal from '@/components/DeletePropositionModal'; +import { Button } from '@/components/ui/button'; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; +import { Badge } from '@/components/ui/badge'; +import { Avatar, AvatarFallback } from '@/components/ui/avatar'; +import Navigation from '@/components/Navigation'; +import { FileText, User, Calendar, Mail } from 'lucide-react'; -// Force dynamic rendering to avoid SSR issues with Supabase export const dynamic = 'force-dynamic'; export default function CampaignPropositionsPage() { const params = useParams(); const campaignId = params.id as string; - const [campaign, setCampaign] = useState(null); const [propositions, setPropositions] = useState([]); const [loading, setLoading] = useState(true); @@ -25,19 +28,18 @@ export default function CampaignPropositionsPage() { const [selectedProposition, setSelectedProposition] = useState(null); useEffect(() => { - if (campaignId) { - loadData(); - } + loadData(); }, [campaignId]); const loadData = async () => { try { setLoading(true); - const [campaignData, propositionsData] = await Promise.all([ - campaignService.getAll().then(campaigns => campaigns.find(c => c.id === campaignId)), + const [campaigns, propositionsData] = await Promise.all([ + campaignService.getAll(), propositionService.getByCampaign(campaignId) ]); + const campaignData = campaigns.find(c => c.id === campaignId); setCampaign(campaignData || null); setPropositions(propositionsData); } catch (error) { @@ -54,22 +56,29 @@ export default function CampaignPropositionsPage() { const handlePropositionEdited = () => { setShowEditModal(false); - setSelectedProposition(null); loadData(); }; const handlePropositionDeleted = () => { setShowDeleteModal(false); - setSelectedProposition(null); loadData(); }; + const getInitials = (firstName: string, lastName: string) => { + return `${firstName.charAt(0)}${lastName.charAt(0)}`.toUpperCase(); + }; + if (loading) { return ( -
-
-
-

Chargement des propositions...

+
+
+ +
+
+
+

Chargement des propositions...

+
+
); @@ -77,173 +86,212 @@ export default function CampaignPropositionsPage() { if (!campaign) { return ( -
-
-

Campagne non trouvée

-

La campagne demandée n'existe pas.

- - Retour à l'administration - +
+
+ + + +
+ +
+

+ Campagne introuvable +

+

+ La campagne que vous recherchez n'existe pas ou a été supprimée. +

+ +
+
); } return ( -
-
+
+
+ + {/* Header */}
-
+
-
- - - - - Retour - -
-

Propositions

-

- Campagne : {campaign.title} -

-
-
+

+ Propositions +

+

+ {campaign.title} +

- +
- {/* Propositions */} + {/* Stats Overview */} +
+ + +
+
+

Total Propositions

+

{propositions.length}

+
+
+ +
+
+
+
+ + + +
+
+

Auteurs uniques

+

+ {new Set(propositions.map(p => p.author_email)).size} +

+
+
+ +
+
+
+
+ + + +
+
+

Statut Campagne

+

+ {campaign.status === 'deposit' ? 'Dépôt' : + campaign.status === 'voting' ? 'Vote' : 'Terminée'} +

+
+
+ 📊 +
+
+
+
+
+ + {/* Propositions List */} {propositions.length === 0 ? ( -
- - - -

Aucune proposition

-

Commencez par ajouter votre première proposition.

-
- -
-
- ) : ( -
-
-

- Propositions ({propositions.length}) + + +
+ +
+

+ Aucune proposition

-

- Liste de toutes les propositions pour cette campagne +

+ Aucune proposition n'a encore été soumise pour cette campagne.

-

-
    - {propositions.map((proposition) => ( -
  • -
    -
    -

    - {proposition.title} -

    -

    + + + + ) : ( +

    + {propositions.map((proposition) => ( + + +
    +
    + {proposition.title} + {proposition.description} -

    -
    - - Auteur : {proposition.author_first_name} {proposition.author_last_name} - - - Email : {proposition.author_email} - - - Créée le : {new Date(proposition.created_at).toLocaleDateString('fr-FR')} - -
    +
    -
    - - + 🗑️ Supprimer +
    -
  • - ))} -
+ + + +
+ + + {getInitials(proposition.author_first_name, proposition.author_last_name)} + + +
+

+ {proposition.author_first_name} {proposition.author_last_name} +

+
+
+ + {proposition.author_email} +
+
+ + {new Date(proposition.created_at).toLocaleDateString('fr-FR')} +
+
+
+
+
+ + ))}
)} -
- {/* Modals */} - {showAddModal && ( + {/* Modals */} setShowAddModal(false)} onSuccess={handlePropositionAdded} campaignId={campaignId} - campaignTitle={campaign.title} /> - )} - - {showEditModal && selectedProposition && ( - setShowEditModal(false)} - onSuccess={handlePropositionEdited} - proposition={selectedProposition} - /> - )} - - {showDeleteModal && selectedProposition && ( - setShowDeleteModal(false)} - onSuccess={handlePropositionDeleted} - proposition={selectedProposition} - /> - )} + + {selectedProposition && ( + setShowEditModal(false)} + onSuccess={handlePropositionEdited} + proposition={selectedProposition} + /> + )} + + {selectedProposition && ( + setShowDeleteModal(false)} + onSuccess={handlePropositionDeleted} + proposition={selectedProposition} + /> + )} +
); } diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index acf93d7..b43eb8b 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -1,5 +1,4 @@ 'use client'; - import { useState, useEffect } from 'react'; import Link from 'next/link'; import { Campaign, CampaignWithStats } from '@/types'; @@ -7,8 +6,13 @@ import { campaignService } from '@/lib/services'; import CreateCampaignModal from '@/components/CreateCampaignModal'; import EditCampaignModal from '@/components/EditCampaignModal'; import DeleteCampaignModal from '@/components/DeleteCampaignModal'; +import { Button } from '@/components/ui/button'; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; +import { Badge } from '@/components/ui/badge'; +import { Input } from '@/components/ui/input'; +import { Progress } from '@/components/ui/progress'; +import Navigation from '@/components/Navigation'; -// Force dynamic rendering to avoid SSR issues with Supabase export const dynamic = 'force-dynamic'; export default function AdminPage() { @@ -26,9 +30,8 @@ export default function AdminPage() { const loadCampaigns = async () => { try { + setLoading(true); const campaignsData = await campaignService.getAll(); - - // Charger les statistiques pour chaque campagne const campaignsWithStats = await Promise.all( campaignsData.map(async (campaign) => { const stats = await campaignService.getStats(campaign.id); @@ -38,7 +41,6 @@ export default function AdminPage() { }; }) ); - setCampaigns(campaignsWithStats); } catch (error) { console.error('Erreur lors du chargement des campagnes:', error); @@ -47,32 +49,6 @@ export default function AdminPage() { } }; - const getStatusColor = (status: string) => { - switch (status) { - case 'deposit': - return 'bg-blue-100 text-blue-800'; - case 'voting': - return 'bg-green-100 text-green-800'; - case 'closed': - return 'bg-gray-100 text-gray-800'; - default: - return 'bg-gray-100 text-gray-800'; - } - }; - - const getStatusText = (status: string) => { - switch (status) { - case 'deposit': - return 'Dépôt de propositions'; - case 'voting': - return 'En cours de vote'; - case 'closed': - return 'Fermé'; - default: - return status; - } - }; - const handleCampaignCreated = () => { setShowCreateModal(false); loadCampaigns(); @@ -80,262 +56,287 @@ export default function AdminPage() { const handleCampaignEdited = () => { setShowEditModal(false); - setSelectedCampaign(null); loadCampaigns(); }; const handleCampaignDeleted = () => { - console.log('handleCampaignDeleted appelé'); setShowDeleteModal(false); - setSelectedCampaign(null); - console.log('Rechargement des campagnes...'); loadCampaigns(); }; + const getStatusBadge = (status: string) => { + const statusConfig = { + deposit: { label: 'Dépôt de propositions', variant: 'secondary' as const }, + voting: { label: 'En cours de vote', variant: 'default' as const }, + closed: { label: 'Terminée', variant: 'destructive' as const } + }; + const config = statusConfig[status as keyof typeof statusConfig]; + return {config.label}; + }; + + const getSpendingTiersDisplay = (tiers: string) => { + return tiers.split(',').map(tier => tier.trim()).join('€, ') + '€'; + }; + if (loading) { return ( -
-
-
-

Chargement des campagnes...

+
+
+
+
+
+

Chargement des campagnes...

+
+
); } return ( -
-
+
+
+ + {/* Header */}
-
+
-

Administration

-

Gérez vos campagnes de budgets participatifs

-
-
- - - - - Retour - - +

+ Administration +

+

+ Gérez vos campagnes de budget participatif +

+
- {/* Campagnes */} + {/* Stats Overview */} +
+ + +
+
+

Total Campagnes

+

{campaigns.length}

+
+
+ 📊 +
+
+
+
+ + + +
+
+

En cours

+

+ {campaigns.filter(c => c.status === 'voting').length} +

+
+
+ 🗳️ +
+
+
+
+ + + +
+
+

Dépôt

+

+ {campaigns.filter(c => c.status === 'deposit').length} +

+
+
+ 📝 +
+
+
+
+ + + +
+
+

Terminées

+

+ {campaigns.filter(c => c.status === 'closed').length} +

+
+
+ +
+
+
+
+
+ + {/* Campaigns List */} {campaigns.length === 0 ? ( -
- - - -

Aucune campagne

-

Commencez par créer votre première campagne.

-
- -
-
- ) : ( -
-
-

- Campagnes ({campaigns.length}) + + +
+ 📋 +
+

+ Aucune campagne créée

-

- Liste de toutes vos campagnes de budgets participatifs +

+ Commencez par créer votre première campagne de budget participatif

-

-
    - {campaigns.map((campaign) => ( -
  • -
    -
    -
    -
    -

    {campaign.title}

    - - {getStatusText(campaign.status)} - -
    + + + + ) : ( +
    + {campaigns.map((campaign) => ( + + +
    +
    +
    + {campaign.title} + {getStatusBadge(campaign.status)}
    - -

    {campaign.description}

    - -
    -
    -
    - - - - {campaign.budget_per_user}€ -
    -

    Budget par utilisateur

    -
    - -
    -
    - - - - {campaign.stats.propositions} -
    -

    Propositions

    -
    - -
    -
    - - - - {campaign.stats.participants} -
    -

    Participants

    -
    -
    - - - {campaign.status === 'deposit' && ( -
    -
    -
    -

    Lien public pour déposer des propositions

    -
    - - -
    -
    -
    -
    - )} + + {campaign.description} +
    - -
    - - - - - - Propositions - - - - - - Votants - - + 🗑️ Supprimer +
    -
  • - ))} -
+ + + +
+
+

Budget par utilisateur

+

{campaign.budget_per_user}€

+
+
+

Propositions

+

{campaign.stats.propositions}

+
+
+

Participants

+

{campaign.stats.participants}

+
+
+

Paliers de dépense

+

{getSpendingTiersDisplay(campaign.spending_tiers)}

+
+
+ + {/* Public URL for deposit campaigns */} + {campaign.status === 'deposit' && ( + + +
+
+

+ Lien public pour déposer des propositions +

+
+ + +
+
+
+
+
+ )} + + {/* Action Buttons */} +
+ + +
+
+ + ))}
)} -
- {/* Modals */} - {showCreateModal && ( + {/* Modals */} setShowCreateModal(false)} onSuccess={handleCampaignCreated} /> - )} - - {showEditModal && selectedCampaign && ( - setShowEditModal(false)} - onSuccess={handleCampaignEdited} - campaign={selectedCampaign} - /> - )} - - {showDeleteModal && selectedCampaign && ( - setShowDeleteModal(false)} - onSuccess={handleCampaignDeleted} - campaign={selectedCampaign} - /> - )} + + {selectedCampaign && ( + setShowEditModal(false)} + onSuccess={handleCampaignEdited} + campaign={selectedCampaign} + /> + )} + + {selectedCampaign && ( + setShowDeleteModal(false)} + onSuccess={handleCampaignDeleted} + campaign={selectedCampaign} + /> + )} +
); } diff --git a/src/app/globals.css b/src/app/globals.css index e8bacd3..37e4e12 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,28 +1,46 @@ @import "tailwindcss"; +@import "tw-animate-css"; -:root { - --background: #ffffff; - --foreground: #171717; -} +@custom-variant dark (&:is(.dark *)); @theme inline { --color-background: var(--background); --color-foreground: var(--foreground); --font-sans: var(--font-geist-sans); --font-mono: var(--font-geist-mono); -} - -@media (prefers-color-scheme: dark) { - :root { - --background: #0a0a0a; - --foreground: #ededed; - } -} - -body { - background: var(--background); - color: var(--foreground); - font-family: Arial, Helvetica, sans-serif; + --color-sidebar-ring: var(--sidebar-ring); + --color-sidebar-border: var(--sidebar-border); + --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); + --color-sidebar-accent: var(--sidebar-accent); + --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); + --color-sidebar-primary: var(--sidebar-primary); + --color-sidebar-foreground: var(--sidebar-foreground); + --color-sidebar: var(--sidebar); + --color-chart-5: var(--chart-5); + --color-chart-4: var(--chart-4); + --color-chart-3: var(--chart-3); + --color-chart-2: var(--chart-2); + --color-chart-1: var(--chart-1); + --color-ring: var(--ring); + --color-input: var(--input); + --color-border: var(--border); + --color-destructive: var(--destructive); + --color-accent-foreground: var(--accent-foreground); + --color-accent: var(--accent); + --color-muted-foreground: var(--muted-foreground); + --color-muted: var(--muted); + --color-secondary-foreground: var(--secondary-foreground); + --color-secondary: var(--secondary); + --color-primary-foreground: var(--primary-foreground); + --color-primary: var(--primary); + --color-popover-foreground: var(--popover-foreground); + --color-popover: var(--popover); + --color-card-foreground: var(--card-foreground); + --color-card: var(--card); + --radius-sm: calc(var(--radius) - 4px); + --radius-md: calc(var(--radius) - 2px); + --radius-lg: var(--radius); + --radius-xl: calc(var(--radius) + 4px); } /* Styles personnalisés pour le slider */ @@ -89,3 +107,81 @@ body { transform: scale(1.1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); } + +:root { + --radius: 0.625rem; + --background: oklch(1 0 0); + --foreground: oklch(0.129 0.042 264.695); + --card: oklch(1 0 0); + --card-foreground: oklch(0.129 0.042 264.695); + --popover: oklch(1 0 0); + --popover-foreground: oklch(0.129 0.042 264.695); + --primary: oklch(0.208 0.042 265.755); + --primary-foreground: oklch(0.984 0.003 247.858); + --secondary: oklch(0.968 0.007 247.896); + --secondary-foreground: oklch(0.208 0.042 265.755); + --muted: oklch(0.968 0.007 247.896); + --muted-foreground: oklch(0.554 0.046 257.417); + --accent: oklch(0.968 0.007 247.896); + --accent-foreground: oklch(0.208 0.042 265.755); + --destructive: oklch(0.577 0.245 27.325); + --border: oklch(0.929 0.013 255.508); + --input: oklch(0.929 0.013 255.508); + --ring: oklch(0.704 0.04 256.788); + --chart-1: oklch(0.646 0.222 41.116); + --chart-2: oklch(0.6 0.118 184.704); + --chart-3: oklch(0.398 0.07 227.392); + --chart-4: oklch(0.828 0.189 84.429); + --chart-5: oklch(0.769 0.188 70.08); + --sidebar: oklch(0.984 0.003 247.858); + --sidebar-foreground: oklch(0.129 0.042 264.695); + --sidebar-primary: oklch(0.208 0.042 265.755); + --sidebar-primary-foreground: oklch(0.984 0.003 247.858); + --sidebar-accent: oklch(0.968 0.007 247.896); + --sidebar-accent-foreground: oklch(0.208 0.042 265.755); + --sidebar-border: oklch(0.929 0.013 255.508); + --sidebar-ring: oklch(0.704 0.04 256.788); +} + +.dark { + --background: oklch(0.129 0.042 264.695); + --foreground: oklch(0.984 0.003 247.858); + --card: oklch(0.208 0.042 265.755); + --card-foreground: oklch(0.984 0.003 247.858); + --popover: oklch(0.208 0.042 265.755); + --popover-foreground: oklch(0.984 0.003 247.858); + --primary: oklch(0.929 0.013 255.508); + --primary-foreground: oklch(0.208 0.042 265.755); + --secondary: oklch(0.279 0.041 260.031); + --secondary-foreground: oklch(0.984 0.003 247.858); + --muted: oklch(0.279 0.041 260.031); + --muted-foreground: oklch(0.704 0.04 256.788); + --accent: oklch(0.279 0.041 260.031); + --accent-foreground: oklch(0.984 0.003 247.858); + --destructive: oklch(0.704 0.191 22.216); + --border: oklch(1 0 0 / 10%); + --input: oklch(1 0 0 / 15%); + --ring: oklch(0.551 0.027 264.364); + --chart-1: oklch(0.488 0.243 264.376); + --chart-2: oklch(0.696 0.17 162.48); + --chart-3: oklch(0.769 0.188 70.08); + --chart-4: oklch(0.627 0.265 303.9); + --chart-5: oklch(0.645 0.246 16.439); + --sidebar: oklch(0.208 0.042 265.755); + --sidebar-foreground: oklch(0.984 0.003 247.858); + --sidebar-primary: oklch(0.488 0.243 264.376); + --sidebar-primary-foreground: oklch(0.984 0.003 247.858); + --sidebar-accent: oklch(0.279 0.041 260.031); + --sidebar-accent-foreground: oklch(0.984 0.003 247.858); + --sidebar-border: oklch(1 0 0 / 10%); + --sidebar-ring: oklch(0.551 0.027 264.364); +} + +@layer base { + * { + @apply border-border outline-ring/50; + } + body { + @apply bg-background text-foreground; + } +} diff --git a/src/app/page.tsx b/src/app/page.tsx index d47ace0..f6cb258 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,63 +1,108 @@ import Link from 'next/link'; +import { Button } from '@/components/ui/button'; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; +import { Badge } from '@/components/ui/badge'; export default function HomePage() { return ( -
-
-
-

+
+
+ {/* Hero Section */} +
+ + 🗳️ Démocratie Participative + +

Mes Budgets Participatifs

- -

- Participez aux décisions budgétaires de vos collectifs +

+ Participez aux décisions budgétaires de vos collectifs. + Votez pour les projets qui vous tiennent à cœur et façonnez ensemble l'avenir de votre communauté.

- -
- - - - - - Accès Admin - -
- -
-
-
- - - -
-

Déposez vos propositions

-

Soumettez vos idées pour améliorer votre collectif

-
- -
-
- - - -
-

Votez collectivement

-

Participez aux décisions avec votre budget alloué

-
- -
-
- - - -
-

Suivez les résultats

-

Découvrez quelles propositions ont été sélectionnées

-
+
+ +
+ + {/* Features Section */} +
+ + +
+ 📝 +
+ Propositions + + Soumettez et découvrez des projets innovants pour votre collectif + +
+ +

+ Partagez vos idées et consultez les propositions de la communauté +

+
+
+ + + +
+ 🗳️ +
+ Vote + + Votez pour les projets qui vous semblent prioritaires + +
+ +

+ Répartissez votre budget entre les différentes propositions +

+
+
+ + + +
+ 📊 +
+ Résultats + + Suivez en temps réel l'évolution des votes + +
+ +

+ Visualisez les projets les plus populaires et les résultats finaux +

+
+
+
+ + {/* CTA Section */} + + +

+ Prêt à participer ? +

+

+ Rejoignez votre collectif et prenez part aux décisions qui vous concernent +

+ +
+
); diff --git a/src/components/AddParticipantModal.tsx b/src/components/AddParticipantModal.tsx index bea872c..8a0a590 100644 --- a/src/components/AddParticipantModal.tsx +++ b/src/components/AddParticipantModal.tsx @@ -1,8 +1,9 @@ 'use client'; - import { useState } from 'react'; -import { Dialog } from '@headlessui/react'; -import { XMarkIcon } from '@heroicons/react/24/outline'; +import { Button } from '@/components/ui/button'; +import { Input } from '@/components/ui/input'; +import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog'; +import { Label } from '@/components/ui/label'; import { participantService } from '@/lib/services'; interface AddParticipantModalProps { @@ -10,16 +11,10 @@ interface AddParticipantModalProps { onClose: () => void; onSuccess: () => void; campaignId: string; - campaignTitle: string; + campaignTitle?: string; } -export default function AddParticipantModal({ - isOpen, - onClose, - onSuccess, - campaignId, - campaignTitle -}: AddParticipantModalProps) { +export default function AddParticipantModal({ isOpen, onClose, onSuccess, campaignId, campaignTitle }: AddParticipantModalProps) { const [formData, setFormData] = useState({ first_name: '', last_name: '', @@ -40,8 +35,8 @@ export default function AddParticipantModal({ last_name: formData.last_name, email: formData.email }); + onSuccess(); - // Reset form setFormData({ first_name: '', last_name: '', @@ -56,111 +51,78 @@ export default function AddParticipantModal({ }; const handleChange = (e: React.ChangeEvent) => { - const { name, value } = e.target; setFormData(prev => ({ ...prev, - [name]: value + [e.target.name]: e.target.value })); }; return ( - - ); } diff --git a/src/components/AddPropositionModal.tsx b/src/components/AddPropositionModal.tsx index bfff790..f8ebacc 100644 --- a/src/components/AddPropositionModal.tsx +++ b/src/components/AddPropositionModal.tsx @@ -1,8 +1,10 @@ 'use client'; - import { useState } from 'react'; -import { Dialog } from '@headlessui/react'; -import { XMarkIcon } from '@heroicons/react/24/outline'; +import { Button } from '@/components/ui/button'; +import { Input } from '@/components/ui/input'; +import { Textarea } from '@/components/ui/textarea'; +import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog'; +import { Label } from '@/components/ui/label'; import { propositionService } from '@/lib/services'; interface AddPropositionModalProps { @@ -10,16 +12,9 @@ interface AddPropositionModalProps { onClose: () => void; onSuccess: () => void; campaignId: string; - campaignTitle: string; } -export default function AddPropositionModal({ - isOpen, - onClose, - onSuccess, - campaignId, - campaignTitle -}: AddPropositionModalProps) { +export default function AddPropositionModal({ isOpen, onClose, onSuccess, campaignId }: AddPropositionModalProps) { const [formData, setFormData] = useState({ title: '', description: '', @@ -44,17 +39,17 @@ export default function AddPropositionModal({ author_last_name: formData.author_last_name, author_email: formData.author_email }); + onSuccess(); - // Reset form setFormData({ title: '', description: '', - author_first_name: '', - author_last_name: '', - author_email: '' + author_first_name: 'admin', + author_last_name: 'admin', + author_email: 'admin@example.com' }); } catch (err) { - setError('Erreur lors de l\'ajout de la proposition'); + setError('Erreur lors de la création de la proposition'); console.error(err); } finally { setLoading(false); @@ -62,149 +57,106 @@ export default function AddPropositionModal({ }; const handleChange = (e: React.ChangeEvent) => { - const { name, value } = e.target; setFormData(prev => ({ ...prev, - [name]: value + [e.target.name]: e.target.value })); }; return ( - -