@lexibase/rdx-next 1.0.0-beta.4 → 1.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,19 @@
1
- # `@rdx/next`
1
+ # `@lexibase/rdx-next`
2
2
 
3
3
  The official Next.js runtime for RDX documentation projects.
4
4
 
5
5
  It exposes the `rdx` command used by generated projects to create their
6
6
  internal `.rdx` application and run Next.js.
7
+
8
+ Generated sites use the same theme and components as the development website,
9
+ through `@lexibase/rdx-ui`: logo, navbar, Radix version dropdown, mobile/desktop
10
+ sidebar, landing page, MDX styles and theme provider. The adapter owns content
11
+ and route data; it does not implement a parallel UI theme.
12
+
13
+ Use `homepage: { enabled: true }` in `rdx.config.ts` for the centered-logo
14
+ homepage, or import a project-owned React component with `homepage.component`.
15
+ Without the option, `/` redirects to `/docs`. Additional content sources from
16
+ explicitly configured plugins enable the shared navbar dropdown.
17
+
18
+ `.rdx/` is generated. Configure the site or edit a project-owned `home.tsx`
19
+ instead of modifying files inside `.rdx/`.
package/bin/rdx.mjs CHANGED
@@ -47,6 +47,7 @@ async function main() {
47
47
  const jiti = createJiti(import.meta.url, {
48
48
  moduleCache: false,
49
49
  fsCache: false,
50
+ jsx: { runtime: 'automatic' },
50
51
  })
51
52
  let input
52
53
  try {
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { defineConfig } from '@lexibase/rdx-core/config';
2
- export { RdxConfig, RdxPlugin, RdxPluginContext, RdxRuntimeConfig } from '@lexibase/rdx-types';
2
+ export { RdxConfig, RdxHomepage, RdxPlugin, RdxPluginContext, RdxRuntimeConfig } from '@lexibase/rdx-types';
@@ -3,13 +3,17 @@ import { ReactNode } from 'react';
3
3
  import { RdxProject, RdxRuntimeConfig } from '@lexibase/rdx-types';
4
4
  export { createRdxProject, getProjectDocsPaths } from '@lexibase/rdx-core';
5
5
 
6
- declare function RdxLayout({ children, config, }: {
6
+ declare function RdxLayout({ children, config, bodyClassName, }: {
7
7
  children: ReactNode;
8
8
  config: RdxRuntimeConfig;
9
+ bodyClassName?: string;
10
+ }): react_jsx_runtime.JSX.Element;
11
+ declare function HomePage({ project }: {
12
+ project: RdxProject;
9
13
  }): react_jsx_runtime.JSX.Element;
10
14
  declare function DocsPage({ slug, project, }: {
11
15
  slug?: string[];
12
16
  project: RdxProject;
13
17
  }): Promise<react_jsx_runtime.JSX.Element>;
14
18
 
15
- export { DocsPage, RdxLayout };
19
+ export { DocsPage, HomePage, RdxLayout };
@@ -5,64 +5,98 @@ import {
5
5
  getSourceOptions,
6
6
  resolveDocsRoute
7
7
  } from "@lexibase/rdx-core";
8
+ import { Button } from "@lexibase/rdx-ui/components/button";
9
+ import { DocsSidebar } from "@lexibase/rdx-ui/components/docs-sidebar";
10
+ import { Home } from "@lexibase/rdx-ui/components/home";
11
+ import { Logo } from "@lexibase/rdx-ui/components/logo";
12
+ import { mdxComponents } from "@lexibase/rdx-ui/components/mdx-components";
13
+ import { Navbar } from "@lexibase/rdx-ui/components/navbar";
14
+ import {
15
+ VersionDropdown
16
+ } from "@lexibase/rdx-ui/components/version-dropdown";
17
+ import { ThemeProvider } from "@lexibase/rdx-ui/providers/theme-provider";
8
18
  import { compileMDX } from "next-mdx-remote/rsc";
9
19
  import Link from "next/link";
10
- import { notFound } from "next/navigation";
20
+ import { notFound, redirect } from "next/navigation";
11
21
  import { createRdxProject, getProjectDocsPaths } from "@lexibase/rdx-core";
12
- import { jsx, jsxs } from "react/jsx-runtime";
13
- var mdxComponents = {
14
- h1: (props) => /* @__PURE__ */ jsx("h1", { ...props }),
15
- h2: (props) => /* @__PURE__ */ jsx("h2", { ...props }),
16
- h3: (props) => /* @__PURE__ */ jsx("h3", { ...props }),
17
- p: (props) => /* @__PURE__ */ jsx("p", { ...props }),
18
- ul: (props) => /* @__PURE__ */ jsx("ul", { ...props }),
19
- ol: (props) => /* @__PURE__ */ jsx("ol", { ...props }),
20
- li: (props) => /* @__PURE__ */ jsx("li", { ...props }),
21
- blockquote: (props) => /* @__PURE__ */ jsx("blockquote", { ...props }),
22
- pre: (props) => /* @__PURE__ */ jsx("pre", { ...props }),
23
- code: (props) => /* @__PURE__ */ jsx("code", { ...props }),
24
- a: ({ href, ...props }) => {
25
- const isExternal = href?.startsWith("http");
26
- return /* @__PURE__ */ jsx(
27
- "a",
28
- {
29
- href,
30
- rel: isExternal ? "noreferrer" : void 0,
31
- target: isExternal ? "_blank" : void 0,
32
- ...props
33
- }
34
- );
35
- }
36
- };
22
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
37
23
  function RdxLayout({
38
24
  children,
39
- config
25
+ config,
26
+ bodyClassName
27
+ }) {
28
+ return /* @__PURE__ */ jsx("html", { suppressHydrationWarning: true, lang: config.lang ?? "en", children: /* @__PURE__ */ jsx("body", { className: bodyClassName, children: /* @__PURE__ */ jsxs(
29
+ ThemeProvider,
30
+ {
31
+ disableTransitionOnChange: true,
32
+ enableSystem: true,
33
+ attribute: "class",
34
+ defaultTheme: config.theme?.defaultTheme ?? "system",
35
+ children: [
36
+ /* @__PURE__ */ jsx("a", { className: "rdx-skip-link", href: "#rdx-main", children: "Skip to content" }),
37
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col h-dvh", children })
38
+ ]
39
+ }
40
+ ) }) });
41
+ }
42
+ function RdxHeader({
43
+ project,
44
+ slug
40
45
  }) {
41
- const brand = config.navbar?.title ?? config.title;
46
+ const { config } = project;
47
+ const { source, slug: currentSlug } = resolveDocsRoute(project, slug);
48
+ const options = project.sources.map((edition) => {
49
+ const docs = getSourceOptions(project, edition);
50
+ const destination = currentSlug && getDocument(currentSlug, docs) ? currentSlug : getDocsPaths(docs)[0];
51
+ return {
52
+ id: edition.id,
53
+ label: edition.id === "current" ? "Current" : `Version ${edition.label}`,
54
+ kind: edition.id === "current" ? "live" : edition.badge === "Archived" ? "archived" : "version",
55
+ href: ["/docs", edition.routePrefix, destination].filter(Boolean).join("/")
56
+ };
57
+ });
58
+ const BrandLogo = config.navbar?.logo ?? Logo;
42
59
  return /* @__PURE__ */ jsx(
43
- "html",
60
+ Navbar,
44
61
  {
45
- lang: config.lang ?? "en",
46
- "data-theme": config.theme?.defaultTheme ?? "system",
47
- children: /* @__PURE__ */ jsxs("body", { children: [
48
- /* @__PURE__ */ jsxs("header", { className: "rdx-header", children: [
49
- /* @__PURE__ */ jsx(Link, { className: "rdx-brand", href: "/docs", "aria-label": config.title, children: brand }),
50
- config.navbar?.actions?.github?.visible && config.navbar.actions.github.url && /* @__PURE__ */ jsx(
51
- "a",
52
- {
53
- className: "rdx-github-link",
54
- href: config.navbar.actions.github.url,
55
- rel: "noreferrer",
56
- target: "_blank",
57
- children: "GitHub"
58
- }
59
- )
60
- ] }),
61
- children
62
- ] })
62
+ title: config.navbar?.title ?? "",
63
+ siteTitle: config.title,
64
+ logo: /* @__PURE__ */ jsx(BrandLogo, { className: "size-5" }),
65
+ homeHref: config.homepage?.enabled ? "/" : "/docs",
66
+ docsHref: ["/docs", source.routePrefix].filter(Boolean).join("/"),
67
+ versionMenu: project.sources.length > 1 ? /* @__PURE__ */ jsx(VersionDropdown, { options, currentId: source.id }) : void 0,
68
+ github: config.navbar?.actions?.github,
69
+ showToggleMode: config.navbar?.actions?.showToggleMode
63
70
  }
64
71
  );
65
72
  }
73
+ function HomePage({ project }) {
74
+ const { config } = project;
75
+ if (!config.homepage?.enabled) redirect("/docs");
76
+ const homepage = config.homepage;
77
+ const CustomHome = homepage.component;
78
+ const BrandLogo = config.navbar?.logo ?? Logo;
79
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
80
+ /* @__PURE__ */ jsx(RdxHeader, { project }),
81
+ /* @__PURE__ */ jsx(
82
+ "main",
83
+ {
84
+ id: "rdx-main",
85
+ tabIndex: -1,
86
+ className: "flex-1 min-h-0 overflow-y-auto",
87
+ children: CustomHome ? /* @__PURE__ */ jsx(CustomHome, {}) : /* @__PURE__ */ jsx(
88
+ Home,
89
+ {
90
+ title: homepage.title ?? config.title,
91
+ logo: /* @__PURE__ */ jsx(BrandLogo, { className: "size-52 hover:scale-105 hover:rotate-1 transition-[scale,rotation] duration-1000" }),
92
+ description: homepage.description,
93
+ buttons: homepage.buttons
94
+ }
95
+ )
96
+ }
97
+ )
98
+ ] });
99
+ }
66
100
  async function DocsPage({
67
101
  slug,
68
102
  project
@@ -73,12 +107,14 @@ async function DocsPage({
73
107
  document,
74
108
  categories
75
109
  } = resolveDocsRoute(project, slug);
76
- if (!currentSlug) {
77
- return /* @__PURE__ */ jsxs("main", { className: "rdx-empty-state", children: [
78
- /* @__PURE__ */ jsx("h1", { children: "Your documentation is ready." }),
79
- /* @__PURE__ */ jsx("p", { children: "Add an `.mdx` file inside `docs/` to create your first page." })
110
+ if (!currentSlug)
111
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
112
+ /* @__PURE__ */ jsx(RdxHeader, { project, slug }),
113
+ /* @__PURE__ */ jsxs("main", { id: "rdx-main", tabIndex: -1, className: "p-8", children: [
114
+ /* @__PURE__ */ jsx("h1", { children: "Your documentation is ready." }),
115
+ /* @__PURE__ */ jsx("p", { children: "Add an .mdx file inside your configured documentation directory." })
116
+ ] })
80
117
  ] });
81
- }
82
118
  if (!document) notFound();
83
119
  const { content } = await compileMDX({
84
120
  source: document.content,
@@ -86,55 +122,68 @@ async function DocsPage({
86
122
  });
87
123
  const title = typeof document.frontmatter.title === "string" ? document.frontmatter.title : currentSlug;
88
124
  const description = typeof document.frontmatter.description === "string" ? document.frontmatter.description : null;
89
- return /* @__PURE__ */ jsxs("div", { className: "rdx-docs-layout", children: [
90
- /* @__PURE__ */ jsxs("aside", { className: "rdx-sidebar", "aria-label": "Documentation navigation", children: [
91
- project.sources.length > 1 && /* @__PURE__ */ jsx("nav", { className: "rdx-editions", "aria-label": "Documentation editions", children: project.sources.map((edition) => {
92
- const options = getSourceOptions(project, edition);
93
- const destination = getDocument(currentSlug, options) ? currentSlug : getDocsPaths(options)[0];
94
- const href = ["/docs", edition.routePrefix, destination].filter(Boolean).join("/");
95
- return /* @__PURE__ */ jsxs(
96
- Link,
97
- {
98
- href,
99
- "aria-current": edition.id === source.id ? "page" : void 0,
100
- children: [
101
- edition.label,
102
- edition.badge ? ` (${edition.badge})` : ""
103
- ]
104
- },
105
- edition.id
106
- );
107
- }) }),
108
- categories.map((category) => /* @__PURE__ */ jsxs("section", { className: "rdx-sidebar-category", children: [
109
- /* @__PURE__ */ jsx("h2", { children: category.title }),
110
- /* @__PURE__ */ jsx("ul", { children: category.pages.map((page) => {
111
- const href = ["/docs", source.routePrefix, page.slug].filter(Boolean).join("/");
112
- const isCurrentPage = page.slug === currentSlug;
113
- return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
114
- Link,
125
+ const hrefFor = (pageSlug) => ["/docs", source.routePrefix, pageSlug].filter(Boolean).join("/");
126
+ const sidebarCategories = categories.map((category2) => ({
127
+ title: category2.title,
128
+ links: category2.pages.map((page) => ({
129
+ label: page.title,
130
+ href: hrefFor(page.slug)
131
+ }))
132
+ }));
133
+ const pages = categories.flatMap((category2) => category2.pages);
134
+ const index = pages.findIndex((page) => page.slug === currentSlug);
135
+ const previous = pages[index - 1];
136
+ const next = pages[index + 1];
137
+ const category = categories.find(
138
+ (entry) => entry.pages.some((page) => page.slug === currentSlug)
139
+ );
140
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
141
+ /* @__PURE__ */ jsx(RdxHeader, { project, slug }),
142
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 min-h-0 overflow-hidden relative", children: [
143
+ /* @__PURE__ */ jsx(
144
+ DocsSidebar,
145
+ {
146
+ categories: sidebarCategories,
147
+ pathname: hrefFor(currentSlug)
148
+ }
149
+ ),
150
+ /* @__PURE__ */ jsx("div", { className: "flex-1 h-full overflow-y-auto pt-12 md:pt-0 outline-none", children: /* @__PURE__ */ jsxs("section", { className: "w-full min-h-full px-7 flex flex-col gap-5 pb-8 md:py-8", children: [
151
+ /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col gap-5 md:mx-auto md:max-w-[860px] pt-14 md:pt-0 flex-1", children: [
152
+ /* @__PURE__ */ jsxs("header", { className: "mb-6", children: [
153
+ source.badge && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4", children: source.badge }),
154
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-zinc-600 font-semibold uppercase block -mb-0.5", children: category?.title }),
155
+ /* @__PURE__ */ jsx("h1", { className: "text-4xl uppercase font-bold mb-2", children: title }),
156
+ description && /* @__PURE__ */ jsx("p", { className: "text-sm text-ring max-w-[726px]", children: description })
157
+ ] }),
158
+ /* @__PURE__ */ jsx(
159
+ "main",
115
160
  {
116
- "aria-current": isCurrentPage ? "page" : void 0,
117
- className: isCurrentPage ? "is-active" : void 0,
118
- href,
119
- children: page.title
161
+ id: "rdx-main",
162
+ tabIndex: -1,
163
+ className: "h-full w-full flex-1 max-w-[960px]",
164
+ children: content
120
165
  }
121
- ) }, page.slug);
122
- }) })
123
- ] }, category.id))
124
- ] }),
125
- /* @__PURE__ */ jsxs("main", { className: "rdx-document", children: [
126
- /* @__PURE__ */ jsxs("header", { className: "rdx-document-header", children: [
127
- source.badge && /* @__PURE__ */ jsx("p", { className: "rdx-source-badge", children: source.badge }),
128
- /* @__PURE__ */ jsx("p", { className: "rdx-breadcrumb", children: currentSlug }),
129
- /* @__PURE__ */ jsx("h1", { children: title }),
130
- description && /* @__PURE__ */ jsx("p", { className: "rdx-description", children: description })
131
- ] }),
132
- /* @__PURE__ */ jsx("article", { className: "rdx-mdx-content", children: content })
166
+ )
167
+ ] }),
168
+ /* @__PURE__ */ jsxs("footer", { className: "flex flex-col", children: [
169
+ /* @__PURE__ */ jsxs("section", { className: "flex items-center justify-between", children: [
170
+ previous ? /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", asChild: true, children: /* @__PURE__ */ jsx(Link, { href: hrefFor(previous.slug), children: previous.title }) }) : /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", disabled: true, children: "Previous" }),
171
+ next ? /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", asChild: true, children: /* @__PURE__ */ jsx(Link, { href: hrefFor(next.slug), children: next.title }) }) : /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", disabled: true, children: "Next" })
172
+ ] }),
173
+ /* @__PURE__ */ jsx("section", { className: "flex items-center justify-center w-full py-5", children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
174
+ "\xA9 ",
175
+ (/* @__PURE__ */ new Date()).getFullYear(),
176
+ " ",
177
+ /* @__PURE__ */ jsx("strong", { children: project.config.title })
178
+ ] }) })
179
+ ] })
180
+ ] }) })
133
181
  ] })
