This commit is contained in:
Ubuntu
2026-07-03 16:58:28 +08:00
commit 32b43f85bd
6240 changed files with 1987678 additions and 0 deletions
@@ -0,0 +1,98 @@
import React from "react";
import { allDocs } from "contentlayer/generated";
import { notFound } from "next/navigation";
import { format } from "date-fns";
import MDX from "@/components/MDX";
import { Text } from "@/components/retroui/Text";
import { Metadata } from "next";
import { MoveUpRightIcon } from "lucide-react";
import { generateToc } from "@/lib/toc";
import TableOfContents from "@/components/TableOfContents";
interface IProps {
params: { slug: string[] };
}
function getDocParams({ params }: IProps) {
const slug = `/docs${params.slug ? `/${params.slug.join("/")}` : ""}`;
const doc = allDocs.find((doc) => doc.url === slug);
if (!doc) {
return null;
}
return doc;
}
export async function generateMetadata({ params }: IProps): Promise<Metadata> {
const doc = getDocParams({ params });
if (!doc) {
return {
title: "Not Found | Retro UI",
};
}
return {
title: `${doc.title} | Retro UI`,
description: doc.description,
};
}
export default async function page({ params }: IProps) {
const doc = getDocParams({ params });
if (!doc) {
return notFound();
}
const toc = await generateToc(doc.body.raw);
return (
<>
{/* Main Content */}
<div className="flex-1 space-y-12 py-12 px-4 max-w-2xl mx-auto w-full">
<div className="border-b pb-6">
<Text as="h1" className="text-4xl">
{doc.title}
</Text>
<p className="text-lg text-muted-foreground mt-2">
{doc.description}
</p>
{doc.links && (
<div className="flex space-x-4 text-sm mt-4 text-black">
{doc.links?.api_reference && (
<a
className="flex items-center bg-gray-200 px-1.5 py-.5"
href={doc.links.api_reference}
target="_blank"
>
API Reference <MoveUpRightIcon className="h-3 w-3 ml-1" />
</a>
)}
{doc.links && doc.links?.source && (
<a
className="flex items-center bg-gray-200 px-1.5 py-.5"
href={doc.links.source}
target="_blank"
>
Source <MoveUpRightIcon className="h-3 w-3 ml-1" />
</a>
)}
</div>
)}
</div>
<div>
<MDX code={doc.body.code} />
</div>
<p className="text-right">
Last Updated: {format(doc.lastUpdated, "dd MMM, yyy")}
</p>
</div>
{/* Table of Contents */}
<div className="hidden lg:block lg:w-60 flex-shrink-0 sticky top-36 self-start space-y-6">
<TableOfContents toc={toc} />
</div>
</>
);
}
+26
View File
@@ -0,0 +1,26 @@
import SideNav from "@/components/SideNav";
import { Metadata } from "next";
export const metadata: Metadata = {
title: "Getting Started | RetroUI",
};
export default function ComponentLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<div className="relative max-w-7xl mx-auto">
<div className="max-lg:px-4">
<div className="flex lg:gap-20 items-start">
{/* Sidebar */}
<div className="hidden lg:block w-60 flex-shrink-0 sticky top-28 self-start">
<SideNav />
</div>
{children}
</div>
</div>
</div>
);
}
@@ -0,0 +1,154 @@
import React from "react";
import { notFound } from "next/navigation";
import { format } from "date-fns";
import { Avatar, Badge, Button, Text } from "@/components/retroui";
import { Metadata } from "next";
import Image from "next/image";
import Link from "next/link";
import { RichText } from "@payloadcms/richtext-lexical/react";
import { JSXConverters } from "@/components/RichTextConverter";
interface IProps {
params: { slug: string[] };
}
type Post = {
id: number,
title: string,
slug: string,
publishedAt: string,
content: any,
excerpt: string,
tags: {
name: string,
slug: string
}[],
featuredImage: {
url: string,
alt: string
},
}
async function getBlogParams({ params }: IProps) {
const res = await fetch(`https://cms.retroui.dev/api/posts/slug/${params.slug}`, {
method: 'GET',
credentials: 'include',
next: {
revalidate: 60,
},
})
const post = await res.json()
return post;
}
export async function generateMetadata({ params }: IProps): Promise<Metadata> {
const blog: Post = await getBlogParams({ params });
if (!blog) {
return {
title: "Not Found | Retro UI",
};
}
return {
title: `${blog.title} | RetroUI Blogs`,
description: blog.excerpt,
alternates: {
canonical: `https://www.retroui.dev/blogs/${blog.slug}`,
},
openGraph: {
type: "article",
images: blog.featuredImage.url,
title: `${blog.title} | RetroUI Blogs`,
publishedTime: blog.publishedAt,
authors: ["Arif Hossain"],
},
};
}
export default async function page({ params }: IProps) {
const blog: Post | null = await getBlogParams({ params });
if (!blog) {
return notFound();
}
return (
<article className="max-w-3xl mt-8 mx-auto">
<div className="border-b border-black pb-6 mb-6">
<div className="flex items-center gap-4 mb-6">
<Text className="text-muted-foreground text-sm font-medium">
{format(new Date(blog.publishedAt), "dd, MMMM yyyy")}
</Text>
<Text>|</Text>
<div className="flex items-center gap-3">
{blog.tags.map((tag) => (
<Badge
key={tag.slug}
size="sm"
variant="surface"
className={`bg-${["red", "green", "blue", "yellow", "purple", "pink"][
blog.tags.indexOf(tag) % 6
]
}-300`}
>
{tag.name}
</Badge>
))}
</div>
</div>
<Text as="h1" className="mb-2">
{blog.title}
</Text>
<Text className="text-muted-foreground mb-12">
{blog.excerpt}
</Text>
<Image
src={`https://cms.retroui.dev${blog.featuredImage.url}`}
alt={blog.featuredImage.alt}
width={1200}
height={800}
className="mb-8"
/>
<div className="flex justify-between items-start">
<div className="flex gap-4">
<Avatar>
<Avatar.Image src="https://pub-5f7cbdfd9ffa4c838e386788f395f0c4.r2.dev/arif.jpg" alt="Arif Hossain" />
<Avatar.Fallback>AH</Avatar.Fallback>
</Avatar>
<div>
<Text as="h5">Arif Hossain</Text>
<Link
href={`https://x.com/@ariflogs`}
target="_blank"
className="text-muted-foreground"
>
@ariflogs
</Link>
</div>
</div>
<Link
target="_blank"
href={`https://x.com/share?url=${`https://www.retroui.dev/blogs/${blog.slug}`}&text=${blog.title}.%0ACheck it out 👉`}
>
<Button size="sm" variant="outline">
Share on X
</Button>
</Link>
</div>
</div>
<RichText
data={blog.content}
converters={JSXConverters}
/>
<hr className="my-12" />
<Button asChild aria-label="Return to all blog posts" variant="secondary">
<Link href="/blogs" className="inline-flex">← Back to blogs</Link>
</Button>
</article>
);
}
+18
View File
@@ -0,0 +1,18 @@
import { Metadata } from "next";
import Footer from "@/components/footer";
export const metadata: Metadata = {
title: "RetroUI Blogs",
};
export default function BlogsLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<>
<div className="max-w-6xl mx-auto py-12 px-4 lg:px-0">{children}</div>
<Footer />
</>
);
}
+75
View File
@@ -0,0 +1,75 @@
import { allBlogs } from "@/.contentlayer/generated";
import { Avatar, Card, Text } from "@/components/retroui";
import Image from "next/image";
import Link from "next/link";
import React from "react";
import { format } from "date-fns";
import { sdk } from "@/lib/payload"
type Post = {
id: number,
title: string,
slug: string,
publishedAt: string,
excerpt: string,
featuredImage: {
url: string,
alt: string
},
}
async function page() {
const res = await fetch("https://cms.retroui.dev/api/posts/published", {
method: 'GET',
credentials: 'include',
next: {
revalidate: 60,
},
})
const posts = await res.json()
return (
<div>
<Text as="h1" className="mb-12">
All RetroUI Blogs
</Text>
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6 lg:gap-8">
{posts.docs.map((blog: Post) => (
<Link href={`/blogs/${blog.slug}`} key={blog.id}>
<Card className="shadow-none hover:-translate-x-2 hover:-translate-y-2 hover:shadow-lg">
<Card.Header>
<Image
src={`https://cms.retroui.dev${blog.featuredImage?.url}`}
alt={blog.title}
width={600}
height={400}
className="mb-6 h-50"
/>
<Text as="p" className="mb-2 text-sm text-muted-foreground">
{format(new Date(blog.publishedAt), "dd, MMMM yyyy")}
</Text>
<Card.Title className="line-clamp-2 text-2xl">{blog.title}</Card.Title>
<Card.Description className="line-clamp-2 text-sm">{blog.excerpt}</Card.Description>
</Card.Header>
{/* <Card.Content className="pt-0">
<div className="flex gap-2 items-center">
<Avatar className="h-8 w-8 border">
<Avatar.Image src="https://pub-5f7cbdfd9ffa4c838e386788f395f0c4.r2.dev/arif.jpg" alt="Arif Hossain" />
<Avatar.Fallback>AH</Avatar.Fallback>
</Avatar>
<Text className="text-sm">Arif Hossain</Text>
</div>
</Card.Content> */}
</Card>
</Link>
))}
</div>
</div>
);
}
export default page;
+327
View File
@@ -0,0 +1,327 @@
"use server";
import {
Button,
Text,
Input,
Textarea,
Card,
Avatar,
Badge,
CommandDisplay,
} from "@/components/retroui";
import AccordionStyleDefault from "@/preview/components/accordion-style-default";
import AlertStyleDefaultIcon from "@/preview/components/alert-style-with-icon";
import AvatarStyleCircle from "@/preview/components/avatar-style-circle-sizes";
import BadgeStyleVariants from "@/preview/components/badge-style-variants";
import {
ArrowRightIcon,
ChartArea,
GithubIcon,
MessageCircle,
PaintbrushIcon,
} from "lucide-react";
import Image from "next/image";
import Link from "next/link";
import Footer from "@/components/footer";
import WorksWithSection from "@/components/WorksWithSection";
async function getContributors(): Promise<
{ avatar: string; username: string; url: string }[]
> {
const request = await fetch(
`https://api.github.com/repos/logging-studio/RetroUI/contributors`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
},
);
const contributorsList = await request.json();
return contributorsList.map(
(c: { avatar_url: string; login: string; html_url: string }) => ({
avatar: c.avatar_url,
username: c.login,
url: c.html_url,
}),
);
}
export default async function Home() {
const contributors = await getContributors();
return (
<main>
<div className="bg-image bg-cover bg-no-repeat bg-center flex flex-col items-center min-h-screen">
<section className="container max-w-6xl mx-auto px-4 lg:px-0 text-gray-900 flex justify-center items-center lg:gap-28 my-28">
<div className="text-center lg:text-left w-full lg:w-2/3">
<Link href="https://neo.retroui.dev" target="_blank" className="mb-4 inline-block">
<Badge>
Introducing Neo/SS
<PaintbrushIcon className="ml-2 h-4 w-4 inline-block" />
</Badge>
</Link>
<Text as="h1" className="text-5xl text-foreground lg:text-6xl mt-8">
Make your projects
<br />
<span className="text-outlined">stand out!</span>
</Text>
<p className="text-lg text-muted-foreground mb-8 mt-4">
A NeoBrutalism styled React + TailwindCSS UI library for building bold, modern web apps.
Perfect for any project using Shadcn/ui.
</p>
<div className="flex flex-col md:flex-row items-center gap-4">
<Link href="/docs" passHref>
<Button
className="w-full"
aria-label="Get Started with RetroUI"
>
Get Started
</Button>
</Link>
<div className="w-full max-w-72 shadow shadow-primary">
<CommandDisplay command='npx shadcn add @retroui/button' />
</div>
</div>
</div>
<div className="hidden lg:block lg:w-1/3">
<Image
alt="retro tv radio"
src="/images/tv_radio.png"
layout="responsive"
width={500}
height={500}
className="h-full w-full"
/>
</div>
</section>
<section className="container max-w-6xl mx-auto px-4 lg:px-0 lg:my-36">
{/* <Text as="h2" className="mb-16 text-center">
Old school with modern twist! ✨
</Text> */}
<div className="grid gap-6 grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 mb-8">
<Card className="w-full bg-background shadow-none">
<Card.Header>
<Card.Title>Button</Card.Title>
</Card.Header>
<Card.Content>
<div className="flex flex-wrap gap-4">
<Button>Primary</Button>
<Button variant="outline">Outline</Button>
</div>
</Card.Content>
</Card>
<Card className="w-full bg-background shadow-none">
<Card.Header>
<Card.Title>Badge</Card.Title>
</Card.Header>
<Card.Content>
<BadgeStyleVariants />
</Card.Content>
</Card>
<Card className="w-full bg-background shadow-none">
<Card.Header>
<Card.Title>Avatar</Card.Title>
</Card.Header>
<Card.Content>
<AvatarStyleCircle />
</Card.Content>
</Card>
<Card className="w-full bg-background shadow-none">
<Card.Header>
<Card.Title>Accordion</Card.Title>
</Card.Header>
<Card.Content>
<AccordionStyleDefault />
</Card.Content>
</Card>
<Card className="w-full bg-background shadow-none">
<Card.Header>
<Card.Title>Input & Textarea</Card.Title>
</Card.Header>
<Card.Content>
<Input />
<div className="h-4"></div>
<Textarea className="border-foreground" />
</Card.Content>
</Card>
<Card className="w-full bg-background shadow-none">
<Card.Header>
<Card.Title>Alert</Card.Title>
</Card.Header>
<Card.Content>
<AlertStyleDefaultIcon />
</Card.Content>
</Card>
</div>
</section>
</div>
<section className="container max-w-6xl mx-auto px-4 lg:px-0 flex flex-col lg:flex-row gap-12 lg:gap-16 lg:grid-cols-2 my-36">
<div className="w-full lg:w-3/5">
<Text as="h2">
Easily <span className="text-outlined">Customize</span> to Your Own
Needs! 🛠️
</Text>
<div className="flex flex-col space-y-1 mt-6 mb-8 text-muted-foreground">
<Text className="text-lg">
Copy-Paste Ready: Components that you can just copy paste.
</Text>
<Text className="text-lg">
Tailwind Based: Customizable with Tailwind CSS.
</Text>
<Text className="text-lg">
Type Safe: Typescript support for all components.
</Text>
</div>
<Link href="/docs/components/button" passHref>
<Button>See Examples</Button>
</Link>
</div>
<div className="w-full lg:w-2/5">
<Image
src="/images/code_show.svg"
width={600}
height={400}
alt="retroui code showcase"
/>
</div>
</section>
<section className="container max-w-6xl max-lg:px-4 mx-auto bg-[url('/images/starts_bg.svg')] bg-cover bg-no-repeat py-12">
<Text as="h2" className="text-center mb-28 max-w-2xl mx-auto">
A <span className="text-outlined">Growing</span> Community of Developers and Designers.
</Text>
<div className="grid grid-cols-1 md:grid-cols-2 gap-12 max-w-3xl mx-auto">
<div className="flex flex-col items-start relative mx-auto">
<Text as="h3" className="mb-2 font-sans">
Github Stars
</Text>
<Text className="text-outlined text-7xl lg:text-8xl font-head">
1,200+
</Text>
<Image
src="/images/shooting_star.svg"
width={120}
height={120}
alt="shotting stars"
className="absolute -top-[80px] -left-[80px]"
/>
</div>
<div className="flex flex-col items-start relative mx-auto">
<Text as="h3" className="mb-2 font-sans">
Discord Members
</Text>
<Text className="text-outlined text-7xl lg:text-8xl font-head">
100+
</Text>
<Image
src="/images/shooting_star.svg"
width={120}
height={120}
alt="shotting stars"
className="absolute -right-[80px] -bottom-[80px] rotate-180"
/>
</div>
</div>
</section>
<WorksWithSection />
<section className="container max-w-6xl mx-auto border-2 bg-primary border-black py-16 px-4 lg:p-16 my-36">
<Text as="h2" className="text-center text-black mb-2">
Community Contributors
</Text>
<Text className="text-xl text-center text-black mb-8">
RetroUI core is free and open-source, and it is made possible by our
awesome contributors.
</Text>
<div className="max-w-2xl mx-auto flex flex-wrap justify-center gap-2 lg:gap-4">
{contributors.map((contributor) => (
<Link
key={contributor.username}
href={contributor.url}
target="_blank"
passHref
className="flex flex-col items-center"
>
<Avatar className="h-10 w-10 border-black lg:h-16 lg:w-16">
<Avatar.Image
src={contributor.avatar}
alt={contributor.username}
/>
</Avatar>
</Link>
))}
</div>
<div className="flex flex-col lg:flex-row items-center justify-center gap-4 mt-12">
<Link
href="https://github.com/logging-studio/retroui"
target="_blank"
passHref
>
<Button
className="bg-background"
variant="outline"
>
<GithubIcon size="16" className="mr-2" />
Star on Github
</Button>
</Link>
<Link href="https://discord.gg/Jum3NJxK6Q" target="_blank" passHref>
<Button
className="bg-background"
variant="outline"
>
<MessageCircle size="16" className="mr-2" />
Join Community
</Button>
</Link>
</div>
</section>
<section className="mx-auto px-4">
<div className="container max-w-6xl h-full mx-auto py-16 flex flex-col justify-between gap-20">
<div className="flex flex-col md:flex-row items-center gap-10">
<div className="w-full md:w-3/5">
<Text as="h1" className="text-4xl lg:text-5xl">
Ship <span className="text-outlined">Faster</span> With Blocks
<br />
and Templates 🚀
</Text>
<Text
as="p"
className="text-muted-foreground font-medium text-xl mt-2 mb-8"
>
Get access to 100+ premium blocks, templates and figma kit,
ready to make your project stand out.
</Text>
<Link href="https://pro.retroui.dev/blocks" target="_blank">
<Button>Explore RetroUI Pro</Button>
</Link>
</div>
<div className="w-full md:w-2/5">
<Image
src="/images/pro_showcase.svg"
width={1920}
height={1080}
alt="retroui pro ui blocks showcase"
/>
</div>
</div>
</div>
</section>
<Footer />
</main>
);
}
+57
View File
@@ -0,0 +1,57 @@
import showcaseData from "@/showcase.json";
import { Card, Text, Button } from "@/components/retroui";
import Image from "next/image";
import Link from "next/link";
import { ArrowUpRight } from "lucide-react";
import Footer from "@/components/footer";
export default function ShowcasePage() {
return (
<>
<div className="max-w-6xl mx-auto py-12 px-4 lg:px-0">
<div className="mb-12 flex flex-col gap-2 items-start">
<Text as="h1">
Showcase
</Text>
<Text className="text-lg text-muted-foreground mb-4">
Build something cool using RetroUI? Share it with the community.
</Text>
<Button asChild>
<Link href="https://github.com/Logging-Studio/RetroUI/discussions/102" target="_blank">
Add Your Project
</Link>
</Button>
</div>
<ul className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{Object.entries(showcaseData).map(([key, value]) => (
<li key={key}>
<Card className="hover:shadow">
<Card.Header>
<Image
src={value.cover}
alt={value.name}
width={600}
height={400}
className="mb-6 border-2 h-[200px] w-full object-fit border-muted-foreground"
/>
<div className="flex items-center justify-between gap-2">
<Card.Title>{value.name}</Card.Title>
<Button asChild size="sm" variant="secondary">
<Link href={value.url} target="_blank" rel="noopener noreferrer">
Visit <ArrowUpRight className="ml-2 h-4 w-4" />
</Link>
</Button>
</div>
</Card.Header>
</Card>
</li>
))}
</ul>
</div>
<Footer />
</>
);
}
+144
View File
@@ -0,0 +1,144 @@
"use client";
import {
Card,
Select,
Text,
} from "@/components/retroui";
import ChartStyleMultiple from "@/preview/charts/area-chart-style-multiple";
import CourseCard from "@/preview/blocks/course-card";
import SignInBlock from "@/preview/blocks/sign-in";
import BarChartStyleMultiple from "@/preview/charts/bar-chart-style-multiple";
import TeamMembersBlock from "@/preview/blocks/team-members";
import CopyTheme from "@/components/CopyTheme";
import { Theme } from "@/config/theme";
import { useTheme } from "@/contexts/ThemeContext";
const themes: {value: Theme, label: string}[] = [
{
value: Theme.Default,
label: "Default",
},
{
value: Theme.Purple,
label: "Purple",
},
{
value: Theme.Lime,
label: "Lime",
},
{
value: Theme.Red,
label: "Red",
},
{
value: Theme.Lavender,
label: "Lavender",
},
{
value: Theme.Orange,
label: "Orange",
},
{
value: Theme.Green,
label: "Green",
},
];
const variants = [
{
value: "box",
label: "Box",
},
{
value: "with-radius",
label: "Rounded",
},
];
export default function Themes() {
const { colorTheme, variant, setColorTheme, setVariant } = useTheme();
return (
<section className={`theme-${colorTheme} ${variant} container max-w-8xl mx-auto py-12`}>
<Text as="h1" className="font-normal mb-12">Don&apos;t like <span className="text-primary">{colorTheme === Theme.Default ? "Yellow" : colorTheme.slice(0, 1).toUpperCase() + colorTheme.slice(1)}?</span><br />Well, we have more! 🫡</Text>
<div className="flex flex-col lg:flex-row gap-6 items-center justify-between mb-6">
<div className="flex gap-6">
<Select value={colorTheme} onValueChange={(value: Theme) => setColorTheme(value)}>
<Select.Trigger>
<Select.Value placeholder="Select Color" />
</Select.Trigger>
<Select.Content>
<Select.Group>
{
themes.map((theme) => (
<Select.Item key={theme.value} value={theme.value}>
{theme.label}
</Select.Item>
))
}
</Select.Group>
</Select.Content>
</Select>
<Select value={variant} onValueChange={(value) => setVariant(value)}>
<Select.Trigger>
<Select.Value placeholder="Select Variant" />
</Select.Trigger>
<Select.Content>
<Select.Group>
{
variants.map((variant) => (
<Select.Item key={variant.value} value={variant.value}>
{variant.label}
</Select.Item>
))
}
</Select.Group>
</Select.Content>
</Select>
</div>
<CopyTheme theme={colorTheme} hasRadius={variant === "with-radius"} />
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 w-full gap-6">
<div className="flex flex-col gap-6">
<Card className="w-full border-muted bg-background shadow-none">
<Card.Content>
<CourseCard />
</Card.Content>
</Card>
<Card className="w-full border-muted bg-background shadow-none">
<Card.Content>
<TeamMembersBlock />
</Card.Content>
</Card>
</div>
<div className="flex flex-col gap-6">
<Card className="w-full border-muted bg-background shadow-none">
<Card.Content>
<ChartStyleMultiple />
</Card.Content>
</Card>
<Card className="w-full border-muted bg-background shadow-none">
<Card.Content>
<BarChartStyleMultiple />
</Card.Content>
</Card>
</div>
<Card className="w-full border-muted bg-background shadow-none">
<Card.Content>
<SignInBlock />
</Card.Content>
</Card>
</div>
</section>
);
}
@@ -0,0 +1,32 @@
"use client";
import React from "react";
import { TableOfContents } from "@/components/retroui/TableOfContents";
export default function page() {
return (
<div className="container max-w-6xl mx-auto space-y-6 flex">
<div className="flex-1">
<h1>Table of Contents</h1>
<h1>Table of Contents 1</h1>
<div className="h-80"></div>
<h2>Table of Contents 2</h2>
<div className="h-80"></div>
<h3>Table of Contents 3</h3>
<h3>Table of Contents 3</h3>
<h3>Table of Contents 3</h3>
<div className="h-80"></div>
<h4>Table of Contents 4</h4>
<h4>Table of Contents 4</h4>
<h4>Table of Contents 4</h4>
<div className="h-80"></div>
<h5>Table of Contents 5</h5>
<h6>Table of Contents 6</h6>
</div>
<TableOfContents />
</div>
);
}
+25
View File
@@ -0,0 +1,25 @@
"use server";
import { Resend } from "resend";
const resend = new Resend(process.env.RESEND_API_KEY);
export async function subscribeToNewsletter(email: string) {
try {
const { data, error } = await resend.contacts.create({
email,
audienceId: process.env.RESEND_AUDIENCE_ID!,
});
if (error) {
return { success: false, error: error.message };
}
return { success: true, data };
} catch (error) {
return {
success: false,
error: error instanceof Error ? error.message : "Failed to subscribe",
};
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+494
View File
@@ -0,0 +1,494 @@
@import "tailwindcss";
@import "tw-animate-css";
@theme inline {
--font-head: var(--font-head);
--font-sans: var(--font-sans);
--radius: var(--radius);
--shadow-xs: 1px 1px 0 0 var(--border);
--shadow-sm: 2px 2px 0 0 var(--border);
--shadow: 3px 3px 0 0 var(--border);
--shadow-md: 4px 4px 0 0 var(--border);
--shadow-lg: 6px 6px 0 0 var(--border);
--shadow-xl: 10px 10px 0 1px var(--border);
--shadow-2xl: 16px 16px 0 1px var(--border);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-primary-hover: var(--primary-hover);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--background-image: var(--background-image);
--chart-1: var(--chart-1);
--chart-2: var(--chart-2);
--chart-3: var(--chart-3);
--chart-4: var(--chart-4);
--chart-5: var(--chart-5);
}
:root {
--radius: 0;
--background: #fff;
--foreground: #000;
--card: #fff;
--card-foreground: #000;
--primary: #ffdb33;
--primary-hover: #ffcc00;
--primary-foreground: #000;
--secondary: #000;
--secondary-foreground: #fff;
--muted: #d5d5d5;
--muted-foreground: #5a5a5a;
--accent: #fae583;
--accent-foreground: #000;
--destructive: #e63946;
--destructive-foreground: #fff;
--border: #000;
--background-image: url("/images/banner_void_2.svg");
--chart-1: #c4a1ff;
--chart-2: #01ffcc;
--chart-3: #e7f192;
--chart-4: #000;
--chart-5: #ff30cd;
}
.dark {
--background: #1a1a1a;
--foreground: #f5f5f5;
--card: #242424;
--card-foreground: #f5f5f5;
--primary: #ffdb33;
--primary-hover: #ffcc00;
--primary-foreground: #000;
--secondary: #3a3a3a;
--secondary-foreground: #f5f5f5;
--muted: #3f3f46;
--muted-foreground: #a0a0a0;
--accent: #fae583;
--accent-foreground: #000;
--destructive: #e63946;
--destructive-foreground: #fff;
--border: #5c5c5c;
--background-image: url("/images/bg_void_3.svg");
--chart-1: #ffdb33;
--chart-2: #000;
--chart-3: #aeaeae;
--chart-4: #fae583;
--chart-5: #e63946;
}
.with-radius {
--radius: 0.5rem;
}
.theme-purple {
--background: #f5f5f5;
--foreground: #1a1a1a;
--card: #FFFFFF;
--card-foreground: #f5f5f5;
--primary: #5F4FE6;
--primary-hover: #4938C2;
--primary-foreground: #fff;
--secondary: #3a3a3a;
--secondary-foreground: #f5f5f5;
--muted: #CFCCEA;
--muted-foreground: #5B5686;
--accent: #FED13B;
--accent-foreground: #000000;
--destructive: #EF4444;
--destructive-foreground: #fff;
--border: #3a3a3a;
--background-image: url("/images/bg_void_3.svg");
--chart-1: #ffdb33;
--chart-2: #000;
--chart-3: #aeaeae;
--chart-4: #fae583;
--chart-5: #e63946;
}
.dark .theme-purple {
--background: #0f0f12;
--foreground: #f5f5f5;
--card: #1a1a1d;
--card-foreground: #eaeaea;
--primary: #7b6df5;
--primary-hover: #5F4FE6;
--primary-foreground: #fff;
--secondary: #2a2a2e;
--secondary-foreground: #eaeaea;
--muted: #3d395a;
--muted-foreground: #a49fce;
--accent: #FED13B;
--accent-foreground: #000;
--destructive: #EF4444;
--destructive-foreground: #fff;
--border: #2e2e32;
}
.theme-lime {
--background: #FFFFFF;
--foreground: #000000;
--card: #FFFFFF;
--card-foreground: #000000;
--input: #FFFFFF;
--border: #000000;
--ring: #AAFC3D;
--primary: #AAFC3D;
--primary-hover: #97f819;
--primary-foreground: #000000;
--secondary: #000000;
--secondary-foreground: #FFFFFF;
--muted: #F3F3F3;
--muted-foreground: #444444;
--accent: #FF4FD8;
--accent-foreground: #000000;
--destructive: #FF0033;
--destructive-foreground: #FFFFFF;
}
.dark .theme-lime {
--background: #0f0f0f;
--foreground: #f5f5f5;
--card: #1a1a1a;
--card-foreground: #FFFFFF;
--input: #2a2a2a;
--border: #333333;
--ring: #AAFC3D;
--primary: #AAFC3D;
--primary-hover: #97f819;
--primary-foreground: #000000;
--secondary: #FFFFFF;
--secondary-foreground: #000000;
--muted: #2a2a2a;
--muted-foreground: #aaaaaa;
--accent: #FF4FD8;
--accent-foreground: #000000;
--destructive: #FF0033;
--destructive-foreground: #FFFFFF;
}
.theme-red {
--background: #FCFFE7;
--foreground: #000000;
--muted: #EFD0D5;
--muted-foreground: #A42439;
--card: #FFFFFF;
--card-foreground: #000000;
--popover: #FFFFFF;
--popover-foreground: #000000;
--border: #000000;
--input: #FFFFFF;
--primary: #EA435F;
--primary-hover: #D00000;
--primary-foreground: #FFFFFF;
--secondary: #FFDA5C;
--secondary-foreground: #000000;
--accent: #CEEBFC;
--accent-foreground: #000000;
--destructive: #D00000;
--destructive-foreground: #FFFFFF;
--ring: #000000;
}
.dark .theme-red {
--background: #0f0f0f;
--foreground: #f5f5f5;
--muted: #3a1f24;
--muted-foreground: #f2a7b2;
--card: #1a1a1a;
--card-foreground: #ffffff;
--popover: #1a1a1a;
--popover-foreground: #ffffff;
--border: #2a2a2a;
--input: #2a2a2a;
--primary: #EA435F;
--primary-hover: #D00000;
--primary-foreground: #ffffff;
--secondary: #FFDA5C;
--secondary-foreground: #000000;
--accent: #2a3b45;
--accent-foreground: #CEEBFC;
--destructive: #D00000;
--destructive-foreground: #ffffff;
--ring: #EA435F;
}
.theme-lavender {
--background: #F9F5F2;
--foreground: #000000;
--muted: #EDE3FF;
--muted-foreground: #5B3B98;
--card: #FFFFFF;
--card-foreground: #000000;
--popover: #FFFFFF;
--popover-foreground: #000000;
--border: #000000;
--input: #FFFFFF;
--primary: #C4A1FF;
--primary-hover: #9678FF;
--primary-foreground: #000000;
--secondary: #E7F193;
--secondary-foreground: #000000;
--accent: #FE91E9;
--accent-foreground: #000000;
--destructive: #FE3B3B;
--destructive-foreground: #FFFFFF;
--ring: #000000;
}
.dark .theme-lavender {
--background: #121014;
--foreground: #f5f5f5;
--muted: #2d2440;
--muted-foreground: #c7b6f3;
--card: #1a1820;
--card-foreground: #ffffff;
--popover: #1a1820;
--popover-foreground: #ffffff;
--border: #2a2a2e;
--input: #2a2a2e;
--primary: #C4A1FF;
--primary-hover: #9678FF;
--primary-foreground: #000000;
--secondary: #E7F193;
--secondary-foreground: #000000;
--accent: #FE91E9;
--accent-foreground: #000000;
--destructive: #FE3B3B;
--destructive-foreground: #ffffff;
--ring: #C4A1FF;
}
.theme-orange {
--background: #FFFFFF;
--foreground: #000000;
--muted: #FFE1C7;
--muted-foreground: #8C3D00;
--card: #FFFFFF;
--card-foreground: #000000;
--popover: #FFFFFF;
--popover-foreground: #000000;
--border: #000000;
--input: #FFFFFF;
--primary: #F07200;
--primary-hover: #ff8011;
--primary-foreground: #FDEAD9;
--secondary: #EF8C27;
--secondary-foreground: #000000;
--accent: #FF6B6B;
--accent-foreground: #000000;
--destructive: #FE3B3B;
--destructive-foreground: #FFFFFF;
--ring: #000000;
}
.dark .theme-orange {
--background: #12100e;
--foreground: #f5f5f5;
--muted: #3a2617;
--muted-foreground: #ffb679;
--card: #1a1a1a;
--card-foreground: #ffffff;
--popover: #1a1a1a;
--popover-foreground: #ffffff;
--border: #2a2a2a;
--input: #2a2a2a;
--primary: #F07200;
--primary-hover: #ff8011;
--primary-foreground: #FDEAD9;
--secondary: #EF8C27;
--secondary-foreground: #000000;
--accent: #FF6B6B;
--accent-foreground: #000000;
--destructive: #FE3B3B;
--destructive-foreground: #ffffff;
--ring: #F07200;
}
.theme-green {
--background: #FFFFFF;
--foreground: #000000;
--muted: #CBE9D8;
--muted-foreground: #1F7751;
--card: #F9F5F2;
--card-foreground: #000000;
--popover: #FFFFFF;
--popover-foreground: #000000;
--border: #000000;
--input: #FFFFFF;
--primary: #599D77;
--primary-hover: #39654c;
--primary-foreground: #FFFFFF;
--secondary: #A3D9B1;
--secondary-foreground: #000000;
--accent: #FFE75A;
--accent-foreground: #000000;
--destructive: #F05D5D;
--destructive-foreground: #FFFFFF;
--ring: #000000;
}
.dark .theme-green {
--background: #0f1210;
--foreground: #f5f5f5;
--muted: #1f3a2d;
--muted-foreground: #9cd9b8;
--card: #181c19;
--card-foreground: #ffffff;
--popover: #181c19;
--popover-foreground: #ffffff;
--border: #2a2e2b;
--input: #2a2e2b;
--primary: #599D77;
--primary-hover: #39654c;
--primary-foreground: #ffffff;
--secondary: #3a6f52;
--secondary-foreground: #ffffff;
--accent: #FFE75A;
--accent-foreground: #000000;
--destructive: #F05D5D;
--destructive-foreground: #ffffff;
--ring: #599D77;
}
body {
font-family: var(--font-sans);
}
/* Firefox scrollbar */
html {
scrollbar-width: auto;
scrollbar-color: var(--muted) var(--foreground);
}
.bg-image {
background-image: var(--background-image);
background-size: cover;
background-position: center;
}
.text-outlined {
letter-spacing: 2px;
text-shadow:
0px 0px 0 var(--primary),
0px 0px 0 var(--primary),
4px 4px 0 var(--primary),
4px 4px 0 var(--primary);
}
/* Syntax Highlighting stuff */
pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}
code.hljs {
padding: 3px 5px;
}
.hljs {
background: #222;
color: #aaa;
}
.hljs-subst {
color: #aaa;
}
.hljs-section {
color: #fff;
}
.hljs-comment,
.hljs-quote,
.hljs-meta {
color: #444;
}
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-regexp {
color: #ffcc33;
}
.hljs-number,
.hljs-addition {
color: #00cc66;
}
.hljs-built_in,
.hljs-literal,
.hljs-type,
.hljs-template-variable,
.hljs-attribute,
.hljs-link {
color: #32aaee;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
color: #6644aa;
}
.hljs-title,
.hljs-variable,
.hljs-deletion,
.hljs-template-tag {
color: #bb1166;
}
.hljs-section,
.hljs-doctag,
.hljs-strong {
font-weight: bold;
}
.hljs-emphasis {
font-style: italic;
}
/* Custom scrollbar for sidebar */
.sidebar-scroll {
scrollbar-width: thin;
scrollbar-color: transparent transparent;
transition: scrollbar-color 0.3s ease;
}
.sidebar-scroll:hover {
scrollbar-color: var(--color-primary) transparent;
}
/* Webkit browsers (Chrome, Safari, Edge) */
.sidebar-scroll::-webkit-scrollbar {
width: 2px;
height: 2px;
}
.sidebar-scroll::-webkit-scrollbar-track {
background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
background: transparent;
border-radius: 2px;
transition: background 0.3s ease;
}
+95
View File
@@ -0,0 +1,95 @@
import TopNav from "@/components/TopNav";
import "./global.css";
import { Archivo_Black, Space_Grotesk, Space_Mono } from "next/font/google";
import { Metadata } from "next";
import { Toaster } from "@/components/retroui";
import { Analytics } from "@vercel/analytics/next";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { ThemeProvider } from "@/contexts/ThemeContext";
import ThemeWrapper from "@/components/ThemeWrapper";
const sans = Space_Grotesk({
subsets: ["latin"],
weight: "400",
variable: "--font-sans",
display: "swap",
});
const head = Archivo_Black({
subsets: ["latin"],
weight: "400",
variable: "--font-head",
display: "swap",
});
const mono = Space_Mono({
subsets: ["latin"],
weight: "400",
variable: "--font-mono",
display: "swap",
});
export const metadata: Metadata = {
title: "NeoBrutalism Styled React Components | RetroUI",
description:
"RetroUI - NeoBrutalism styled component library built with React and TailwindCSS for modern web apps.",
openGraph: {
images: "https://retroui.dev/banner.png",
title: "NeoBrutalism Styled React Components | RetroUI",
},
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<head>
<script
dangerouslySetInnerHTML={{
__html: `
(function() {
try {
const darkMode = localStorage.getItem('darkMode');
if (darkMode === 'dark') {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
} catch (e) {
console.error('Error applying theme:', e);
}
})();
`,
}}
/>
{/* <script
defer
src="https://cloud.umami.is/script.js"
data-website-id="97dd6182-c656-4265-97e0-ee9613b88078"
/> */}
<script
defer
data-website-id="dfid_zlQSgC5h2RNuCLHQTf7Fd"
data-domain="retroui.dev"
src="https://datafa.st/js/script.js">
</script>
</head>
<body
className={`${head.variable} ${sans.variable} ${mono.variable}`}
>
<ThemeProvider>
<div className="bg-background text-foreground">
<TopNav />
{children}
<Toaster />
</div>
</ThemeProvider>
<SpeedInsights />
<Analytics />
</body>
</html>
);
}
+11
View File
@@ -0,0 +1,11 @@
import type { MetadataRoute } from "next";
export default function robots(): MetadataRoute.Robots {
return {
rules: {
userAgent: "*",
allow: "/",
},
sitemap: "https://retroui.dev/sitemap.xml",
};
}
+40
View File
@@ -0,0 +1,40 @@
import { generateRegistryRssFeed } from "@wandry/analytics-sdk";
import type { NextRequest } from "next/server";
export const revalidate = 3600;
export async function GET(request: NextRequest) {
const baseUrl = new URL(request.url).origin;
const rssXml = await generateRegistryRssFeed({
baseUrl,
componentsUrl: "/docs/components",
excludeItemTypes: ["registry:block", "registry:style", "registry:lib"],
rss: {
title: "@retroui",
description: "Subscribe to @retroui updates",
link: "https://retroui.dev",
pubDateStrategy: "githubLastEdit",
},
github: {
owner: "Logging-Studio",
repo: "RetroUI",
token: process.env.GITHUB_TOKEN,
},
});
if (!rssXml) {
return new Response("RSS feed not available", {
status: 404,
headers: { "Content-Type": "text/plain" },
});
}
return new Response(rssXml, {
headers: {
"Content-Type": "application/rss+xml; charset=utf-8",
"Cache-Control":
"public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400",
},
});
}
+17
View File
@@ -0,0 +1,17 @@
import { allDocs } from "@/.contentlayer/generated";
import type { MetadataRoute } from "next";
export default function sitemap(): MetadataRoute.Sitemap {
return [
{
url: "https://retroui.dev",
lastModified: new Date(),
changeFrequency: "yearly",
priority: 1,
},
...allDocs.map((doc) => ({
url: `https://retroui.dev${doc.url}`,
lastModified: doc.lastUpdated,
})),
];
}