Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

πŸ§‘β€πŸ’» dx: add prettier

Dillion Vermad55c2b143e1a
diff --git a/.eslintrc.json b/.eslintrc.json
index 9413ce81..03a8007e 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -6,4 +6,4 @@
"plugin:tailwindcss/recommended"
],
"plugins": ["tailwindcss"]
-}
\ No newline at end of file
+}
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000..a7d6bd6a
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,3 @@
+yarn.lock
+node_modules
+.next
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 00000000..1eaba3d7
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,8 @@
+{
+ "bracketSpacing": true,
+ "semi": true,
+ "trailingComma": "all",
+ "printWidth": 80,
+ "tabWidth": 2,
+ "plugins": ["prettier-plugin-tailwindcss"]
+}
diff --git a/app/(auth)/login/page.tsx b/app/(auth)/login/page.tsx
index 485c36d6..a67efb77 100644
--- a/app/(auth)/login/page.tsx
+++ b/app/(auth)/login/page.tsx
@@ -17,7 +17,7 @@ export default function LoginPage() {
href="/"
className={cn(
buttonVariants({ variant: "ghost" }),
- "absolute left-4 top-4 md:left-8 md:top-8"
+ "absolute left-4 top-4 md:left-8 md:top-8",
)}
>
<>
diff --git a/app/(auth)/register/page.tsx b/app/(auth)/register/page.tsx
index 81175d18..500f6458 100644
--- a/app/(auth)/register/page.tsx
+++ b/app/(auth)/register/page.tsx
@@ -17,7 +17,7 @@ export default function RegisterPage() {
href="/login"
className={cn(
buttonVariants({ variant: "ghost" }),
- "absolute right-4 top-4 md:right-8 md:top-8"
+ "absolute right-4 top-4 md:right-8 md:top-8",
)}
>
Login
diff --git a/app/(docs)/components/[slug]/page.tsx b/app/(docs)/components/[slug]/page.tsx
index 66ff2683..91a6ed14 100644
--- a/app/(docs)/components/[slug]/page.tsx
+++ b/app/(docs)/components/[slug]/page.tsx
@@ -31,7 +31,7 @@ export async function generateMetadata({
params: { slug: string };
}): Promise<Metadata | undefined> {
const component = allComponents.find(
- (component) => component.slugAsParams === params.slug
+ (component) => component.slugAsParams === params.slug,
);
if (!component) {
return;
@@ -84,11 +84,11 @@ export default async function Component({ params }: Props) {
const { payments } = await getUserPayments(user?.id!);
const paid = payments.some(
- (payment: Payment) => payment.status === "succeeded"
+ (payment: Payment) => payment.status === "succeeded",
);
const component = allComponents.find(
- (component) => component.slugAsParams === params.slug
+ (component) => component.slugAsParams === params.slug,
);
if (!component) {
notFound();
@@ -152,7 +152,7 @@ export default async function Component({ params }: Props) {
</div>
</div>
- <div className="flex flex-col pt-8 gap-4">
+ <div className="flex flex-col gap-4 pt-8">
{/* {component.video && (
<div className="flex md:hidden overflow-hidden relative rounded-xl border dark:border-slate-800 md:p-8 justify-center items-center flex-col max-w-[65ch]">
<video
diff --git a/app/(docs)/components/page.tsx b/app/(docs)/components/page.tsx
index 5618aa0d..e3dbc591 100644
--- a/app/(docs)/components/page.tsx
+++ b/app/(docs)/components/page.tsx
@@ -21,7 +21,7 @@ export default async function ComponentPage() {
<div className="container max-w-4xl py-6 lg:py-10">
<div className="flex flex-col items-start gap-4 md:flex-row md:justify-between md:gap-8">
<div className="flex-1 space-y-4">
- <h1 className="inline-block font-medium text-4xl lg:text-5xl">
+ <h1 className="inline-block text-4xl font-medium lg:text-5xl">
Components
</h1>
<p className="text-xl text-muted-foreground">
@@ -36,7 +36,7 @@ export default async function ComponentPage() {
<FadeIn key={post._id} delay={index * 0.1}>
<article
key={post._id}
- className="group relative flex grow flex-col w-full h-full overflow-hidden rounded-xl border hover:border-gray-300 dark:border-gray-800 dark:hover:border-gray-700 transition-all duration-300 bg-background"
+ className="group relative flex h-full w-full grow flex-col overflow-hidden rounded-xl border bg-background transition-all duration-300 hover:border-gray-300 dark:border-gray-800 dark:hover:border-gray-700"
>
{post.video && (
<div className="overflow-hidden">
@@ -50,7 +50,7 @@ export default async function ComponentPage() {
/>
</div>
)}
- <div className="flex flex-1 justify-end flex-col p-3">
+ <div className="flex flex-1 flex-col justify-end p-3">
<h2>{post.title}</h2>
{/* {post.date && (
<p className="text-sm text-gray-500">
diff --git a/app/(docs)/layout.tsx b/app/(docs)/layout.tsx
index 121f449f..45e8bd9a 100644
--- a/app/(docs)/layout.tsx
+++ b/app/(docs)/layout.tsx
@@ -15,13 +15,13 @@ export default async function MarketingLayout({
const user = await getCurrentUser();
return (
- <div className="flex min-h-screen flex-col relative">
+ <div className="relative flex min-h-screen flex-col">
<SiteHeader user={user} />
<main className="flex-1">{children}</main>
<SiteFooter />
{/* Top Ellipse Gradient */}
- <div className="pointer-events-none h-screen absolute inset-0 dark:bg-[radial-gradient(ellipse_80%_50%_at_50%_-20%,rgba(120,119,198,0.2),rgba(255,255,255,0))]" />
+ <div className="pointer-events-none absolute inset-0 h-screen dark:bg-[radial-gradient(ellipse_80%_50%_at_50%_-20%,rgba(120,119,198,0.2),rgba(255,255,255,0))]" />
{/* Grid Pattern */}
<GridPattern
@@ -30,15 +30,15 @@ export default async function MarketingLayout({
x={-1}
y={-1}
className={cn(
- "absolute w-screen h-screen inset-0 stroke-white/10 fill-white/10",
- "[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)] -z-50",
- "skew-y-12 inset-x-0 -top-[4rem] -z-50"
+ "absolute inset-0 h-screen w-screen fill-white/10 stroke-white/10",
+ "-z-50 [mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)]",
+ "inset-x-0 -top-[4rem] -z-50 skew-y-12",
)}
/>
{/* Linear Gradient */}
<LinearGradient
- className="w-screen h-screen"
+ className="h-screen w-screen"
from="rgba(120,119,198,0.1)"
to="rgba(0,0,0,0.0)"
direction="bottom right"
diff --git a/app/(docs)/templates/page.tsx b/app/(docs)/templates/page.tsx
index a3264e53..40be92fd 100644
--- a/app/(docs)/templates/page.tsx
+++ b/app/(docs)/templates/page.tsx
@@ -15,7 +15,7 @@ export default async function TemplatePage() {
<div className="container max-w-4xl py-6 lg:py-10">
<div className="flex flex-col items-start gap-4 md:flex-row md:justify-between md:gap-8">
<div className="flex-1 space-y-4">
- <h1 className="inline-block font-heading text-4xl tracking-tight lg:text-5xl">
+ <h1 className="font-heading inline-block text-4xl tracking-tight lg:text-5xl">
Templates
</h1>
<p className="text-xl text-muted-foreground">
@@ -30,7 +30,7 @@ export default async function TemplatePage() {
<FadeIn key={post._id} delay={index * 0.1}>
<article
key={post._id}
- className="group relative space-y-2 flex grow flex-col overflow-hidden rounded-xl border hover:border-gray-300 dark:border-gray-800 dark:hover:border-gray-700 transition-all duration-300"
+ className="group relative flex grow flex-col space-y-2 overflow-hidden rounded-xl border transition-all duration-300 hover:border-gray-300 dark:border-gray-800 dark:hover:border-gray-700"
>
{post.image && (
<video
diff --git a/app/(marketing)/[...slug]/page.tsx b/app/(marketing)/[...slug]/page.tsx
index ec4bdfc3..03f929d6 100644
--- a/app/(marketing)/[...slug]/page.tsx
+++ b/app/(marketing)/[...slug]/page.tsx
@@ -82,7 +82,7 @@ export default async function PagePage({ params }: PageProps) {
return (
<article className="container max-w-3xl py-6 lg:py-12">
<div className="space-y-4">
- <h1 className="inline-block font-heading text-4xl lg:text-5xl">
+ <h1 className="font-heading inline-block text-4xl lg:text-5xl">
{page.title}
</h1>
{page.description && (
diff --git a/app/(marketing)/layout.tsx b/app/(marketing)/layout.tsx
index 121f449f..45e8bd9a 100644
--- a/app/(marketing)/layout.tsx
+++ b/app/(marketing)/layout.tsx
@@ -15,13 +15,13 @@ export default async function MarketingLayout({
const user = await getCurrentUser();
return (
- <div className="flex min-h-screen flex-col relative">
+ <div className="relative flex min-h-screen flex-col">
<SiteHeader user={user} />
<main className="flex-1">{children}</main>
<SiteFooter />
{/* Top Ellipse Gradient */}
- <div className="pointer-events-none h-screen absolute inset-0 dark:bg-[radial-gradient(ellipse_80%_50%_at_50%_-20%,rgba(120,119,198,0.2),rgba(255,255,255,0))]" />
+ <div className="pointer-events-none absolute inset-0 h-screen dark:bg-[radial-gradient(ellipse_80%_50%_at_50%_-20%,rgba(120,119,198,0.2),rgba(255,255,255,0))]" />
{/* Grid Pattern */}
<GridPattern
@@ -30,15 +30,15 @@ export default async function MarketingLayout({
x={-1}
y={-1}
className={cn(
- "absolute w-screen h-screen inset-0 stroke-white/10 fill-white/10",
- "[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)] -z-50",
- "skew-y-12 inset-x-0 -top-[4rem] -z-50"
+ "absolute inset-0 h-screen w-screen fill-white/10 stroke-white/10",
+ "-z-50 [mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)]",
+ "inset-x-0 -top-[4rem] -z-50 skew-y-12",
)}
/>
{/* Linear Gradient */}
<LinearGradient
- className="w-screen h-screen"
+ className="h-screen w-screen"
from="rgba(120,119,198,0.1)"
to="rgba(0,0,0,0.0)"
direction="bottom right"
diff --git a/app/(marketing)/not-found.tsx b/app/(marketing)/not-found.tsx
index 5bb587e6..61a66312 100644
--- a/app/(marketing)/not-found.tsx
+++ b/app/(marketing)/not-found.tsx
@@ -9,10 +9,10 @@ export default function NotFound() {
const router = useRouter();
return (
<section>
- <div className="container flex items-center min-h-[calc(100vh-8rem)] px-6 py-12 mx-auto">
- <div className="flex flex-col items-center max-w-sm mx-auto text-center">
- <p className="p-3 text-sm font-medium rounded-full bg-blue-50 dark:bg-gray-800">
- <Icons.warning className="w-6 h-6" />
+ <div className="container mx-auto flex min-h-[calc(100vh-8rem)] items-center px-6 py-12">
+ <div className="mx-auto flex max-w-sm flex-col items-center text-center">
+ <p className="rounded-full bg-blue-50 p-3 text-sm font-medium dark:bg-gray-800">
+ <Icons.warning className="h-6 w-6" />
</p>
<h1 className="mt-3 text-2xl font-semibold text-gray-800 dark:text-white md:text-3xl">
Page not found
@@ -21,12 +21,12 @@ export default function NotFound() {
The page you are looking for doesn&apos;t exist.
</p>
- <div className="flex items-center w-full mt-6 gap-x-3 shrink-0 sm:w-auto group">
+ <div className="group mt-6 flex w-full shrink-0 items-center gap-x-3 sm:w-auto">
<Button
onClick={() => router.back()}
className={buttonVariants({ variant: "secondary" })}
>
- <Icons.chevronLeft className="w-4 h-4 group-hover:-translate-x-1 transition-transform" />
+ <Icons.chevronLeft className="h-4 w-4 transition-transform group-hover:-translate-x-1" />
<span>Go back</span>
</Button>
diff --git a/app/(marketing)/page.tsx b/app/(marketing)/page.tsx
index 69848bc0..b893447c 100644
--- a/app/(marketing)/page.tsx
+++ b/app/(marketing)/page.tsx
@@ -37,7 +37,7 @@ async function getTweets() {
tweetUrls.map(async (id) => {
const tweet = await getTweet(id);
return tweet;
- })
+ }),
);
return tweets.length ? { props: { tweets } } : { notFound: true };
} catch (error) {
@@ -54,13 +54,13 @@ export default async function Home() {
<>
<section className="space-y-6 pb-8 pt-20 md:pb-12">
<div className="container flex max-w-[64rem] flex-col items-center gap-4 text-center">
- <FadeIn className="z-10 flex flex-col items-center justify-center w-full h-full">
+ <FadeIn className="z-10 flex h-full w-full flex-col items-center justify-center">
<Link
href="/components/marquee"
className={cn(
- "relative flex justify-center items-center flex-row",
+ "relative flex flex-row items-center justify-center",
"rounded-2xl px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#8fdfff1f]",
- "transition-shadow hover:shadow-[inset_0_-5px_10px_#8fdfff3f] ease-out duration-500"
+ "transition-shadow duration-500 ease-out hover:shadow-[inset_0_-5px_10px_#8fdfff3f]",
)}
style={
{
@@ -71,26 +71,26 @@ export default async function Home() {
πŸŽ‰ <Separator className="mx-2 h-4" orientation="vertical" />{" "}
<span
className={cn(
- `bg-clip-text text-transparent bg-gradient-to-r from-[#ffaa40] via-[#9c40ff] to-[#ffaa40] animate-gradient bg-[length:var(--bg-size)_100%]`,
- `inline`
+ `animate-gradient bg-gradient-to-r from-[#ffaa40] via-[#9c40ff] to-[#ffaa40] bg-[length:var(--bg-size)_100%] bg-clip-text text-transparent`,
+ `inline`,
)}
>
Introducing Marquee
</span>
<ChevronRight className="ml-1 h-4 w-4 text-gray-500" />
- <div className="block w-full h-full absolute inset-0 p-[1px] [border-radius:inherit] bg-gradient-to-r from-[#ffaa40]/50 via-[#9c40ff]/50 to-[#ffaa40]/50 [mask:linear-gradient(#fff_0_0)_content-box,linear-gradient(#fff_0_0)] [mask-composite:xor] [-webkit-mask-composite:xor] animate-gradient bg-[length:var(--bg-size)_100%]" />
+ <div className="absolute inset-0 block h-full w-full animate-gradient bg-gradient-to-r from-[#ffaa40]/50 via-[#9c40ff]/50 to-[#ffaa40]/50 bg-[length:var(--bg-size)_100%] p-[1px] [-webkit-mask-composite:xor] [border-radius:inherit] [mask-composite:xor] [mask:linear-gradient(#fff_0_0)_content-box,linear-gradient(#fff_0_0)]" />
</Link>
</FadeIn>
<FadeIn
// delay={0.0}
- className="z-10 flex flex-col items-center justify-center w-full h-full"
+ className="z-10 flex h-full w-full flex-col items-center justify-center"
>
- <h1 className="font-medium text-5xl sm:text-6xl md:text-7xl lg:text-9xl tracking-tight">
+ <h1 className="text-5xl font-medium tracking-tight sm:text-6xl md:text-7xl lg:text-9xl">
Create Magical <br /> Landing Pages
</h1>
</FadeIn>
<FadeIn
- className="z-10 flex flex-col items-center justify-center w-full h-full"
+ className="z-10 flex h-full w-full flex-col items-center justify-center"
delay={0.1}
>
<p className="max-w-[42rem] leading-normal text-muted-foreground sm:text-xl sm:leading-8">
@@ -99,10 +99,10 @@ export default async function Home() {
</p>
</FadeIn>
<FadeIn
- className="z-10 flex flex-col items-center justify-center w-full h-full"
+ className="z-10 flex h-full w-full flex-col items-center justify-center"
delay={0.2}
>
- <div className="flex flex-col md:flex-row gap-4">
+ <div className="flex flex-col gap-4 md:flex-row">
<Link
href="/pricing"
className={cn(buttonVariants({ size: "lg" }))}
@@ -112,7 +112,7 @@ export default async function Home() {
<Link
href="/components"
className={cn(
- buttonVariants({ variant: "outline", size: "lg" })
+ buttonVariants({ variant: "outline", size: "lg" }),
)}
>
Get Started
@@ -123,19 +123,19 @@ export default async function Home() {
</section>
<section className="relative flex flex-col gap-4 pb-8 pt-20 md:pb-12">
- <Marquee className="[--duration:120s] max-w-screen" pauseOnHover>
+ <Marquee className="max-w-screen [--duration:120s]" pauseOnHover>
{firstRow?.map((data, idx) => (
<FadeIn delay={0.06 + idx * 0.04}>
<ServerTweetCard
tweet={data}
key={idx}
- className="w-72 min-w-[18rem] h-36"
+ className="h-36 w-72 min-w-[18rem]"
/>
</FadeIn>
))}
</Marquee>
<Marquee
- className="[--duration:120s] max-w-screen"
+ className="max-w-screen [--duration:120s]"
reverse
pauseOnHover
>
@@ -144,13 +144,13 @@ export default async function Home() {
<ServerTweetCard
tweet={data}
key={idx}
- className="w-72 min-w-[18rem] h-36"
+ className="h-36 w-72 min-w-[18rem]"
/>
</FadeIn>
))}
</Marquee>
- <div className="pointer-events-none absolute inset-y-0 left-0 h-full w-1/3 bg-gradient-to-r dark:from-background from-white"></div>
- <div className="pointer-events-none absolute inset-y-0 right-0 h-full w-1/3 bg-gradient-to-l dark:from-background from-white"></div>
+ <div className="pointer-events-none absolute inset-y-0 left-0 h-full w-1/3 bg-gradient-to-r from-white dark:from-background"></div>
+ <div className="pointer-events-none absolute inset-y-0 right-0 h-full w-1/3 bg-gradient-to-l from-white dark:from-background"></div>
</section>
{/* <section
id="faq"
diff --git a/app/(marketing)/pricing/page.tsx b/app/(marketing)/pricing/page.tsx
index ff0be8c2..3148c9d5 100644
--- a/app/(marketing)/pricing/page.tsx
+++ b/app/(marketing)/pricing/page.tsx
@@ -14,7 +14,7 @@ export const metadata = constructMetadata({
export default function Buy() {
return (
<section className="py-14">
- <div className="max-w-screen-xl mx-auto px-4 md:px-8">
+ <div className="mx-auto max-w-screen-xl px-4 md:px-8">
<div className="mx-auto max-w-2xl text-center">
<FadeIn>
<h4 className="text-xl font-bold tracking-tight text-foreground">
@@ -34,7 +34,7 @@ export default function Buy() {
</p>
</FadeIn>
</div>
- <MagicContainer className="mt-16 w-full max-w-[400px] mx-auto">
+ <MagicContainer className="mx-auto mt-16 w-full max-w-[400px]">
{plans.map((item, idx) => (
<PriceCard key={idx} item={item} />
))}
diff --git a/app/api/og/route.tsx b/app/api/og/route.tsx
index 06433e4c..34245f81 100644
--- a/app/api/og/route.tsx
+++ b/app/api/og/route.tsx
@@ -4,11 +4,11 @@ import { ImageResponse } from "next/server";
export const runtime = "edge";
const interSemiBold = fetch(
- new URL("../../../assets/fonts/Inter-SemiBold.ttf", import.meta.url)
+ new URL("../../../assets/fonts/Inter-SemiBold.ttf", import.meta.url),
).then((res) => res.arrayBuffer());
const image = fetch(
- new URL("../../../assets/images/og-bg.png", import.meta.url)
+ new URL("../../../assets/images/og-bg.png", import.meta.url),
).then((res) => res.arrayBuffer());
export async function GET(req: Request) {
@@ -100,7 +100,7 @@ export async function GET(req: Request) {
weight: 400,
},
],
- }
+ },
);
} catch (e: any) {
console.log(`${e.message}`);
diff --git a/app/api/users/[userId]/route.ts b/app/api/users/[userId]/route.ts
index 611802bd..b6b528cd 100644
--- a/app/api/users/[userId]/route.ts
+++ b/app/api/users/[userId]/route.ts
@@ -12,7 +12,7 @@ const routeContextSchema = z.object({
export async function PATCH(
req: Request,
- context: z.infer<typeof routeContextSchema>
+ context: z.infer<typeof routeContextSchema>,
) {
try {
// Validate the route context.
diff --git a/app/api/webhooks/stripe/route.ts b/app/api/webhooks/stripe/route.ts
index bf7b825d..f9795b8a 100644
--- a/app/api/webhooks/stripe/route.ts
+++ b/app/api/webhooks/stripe/route.ts
@@ -71,7 +71,7 @@ export async function POST(req: Request) {
}
const customer = await upsertCustomer(
session.customer_details.email,
- session.customer_details.name || ""
+ session.customer_details.name || "",
);
await upsertPayment(session.payment_intent as string, customer.id);
diff --git a/app/layout.tsx b/app/layout.tsx
index b719ffc8..a4722763 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -25,8 +25,8 @@ export default function RootLayout({
<head />
<body
className={cn(
- "min-h-screen bg-background font-sans antialiased scroll-smooth",
- fontSans.variable
+ "min-h-screen scroll-smooth bg-background font-sans antialiased",
+ fontSans.variable,
)}
>
<SessionProvider>
diff --git a/components/code-block-wrapper.tsx b/components/code-block-wrapper.tsx
index 721ebe56..dfd6854b 100644
--- a/components/code-block-wrapper.tsx
+++ b/components/code-block-wrapper.tsx
@@ -32,7 +32,7 @@ export function CodeBlockWrapper({
<div
className={cn(
"[&_pre]:my-0 [&_pre]:max-h-[650px] [&_pre]:pb-[100px]",
- !isOpened ? "[&_pre]:overflow-hidden" : "[&_pre]:overflow-auto]"
+ !isOpened ? "[&_pre]:overflow-hidden" : "[&_pre]:overflow-auto]",
)}
>
{children}
@@ -41,7 +41,7 @@ export function CodeBlockWrapper({
<div
className={cn(
"absolute flex items-center justify-center bg-gradient-to-b from-background/10 to-background/90 p-2",
- isOpened ? "inset-x-0 bottom-0 h-12 from-gray-900/30" : "inset-0 "
+ isOpened ? "inset-x-0 bottom-0 h-12 from-gray-900/30" : "inset-0 ",
)}
>
<CollapsibleTrigger asChild>
diff --git a/components/command-menu.tsx b/components/command-menu.tsx
index 9c6a9e4f..238693c9 100644
--- a/components/command-menu.tsx
+++ b/components/command-menu.tsx
@@ -45,7 +45,7 @@ export function CommandMenu({ ...props }: DialogProps) {
<Button
variant="outline"
className={cn(
- "relative w-full justify-start text-sm text-muted-foreground sm:pr-12 md:w-40 lg:w-64"
+ "relative w-full justify-start text-sm text-muted-foreground sm:pr-12 md:w-40 lg:w-64",
)}
onClick={() => setOpen(true)}
{...props}
diff --git a/components/component-source.tsx b/components/component-source.tsx
index 0b77a48a..d9f866c6 100644
--- a/components/component-source.tsx
+++ b/components/component-source.tsx
@@ -17,7 +17,7 @@ export function ComponentSource({
const { data: session, status } = useSession();
const { data, isLoading } = useSWR(
status === "authenticated" && "/api/me",
- fetcher
+ fetcher,
);
if (status === "loading") return null;
diff --git a/components/component-wrapper.tsx b/components/component-wrapper.tsx
index e2ef8cb5..f01d614b 100644
--- a/components/component-wrapper.tsx
+++ b/components/component-wrapper.tsx
@@ -12,8 +12,8 @@ const ComponentWrapper = ({ className, children }: ComponentWrapperProps) => {
return (
<div
className={cn(
- "relative rounded-xl border md:p-10 p-10 flex justify-center items-center flex-col max-w-[65ch] not-prose",
- className
+ "not-prose relative flex max-w-[65ch] flex-col items-center justify-center rounded-xl border p-10 md:p-10",
+ className,
)}
>
{children}
@@ -21,7 +21,7 @@ const ComponentWrapper = ({ className, children }: ComponentWrapperProps) => {
<div
className={cn(
`absolute inset-0 -z-50 h-full w-full [background-size:16px_16px]`,
- `bg-[radial-gradient(#00000055_1px,transparent_1px)] dark:bg-[radial-gradient(#ffffff22_1px,transparent_1px)]`
+ `bg-[radial-gradient(#00000055_1px,transparent_1px)] dark:bg-[radial-gradient(#ffffff22_1px,transparent_1px)]`,
)}
style={
{
diff --git a/components/copy-button.tsx b/components/copy-button.tsx
index 23ceefdd..c359b284 100644
--- a/components/copy-button.tsx
+++ b/components/copy-button.tsx
@@ -54,7 +54,7 @@ export function CopyButton({
variant="ghost"
className={cn(
"relative z-10 h-6 w-6 text-zinc-50 hover:bg-background hover:text-zinc-50",
- className
+ className,
)}
onClick={() => {
copyToClipboardWithMeta(
@@ -66,7 +66,7 @@ export function CopyButton({
code: value,
},
}
- : undefined
+ : undefined,
);
setHasCopied(true);
}}
@@ -115,7 +115,7 @@ export function CopyWithClassNames({
variant="ghost"
className={cn(
"relative z-10 h-6 w-6 text-zinc-50 hover:bg-zinc-700 hover:text-zinc-50",
- className
+ className,
)}
>
{hasCopied ? (
diff --git a/components/dashboard/nav.tsx b/components/dashboard/nav.tsx
index 074fa47c..88033de1 100644
--- a/components/dashboard/nav.tsx
+++ b/components/dashboard/nav.tsx
@@ -29,7 +29,7 @@ export function DashboardNav({ items }: DashboardNavProps) {
className={cn(
"group flex items-center rounded-md px-3 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground",
path === item.href ? "bg-accent" : "transparent",
- item.disabled && "cursor-not-allowed opacity-80"
+ item.disabled && "cursor-not-allowed opacity-80",
)}
>
<Icon className="mr-2 h-4 w-4" />
diff --git a/components/dashboard/order-list.tsx b/components/dashboard/order-list.tsx
index 498971bc..e7d6f3dd 100644
--- a/components/dashboard/order-list.tsx
+++ b/components/dashboard/order-list.tsx
@@ -61,7 +61,7 @@ export function OrderList({ payments, className, ...props }: OrderListProps) {
variant={"outline"}
className={cn(
payment.status === "succeeded" && " bg-green-400/40",
- payment.status === "failed" && " bg-red-400/40"
+ payment.status === "failed" && " bg-red-400/40",
)}
>
{payment.status}
@@ -78,7 +78,7 @@ export function OrderList({ payments, className, ...props }: OrderListProps) {
<Link
className={cn(
buttonVariants({ size: "sm", variant: "default" }),
- "text-sm"
+ "text-sm",
)}
href={payment.receiptUrl || ""}
>
diff --git a/components/empty-placeholder.tsx b/components/empty-placeholder.tsx
index 1f444bd9..0b72eb27 100644
--- a/components/empty-placeholder.tsx
+++ b/components/empty-placeholder.tsx
@@ -14,7 +14,7 @@ export function EmptyPlaceholder({
<div
className={cn(
"flex flex-col items-center justify-center rounded-md border border-dashed p-8 text-center animate-in fade-in-50",
- className
+ className,
)}
{...props}
>
@@ -71,7 +71,7 @@ EmptyPlaceholder.Description = function EmptyPlaceholderDescription({
<p
className={cn(
"mb-8 mt-2 text-center text-sm font-normal leading-6 text-muted-foreground",
- className
+ className,
)}
{...props}
/>
diff --git a/components/main-nav.tsx b/components/main-nav.tsx
index 30c8eb71..fad6fbdb 100644
--- a/components/main-nav.tsx
+++ b/components/main-nav.tsx
@@ -29,7 +29,7 @@ export function MainNav() {
"transition-colors hover:text-foreground/80",
pathname?.startsWith(item.href!)
? "text-foreground"
- : "text-foreground/60"
+ : "text-foreground/60",
)}
>
{item.title}
diff --git a/components/mdx-components.tsx b/components/mdx-components.tsx
index 7cc3d3dc..39ae7431 100644
--- a/components/mdx-components.tsx
+++ b/components/mdx-components.tsx
@@ -43,7 +43,7 @@ const components = {
<th
className={cn(
"border px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right",
- className
+ className,
)}
{...props}
/>
@@ -51,8 +51,8 @@ const components = {
td: ({ className, ...props }: React.HTMLAttributes<HTMLTableCellElement>) => (
<td
className={cn(
- "border px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right whitespace-pre",
- className
+ "whitespace-pre border px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right",
+ className,
)}
{...props}
/>
@@ -61,7 +61,7 @@ const components = {
<div
className={cn(
"font-heading mt-8 scroll-m-20 text-xl font-semibold tracking-tight",
- className
+ className,
)}
{...props}
/>
@@ -95,7 +95,7 @@ const components = {
<pre
className={cn(
"mb-4 mt-6 max-h-[650px] overflow-x-auto rounded-lg border bg-zinc-950 py-4 dark:bg-zinc-900",
- className
+ className,
)}
{...props}
/>
@@ -132,7 +132,7 @@ export function Mdx({ code }: MDXProps) {
return (
<article
className={cn(
- `prose dark:prose-invert prose-gray leading-tighter tracking-tighter`,
+ `leading-tighter prose prose-gray tracking-tighter dark:prose-invert`,
// `md:prose-lg lg:prose-xl`,
// no underline on links
@@ -140,7 +140,7 @@ export function Mdx({ code }: MDXProps) {
// `prose-a:transition-colors prose-a:duration-200 prose-a:ease-out`,
// `dark:prose-a:text-gray-200 prose-a:underline-offset-4 dark:hover:prose-a:text-gray-700 prose-a:font-semibold hover:prose-a:text-gray-400`,
// `prose-pre:bg-gray-900 prose-pre:rounded-xl prose-pre:overflow-x-auto prose-pre:border prose-pre:px-0 `,
- `prose-pre:mb-4 prose-pre:mt-6 prose-pre:max-h-[650px] prose-pre:overflow-x-auto prose-pre:rounded-lg prose-pre:border prose-pre:bg-gray-900 prose-pre:py-4 prose-pre:dark:bg-gray-900 prose-pre:px-0 prose-pre:text-xs md:prose-pre:text-sm prose-pre:tracking-tighter`
+ `prose-pre:mb-4 prose-pre:mt-6 prose-pre:max-h-[650px] prose-pre:overflow-x-auto prose-pre:rounded-lg prose-pre:border prose-pre:bg-gray-900 prose-pre:px-0 prose-pre:py-4 prose-pre:text-xs prose-pre:tracking-tighter prose-pre:dark:bg-gray-900 md:prose-pre:text-sm`,
)}
>
{/* @ts-ignore */}
diff --git a/components/preorder.tsx b/components/preorder.tsx
index 3bf724fb..de63dab7 100644
--- a/components/preorder.tsx
+++ b/components/preorder.tsx
@@ -10,7 +10,7 @@ export default function PreOrder() {
const url = new URL(
process.env.NODE_ENV === "development"
? "https://buy.stripe.com/test_bIY7uvbbzecfcw09AB"
- : "https://buy.stripe.com/00g7vD4Vu8zQb8k5kl?prefilled_promo_code=EARLYBIRD"
+ : "https://buy.stripe.com/00g7vD4Vu8zQb8k5kl?prefilled_promo_code=EARLYBIRD",
);
if (status === "authenticated" && user && user.email) {
diff --git a/components/price-card.tsx b/components/price-card.tsx
index 49db3e0e..1aebf2d0 100644
--- a/components/price-card.tsx
+++ b/components/price-card.tsx
@@ -24,12 +24,12 @@ export const PriceCard = ({
className="relative flex flex-col gap-8 overflow-hidden p-8"
>
<div className="flex flex-col space-y-4">
- <span className="text-foreground font-medium">{item.name}</span>
+ <span className="font-medium text-foreground">{item.name}</span>
<div className="flex flex-row gap-2">
- <span className="text-7xl text-foreground font-semibold">
+ <span className="text-7xl font-semibold text-foreground">
${item.discountPrice}
</span>
- <span className="line-through text-4xl text-gray-700 font-normal">
+ <span className="text-4xl font-normal text-gray-700 line-through">
${item.price}
</span>
</div>
@@ -43,7 +43,7 @@ export const PriceCard = ({
target="_blank"
className={cn(
buttonVariants({ variant: "default", size: "lg" }),
- "w-full"
+ "w-full",
)}
>
Get Lifetime Access
@@ -56,7 +56,7 @@ export const PriceCard = ({
target="_blank"
className={cn(
buttonVariants({ variant: "default", size: "lg" }),
- "w-full text-xl gap-1"
+ "w-full gap-1 text-xl",
)}
>
<Icons.apple className="ml-2 h-5 w-5" />
@@ -65,13 +65,13 @@ export const PriceCard = ({
)}
</div>
<ul className="space-y-3">
- <li className="pb-2 text-foreground font-medium">
+ <li className="pb-2 font-medium text-foreground">
<p>Features</p>
</li>
{item.features.map((featureItem: any, idx: any) => (
<li
key={idx}
- className="flex items-center gap-5 text-foreground text-sm"
+ className="flex items-center gap-5 text-sm text-foreground"
>
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -100,8 +100,8 @@ export const PriceCard = ({
cy={1}
cr={1}
className={cn(
- "absolute w-full h-full inset-0 fill-white/20",
- "[mask-image:linear-gradient(to_top_left,white,transparent,transparent)]"
+ "absolute inset-0 h-full w-full fill-white/20",
+ "[mask-image:linear-gradient(to_top_left,white,transparent,transparent)]",
)}
/>
</MagicCard>
diff --git a/components/sidebar-nav.tsx b/components/sidebar-nav.tsx
index bf65a700..77b68db4 100644
--- a/components/sidebar-nav.tsx
+++ b/components/sidebar-nav.tsx
@@ -50,7 +50,7 @@ export function DocsSidebarNavItems({
item.disabled && "cursor-not-allowed opacity-60",
pathname === item.href
? "font-medium text-foreground"
- : "text-muted-foreground"
+ : "text-muted-foreground",
)}
target={item.external ? "_blank" : ""}
rel={item.external ? "noreferrer" : ""}
@@ -67,7 +67,7 @@ export function DocsSidebarNavItems({
key={index}
className={cn(
"flex w-full cursor-not-allowed items-center rounded-md p-2 text-muted-foreground hover:underline",
- item.disabled && "cursor-not-allowed opacity-60"
+ item.disabled && "cursor-not-allowed opacity-60",
)}
>
{item.title}
@@ -77,7 +77,7 @@ export function DocsSidebarNavItems({
</span>
)}
</span>
- )
+ ),
)}
</div>
) : null;
diff --git a/components/site-footer.tsx b/components/site-footer.tsx
index fec0d4ca..8a84da8a 100644
--- a/components/site-footer.tsx
+++ b/components/site-footer.tsx
@@ -4,7 +4,7 @@ export function SiteFooter() {
return (
<footer className="relative py-6 md:px-8 md:py-0">
<div
- className="absolute w-full h-px top-0"
+ className="absolute top-0 h-px w-full"
style={{
background:
"radial-gradient(50% 100% at 50% 100%,rgba(255,255,255,.12) 0%,rgba(255,255,255,0) 100%)",
diff --git a/components/site-header.tsx b/components/site-header.tsx
index 4a683def..a9a00333 100644
--- a/components/site-header.tsx
+++ b/components/site-header.tsx
@@ -52,7 +52,7 @@ export function SiteHeader({ user }: SiteHeaderProps) {
buttonVariants({
variant: "ghost",
}),
- "w-9 px-0"
+ "w-9 px-0",
)}
>
<Icons.twitter className="h-4 w-4 fill-current" />
@@ -76,7 +76,7 @@ export function SiteHeader({ user }: SiteHeaderProps) {
href="/login"
className={cn(
buttonVariants({ variant: "secondary", size: "sm" }),
- "px-4"
+ "px-4",
)}
>
Login
@@ -85,7 +85,7 @@ export function SiteHeader({ user }: SiteHeaderProps) {
</nav>
</div>
</div>
- <div className="absolute w-full h-px bottom-0 dark:bg-[radial-gradient(50%_100%_at_50%_100%,rgba(255,255,255,.32)_0%,rgba(255,255,255,0)_100%)] bg-[radial-gradient(50%_100%_at_50%_100%,rgba(0,0,0,.12)_0%,rgba(255,255,255,0)_100%)]" />
+ <div className="absolute bottom-0 h-px w-full bg-[radial-gradient(50%_100%_at_50%_100%,rgba(0,0,0,.12)_0%,rgba(255,255,255,0)_100%)] dark:bg-[radial-gradient(50%_100%_at_50%_100%,rgba(255,255,255,.32)_0%,rgba(255,255,255,0)_100%)]" />
</header>
);
}
diff --git a/components/toc.tsx b/components/toc.tsx
index 31621234..87b0e9f9 100644
--- a/components/toc.tsx
+++ b/components/toc.tsx
@@ -19,7 +19,7 @@ export function DashboardTableOfContents({ toc }: TocProps) {
.filter(Boolean)
.map((id) => id?.split("#")[1])
: [],
- [toc]
+ [toc],
) as string[];
const activeHeading = useActiveItem(itemIds);
@@ -49,7 +49,7 @@ function useActiveItem(itemIds: string[]): string | null {
}
});
},
- { rootMargin: `0% 0% -80% 0%` }
+ { rootMargin: `0% 0% -80% 0%` },
);
itemIds?.forEach((id) => {
@@ -90,7 +90,7 @@ function Tree({ tree, level = 1, activeItem }: TreeProps) {
"inline-block no-underline transition-colors hover:text-foreground",
item.url === `#${activeItem}`
? "font-medium text-foreground"
- : "text-muted-foreground"
+ : "text-muted-foreground",
)}
>
{item.title}
diff --git a/components/ui/accordion.tsx b/components/ui/accordion.tsx
index 66f095a7..c74c87f9 100644
--- a/components/ui/accordion.tsx
+++ b/components/ui/accordion.tsx
@@ -1,12 +1,12 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as AccordionPrimitive from "@radix-ui/react-accordion"
-import { ChevronDownIcon } from "@radix-ui/react-icons"
+import * as React from "react";
+import * as AccordionPrimitive from "@radix-ui/react-accordion";
+import { ChevronDownIcon } from "@radix-ui/react-icons";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
-const Accordion = AccordionPrimitive.Root
+const Accordion = AccordionPrimitive.Root;
const AccordionItem = React.forwardRef<
React.ElementRef<typeof AccordionPrimitive.Item>,
@@ -17,8 +17,8 @@ const AccordionItem = React.forwardRef<
className={cn("border-b", className)}
{...props}
/>
-))
-AccordionItem.displayName = "AccordionItem"
+));
+AccordionItem.displayName = "AccordionItem";
const AccordionTrigger = React.forwardRef<
React.ElementRef<typeof AccordionPrimitive.Trigger>,
@@ -29,7 +29,7 @@ const AccordionTrigger = React.forwardRef<
ref={ref}
className={cn(
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
- className
+ className,
)}
{...props}
>
@@ -37,8 +37,8 @@ const AccordionTrigger = React.forwardRef<
<ChevronDownIcon className="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" />
</AccordionPrimitive.Trigger>
</AccordionPrimitive.Header>
-))
-AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
+));
+AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
const AccordionContent = React.forwardRef<
React.ElementRef<typeof AccordionPrimitive.Content>,
@@ -48,13 +48,13 @@ const AccordionContent = React.forwardRef<
ref={ref}
className={cn(
"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
- className
+ className,
)}
{...props}
>
<div className="pb-4 pt-0">{children}</div>
</AccordionPrimitive.Content>
-))
-AccordionContent.displayName = AccordionPrimitive.Content.displayName
+));
+AccordionContent.displayName = AccordionPrimitive.Content.displayName;
-export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
+export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
diff --git a/components/ui/alert.tsx b/components/ui/alert.tsx
index 863d8fc3..8070ff6f 100644
--- a/components/ui/alert.tsx
+++ b/components/ui/alert.tsx
@@ -1,7 +1,7 @@
-import * as React from "react"
-import { cva, type VariantProps } from "class-variance-authority"
+import * as React from "react";
+import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const alertVariants = cva(
"relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
@@ -16,8 +16,8 @@ const alertVariants = cva(
defaultVariants: {
variant: "default",
},
- }
-)
+ },
+);
const Alert = React.forwardRef<
HTMLDivElement,
@@ -29,8 +29,8 @@ const Alert = React.forwardRef<
className={cn(alertVariants({ variant }), className)}
{...props}
/>
-))
-Alert.displayName = "Alert"
+));
+Alert.displayName = "Alert";
const AlertTitle = React.forwardRef<
HTMLParagraphElement,
@@ -41,8 +41,8 @@ const AlertTitle = React.forwardRef<
className={cn("mb-1 font-medium leading-none tracking-tight", className)}
{...props}
/>
-))
-AlertTitle.displayName = "AlertTitle"
+));
+AlertTitle.displayName = "AlertTitle";
const AlertDescription = React.forwardRef<
HTMLParagraphElement,
@@ -53,7 +53,7 @@ const AlertDescription = React.forwardRef<
className={cn("text-sm [&_p]:leading-relaxed", className)}
{...props}
/>
-))
-AlertDescription.displayName = "AlertDescription"
+));
+AlertDescription.displayName = "AlertDescription";
-export { Alert, AlertTitle, AlertDescription }
+export { Alert, AlertTitle, AlertDescription };
diff --git a/components/ui/avatar.tsx b/components/ui/avatar.tsx
index 51e507ba..09cd14df 100644
--- a/components/ui/avatar.tsx
+++ b/components/ui/avatar.tsx
@@ -1,9 +1,9 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as AvatarPrimitive from "@radix-ui/react-avatar"
+import * as React from "react";
+import * as AvatarPrimitive from "@radix-ui/react-avatar";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const Avatar = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Root>,
@@ -13,12 +13,12 @@ const Avatar = React.forwardRef<
ref={ref}
className={cn(
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
- className
+ className,
)}
{...props}
/>
-))
-Avatar.displayName = AvatarPrimitive.Root.displayName
+));
+Avatar.displayName = AvatarPrimitive.Root.displayName;
const AvatarImage = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Image>,
@@ -29,8 +29,8 @@ const AvatarImage = React.forwardRef<
className={cn("aspect-square h-full w-full", className)}
{...props}
/>
-))
-AvatarImage.displayName = AvatarPrimitive.Image.displayName
+));
+AvatarImage.displayName = AvatarPrimitive.Image.displayName;
const AvatarFallback = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Fallback>,
@@ -40,11 +40,11 @@ const AvatarFallback = React.forwardRef<
ref={ref}
className={cn(
"flex h-full w-full items-center justify-center rounded-full bg-muted",
- className
+ className,
)}
{...props}
/>
-))
-AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
+));
+AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
-export { Avatar, AvatarImage, AvatarFallback }
+export { Avatar, AvatarImage, AvatarFallback };
diff --git a/components/ui/badge.tsx b/components/ui/badge.tsx
index e87d62bf..f7959805 100644
--- a/components/ui/badge.tsx
+++ b/components/ui/badge.tsx
@@ -1,7 +1,7 @@
-import * as React from "react"
-import { cva, type VariantProps } from "class-variance-authority"
+import * as React from "react";
+import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const badgeVariants = cva(
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
@@ -20,8 +20,8 @@ const badgeVariants = cva(
defaultVariants: {
variant: "default",
},
- }
-)
+ },
+);
export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>,
@@ -30,7 +30,7 @@ export interface BadgeProps
function Badge({ className, variant, ...props }: BadgeProps) {
return (
<div className={cn(badgeVariants({ variant }), className)} {...props} />
- )
+ );
}
-export { Badge, badgeVariants }
+export { Badge, badgeVariants };
diff --git a/components/ui/button.tsx b/components/ui/button.tsx
index d791d9d7..af2d5408 100644
--- a/components/ui/button.tsx
+++ b/components/ui/button.tsx
@@ -1,8 +1,8 @@
-import * as React from "react"
-import { Slot } from "@radix-ui/react-slot"
-import { cva, type VariantProps } from "class-variance-authority"
+import * as React from "react";
+import { Slot } from "@radix-ui/react-slot";
+import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const buttonVariants = cva(
"inline-flex items-center justify-center 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",
@@ -31,27 +31,27 @@ const buttonVariants = cva(
variant: "default",
size: "default",
},
- }
-)
+ },
+);
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
- asChild?: boolean
+ asChild?: boolean;
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
- const Comp = asChild ? Slot : "button"
+ const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
- )
- }
-)
-Button.displayName = "Button"
+ );
+ },
+);
+Button.displayName = "Button";
-export { Button, buttonVariants }
+export { Button, buttonVariants };
diff --git a/components/ui/card.tsx b/components/ui/card.tsx
index 9f7e6083..e102126a 100644
--- a/components/ui/card.tsx
+++ b/components/ui/card.tsx
@@ -1,6 +1,6 @@
-import * as React from "react"
+import * as React from "react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const Card = React.forwardRef<
HTMLDivElement,
@@ -10,12 +10,12 @@ const Card = React.forwardRef<
ref={ref}
className={cn(
"rounded-xl border bg-card text-card-foreground shadow",
- className
+ className,
)}
{...props}
/>
-))
-Card.displayName = "Card"
+));
+Card.displayName = "Card";
const CardHeader = React.forwardRef<
HTMLDivElement,
@@ -26,8 +26,8 @@ const CardHeader = React.forwardRef<
className={cn("flex flex-col space-y-1.5 p-6", className)}
{...props}
/>
-))
-CardHeader.displayName = "CardHeader"
+));
+CardHeader.displayName = "CardHeader";
const CardTitle = React.forwardRef<
HTMLParagraphElement,
@@ -38,8 +38,8 @@ const CardTitle = React.forwardRef<
className={cn("font-semibold leading-none tracking-tight", className)}
{...props}
/>
-))
-CardTitle.displayName = "CardTitle"
+));
+CardTitle.displayName = "CardTitle";
const CardDescription = React.forwardRef<
HTMLParagraphElement,
@@ -50,16 +50,16 @@ const CardDescription = React.forwardRef<
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
-))
-CardDescription.displayName = "CardDescription"
+));
+CardDescription.displayName = "CardDescription";
const CardContent = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
-))
-CardContent.displayName = "CardContent"
+));
+CardContent.displayName = "CardContent";
const CardFooter = React.forwardRef<
HTMLDivElement,
@@ -70,7 +70,14 @@ const CardFooter = React.forwardRef<
className={cn(" flex items-center p-6 pt-0", className)}
{...props}
/>
-))
-CardFooter.displayName = "CardFooter"
+));
+CardFooter.displayName = "CardFooter";
-export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
+export {
+ Card,
+ CardHeader,
+ CardFooter,
+ CardTitle,
+ CardDescription,
+ CardContent,
+};
diff --git a/components/ui/collapsible.tsx b/components/ui/collapsible.tsx
index 9fa48946..cb003d17 100644
--- a/components/ui/collapsible.tsx
+++ b/components/ui/collapsible.tsx
@@ -1,11 +1,11 @@
-"use client"
+"use client";
-import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
+import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
-const Collapsible = CollapsiblePrimitive.Root
+const Collapsible = CollapsiblePrimitive.Root;
-const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger
+const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
-const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
+const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
-export { Collapsible, CollapsibleTrigger, CollapsibleContent }
+export { Collapsible, CollapsibleTrigger, CollapsibleContent };
diff --git a/components/ui/command.tsx b/components/ui/command.tsx
index 6f4a5eb1..6397547e 100644
--- a/components/ui/command.tsx
+++ b/components/ui/command.tsx
@@ -1,12 +1,12 @@
-"use client"
+"use client";
-import * as React from "react"
-import { DialogProps } from "@radix-ui/react-dialog"
-import { MagnifyingGlassIcon } from "@radix-ui/react-icons"
-import { Command as CommandPrimitive } from "cmdk"
+import * as React from "react";
+import { DialogProps } from "@radix-ui/react-dialog";
+import { MagnifyingGlassIcon } from "@radix-ui/react-icons";
+import { Command as CommandPrimitive } from "cmdk";
-import { cn } from "@/lib/utils"
-import { Dialog, DialogContent } from "@/components/ui/dialog"
+import { cn } from "@/lib/utils";
+import { Dialog, DialogContent } from "@/components/ui/dialog";
const Command = React.forwardRef<
React.ElementRef<typeof CommandPrimitive>,
@@ -16,12 +16,12 @@ const Command = React.forwardRef<
ref={ref}
className={cn(
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
- className
+ className,
)}
{...props}
/>
-))
-Command.displayName = CommandPrimitive.displayName
+));
+Command.displayName = CommandPrimitive.displayName;
interface CommandDialogProps extends DialogProps {}
@@ -34,8 +34,8 @@ const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
</Command>
</DialogContent>
</Dialog>
- )
-}
+ );
+};
const CommandInput = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Input>,
@@ -47,14 +47,14 @@ const CommandInput = React.forwardRef<
ref={ref}
className={cn(
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
- className
+ className,
)}
{...props}
/>
</div>
-))
+));
-CommandInput.displayName = CommandPrimitive.Input.displayName
+CommandInput.displayName = CommandPrimitive.Input.displayName;
const CommandList = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.List>,
@@ -65,9 +65,9 @@ const CommandList = React.forwardRef<
className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
{...props}
/>
-))
+));
-CommandList.displayName = CommandPrimitive.List.displayName
+CommandList.displayName = CommandPrimitive.List.displayName;
const CommandEmpty = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Empty>,
@@ -78,9 +78,9 @@ const CommandEmpty = React.forwardRef<
className="py-6 text-center text-sm"
{...props}
/>
-))
+));
-CommandEmpty.displayName = CommandPrimitive.Empty.displayName
+CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
const CommandGroup = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Group>,
@@ -90,13 +90,13 @@ const CommandGroup = React.forwardRef<
ref={ref}
className={cn(
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
- className
+ className,
)}
{...props}
/>
-))
+));
-CommandGroup.displayName = CommandPrimitive.Group.displayName
+CommandGroup.displayName = CommandPrimitive.Group.displayName;
const CommandSeparator = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Separator>,
@@ -107,8 +107,8 @@ const CommandSeparator = React.forwardRef<
className={cn("-mx-1 h-px bg-border", className)}
{...props}
/>
-))
-CommandSeparator.displayName = CommandPrimitive.Separator.displayName
+));
+CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
const CommandItem = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Item>,
@@ -118,13 +118,13 @@ const CommandItem = React.forwardRef<
ref={ref}
className={cn(
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
- className
+ className,
)}
{...props}
/>
-))
+));
-CommandItem.displayName = CommandPrimitive.Item.displayName
+CommandItem.displayName = CommandPrimitive.Item.displayName;
const CommandShortcut = ({
className,
@@ -134,13 +134,13 @@ const CommandShortcut = ({
<span
className={cn(
"ml-auto text-xs tracking-widest text-muted-foreground",
- className
+ className,
)}
{...props}
/>
- )
-}
-CommandShortcut.displayName = "CommandShortcut"
+ );
+};
+CommandShortcut.displayName = "CommandShortcut";
export {
Command,
@@ -152,4 +152,4 @@ export {
CommandItem,
CommandShortcut,
CommandSeparator,
-}
+};
diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx
index 8cbe0d42..a91512dd 100644
--- a/components/ui/dialog.tsx
+++ b/components/ui/dialog.tsx
@@ -1,22 +1,22 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as DialogPrimitive from "@radix-ui/react-dialog"
-import { Cross2Icon } from "@radix-ui/react-icons"
+import * as React from "react";
+import * as DialogPrimitive from "@radix-ui/react-dialog";
+import { Cross2Icon } from "@radix-ui/react-icons";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
-const Dialog = DialogPrimitive.Root
+const Dialog = DialogPrimitive.Root;
-const DialogTrigger = DialogPrimitive.Trigger
+const DialogTrigger = DialogPrimitive.Trigger;
const DialogPortal = ({
className,
...props
}: DialogPrimitive.DialogPortalProps) => (
<DialogPrimitive.Portal className={cn(className)} {...props} />
-)
-DialogPortal.displayName = DialogPrimitive.Portal.displayName
+);
+DialogPortal.displayName = DialogPrimitive.Portal.displayName;
const DialogOverlay = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Overlay>,
@@ -26,12 +26,12 @@ const DialogOverlay = React.forwardRef<
ref={ref}
className={cn(
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
- className
+ className,
)}
{...props}
/>
-))
-DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
+));
+DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
const DialogContent = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Content>,
@@ -43,7 +43,7 @@ const DialogContent = React.forwardRef<
ref={ref}
className={cn(
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
- className
+ className,
)}
{...props}
>
@@ -54,8 +54,8 @@ const DialogContent = React.forwardRef<
</DialogPrimitive.Close>
</DialogPrimitive.Content>
</DialogPortal>
-))
-DialogContent.displayName = DialogPrimitive.Content.displayName
+));
+DialogContent.displayName = DialogPrimitive.Content.displayName;
const DialogHeader = ({
className,
@@ -64,12 +64,12 @@ const DialogHeader = ({
<div
className={cn(
"flex flex-col space-y-1.5 text-center sm:text-left",
- className
+ className,
)}
{...props}
/>
-)
-DialogHeader.displayName = "DialogHeader"
+);
+DialogHeader.displayName = "DialogHeader";
const DialogFooter = ({
className,
@@ -78,12 +78,12 @@ const DialogFooter = ({
<div
className={cn(
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
- className
+ className,
)}
{...props}
/>
-)
-DialogFooter.displayName = "DialogFooter"
+);
+DialogFooter.displayName = "DialogFooter";
const DialogTitle = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Title>,
@@ -93,12 +93,12 @@ const DialogTitle = React.forwardRef<
ref={ref}
className={cn(
"text-lg font-semibold leading-none tracking-tight",
- className
+ className,
)}
{...props}
/>
-))
-DialogTitle.displayName = DialogPrimitive.Title.displayName
+));
+DialogTitle.displayName = DialogPrimitive.Title.displayName;
const DialogDescription = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Description>,
@@ -109,8 +109,8 @@ const DialogDescription = React.forwardRef<
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
-))
-DialogDescription.displayName = DialogPrimitive.Description.displayName
+));
+DialogDescription.displayName = DialogPrimitive.Description.displayName;
export {
Dialog,
@@ -120,4 +120,4 @@ export {
DialogFooter,
DialogTitle,
DialogDescription,
-}
+};
diff --git a/components/ui/dropdown-menu.tsx b/components/ui/dropdown-menu.tsx
index 242b07a6..9dc361e0 100644
--- a/components/ui/dropdown-menu.tsx
+++ b/components/ui/dropdown-menu.tsx
@@ -1,31 +1,31 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
+import * as React from "react";
+import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
import {
CheckIcon,
ChevronRightIcon,
DotFilledIcon,
-} from "@radix-ui/react-icons"
+} from "@radix-ui/react-icons";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
-const DropdownMenu = DropdownMenuPrimitive.Root
+const DropdownMenu = DropdownMenuPrimitive.Root;
-const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
+const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
-const DropdownMenuGroup = DropdownMenuPrimitive.Group
+const DropdownMenuGroup = DropdownMenuPrimitive.Group;
-const DropdownMenuPortal = DropdownMenuPrimitive.Portal
+const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
-const DropdownMenuSub = DropdownMenuPrimitive.Sub
+const DropdownMenuSub = DropdownMenuPrimitive.Sub;
-const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
+const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
const DropdownMenuSubTrigger = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
- inset?: boolean
+ inset?: boolean;
}
>(({ className, inset, children, ...props }, ref) => (
<DropdownMenuPrimitive.SubTrigger
@@ -33,16 +33,16 @@ const DropdownMenuSubTrigger = React.forwardRef<
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",
inset && "pl-8",
- className
+ className,
)}
{...props}
>
{children}
<ChevronRightIcon className="ml-auto h-4 w-4" />
</DropdownMenuPrimitive.SubTrigger>
-))
+));
DropdownMenuSubTrigger.displayName =
- DropdownMenuPrimitive.SubTrigger.displayName
+ DropdownMenuPrimitive.SubTrigger.displayName;
const DropdownMenuSubContent = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
@@ -52,13 +52,13 @@ const DropdownMenuSubContent = React.forwardRef<
ref={ref}
className={cn(
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
- className
+ className,
)}
{...props}
/>
-))
+));
DropdownMenuSubContent.displayName =
- DropdownMenuPrimitive.SubContent.displayName
+ DropdownMenuPrimitive.SubContent.displayName;
const DropdownMenuContent = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
@@ -71,18 +71,18 @@ const DropdownMenuContent = React.forwardRef<
className={cn(
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
- className
+ className,
)}
{...props}
/>
</DropdownMenuPrimitive.Portal>
-))
-DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
+));
+DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
const DropdownMenuItem = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
- inset?: boolean
+ inset?: boolean;
}
>(({ className, inset, ...props }, ref) => (
<DropdownMenuPrimitive.Item
@@ -90,12 +90,12 @@ const DropdownMenuItem = React.forwardRef<
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",
inset && "pl-8",
- className
+ className,
)}
{...props}
/>
-))
-DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
+));
+DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
const DropdownMenuCheckboxItem = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
@@ -105,7 +105,7 @@ const DropdownMenuCheckboxItem = React.forwardRef<
ref={ref}
className={cn(
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
- className
+ className,
)}
checked={checked}
{...props}
@@ -117,9 +117,9 @@ const DropdownMenuCheckboxItem = React.forwardRef<
</span>
{children}
</DropdownMenuPrimitive.CheckboxItem>
-))
+));
DropdownMenuCheckboxItem.displayName =
- DropdownMenuPrimitive.CheckboxItem.displayName
+ DropdownMenuPrimitive.CheckboxItem.displayName;
const DropdownMenuRadioItem = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
@@ -129,7 +129,7 @@ const DropdownMenuRadioItem = React.forwardRef<
ref={ref}
className={cn(
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
- className
+ className,
)}
{...props}
>
@@ -140,13 +140,13 @@ const DropdownMenuRadioItem = React.forwardRef<
</span>
{children}
</DropdownMenuPrimitive.RadioItem>
-))
-DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
+));
+DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
const DropdownMenuLabel = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
- inset?: boolean
+ inset?: boolean;
}
>(({ className, inset, ...props }, ref) => (
<DropdownMenuPrimitive.Label
@@ -154,12 +154,12 @@ const DropdownMenuLabel = React.forwardRef<
className={cn(
"px-2 py-1.5 text-sm font-semibold",
inset && "pl-8",
- className
+ className,
)}
{...props}
/>
-))
-DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
+));
+DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
const DropdownMenuSeparator = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
@@ -170,8 +170,8 @@ const DropdownMenuSeparator = React.forwardRef<
className={cn("-mx-1 my-1 h-px bg-muted", className)}
{...props}
/>
-))
-DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
+));
+DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
const DropdownMenuShortcut = ({
className,
@@ -182,9 +182,9 @@ const DropdownMenuShortcut = ({
className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
{...props}
/>
- )
-}
-DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
+ );
+};
+DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
export {
DropdownMenu,
@@ -202,4 +202,4 @@ export {
DropdownMenuSubContent,
DropdownMenuSubTrigger,
DropdownMenuRadioGroup,
-}
+};
diff --git a/components/ui/form.tsx b/components/ui/form.tsx
index f6afdaf2..670c3258 100644
--- a/components/ui/form.tsx
+++ b/components/ui/form.tsx
@@ -1,6 +1,6 @@
-import * as React from "react"
-import * as LabelPrimitive from "@radix-ui/react-label"
-import { Slot } from "@radix-ui/react-slot"
+import * as React from "react";
+import * as LabelPrimitive from "@radix-ui/react-label";
+import { Slot } from "@radix-ui/react-slot";
import {
Controller,
ControllerProps,
@@ -8,27 +8,27 @@ import {
FieldValues,
FormProvider,
useFormContext,
-} from "react-hook-form"
+} from "react-hook-form";
-import { cn } from "@/lib/utils"
-import { Label } from "@/components/ui/label"
+import { cn } from "@/lib/utils";
+import { Label } from "@/components/ui/label";
-const Form = FormProvider
+const Form = FormProvider;
type FormFieldContextValue<
TFieldValues extends FieldValues = FieldValues,
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
> = {
- name: TName
-}
+ name: TName;
+};
const FormFieldContext = React.createContext<FormFieldContextValue>(
- {} as FormFieldContextValue
-)
+ {} as FormFieldContextValue,
+);
const FormField = <
TFieldValues extends FieldValues = FieldValues,
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
>({
...props
}: ControllerProps<TFieldValues, TName>) => {
@@ -36,21 +36,21 @@ const FormField = <
<FormFieldContext.Provider value={{ name: props.name }}>
<Controller {...props} />
</FormFieldContext.Provider>
- )
-}
+ );
+};
const useFormField = () => {
- const fieldContext = React.useContext(FormFieldContext)
- const itemContext = React.useContext(FormItemContext)
- const { getFieldState, formState } = useFormContext()
+ const fieldContext = React.useContext(FormFieldContext);
+ const itemContext = React.useContext(FormItemContext);
+ const { getFieldState, formState } = useFormContext();
- const fieldState = getFieldState(fieldContext.name, formState)
+ const fieldState = getFieldState(fieldContext.name, formState);
if (!fieldContext) {
- throw new Error("useFormField should be used within <FormField>")
+ throw new Error("useFormField should be used within <FormField>");
}
- const { id } = itemContext
+ const { id } = itemContext;
return {
id,
@@ -59,36 +59,36 @@ const useFormField = () => {
formDescriptionId: `${id}-form-item-description`,
formMessageId: `${id}-form-item-message`,
...fieldState,
- }
-}
+ };
+};
type FormItemContextValue = {
- id: string
-}
+ id: string;
+};
const FormItemContext = React.createContext<FormItemContextValue>(
- {} as FormItemContextValue
-)
+ {} as FormItemContextValue,
+);
const FormItem = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => {
- const id = React.useId()
+ const id = React.useId();
return (
<FormItemContext.Provider value={{ id }}>
<div ref={ref} className={cn("space-y-2", className)} {...props} />
</FormItemContext.Provider>
- )
-})
-FormItem.displayName = "FormItem"
+ );
+});
+FormItem.displayName = "FormItem";
const FormLabel = React.forwardRef<
React.ElementRef<typeof LabelPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
>(({ className, ...props }, ref) => {
- const { error, formItemId } = useFormField()
+ const { error, formItemId } = useFormField();
return (
<Label
@@ -97,15 +97,16 @@ const FormLabel = React.forwardRef<
htmlFor={formItemId}
{...props}
/>
- )
-})
-FormLabel.displayName = "FormLabel"
+ );
+});
+FormLabel.displayName = "FormLabel";
const FormControl = React.forwardRef<
React.ElementRef<typeof Slot>,
React.ComponentPropsWithoutRef<typeof Slot>
>(({ ...props }, ref) => {
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
+ const { error, formItemId, formDescriptionId, formMessageId } =
+ useFormField();
return (
<Slot
@@ -119,15 +120,15 @@ const FormControl = React.forwardRef<
aria-invalid={!!error}
{...props}
/>
- )
-})
-FormControl.displayName = "FormControl"
+ );
+});
+FormControl.displayName = "FormControl";
const FormDescription = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, ...props }, ref) => {
- const { formDescriptionId } = useFormField()
+ const { formDescriptionId } = useFormField();
return (
<p
@@ -136,19 +137,19 @@ const FormDescription = React.forwardRef<
className={cn("text-[0.8rem] text-muted-foreground", className)}
{...props}
/>
- )
-})
-FormDescription.displayName = "FormDescription"
+ );
+});
+FormDescription.displayName = "FormDescription";
const FormMessage = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, children, ...props }, ref) => {
- const { error, formMessageId } = useFormField()
- const body = error ? String(error?.message) : children
+ const { error, formMessageId } = useFormField();
+ const body = error ? String(error?.message) : children;
if (!body) {
- return null
+ return null;
}
return (
@@ -160,9 +161,9 @@ const FormMessage = React.forwardRef<
>
{body}
</p>
- )
-})
-FormMessage.displayName = "FormMessage"
+ );
+});
+FormMessage.displayName = "FormMessage";
export {
useFormField,
@@ -173,4 +174,4 @@ export {
FormDescription,
FormMessage,
FormField,
-}
+};
diff --git a/components/ui/input.tsx b/components/ui/input.tsx
index 010eef58..4305d922 100644
--- a/components/ui/input.tsx
+++ b/components/ui/input.tsx
@@ -1,6 +1,6 @@
-import * as React from "react"
+import * as React from "react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
@@ -12,14 +12,14 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
type={type}
className={cn(
"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
- className
+ className,
)}
ref={ref}
{...props}
/>
- )
- }
-)
-Input.displayName = "Input"
+ );
+ },
+);
+Input.displayName = "Input";
-export { Input }
+export { Input };
diff --git a/components/ui/label.tsx b/components/ui/label.tsx
index 53418217..84f8b0c7 100644
--- a/components/ui/label.tsx
+++ b/components/ui/label.tsx
@@ -1,14 +1,14 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as LabelPrimitive from "@radix-ui/react-label"
-import { cva, type VariantProps } from "class-variance-authority"
+import * as React from "react";
+import * as LabelPrimitive from "@radix-ui/react-label";
+import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const labelVariants = cva(
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
-)
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
+);
const Label = React.forwardRef<
React.ElementRef<typeof LabelPrimitive.Root>,
@@ -20,7 +20,7 @@ const Label = React.forwardRef<
className={cn(labelVariants(), className)}
{...props}
/>
-))
-Label.displayName = LabelPrimitive.Root.displayName
+));
+Label.displayName = LabelPrimitive.Root.displayName;
-export { Label }
+export { Label };
diff --git a/components/ui/scroll-area.tsx b/components/ui/scroll-area.tsx
index 54b87cd7..a8ac2052 100644
--- a/components/ui/scroll-area.tsx
+++ b/components/ui/scroll-area.tsx
@@ -1,9 +1,9 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
+import * as React from "react";
+import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const ScrollArea = React.forwardRef<
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
@@ -20,8 +20,8 @@ const ScrollArea = React.forwardRef<
<ScrollBar />
<ScrollAreaPrimitive.Corner />
</ScrollAreaPrimitive.Root>
-))
-ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
+));
+ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
const ScrollBar = React.forwardRef<
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
@@ -36,13 +36,13 @@ const ScrollBar = React.forwardRef<
"h-full w-2.5 border-l border-l-transparent p-[1px]",
orientation === "horizontal" &&
"h-2.5 border-t border-t-transparent p-[1px]",
- className
+ className,
)}
{...props}
>
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
</ScrollAreaPrimitive.ScrollAreaScrollbar>
-))
-ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
+));
+ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
-export { ScrollArea, ScrollBar }
+export { ScrollArea, ScrollBar };
diff --git a/components/ui/separator.tsx b/components/ui/separator.tsx
index 12d81c4a..9ac3b95f 100644
--- a/components/ui/separator.tsx
+++ b/components/ui/separator.tsx
@@ -1,9 +1,9 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as SeparatorPrimitive from "@radix-ui/react-separator"
+import * as React from "react";
+import * as SeparatorPrimitive from "@radix-ui/react-separator";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const Separator = React.forwardRef<
React.ElementRef<typeof SeparatorPrimitive.Root>,
@@ -11,7 +11,7 @@ const Separator = React.forwardRef<
>(
(
{ className, orientation = "horizontal", decorative = true, ...props },
- ref
+ ref,
) => (
<SeparatorPrimitive.Root
ref={ref}
@@ -20,12 +20,12 @@ const Separator = React.forwardRef<
className={cn(
"shrink-0 bg-border",
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
- className
+ className,
)}
{...props}
/>
- )
-)
-Separator.displayName = SeparatorPrimitive.Root.displayName
+ ),
+);
+Separator.displayName = SeparatorPrimitive.Root.displayName;
-export { Separator }
+export { Separator };
diff --git a/components/ui/sheet.tsx b/components/ui/sheet.tsx
index 0f9948fd..2e5ca64d 100644
--- a/components/ui/sheet.tsx
+++ b/components/ui/sheet.tsx
@@ -28,7 +28,7 @@ const SheetOverlay = React.forwardRef<
<SheetPrimitive.Overlay
className={cn(
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
- className
+ className,
)}
{...props}
ref={ref}
@@ -52,7 +52,7 @@ const sheetVariants = cva(
defaultVariants: {
side: "right",
},
- }
+ },
);
interface SheetContentProps
@@ -87,7 +87,7 @@ const SheetHeader = ({
<div
className={cn(
"flex flex-col space-y-2 text-center sm:text-left",
- className
+ className,
)}
{...props}
/>
@@ -101,7 +101,7 @@ const SheetFooter = ({
<div
className={cn(
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
- className
+ className,
)}
{...props}
/>
diff --git a/components/ui/skeleton.tsx b/components/ui/skeleton.tsx
index d7e45f7b..c26c4ea9 100644
--- a/components/ui/skeleton.tsx
+++ b/components/ui/skeleton.tsx
@@ -1,4 +1,4 @@
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
function Skeleton({
className,
@@ -9,7 +9,7 @@ function Skeleton({
className={cn("animate-pulse rounded-md bg-primary/10", className)}
{...props}
/>
- )
+ );
}
-export { Skeleton }
+export { Skeleton };
diff --git a/components/ui/table.tsx b/components/ui/table.tsx
index eb17c5a0..0717d74d 100644
--- a/components/ui/table.tsx
+++ b/components/ui/table.tsx
@@ -1,6 +1,6 @@
-import * as React from "react"
+import * as React from "react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const Table = React.forwardRef<
HTMLTableElement,
@@ -13,16 +13,16 @@ const Table = React.forwardRef<
{...props}
/>
</div>
-))
-Table.displayName = "Table"
+));
+Table.displayName = "Table";
const TableHeader = React.forwardRef<
HTMLTableSectionElement,
React.HTMLAttributes<HTMLTableSectionElement>
>(({ className, ...props }, ref) => (
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
-))
-TableHeader.displayName = "TableHeader"
+));
+TableHeader.displayName = "TableHeader";
const TableBody = React.forwardRef<
HTMLTableSectionElement,
@@ -33,8 +33,8 @@ const TableBody = React.forwardRef<
className={cn("[&_tr:last-child]:border-0", className)}
{...props}
/>
-))
-TableBody.displayName = "TableBody"
+));
+TableBody.displayName = "TableBody";
const TableFooter = React.forwardRef<
HTMLTableSectionElement,
@@ -45,8 +45,8 @@ const TableFooter = React.forwardRef<
className={cn("bg-primary font-medium text-primary-foreground", className)}
{...props}
/>
-))
-TableFooter.displayName = "TableFooter"
+));
+TableFooter.displayName = "TableFooter";
const TableRow = React.forwardRef<
HTMLTableRowElement,
@@ -56,12 +56,12 @@ const TableRow = React.forwardRef<
ref={ref}
className={cn(
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
- className
+ className,
)}
{...props}
/>
-))
-TableRow.displayName = "TableRow"
+));
+TableRow.displayName = "TableRow";
const TableHead = React.forwardRef<
HTMLTableCellElement,
@@ -71,12 +71,12 @@ const TableHead = React.forwardRef<
ref={ref}
className={cn(
"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
- className
+ className,
)}
{...props}
/>
-))
-TableHead.displayName = "TableHead"
+));
+TableHead.displayName = "TableHead";
const TableCell = React.forwardRef<
HTMLTableCellElement,
@@ -86,12 +86,12 @@ const TableCell = React.forwardRef<
ref={ref}
className={cn(
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
- className
+ className,
)}
{...props}
/>
-))
-TableCell.displayName = "TableCell"
+));
+TableCell.displayName = "TableCell";
const TableCaption = React.forwardRef<
HTMLTableCaptionElement,
@@ -102,8 +102,8 @@ const TableCaption = React.forwardRef<
className={cn("mt-4 text-sm text-muted-foreground", className)}
{...props}
/>
-))
-TableCaption.displayName = "TableCaption"
+));
+TableCaption.displayName = "TableCaption";
export {
Table,
@@ -114,4 +114,4 @@ export {
TableRow,
TableCell,
TableCaption,
-}
+};
diff --git a/components/ui/tabs.tsx b/components/ui/tabs.tsx
index 0f4caebb..cc56f162 100644
--- a/components/ui/tabs.tsx
+++ b/components/ui/tabs.tsx
@@ -1,11 +1,11 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as TabsPrimitive from "@radix-ui/react-tabs"
+import * as React from "react";
+import * as TabsPrimitive from "@radix-ui/react-tabs";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
-const Tabs = TabsPrimitive.Root
+const Tabs = TabsPrimitive.Root;
const TabsList = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.List>,
@@ -15,12 +15,12 @@ const TabsList = React.forwardRef<
ref={ref}
className={cn(
"inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
- className
+ className,
)}
{...props}
/>
-))
-TabsList.displayName = TabsPrimitive.List.displayName
+));
+TabsList.displayName = TabsPrimitive.List.displayName;
const TabsTrigger = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.Trigger>,
@@ -30,12 +30,12 @@ const TabsTrigger = React.forwardRef<
ref={ref}
className={cn(
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
- className
+ className,
)}
{...props}
/>
-))
-TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
+));
+TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
const TabsContent = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.Content>,
@@ -45,11 +45,11 @@ const TabsContent = React.forwardRef<
ref={ref}
className={cn(
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
- className
+ className,
)}
{...props}
/>
-))
-TabsContent.displayName = TabsPrimitive.Content.displayName
+));
+TabsContent.displayName = TabsPrimitive.Content.displayName;
-export { Tabs, TabsList, TabsTrigger, TabsContent }
+export { Tabs, TabsList, TabsTrigger, TabsContent };
diff --git a/components/ui/toast.tsx b/components/ui/toast.tsx
index 72c38533..c3aeb4b0 100644
--- a/components/ui/toast.tsx
+++ b/components/ui/toast.tsx
@@ -1,11 +1,11 @@
-import * as React from "react"
-import { Cross2Icon } from "@radix-ui/react-icons"
-import * as ToastPrimitives from "@radix-ui/react-toast"
-import { cva, type VariantProps } from "class-variance-authority"
+import * as React from "react";
+import { Cross2Icon } from "@radix-ui/react-icons";
+import * as ToastPrimitives from "@radix-ui/react-toast";
+import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
-const ToastProvider = ToastPrimitives.Provider
+const ToastProvider = ToastPrimitives.Provider;
const ToastViewport = React.forwardRef<
React.ElementRef<typeof ToastPrimitives.Viewport>,
@@ -15,12 +15,12 @@ const ToastViewport = React.forwardRef<
ref={ref}
className={cn(
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
- className
+ className,
)}
{...props}
/>
-))
-ToastViewport.displayName = ToastPrimitives.Viewport.displayName
+));
+ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
const toastVariants = cva(
"group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
@@ -35,8 +35,8 @@ const toastVariants = cva(
defaultVariants: {
variant: "default",
},
- }
-)
+ },
+);
const Toast = React.forwardRef<
React.ElementRef<typeof ToastPrimitives.Root>,
@@ -49,9 +49,9 @@ const Toast = React.forwardRef<
className={cn(toastVariants({ variant }), className)}
{...props}
/>
- )
-})
-Toast.displayName = ToastPrimitives.Root.displayName
+ );
+});
+Toast.displayName = ToastPrimitives.Root.displayName;
const ToastAction = React.forwardRef<
React.ElementRef<typeof ToastPrimitives.Action>,
@@ -61,12 +61,12 @@ const ToastAction = React.forwardRef<
ref={ref}
className={cn(
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
- className
+ className,
)}
{...props}
/>
-))
-ToastAction.displayName = ToastPrimitives.Action.displayName
+));
+ToastAction.displayName = ToastPrimitives.Action.displayName;
const ToastClose = React.forwardRef<
React.ElementRef<typeof ToastPrimitives.Close>,
@@ -76,15 +76,15 @@ const ToastClose = React.forwardRef<
ref={ref}
className={cn(
"absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
- className
+ className,
)}
toast-close=""
{...props}
>
<Cross2Icon className="h-4 w-4" />
</ToastPrimitives.Close>
-))
-ToastClose.displayName = ToastPrimitives.Close.displayName
+));
+ToastClose.displayName = ToastPrimitives.Close.displayName;
const ToastTitle = React.forwardRef<
React.ElementRef<typeof ToastPrimitives.Title>,
@@ -95,8 +95,8 @@ const ToastTitle = React.forwardRef<
className={cn("text-sm font-semibold [&+div]:text-xs", className)}
{...props}
/>
-))
-ToastTitle.displayName = ToastPrimitives.Title.displayName
+));
+ToastTitle.displayName = ToastPrimitives.Title.displayName;
const ToastDescription = React.forwardRef<
React.ElementRef<typeof ToastPrimitives.Description>,
@@ -107,12 +107,12 @@ const ToastDescription = React.forwardRef<
className={cn("text-sm opacity-90", className)}
{...props}
/>
-))
-ToastDescription.displayName = ToastPrimitives.Description.displayName
+));
+ToastDescription.displayName = ToastPrimitives.Description.displayName;
-type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>
+type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
-type ToastActionElement = React.ReactElement<typeof ToastAction>
+type ToastActionElement = React.ReactElement<typeof ToastAction>;
export {
type ToastProps,
@@ -124,4 +124,4 @@ export {
ToastDescription,
ToastClose,
ToastAction,
-}
+};
diff --git a/components/ui/toaster.tsx b/components/ui/toaster.tsx
index e2233852..7d82ed55 100644
--- a/components/ui/toaster.tsx
+++ b/components/ui/toaster.tsx
@@ -1,4 +1,4 @@
-"use client"
+"use client";
import {
Toast,
@@ -7,11 +7,11 @@ import {
ToastProvider,
ToastTitle,
ToastViewport,
-} from "@/components/ui/toast"
-import { useToast } from "@/components/ui/use-toast"
+} from "@/components/ui/toast";
+import { useToast } from "@/components/ui/use-toast";
export function Toaster() {
- const { toasts } = useToast()
+ const { toasts } = useToast();
return (
<ToastProvider>
@@ -27,9 +27,9 @@ export function Toaster() {
{action}
<ToastClose />
</Toast>
- )
+ );
})}
<ToastViewport />
</ToastProvider>
- )
+ );
}
diff --git a/components/ui/use-toast.ts b/components/ui/use-toast.ts
index 90d8959b..ac0aff3e 100644
--- a/components/ui/use-toast.ts
+++ b/components/ui/use-toast.ts
@@ -1,76 +1,73 @@
// Inspired by react-hot-toast library
-import * as React from "react"
+import * as React from "react";
-import type {
- ToastActionElement,
- ToastProps,
-} from "@/components/ui/toast"
+import type { ToastActionElement, ToastProps } from "@/components/ui/toast";
-const TOAST_LIMIT = 1
-const TOAST_REMOVE_DELAY = 1000000
+const TOAST_LIMIT = 1;
+const TOAST_REMOVE_DELAY = 1000000;
type ToasterToast = ToastProps & {
- id: string
- title?: React.ReactNode
- description?: React.ReactNode
- action?: ToastActionElement
-}
+ id: string;
+ title?: React.ReactNode;
+ description?: React.ReactNode;
+ action?: ToastActionElement;
+};
const actionTypes = {
ADD_TOAST: "ADD_TOAST",
UPDATE_TOAST: "UPDATE_TOAST",
DISMISS_TOAST: "DISMISS_TOAST",
REMOVE_TOAST: "REMOVE_TOAST",
-} as const
+} as const;
-let count = 0
+let count = 0;
function genId() {
- count = (count + 1) % Number.MAX_VALUE
- return count.toString()
+ count = (count + 1) % Number.MAX_VALUE;
+ return count.toString();
}
-type ActionType = typeof actionTypes
+type ActionType = typeof actionTypes;
type Action =
| {
- type: ActionType["ADD_TOAST"]
- toast: ToasterToast
+ type: ActionType["ADD_TOAST"];
+ toast: ToasterToast;
}
| {
- type: ActionType["UPDATE_TOAST"]
- toast: Partial<ToasterToast>
+ type: ActionType["UPDATE_TOAST"];
+ toast: Partial<ToasterToast>;
}
| {
- type: ActionType["DISMISS_TOAST"]
- toastId?: ToasterToast["id"]
+ type: ActionType["DISMISS_TOAST"];
+ toastId?: ToasterToast["id"];
}
| {
- type: ActionType["REMOVE_TOAST"]
- toastId?: ToasterToast["id"]
- }
+ type: ActionType["REMOVE_TOAST"];
+ toastId?: ToasterToast["id"];
+ };
interface State {
- toasts: ToasterToast[]
+ toasts: ToasterToast[];
}
-const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>()
+const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();
const addToRemoveQueue = (toastId: string) => {
if (toastTimeouts.has(toastId)) {
- return
+ return;
}
const timeout = setTimeout(() => {
- toastTimeouts.delete(toastId)
+ toastTimeouts.delete(toastId);
dispatch({
type: "REMOVE_TOAST",
toastId: toastId,
- })
- }, TOAST_REMOVE_DELAY)
+ });
+ }, TOAST_REMOVE_DELAY);
- toastTimeouts.set(toastId, timeout)
-}
+ toastTimeouts.set(toastId, timeout);
+};
export const reducer = (state: State, action: Action): State => {
switch (action.type) {
@@ -78,27 +75,27 @@ export const reducer = (state: State, action: Action): State => {
return {
...state,
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
- }
+ };
case "UPDATE_TOAST":
return {
...state,
toasts: state.toasts.map((t) =>
- t.id === action.toast.id ? { ...t, ...action.toast } : t
+ t.id === action.toast.id ? { ...t, ...action.toast } : t,
),
- }
+ };
case "DISMISS_TOAST": {
- const { toastId } = action
+ const { toastId } = action;
// ! Side effects ! - This could be extracted into a dismissToast() action,
// but I'll keep it here for simplicity
if (toastId) {
- addToRemoveQueue(toastId)
+ addToRemoveQueue(toastId);
} else {
state.toasts.forEach((toast) => {
- addToRemoveQueue(toast.id)
- })
+ addToRemoveQueue(toast.id);
+ });
}
return {
@@ -109,46 +106,46 @@ export const reducer = (state: State, action: Action): State => {
...t,
open: false,
}
- : t
+ : t,
),
- }
+ };
}
case "REMOVE_TOAST":
if (action.toastId === undefined) {
return {
...state,
toasts: [],
- }
+ };
}
return {
...state,
toasts: state.toasts.filter((t) => t.id !== action.toastId),
- }
+ };
}
-}
+};
-const listeners: Array<(state: State) => void> = []
+const listeners: Array<(state: State) => void> = [];
-let memoryState: State = { toasts: [] }
+let memoryState: State = { toasts: [] };
function dispatch(action: Action) {
- memoryState = reducer(memoryState, action)
+ memoryState = reducer(memoryState, action);
listeners.forEach((listener) => {
- listener(memoryState)
- })
+ listener(memoryState);
+ });
}
-type Toast = Omit<ToasterToast, "id">
+type Toast = Omit<ToasterToast, "id">;
function toast({ ...props }: Toast) {
- const id = genId()
+ const id = genId();
const update = (props: ToasterToast) =>
dispatch({
type: "UPDATE_TOAST",
toast: { ...props, id },
- })
- const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id })
+ });
+ const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
dispatch({
type: "ADD_TOAST",
@@ -157,36 +154,36 @@ function toast({ ...props }: Toast) {
id,
open: true,
onOpenChange: (open) => {
- if (!open) dismiss()
+ if (!open) dismiss();
},
},
- })
+ });
return {
id: id,
dismiss,
update,
- }
+ };
}
function useToast() {
- const [state, setState] = React.useState<State>(memoryState)
+ const [state, setState] = React.useState<State>(memoryState);
React.useEffect(() => {
- listeners.push(setState)
+ listeners.push(setState);
return () => {
- const index = listeners.indexOf(setState)
+ const index = listeners.indexOf(setState);
if (index > -1) {
- listeners.splice(index, 1)
+ listeners.splice(index, 1);
}
- }
- }, [state])
+ };
+ }, [state]);
return {
...state,
toast,
dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
- }
+ };
}
-export { useToast, toast }
+export { useToast, toast };
diff --git a/config/docs.ts b/config/docs.ts
index 1badc957..0d209c90 100644
--- a/config/docs.ts
+++ b/config/docs.ts
@@ -23,7 +23,7 @@ export const docsConfig: DocsConfig = {
title: "Components",
items: allComponents
.filter(
- (post) => post.date <= new Date().toISOString() && post.published
+ (post) => post.date <= new Date().toISOString() && post.published,
)
.sort((a, b) => {
return compareDesc(new Date(a.date), new Date(b.date));
diff --git a/content/components/temp.mdx b/content/components/temp.mdx
index e4bc0a77..0fe53272 100644
--- a/content/components/temp.mdx
+++ b/content/components/temp.mdx
@@ -1,7 +1,7 @@
```tsx
<div className="absolute bottom-6 left-0 right-0 flex translate-y-4 items-center justify-center opacity-0 duration-500 ease-in-out group-hover:translate-y-0 group-hover:opacity-100 group-focus-visible:translate-y-0 group-focus-visible:opacity-100">
<span className="flex items-center gap-1">
- <span className="text-sm text-slate-11 font-normal">Read more</span>
+ <span className="text-slate-11 text-sm font-normal">Read more</span>
<svg
className="text-[#70757E]"
width="24"
diff --git a/contentlayer.config.ts b/contentlayer.config.ts
index e49827f8..ac33d39a 100644
--- a/contentlayer.config.ts
+++ b/contentlayer.config.ts
@@ -45,7 +45,7 @@ const computedFields = {
name: doc.author,
url: `https://twitter.com/${doc.author}`,
},
- } as WithContext<BlogPosting>),
+ }) as WithContext<BlogPosting>,
},
};
diff --git a/emails/LoginLink.tsx b/emails/LoginLink.tsx
index f686df44..150dd5f0 100644
--- a/emails/LoginLink.tsx
+++ b/emails/LoginLink.tsx
@@ -34,31 +34,31 @@ const Email = ({ firstName, loginLink = "https://magicuikit.com" }: Props) => {
</Head>
<Preview>{previewText}</Preview>
<Tailwind>
- <Body className="bg-white my-auto mx-auto font-sans">
- <Container className="border border-solid border-[#eaeaea] rounded my-[40px] mx-auto p-[20px] w-[465px] max-w-[465px]">
+ <Body className="mx-auto my-auto bg-white font-sans">
+ <Container className="mx-auto my-[40px] w-[465px] max-w-[465px] rounded border border-solid border-[#eaeaea] p-[20px]">
<Section className="mt-[32px]">
<Img
src={`https://magicuikit.com/icon.png`}
width="40"
height="37"
alt="Magic UI"
- className="my-0 mx-auto"
+ className="mx-auto my-0"
/>
</Section>
- <Heading className="text-black text-[24px] font-normal text-center p-0 my-[30px] mx-0">
+ <Heading className="mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black">
Welcome to <strong>Magic UI</strong> πŸŽ‰
</Heading>
{/* <Text className="text-black text-[14px] leading-[24px]">
{firstName && `Hello ${firstName} πŸ‘‹`}
{!firstName && `Hello πŸ‘‹`}
</Text> */}
- <Text className="text-black text-[14px] leading-[24px]">
+ <Text className="text-[14px] leading-[24px] text-black">
Click the link below to login to your account.
</Text>
- <Section className="text-center mt-[20px] mb-[20px]">
+ <Section className="mb-[20px] mt-[20px] text-center">
<Button
- className="bg-[#000000] rounded text-white text-[12px] font-semibold no-underline text-center px-5 py-3"
+ className="rounded bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline"
href={loginLink}
>
Get Started
@@ -71,8 +71,8 @@ const Email = ({ firstName, loginLink = "https://magicuikit.com" }: Props) => {
{loginLink}
</Link>
</Text> */}
- <Hr className="border-[#eaeaea] my-[26px] mx-0 w-full" />
- <Text className="text-[#666666] text-[12px] leading-[24px]">
+ <Hr className="mx-0 my-[26px] w-full border-[#eaeaea]" />
+ <Text className="text-[12px] leading-[24px] text-[#666666]">
If you were not expecting this invitation, you can ignore this
email.
</Text>
diff --git a/lib/rehype-component.ts b/lib/rehype-component.ts
index 48e04a58..9159dbf0 100644
--- a/lib/rehype-component.ts
+++ b/lib/rehype-component.ts
@@ -61,7 +61,7 @@ export function rehypeComponent() {
],
}),
],
- })
+ }),
);
// }
} catch (error) {
@@ -115,7 +115,7 @@ export function rehypeComponent() {
],
}),
],
- })
+ }),
);
// }
} catch (error) {
diff --git a/lib/stripe-utils.ts b/lib/stripe-utils.ts
index 659dd684..71aeefaf 100644
--- a/lib/stripe-utils.ts
+++ b/lib/stripe-utils.ts
@@ -45,7 +45,7 @@ export async function getUserPayments(userId: string): Promise<UserPayments> {
export const upsertPayment = async (
paymentIntent: string,
- customerId: string
+ customerId: string,
) => {
const p = await stripe.paymentIntents.retrieve(paymentIntent);
diff --git a/lib/toc.ts b/lib/toc.ts
index 8b5734d8..48927c93 100644
--- a/lib/toc.ts
+++ b/lib/toc.ts
@@ -68,7 +68,7 @@ const getToc = () => (node: any, file: any) => {
export type TableOfContents = Items;
export async function getTableOfContents(
- content: string
+ content: string,
): Promise<TableOfContents> {
const result = await remark().use(getToc).process(content);
diff --git a/lib/utils.ts b/lib/utils.ts
index 04d1459d..254feece 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -32,7 +32,7 @@ export const fetcher = (...args: Parameters<typeof fetch>) =>
*/
export const capitalize = (str: string, lower = false) =>
(lower ? str.toLowerCase() : str).replace(/(?:^|\s|["'([{])+\S/g, (match) =>
- match.toUpperCase()
+ match.toUpperCase(),
);
export function formatDate(input: string | number): string {
diff --git a/package.json b/package.json
index fb7a067e..ce2083cf 100644
--- a/package.json
+++ b/package.json
@@ -88,6 +88,8 @@
"@types/react-dom": "18.2.5",
"mdast-util-toc": "^6.1.1",
"prisma": "^4.16.1",
+ "prettier": "^3.0.0",
+ "prettier-plugin-tailwindcss": "^0.4.1",
"rehype-autolink-headings": "^6.1.1",
"rehype-pretty-code": "^0.9.11",
"rehype-slug": "^5.1.0",
diff --git a/postcss.config.js b/postcss.config.js
index 33ad091d..12a703d9 100644
--- a/postcss.config.js
+++ b/postcss.config.js
@@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
},
-}
+};
diff --git a/registry/components/example/dot-pattern-demo.tsx b/registry/components/example/dot-pattern-demo.tsx
index 92237651..c3c76dff 100644
--- a/registry/components/example/dot-pattern-demo.tsx
+++ b/registry/components/example/dot-pattern-demo.tsx
@@ -6,13 +6,13 @@ import RadialGradient from "@/registry/components/magicui/radial-gradient";
const DotPatternDemo = () => {
return (
- <div className="border rounded-lg h-full w-full relative flex justify-center items-center bg-background overflow-hidden p-20">
- <p className="text-5xl font-medium tracking-tighter text-black dark:text-white z-10 whitespace-pre-wrap text-center">
+ <div className="relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border bg-background p-20">
+ <p className="z-10 whitespace-pre-wrap text-center text-5xl font-medium tracking-tighter text-black dark:text-white">
Dot Pattern
</p>
<DotPattern
className={cn(
- "[mask-image:radial-gradient(200px_circle_at_center,white,transparent)]"
+ "[mask-image:radial-gradient(200px_circle_at_center,white,transparent)]",
)}
/>
<RadialGradient from="rgba(120,119,198,0.3)" to="rgba(0,0,0,0.0)" />
diff --git a/registry/components/example/dot-pattern-linear-gradient.tsx b/registry/components/example/dot-pattern-linear-gradient.tsx
index 508735a6..cad0b4b4 100644
--- a/registry/components/example/dot-pattern-linear-gradient.tsx
+++ b/registry/components/example/dot-pattern-linear-gradient.tsx
@@ -6,8 +6,8 @@ import LinearGradient from "@/registry/components/magicui/linear-gradient";
const DotPatternDemo2 = () => {
return (
- <div className="border rounded-lg h-full w-full relative flex justify-center items-center bg-background overflow-hidden p-20">
- <p className="text-5xl font-medium tracking-tighter text-black dark:text-white z-10 whitespace-pre-wrap text-center">
+ <div className="relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border bg-background p-20">
+ <p className="z-10 whitespace-pre-wrap text-center text-5xl font-medium tracking-tighter text-black dark:text-white">
Dot Pattern
</p>
<DotPattern
@@ -17,8 +17,8 @@ const DotPatternDemo2 = () => {
cy={1}
cr={1}
className={cn(
- "absolute w-full h-full inset-0 fill-white/20",
- "[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)] "
+ "absolute inset-0 h-full w-full fill-white/20",
+ "[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)] ",
)}
/>
<LinearGradient
diff --git a/registry/components/example/grid-pattern-dashed.tsx b/registry/components/example/grid-pattern-dashed.tsx
index 80adb78d..c62fa44f 100644
--- a/registry/components/example/grid-pattern-dashed.tsx
+++ b/registry/components/example/grid-pattern-dashed.tsx
@@ -6,8 +6,8 @@ import RadialGradient from "@/registry/components/magicui/radial-gradient";
const GridPatternDashed = () => {
return (
- <div className="border rounded-lg h-full w-full relative flex justify-center items-center bg-background overflow-hidden p-20">
- <p className="text-5xl font-medium tracking-tighter text-black dark:text-white z-10 whitespace-pre-wrap text-center">
+ <div className="relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border bg-background p-20">
+ <p className="z-10 whitespace-pre-wrap text-center text-5xl font-medium tracking-tighter text-black dark:text-white">
Grid Pattern
</p>
<GridPattern
@@ -17,8 +17,8 @@ const GridPatternDashed = () => {
y={-1}
strokeDasharray={"4 2"}
className={cn(
- "absolute w-full h-full inset-0 stroke-white/10 fill-white/10",
- "[mask-image:radial-gradient(300px_circle_at_center,white,transparent)]"
+ "absolute inset-0 h-full w-full fill-white/10 stroke-white/10",
+ "[mask-image:radial-gradient(300px_circle_at_center,white,transparent)]",
)}
/>
<RadialGradient from="rgba(120,119,198,0.3)" to="rgba(0,0,0,0.0)" />
diff --git a/registry/components/example/grid-pattern-demo.tsx b/registry/components/example/grid-pattern-demo.tsx
index 677a6ccc..f9f6c27b 100644
--- a/registry/components/example/grid-pattern-demo.tsx
+++ b/registry/components/example/grid-pattern-demo.tsx
@@ -6,8 +6,8 @@ import RadialGradient from "@/registry/components/magicui/radial-gradient";
const GridPatternDemo = () => {
return (
- <div className="border rounded-lg h-full w-full relative flex justify-center items-center bg-background overflow-hidden p-20">
- <p className="text-5xl font-medium tracking-tighter text-black dark:text-white z-10 whitespace-pre-wrap text-center">
+ <div className="relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border bg-background p-20">
+ <p className="z-10 whitespace-pre-wrap text-center text-5xl font-medium tracking-tighter text-black dark:text-white">
Grid Pattern
</p>
<GridPattern
@@ -21,7 +21,7 @@ const GridPatternDemo = () => {
]}
className={cn(
"[mask-image:radial-gradient(200px_circle_at_center,white,transparent)]",
- "skew-y-12 inset-x-0 inset-y-[-30%] h-[200%]"
+ "inset-x-0 inset-y-[-30%] h-[200%] skew-y-12",
)}
/>
<RadialGradient from="rgba(120,119,198,0.3)" to="rgba(0,0,0,0.0)" />
diff --git a/registry/components/example/grid-pattern-linear-gradient.tsx b/registry/components/example/grid-pattern-linear-gradient.tsx
index ea753ffe..a9895499 100644
--- a/registry/components/example/grid-pattern-linear-gradient.tsx
+++ b/registry/components/example/grid-pattern-linear-gradient.tsx
@@ -6,8 +6,8 @@ import LinearGradient from "@/registry/components/magicui/linear-gradient";
const GridPatternDemo2 = () => {
return (
- <div className="border rounded-lg h-full w-full relative flex justify-center items-center bg-background overflow-hidden p-20">
- <p className="text-5xl font-medium tracking-tighter text-black dark:text-white z-10 whitespace-pre-wrap text-center">
+ <div className="relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border bg-background p-20">
+ <p className="z-10 whitespace-pre-wrap text-center text-5xl font-medium tracking-tighter text-black dark:text-white">
Grid Pattern
</p>
<GridPattern
@@ -16,8 +16,8 @@ const GridPatternDemo2 = () => {
x={-1}
y={-1}
className={cn(
- "absolute w-full h-full inset-0 stroke-white/10 fill-white/10",
- "[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)] "
+ "absolute inset-0 h-full w-full fill-white/10 stroke-white/10",
+ "[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)] ",
)}
/>
<LinearGradient
diff --git a/registry/components/example/linear-gradient-demo.tsx b/registry/components/example/linear-gradient-demo.tsx
index 20934ded..9d9f3572 100644
--- a/registry/components/example/linear-gradient-demo.tsx
+++ b/registry/components/example/linear-gradient-demo.tsx
@@ -2,8 +2,8 @@ import LinearGradient from "@/registry/components/magicui/linear-gradient";
export default function LinearGradientDemo() {
return (
- <div className="border rounded-lg h-full w-full relative flex justify-center items-center bg-background p-20">
- <p className="text-5xl font-medium tracking-tighter text-black dark:text-white z-10 whitespace-pre-wrap text-center">
+ <div className="relative flex h-full w-full items-center justify-center rounded-lg border bg-background p-20">
+ <p className="z-10 whitespace-pre-wrap text-center text-5xl font-medium tracking-tighter text-black dark:text-white">
Linear Gradient
</p>
<LinearGradient />
diff --git a/registry/components/example/magic-card-demo.tsx b/registry/components/example/magic-card-demo.tsx
index 9e7cc212..65cd7d28 100644
--- a/registry/components/example/magic-card-demo.tsx
+++ b/registry/components/example/magic-card-demo.tsx
@@ -7,20 +7,20 @@ export default function MagicCardWithGradient() {
return (
<MagicContainer
className={
- "flex flex-col gap-4 h-[500px] lg:h-[250px] w-full lg:flex-row"
+ "flex h-[500px] w-full flex-col gap-4 lg:h-[250px] lg:flex-row"
}
>
- <MagicCard className="cursor-pointer shadow-2xl flex flex-col justify-center items-center overflow-hidden p-20 w-full">
- <p className="text-4xl font-medium whitespace-nowrap text-gray-800 dark:text-gray-200 z-10">
+ <MagicCard className="flex w-full cursor-pointer flex-col items-center justify-center overflow-hidden p-20 shadow-2xl">
+ <p className="z-10 whitespace-nowrap text-4xl font-medium text-gray-800 dark:text-gray-200">
Magic
</p>
- <div className="pointer-events-none h-full absolute inset-0 bg-[radial-gradient(circle_at_50%_120%,rgba(120,119,198,0.3),rgba(255,255,255,0))]" />
+ <div className="pointer-events-none absolute inset-0 h-full bg-[radial-gradient(circle_at_50%_120%,rgba(120,119,198,0.3),rgba(255,255,255,0))]" />
</MagicCard>
- <MagicCard className="cursor-pointer shadow-2xl flex flex-col justify-center items-center overflow-hidden p-20 w-full">
- <p className="text-4xl font-medium whitespace-nowrap text-gray-800 dark:text-gray-200 z-10">
+ <MagicCard className="flex w-full cursor-pointer flex-col items-center justify-center overflow-hidden p-20 shadow-2xl">
+ <p className="z-10 whitespace-nowrap text-4xl font-medium text-gray-800 dark:text-gray-200">
Card
</p>
- <div className="pointer-events-none h-full absolute inset-0 bg-[radial-gradient(circle_at_50%_120%,rgba(120,119,198,0.3),rgba(255,255,255,0))]" />
+ <div className="pointer-events-none absolute inset-0 h-full bg-[radial-gradient(circle_at_50%_120%,rgba(120,119,198,0.3),rgba(255,255,255,0))]" />
</MagicCard>
</MagicContainer>
);
diff --git a/registry/components/example/marquee-demo.tsx b/registry/components/example/marquee-demo.tsx
index e78cba93..d96aac6d 100644
--- a/registry/components/example/marquee-demo.tsx
+++ b/registry/components/example/marquee-demo.tsx
@@ -47,20 +47,20 @@ const ReviewCard = ({
return (
<figure
className={cn(
- "w-64 p-4 rounded-xl border cursor-pointer overflow-hidden relative",
+ "relative w-64 cursor-pointer overflow-hidden rounded-xl border p-4",
// light styles
- "bg-gray-950/[.01] hover:bg-gray-950/[.05] border-gray-950/[.1]",
+ "border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]",
// dark styles
- "dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15] dark:border-gray-50/[.1]"
+ "dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]",
)}
>
<div className="flex flex-row items-center gap-2">
<img className="rounded-full" width="32" height="32" alt="" src={img} />
<div className="flex flex-col">
- <figcaption className="font-medium dark:text-white text-sm">
+ <figcaption className="text-sm font-medium dark:text-white">
{name}
</figcaption>
- <p className="font-medium dark:text-white/40 text-xs">{username}</p>
+ <p className="text-xs font-medium dark:text-white/40">{username}</p>
</div>
</div>
<blockquote className="mt-2 text-sm">{body}</blockquote>
@@ -70,7 +70,7 @@ const ReviewCard = ({
const MarqueeDemo = () => {
return (
- <div className="border rounded-lg h-full w-full relative flex justify-center items-center bg-background overflow-hidden py-20 flex-col gap-4">
+ <div className="relative flex h-full w-full flex-col items-center justify-center gap-4 overflow-hidden rounded-lg border bg-background py-20">
<Marquee pauseOnHover>
{reviews.map((review) => (
<ReviewCard key={review.username} {...review} />
@@ -81,8 +81,8 @@ const MarqueeDemo = () => {
<ReviewCard key={review.username} {...review} />
))}
</Marquee>
- <div className="pointer-events-none absolute inset-y-0 left-0 w-1/3 bg-gradient-to-r dark:from-gray-950 from-gray-50"></div>
- <div className="pointer-events-none absolute inset-y-0 right-0 w-1/3 bg-gradient-to-l dark:from-gray-950 from-gray-50"></div>
+ <div className="pointer-events-none absolute inset-y-0 left-0 w-1/3 bg-gradient-to-r from-gray-50 dark:from-gray-950"></div>
+ <div className="pointer-events-none absolute inset-y-0 right-0 w-1/3 bg-gradient-to-l from-gray-50 dark:from-gray-950"></div>
</div>
);
};
diff --git a/registry/components/example/marquee-logos.tsx b/registry/components/example/marquee-logos.tsx
index 7d15e1a9..92a2d9b3 100644
--- a/registry/components/example/marquee-logos.tsx
+++ b/registry/components/example/marquee-logos.tsx
@@ -38,14 +38,14 @@ const Logo = ({ name, img }: { name: string; img: string }) => {
const MarqueeLogos = () => {
return (
- <div className="border rounded-lg h-full w-full relative flex justify-center items-center bg-background overflow-hidden py-20 flex-col gap-4">
+ <div className="relative flex h-full w-full flex-col items-center justify-center gap-4 overflow-hidden rounded-lg border bg-background py-20">
<Marquee className="[--gap:3rem]">
{logos.map((logo, idx) => (
<Logo key={idx} {...logo} />
))}
</Marquee>
- <div className="pointer-events-none absolute inset-y-0 left-0 w-1/3 bg-gradient-to-r dark:from-gray-950 from-gray-50"></div>
- <div className="pointer-events-none absolute inset-y-0 right-0 w-1/3 bg-gradient-to-l dark:from-gray-950 from-gray-50"></div>
+ <div className="pointer-events-none absolute inset-y-0 left-0 w-1/3 bg-gradient-to-r from-gray-50 dark:from-gray-950"></div>
+ <div className="pointer-events-none absolute inset-y-0 right-0 w-1/3 bg-gradient-to-l from-gray-50 dark:from-gray-950"></div>
</div>
);
};
diff --git a/registry/components/example/meteors-demo.tsx b/registry/components/example/meteors-demo.tsx
index ee94ad33..a39e926a 100644
--- a/registry/components/example/meteors-demo.tsx
+++ b/registry/components/example/meteors-demo.tsx
@@ -2,12 +2,12 @@ import Meteors from "@/registry/components/magicui/meteors";
export default function MeteorDemo() {
return (
- <div className="border rounded-lg h-full w-full relative flex justify-center items-center bg-background overflow-hidden p-20">
+ <div className="relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border bg-background p-20">
<Meteors />
- <p className="text-5xl font-medium tracking-tighter text-black dark:text-white z-10 whitespace-pre-wrap text-center">
+ <p className="z-10 whitespace-pre-wrap text-center text-5xl font-medium tracking-tighter text-black dark:text-white">
Meteors
</p>
- <div className="pointer-events-none h-full absolute inset-0 bg-[radial-gradient(circle_at_50%_120%,rgba(120,119,198,0.3),rgba(255,255,255,0))]" />
+ <div className="pointer-events-none absolute inset-0 h-full bg-[radial-gradient(circle_at_50%_120%,rgba(120,119,198,0.3),rgba(255,255,255,0))]" />
</div>
);
}
diff --git a/registry/components/example/radial-gradient-demo.tsx b/registry/components/example/radial-gradient-demo.tsx
index e2aa1e0d..56297b2a 100644
--- a/registry/components/example/radial-gradient-demo.tsx
+++ b/registry/components/example/radial-gradient-demo.tsx
@@ -2,8 +2,8 @@ import RadialGradient from "@/registry/components/magicui/radial-gradient";
export default function RadialGradientDemo() {
return (
- <div className="border rounded-lg h-full w-full relative flex justify-center items-center bg-background p-20">
- <p className="text-5xl font-medium tracking-tighter text-black dark:text-white z-10 whitespace-pre-wrap text-center">
+ <div className="relative flex h-full w-full items-center justify-center rounded-lg border bg-background p-20">
+ <p className="z-10 whitespace-pre-wrap text-center text-5xl font-medium tracking-tighter text-black dark:text-white">
Radial Gradient
</p>
<RadialGradient />
diff --git a/registry/components/example/tweet-card-demo.tsx b/registry/components/example/tweet-card-demo.tsx
index 579d65d3..17e4f5ac 100644
--- a/registry/components/example/tweet-card-demo.tsx
+++ b/registry/components/example/tweet-card-demo.tsx
@@ -1,5 +1,5 @@
import TweetCard from "@/registry/components/magicui/tweet-card";
export default function TweetDemo() {
- return <TweetCard id="1668408059125702661" className="w-full h-full" />;
+ return <TweetCard id="1668408059125702661" className="h-full w-full" />;
}
diff --git a/registry/components/magicui/dot-pattern.tsx b/registry/components/magicui/dot-pattern.tsx
index eb838754..757226bc 100644
--- a/registry/components/magicui/dot-pattern.tsx
+++ b/registry/components/magicui/dot-pattern.tsx
@@ -29,8 +29,8 @@ export function DotPattern({
<svg
aria-hidden="true"
className={cn(
- "pointer-events-none absolute w-full h-full inset-0 fill-gray-400/30",
- className
+ "pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30",
+ className,
)}
{...props}
>
diff --git a/registry/components/magicui/grid-pattern.tsx b/registry/components/magicui/grid-pattern.tsx
index c746cca0..b1f1b2fa 100644
--- a/registry/components/magicui/grid-pattern.tsx
+++ b/registry/components/magicui/grid-pattern.tsx
@@ -28,8 +28,8 @@ export function GridPattern({
<svg
aria-hidden="true"
className={cn(
- "pointer-events-none absolute w-full h-full inset-0 stroke-gray-400/30 fill-gray-400/30",
- className
+ "pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30",
+ className,
)}
{...props}
>
diff --git a/registry/components/magicui/linear-mask.tsx b/registry/components/magicui/linear-mask.tsx
index 5a6c3625..f16c5382 100644
--- a/registry/components/magicui/linear-mask.tsx
+++ b/registry/components/magicui/linear-mask.tsx
@@ -38,7 +38,7 @@ const LinearMask: React.FC<Props> = ({ className, children }) => {
<div
className={cn(
"[mask:linear-gradient(180deg,transparent,#fff_30%,#fff_70%,transparent)]",
- className
+ className,
)}
>
{children}
diff --git a/registry/components/magicui/magic-card.tsx b/registry/components/magicui/magic-card.tsx
index c64ab46f..08a84463 100644
--- a/registry/components/magicui/magic-card.tsx
+++ b/registry/components/magicui/magic-card.tsx
@@ -57,7 +57,9 @@ const MagicContainer = ({ children, className }: MagicContainerProps) => {
init();
containerRef.current &&
setBoxes(
- Array.from(containerRef.current.children).map((el) => el as HTMLElement)
+ Array.from(containerRef.current.children).map(
+ (el) => el as HTMLElement,
+ ),
);
}, []);
@@ -219,7 +221,7 @@ const MagicCard = ({
return (
<div
{...props}
- className={cn("relative w-full h-full rounded-lg", className)}
+ className={cn("relative h-full w-full rounded-lg", className)}
style={
{
"--border-width": `${borderWidth}px`,
@@ -229,18 +231,18 @@ const MagicCard = ({
}
>
{/* Border */}
- <div className="pointer-events-none absolute w-full h-full rounded-lg top-0 left-0 duration-500 transition-opacity bg-[radial-gradient(var(--mask-size)_circle_at_var(--mouse-x)_var(--mouse-y),#ffaa40_0,#9c40ff_50%,transparent_100%)] -z-30 dark:bg-gray-700 bg-gray-300" />
+ <div className="pointer-events-none absolute left-0 top-0 -z-30 h-full w-full rounded-lg bg-gray-300 bg-[radial-gradient(var(--mask-size)_circle_at_var(--mouse-x)_var(--mouse-y),#ffaa40_0,#9c40ff_50%,transparent_100%)] transition-opacity duration-500 dark:bg-gray-700" />
{children}
{/* Background */}
- <div className={"absolute inset-[1px] rounded-lg -z-20 bg-background"} />
+ <div className={"absolute inset-[1px] -z-20 rounded-lg bg-background"} />
{/* Spotlight */}
{spotlight && (
<div
className={
- "pointer-events-none absolute w-full h-full rounded-lg top-0 left-0 duration-500 transition-opacity bg-[radial-gradient(var(--mask-size)_circle_at_var(--mouse-x)_var(--mouse-y),var(--spotlight-color),transparent_40%)] -z-10 blur-xs"
+ "blur-xs pointer-events-none absolute left-0 top-0 -z-10 h-full w-full rounded-lg bg-[radial-gradient(var(--mask-size)_circle_at_var(--mouse-x)_var(--mouse-y),var(--spotlight-color),transparent_40%)] transition-opacity duration-500"
}
/>
)}
diff --git a/registry/components/magicui/marquee.tsx b/registry/components/magicui/marquee.tsx
index 02394307..da799fef 100644
--- a/registry/components/magicui/marquee.tsx
+++ b/registry/components/magicui/marquee.tsx
@@ -20,12 +20,12 @@ const Marquee = ({
<div
{...props}
className={cn(
- "flex w-full overflow-hidden [--gap:1rem] [--duration:20s]",
- className
+ "flex w-full overflow-hidden [--duration:20s] [--gap:1rem]",
+ className,
)}
>
<div
- className={cn("animate-marquee flex items-stretch w-max gap-[--gap]", {
+ className={cn("flex w-max animate-marquee items-stretch gap-[--gap]", {
"[animation-direction:reverse]": reverse,
"hover:[animation-play-state:paused]": pauseOnHover,
})}
diff --git a/registry/components/magicui/meteors.tsx b/registry/components/magicui/meteors.tsx
index 5e372567..32880a81 100644
--- a/registry/components/magicui/meteors.tsx
+++ b/registry/components/magicui/meteors.tsx
@@ -8,7 +8,7 @@ interface MeteorsProps {
}
export const Meteors = ({ number = 20 }: MeteorsProps) => {
const [meteorStyles, setMeteorStyles] = useState<Array<React.CSSProperties>>(
- []
+ [],
);
useEffect(() => {
@@ -28,12 +28,12 @@ export const Meteors = ({ number = 20 }: MeteorsProps) => {
<span
key={idx}
className={clsx(
- "pointer-events-none absolute top-1/2 left-1/2 h-0.5 w-0.5 rotate-[215deg] animate-meteor rounded-[9999px] bg-slate-500 shadow-[0_0_0_1px_#ffffff10] -z-10"
+ "pointer-events-none absolute left-1/2 top-1/2 -z-10 h-0.5 w-0.5 rotate-[215deg] animate-meteor rounded-[9999px] bg-slate-500 shadow-[0_0_0_1px_#ffffff10]",
)}
style={style}
>
{/* Meteor Tail */}
- <div className="pointer-events-none -z-10 absolute w-[50px] h-[1px] bg-gradient-to-r from-slate-500 to-transparent top-1/2 -translate-y-1/2" />
+ <div className="pointer-events-none absolute top-1/2 -z-10 h-[1px] w-[50px] -translate-y-1/2 bg-gradient-to-r from-slate-500 to-transparent" />
</span>
))}
</>
diff --git a/registry/components/magicui/retro-grid.tsx b/registry/components/magicui/retro-grid.tsx
index a62de09f..32cb565f 100644
--- a/registry/components/magicui/retro-grid.tsx
+++ b/registry/components/magicui/retro-grid.tsx
@@ -32,7 +32,7 @@ const RetroGrid = ({ className }: { className?: string }) => {
<div className={cn("overflow-hidden", className)}>
<div style={gridStyle}>
<div
- className="w-screen h-screen animate-grid"
+ className="h-screen w-screen animate-grid"
style={gridLinesStyle}
/>
</div>
diff --git a/registry/components/magicui/tweet-card.tsx b/registry/components/magicui/tweet-card.tsx
index a4ed7c0e..134fee69 100644
--- a/registry/components/magicui/tweet-card.tsx
+++ b/registry/components/magicui/tweet-card.tsx
@@ -18,9 +18,9 @@ export const truncate = (str: string | null, length: number) => {
};
export const TweetSkeleton = () => (
- <div className="flex flex-col w-full h-full border rounded-lg p-4 gap-2 min-w-[18rem] max-h-max">
+ <div className="flex h-full max-h-max w-full min-w-[18rem] flex-col gap-2 rounded-lg border p-4">
<div className="flex flex-row gap-2">
- <Skeleton className="h-10 w-10 rounded-full shrink-0" />
+ <Skeleton className="h-10 w-10 shrink-0 rounded-full" />
<Skeleton className="h-10 w-full" />
</div>
<Skeleton className="h-20 w-full" />
@@ -28,13 +28,13 @@ export const TweetSkeleton = () => (
);
export const TweetNotFound = (_props: { error?: any }) => (
- <div className="flex flex-col w-full h-full border rounded-lg p-4 gap-2 items-center">
+ <div className="flex h-full w-full flex-col items-center gap-2 rounded-lg border p-4">
<h3>Tweet not found</h3>
</div>
);
export const TweetHeader = ({ tweet }: { tweet: EnrichedTweet }) => (
- <div className="flex justify-between tracking-tight flex-row">
+ <div className="flex flex-row justify-between tracking-tight">
<div className="flex items-center space-x-2">
<a href={tweet.user.url} target="_blank" rel="noreferrer">
<img
@@ -50,7 +50,7 @@ export const TweetHeader = ({ tweet }: { tweet: EnrichedTweet }) => (
href={tweet.user.url}
target="_blank"
rel="noreferrer"
- className="flex items-center font-semibold whitespace-nowrap"
+ className="flex items-center whitespace-nowrap font-semibold"
>
{truncate(tweet.user.name, 20)}
{tweet.user.verified || tweet.user.is_blue_verified ? (
@@ -79,13 +79,13 @@ export const TweetHeader = ({ tweet }: { tweet: EnrichedTweet }) => (
</div>
<a href={tweet.url} target="_blank" rel="noreferrer">
<span className="sr-only">Link to tweet</span>
- <Twitter className="h-5 w-5 text-[#3BA9EE] transition-all ease-in-out hover:scale-105 items-start" />
+ <Twitter className="h-5 w-5 items-start text-[#3BA9EE] transition-all ease-in-out hover:scale-105" />
</a>
</div>
);
export const TweetBody = ({ tweet }: { tweet: EnrichedTweet }) => (
- <div className="break-words tracking-tighter leading-normal">
+ <div className="break-words leading-normal tracking-tighter">
{tweet.entities.map((entity, idx) => {
switch (entity.type) {
case "url":
@@ -132,8 +132,8 @@ export const MyTweet = ({
return (
<div
className={cn(
- "backdrop-blur-md rounded-lg p-4 border relative gap-2 flex flex-col w-full h-32 overflow-hidden max-h-max",
- className
+ "relative flex h-32 max-h-max w-full flex-col gap-2 overflow-hidden rounded-lg border p-4 backdrop-blur-md",
+ className,
)}
{...props}
>
diff --git a/registry/index.tsx b/registry/index.tsx
index 857b4682..d7a56629 100644
--- a/registry/index.tsx
+++ b/registry/index.tsx
@@ -51,7 +51,7 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/magic-card-demo.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/magic-card-demo")
+ () => import("@/registry/components/example/magic-card-demo"),
),
},
"linear-gradient-demo": {
@@ -59,7 +59,7 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/linear-gradient-demo.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/linear-gradient-demo")
+ () => import("@/registry/components/example/linear-gradient-demo"),
),
},
"radial-gradient-demo": {
@@ -67,7 +67,7 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/radial-gradient-demo.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/radial-gradient-demo")
+ () => import("@/registry/components/example/radial-gradient-demo"),
),
},
"meteors-demo": {
@@ -75,7 +75,7 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/meteors-demo.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/meteors-demo")
+ () => import("@/registry/components/example/meteors-demo"),
),
},
"grid-pattern-demo": {
@@ -83,7 +83,7 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/grid-pattern-demo.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/grid-pattern-demo")
+ () => import("@/registry/components/example/grid-pattern-demo"),
),
},
"grid-pattern-linear-gradient": {
@@ -91,7 +91,8 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/grid-pattern-linear-gradient.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/grid-pattern-linear-gradient")
+ () =>
+ import("@/registry/components/example/grid-pattern-linear-gradient"),
),
},
"grid-pattern-dashed": {
@@ -99,7 +100,7 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/grid-pattern-dashed.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/grid-pattern-dashed")
+ () => import("@/registry/components/example/grid-pattern-dashed"),
),
},
"dot-pattern-demo": {
@@ -107,7 +108,7 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/dot-pattern-demo.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/dot-pattern-demo")
+ () => import("@/registry/components/example/dot-pattern-demo"),
),
},
"dot-pattern-linear-gradient": {
@@ -115,7 +116,7 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/dot-pattern-linear-gradient.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/dot-pattern-linear-gradient")
+ () => import("@/registry/components/example/dot-pattern-linear-gradient"),
),
},
@@ -124,7 +125,7 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/marquee-demo.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/marquee-demo")
+ () => import("@/registry/components/example/marquee-demo"),
),
},
"marquee-logos": {
@@ -132,7 +133,7 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/marquee-logos.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/marquee-logos")
+ () => import("@/registry/components/example/marquee-logos"),
),
},
"tweet-card-demo": {
@@ -140,7 +141,7 @@ const example: Registry = {
type: "components:example",
files: ["registry/components/example/tweet-card-demo.tsx"],
component: React.lazy(
- () => import("@/registry/components/example/tweet-card-demo")
+ () => import("@/registry/components/example/tweet-card-demo"),
),
},
};
diff --git a/registry/schema.ts b/registry/schema.ts
index ded9febe..39abe976 100644
--- a/registry/schema.ts
+++ b/registry/schema.ts
@@ -13,7 +13,7 @@ export const registrySchema = z.record(
"components:example",
]),
component: z.function().args(z.any()).returns(z.any()).optional(),
- })
+ }),
);
export type Registry = z.infer<typeof registrySchema>;
diff --git a/styles/globals.css b/styles/globals.css
index 0063f595..cbeb9faa 100644
--- a/styles/globals.css
+++ b/styles/globals.css
@@ -2,7 +2,6 @@
@tailwind components;
@tailwind utilities;
-
@layer base {
:root {
--background: 0 0% 100%;
@@ -69,15 +68,15 @@
}
}
-
-
@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
- font-feature-settings: "rlig" 1, "calt" 1;
+ font-feature-settings:
+ "rlig" 1,
+ "calt" 1;
}
}
@@ -87,7 +86,7 @@
}
.step:before {
- @apply absolute w-9 h-9 bg-muted rounded-full font-mono font-medium text-center text-base inline-flex items-center justify-center -indent-px border-4 border-background;
+ @apply absolute inline-flex h-9 w-9 items-center justify-center rounded-full border-4 border-background bg-muted text-center -indent-px font-mono text-base font-medium;
@apply ml-[-50px] mt-[-4px];
content: counter(step);
}
@@ -97,4 +96,4 @@
.container {
@apply px-4;
}
-}
\ No newline at end of file
+}
diff --git a/styles/mdx.css b/styles/mdx.css
index 44679b95..e0607626 100644
--- a/styles/mdx.css
+++ b/styles/mdx.css
@@ -1,82 +1,86 @@
[data-theme="light"] {
- display: block;
- }
-
- [data-theme="dark"] {
- display: none;
- }
-
- .dark [data-theme="light"] {
- display: none;
- }
-
- .dark [data-theme="dark"] {
- display: block;
- }
-
- [data-rehype-pretty-code-fragment] {
- @apply relative;
- }
-
-
- [data-rehype-pretty-code-fragment] code {
- @apply grid min-w-full break-words rounded-none border-0 bg-transparent p-0;
- counter-reset: line;
- box-decoration-break: clone;
- line-height: 1.7;
-
- }
-
- [data-rehype-pretty-code-fragment] .line {
- @apply px-4 min-h-[1rem] py-0.5 w-full inline-block;
- }
-
- [data-rehype-pretty-code-fragment] [data-line-numbers] .line {
- @apply px-2;
- }
-
- [data-rehype-pretty-code-fragment] [data-line-numbers] > .line--highlighted::before {
- @apply text-slate-600
- }
-
- [data-rehype-pretty-code-fragment] [data-line-numbers] > .line::before {
- @apply text-slate-400 text-xs;
- counter-increment: line;
- content: counter(line);
- display: inline-block;
- width: 1rem;
- margin-right: 2rem;
- text-align: right;
- }
-
- [data-rehype-pretty-code-fragment] code[data-line-numbers-max-digits='2'] > .line::before {
- width: 2rem;
- }
-
- [data-rehype-pretty-code-fragment] code[data-line-numbers-max-digits='3'] > .line::before {
- width: 3rem;
- }
-
- [data-rehype-pretty-code-fragment] .line--highlighted {
- @apply bg-slate-700/50;
- }
-
- [data-rehype-pretty-code-fragment] .line-highlighted span {
- @apply relative;
- }
-
- [data-rehype-pretty-code-fragment] .word--highlighted {
- @apply rounded-md bg-slate-700/50 border-slate-700/70 p-1;
- }
-
- .dark [data-rehype-pretty-code-fragment] .word--highlighted {
- @apply bg-slate-900;
- }
-
- [data-rehype-pretty-code-title] {
- @apply mt-2 pt-6 px-4 text-sm font-medium
- }
-
- [data-rehype-pretty-code-title] + pre {
- @apply mt-2;
- }
\ No newline at end of file
+ display: block;
+}
+
+[data-theme="dark"] {
+ display: none;
+}
+
+.dark [data-theme="light"] {
+ display: none;
+}
+
+.dark [data-theme="dark"] {
+ display: block;
+}
+
+[data-rehype-pretty-code-fragment] {
+ @apply relative;
+}
+
+[data-rehype-pretty-code-fragment] code {
+ @apply grid min-w-full break-words rounded-none border-0 bg-transparent p-0;
+ counter-reset: line;
+ box-decoration-break: clone;
+ line-height: 1.7;
+}
+
+[data-rehype-pretty-code-fragment] .line {
+ @apply inline-block min-h-[1rem] w-full px-4 py-0.5;
+}
+
+[data-rehype-pretty-code-fragment] [data-line-numbers] .line {
+ @apply px-2;
+}
+
+[data-rehype-pretty-code-fragment]
+ [data-line-numbers]
+ > .line--highlighted::before {
+ @apply text-slate-600;
+}
+
+[data-rehype-pretty-code-fragment] [data-line-numbers] > .line::before {
+ @apply text-xs text-slate-400;
+ counter-increment: line;
+ content: counter(line);
+ display: inline-block;
+ width: 1rem;
+ margin-right: 2rem;
+ text-align: right;
+}
+
+[data-rehype-pretty-code-fragment]
+ code[data-line-numbers-max-digits="2"]
+ > .line::before {
+ width: 2rem;
+}
+
+[data-rehype-pretty-code-fragment]
+ code[data-line-numbers-max-digits="3"]
+ > .line::before {
+ width: 3rem;
+}
+
+[data-rehype-pretty-code-fragment] .line--highlighted {
+ @apply bg-slate-700/50;
+}
+
+[data-rehype-pretty-code-fragment] .line-highlighted span {
+ @apply relative;
+}
+
+[data-rehype-pretty-code-fragment] .word--highlighted {
+ @apply rounded-md border-slate-700/70 bg-slate-700/50 p-1;
+}
+
+.dark [data-rehype-pretty-code-fragment] .word--highlighted {
+ @apply bg-slate-900;
+}
+
+[data-rehype-pretty-code-title] {
+ @apply mt-2 px-4 pt-6 text-sm font-medium;
+}
+
+[data-rehype-pretty-code-title] + pre {
+ @apply mt-2;
+}
diff --git a/tsconfig.json b/tsconfig.json
index 17bf9fcd..688c840c 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -25,6 +25,12 @@
"contentlayer/generated": ["./.contentlayer/generated"]
}
},
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".contentlayer/generated"],
+ "include": [
+ "next-env.d.ts",
+ "**/*.ts",
+ "**/*.tsx",
+ ".next/types/**/*.ts",
+ ".contentlayer/generated"
+ ],
"exclude": ["node_modules"]
}
diff --git a/yarn.lock b/yarn.lock
index e61fc6b6..d5c69584 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5916,6 +5916,16 @@ prelude-ls@^1.2.1:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
+prettier-plugin-tailwindcss@^0.4.1:
+ version "0.4.1"
+ resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.4.1.tgz#f7ed664199540978b2cbd037bac3a337d6689e86"
+ integrity sha512-hwn2EiJmv8M+AW4YDkbjJ6HlZCTzLyz1QlySn9sMuKV/Px0fjwldlB7tol8GzdgqtkdPtzT3iJ4UzdnYXP25Ag==
+
+prettier@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae"
+ integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==
+
pretty-bytes@^5.6.0:
version "5.6.0"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"