diff --git a/app.config.ts b/app.config.ts index a158c4a..6937643 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,3 +1,4 @@ +// import tailwindcss from "@tailwindcss/vite"; import { defineConfig } from "@tanstack/start/config"; import tsConfigPaths from "vite-tsconfig-paths"; @@ -7,6 +8,7 @@ export default defineConfig({ tsConfigPaths({ projects: ["./tsconfig.json"], }), + // tailwindcss(), ], }, diff --git a/app/routes/signin.tsx b/app/routes/signin.tsx index e69b4ed..e53d189 100644 --- a/app/routes/signin.tsx +++ b/app/routes/signin.tsx @@ -1,5 +1,6 @@ import { createFileRoute, redirect } from "@tanstack/react-router"; -import { Button, type ButtonProps } from "~/lib/components/ui/button"; +import { type ComponentProps } from "react"; +import { Button } from "~/lib/components/ui/button"; import { cn } from "~/lib/utils"; import authClient from "~/lib/utils/auth-client"; @@ -43,7 +44,7 @@ function AuthPage() { ); } -interface SignInButtonProps extends ButtonProps { +interface SignInButtonProps extends ComponentProps { provider: "discord" | "google" | "github"; label: string; } diff --git a/components.json b/components.json index cfa1606..4b77b4b 100644 --- a/components.json +++ b/components.json @@ -1,6 +1,6 @@ { "$schema": "https://ui.shadcn.com/schema.json", - "style": "default", + "style": "new-york", "rsc": false, "tsx": true, "tailwind": { @@ -14,7 +14,8 @@ "components": "~/lib/components", "utils": "~/lib/utils", "ui": "~/lib/components/ui", - "hooks": "~/lib/hooks", - "lib": "~/lib/utils" - } + "lib": "~/lib/utils", + "hooks": "~/lib/hooks" + }, + "iconLibrary": "lucide" } diff --git a/lib/components/ThemeToggle.tsx b/lib/components/ThemeToggle.tsx index 9708aca..603bb36 100644 --- a/lib/components/ThemeToggle.tsx +++ b/lib/components/ThemeToggle.tsx @@ -18,8 +18,8 @@ export default function ThemeToggle() { return ( ); diff --git a/lib/components/ui/button.tsx b/lib/components/ui/button.tsx index e772ca7..617ea0e 100644 --- a/lib/components/ui/button.tsx +++ b/lib/components/ui/button.tsx @@ -5,23 +5,25 @@ import * as React from "react"; import { cn } from "~/lib/utils"; const buttonVariants = cva( - "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 focus-visible:ring-4 focus-visible:outline-1 aria-invalid:focus-visible:ring-0", { variants: { variant: { - default: "bg-primary text-primary-foreground hover:bg-primary/90", - destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", + default: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90", + destructive: + "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90", outline: - "border border-input bg-background hover:bg-accent hover:text-accent-foreground", - secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", + "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground", + secondary: + "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground", link: "text-primary underline-offset-4 hover:underline", }, size: { - default: "h-10 px-4 py-2", - sm: "h-9 rounded-md px-3", - lg: "h-11 rounded-md px-8", - icon: "h-10 w-10", + default: "h-9 px-4 py-2 has-[>svg]:px-3", + sm: "h-8 rounded-md px-3 has-[>svg]:px-2.5", + lg: "h-10 rounded-md px-6 has-[>svg]:px-4", + icon: "size-9", }, }, defaultVariants: { @@ -31,29 +33,25 @@ const buttonVariants = cva( }, ); -export interface ButtonProps - extends React.ButtonHTMLAttributes, - VariantProps { - asChild?: boolean; -} - -const Button = ({ - ref, +function Button({ className, variant, size, asChild = false, ...props -}: Readonly & { ref?: React.RefObject }) => { +}: React.ComponentProps<"button"> & + VariantProps & { + asChild?: boolean; + }) { const Comp = asChild ? Slot : "button"; + return ( ); -}; -Button.displayName = "Button"; +} export { Button, buttonVariants }; diff --git a/lib/styles/app.css b/lib/styles/app.css index 8f4630f..9e1e278 100644 --- a/lib/styles/app.css +++ b/lib/styles/app.css @@ -1,83 +1,98 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; +@import "tailwindcss" source("../../"); -@layer base { - :root { - --background: 0 0% 100%; - --foreground: 240 10% 3.9%; - --card: 0 0% 100%; - --card-foreground: 240 10% 3.9%; - --popover: 0 0% 100%; - --popover-foreground: 240 10% 3.9%; - --primary: 240 5.9% 10%; - --primary-foreground: 0 0% 98%; - --secondary: 240 4.8% 95.9%; - --secondary-foreground: 240 5.9% 10%; - --muted: 240 4.8% 95.9%; - --muted-foreground: 240 3.8% 46.1%; - --accent: 240 4.8% 95.9%; - --accent-foreground: 240 5.9% 10%; - --destructive: 0 84.2% 60.2%; - --destructive-foreground: 0 0% 98%; - --border: 240 5.9% 90%; - --input: 240 5.9% 90%; - --ring: 240 5.9% 10%; - --radius: 0.5rem; - --chart-1: 12 76% 61%; - --chart-2: 173 58% 39%; - --chart-3: 197 37% 24%; - --chart-4: 43 74% 66%; - --chart-5: 27 87% 67%; - --sidebar-background: 0 0% 98%; - --sidebar-foreground: 240 5.3% 26.1%; - --sidebar-primary: 240 5.9% 10%; - --sidebar-primary-foreground: 0 0% 98%; - --sidebar-accent: 240 4.8% 95.9%; - --sidebar-accent-foreground: 240 5.9% 10%; - --sidebar-border: 220 13% 91%; - --sidebar-ring: 217.2 91.2% 59.8%; - } +@plugin 'tailwindcss-animate'; - .dark { - --background: 240 10% 3.9%; - --foreground: 0 0% 98%; - --card: 240 10% 3.9%; - --card-foreground: 0 0% 98%; - --popover: 240 10% 3.9%; - --popover-foreground: 0 0% 98%; - --primary: 0 0% 98%; - --primary-foreground: 240 5.9% 10%; - --secondary: 240 3.7% 15.9%; - --secondary-foreground: 0 0% 98%; - --muted: 240 3.7% 15.9%; - --muted-foreground: 240 5% 64.9%; - --accent: 240 3.7% 15.9%; - --accent-foreground: 0 0% 98%; - --destructive: 0 62.8% 30.6%; - --destructive-foreground: 0 0% 98%; - --border: 240 3.7% 15.9%; - --input: 240 3.7% 15.9%; - --ring: 240 4.9% 83.9%; - --chart-1: 220 70% 50%; - --chart-2: 160 60% 45%; - --chart-3: 30 80% 55%; - --chart-4: 280 65% 60%; - --chart-5: 340 75% 55%; - --sidebar-background: 240 5.9% 10%; - --sidebar-foreground: 240 4.8% 95.9%; - --sidebar-primary: 224.3 76.3% 48%; - --sidebar-primary-foreground: 0 0% 100%; - --sidebar-accent: 240 3.7% 15.9%; - --sidebar-accent-foreground: 240 4.8% 95.9%; - --sidebar-border: 240 3.7% 15.9%; - --sidebar-ring: 217.2 91.2% 59.8%; - } +@custom-variant dark (&:is(.dark *)); + +:root { + --background: hsl(0 0% 100%); + --foreground: hsl(240 10% 3.9%); + --card: hsl(0 0% 100%); + --card-foreground: hsl(240 10% 3.9%); + --popover: hsl(0 0% 100%); + --popover-foreground: hsl(240 10% 3.9%); + --primary: hsl(240 5.9% 10%); + --primary-foreground: hsl(0 0% 98%); + --secondary: hsl(240 4.8% 95.9%); + --secondary-foreground: hsl(240 5.9% 10%); + --muted: hsl(240 4.8% 95.9%); + --muted-foreground: hsl(240 3.8% 46.1%); + --accent: hsl(240 4.8% 95.9%); + --accent-foreground: hsl(240 5.9% 10%); + --destructive: hsl(0 84.2% 60.2%); + --destructive-foreground: hsl(0 0% 98%); + --border: hsl(240 5.9% 90%); + --input: hsl(240 5.9% 90%); + --ring: hsl(240 10% 3.9%); + --chart-1: hsl(12 76% 61%); + --chart-2: hsl(173 58% 39%); + --chart-3: hsl(197 37% 24%); + --chart-4: hsl(43 74% 66%); + --chart-5: hsl(27 87% 67%); + --radius: 0.6rem; +} + +.dark { + --background: hsl(240 10% 3.9%); + --foreground: hsl(0 0% 98%); + --card: hsl(240 10% 3.9%); + --card-foreground: hsl(0 0% 98%); + --popover: hsl(240 10% 3.9%); + --popover-foreground: hsl(0 0% 98%); + --primary: hsl(0 0% 98%); + --primary-foreground: hsl(240 5.9% 10%); + --secondary: hsl(240 3.7% 15.9%); + --secondary-foreground: hsl(0 0% 98%); + --muted: hsl(240 3.7% 15.9%); + --muted-foreground: hsl(240 5% 64.9%); + --accent: hsl(240 3.7% 15.9%); + --accent-foreground: hsl(0 0% 98%); + --destructive: hsl(0 62.8% 30.6%); + --destructive-foreground: hsl(0 0% 98%); + --border: hsl(240 3.7% 15.9%); + --input: hsl(240 3.7% 15.9%); + --ring: hsl(240 4.9% 83.9%); + --chart-1: hsl(220 70% 50%); + --chart-2: hsl(160 60% 45%); + --chart-3: hsl(30 80% 55%); + --chart-4: hsl(280 65% 60%); + --chart-5: hsl(340 75% 55%); +} + +@theme inline { + --color-background: var(--background); + --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: var(--primary); + --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-destructive-foreground: var(--destructive-foreground); + --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); + --radius-sm: calc(var(--radius) - 4px); + --radius-md: calc(var(--radius) - 2px); + --radius-lg: var(--radius); + --radius-xl: calc(var(--radius) + 4px); } @layer base { * { - @apply border-border; + @apply border-border outline-ring/50; } body { @apply bg-background text-foreground; diff --git a/package.json b/package.json index b9069de..c4ae570 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "eslint .", "format": "prettier --write .", "db": "drizzle-kit", - "ui": "pnpm dlx shadcn@latest", + "ui": "pnpm dlx shadcn@canary", "auth": "pnpm dlx @better-auth/cli@latest", "auth:generate": "pnpm dlx @better-auth/cli@latest generate --y --output ./lib/server/schema/auth.schema.ts && prettier --write ./lib/server/schema/auth.schema.ts" }, @@ -17,10 +17,10 @@ "@radix-ui/react-slot": "^1.1.2", "@tanstack/react-query": "^5.66.0", "@tanstack/react-query-devtools": "^5.66.0", - "@tanstack/react-router": "^1.99.7", - "@tanstack/react-router-with-query": "^1.99.7", - "@tanstack/router-devtools": "^1.99.7", - "@tanstack/start": "^1.99.7", + "@tanstack/react-router": "^1.99.13", + "@tanstack/react-router-with-query": "^1.99.13", + "@tanstack/router-devtools": "^1.99.13", + "@tanstack/start": "^1.99.14", "@vitejs/plugin-react": "^4.3.4", "better-auth": "^1.1.16", "class-variance-authority": "^0.7.1", @@ -30,21 +30,21 @@ "postgres": "^3.4.5", "react": "^19.0.0", "react-dom": "^19.0.0", - "tailwind-merge": "^2.6.0", + "tailwind-merge": "^3.0.1", "tailwindcss-animate": "^1.0.7", - "vinxi": "^0.5.1" + "vinxi": "^0.5.2" }, "devDependencies": { - "@eslint-react/eslint-plugin": "^1.26.1", - "@eslint/js": "^9.19.0", + "@eslint-react/eslint-plugin": "^1.26.2", + "@eslint/js": "^9.20.0", + "@tailwindcss/postcss": "^4.0.4", "@tanstack/eslint-plugin-query": "^5.66.0", "@tanstack/eslint-plugin-router": "^1.99.3", "@types/eslint__js": "^8.42.3", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", - "autoprefixer": "^10.4.20", "drizzle-kit": "^0.30.4", - "eslint": "^9.19.0", + "eslint": "^9.20.0", "eslint-config-prettier": "^10.0.1", "eslint-plugin-react-hooks": "^5.1.0", "globals": "^15.14.0", @@ -52,7 +52,7 @@ "prettier": "^3.4.2", "prettier-plugin-organize-imports": "^4.1.0", "prettier-plugin-tailwindcss": "^0.6.11", - "tailwindcss": "^3.4.17", + "tailwindcss": "^4.0.4", "typescript": "^5.7.3", "typescript-eslint": "^8.23.0", "vite-tsconfig-paths": "^5.1.4" diff --git a/postcss.config.js b/postcss.config.js index 2aa7205..c2ddf74 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,5 @@ export default { plugins: { - tailwindcss: {}, - autoprefixer: {}, + "@tailwindcss/postcss": {}, }, }; diff --git a/tailwind.config.ts b/tailwind.config.ts deleted file mode 100644 index abf762d..0000000 --- a/tailwind.config.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { type Config } from "tailwindcss"; -import tailwindcssAnimate from "tailwindcss-animate"; - -export default { - darkMode: ["class"], - content: ["./app/**/*.tsx", "./lib/**/*.tsx"], - theme: { - extend: { - borderRadius: { - lg: "var(--radius)", - md: "calc(var(--radius) - 2px)", - sm: "calc(var(--radius) - 4px)", - }, - colors: { - background: "hsl(var(--background))", - foreground: "hsl(var(--foreground))", - card: { - DEFAULT: "hsl(var(--card))", - foreground: "hsl(var(--card-foreground))", - }, - popover: { - DEFAULT: "hsl(var(--popover))", - foreground: "hsl(var(--popover-foreground))", - }, - primary: { - DEFAULT: "hsl(var(--primary))", - foreground: "hsl(var(--primary-foreground))", - }, - secondary: { - DEFAULT: "hsl(var(--secondary))", - foreground: "hsl(var(--secondary-foreground))", - }, - muted: { - DEFAULT: "hsl(var(--muted))", - foreground: "hsl(var(--muted-foreground))", - }, - accent: { - DEFAULT: "hsl(var(--accent))", - foreground: "hsl(var(--accent-foreground))", - }, - destructive: { - DEFAULT: "hsl(var(--destructive))", - foreground: "hsl(var(--destructive-foreground))", - }, - border: "hsl(var(--border))", - input: "hsl(var(--input))", - ring: "hsl(var(--ring))", - chart: { - "1": "hsl(var(--chart-1))", - "2": "hsl(var(--chart-2))", - "3": "hsl(var(--chart-3))", - "4": "hsl(var(--chart-4))", - "5": "hsl(var(--chart-5))", - }, - sidebar: { - DEFAULT: "hsl(var(--sidebar-background))", - foreground: "hsl(var(--sidebar-foreground))", - primary: "hsl(var(--sidebar-primary))", - "primary-foreground": "hsl(var(--sidebar-primary-foreground))", - accent: "hsl(var(--sidebar-accent))", - "accent-foreground": "hsl(var(--sidebar-accent-foreground))", - border: "hsl(var(--sidebar-border))", - ring: "hsl(var(--sidebar-ring))", - }, - }, - keyframes: { - "accordion-down": { - from: { - height: "0", - }, - to: { - height: "var(--radix-accordion-content-height)", - }, - }, - "accordion-up": { - from: { - height: "var(--radix-accordion-content-height)", - }, - to: { - height: "0", - }, - }, - }, - animation: { - "accordion-down": "accordion-down 0.2s ease-out", - "accordion-up": "accordion-up 0.2s ease-out", - }, - }, - }, - plugins: [tailwindcssAnimate], -} satisfies Config;