Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions apps/docs/app/[[...mdxPath]]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { Metadata, Viewport } from "next";
import { Inter } from "next/font/google";
import { Footer, Layout, Navbar } from "nextra-theme-docs";
import { Head } from "nextra/components";
import { getPageMap } from "nextra/page-map";
import Logo from "../../components/Logo";
import "../globals.css";

export const metadata: Metadata = {
title: "%s – Next Admin",
keywords: "next, prisma, admin, database, next.js, back-office, cms",
publisher: "Premier Octet",
};

export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
};

const inter = Inter({ subsets: ["latin"], variable: "--font-inter" });

export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en" dir="ltr" suppressHydrationWarning>
<Head
color={{
hue: {
light: 209,
dark: 209,
},
saturation: {
dark: 100,
light: 100,
},
}}
>
<link rel="canonical" href="https://next-admin.vercel.app" />
<link rel="icon" href="/logo.svg" />
</Head>
<body className={inter.className}>
<Layout
darkMode
editLink={null}
toc={{
float: false,
}}
navbar={
<Navbar
logo={
<div className="flex items-center gap-2">
<Logo width={45} />
<span className="font-semibold">Next Admin</span>
</div>
}
projectLink="https://github.com/premieroctet/next-admin"
/>
}
footer={
<Footer>
MIT {new Date().getFullYear()} ©{" "}
{
<a href="https://premieroctet.com" target="_blank">
Premier Octet
</a>
}
.
</Footer>
}
pageMap={await getPageMap()}
docsRepositoryBase="https://github.com/premieroctet/next-admin"
>
{children}
</Layout>
</body>
</html>
);
}
32 changes: 32 additions & 0 deletions apps/docs/app/[[...mdxPath]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { generateStaticParamsFor, importPage } from "nextra/pages";
import { useMDXComponents as getMDXComponents } from "../../mdx-components";
import { Metadata } from "next";

export const generateStaticParams = generateStaticParamsFor("mdxPath");

export async function generateMetadata(props: {
params: Promise<{ mdxPath: string[] }>;
}): Promise<Metadata> {
const params = await props.params;
const { metadata } = await importPage(params.mdxPath);
return metadata;
}

const Wrapper = getMDXComponents().wrapper;

export default async function Page(props: {
params: Promise<{ mdxPath: string[] }>;
}) {
const params = await props.params;
const {
default: MDXContent,
toc,
metadata,
sourceCode,
} = await importPage(params.mdxPath);
return (
<Wrapper toc={toc} metadata={metadata} sourceCode={sourceCode}>
<MDXContent {...props} params={params} />
</Wrapper>
);
}
46 changes: 46 additions & 0 deletions apps/docs/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@import "tailwindcss";

/* Optional: import Nextra theme styles */
@import "nextra-theme-docs/style.css"; /* or nextra-theme-blog/style.css */

@variant dark (&:where(.dark *));

@theme inline {
--font-sans: var(--font-inter);
--font-mono: var(--font-roboto-mono);
}

:root {
--nextra-content-width: 85vw !important;
}

@theme {
@keyframes meteor {
0% {
transform: rotate(215deg) translateX(0);
opacity: 1;
}
70% {
opacity: 1;
}
100% {
transform: rotate(215deg) translateX(-500px);
opacity: 0;
}
}

@keyframes spotlight {
0% {
opacity: 0;
transform: translate(-72%, -62%) scale(0.5);
}

100% {
opacity: 1;
transform: translate(-50%, -40%) scale(1);
}
}

--animate-meteor-effect: meteor 5s linear infinite;
--animate-spotlight: spotlight 2s ease 0.75s 1 forwards;
}
10 changes: 5 additions & 5 deletions apps/docs/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ import { Spotlight } from "./effects/Spotlight";
export const GitHubIcon = () => (
<svg viewBox="0 0 24 24" aria-hidden="true" className="h-6 w-6">
<path
fill-rule="evenodd"
clip-rule="evenodd"
fillRule="evenodd"
clipRule="evenodd"
d="M12 2C6.477 2 2 6.463 2 11.97c0 4.404 2.865 8.14 6.839 9.458.5.092.682-.216.682-.48 0-.236-.008-.864-.013-1.695-2.782.602-3.369-1.337-3.369-1.337-.454-1.151-1.11-1.458-1.11-1.458-.908-.618.069-.606.069-.606 1.003.07 1.531 1.027 1.531 1.027.892 1.524 2.341 1.084 2.91.828.092-.643.35-1.083.636-1.332-2.22-.251-4.555-1.107-4.555-4.927 0-1.088.39-1.979 1.029-2.675-.103-.252-.446-1.266.098-2.638 0 0 .84-.268 2.75 1.022A9.607 9.607 0 0 1 12 6.82c.85.004 1.705.114 2.504.336 1.909-1.29 2.747-1.022 2.747-1.022.546 1.372.202 2.386.1 2.638.64.696 1.028 1.587 1.028 2.675 0 3.83-2.339 4.673-4.566 4.92.359.307.678.915.678 1.846 0 1.332-.012 2.407-.012 2.734 0 .267.18.577.688.48 3.97-1.32 6.833-5.054 6.833-9.458C22 6.463 17.522 2 12 2Z"
></path>
</svg>
);

export function Hero() {
return (
<div className="relative flex h-[35rem] w-full overflow-hidden border-b border-dashed bg-transparent antialiased md:items-center md:justify-center dark:border-b-stone-500">
<div className="h-140 relative flex w-full overflow-hidden border-b border-dashed bg-transparent antialiased md:items-center md:justify-center dark:border-b-stone-500">
<Spotlight
className="-top-40 left-0 md:-top-20 md:left-60"
fill="#82e9a6"
/>
<div className="relative z-10 mx-auto w-full max-w-7xl p-4 pt-20 md:pt-0">
<h1 className="bg-opacity-50 bg-gradient-to-b from-black/70 to-black/90 bg-clip-text text-center text-4xl font-bold text-transparent md:text-7xl dark:text-white">
<h1 className="bg-linear-to-b bg-opacity-50 from-black/70 to-black/90 bg-clip-text text-center text-4xl font-bold text-transparent md:text-7xl dark:text-white">
Full-featured Admin
<br /> for React frameworks
</h1>
Expand All @@ -29,7 +29,7 @@ export function Hero() {
<div className="mx-auto mt-10 flex max-w-xl flex-col justify-center gap-4 text-center sm:flex-row">
<Link
href="/docs"
className="text-md rounded-lg bg-black px-6 py-3 font-semibold text-white transition-colors duration-300 ease-in-out hover:bg-gray-800 dark:bg-white dark:text-black dark:hover:bg-gray-700 dark:hover:bg-white/80"
className="text-md rounded-lg bg-black px-6 py-3 font-semibold text-white transition-colors duration-300 ease-in-out hover:bg-gray-800 dark:bg-white dark:text-black dark:hover:bg-gray-700"
>
Documentation
</Link>
Expand Down
9 changes: 6 additions & 3 deletions apps/docs/pages/_meta.ts → apps/docs/content/_meta.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { MetaRecord } from "nextra";

export default {
index: {
type: "page",
title: "Next Admin",
display: "hidden",
theme: {
layout: "raw",
copyPage: true,
toc: false,
sidebar: false,
},
},
docs: {
Expand All @@ -24,6 +28,5 @@ export default {
title: "Demo",
type: "page",
href: "https://next-admin-po.vercel.app",
newWindow: true,
},
};
} satisfies MetaRecord;
5 changes: 5 additions & 0 deletions apps/docs/content/changelog/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { MetaRecord } from "nextra";

export default {
index: "Versions",
} satisfies MetaRecord;
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { MetaRecord } from "nextra";

export default {
index: "Introduction",
"getting-started": "Getting Started",
Expand All @@ -9,6 +11,7 @@ export default {
sidebar: true,
toc: true,
pagination: true,
copyPage: false,
},
},
i18n: "I18n",
Expand All @@ -18,4 +21,4 @@ export default {
"edge-cases": "Edge cases",
"code-snippets": "Code snippets",
"frameworks-support": "Frameworks support",
};
} satisfies MetaRecord;
22 changes: 22 additions & 0 deletions apps/docs/content/docs/api/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { MetaRecord } from "nextra";

export default {
"next-admin-component": {
title: "<NextAdmin/>",
},
options: {
title: "Options parameter",
},
"model-configuration": {
title: "Model configuration",
},
user: {
title: "User",
},
"create-handler-function": {
title: "createHandler()",
},
"get-next-admin-props-function": {
title: "getNextAdminProps()",
},
} satisfies MetaRecord;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { MetaRecord } from "nextra";

export default {
docs: {
title: "Documentation",
type: "page",
display: "hidden",
},
};
} satisfies MetaRecord;
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { MetaRecord } from "nextra";

export default {
index: "Introduction",
"getting-started": "Getting Started",
Expand All @@ -9,6 +11,7 @@ export default {
sidebar: true,
toc: true,
pagination: true,
copyPage: false,
},
},
authentication: "Authentication",
Expand All @@ -19,4 +22,4 @@ export default {
route: "Route name",
"edge-cases": "Edge cases",
"code-snippets": "Code snippets",
};
} satisfies MetaRecord;
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { MetaRecord } from "nextra";

export default {
"next-admin-component": {
title: "<NextAdmin/>",
Expand All @@ -14,4 +16,4 @@ export default {
"model-configuration": {
title: "Model configuration",
},
};
} satisfies MetaRecord;
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 0 additions & 9 deletions apps/docs/globals.css

This file was deleted.

10 changes: 10 additions & 0 deletions apps/docs/mdx-components.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { useMDXComponents as getDocsMDXComponents } from "nextra-theme-docs";

const docsComponents = getDocsMDXComponents();

export function useMDXComponents(components) {
return {
...docsComponents,
...components,
};
}
2 changes: 1 addition & 1 deletion apps/docs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />
import "./.next/dev/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
3 changes: 1 addition & 2 deletions apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import nextra from "nextra";

const config = nextra({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.jsx",
contentDirBasePath: "/docs",
});

export default config({
Expand Down
9 changes: 4 additions & 5 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"clsx": "^2.1.0",
"framer-motion": "^11.13.5",
"mini-svg-data-uri": "^1.4.4",
"next": "^15.0.3",
"nextra": "3.2.5",
"nextra-theme-docs": "3.2.5",
"next": "catalog:next",
"nextra": "4.6.0",
"nextra-theme-docs": "4.6.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"tailwind-merge": "^2.2.1"
Expand All @@ -28,8 +28,7 @@
"autoprefixer": "^10.0.1",
"eslint": "7.32.0",
"eslint-config-custom": "workspace:*",
"postcss": "^8",
"tailwindcss": "^3.4.14",
"tailwindcss": "catalog:tailwind",
"tsconfig": "workspace:*",
"typescript": "^5.6.3"
}
Expand Down
18 changes: 0 additions & 18 deletions apps/docs/pages/_app.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions apps/docs/pages/changelog/_meta.ts

This file was deleted.

Loading
Loading