diff --git a/.github/workflows/ci-no-deploy.yml b/.github/workflows/ci-no-deploy.yml index c51359c..8455cc2 100644 --- a/.github/workflows/ci-no-deploy.yml +++ b/.github/workflows/ci-no-deploy.yml @@ -74,6 +74,14 @@ jobs: - name: Run Playwright tests run: npm run test + env: + NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }} + NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }} + NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }} + NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }} + NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }} + NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }} + NEXT_PUBLIC_USE_FIREBASE_EMULATOR: 'false' - name: Upload Playwright Report uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1eff08a..27a9f68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,14 @@ jobs: - name: Run Playwright tests run: npm run test + env: + NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }} + NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }} + NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }} + NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }} + NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }} + NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }} + NEXT_PUBLIC_USE_FIREBASE_EMULATOR: 'false' - name: Upload Playwright Report uses: actions/upload-artifact@v4 diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index cf40276..adfeb91 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -33,6 +33,14 @@ jobs: - name: Run Playwright tests run: npx playwright test --project=${{ matrix.browser }} + env: + NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }} + NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }} + NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }} + NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }} + NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }} + NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }} + NEXT_PUBLIC_USE_FIREBASE_EMULATOR: 'false' - name: Upload Playwright Report uses: actions/upload-artifact@v4 @@ -72,6 +80,14 @@ jobs: - name: Run Playwright tests on mobile devices run: npx playwright test --project="Mobile Chrome" --project="Mobile Safari" + env: + NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }} + NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }} + NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }} + NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }} + NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }} + NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }} + NEXT_PUBLIC_USE_FIREBASE_EMULATOR: 'false' - name: Upload Mobile Test Report uses: actions/upload-artifact@v4 diff --git a/app/globals.css b/app/globals.css index 56cfa8a..2a86407 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,7 +1,8 @@ @import "tailwindcss"; - +@import "tw-animate-css"; :root { + --background: #ffffff; --primary: #02AFC7; --secondary-1: #FBD121; @@ -9,8 +10,43 @@ --text-1: #181d1f; --text-2: #666666; --light-border: #D9D9D9; -} + + + --foreground: var(--text-1); + --card: #ffffff; + --card-foreground: var(--text-1); + --popover: #ffffff; + --popover-foreground: var(--text-1); + --primary-foreground: #ffffff; + --secondary: var(--secondary-2); + --secondary-foreground: var(--text-1); + --muted: #f5f5f5; + --muted-foreground: var(--text-2); + --accent: #f0f0f0; + --accent-foreground: var(--text-1); + --destructive: #ef4444; + --destructive-foreground: #ffffff; + --border: var(--light-border); + --input: var(--light-border); + --ring: var(--primary); + --radius: 0.5rem; + --chart-1: var(--primary); + --chart-2: var(--secondary-1); + --chart-3: #8b5cf6; + --chart-4: #f97316; + --chart-5: #06b6d4; + + + --sidebar: #ffffff; + --sidebar-foreground: var(--text-1); + --sidebar-primary: var(--primary); + --sidebar-primary-foreground: #ffffff; + --sidebar-accent: var(--muted); + --sidebar-accent-foreground: var(--text-1); + --sidebar-border: var(--light-border); + --sidebar-ring: var(--primary); +} @theme inline { --color-background: var(--background); @@ -24,14 +60,60 @@ --font-family-opensans: var(--font-opensans); --font-family-raleway: var(--font-raleway); --font-family-roboto: var(--font-roboto); + + /* shadcn theme variables */ + --color-foreground: var(--foreground); + --color-card: var(--card); + --color-card-foreground: var(--card-foreground); + --color-popover: var(--popover); + --color-popover-foreground: var(--popover-foreground); + --color-primary-foreground: var(--primary-foreground); + --color-secondary: var(--secondary); + --color-secondary-foreground: var(--secondary-foreground); + --color-muted: var(--muted); + --color-muted-foreground: var(--muted-foreground); + --color-accent: var(--accent); + --color-accent-foreground: var(--accent-foreground); + --color-destructive: var(--destructive); + --color-border: var(--border); + --color-input: var(--input); + --color-ring: var(--ring); + --color-chart-1: var(--chart-1); + --color-chart-2: var(--chart-2); + --color-chart-3: var(--chart-3); + --color-chart-4: var(--chart-4); + --color-chart-5: var(--chart-5); + --color-sidebar: var(--sidebar); + --color-sidebar-foreground: var(--sidebar-foreground); + --color-sidebar-primary: var(--sidebar-primary); + --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); + --color-sidebar-accent: var(--sidebar-accent); + --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); + --color-sidebar-border: var(--sidebar-border); + --color-sidebar-ring: var(--sidebar-ring); + + /* Radius utilities */ + --radius-sm: calc(var(--radius) - 4px); + --radius-md: calc(var(--radius) - 2px); + --radius-lg: var(--radius); + --radius-xl: calc(var(--radius) + 4px); } body { - background: var(--background); font: var(--font-family-roboto); - color: var(--color-text-1) + color: var(--color-text-1); } button:hover { - cursor: pointer + cursor: pointer; } + +/* shadcn base layer */ +@layer base { + * { + @apply border-border outline-ring/50; + } + body { + @apply bg-background text-foreground; + } +} \ No newline at end of file diff --git a/app/inventory/layout.tsx b/app/inventory/layout.tsx index a980fb9..2cd5088 100644 --- a/app/inventory/layout.tsx +++ b/app/inventory/layout.tsx @@ -1,5 +1,6 @@ "use client"; +import { ProtectedRoute } from "@/components/ProtectedRoute"; import SideNavbar from "@/components/SideNav"; import TopNavbar from "@/components/TopNav"; import { usePathname } from "next/navigation"; @@ -9,7 +10,7 @@ export default function InventoryLayout({ children }: { children: ReactNode }) { const pathname = usePathname(); return ( - <> +
@@ -76,6 +77,6 @@ export default function InventoryLayout({ children }: { children: ReactNode }) {
- +
); } diff --git a/app/layout.tsx b/app/layout.tsx index b7c192b..b53ae29 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,31 +1,37 @@ import "./globals.css"; import localFont from "next/font/local"; +import { AuthProvider } from "../contexts/AuthContext"; const openSans = localFont({ - src: '../public/fonts/OpenSans/OpenSans.ttf', - variable: '--font-opensans', -}) + src: "../public/fonts/OpenSans/OpenSans.ttf", + variable: "--font-opensans", +}); const raleway = localFont({ - src: '../public/fonts/Raleway/Raleway.ttf', - variable: '--font-raleway', -}) + src: "../public/fonts/Raleway/Raleway.ttf", + variable: "--font-raleway", +}); const roboto = localFont({ - src: '../public/fonts/Roboto/Roboto.ttf', - variable: '--font-roboto', -}) + src: "../public/fonts/Roboto/Roboto.ttf", + variable: "--font-roboto", +}); export default function RootLayout({ - children, + children, }: Readonly<{ - children: React.ReactNode; + children: React.ReactNode; }>) { - return ( - - - {children} - - - ); + return ( + + + + {children} + + + + ); } diff --git a/app/login/page.tsx b/app/login/page.tsx index 6fc940d..f31a467 100644 --- a/app/login/page.tsx +++ b/app/login/page.tsx @@ -6,6 +6,7 @@ import LongButton from '@/components/auth/LongButton'; import InputBox from '../../components/auth/InputBox'; import { FirebaseError } from 'firebase/app'; import { login } from '@/lib/services/auth'; +import { useAuth } from '@/contexts/AuthContext'; export default function LoginPage() { const router = useRouter(); @@ -13,6 +14,7 @@ export default function LoginPage() { const [password, setPassword] = useState(''); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); + const auth = useAuth(); const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); @@ -20,8 +22,9 @@ export default function LoginPage() { setLoading(true); try { - await login(email, password); - router.push("/inventory"); + await auth.logout(); + await auth.login(email, password); + router.push("/"); } catch (e: unknown) { console.error("Login failed:", e); setError((e as FirebaseError).message); diff --git a/app/page.tsx b/app/page.tsx index 41c63cd..58ceb8a 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,11 +1,24 @@ +"use client"; + +import { ProtectedRoute } from "@/components/ProtectedRoute"; +import SideNavbar from "@/components/SideNav"; +import TopNavbar from "@/components/TopNav"; + export default function HomePage() { - return ( - <> -
- - Journeying to the Home Page!!! - -
- - ); + + return ( + +
+ +
+ +
+ + Journeying to the Home Page! + +
+
+
+
+ ); } diff --git a/app/signup/PickRole.tsx b/app/signup/PickRole.tsx index 9de11e1..e91aa8e 100644 --- a/app/signup/PickRole.tsx +++ b/app/signup/PickRole.tsx @@ -20,7 +20,7 @@ export default function PickRole({

Account Type

- {(["Administrator","Case Manager","Volunteer"] as UserRole[]).map((r) => ( + {(["Admin","Case Manager","Volunteer"] as UserRole[]).map((r) => ( + +
+ + ); +} diff --git a/app/status/missing-user-data/page.tsx b/app/status/missing-user-data/page.tsx new file mode 100644 index 0000000..4eb1996 --- /dev/null +++ b/app/status/missing-user-data/page.tsx @@ -0,0 +1,24 @@ +"use client"; + +import { ProtectedRoute } from "@/components/ProtectedRoute"; +import { useAuth } from "@/contexts/AuthContext"; +import { useRouter } from "next/navigation"; + +export default function MissingUserData() { + + const auth = useAuth(); + const router = useRouter(); + + return <> +
+

Error: Couldn't find data for this user

+ + +
+ +} \ No newline at end of file diff --git a/app/tests/page.tsx b/app/tests/page.tsx deleted file mode 100644 index 4f9311e..0000000 --- a/app/tests/page.tsx +++ /dev/null @@ -1,10 +0,0 @@ -export default function testPage() { - console.log( { - a: [1, 4, 5], - b: 'hello' - } ) - - return <> -

hi

- ; -} \ No newline at end of file diff --git a/app/user-management/account-requests/page.tsx b/app/user-management/account-requests/page.tsx new file mode 100644 index 0000000..7f695f7 --- /dev/null +++ b/app/user-management/account-requests/page.tsx @@ -0,0 +1,69 @@ +"use client"; + +import { DropdownMultiselect } from "@/components/inventory/DropdownMultiselect"; +import { SearchBox } from "@/components/inventory/SearchBox"; +import { AccountReqTable } from "@/components/user-management/AccountReqTable"; +import { approveAccount, fetchAllAccountRequests } from "@/lib/services/users"; +import { UserData, UserRole } from "@/types/user"; +import { User } from "firebase/auth"; +import { useEffect, useState } from "react"; + +export default function AccountRequestsPage() { + const requestOpts: UserRole[] = ["Admin", "Case Manager"]; + + const [searchQuery, setSearchQuery] = useState(""); + const [selectedRoles, setSelectedRoles] = useState(requestOpts); + const [allRequests, setAllRequests] = useState([]); + + useEffect(() => { + fetchAllAccountRequests().then(setAllRequests); + }, []); + + function onAccept(user: UserData) { + if ( + !window.confirm( + `Are you sure you want to give ${user.firstName} ${user.lastName} (${user.email}) the role ${user.pending}?` + ) + ) { + return; + } + approveAccount(user.uid, user.pending ?? "Volunteer"); + setAllRequests((old) => old.filter((u) => u.uid != user.uid)); + } + + return ( + <> +
+
+ + fetchAllAccountRequests().then(setAllRequests) + } + /> + +
+
+ + user.pending != null && + selectedRoles.includes(user.pending) + ).filter((user) => + ("" + user.firstName + user.lastName + user.email) + .trim() + .toLowerCase() + .replace(/\s/g, "") + .includes(searchQuery.toLowerCase().trim()) + )} + onAccept={onAccept} + /> + + ); +} diff --git a/app/user-management/all-accounts/page.tsx b/app/user-management/all-accounts/page.tsx new file mode 100644 index 0000000..2e116d0 --- /dev/null +++ b/app/user-management/all-accounts/page.tsx @@ -0,0 +1,87 @@ +"use client"; + +import { DropdownMultiselect } from "@/components/inventory/DropdownMultiselect"; +import { SearchBox } from "@/components/inventory/SearchBox"; +import { SortOption } from "@/components/inventory/SortOption"; +import { ProtectedRoute } from "@/components/ProtectedRoute"; +import { EditAccountModal } from "@/components/user-management/EditAccountModal"; +import { UserTable } from "@/components/user-management/UserTable"; +import { fetchAllActiveUsers, updateUser } from "@/lib/services/users"; +import { SortStatus } from "@/types/inventory"; +import { UserData, UserRole } from "@/types/user"; +import { User } from "lucide-react"; +import { useEffect, useState } from "react"; + +export default function AllAccountsPage() { + const roleOptions: UserRole[] = ["Admin", "Case Manager", "Volunteer"]; + + const [searchQuery, setSearchQuery] = useState(""); + const [selectedRoles, setSelectedRoles] = useState(roleOptions); + const [allAccounts, setAllAccounts] = useState([]); + + const [selectedAccount, setSelectedAccount] = useState( + null + ); + + function editAccount(updated: UserData) { + updateUser(updated).then((success) => { + if (success) { + setSelectedAccount(null); + setAllAccounts((prevAccounts) => + prevAccounts.map((user) => + user.uid === updated.uid ? updated : user + ) + ); + } else { + alert("Error: Couldn't update user"); + } + }); + } + + useEffect(() => { + fetchAllActiveUsers().then(setAllAccounts); + }, []); + + return ( + <> + {selectedAccount && ( + setSelectedAccount(null)} + editAccount={editAccount} + /> + )} +
+
+ + fetchAllActiveUsers().then(setAllAccounts) + } + /> + +
+
+ selectedRoles.includes(user.role)) + .filter((user) => + ("" + user.firstName + user.lastName + user.email) + .trim() + .toLowerCase() + .replace(/\s/g, "") + .includes(searchQuery.toLowerCase().trim()) + )} + onSelect={(user: UserData) => { + setSelectedAccount(user); + }} + /> + + ); +} diff --git a/app/user-management/layout.tsx b/app/user-management/layout.tsx new file mode 100644 index 0000000..e69eded --- /dev/null +++ b/app/user-management/layout.tsx @@ -0,0 +1,66 @@ +"use client"; + +import { ProtectedRoute } from "@/components/ProtectedRoute"; +import SideNavbar from "@/components/SideNav"; +import TopNavbar from "@/components/TopNav"; +import { usePathname } from "next/navigation"; +import { ReactNode } from "react"; + +export default function UserManagementLayout({ children }: { children: ReactNode }) { + const pathname = usePathname(); + + return ( + +
+ +
+ +
+ + User Management + + +
+ {children} +
+
+
+
+
+ ); +} + diff --git a/app/user-management/page.tsx b/app/user-management/page.tsx new file mode 100644 index 0000000..f5fd2ae --- /dev/null +++ b/app/user-management/page.tsx @@ -0,0 +1,5 @@ +import { permanentRedirect } from "next/navigation"; + +export default function UserManagementHome() { + permanentRedirect("/user-management/all-accounts"); +} diff --git a/app/user-management/previous-donors/page.tsx b/app/user-management/previous-donors/page.tsx new file mode 100644 index 0000000..a6c5ea7 --- /dev/null +++ b/app/user-management/previous-donors/page.tsx @@ -0,0 +1,47 @@ +"use client"; + +import { DropdownMultiselect } from "@/components/inventory/DropdownMultiselect"; +import { SearchBox } from "@/components/inventory/SearchBox"; +import { ProtectedRoute } from "@/components/ProtectedRoute"; +import { DonorsTable } from "@/components/user-management/DonorsTable"; +import { fetchAllDonors } from "@/lib/services/donations"; +import { DonorInfo } from "@/types/donations"; +import { useEffect, useState } from "react"; + +export default function PreviousDonorsPage() { + const [searchQuery, setSearchQuery] = useState(""); + const [allDonors, setAllDonors] = useState([]); + + useEffect(() => { + fetchAllDonors().then(setAllDonors); + }, []); + + return ( + <> +
+
+ fetchAllDonors().then(setAllDonors)} + /> +
+
+ + ( + "" + + donor.firstName + + donor.lastName + + donor.email + + donor.phoneNumber + ) + .trim() + .toLowerCase() + .replace(/\s/g, "") + .includes(searchQuery.toLowerCase().trim()) + )} + /> + + ); +} diff --git a/components.json b/components.json new file mode 100644 index 0000000..b7b9791 --- /dev/null +++ b/components.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "", + "css": "app/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "iconLibrary": "lucide", + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "registries": {} +} diff --git a/components/ProtectedRoute.tsx b/components/ProtectedRoute.tsx new file mode 100644 index 0000000..8267ad8 --- /dev/null +++ b/components/ProtectedRoute.tsx @@ -0,0 +1,59 @@ +import { useAuth } from "@/contexts/AuthContext"; +import { UserRole } from "@/types/user"; +import { useRouter } from "next/navigation"; +import { useEffect, useState } from "react"; +import { Spinner } from "./ui/spinner"; + +type ProtectedRouteProps = { + children: React.ReactNode; + allow: UserRole[]; +} + +export function ProtectedRoute({children, allow}: ProtectedRouteProps) { + + const auth = useAuth(); + const router = useRouter(); + + const [show, setShow] = useState(false); + + useEffect(() => { + console.log(auth) + if (auth.state.loading) { + setShow(false); + return; + } + if (!auth.state.currentUser) { + setShow(false); + router.push("/login"); + return; + } + + if (!auth.state.userData) { + setShow(false); + router.push("/status/missing-user-data"); + return + } + + if (!allow.includes(auth.state.userData.role)) { + setShow(false); + router.push("/status/invalid-perms"); + return + } + + setShow(true); + + }, [auth.state, allow]) + + if(!show) { + return <> +
+ +
+ + } + + return <> + {children} + + +} \ No newline at end of file diff --git a/components/SideNav.tsx b/components/SideNav.tsx index f75dbc9..8277e0f 100644 --- a/components/SideNav.tsx +++ b/components/SideNav.tsx @@ -1,14 +1,130 @@ "use client"; +import { useState } from "react"; +import { usePathname } from "next/navigation"; +import { useAuth } from "@/contexts/AuthContext"; + export default function SideNavbar() { + const pathname = usePathname(); + const [inventoryOpen, setInventoryOpen] = useState(pathname?.startsWith("/inventory") || false); + const [userManagementOpen, setUserManagementOpen] = useState(pathname?.startsWith("/user-management") || false); + const auth = useAuth(); return ( -
- Admin - Inventory - Volunteers - Case Managers - User Management +
+ {auth.state.userData?.role ?? "Loading..."} + +
+ + {inventoryOpen && ( + + )} +
+ + + Volunteers + + + + Case Managers + + +
+ + {userManagementOpen && ( + + )} +
) } \ No newline at end of file diff --git a/components/TopNav.tsx b/components/TopNav.tsx index badeefb..8441ac9 100644 --- a/components/TopNav.tsx +++ b/components/TopNav.tsx @@ -1,10 +1,18 @@ "use client"; +import { useAuth } from "@/contexts/AuthContext"; +import { useRouter } from "next/navigation"; + export default function TopNavbar() { + const auth = useAuth(); + const router = useRouter(); + return ( -
- Name +
auth.logout()} + > + {auth.state.userData && {auth.state.userData.firstName} {auth.state.userData.lastName}}
) } \ No newline at end of file diff --git a/components/icons/DropdownIcon.tsx b/components/icons/DropdownIcon.tsx new file mode 100644 index 0000000..db3274f --- /dev/null +++ b/components/icons/DropdownIcon.tsx @@ -0,0 +1,15 @@ +export function DropdownIcon() { + return ( + + + + ); +} diff --git a/components/icons/EditIcon.tsx b/components/icons/EditIcon.tsx new file mode 100644 index 0000000..5e356cf --- /dev/null +++ b/components/icons/EditIcon.tsx @@ -0,0 +1,20 @@ +"use client"; + +export function EditIcon() { + return ( + + + + ); +} + + + diff --git a/components/icons/ExportIcon.tsx b/components/icons/ExportIcon.tsx new file mode 100644 index 0000000..916f64f --- /dev/null +++ b/components/icons/ExportIcon.tsx @@ -0,0 +1,21 @@ +"use client"; + +export function ExportIcon() { + return ( + + + + + ); +} + diff --git a/components/icons/ExportIconOutline.tsx b/components/icons/ExportIconOutline.tsx new file mode 100644 index 0000000..a63174e --- /dev/null +++ b/components/icons/ExportIconOutline.tsx @@ -0,0 +1,32 @@ +"use client"; + +export function ExportIconOutline() { + return ( + + + + + ); +} + diff --git a/components/icons/ViewIcon.tsx b/components/icons/ViewIcon.tsx index 7b46254..b35420a 100644 --- a/components/icons/ViewIcon.tsx +++ b/components/icons/ViewIcon.tsx @@ -2,18 +2,16 @@ export function ViewIcon() { return ( - - - - - +
+ + + +
); } diff --git a/components/inventory/DropdownMultiselect.tsx b/components/inventory/DropdownMultiselect.tsx new file mode 100644 index 0000000..70e0ba9 --- /dev/null +++ b/components/inventory/DropdownMultiselect.tsx @@ -0,0 +1,51 @@ +import { DropdownIcon } from "../icons/DropdownIcon"; +import { SortIcon } from "../icons/SortIcon"; +import { SortStatus } from "@/types/inventory"; +import { + DropdownMenu, + DropdownMenuCheckboxItem, + DropdownMenuContent, + DropdownMenuTrigger, +} from "../ui/dropdown-menu"; + +type DropdownMultiselectProps = { + label: string; + options: T[]; + selected: T[]; + setSelected: React.Dispatch>; +}; + +export function DropdownMultiselect({ label, options, selected, setSelected }: DropdownMultiselectProps) { + + + return ( + <> + + + + + + {options.map(option => + { + checked ? + setSelected(prev => [...prev, option]) : + setSelected(prev => prev.filter(x => x !== option)) + + }} + onSelect={(event) => event.preventDefault()} + > + {option} + + )} + + + + ); +} diff --git a/components/inventory/SortOption.tsx b/components/inventory/SortOption.tsx index 52a01f9..b62b842 100644 --- a/components/inventory/SortOption.tsx +++ b/components/inventory/SortOption.tsx @@ -1,4 +1,3 @@ -import { useState } from "react"; import { SortIcon } from "../icons/SortIcon"; import { SortStatus } from "@/types/inventory"; diff --git a/components/ui/dropdown-menu.tsx b/components/ui/dropdown-menu.tsx new file mode 100644 index 0000000..bbe6fb0 --- /dev/null +++ b/components/ui/dropdown-menu.tsx @@ -0,0 +1,257 @@ +"use client" + +import * as React from "react" +import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu" +import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react" + +import { cn } from "@/lib/utils" + +function DropdownMenu({ + ...props +}: React.ComponentProps) { + return +} + +function DropdownMenuPortal({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuTrigger({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuContent({ + className, + sideOffset = 4, + ...props +}: React.ComponentProps) { + return ( + + + + ) +} + +function DropdownMenuGroup({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuItem({ + className, + inset, + variant = "default", + ...props +}: React.ComponentProps & { + inset?: boolean + variant?: "default" | "destructive" +}) { + return ( + + ) +} + +function DropdownMenuCheckboxItem({ + className, + children, + checked, + ...props +}: React.ComponentProps) { + return ( + + + + + + + {children} + + ) +} + +function DropdownMenuRadioGroup({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuRadioItem({ + className, + children, + ...props +}: React.ComponentProps) { + return ( + + + + + + + {children} + + ) +} + +function DropdownMenuLabel({ + className, + inset, + ...props +}: React.ComponentProps & { + inset?: boolean +}) { + return ( + + ) +} + +function DropdownMenuSeparator({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuShortcut({ + className, + ...props +}: React.ComponentProps<"span">) { + return ( + + ) +} + +function DropdownMenuSub({ + ...props +}: React.ComponentProps) { + return +} + +function DropdownMenuSubTrigger({ + className, + inset, + children, + ...props +}: React.ComponentProps & { + inset?: boolean +}) { + return ( + + {children} + + + ) +} + +function DropdownMenuSubContent({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { + DropdownMenu, + DropdownMenuPortal, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuLabel, + DropdownMenuItem, + DropdownMenuCheckboxItem, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, + DropdownMenuSeparator, + DropdownMenuShortcut, + DropdownMenuSub, + DropdownMenuSubTrigger, + DropdownMenuSubContent, +} diff --git a/components/ui/spinner.tsx b/components/ui/spinner.tsx new file mode 100644 index 0000000..a70e713 --- /dev/null +++ b/components/ui/spinner.tsx @@ -0,0 +1,16 @@ +import { Loader2Icon } from "lucide-react" + +import { cn } from "@/lib/utils" + +function Spinner({ className, ...props }: React.ComponentProps<"svg">) { + return ( + + ) +} + +export { Spinner } diff --git a/components/user-management/AccountReqTable.tsx b/components/user-management/AccountReqTable.tsx new file mode 100644 index 0000000..ece5b80 --- /dev/null +++ b/components/user-management/AccountReqTable.tsx @@ -0,0 +1,69 @@ +import { UserData } from "@/types/user"; +import { Badge } from "../Badge"; + +type AccountReqTableProps = { + requests: UserData[]; + onAccept: (user: UserData) => void; +}; + +export function AccountReqTable({ requests, onAccept }: AccountReqTableProps) { + return ( +
+
+ + First Name + + + Last Name + + + Requesting + + + Email + + + Actions + +
+ {requests.map((user) => ( + + ))} +
+ ); +} + +function AccountReqTableRow({ + user, + onAccept +}: { + user: UserData; + onAccept: (user: UserData) => void +}) { + return ( + <> +
+
+ {user.firstName} +
+
+ {user.lastName} +
+
+ {user.pending && } +
+
+ {user.email} +
+
+ +
+
+ + ); +} diff --git a/components/user-management/DonorsTable.tsx b/components/user-management/DonorsTable.tsx new file mode 100644 index 0000000..423cd6b --- /dev/null +++ b/components/user-management/DonorsTable.tsx @@ -0,0 +1,67 @@ +"use client"; + +import { DonorInfo } from "@/types/donations"; +import { ViewIcon } from "../icons/ViewIcon"; +import { TrashIcon } from "../icons/TrashIcon"; + +type DonorsTableProps = { + donors: DonorInfo[]; +}; + +export function DonorsTable({ donors }: DonorsTableProps) { + return ( +
+
+ + Name + + + Phone + + + Email + + + Address + + + Actions + +
+ {donors.map((donor) => ( + + ))} +
+ ); +} + +function DonorsTableRow({ donor }: { donor: DonorInfo }) { + return ( + <> +
+
+ + {donor.firstName} {donor.lastName} + +
+
+ {donor.phoneNumber} +
+
+ + {donor.email} + +
+ + {donor.address.streetAddress}, {donor.address.city} {donor.address.zipCode} + +
+ + +
+
+ + ); +} diff --git a/components/user-management/EditAccountModal.tsx b/components/user-management/EditAccountModal.tsx new file mode 100644 index 0000000..eeae754 --- /dev/null +++ b/components/user-management/EditAccountModal.tsx @@ -0,0 +1,91 @@ +import { UserData, UserRole } from "@/types/user"; +import { createPortal } from "react-dom"; +import { CloseIcon } from "../icons/CloseIcon"; +import { useEffect, useState } from "react"; +import InputBox from "../auth/InputBox"; +import { Spinner } from "../ui/spinner"; + +type EditAccountModalProps = { + account: UserData; + onClose: () => void; + editAccount: (updated: UserData) => void; +}; + +export function EditAccountModal({ + account, + onClose, + editAccount, +}: EditAccountModalProps) { + + const [firstName, setFirstName] = useState(""); + const [lastName, setLastName] = useState(""); + const [role, setRole] = useState("Volunteer"); + + useEffect(() => { + setFirstName(account.firstName); + setLastName(account.lastName); + setRole(account.role); + }, [account]) + + return createPortal( + <> +
+
+
+ +
+
+

Edit Account

+

{account.email}

+ +
+
+

First Name

+ setFirstName(e.target.value)} + className="rounded-xs h-8 text-sm px-3 border border-light-border outline-0 w-full" + /> +
+
+

Last Name

+ setLastName(e.target.value)} + className="rounded-xs h-8 text-sm px-3 border border-light-border outline-0 w-full" + /> +
+
+ +

Role

+ +
+ + +
+
+ + +
+
+ , + document.body + ); +} diff --git a/components/user-management/UserTable.tsx b/components/user-management/UserTable.tsx new file mode 100644 index 0000000..3277cc9 --- /dev/null +++ b/components/user-management/UserTable.tsx @@ -0,0 +1,83 @@ +"use client"; + +import { UserData } from "@/types/user"; +import { Badge } from "../Badge"; +import { Check, CheckIcon } from "lucide-react"; +import { ViewIcon } from "../icons/ViewIcon"; +import { TrashIcon } from "../icons/TrashIcon"; + +type UserTableProps = { + users: UserData[]; + onSelect: (user: UserData) => void; +}; + +export function UserTable({ users, onSelect }: UserTableProps) { + return ( +
+
+ + Name + + + User Type + + + Email + + + Date of Birth + + + Actions + +
+ {users.map((user) => ( + onSelect(user)} /> + ))} +
+ ); +} + +function UserTableRow({ user, onSelect }: { user: UserData, onSelect: () => void }) { + return ( + <> +
+
+ + + {user.firstName} {user.lastName} + +
+
+ +
+
+ + {user.email} + +
+ + {(user.dob) && user.dob.toDate().toLocaleDateString("en-US", { + month: "2-digit", + day: "2-digit", + year: "numeric", + timeZone: "UTC" + })} + +
+ + +
+
+ + ); +} diff --git a/contexts/AuthContext.tsx b/contexts/AuthContext.tsx new file mode 100644 index 0000000..beabc7e --- /dev/null +++ b/contexts/AuthContext.tsx @@ -0,0 +1,100 @@ +"use client"; + +import { createContext, useContext, useEffect, useState, ReactNode } from "react"; +import { User, createUserWithEmailAndPassword, signInWithEmailAndPassword, signOut, onAuthStateChanged } from "firebase/auth"; +import { auth } from "../lib/firebase"; +import { UserData, UserRole, AuthContextType } from "../types/user"; +import { createUserInDB, fetchAllUsers, getUserByUID } from "../lib/services/users"; +import { Timestamp } from "firebase/firestore"; +import { login, logout, signUp } from "@/lib/services/auth"; + +const AuthContext = createContext(null); + +export const AuthProvider = ({ children }: { children: ReactNode }) => { + + const [authState, setAuthState] = useState<{ + currentUser: User | null; + userData: UserData | null; + loading: boolean; + }>({ + currentUser: null, + userData: null, + loading: true, + }) + + + /** + * Listen for auth changes + */ + useEffect(() => { + const unsubscribe = onAuthStateChanged(auth, async (user) => { + // setCurrentUser(user); + // if (user) { + // // Fetch user data from Firestore + // const foundUser = await getUserByUID(user.uid); + // setUserData(foundUser); + // } else { + // setUserData(null); + // } + // setLoading(false); + const foundUser = (user) ? await getUserByUID(user.uid) : null; + + setAuthState({ + currentUser: user, + userData: foundUser, + loading: false + }) + }); + + return () => unsubscribe(); + }, []); +// signup: ( +// email: string, +// password: string, +// firstName: string, +// lastName: string, +// dob: string, +// role: UserRole +// ) => Promise; +// login: (email: string, password: string) => Promise; +// logout: () => Promise; + async function _signup( + email: string, + password: string, + firstName: string, + lastName: string, + dob: string, + role: UserRole + ): Promise { + setAuthState(old => ({...old, loading: true})); + return (await signUp(email, password, firstName, lastName, dob, role)) + } + + async function _login( + email: string, + password: string + ): Promise { + setAuthState(old => ({...old, loading: true})); + return (await login(email, password)) + } + + async function _logout(): Promise { + setAuthState(old => ({...old, loading: true})); + return (await logout()) + } + + return ( + + {children} + + ); +}; + +/** + * Hook to use AuthContext + */ +export const useAuth = () => { + const context = useContext(AuthContext); + if (!context) throw new Error("useAuth must be used within an AuthProvider"); + return context; +}; diff --git a/lib/firebase.ts b/lib/firebase.ts index 2c98fc6..48a743a 100644 --- a/lib/firebase.ts +++ b/lib/firebase.ts @@ -19,7 +19,7 @@ const storage = getStorage(app); const auth = getAuth(app); -if(process.env.NEXT_PUBLIC_USE_FIREBASE_EMULATOR === 'true' && typeof window !== 'undefined') { +if(process.env.NEXT_PUBLIC_USE_FIREBASE_EMULATOR === 'true') { connectFirestoreEmulator( db, process.env.NEXT_PUBLIC_FIREBASE_EMULATOR_HOST ?? 'localhost', diff --git a/lib/services/auth.ts b/lib/services/auth.ts index 78fe446..f26f590 100644 --- a/lib/services/auth.ts +++ b/lib/services/auth.ts @@ -5,8 +5,10 @@ import { signOut, User, } from "firebase/auth"; -import { auth, db } from "../firebase"; -import { doc, setDoc, Timestamp } from "firebase/firestore"; +import { auth } from "../firebase"; +import { Timestamp } from "firebase/firestore"; +import { createUserInDB } from "./users"; +import { UserData } from "@/types/user"; export async function signUp( email: string, @@ -22,16 +24,19 @@ export async function signUp( password ); const user = userCredential.user; - - await setDoc(doc(db, "users", user.uid), { + + const userRecord: UserData = { uid: user.uid, - email: email, - firstName: firstName, - lastName: lastName, + firstName, + lastName, + email: user.email!, dob: dob ? Timestamp.fromDate(new Date(dob)) : null, - role: role, - emailVerified: false, - }); + role: "Volunteer", + pending: (role == "Volunteer") ? null : role, + emailVerified: user.emailVerified, + }; + + await createUserInDB(userRecord); return user; // let err = error as FirebaseError; diff --git a/lib/services/donations.ts b/lib/services/donations.ts index 500a6a3..f8ffcf8 100644 --- a/lib/services/donations.ts +++ b/lib/services/donations.ts @@ -178,3 +178,12 @@ export async function createDonationRequest(request: DonationRequest): Promise => { + const snapshot = await getDocs(collection(db, DONORS_COLLECTION)); + const donors: DonorInfo[] = []; + snapshot.forEach((doc) => { + donors.push(doc.data() as DonorInfo); + }); + return donors; +}; diff --git a/lib/services/users.ts b/lib/services/users.ts new file mode 100644 index 0000000..a879b49 --- /dev/null +++ b/lib/services/users.ts @@ -0,0 +1,94 @@ +"use client"; + +import { db } from "../firebase"; +import { collection, doc, getDocs, setDoc, updateDoc, Timestamp, deleteDoc, query, where, orderBy} from "firebase/firestore"; +import { UserData, UserRole } from "../../types/user"; + +const usersCol = collection(db, "users"); + +/** + * Create a new user in Firestore + * Stores the actual role from signup, status = "pending" until approved + */ +export const createUserInDB = async (user: UserData) => { + const userRef = doc(db, "users", user.uid); + await setDoc(userRef, user); +}; + +/** + * Fetch all users + */ +export const fetchAllUsers = async (): Promise => { + const snapshot = await getDocs(usersCol); + const users: UserData[] = []; + snapshot.forEach((doc) => { + users.push(doc.data() as UserData); + }); + return users; +}; + +export const fetchAllActiveUsers = async (): Promise => { + const all = await fetchAllUsers(); + return all.filter(user => user.pending == null); +} + +export const fetchAllAccountRequests = async (): Promise => { + const all = await fetchAllUsers(); + return all.filter(user => user.pending != null); +}; + +export async function getUserByUID(uid: string): Promise { + const q = query(usersCol, where('uid', '==', uid)); + + const querySnapshot = await getDocs(q); + + if (querySnapshot.empty) { + return null; + } + + // Return first matching document + const doc = querySnapshot.docs[0]; + return doc.data() as UserData; +} + +/** + * Admin-only: update a user with new data + */ +export const updateUser = async ( + updated: UserData +) => { + + const userRef = doc(db, "users", updated.uid); + try { + await updateDoc(userRef, updated); + return true; + } catch (err) { + console.error(err); + } + return false; +}; + +/** + * Admin-only: approve pending account + * Keeps the existing role, just changes status to "active" + */ +export const approveAccount = async ( + uid: string, + role: UserRole +) => { + + const userRef = doc(db, "users", uid); + await updateDoc(userRef, { + role, + pending: null, + }); +}; + +/** + * Admin-only: delete a user from Firestore + */ +export const deleteUser = async (uid: string) => { + + const userRef = doc(db, "users", uid); + await deleteDoc(userRef); +}; \ No newline at end of file diff --git a/lib/utils.ts b/lib/utils.ts new file mode 100644 index 0000000..bd0c391 --- /dev/null +++ b/lib/utils.ts @@ -0,0 +1,6 @@ +import { clsx, type ClassValue } from "clsx" +import { twMerge } from "tailwind-merge" + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)) +} diff --git a/package-lock.json b/package-lock.json index 3d9beb3..a3dacf7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,10 +8,15 @@ "name": "journey_home", "version": "0.1.0", "dependencies": { + "@radix-ui/react-dropdown-menu": "^2.1.16", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", "firebase": "^10.13.0", + "lucide-react": "^0.554.0", "next": "15.5.3", "react": "19.1.0", "react-dom": "19.1.0", + "tailwind-merge": "^3.4.0", "uuid": "^13.0.0" }, "devDependencies": { @@ -26,6 +31,7 @@ "eslint-config-next": "15.5.3", "firebase-tools": "^13.35.1", "tailwindcss": "^4", + "tw-animate-css": "^1.4.0", "typescript": "^5" } }, @@ -822,6 +828,44 @@ "integrity": "sha512-jmEnr/pk0yVkA7mIlHNnxCi+wWzOFUg0WyIotgkKAb2u1J7fAeDBcVNSTjTihbAYNusCLQdW5s9IJ5qwnEufcQ==", "license": "Apache-2.0" }, + "node_modules/@floating-ui/core": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.3.tgz", + "integrity": "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==", + "license": "MIT", + "dependencies": { + "@floating-ui/utils": "^0.2.10" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.4.tgz", + "integrity": "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==", + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^1.7.3", + "@floating-ui/utils": "^0.2.10" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.6.tgz", + "integrity": "sha512-4JX6rEatQEvlmgU80wZyq9RT96HZJa88q8hp0pBd+LrczeDI4o6uA2M+uvxngVHo4Ihr8uibXxH6+70zhAFrVw==", + "license": "MIT", + "dependencies": { + "@floating-ui/dom": "^1.7.4" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.10.tgz", + "integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==", + "license": "MIT" + }, "node_modules/@google-cloud/cloud-sql-connector": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@google-cloud/cloud-sql-connector/-/cloud-sql-connector-1.8.3.tgz", @@ -1996,13 +2040,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.55.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.0.tgz", - "integrity": "sha512-04IXzPwHrW69XusN/SIdDdKZBzMfOT9UNT/YiJit/xpy2VuAoB8NHc8Aplb96zsWDddLnbkPL3TsmrS04ZU2xQ==", + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.1.tgz", + "integrity": "sha512-vSMYtL/zOcFpvJCW71Q/OEGQb7KYBPAdKh35WNSkaZA75JlAO8ED8UN6GUNTm3drWomcbcqRPFqQbLae8yBTdg==", "devOptional": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.55.0" + "playwright": "1.56.1" }, "bin": { "playwright": "cli.js" @@ -2120,6 +2164,539 @@ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", "license": "BSD-3-Clause" }, + "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-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-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-dropdown-menu": { + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.16.tgz", + "integrity": "sha512-1PLGQEynI/3OX/ftV54COn+3Sud/Mn8vALg2rWnBLnRaGtJDduNW/22XjlGgPdpcIbiQxjKtb7BkcjP00nqfJw==", + "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-id": "1.1.1", + "@radix-ui/react-menu": "2.1.16", + "@radix-ui/react-primitive": "2.1.3", + "@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-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-menu": { + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.1.16.tgz", + "integrity": "sha512-72F2T+PLlphrqLcAotYPp0uJMr5SjP5SL01wfEspJbru5Zs5vQaSHb4VB3ZMJPimgHHCHG7gMOeOB9H3Hdmtxg==", + "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-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-presence": "1.1.5", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-roving-focus": "1.1.11", + "@radix-ui/react-slot": "1.2.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "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-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-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-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-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-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-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/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/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", @@ -2508,7 +3085,7 @@ "version": "19.2.2", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.2.tgz", "integrity": "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "csstype": "^3.0.2" @@ -2518,7 +3095,7 @@ "version": "19.2.2", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.2.tgz", "integrity": "sha512-9KQPoO6mZCi7jcIStSnlOWn2nEF3mNmyr3rIAsGnAbQKYbRLyqmeSc39EVgtxXVia+LMT8j3knZLAZAh+xLmrw==", - "dev": true, + "devOptional": true, "license": "MIT", "peerDependencies": { "@types/react": "^19.2.0" @@ -3383,6 +3960,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", @@ -4204,6 +4793,18 @@ "node": ">= 0.3.0" } }, + "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/cli-boxes": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", @@ -4397,6 +4998,15 @@ "node": ">=0.8" } }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/color": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", @@ -4849,7 +5459,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/csv-parse": { @@ -5088,6 +5698,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/discontinuous-range": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", @@ -6605,9 +7221,9 @@ } }, "node_modules/firebase-tools/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", "dev": true, "license": "MIT", "dependencies": { @@ -6995,6 +7611,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", @@ -7056,9 +7681,9 @@ } }, "node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "dev": true, "license": "ISC", "dependencies": { @@ -8503,9 +9128,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, "license": "MIT", "dependencies": { @@ -9268,6 +9893,15 @@ "node": ">=0.10.0" } }, + "node_modules/lucide-react": { + "version": "0.554.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.554.0.tgz", + "integrity": "sha512-St+z29uthEJVx0Is7ellNkgTEhaeSoA42I7JjOCBCrc5X6LYMGSv0P/2uS5HDLTExP5tpiqRD2PyUEOS6s9UXA==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/magic-string": { "version": "0.30.19", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.19.tgz", @@ -10714,13 +11348,13 @@ } }, "node_modules/playwright": { - "version": "1.55.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.55.0.tgz", - "integrity": "sha512-sdCWStblvV1YU909Xqx0DhOjPZE4/5lJsIS84IfN9dAZfcl/CIZ5O8l3o0j7hPMjDvqoTF8ZUcc+i/GL5erstA==", + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.1.tgz", + "integrity": "sha512-aFi5B0WovBHTEvpM3DzXTUaeN6eN0qWnTkKx4NQaH4Wvcmc153PdaY2UBdSYKaGYw+UyWXSVyxDUg5DoPEttjw==", "devOptional": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.55.0" + "playwright-core": "1.56.1" }, "bin": { "playwright": "cli.js" @@ -10733,9 +11367,9 @@ } }, "node_modules/playwright-core": { - "version": "1.55.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.55.0.tgz", - "integrity": "sha512-GvZs4vU3U5ro2nZpeiwyb0zuFaqb9sUiAJuyrWpcGouD8y9/HLgGbNRjIph7zU9D3hnPaisMl9zG9CgFi/biIg==", + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.1.tgz", + "integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==", "devOptional": true, "license": "Apache-2.0", "bin": { @@ -11226,6 +11860,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/readable-stream": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", @@ -12632,6 +13335,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tailwind-merge": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.4.0.tgz", + "integrity": "sha512-uSaO4gnW+b3Y2aWoWfFpX62vn2sR3skfhbjsEnaBI81WD1wBLlHZe5sWf0AqjksNdYTbGBEd0UasQMT3SNV15g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/dcastil" + } + }, "node_modules/tailwindcss": { "version": "4.1.13", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.13.tgz", @@ -13040,6 +13753,16 @@ "node": ">=0.6.x" } }, + "node_modules/tw-animate-css": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/tw-animate-css/-/tw-animate-css-1.4.0.tgz", + "integrity": "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ==", + "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", @@ -13398,6 +14121,49 @@ "dev": true, "license": "BSD" }, + "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/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index c94a082..0cf2cb6 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,15 @@ "test:all": "npm run test && npm run functions:test" }, "dependencies": { + "@radix-ui/react-dropdown-menu": "^2.1.16", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", "firebase": "^10.13.0", + "lucide-react": "^0.554.0", "next": "15.5.3", "react": "19.1.0", "react-dom": "19.1.0", + "tailwind-merge": "^3.4.0", "uuid": "^13.0.0" }, "devDependencies": { @@ -47,6 +52,7 @@ "eslint-config-next": "15.5.3", "firebase-tools": "^13.35.1", "tailwindcss": "^4", + "tw-animate-css": "^1.4.0", "typescript": "^5" } } diff --git a/types/user.ts b/types/user.ts index 34f9b53..c5314ba 100644 --- a/types/user.ts +++ b/types/user.ts @@ -1,24 +1,27 @@ -"use client" +"use client"; import { User } from "firebase/auth"; -import { Timestamp } from "firebase/firestore" +import { Timestamp } from "firebase/firestore"; export type UserRole = "Admin" | "Case Manager" | "Volunteer"; export type UserData = { - uid: string, - firstName: string, - lastName: string, - email: string, - dob: Timestamp | null, - role: UserRole, - emailVerified: boolean -} + uid: string; + firstName: string; + lastName: string; + email: string; + dob: Timestamp | null; + role: UserRole; + pending: UserRole | null; + emailVerified: boolean; +}; export interface AuthContextType { - currentUser: User | null; - userData: UserData | null; - loading: boolean; + state: { + currentUser: User | null; + userData: UserData | null; + loading: boolean; + }; signup: ( email: string, password: string, @@ -27,9 +30,6 @@ export interface AuthContextType { dob: string, role: UserRole ) => Promise; - login: ( - email: string, - password: string - ) => Promise; + login: (email: string, password: string) => Promise; logout: () => Promise; - } \ No newline at end of file +}