From a2129641aeba8a9cb621232502b6e85a7dbc7dcb Mon Sep 17 00:00:00 2001 From: AI Christianson Date: Thu, 13 Mar 2025 14:13:04 -0400 Subject: [PATCH] Revert "shadcn integration" This reverts commit 9d585f38b5600e617a72f7481325031d143ec067. --- .gitignore | 2 - frontend/common/components.json | 16 - frontend/common/package.json | 16 - frontend/common/postcss.config.js | 6 - frontend/common/src/components/ShadcnDemo.tsx | 197 ---- .../src/components/theme/theme-provider.tsx | 74 -- .../src/components/theme/theme-toggle.tsx | 58 -- frontend/common/src/components/ui/button.tsx | 55 -- frontend/common/src/components/ui/card.tsx | 79 -- frontend/common/src/components/ui/toggle.tsx | 43 - frontend/common/src/index.ts | 27 +- frontend/common/src/lib/utils.ts | 6 - frontend/common/src/styles/globals.css | 75 -- frontend/common/tailwind.config.js | 79 -- frontend/common/tsconfig.json | 10 +- frontend/package-lock.json | 873 +----------------- frontend/package.json | 8 +- frontend/web/index.html | 5 +- frontend/web/package.json | 9 +- frontend/web/postcss.config.js | 6 - frontend/web/src/index.tsx | 14 +- frontend/web/src/styles.css | 4 - frontend/web/tailwind.config.js | 6 - frontend/web/vite.config.js | 20 +- 24 files changed, 49 insertions(+), 1639 deletions(-) delete mode 100644 frontend/common/components.json delete mode 100644 frontend/common/postcss.config.js delete mode 100644 frontend/common/src/components/ShadcnDemo.tsx delete mode 100644 frontend/common/src/components/theme/theme-provider.tsx delete mode 100644 frontend/common/src/components/theme/theme-toggle.tsx delete mode 100644 frontend/common/src/components/ui/button.tsx delete mode 100644 frontend/common/src/components/ui/card.tsx delete mode 100644 frontend/common/src/components/ui/toggle.tsx delete mode 100644 frontend/common/src/lib/utils.ts delete mode 100644 frontend/common/src/styles/globals.css delete mode 100644 frontend/common/tailwind.config.js delete mode 100644 frontend/web/postcss.config.js delete mode 100644 frontend/web/src/styles.css delete mode 100644 frontend/web/tailwind.config.js diff --git a/.gitignore b/.gitignore index 90c2af7..ae783cf 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,3 @@ appmap.log /vsc/node_modules /vsc/dist node_modules/ -/frontend/web/dist/ -/frontend/common/dist/ diff --git a/frontend/common/components.json b/frontend/common/components.json deleted file mode 100644 index ac17545..0000000 --- a/frontend/common/components.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema.json", - "style": "default", - "rsc": false, - "tsx": true, - "tailwind": { - "config": "tailwind.config.js", - "css": "src/styles/globals.css", - "baseColor": "slate", - "cssVariables": true - }, - "aliases": { - "components": "@ra-aid/common/src/components", - "utils": "@ra-aid/common/src/lib/utils" - } -} \ No newline at end of file diff --git a/frontend/common/package.json b/frontend/common/package.json index cd5c9c2..2371bed 100644 --- a/frontend/common/package.json +++ b/frontend/common/package.json @@ -8,23 +8,7 @@ "build": "tsc", "dev": "tsc --watch" }, - "dependencies": { - "@radix-ui/react-toggle": "^1.1.2", - "class-variance-authority": "^0.7.0", - "clsx": "^2.1.0", - "lucide-react": "^0.344.0", - "react": "^18.0.0", - "react-dom": "^18.0.0", - "tailwind-merge": "^2.2.1", - "tailwindcss-animate": "^1.0.7" - }, "devDependencies": { - "@types/react": "^18.0.0", - "@types/react-dom": "^18.0.0", "typescript": "^5.0.0" - }, - "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" } } diff --git a/frontend/common/postcss.config.js b/frontend/common/postcss.config.js deleted file mode 100644 index dc655aa..0000000 --- a/frontend/common/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - plugins: { - '@tailwindcss/postcss': {}, - autoprefixer: {}, - }, -} \ No newline at end of file diff --git a/frontend/common/src/components/ShadcnDemo.tsx b/frontend/common/src/components/ShadcnDemo.tsx deleted file mode 100644 index 2b29520..0000000 --- a/frontend/common/src/components/ShadcnDemo.tsx +++ /dev/null @@ -1,197 +0,0 @@ -import React from "react"; -import { - ThemeProvider, - ThemeToggle, - Button, - Card, - CardHeader, - CardFooter, - CardTitle, - CardDescription, - CardContent -} from "../index"; - -/** - * ShadcnDemo Component - * - * Demonstrates various shadcn UI components including: - * - Cards with different content - * - Buttons with different variants and sizes - * - Theme toggling between light and dark modes - * - Responsive layout using Tailwind CSS - */ -export function ShadcnDemo() { - return ( - -
-
-
-

