diff --git a/frontend/alert-2.0/.gitignore b/frontend/alert-2.0/.gitignore deleted file mode 100644 index a547bf36..00000000 --- a/frontend/alert-2.0/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - -node_modules -dist -dist-ssr -*.local - -# Editor directories and files -.vscode/* -!.vscode/extensions.json -.idea -.DS_Store -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? diff --git a/frontend/alert-2.0/README.md b/frontend/alert-2.0/README.md deleted file mode 100644 index 74872fd4..00000000 --- a/frontend/alert-2.0/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# React + TypeScript + Vite - -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. - -Currently, two official plugins are available: - -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh - -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: - -- Configure the top-level `parserOptions` property like this: - -```js -export default tseslint.config({ - languageOptions: { - // other options... - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - }, -}) -``` - -- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked` -- Optionally add `...tseslint.configs.stylisticTypeChecked` -- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config: - -```js -// eslint.config.js -import react from 'eslint-plugin-react' - -export default tseslint.config({ - // Set the react version - settings: { react: { version: '18.3' } }, - plugins: { - // Add the react plugin - react, - }, - rules: { - // other rules... - // Enable its recommended rules - ...react.configs.recommended.rules, - ...react.configs['jsx-runtime'].rules, - }, -}) -``` diff --git a/frontend/alert-2.0/components.json b/frontend/alert-2.0/components.json deleted file mode 100644 index eaa263eb..00000000 --- a/frontend/alert-2.0/components.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema.json", - "style": "new-york", - "rsc": false, - "tsx": true, - "tailwind": { - "config": "tailwind.config.js", - "css": "src/index.css", - "baseColor": "neutral", - "cssVariables": true, - "prefix": "" - }, - "aliases": { - "components": "@/components", - "utils": "@/lib/utils", - "ui": "@/components/ui", - "lib": "@/lib", - "hooks": "@/hooks" - } -} diff --git a/frontend/alert-2.0/eslint.config.js b/frontend/alert-2.0/eslint.config.js deleted file mode 100644 index 0c2f237f..00000000 --- a/frontend/alert-2.0/eslint.config.js +++ /dev/null @@ -1,3 +0,0 @@ -import config from "@esinx/eslint-config"; - -export default [...config] \ No newline at end of file diff --git a/frontend/alert-2.0/index.html b/frontend/alert-2.0/index.html deleted file mode 100644 index e4b78eae..00000000 --- a/frontend/alert-2.0/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - Vite + React + TS - - -
- - - diff --git a/frontend/alert-2.0/package.json b/frontend/alert-2.0/package.json deleted file mode 100644 index a8563a89..00000000 --- a/frontend/alert-2.0/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "alert-2.0", - "private": true, - "version": "0.0.0", - "type": "module", - "prettier": "@esinx/prettier-config", - "scripts": { - "dev": "vite", - "build": "tsc -b && vite build", - "lint": "eslint .", - "preview": "vite preview" - }, - "dependencies": { - "@hookform/resolvers": "^3.9.0", - "@radix-ui/react-avatar": "^1.1.0", - "@radix-ui/react-dialog": "^1.1.1", - "@radix-ui/react-icons": "^1.3.0", - "@radix-ui/react-label": "^2.1.0", - "@radix-ui/react-navigation-menu": "^1.2.0", - "@radix-ui/react-popover": "^1.1.1", - "@radix-ui/react-slot": "^1.1.0", - "@radix-ui/react-switch": "^1.1.0", - "@tanstack/react-query": "^5.53.3", - "@tanstack/react-router": "^1.51.6", - "@trpc/client": "^11.0.0-rc.498", - "@trpc/react-query": "^11.0.0-rc.498", - "@trpc/server": "^11.0.0-rc.498", - "class-variance-authority": "^0.7.0", - "clsx": "^2.1.1", - "cmdk": "1.0.0", - "lucide-react": "^0.436.0", - "next-themes": "^0.3.0", - "oidc-client-ts": "^3.0.1", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-error-boundary": "^4.0.13", - "react-hook-form": "^7.53.0", - "react-oidc-context": "^3.1.0", - "sonner": "^1.5.0", - "tailwind-merge": "^2.5.2", - "tailwindcss-animate": "^1.0.7", - "ts-pattern": "^5.3.1", - "use-debounce": "^10.0.3", - "zod": "^3.23.8", - "zustand": "^4.5.5" - }, - "devDependencies": { - "@esinx/eslint-config": "^2.0.1", - "@esinx/prettier-config": "^1.0.0-3", - "@eslint/js": "^9.9.0", - "@tanstack/router-devtools": "^1.51.6", - "@tanstack/router-plugin": "^1.51.6", - "@types/node": "^22.5.1", - "@types/react": "^18.3.3", - "@types/react-dom": "^18.3.0", - "@vitejs/plugin-react": "^4.3.1", - "autoprefixer": "^10.4.20", - "eslint": "^9.9.0", - "eslint-plugin-react-hooks": "^5.1.0-rc.0", - "eslint-plugin-react-refresh": "^0.4.9", - "globals": "^15.9.0", - "postcss": "^8.4.41", - "tailwindcss": "^3.4.10", - "typescript": "^5.5.3", - "typescript-eslint": "^8.0.1", - "vite": "^5.4.1" - } -} diff --git a/frontend/alert-2.0/postcss.config.js b/frontend/alert-2.0/postcss.config.js deleted file mode 100644 index 2e7af2b7..00000000 --- a/frontend/alert-2.0/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -export default { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} diff --git a/frontend/alert-2.0/public/assets/icons/PCA_logo.svg b/frontend/alert-2.0/public/assets/icons/PCA_logo.svg deleted file mode 100644 index 9b20fc69..00000000 --- a/frontend/alert-2.0/public/assets/icons/PCA_logo.svg +++ /dev/null @@ -1 +0,0 @@ -Asset 3 \ No newline at end of file diff --git a/frontend/alert-2.0/public/assets/icons/abell.svg b/frontend/alert-2.0/public/assets/icons/abell.svg deleted file mode 100644 index 6deac43b..00000000 --- a/frontend/alert-2.0/public/assets/icons/abell.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/alert-2.0/public/assets/icons/bang.svg b/frontend/alert-2.0/public/assets/icons/bang.svg deleted file mode 100644 index 8bf69d02..00000000 --- a/frontend/alert-2.0/public/assets/icons/bang.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/frontend/alert-2.0/public/assets/icons/bell-off.svg b/frontend/alert-2.0/public/assets/icons/bell-off.svg deleted file mode 100644 index fb4c1d0f..00000000 --- a/frontend/alert-2.0/public/assets/icons/bell-off.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/alert-2.0/public/assets/icons/bell.svg b/frontend/alert-2.0/public/assets/icons/bell.svg deleted file mode 100644 index 2db23ce8..00000000 --- a/frontend/alert-2.0/public/assets/icons/bell.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/alert-2.0/public/assets/icons/blue-trash.svg b/frontend/alert-2.0/public/assets/icons/blue-trash.svg deleted file mode 100644 index c497b12e..00000000 --- a/frontend/alert-2.0/public/assets/icons/blue-trash.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/frontend/alert-2.0/public/assets/icons/check.svg b/frontend/alert-2.0/public/assets/icons/check.svg deleted file mode 100644 index 27682f73..00000000 --- a/frontend/alert-2.0/public/assets/icons/check.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/alert-2.0/public/assets/icons/close.svg b/frontend/alert-2.0/public/assets/icons/close.svg deleted file mode 100644 index 2c72363d..00000000 --- a/frontend/alert-2.0/public/assets/icons/close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/alert-2.0/public/assets/icons/down-arrow.svg b/frontend/alert-2.0/public/assets/icons/down-arrow.svg deleted file mode 100644 index d61661fc..00000000 --- a/frontend/alert-2.0/public/assets/icons/down-arrow.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/frontend/alert-2.0/public/assets/icons/search.svg b/frontend/alert-2.0/public/assets/icons/search.svg deleted file mode 100644 index 19c752d8..00000000 --- a/frontend/alert-2.0/public/assets/icons/search.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/alert-2.0/public/assets/icons/trash.svg b/frontend/alert-2.0/public/assets/icons/trash.svg deleted file mode 100644 index 7d5d93c6..00000000 --- a/frontend/alert-2.0/public/assets/icons/trash.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/frontend/alert-2.0/public/assets/icons/up-arrow.svg b/frontend/alert-2.0/public/assets/icons/up-arrow.svg deleted file mode 100644 index 25cb484b..00000000 --- a/frontend/alert-2.0/public/assets/icons/up-arrow.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/frontend/alert-2.0/public/assets/icons/x.svg b/frontend/alert-2.0/public/assets/icons/x.svg deleted file mode 100644 index aab2a0ec..00000000 --- a/frontend/alert-2.0/public/assets/icons/x.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/frontend/alert-2.0/src/components/CourseSection.tsx b/frontend/alert-2.0/src/components/CourseSection.tsx deleted file mode 100644 index 9181fd71..00000000 --- a/frontend/alert-2.0/src/components/CourseSection.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { match } from 'ts-pattern' - -import { StatusIndicator } from '@/components/StatusIndicator' -import { Badge } from '@/components/ui/badge' -import { Activity, type CourseSection } from '@/core/types' -import { cn } from '@/lib/utils' - -interface Props { - section: CourseSection - className?: string -} - -const classOfActivity = (activity: Activity) => - match(activity) - .with(Activity.LECTURE, () => - cn('bg-blue-100', 'hover:bg-blue-100', 'text-blue-600'), - ) - .with(Activity.RECITATION, () => - cn('bg-yellow-100', 'hover:bg-yellow-100', 'text-yellow-600'), - ) - .with(Activity.LAB, () => - cn('bg-green-100', 'hover:bg-green-100', 'text-green-600'), - ) - .otherwise(() => cn('bg-gray-100', 'hover:bg-gray-100', 'text-gray-600')) - -export const CourseSectionContent: React.FC = ({ - section, - className, -}) => { - return ( -
-
- -
-
{section.course_title}
-
{section.section_id}
-
- {section.instructors.length > 0 - ? section.instructors.map(inst => inst.name).join(', ') - : 'N/A'} -
-
-
-
- - {section.activity} - -
-
- ) -} diff --git a/frontend/alert-2.0/src/components/CourseSectionAutocomplete.tsx b/frontend/alert-2.0/src/components/CourseSectionAutocomplete.tsx deleted file mode 100644 index d955db6a..00000000 --- a/frontend/alert-2.0/src/components/CourseSectionAutocomplete.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { keepPreviousData } from '@tanstack/react-query' -import { useState } from 'react' -import { useDebounce } from 'use-debounce' - -import { AutoComplete, ItemEntry } from '@/components/autocomplete' -import { CourseSectionContent } from '@/components/CourseSection' -import { trpc } from '@/core/trpc' -import { CourseSection } from '@/core/types' -import { cn } from '@/lib/utils' - -interface Props { - onCourseSectionSelected?: (courseSection: CourseSection) => void -} - -const ItemComponent: React.FC<{ item: ItemEntry }> = ({ - item: { value }, -}) => { - return ( - - ) -} - -export const CourseSectionAutocomplete: React.FC = ({ - onCourseSectionSelected, -}) => { - const [query, setQuery] = useState('') - const [debouncedQuery] = useDebounce(query, 500) - const { - data: sections, - isLoading, - isPlaceholderData, - } = trpc.course.searchSection.useQuery( - { - query: debouncedQuery, - limit: 20, - }, - { - placeholderData: keepPreviousData, - }, - ) - return ( -
- ({ - id: section.section_id, - value: section, - })) ?? [] - } - ItemComponent={ItemComponent} - searchValue={query} - onSearchValueChange={setQuery} - placeholder="CIS-1200" - onSelect={({ value }) => onCourseSectionSelected?.(value)} - isLoading={isLoading} - emptyMessage={ - debouncedQuery.length > 0 && !isPlaceholderData - ? 'No courses found' - : 'Start typing to search!' - } - /> -
- ) -} diff --git a/frontend/alert-2.0/src/components/PCAHeader.tsx b/frontend/alert-2.0/src/components/PCAHeader.tsx deleted file mode 100644 index 6d3fe557..00000000 --- a/frontend/alert-2.0/src/components/PCAHeader.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { Badge } from '@/components/ui/badge' -import { cn } from '@/lib/utils' - -export const PCAHeader: React.FC = () => { - return ( -
-
- -
- Penn Course Alert -
- 2.0 -
-
- Get alerted when a course opens up -
-
- ) -} diff --git a/frontend/alert-2.0/src/components/StatusIndicator.tsx b/frontend/alert-2.0/src/components/StatusIndicator.tsx deleted file mode 100644 index 51e080aa..00000000 --- a/frontend/alert-2.0/src/components/StatusIndicator.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { match } from 'ts-pattern' - -import { Status } from '@/core/types' -import { cn } from '@/lib/utils' - -const classOfStatus = (status: Status) => - match(status) - .with(Status.OPEN, () => cn('bg-green-400')) - .with(Status.CLOSED, () => cn('bg-red-400')) - .otherwise(() => cn('bg-yellow-400')) - -export const StatusIndicator: React.FC<{ status: Status }> = ({ status }) => { - return ( -
-
-
- ) -} diff --git a/frontend/alert-2.0/src/components/autocomplete.tsx b/frontend/alert-2.0/src/components/autocomplete.tsx deleted file mode 100644 index 40c482cc..00000000 --- a/frontend/alert-2.0/src/components/autocomplete.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import { Command as CommandPrimitive } from 'cmdk' -import React, { useState } from 'react' - -import { - Command, - CommandEmpty, - CommandGroup, - CommandItem, - CommandList, -} from './ui/command' -import { Input } from './ui/input' -import { Popover, PopoverAnchor, PopoverContent } from './ui/popover' -import { Skeleton } from './ui/skeleton' - -export interface ItemEntry { - id: string - value: T -} - -interface Props { - searchValue?: string - onSearchValueChange?: (value: string) => void - onSelect?: (obj: ItemEntry) => void - - items: ItemEntry[] - isLoading?: boolean - - emptyMessage?: string - placeholder?: string - - ItemComponent: React.FC<{ item: ItemEntry }> -} - -export function AutoComplete({ - searchValue, - onSearchValueChange, - onSelect, - - items, - isLoading, - - emptyMessage, - placeholder, - - ItemComponent, -}: Props) { - const [open, setOpen] = useState(false) - - const reset = () => { - onSearchValueChange?.('') - } - - const onInputBlur = (e: React.FocusEvent) => { - if (!e.relatedTarget?.hasAttribute('cmdk-list')) { - reset() - } - } - - const onSelectItem = (entry: ItemEntry) => { - onSelect?.(entry) - setOpen(false) - } - - return ( -
- - - - setOpen(e.key !== 'Escape')} - onMouseDown={() => setOpen(open => !!searchValue || !open)} - onFocus={() => setOpen(true)} - onBlur={onInputBlur} - > - - - - {!open && - -
- ) -} diff --git a/frontend/alert-2.0/src/components/ui/avatar.tsx b/frontend/alert-2.0/src/components/ui/avatar.tsx deleted file mode 100644 index c6accfe9..00000000 --- a/frontend/alert-2.0/src/components/ui/avatar.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import * as AvatarPrimitive from "@radix-ui/react-avatar" -import * as React from "react" - -import { cn } from "@/lib/utils" - -const Avatar = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -Avatar.displayName = AvatarPrimitive.Root.displayName - -const AvatarImage = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -AvatarImage.displayName = AvatarPrimitive.Image.displayName - -const AvatarFallback = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName - -export { Avatar, AvatarFallback,AvatarImage } diff --git a/frontend/alert-2.0/src/components/ui/badge.tsx b/frontend/alert-2.0/src/components/ui/badge.tsx deleted file mode 100644 index 7f0d6cd1..00000000 --- a/frontend/alert-2.0/src/components/ui/badge.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { cva, type VariantProps } from "class-variance-authority" -import * as React from "react" - -import { cn } from "@/lib/utils" - -const badgeVariants = cva( - "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", - { - variants: { - variant: { - default: - "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80", - secondary: - "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", - destructive: - "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80", - outline: "text-foreground", - }, - }, - defaultVariants: { - variant: "default", - }, - } -) - -export interface BadgeProps - extends React.HTMLAttributes, - VariantProps {} - -function Badge({ className, variant, ...props }: BadgeProps) { - return ( -
- ) -} - -export { Badge, badgeVariants } diff --git a/frontend/alert-2.0/src/components/ui/button.tsx b/frontend/alert-2.0/src/components/ui/button.tsx deleted file mode 100644 index 3c71e602..00000000 --- a/frontend/alert-2.0/src/components/ui/button.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { Slot } from "@radix-ui/react-slot" -import { cva, type VariantProps } from "class-variance-authority" -import * as React from "react" - -import { cn } from "@/lib/utils" - -const buttonVariants = cva( - "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", - { - variants: { - variant: { - default: - "bg-primary text-primary-foreground shadow hover:bg-primary/90", - destructive: - "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90", - outline: - "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground", - secondary: - "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80", - ghost: "hover:bg-accent hover:text-accent-foreground", - link: "text-primary underline-offset-4 hover:underline", - }, - size: { - default: "h-9 px-4 py-2", - sm: "h-8 rounded-md px-3 text-xs", - lg: "h-10 rounded-md px-8", - icon: "h-9 w-9", - }, - }, - defaultVariants: { - variant: "default", - size: "default", - }, - } -) - -export interface ButtonProps - extends React.ButtonHTMLAttributes, - VariantProps { - asChild?: boolean -} - -const Button = React.forwardRef( - ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : "button" - return ( - - ) - } -) -Button.displayName = "Button" - -export { Button, buttonVariants } diff --git a/frontend/alert-2.0/src/components/ui/card.tsx b/frontend/alert-2.0/src/components/ui/card.tsx deleted file mode 100644 index 4000a69e..00000000 --- a/frontend/alert-2.0/src/components/ui/card.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import * as React from "react" - -import { cn } from "@/lib/utils" - -const Card = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) -Card.displayName = "Card" - -const CardHeader = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) -CardHeader.displayName = "CardHeader" - -const CardTitle = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -

