Skip to content

Commit

Permalink
cleanup cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguyinabeanie committed Nov 8, 2024
1 parent cb36e65 commit 331a10d
Show file tree
Hide file tree
Showing 13 changed files with 1,729 additions and 564 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"cSpell.words": [
"articifial",
"compat",
"Embla",
"ianvs",
"jiti",
"jullerino",
Expand Down
168 changes: 0 additions & 168 deletions apps/nextjs/src/app/_components/posts.tsx

This file was deleted.

10 changes: 4 additions & 6 deletions apps/nextjs/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { GeistSans } from "geist/font/sans";

import { cn } from "@battle-stadium/ui";
import { ThemeProvider, ThemeToggle } from "@battle-stadium/ui/theme";
import { Toaster } from "@battle-stadium/ui/toast";

import { TRPCReactProvider } from "~/trpc/react";

Expand Down Expand Up @@ -40,24 +39,23 @@ export const viewport: Viewport = {
],
};

export default function RootLayout (
export default function RootLayout(
props: Readonly<{ children: React.ReactNode }>,
) {
return (
<html lang="en" suppressHydrationWarning>
<body
className={ cn(
className={cn(
"min-h-screen bg-background font-sans text-foreground antialiased",
GeistSans.variable,
GeistMono.variable,
) }
)}
>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<TRPCReactProvider>{ props.children }</TRPCReactProvider>
<TRPCReactProvider>{props.children}</TRPCReactProvider>
<div className="absolute bottom-4 right-4">
<ThemeToggle />
</div>
<Toaster />
</ThemeProvider>
</body>
</html>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"tsx": true,
"tailwind": {
"config": "../../tooling/tailwind/web.ts",
"css": "unused.css",
"css": "./src/globals.css",
"baseColor": "zinc",
"cssVariables": true
},
Expand Down
41 changes: 37 additions & 4 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,49 @@
},
"prettier": "@battle-stadium/prettier-config",
"dependencies": {
"@hookform/resolvers": "^3.9.0",
"@hookform/resolvers": "^3.9.1",
"@radix-ui/react-accordion": "^1.2.1",
"@radix-ui/react-alert-dialog": "^1.1.2",
"@radix-ui/react-aspect-ratio": "^1.1.0",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-collapsible": "^1.1.1",
"@radix-ui/react-context-menu": "^2.2.2",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-hover-card": "^1.1.2",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-menubar": "^1.1.2",
"@radix-ui/react-navigation-menu": "^1.2.1",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-progress": "^1.1.0",
"@radix-ui/react-radio-group": "^1.2.1",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slider": "^1.2.1",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-toast": "^1.2.2",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.3",
"class-variance-authority": "^0.7.0",
"cmdk": "1.0.0",
"date-fns": "^4.1.0",
"embla-carousel-react": "^8.3.1",
"input-otp": "^1.4.1",
"lucide-react": "^0.454.0",
"next-themes": "^0.3.0",
"react-hook-form": "^7.53.0",
"sonner": "^1.5.0",
"tailwind-merge": "^2.5.4"
"react-day-picker": "8.10.1",
"react-hook-form": "^7.53.1",
"react-resizable-panels": "^2.1.6",
"recharts": "^2.13.3",
"sonner": "^1.7.0",
"tailwind-merge": "^2.5.4",
"vaul": "^1.1.1"
},
"devDependencies": {
"@battle-stadium/eslint-config": "workspace:*",
Expand Down
16 changes: 8 additions & 8 deletions packages/ui/src/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva } from "class-variance-authority";

import { cn } from "@battle-stadium/ui";
import { cn } from ".";

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",
"inline-flex items-center justify-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
{
variants: {
variant: {
primary:
default:
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
destructive:
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
Expand All @@ -22,20 +22,20 @@ const buttonVariants = cva(
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",
md: "h-9 px-4 py-2",
lg: "h-10 rounded-md px-8",
icon: "size-9",
icon: "h-9 w-9",
},
},
defaultVariants: {
variant: "primary",
size: "md",
variant: "default",
size: "default",
},
},
);

interface ButtonProps
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
Expand Down
21 changes: 13 additions & 8 deletions packages/ui/src/dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ import {
DotFilledIcon,
} from "@radix-ui/react-icons";

import { cn } from "@battle-stadium/ui";
import { cn } from ".";

const DropdownMenu = DropdownMenuPrimitive.Root;

const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;

const DropdownMenuGroup = DropdownMenuPrimitive.Group;

const DropdownMenuPortal = DropdownMenuPrimitive.Portal;

const DropdownMenuSub = DropdownMenuPrimitive.Sub;

const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;

const DropdownMenuSubTrigger = React.forwardRef<
Expand All @@ -26,14 +31,14 @@ const DropdownMenuSubTrigger = React.forwardRef<
<DropdownMenuPrimitive.SubTrigger
ref={ref}
className={cn(
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
inset && "pl-8",
className,
)}
{...props}
>
{children}
<ChevronRightIcon className="ml-auto size-4" />
<ChevronRightIcon className="ml-auto" />
</DropdownMenuPrimitive.SubTrigger>
));
DropdownMenuSubTrigger.displayName =
Expand Down Expand Up @@ -83,7 +88,7 @@ const DropdownMenuItem = React.forwardRef<
<DropdownMenuPrimitive.Item
ref={ref}
className={cn(
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
inset && "pl-8",
className,
)}
Expand All @@ -105,9 +110,9 @@ const DropdownMenuCheckboxItem = React.forwardRef<
checked={checked}
{...props}
>
<span className="absolute left-2 flex size-3.5 items-center justify-center">
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<DropdownMenuPrimitive.ItemIndicator>
<CheckIcon className="size-4" />
<CheckIcon className="h-4 w-4" />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
Expand All @@ -128,9 +133,9 @@ const DropdownMenuRadioItem = React.forwardRef<
)}
{...props}
>
<span className="absolute left-2 flex size-3.5 items-center justify-center">
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<DropdownMenuPrimitive.ItemIndicator>
<DotFilledIcon className="size-4 fill-current" />
<DotFilledIcon className="h-2 w-2 fill-current" />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
Expand Down
Loading

0 comments on commit 331a10d

Please sign in to comment.