Shadcn UI Demo

- -
- -
-

Button Variants

-
- - - - - - -
-
- -
-

Button Sizes

-
- - - - -
-
- -
-

Cards

-
- {/* Feature Card */} - - - Feature Highlight - Showcasing a key product feature - - -

This card demonstrates a clean way to highlight important features or content in your application.

-
- - - -
- - {/* Stats Card */} - - - Statistics - Key metrics and data points - - -
- Total Users - 1,234 -
-
- Active Sessions - 567 -
-
- Conversion Rate - 12.5% -
-
- - - -
- - {/* CTA Card */} - - - Get Started - Begin your journey today - - -

Sign up now and get access to all premium features for the first 30 days.

-
- - - -
-
-
- -
-

Responsive Demo

- - -
-
-

Mobile View

-

Default

-
-
-

Tablet View

-

sm:block

-
-
-

Desktop View

-

lg:block

-
-
-

Desktop View

-

lg:block

-
-
-
- - - - -
-
- -
-

Interactive States

-
- - - Button States - - - - - - - - - - - Interactive Example - - -

Toggle between these options:

-
- - - -
-
- - - -
-
-
-
-
-
- ); -} - -export default ShadcnDemo; \ No newline at end of file diff --git a/frontend/common/src/components/theme/theme-provider.tsx b/frontend/common/src/components/theme/theme-provider.tsx deleted file mode 100644 index 9695667..0000000 --- a/frontend/common/src/components/theme/theme-provider.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import React, { createContext, useContext, useEffect, useState } from "react"; - -type Theme = "dark" | "light" | "system"; - -type ThemeProviderProps = { - children: React.ReactNode; - defaultTheme?: Theme; - storageKey?: string; -}; - -type ThemeProviderState = { - theme: Theme; - setTheme: (theme: Theme) => void; -}; - -const initialState: ThemeProviderState = { - theme: "system", - setTheme: () => null, -}; - -const ThemeProviderContext = createContext(initialState); - -export function ThemeProvider({ - children, - defaultTheme = "system", - storageKey = "ra-aid-ui-theme", - ...props -}: ThemeProviderProps) { - const [theme, setTheme] = useState( - () => (localStorage.getItem(storageKey) as Theme) || defaultTheme - ); - - useEffect(() => { - const root = window.document.documentElement; - - root.classList.remove("light", "dark"); - - if (theme === "system") { - const systemTheme = window.matchMedia("(prefers-color-scheme: dark)") - .matches - ? "dark" - : "light"; - - root.classList.add(systemTheme); - return; - } - - root.classList.add(theme); - }, [theme]); - - const value = { - theme, - setTheme: (theme: Theme) => { - localStorage.setItem(storageKey, theme); - setTheme(theme); - }, - }; - - return ( - - {children} - - ); -} - -export const useTheme = () => { - const context = useContext(ThemeProviderContext); - - if (context === undefined) { - throw new Error("useTheme must be used within a ThemeProvider"); - } - - return context; -} \ No newline at end of file diff --git a/frontend/common/src/components/theme/theme-toggle.tsx b/frontend/common/src/components/theme/theme-toggle.tsx deleted file mode 100644 index 8276051..0000000 --- a/frontend/common/src/components/theme/theme-toggle.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import React from "react"; -import { useTheme } from "./theme-provider"; -import { cn } from "../../lib/utils"; - -export function ThemeToggle({ className }: { className?: string }) { - const { theme, setTheme } = useTheme(); - - return ( - - ); -} \ No newline at end of file diff --git a/frontend/common/src/components/ui/button.tsx b/frontend/common/src/components/ui/button.tsx deleted file mode 100644 index 3676aa7..0000000 --- a/frontend/common/src/components/ui/button.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import * as React from "react"; -import { cva, type VariantProps } from "class-variance-authority"; - -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) => { - return ( -