134
182
  ] });
135
183
  }
136
184
  export {
137
185
  DocsPage,
186
+ HomePage,
138
187
  RdxLayout,
139
188
  createRdxProject,
140
189
  getProjectDocsPaths
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexibase/rdx-next",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.6",
4
4
  "description": "The Next.js runtime for RDX documentation projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,6 +8,8 @@
8
8
  "rdx": "./bin/rdx.mjs"
9
9
  },
10
10
  "exports": {
11
+ "./postcss.config": "./postcss.config.mjs",
12
+ "./styles.css": "./src/runtime/styles.css",
11
13
  ".": {
12
14
  "types": "./dist/index.d.ts",
13
15
  "import": "./dist/index.js"
@@ -21,13 +23,16 @@
21
23
  "bin",
22
24
  "dist",
23
25
  "templates",
26
+ "postcss.config.mjs",
27
+ "src/runtime/styles.css",
24
28
  "README.md"
25
29
  ],
26
30
  "dependencies": {
27
31
  "jiti": "^2.6.1",
28
32
  "next-mdx-remote": "^5.0.0",
29
- "@lexibase/rdx-types": "1.0.0-beta.2",
30
- "@lexibase/rdx-core": "1.0.0-beta.2"
33
+ "@lexibase/rdx-ui": "1.0.0-beta.0",
34
+ "@lexibase/rdx-core": "1.0.0-beta.4",
35
+ "@lexibase/rdx-types": "1.0.0-beta.4"
31
36
  },
32
37
  "peerDependencies": {
33
38
  "next": "^15.5.0",
@@ -62,6 +67,7 @@
62
67
  "build": "tsup src/index.ts src/runtime/index.tsx --format esm --dts --clean --external @lexibase/rdx-core --external @lexibase/rdx-types --external next --external react --external react-dom --external next-mdx-remote",
63
68
  "lint": "eslint . --max-warnings 0",
64
69
  "check-types": "tsc --noEmit",
65
- "test": "node --test tests/*.test.mjs"
70
+ "test": "node --test tests/*.test.mjs",
71
+ "test:runtime": "node --test tests/runtime.integration.mjs"
66
72
  }
67
73
  }
