Skip to content

Commit 88351bb

Browse files
feat: migrate to new shadcn
1 parent 50695af commit 88351bb

48 files changed

Lines changed: 5435 additions & 2035 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://ui.shadcn.com/schema.json",
3-
"style": "default",
3+
"style": "base-nova",
44
"rsc": true,
55
"tsx": true,
66
"tailwind": {
@@ -10,12 +10,16 @@
1010
"cssVariables": true,
1111
"prefix": ""
1212
},
13+
"iconLibrary": "lucide",
14+
"rtl": false,
1315
"aliases": {
1416
"components": "@/components",
15-
"utils": "@/lib/utils",
17+
"utils": "@/lib/utils/shadcn",
1618
"ui": "@/components/ui",
1719
"lib": "@/lib",
1820
"hooks": "@/hooks"
1921
},
20-
"iconLibrary": "lucide"
22+
"menuColor": "default",
23+
"menuAccent": "subtle",
24+
"registries": {}
2125
}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"typecheck": "tsc --noEmit"
1414
},
1515
"dependencies": {
16+
"@base-ui/react": "^1.3.0",
1617
"@better-auth/passkey": "^1.5.5",
1718
"@hookform/resolvers": "^3.9.1",
1819
"@polinetwork/backend": "^0.15.5",
@@ -41,11 +42,13 @@
4142
"react-error-boundary": "^6.1.0",
4243
"react-hook-form": "^7.55.0",
4344
"server-only": "^0.0.1",
45+
"shadcn": "^4.2.0",
4446
"sonner": "^2.0.3",
4547
"superjson": "^2.2.1",
4648
"tailwind-merge": "^3.0.1",
4749
"tailwind-scrollbar": "^4.0.2",
4850
"tailwindcss-animate": "^1.0.7",
51+
"tw-animate-css": "^1.4.0",
4952
"zod": "^4.3.5"
5053
},
5154
"devDependencies": {

pnpm-lock.yaml

Lines changed: 2866 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/(auth)/onboarding/link/telegram.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Code } from "@/components/code"
88
import { InputWithPrefix } from "@/components/input-prefix"
99
import { Button } from "@/components/ui/button"
1010
import { Label } from "@/components/ui/label"
11-
import { Progress } from "@/components/ui/progress"
11+
import { Progress, ProgressIndicator, ProgressTrack } from "@/components/ui/progress"
1212
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"
1313
import { useLocalStorage } from "@/hooks/use-local-storage"
1414
import { auth, useSession } from "@/lib/auth"
@@ -143,8 +143,8 @@ export function TelegramLink({ botUsername }: { botUsername: string }) {
143143
<Timer ttl={savedLink.ttl} timeLeft={timeLeft} onEnd={() => setExpired(true)} />
144144

145145
<div className="flex items-center gap-2">
146-
<Tooltip delayDuration={0}>
147-
<TooltipTrigger asChild>
146+
<Tooltip>
147+
<TooltipTrigger delay={0}>
148148
<Button variant="outline">
149149
<a aria-label="open telegram bot" href={`tg://resolve?domain=${botUsername}`}>
150150
Start the bot
@@ -211,11 +211,11 @@ function Timer({ ttl, timeLeft: pTimeLeft, onEnd }: { ttl: number; timeLeft: num
211211

212212
return (
213213
<>
214-
<Progress
215-
value={percentage}
216-
className="h-2 w-64"
217-
indicatorClassname={timeLeft < 31_000 ? "bg-red-600 dark:bg-red-400" : "bg-primary"}
218-
/>
214+
<Progress value={percentage} className="h-2 w-64">
215+
<ProgressTrack>
216+
<ProgressIndicator className={timeLeft < 31_000 ? "bg-red-600 dark:bg-red-400" : "bg-primary"} />
217+
</ProgressTrack>
218+
</Progress>
219219
<span className="text-foreground/70 text-sm">
220220
Time left:
221221
<span className="inline-block w-10 text-end">{Math.floor(timeLeft / 1000)}s</span>

src/app/dashboard/(active)/account/delete-passkey.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function DeletePasskey({ id }: { id: string }) {
3030

3131
return (
3232
<AlertDialog>
33-
<AlertDialogTrigger asChild>
33+
<AlertDialogTrigger>
3434
<Button variant="destructive">Delete</Button>
3535
</AlertDialogTrigger>
3636
<AlertDialogContent size="sm">

src/app/dashboard/(active)/account/set-name.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function SetName({ initialName }: { initialName?: string }) {
3131

3232
return (
3333
<Dialog open={open} onOpenChange={setOpen}>
34-
<DialogTrigger asChild>
34+
<DialogTrigger>
3535
<Button variant="outline">Set name</Button>
3636
</DialogTrigger>
3737
<DialogContent className="sm:max-w-[425px]">
@@ -54,7 +54,7 @@ export function SetName({ initialName }: { initialName?: string }) {
5454
</div>
5555
</div>
5656
<DialogFooter>
57-
<DialogClose asChild>
57+
<DialogClose>
5858
<Button variant="outline">Cancel</Button>
5959
</DialogClose>
6060
<Button type="submit">Save changes</Button>

src/app/dashboard/(active)/assoc/_components/set-assoc-number-dialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function SetAssocNumberDialog({ userId, children }: { userId: string; chi
5252

5353
return (
5454
<Dialog onOpenChange={handleOpenChange} open={open}>
55-
<DialogTrigger asChild>{children ?? <Button variant="outline">Set</Button>}</DialogTrigger>
55+
<DialogTrigger>{children ?? <Button variant="outline">Set</Button>}</DialogTrigger>
5656
<DialogContent className="sm:max-w-sm">
5757
<DialogHeader>
5858
<DialogTitle>Set Assoc Number</DialogTitle>
@@ -75,7 +75,7 @@ export function SetAssocNumberDialog({ userId, children }: { userId: string; chi
7575
/>
7676
</div>
7777
<DialogFooter>
78-
<DialogClose asChild>
78+
<DialogClose>
7979
<Button disabled={isPending} variant="outline">
8080
Cancel
8181
</Button>

src/app/layout.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import type { Metadata } from "next"
2-
import { Poppins } from "next/font/google"
2+
import { Poppins, Geist } from "next/font/google"
33
import "@/index.css"
44
import { HEADER_HEIGHT } from "@/components/header"
55
import { ThemeProvider } from "@/components/theme-provider"
66
import { Toaster } from "@/components/ui/sonner"
77
import { TooltipProvider } from "@/components/ui/tooltip"
88
import { TRPCReactProvider } from "@/lib/trpc/client"
99
import { HydrateClient } from "@/lib/trpc/server"
10+
import { cn } from "@/lib/utils/shadcn"
11+
12+
const geist = Geist({ subsets: ["latin"], variable: "--font-sans" })
1013

1114
const desc = "PoliNetwork Admin Dashboard"
1215

@@ -23,7 +26,7 @@ const poppins = Poppins({ weight: ["100", "200", "300", "400", "500", "600", "70
2326

2427
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
2528
return (
26-
<html lang="en" suppressHydrationWarning className={poppins.className}>
29+
<html lang="en" suppressHydrationWarning className={cn(poppins.className, "font-sans", geist.variable)}>
2730
<body
2831
style={
2932
{

src/components/code.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { type MouseEvent, type ReactNode, useCallback, useRef } from "react"
44
import { toast } from "sonner"
5-
import { cn } from "@/lib/utils"
5+
import { cn } from "@/lib/utils/shadcn"
66

77
type Props = React.HTMLAttributes<HTMLElement> & {
88
block?: boolean
@@ -27,18 +27,18 @@ export function Code({ block = false, copyOnClick = false, children, className,
2727

2828
const InteractiveWrapper = copyOnClick
2929
? ({ children: content }: { children: ReactNode }) => (
30-
<button
31-
type="button"
32-
onClick={copy}
33-
className={cn(
34-
"appearance-none border-0 bg-transparent p-0 text-left outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
35-
block ? "block w-full" : "inline"
36-
)}
37-
aria-label={block ? "Copy code block" : "Copy code"}
38-
>
39-
{content}
40-
</button>
41-
)
30+
<button
31+
type="button"
32+
onClick={copy}
33+
className={cn(
34+
"appearance-none border-0 bg-transparent p-0 text-left outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
35+
block ? "block w-full" : "inline"
36+
)}
37+
aria-label={block ? "Copy code block" : "Copy code"}
38+
>
39+
{content}
40+
</button>
41+
)
4242
: ({ children: content }: { children: ReactNode }) => <>{content}</>
4343

4444
if (block) {

src/components/create-assoc-member.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function CreateAssocUser({ trigger }: Props) {
5858

5959
return (
6060
<Sheet open={open} onOpenChange={handleOpenChange}>
61-
<SheetTrigger asChild>{trigger ?? <Button variant="outline">New Member</Button>}</SheetTrigger>
61+
<SheetTrigger>{trigger ?? <Button variant="outline">New Member</Button>}</SheetTrigger>
6262
<SheetContent className="sm:max-w-[40rem]">
6363
<SheetHeader>
6464
<SheetTitle>New Assoc Member</SheetTitle>
@@ -124,7 +124,7 @@ export function CreateAssocUser({ trigger }: Props) {
124124
</div>
125125
</div>
126126
<SheetFooter className="mt-4">
127-
<SheetClose asChild>
127+
<SheetClose>
128128
<Button variant="secondary" disabled={isPending}>
129129
Cancel
130130
</Button>

0 commit comments

Comments
 (0)