From 2b1d2152c4d89d509a91ee01523b28ae9a87d41c Mon Sep 17 00:00:00 2001 From: Jose Selesan Date: Thu, 15 Oct 2026 15:24:34 -0300 Subject: [PATCH] chore: scaffold turbo monorepo with hono api and react admin web --- .env.example | 17 + .gitignore | 25 + .prettierignore | 6 + .prettierrc | 7 + AGENTS.md | 134 ++++ README.md | 62 ++ STACK.md | 8 + apps/api/.env.example | 6 + apps/api/.oxlintrc.json | 9 + apps/api/package.json | 38 + apps/api/prisma.config.ts | 14 + apps/api/prisma/schema.prisma | 80 ++ apps/api/src/app.ts | 49 ++ apps/api/src/index.ts | 13 + apps/api/src/lib/auth.ts | 21 + apps/api/src/lib/logger.ts | 21 + apps/api/src/lib/prisma.ts | 19 + apps/api/src/lib/problem-details.ts | 52 ++ apps/api/src/lib/result-json.test.ts | 86 +++ apps/api/src/lib/result-json.ts | 39 + apps/api/src/lib/validate.ts | 42 ++ .../src/modules/health/get-status/route.ts | 11 + .../health/get-status/use-case.test.ts | 18 + .../src/modules/health/get-status/use-case.ts | 23 + apps/api/src/modules/health/index.ts | 8 + apps/api/src/types.ts | 9 + apps/api/tsconfig.json | 20 + apps/web/.env.example | 1 + apps/web/.oxlintrc.json | 8 + apps/web/components.json | 25 + apps/web/index.html | 13 + apps/web/package.json | 55 ++ apps/web/src/components/layout/app-header.tsx | 42 ++ .../web/src/components/layout/app-sidebar.tsx | 78 ++ apps/web/src/components/layout/nav-user.tsx | 100 +++ apps/web/src/components/theme-provider.tsx | 11 + apps/web/src/components/theme-toggle.tsx | 39 + apps/web/src/components/ui/alert.tsx | 75 ++ apps/web/src/components/ui/avatar.tsx | 109 +++ apps/web/src/components/ui/badge.tsx | 48 ++ apps/web/src/components/ui/breadcrumb.tsx | 121 +++ apps/web/src/components/ui/button.tsx | 66 ++ apps/web/src/components/ui/card.tsx | 102 +++ apps/web/src/components/ui/checkbox.tsx | 32 + apps/web/src/components/ui/dropdown-menu.tsx | 268 +++++++ apps/web/src/components/ui/field.tsx | 236 ++++++ apps/web/src/components/ui/input.tsx | 18 + apps/web/src/components/ui/label.tsx | 21 + apps/web/src/components/ui/select.tsx | 189 +++++ apps/web/src/components/ui/separator.tsx | 27 + apps/web/src/components/ui/sheet.tsx | 147 ++++ apps/web/src/components/ui/sidebar.tsx | 700 ++++++++++++++++++ apps/web/src/components/ui/skeleton.tsx | 13 + apps/web/src/components/ui/sonner.tsx | 47 ++ apps/web/src/components/ui/switch.tsx | 32 + apps/web/src/components/ui/table.tsx | 115 +++ apps/web/src/components/ui/tabs.tsx | 87 +++ apps/web/src/components/ui/textarea.tsx | 17 + apps/web/src/components/ui/tooltip.tsx | 54 ++ apps/web/src/hooks/use-health.ts | 26 + apps/web/src/hooks/use-mobile.ts | 19 + apps/web/src/index.css | 130 ++++ apps/web/src/lib/api-client.test.ts | 36 + apps/web/src/lib/api-client.ts | 55 ++ apps/web/src/lib/auth-client.ts | 11 + apps/web/src/lib/query-client.ts | 18 + apps/web/src/lib/utils.ts | 1 + apps/web/src/main.tsx | 38 + apps/web/src/routes/(auth)/sign-in.tsx | 102 +++ apps/web/src/routes/__root.tsx | 54 ++ apps/web/src/routes/_authenticated/index.tsx | 153 ++++ apps/web/src/routes/_authenticated/route.tsx | 49 ++ .../src/routes/_authenticated/settings.tsx | 98 +++ apps/web/src/routes/_authenticated/tasks.tsx | 131 ++++ apps/web/tsconfig.app.json | 32 + apps/web/tsconfig.json | 12 + apps/web/tsconfig.node.json | 23 + apps/web/tsr.config.json | 7 + apps/web/vite.config.ts | 25 + bun.lockb | Bin 0 -> 334672 bytes package.json | 27 + packages/shared/.oxlintrc.json | 9 + packages/shared/package.json | 23 + packages/shared/src/index.test.ts | 34 + packages/shared/src/index.ts | 2 + packages/shared/src/problem-details.ts | 94 +++ packages/shared/src/result.ts | 10 + packages/shared/tsconfig.json | 17 + turbo.json | 27 + 89 files changed, 4996 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 AGENTS.md create mode 100644 README.md create mode 100644 STACK.md create mode 100644 apps/api/.env.example create mode 100644 apps/api/.oxlintrc.json create mode 100644 apps/api/package.json create mode 100644 apps/api/prisma.config.ts create mode 100644 apps/api/prisma/schema.prisma create mode 100644 apps/api/src/app.ts create mode 100644 apps/api/src/index.ts create mode 100644 apps/api/src/lib/auth.ts create mode 100644 apps/api/src/lib/logger.ts create mode 100644 apps/api/src/lib/prisma.ts create mode 100644 apps/api/src/lib/problem-details.ts create mode 100644 apps/api/src/lib/result-json.test.ts create mode 100644 apps/api/src/lib/result-json.ts create mode 100644 apps/api/src/lib/validate.ts create mode 100644 apps/api/src/modules/health/get-status/route.ts create mode 100644 apps/api/src/modules/health/get-status/use-case.test.ts create mode 100644 apps/api/src/modules/health/get-status/use-case.ts create mode 100644 apps/api/src/modules/health/index.ts create mode 100644 apps/api/src/types.ts create mode 100644 apps/api/tsconfig.json create mode 100644 apps/web/.env.example create mode 100644 apps/web/.oxlintrc.json create mode 100644 apps/web/components.json create mode 100644 apps/web/index.html create mode 100644 apps/web/package.json create mode 100644 apps/web/src/components/layout/app-header.tsx create mode 100644 apps/web/src/components/layout/app-sidebar.tsx create mode 100644 apps/web/src/components/layout/nav-user.tsx create mode 100644 apps/web/src/components/theme-provider.tsx create mode 100644 apps/web/src/components/theme-toggle.tsx create mode 100644 apps/web/src/components/ui/alert.tsx create mode 100644 apps/web/src/components/ui/avatar.tsx create mode 100644 apps/web/src/components/ui/badge.tsx create mode 100644 apps/web/src/components/ui/breadcrumb.tsx create mode 100644 apps/web/src/components/ui/button.tsx create mode 100644 apps/web/src/components/ui/card.tsx create mode 100644 apps/web/src/components/ui/checkbox.tsx create mode 100644 apps/web/src/components/ui/dropdown-menu.tsx create mode 100644 apps/web/src/components/ui/field.tsx create mode 100644 apps/web/src/components/ui/input.tsx create mode 100644 apps/web/src/components/ui/label.tsx create mode 100644 apps/web/src/components/ui/select.tsx create mode 100644 apps/web/src/components/ui/separator.tsx create mode 100644 apps/web/src/components/ui/sheet.tsx create mode 100644 apps/web/src/components/ui/sidebar.tsx create mode 100644 apps/web/src/components/ui/skeleton.tsx create mode 100644 apps/web/src/components/ui/sonner.tsx create mode 100644 apps/web/src/components/ui/switch.tsx create mode 100644 apps/web/src/components/ui/table.tsx create mode 100644 apps/web/src/components/ui/tabs.tsx create mode 100644 apps/web/src/components/ui/textarea.tsx create mode 100644 apps/web/src/components/ui/tooltip.tsx create mode 100644 apps/web/src/hooks/use-health.ts create mode 100644 apps/web/src/hooks/use-mobile.ts create mode 100644 apps/web/src/index.css create mode 100644 apps/web/src/lib/api-client.test.ts create mode 100644 apps/web/src/lib/api-client.ts create mode 100644 apps/web/src/lib/auth-client.ts create mode 100644 apps/web/src/lib/query-client.ts create mode 100644 apps/web/src/lib/utils.ts create mode 100644 apps/web/src/main.tsx create mode 100644 apps/web/src/routes/(auth)/sign-in.tsx create mode 100644 apps/web/src/routes/__root.tsx create mode 100644 apps/web/src/routes/_authenticated/index.tsx create mode 100644 apps/web/src/routes/_authenticated/route.tsx create mode 100644 apps/web/src/routes/_authenticated/settings.tsx create mode 100644 apps/web/src/routes/_authenticated/tasks.tsx create mode 100644 apps/web/tsconfig.app.json create mode 100644 apps/web/tsconfig.json create mode 100644 apps/web/tsconfig.node.json create mode 100644 apps/web/tsr.config.json create mode 100644 apps/web/vite.config.ts create mode 100755 bun.lockb create mode 100644 package.json create mode 100644 packages/shared/.oxlintrc.json create mode 100644 packages/shared/package.json create mode 100644 packages/shared/src/index.test.ts create mode 100644 packages/shared/src/index.ts create mode 100644 packages/shared/src/problem-details.ts create mode 100644 packages/shared/src/result.ts create mode 100644 packages/shared/tsconfig.json create mode 100644 turbo.json diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..aedf635 --- /dev/null +++ b/.env.example @@ -0,0 +1,17 @@ +# --- apps/api --- +# Postgres connection string used by Prisma +DATABASE_URL="postgresql://postgres:postgres@localhost:5432/superlist?schema=public" +# Port the Hono server listens on +PORT=3000 +# Comma separated list of origins allowed by CORS (the web dev server) +CORS_ORIGIN="http://localhost:5173" +# Secret used by BetterAuth to sign sessions +BETTER_AUTH_SECRET="change-me-with-openssl-rand-base64-32" +# Public URL of the API, used by BetterAuth +BETTER_AUTH_URL="http://localhost:3000" +# "development" enables pretty logs, "production" emits JSON +NODE_ENV="development" + +# --- apps/web --- +# Public URL of the API consumed by the frontend +VITE_API_URL="http://localhost:3000" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..869b83b --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +node_modules/ +dist/ +build/ +.turbo/ +coverage/ +*.tsbuildinfo + +# env +.env +.env.local +.env.*.local + +# logs +*.log +logs/ + +# editors / os +.vscode/* +!.vscode/extensions.json +.idea/ +.DS_Store + +# generated +apps/web/src/routeTree.gen.ts +apps/api/src/generated/ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..ec573b6 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +node_modules +dist +coverage +.turbo +bun.lock +apps/web/src/routeTree.gen.ts diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..c03d068 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "semi": false, + "singleQuote": true, + "trailingComma": "all", + "printWidth": 100, + "tabWidth": 2 +} diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..8f0b063 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,134 @@ +# AGENTS.md + +## Status + +Scaffold is in place: Turborepo monorepo with `apps/api`, `apps/web` and `packages/shared`. +No CI, no database migrations and no product features yet. + +## Stack (source of truth: `STACK.md`) + +- Monorepo orchestrated with **Turborepo** +- Backend: **Bun** + **Hono**, **Prisma** against **Postgres**, **Zod** for validation, **Pino** for logging +- Frontend: **React + Vite + TypeScript**, UI components from **shadcn/ui** +- Auth: **BetterAuth** + +## Conventions + +- **Package manager: Bun** — `bun install`, `bun run + + diff --git a/apps/web/package.json b/apps/web/package.json new file mode 100644 index 0000000..94b92bd --- /dev/null +++ b/apps/web/package.json @@ -0,0 +1,55 @@ +{ + "name": "@superlist/web", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "routes:generate": "tsr generate", + "dev": "tsr generate && vite", + "build": "tsr generate && tsc -b && vite build", + "preview": "vite preview", + "lint": "oxlint", + "typecheck": "tsr generate && tsc -b", + "test": "vitest run --passWithNoTests" + }, + "dependencies": { + "@fontsource-variable/geist": "^5.3.0", + "@hookform/resolvers": "^5.9.1", + "@superlist/shared": "workspace:*", + "@tanstack/react-query": "^5.104.2", + "@tanstack/react-query-devtools": "^5.104.2", + "@tanstack/react-router": "^1.170.42", + "@tanstack/react-table": "^9.3.1", + "better-auth": "^1.7.7", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "cn": "^0.4.0", + "lucide-react": "^1.55.0", + "next-themes": "^0.4.6", + "radix-ui": "^1.8.0", + "react": "^19.2.8", + "react-dom": "^19.2.8", + "react-hook-form": "^7.90.0", + "recharts": "^3.10.1", + "sonner": "^2.0.8", + "tailwind-merge": "^3.7.0", + "zod": "^4.6.7" + }, + "devDependencies": { + "@tailwindcss/vite": "^4.3.3", + "@tanstack/react-router-devtools": "^1.167.2", + "@tanstack/router-cli": "^1.167.41", + "@tanstack/router-plugin": "^1.168.43", + "@types/node": "^24.13.3", + "@types/react": "^19.2.18", + "@types/react-dom": "^19.2.7", + "@vitejs/plugin-react": "^6.1.1", + "oxlint": "^1.81.0", + "shadcn": "^4.21.4", + "tailwindcss": "^4.3.3", + "tw-animate-css": "^1.4.0", + "typescript": "~6.0.2", + "vite": "^8.3.0", + "vitest": "^5.0.4" + } +} diff --git a/apps/web/src/components/layout/app-header.tsx b/apps/web/src/components/layout/app-header.tsx new file mode 100644 index 0000000..708bebf --- /dev/null +++ b/apps/web/src/components/layout/app-header.tsx @@ -0,0 +1,42 @@ +import { useRouterState } from '@tanstack/react-router' +import { SearchIcon } from 'lucide-react' + +import { Separator } from '@/components/ui/separator' +import { SidebarTrigger } from '@/components/ui/sidebar' +import { ThemeToggle } from '@/components/theme-toggle' + +function usePageTitle() { + const pathname = useRouterState({ select: (state) => state.location.pathname }) + + if (pathname === '/') return 'Dashboard' + + const segment = pathname.split('/').filter(Boolean).at(0) ?? '' + return segment.charAt(0).toUpperCase() + segment.slice(1) +} + +export function AppHeader() { + const title = usePageTitle() + + return ( +
+
+ + +