@@ -0,0 +1 @@
1
+ export { default } from '@lexibase/rdx-ui/postcss.config'
@@ -0,0 +1,16 @@
1
+ @import '@lexibase/rdx-ui/globals.css';
2
+ @source '../../dist/**/*.js';
3
+
4
+ /* Colors, buttons, dropdowns and typography come from the shared UI theme. */
5
+ .rdx-skip-link {
6
+ position: fixed;
7
+ top: -100px;
8
+ left: 16px;
9
+ z-index: 100;
10
+ padding: 12px;
11
+ background: var(--background);
12
+ color: var(--foreground);
13
+ }
14
+ .rdx-skip-link:focus {
15
+ top: 12px;
16
+ }
@@ -1,234 +1,4 @@
1
- :root {
2
- --rdx-background: #ffffff;
3
- --rdx-foreground: #171717;
4
- --rdx-muted: #666666;
5
- --rdx-border: #e7e7e7;
6
- --rdx-accent: #f5f5f5;
7
- --rdx-link: #0f5ed8;
8
- }
9
-
10
- @media (prefers-color-scheme: dark) {
11
- :root:not([data-theme='light']) {
12
- --rdx-background: #121212;
13
- --rdx-foreground: #f4f4f5;
14
- --rdx-muted: #a1a1aa;
15
- --rdx-border: #303033;
16
- --rdx-accent: #202022;
17
- --rdx-link: #7bb0ff;
18
- }
19
- }
20
-
21
- :root[data-theme='dark'] {
22
- --rdx-background: #121212;
23
- --rdx-foreground: #f4f4f5;
24
- --rdx-muted: #a1a1aa;
25
- --rdx-border: #303033;
26
- --rdx-accent: #202022;
27
- --rdx-link: #7bb0ff;
28
- }
29
-
30
- .rdx-editions {
31
- border-bottom: 1px solid var(--rdx-border);
32
- margin-bottom: 20px;
33
- padding-bottom: 20px;
34
- }
35
-
36
- .rdx-source-badge {
37
- color: var(--rdx-muted);
38
- font-size: 0.85rem;
39
- }
40
-
41
- * {
42
- box-sizing: border-box;
43
- }
44
-
45
- html,
46
- body {
47
- margin: 0;
48
- min-height: 100%;
49
- }
50
-
51
- body {
52
- background: var(--rdx-background);
53
- color: var(--rdx-foreground);
54
- font-family: Arial, Helvetica, sans-serif;
55
- }
56
-
57
- a {
58
- color: inherit;
59
- }
60
-
61
- .rdx-header {
62
- align-items: center;
63
- border-bottom: 1px solid var(--rdx-border);
64
- display: flex;
65
- height: 60px;
66
- justify-content: space-between;
67
- padding: 0 24px;
68
- }
69
-
70
- .rdx-brand {
71
- font-size: 1.1rem;
72
- font-weight: 700;
73
- text-decoration: none;
74
- }
75
-
76
- .rdx-github-link {
77
- color: var(--rdx-muted);
78
- font-size: 0.9rem;
79
- text-decoration: none;
80
- }
81
-
82
- .rdx-docs-layout {
83
- display: grid;
84
- grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
85
- min-height: calc(100vh - 60px);
86
- }
87
-
88
- .rdx-sidebar {
89
- border-right: 1px solid var(--rdx-border);
90
- padding: 24px;
91
- }
92
-
93
- .rdx-sidebar-category + .rdx-sidebar-category {
94
- border-top: 1px solid var(--rdx-border);
95
- margin-top: 20px;
96
- padding-top: 20px;
97
- }
98
-
99
- .rdx-sidebar h2 {
100
- color: var(--rdx-muted);
101
- font-size: 0.72rem;
102
- letter-spacing: 0.08em;
103
- margin: 0 0 8px;
104
- text-transform: uppercase;
105
- }
106
-
107
- .rdx-sidebar ul {
108
- list-style: none;
109
- margin: 0;
110
- padding: 0;
111
- }
112
-
113
- .rdx-sidebar a {
114
- border-radius: 6px;
115
- display: block;
116
- font-size: 0.92rem;
117
- padding: 7px 8px;
118
- text-decoration: none;
119
- }
120
-
121
- .rdx-sidebar a:hover,
122
- .rdx-sidebar a.is-active {
123
- background: var(--rdx-accent);
124
- }
125
-
126
- .rdx-sidebar a.is-active {
127
- font-weight: 600;
128
- }
129
-
130
- .rdx-document,
131
- .rdx-empty-state {
132
- margin: 0 auto;
133
- max-width: 860px;
134
- padding: 56px 40px 80px;
135
- width: 100%;
136
- }
137
-
138
- .rdx-document-header {
139
- border-bottom: 1px solid var(--rdx-border);
140
- margin-bottom: 36px;
141
- padding-bottom: 28px;
142
- }
143
-
144
- .rdx-document-header h1,
145
- .rdx-mdx-content h1 {
146
- font-size: clamp(2rem, 5vw, 3rem);
147
- letter-spacing: -0.04em;
148
- line-height: 1.1;
149
- margin: 0;
150
- }
151
-
152
- .rdx-breadcrumb {
153
- color: var(--rdx-muted);
154
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
155
- font-size: 0.8rem;
156
- margin: 0 0 12px;
157
- }
158
-
159
- .rdx-description {
160
- color: var(--rdx-muted);
161
- font-size: 1.05rem;
162
- line-height: 1.6;
163
- margin: 14px 0 0;
164
- }
165
-
166
- .rdx-mdx-content {
167
- font-size: 1rem;
168
- line-height: 1.75;
169
- }
170
-
171
- .rdx-mdx-content h2,
172
- .rdx-mdx-content h3 {
173
- letter-spacing: -0.02em;
174
- line-height: 1.25;
175
- margin: 2.2em 0 0.7em;
176
- }
177
-
178
- .rdx-mdx-content p,
179
- .rdx-mdx-content ul,
180
- .rdx-mdx-content ol {
181
- margin: 1em 0;
182
- }
183
-
184
- .rdx-mdx-content li + li {
185
- margin-top: 0.4em;
186
- }
187
-
188
- .rdx-mdx-content a {
189
- color: var(--rdx-link);
190
- }
191
-
192
- .rdx-mdx-content blockquote {
193
- border-left: 3px solid var(--rdx-border);
194
- color: var(--rdx-muted);
195
- margin: 1.5em 0;
196
- padding-left: 16px;
197
- }
198
-
199
- .rdx-mdx-content code {
200
- background: var(--rdx-accent);
201
- border-radius: 4px;
202
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
203
- font-size: 0.9em;
204
- padding: 0.16em 0.35em;
205
- }
206
-
207
- .rdx-mdx-content pre {
208
- background: var(--rdx-accent);
209
- border: 1px solid var(--rdx-border);
210
- border-radius: 8px;
211
- overflow-x: auto;
212
- padding: 16px;
213
- }
214
-
215
- .rdx-mdx-content pre code {
216
- background: transparent;
217
- padding: 0;
218
- }
219
-
220
- @media (max-width: 720px) {
221
- .rdx-docs-layout {
222
- display: block;
223
- }
224
-
225
- .rdx-sidebar {
226
- border-bottom: 1px solid var(--rdx-border);
227
- border-right: 0;
228
- }
229
-
230
- .rdx-document,
231
- .rdx-empty-state {
232
- padding: 36px 24px 60px;
233
- }
234
- }
1
+ @import '@lexibase/rdx-next/styles.css';
2
+ @source '../../home.{ts,tsx}';
3
+ @source '../../components/**/*.{ts,tsx}';
4
+ @source '../../docs/**/*.mdx';
@@ -18,5 +18,9 @@ export default async function RootLayout({
18
18
  children,
19
19
  }: Readonly<{ children: React.ReactNode }>) {
20
20
  const { config } = await getProject()
21
- return <RdxLayout config={config}>{children}</RdxLayout>
21
+ return (
22
+ <RdxLayout config={config} bodyClassName="antialiased">
23
+ {children}
24
+ </RdxLayout>
25
+ )
22
26
  }
@@ -1,5 +1,7 @@
1
- import { redirect } from 'next/navigation'
1
+ import { HomePage } from '@lexibase/rdx-next/runtime'
2
2
 
3
- export default function Home() {
4
- redirect('/docs')
3
+ import { getProject } from '../rdx-project'
4
+
5
+ export default async function Home() {
6
+ return <HomePage project={await getProject()} />
5
7
  }
@@ -6,6 +6,7 @@ const nextConfig = {
6
6
  transpilePackages: [
7
7
  '@lexibase/rdx-core',
8
8
  '@lexibase/rdx-next',
9
+ '@lexibase/rdx-ui',
9
10
  'next-mdx-remote',
10
11
  ],
11
12
  }
@@ -0,0 +1 @@
1
+ export { default } from '@lexibase/rdx-next/postcss.config'