-)) -CardTitle.displayName = "CardTitle" - -const CardDescription = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -

-)) -CardDescription.displayName = "CardDescription" - -const CardContent = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -

-)) -CardContent.displayName = "CardContent" - -const CardFooter = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) -CardFooter.displayName = "CardFooter" - -export { Card, CardContent,CardDescription, CardFooter, CardHeader, CardTitle } diff --git a/frontend/alert-2.0/src/components/ui/command.tsx b/frontend/alert-2.0/src/components/ui/command.tsx deleted file mode 100644 index d8798102..00000000 --- a/frontend/alert-2.0/src/components/ui/command.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import { type DialogProps } from '@radix-ui/react-dialog' -import { MagnifyingGlassIcon } from '@radix-ui/react-icons' -import { Command as CommandPrimitive } from 'cmdk' -import * as React from 'react' - -import { Dialog, DialogContent } from '@/components/ui/dialog' -import { cn } from '@/lib/utils' - -const Command = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -Command.displayName = CommandPrimitive.displayName - -type CommandDialogProps = DialogProps - -const CommandDialog = ({ children, ...props }: CommandDialogProps) => { - return ( - - - - {children} - - - - ) -} - -const CommandInput = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( -
- - -
-)) - -CommandInput.displayName = CommandPrimitive.Input.displayName - -const CommandList = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) - -CommandList.displayName = CommandPrimitive.List.displayName - -const CommandEmpty = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->((props, ref) => ( - -)) - -CommandEmpty.displayName = CommandPrimitive.Empty.displayName - -const CommandGroup = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) - -CommandGroup.displayName = CommandPrimitive.Group.displayName - -const CommandSeparator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -CommandSeparator.displayName = CommandPrimitive.Separator.displayName - -const CommandItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) - -CommandItem.displayName = CommandPrimitive.Item.displayName - -const CommandShortcut = ({ - className, - ...props -}: React.HTMLAttributes) => { - return ( - - ) -} -CommandShortcut.displayName = 'CommandShortcut' - -export { - Command, - CommandDialog, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, - CommandList, - CommandSeparator, - CommandShortcut, -} diff --git a/frontend/alert-2.0/src/components/ui/dialog.tsx b/frontend/alert-2.0/src/components/ui/dialog.tsx deleted file mode 100644 index 1b5decb7..00000000 --- a/frontend/alert-2.0/src/components/ui/dialog.tsx +++ /dev/null @@ -1,120 +0,0 @@ -import * as DialogPrimitive from "@radix-ui/react-dialog" -import { Cross2Icon } from "@radix-ui/react-icons" -import * as React from "react" - -import { cn } from "@/lib/utils" - -const Dialog = DialogPrimitive.Root - -const DialogTrigger = DialogPrimitive.Trigger - -const DialogPortal = DialogPrimitive.Portal - -const DialogClose = DialogPrimitive.Close - -const DialogOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -DialogOverlay.displayName = DialogPrimitive.Overlay.displayName - -const DialogContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( - - - - {children} - - - Close - - - -)) -DialogContent.displayName = DialogPrimitive.Content.displayName - -const DialogHeader = ({ - className, - ...props -}: React.HTMLAttributes) => ( -
-) -DialogHeader.displayName = "DialogHeader" - -const DialogFooter = ({ - className, - ...props -}: React.HTMLAttributes) => ( -
-) -DialogFooter.displayName = "DialogFooter" - -const DialogTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -DialogTitle.displayName = DialogPrimitive.Title.displayName - -const DialogDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -DialogDescription.displayName = DialogPrimitive.Description.displayName - -export { - Dialog, - DialogClose, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogOverlay, - DialogPortal, - DialogTitle, - DialogTrigger, -} diff --git a/frontend/alert-2.0/src/components/ui/form.tsx b/frontend/alert-2.0/src/components/ui/form.tsx deleted file mode 100644 index 636c7032..00000000 --- a/frontend/alert-2.0/src/components/ui/form.tsx +++ /dev/null @@ -1,176 +0,0 @@ -import * as LabelPrimitive from "@radix-ui/react-label" -import { Slot } from "@radix-ui/react-slot" -import * as React from "react" -import { - Controller, - ControllerProps, - FieldPath, - FieldValues, - FormProvider, - useFormContext, -} from "react-hook-form" - -import { Label } from "@/components/ui/label" -import { cn } from "@/lib/utils" - -const Form = FormProvider - -interface FormFieldContextValue< - TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath -> { - name: TName -} - -const FormFieldContext = React.createContext( - {} as FormFieldContextValue -) - -const FormField = < - TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath ->({ - ...props -}: ControllerProps) => { - return ( - - - - ) -} - -const useFormField = () => { - const fieldContext = React.useContext(FormFieldContext) - const itemContext = React.useContext(FormItemContext) - const { getFieldState, formState } = useFormContext() - - const fieldState = getFieldState(fieldContext.name, formState) - - if (!fieldContext) { - throw new Error("useFormField should be used within ") - } - - const { id } = itemContext - - return { - id, - name: fieldContext.name, - formItemId: `${id}-form-item`, - formDescriptionId: `${id}-form-item-description`, - formMessageId: `${id}-form-item-message`, - ...fieldState, - } -} - -interface FormItemContextValue { - id: string -} - -const FormItemContext = React.createContext( - {} as FormItemContextValue -) - -const FormItem = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => { - const id = React.useId() - - return ( - -
- - ) -}) -FormItem.displayName = "FormItem" - -const FormLabel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => { - const { error, formItemId } = useFormField() - - return ( -