{title}

+
+ + +
+
+
+ ) +} diff --git a/apps/web/src/components/layout/app-sidebar.tsx b/apps/web/src/components/layout/app-sidebar.tsx new file mode 100644 index 0000000..562dfbd --- /dev/null +++ b/apps/web/src/components/layout/app-sidebar.tsx @@ -0,0 +1,78 @@ +import { Link, useRouterState } from '@tanstack/react-router' +import { LayoutDashboardIcon, ListTodoIcon, SettingsIcon } from 'lucide-react' +import type { LucideIcon } from 'lucide-react' + +import { NavUser } from '@/components/layout/nav-user' +import { + Sidebar, + SidebarContent, + SidebarFooter, + SidebarGroup, + SidebarGroupLabel, + SidebarHeader, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, + SidebarRail, +} from '@/components/ui/sidebar' + +type NavItem = { + title: string + to: string + icon: LucideIcon +} + +const NAV_ITEMS: NavItem[] = [ + { title: 'Dashboard', to: '/', icon: LayoutDashboardIcon }, + { title: 'Tasks', to: '/tasks', icon: ListTodoIcon }, + { title: 'Settings', to: '/settings', icon: SettingsIcon }, +] + +export function AppSidebar() { + const pathname = useRouterState({ select: (state) => state.location.pathname }) + + return ( + + + + + + +
+ SL +
+
+ Superlist + Admin +
+ +
+
+
+
+ + + + Platform + + {NAV_ITEMS.map((item) => ( + + + + + {item.title} + + + + ))} + + + + + + + + +
+ ) +} diff --git a/apps/web/src/components/layout/nav-user.tsx b/apps/web/src/components/layout/nav-user.tsx new file mode 100644 index 0000000..f8df1c5 --- /dev/null +++ b/apps/web/src/components/layout/nav-user.tsx @@ -0,0 +1,100 @@ +import { useNavigate } from '@tanstack/react-router' +import { ChevronsUpDownIcon, LogOutIcon, UserIcon } from 'lucide-react' + +import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from '@/components/ui/dropdown-menu' +import { + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, + useSidebar, +} from '@/components/ui/sidebar' +import { signOut, useSession } from '@/lib/auth-client' + +function initials(name: string) { + return name + .split(' ') + .map((part) => part[0]) + .filter(Boolean) + .slice(0, 2) + .join('') + .toUpperCase() +} + +export function NavUser() { + const { isMobile } = useSidebar() + const { data: session } = useSession() + const navigate = useNavigate() + + const user = session?.user + const name = user?.name ?? 'Signed out' + const email = user?.email ?? '' + + return ( + + + + + + + + {initials(name) || '?'} + +
+ {name} + {email} +
+ +
+
+ + +
+ + {initials(name) || '?'} + +
+ {name} + {email} +
+
+
+ + + void navigate({ to: '/settings' })}> + + Account + + + + { + await signOut() + await navigate({ to: '/sign-in' }) + }} + > + + Sign out + +
+
+
+
+ ) +} diff --git a/apps/web/src/components/theme-provider.tsx b/apps/web/src/components/theme-provider.tsx new file mode 100644 index 0000000..1028b06 --- /dev/null +++ b/apps/web/src/components/theme-provider.tsx @@ -0,0 +1,11 @@ +import { ThemeProvider as NextThemesProvider } from 'next-themes' +import type { ComponentProps } from 'react' + +/** Wraps `next-themes` so the theme is toggled by a class on ``. */ +export function ThemeProvider({ children, ...props }: ComponentProps) { + return ( + + {children} + + ) +} diff --git a/apps/web/src/components/theme-toggle.tsx b/apps/web/src/components/theme-toggle.tsx new file mode 100644 index 0000000..5e8d8ab --- /dev/null +++ b/apps/web/src/components/theme-toggle.tsx @@ -0,0 +1,39 @@ +import { MonitorIcon, MoonIcon, SunIcon } from 'lucide-react' +import { useTheme } from 'next-themes' + +import { Button } from '@/components/ui/button' +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from '@/components/ui/dropdown-menu' + +const OPTIONS = [ + { value: 'light', label: 'Light', icon: SunIcon }, + { value: 'dark', label: 'Dark', icon: MoonIcon }, + { value: 'system', label: 'System', icon: MonitorIcon }, +] as const + +export function ThemeToggle() { + const { setTheme } = useTheme() + + return ( + + + + + + {OPTIONS.map(({ value, label, icon: Icon }) => ( + setTheme(value)}> + + {label} + + ))} + + + ) +} diff --git a/apps/web/src/components/ui/alert.tsx b/apps/web/src/components/ui/alert.tsx new file mode 100644 index 0000000..17ba728 --- /dev/null +++ b/apps/web/src/components/ui/alert.tsx @@ -0,0 +1,75 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" +import { cn } from "cn" + +const alertVariants = cva( + "group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", + { + variants: { + variant: { + default: "bg-card text-card-foreground", + destructive: + "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +function Alert({ + className, + variant, + ...props +}: React.ComponentProps<"div"> & VariantProps) { + return ( +
+ ) +} + +function AlertTitle({ className, ...props }: React.ComponentProps<"div">) { + return ( +
svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground", + className + )} + {...props} + /> + ) +} + +function AlertDescription({ + className, + ...props +}: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function AlertAction({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +export { Alert, AlertTitle, AlertDescription, AlertAction } diff --git a/apps/web/src/components/ui/avatar.tsx b/apps/web/src/components/ui/avatar.tsx new file mode 100644 index 0000000..89328b4 --- /dev/null +++ b/apps/web/src/components/ui/avatar.tsx @@ -0,0 +1,109 @@ +import * as React from "react" +import { cn } from "cn" +import { Avatar as AvatarPrimitive } from "radix-ui" + +function Avatar({ + className, + size = "default", + ...props +}: React.ComponentProps & { + size?: "default" | "sm" | "lg" +}) { + return ( + + ) +} + +function AvatarImage({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarFallback({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) { + return ( + svg]:hidden", + "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", + "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", + className + )} + {...props} + /> + ) +} + +function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function AvatarGroupCount({ + className, + ...props +}: React.ComponentProps<"div">) { + return ( +
svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", + className + )} + {...props} + /> + ) +} + +export { + Avatar, + AvatarImage, + AvatarFallback, + AvatarGroup, + AvatarGroupCount, + AvatarBadge, +} diff --git a/apps/web/src/components/ui/badge.tsx b/apps/web/src/components/ui/badge.tsx new file mode 100644 index 0000000..837196c --- /dev/null +++ b/apps/web/src/components/ui/badge.tsx @@ -0,0 +1,48 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" +import { cn } from "cn" +import { Slot } from "radix-ui" + +const badgeVariants = cva( + "group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", + { + variants: { + variant: { + default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80", + secondary: + "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80", + destructive: + "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20", + outline: + "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground", + ghost: + "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50", + link: "text-primary underline-offset-4 hover:underline", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +function Badge({ + className, + variant = "default", + asChild = false, + ...props +}: React.ComponentProps<"span"> & + VariantProps & { asChild?: boolean }) { + const Comp = asChild ? Slot.Root : "span" + + return ( + + ) +} + +export { Badge, badgeVariants } diff --git a/apps/web/src/components/ui/breadcrumb.tsx b/apps/web/src/components/ui/breadcrumb.tsx new file mode 100644 index 0000000..a522888 --- /dev/null +++ b/apps/web/src/components/ui/breadcrumb.tsx @@ -0,0 +1,121 @@ +import * as React from "react" +import { cn } from "cn" +import { Slot } from "radix-ui" +import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react" + +function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) { + return ( +