@assistant-ui/docs-theme 0.0.2 → 0.0.3
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 +89 -5
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/site/constants.d.ts +2 -0
- package/dist/site/constants.d.ts.map +1 -0
- package/dist/site/constants.js +5 -0
- package/dist/site/constants.js.map +1 -0
- package/dist/site/footer.d.ts +13 -0
- package/dist/site/footer.d.ts.map +1 -0
- package/dist/site/footer.js +35 -0
- package/dist/site/footer.js.map +1 -0
- package/dist/site/header.d.ts +13 -0
- package/dist/site/header.d.ts.map +1 -0
- package/dist/site/header.js +81 -0
- package/dist/site/header.js.map +1 -0
- package/dist/site/layout.d.ts +8 -0
- package/dist/site/layout.d.ts.map +1 -0
- package/dist/site/layout.js +21 -0
- package/dist/site/layout.js.map +1 -0
- package/dist/site/page.d.ts +9 -0
- package/dist/site/page.d.ts.map +1 -0
- package/dist/site/page.js +32 -0
- package/dist/site/page.js.map +1 -0
- package/dist/site/pager.d.ts +13 -0
- package/dist/site/pager.d.ts.map +1 -0
- package/dist/site/pager.js +36 -0
- package/dist/site/pager.js.map +1 -0
- package/dist/site/sidebar-navigation.d.ts +13 -0
- package/dist/site/sidebar-navigation.d.ts.map +1 -0
- package/dist/site/sidebar-navigation.js +185 -0
- package/dist/site/sidebar-navigation.js.map +1 -0
- package/dist/site/sidebar.d.ts +16 -0
- package/dist/site/sidebar.d.ts.map +1 -0
- package/dist/site/sidebar.js +46 -0
- package/dist/site/sidebar.js.map +1 -0
- package/dist/site/toc.d.ts +12 -0
- package/dist/site/toc.d.ts.map +1 -0
- package/dist/site/toc.js +92 -0
- package/dist/site/toc.js.map +1 -0
- package/dist/site/tree.d.ts +24 -0
- package/dist/site/tree.d.ts.map +1 -0
- package/dist/site/tree.js +14 -0
- package/dist/site/tree.js.map +1 -0
- package/dist/site/utils.d.ts +2 -0
- package/dist/site/utils.d.ts.map +1 -0
- package/dist/site/utils.js +5 -0
- package/dist/site/utils.js.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +9 -0
- package/package.json +21 -11
- package/src/config.ts +1 -1
- package/src/index.ts +1 -1
- package/src/site/constants.ts +1 -0
- package/src/site/footer.tsx +59 -0
- package/src/site/header.test.tsx +89 -0
- package/src/site/header.tsx +117 -0
- package/src/site/layout.tsx +33 -0
- package/src/site/page.tsx +38 -0
- package/src/site/pager.tsx +54 -0
- package/src/site/sidebar-navigation.test.tsx +92 -0
- package/src/site/sidebar-navigation.tsx +267 -0
- package/src/site/sidebar.tsx +77 -0
- package/src/site/toc.test.tsx +187 -0
- package/src/site/toc.tsx +118 -0
- package/src/site/tree.ts +36 -0
- package/src/site/utils.ts +2 -0
- package/src/ui.ts +19 -0
- package/styles/site.css +223 -0
package/README.md
CHANGED
|
@@ -12,14 +12,14 @@ The private website in `apps/docs` is named `@assistant-ui/docs-site`.
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
14
|
```sh
|
|
15
|
-
pnpm add @assistant-ui/docs-theme @farming-labs/docs@0.2.
|
|
15
|
+
pnpm add @assistant-ui/docs-theme @farming-labs/docs@0.2.137 @farming-labs/next@0.2.137 @farming-labs/theme@0.2.137 fumadocs-ui@16.17.8 motion@^14
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Use Farming Labs Docs, Next, and Theme 0.2.
|
|
18
|
+
Use the Farming Labs Docs, Next, and Theme stable patch 0.2.137 with Fumadocs UI 16.17.8. This version includes the focused `@farming-labs/docs/config` entry used by the theme, avoids loading the raw Markdown parser for MDX tree helpers, loads the built-in command-search dialog on first use, and defaults build-time MDX highlighting to Oniguruma.
|
|
19
19
|
Fumadocs UI is a required peer because the theme imports its shared contexts.
|
|
20
20
|
Package managers with automatic peer installation install it; otherwise, add
|
|
21
|
-
`fumadocs-ui@16.17.
|
|
22
|
-
`fumadocs-core@16.17.
|
|
21
|
+
`fumadocs-ui@16.17.8` directly and satisfy its peers. With Yarn PnP, also install
|
|
22
|
+
`fumadocs-core@16.17.8` and align its Zod 4 peer with the version resolved by
|
|
23
23
|
`@farming-labs/theme`. PnP can create separate context instances for different
|
|
24
24
|
peer environments even when the Fumadocs versions match.
|
|
25
25
|
|
|
@@ -35,7 +35,7 @@ this package supplies the appearance and navigation components.
|
|
|
35
35
|
|
|
36
36
|
```tsx
|
|
37
37
|
// docs.config.tsx
|
|
38
|
-
import { defineDocs } from "@farming-labs/docs";
|
|
38
|
+
import { defineDocs } from "@farming-labs/docs/config";
|
|
39
39
|
import { assistantUi, DocsBrand } from "@assistant-ui/docs-theme";
|
|
40
40
|
|
|
41
41
|
export default defineDocs({
|
|
@@ -139,3 +139,87 @@ client provider without pulling server-only framework exports into the browser.
|
|
|
139
139
|
In this workspace, use `"@assistant-ui/docs-theme": "workspace:*"`. To test local
|
|
140
140
|
changes in another repository, run `pnpm pack` in this package and install the
|
|
141
141
|
resulting archive with `pnpm add /path/to/package.tgz`.
|
|
142
|
+
|
|
143
|
+
## Compose the assistant-ui site layout
|
|
144
|
+
|
|
145
|
+
The `ui` entry supplies the responsive shell, header, animated sidebar sections,
|
|
146
|
+
page typography, table of contents, and pager used by `apps/docs`. It does not
|
|
147
|
+
import the framework’s layout into the browser. `apps/docs` compiles content with
|
|
148
|
+
`withDocs` from `@farming-labs/next/config` and selects `assistantUi()` in its
|
|
149
|
+
Farming Labs configuration. It retains application-owned search, platform
|
|
150
|
+
selection, Markdown endpoints, and navigation metadata.
|
|
151
|
+
The existing `next`, `provider`, and `styles.css` integration above remains available.
|
|
152
|
+
|
|
153
|
+
Use Next.js App Router, React 19, Tailwind CSS 4, and `motion@^14` for the animated
|
|
154
|
+
sidebar. Supply your existing semantic Tailwind tokens (`background`, `foreground`,
|
|
155
|
+
`muted`, `muted-foreground`, `accent`, and `border`) and fonts. Import `site.css`
|
|
156
|
+
instead of `styles.css`; it includes a source directive for the published component
|
|
157
|
+
classes, so no source alias or monorepo-relative Tailwind path is necessary.
|
|
158
|
+
|
|
159
|
+
```css
|
|
160
|
+
@import "tailwindcss";
|
|
161
|
+
@import "@assistant-ui/docs-theme/site.css";
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
import {
|
|
166
|
+
DocsBody, DocsContent, DocsPageShell, DocsShell,
|
|
167
|
+
DocsSidebar, DocsSidebarProvider,
|
|
168
|
+
} from "@assistant-ui/docs-theme/ui";
|
|
169
|
+
|
|
170
|
+
export function Documentation({ header, navigation, toc, footer, children }: {
|
|
171
|
+
header: React.ReactNode;
|
|
172
|
+
navigation: React.ReactNode;
|
|
173
|
+
toc: React.ReactNode;
|
|
174
|
+
footer: React.ReactNode;
|
|
175
|
+
children: React.ReactNode;
|
|
176
|
+
}) {
|
|
177
|
+
return (
|
|
178
|
+
<DocsSidebarProvider>
|
|
179
|
+
<DocsShell>
|
|
180
|
+
{header}
|
|
181
|
+
<DocsContent>
|
|
182
|
+
<DocsPageShell
|
|
183
|
+
toc={toc}
|
|
184
|
+
footer={footer}
|
|
185
|
+
mainProps={{ id: "main-content", tabIndex: -1 }}
|
|
186
|
+
>
|
|
187
|
+
<DocsBody>{children}</DocsBody>
|
|
188
|
+
</DocsPageShell>
|
|
189
|
+
</DocsContent>
|
|
190
|
+
<DocsSidebar>{navigation}</DocsSidebar>
|
|
191
|
+
</DocsShell>
|
|
192
|
+
</DocsSidebarProvider>
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
`DocsSiteHeader` owns the mobile navigation/sidebar toggles and responsive header
|
|
198
|
+
regions. Provide branding, search, theme controls, and application links through
|
|
199
|
+
its slots. `navigationRoot` accepts your existing navigation provider;
|
|
200
|
+
`mobileNavigation(close)` receives the action to close the menu and restore focus
|
|
201
|
+
to its toggle after navigation. `useDocsSidebar` lets a custom header control the
|
|
202
|
+
same sidebar; `DOCS_SIDEBAR_ID` identifies it for `aria-controls`.
|
|
203
|
+
`DocsPageShell.mainProps` configures the main landmark, including a focusable target
|
|
204
|
+
for an application-provided skip link.
|
|
205
|
+
|
|
206
|
+
`DocsSidebarNavigation` accepts `sections` (folders with stable `$id` values),
|
|
207
|
+
`pathname`, `activeSectionId`, and `onNavigate`. Use `isVisible` for platform-specific
|
|
208
|
+
nodes and `banner`/`footer` for a platform selector and social links. The structural
|
|
209
|
+
`DocsNode` types accept Fumadocs page trees without tying rendering to that engine.
|
|
210
|
+
The active ancestor path is computed once per tree/path change; opening a section
|
|
211
|
+
does not repeat a tree walk for each nested folder.
|
|
212
|
+
|
|
213
|
+
`DocsTableOfContents` accepts `{title, url, depth}` items and an action area as
|
|
214
|
+
children. `DocsPagerNavigation` accepts previous/next URLs with optional names for
|
|
215
|
+
accessible link labels, and an actions menu as children. `DocsFooter` accepts named previous/next destinations and optional section
|
|
216
|
+
labels. Copy, search, Ask AI, and analytics stay with the consuming application.
|
|
217
|
+
|
|
218
|
+
The shell, page body, and footer can render as Server Components. Interactive
|
|
219
|
+
components preserve their client boundaries in the published build. A separate
|
|
220
|
+
module graph keeps the Farming Labs integration out of the `ui` consumer bundle;
|
|
221
|
+
this does not remove Farming Labs’ internal Fumadocs dependencies or promise a
|
|
222
|
+
particular page-load time.
|
|
223
|
+
|
|
224
|
+
The table of contents observes headings only while its desktop region is visible,
|
|
225
|
+
and reconnects when the viewport grows.
|
package/dist/config.d.ts
CHANGED
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAC;AAGnC,eAAO,MAAM,iBAAiB,GAAI,SAAS,UAAU,KAAG,UAgBpD,CAAC"}
|
package/dist/config.js
CHANGED
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["defineFarmingDocs"],"sources":["../src/config.ts"],"sourcesContent":["import {\n defineDocs as defineFarmingDocs,\n type DocsConfig,\n} from \"@farming-labs/docs\";\nimport { assistantUi } from \"./index\";\n\nexport const withThemeDefaults = (options: DocsConfig): DocsConfig =>\n defineFarmingDocs({\n ...options,\n theme: options.theme ?? assistantUi(),\n sidebar:\n options.sidebar === false\n ? false\n : {\n collapsible: false,\n flat: true,\n folderIndexBehavior: \"link\",\n ...(typeof options.sidebar === \"object\" ? options.sidebar : {}),\n },\n breadcrumb: options.breadcrumb ?? { enabled: false },\n lastUpdated: options.lastUpdated ?? false,\n pageActions: { copyMarkdown: false, openDocs: false },\n });\n"],"mappings":";;;AAMA,MAAa,qBAAqB,YAChCA,WAAkB;CAChB,GAAG;CACH,OAAO,QAAQ,SAAS,YAAY;CACpC,SACE,QAAQ,YAAY,QAChB,QACA;EACE,aAAa;EACb,MAAM;EACN,qBAAqB;EACrB,GAAI,OAAO,QAAQ,YAAY,WAAW,QAAQ,UAAU,CAAC;CAC/D;CACN,YAAY,QAAQ,cAAc,EAAE,SAAS,MAAM;CACnD,aAAa,QAAQ,eAAe;CACpC,aAAa;EAAE,cAAc;EAAO,UAAU;CAAM;AACtD,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.js","names":["defineFarmingDocs"],"sources":["../src/config.ts"],"sourcesContent":["import {\n defineDocs as defineFarmingDocs,\n type DocsConfig,\n} from \"@farming-labs/docs/config\";\nimport { assistantUi } from \"./index\";\n\nexport const withThemeDefaults = (options: DocsConfig): DocsConfig =>\n defineFarmingDocs({\n ...options,\n theme: options.theme ?? assistantUi(),\n sidebar:\n options.sidebar === false\n ? false\n : {\n collapsible: false,\n flat: true,\n folderIndexBehavior: \"link\",\n ...(typeof options.sidebar === \"object\" ? options.sidebar : {}),\n },\n breadcrumb: options.breadcrumb ?? { enabled: false },\n lastUpdated: options.lastUpdated ?? false,\n pageActions: { copyMarkdown: false, openDocs: false },\n });\n"],"mappings":";;;AAMA,MAAa,qBAAqB,YAChCA,WAAkB;CAChB,GAAG;CACH,OAAO,QAAQ,SAAS,YAAY;CACpC,SACE,QAAQ,YAAY,QAChB,QACA;EACE,aAAa;EACb,MAAM;EACN,qBAAqB;EACrB,GAAI,OAAO,QAAQ,YAAY,WAAW,QAAQ,UAAU,CAAC;CAC/D;CACN,YAAY,QAAQ,cAAc,EAAE,SAAS,MAAM;CACnD,aAAa,QAAQ,eAAe;CACpC,aAAa;EAAE,cAAc;EAAO,UAAU;CAAM;AACtD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DocsTheme } from "@farming-labs/docs";
|
|
1
|
+
import { type DocsTheme } from "@farming-labs/docs/config";
|
|
2
2
|
export declare const assistantUi: (overrides?: assistantUi.Options) => DocsTheme;
|
|
3
3
|
export declare namespace assistantUi {
|
|
4
4
|
interface Options extends Partial<DocsTheme> {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AA8BxE,eAAO,MAAM,WAAW,GAAI,YAAW,WAAW,CAAC,OAAY,KAAG,SACjC,CAAC;AAElC,yBAAiB,WAAW,CAAC;IAC3B,UAAiB,OAAQ,SAAQ,OAAO,CAAC,SAAS,CAAC;KAAG;CACvD;AAED,OAAO,EAAE,SAAS,EAAE,mBAAgB"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { createTheme, type DocsTheme } from \"@farming-labs/docs\";\nimport { shadcn } from \"@farming-labs/theme/shadcn\";\n\nconst createAssistantTheme = createTheme({\n ...shadcn({\n ui: {\n layout: {\n contentWidth: 848,\n sidebarWidth: 260,\n tocWidth: 224,\n header: { height: 48 },\n },\n typography: {\n font: {\n style: {\n sans: \"var(--font-public-sans, ui-sans-serif), system-ui, sans-serif\",\n mono: \"var(--font-jetbrains-mono, ui-monospace), monospace\",\n },\n h1: { size: \"1.5rem\", weight: 500, letterSpacing: \"-0.025em\" },\n h2: { size: \"1.25rem\", weight: 500, letterSpacing: \"-0.02em\" },\n h3: { size: \"1rem\", weight: 500, letterSpacing: \"-0.01em\" },\n body: { size: \"0.875rem\", lineHeight: \"1.7\" },\n },\n },\n codeBlock: { showCopyButton: true, showLineNumbers: false },\n },\n }),\n name: \"assistant-ui\",\n});\n\nexport const assistantUi = (overrides: assistantUi.Options = {}): DocsTheme =>\n createAssistantTheme(overrides);\n\nexport namespace assistantUi {\n export interface Options extends Partial<DocsTheme> {}\n}\n\nexport { DocsBrand } from \"./brand\";\n"],"mappings":";;;;AAGA,MAAM,uBAAuB,YAAY;CACvC,GAAG,OAAO,EACR,IAAI;EACF,QAAQ;GACN,cAAc;GACd,cAAc;GACd,UAAU;GACV,QAAQ,EAAE,QAAQ,GAAG;EACvB;EACA,YAAY,EACV,MAAM;GACJ,OAAO;IACL,MAAM;IACN,MAAM;GACR;GACA,IAAI;IAAE,MAAM;IAAU,QAAQ;IAAK,eAAe;GAAW;GAC7D,IAAI;IAAE,MAAM;IAAW,QAAQ;IAAK,eAAe;GAAU;GAC7D,IAAI;IAAE,MAAM;IAAQ,QAAQ;IAAK,eAAe;GAAU;GAC1D,MAAM;IAAE,MAAM;IAAY,YAAY;GAAM;EAC9C,EACF;EACA,WAAW;GAAE,gBAAgB;GAAM,iBAAiB;EAAM;CAC5D,EACF,CAAC;CACD,MAAM;AACR,CAAC;AAED,MAAa,eAAe,YAAiC,CAAC,MAC5D,qBAAqB,SAAS"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { createTheme, type DocsTheme } from \"@farming-labs/docs/config\";\nimport { shadcn } from \"@farming-labs/theme/shadcn\";\n\nconst createAssistantTheme = createTheme({\n ...shadcn({\n ui: {\n layout: {\n contentWidth: 848,\n sidebarWidth: 260,\n tocWidth: 224,\n header: { height: 48 },\n },\n typography: {\n font: {\n style: {\n sans: \"var(--font-public-sans, ui-sans-serif), system-ui, sans-serif\",\n mono: \"var(--font-jetbrains-mono, ui-monospace), monospace\",\n },\n h1: { size: \"1.5rem\", weight: 500, letterSpacing: \"-0.025em\" },\n h2: { size: \"1.25rem\", weight: 500, letterSpacing: \"-0.02em\" },\n h3: { size: \"1rem\", weight: 500, letterSpacing: \"-0.01em\" },\n body: { size: \"0.875rem\", lineHeight: \"1.7\" },\n },\n },\n codeBlock: { showCopyButton: true, showLineNumbers: false },\n },\n }),\n name: \"assistant-ui\",\n});\n\nexport const assistantUi = (overrides: assistantUi.Options = {}): DocsTheme =>\n createAssistantTheme(overrides);\n\nexport namespace assistantUi {\n export interface Options extends Partial<DocsTheme> {}\n}\n\nexport { DocsBrand } from \"./brand\";\n"],"mappings":";;;;AAGA,MAAM,uBAAuB,YAAY;CACvC,GAAG,OAAO,EACR,IAAI;EACF,QAAQ;GACN,cAAc;GACd,cAAc;GACd,UAAU;GACV,QAAQ,EAAE,QAAQ,GAAG;EACvB;EACA,YAAY,EACV,MAAM;GACJ,OAAO;IACL,MAAM;IACN,MAAM;GACR;GACA,IAAI;IAAE,MAAM;IAAU,QAAQ;IAAK,eAAe;GAAW;GAC7D,IAAI;IAAE,MAAM;IAAW,QAAQ;IAAK,eAAe;GAAU;GAC7D,IAAI;IAAE,MAAM;IAAQ,QAAQ;IAAK,eAAe;GAAU;GAC1D,MAAM;IAAE,MAAM;IAAY,YAAY;GAAM;EAC9C,EACF;EACA,WAAW;GAAE,gBAAgB;GAAM,iBAAiB;EAAM;CAC5D,EACF,CAAC;CACD,MAAM;AACR,CAAC;AAED,MAAa,eAAe,YAAiC,CAAC,MAC5D,qBAAqB,SAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/site/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../../src/site/constants.ts"],"sourcesContent":["export const DOCS_SIDEBAR_WIDTH = 260;\n"],"mappings":";AAAA,MAAa,qBAAqB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
type FooterItem = {
|
|
3
|
+
name: ReactNode;
|
|
4
|
+
url: string;
|
|
5
|
+
section?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
type DocsFooterProps = {
|
|
8
|
+
previous?: FooterItem | undefined;
|
|
9
|
+
next?: FooterItem | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare function DocsFooter({ previous, next }: DocsFooterProps): import("react").JSX.Element | null;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../src/site/footer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAClC,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,eAAe,sCA2C7D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
4
|
+
// src/site/footer.tsx
|
|
5
|
+
function DocsFooter({ previous, next }) {
|
|
6
|
+
if (!previous && !next) return null;
|
|
7
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
8
|
+
"aria-label": "Previous and next page",
|
|
9
|
+
className: "not-prose mt-16 flex items-center justify-between gap-4 text-sm",
|
|
10
|
+
children: [previous ? /* @__PURE__ */ jsxs(Link, {
|
|
11
|
+
href: previous.url,
|
|
12
|
+
className: "group text-muted-foreground hover:text-foreground inline-flex min-w-0 items-center gap-1.5 transition-colors",
|
|
13
|
+
children: [/* @__PURE__ */ jsx(ChevronLeft, { className: "size-4 shrink-0 transition-transform group-hover:-translate-x-0.5" }), /* @__PURE__ */ jsxs("span", {
|
|
14
|
+
className: "min-w-0 truncate",
|
|
15
|
+
children: [previous.section ? /* @__PURE__ */ jsxs("span", {
|
|
16
|
+
className: "opacity-60",
|
|
17
|
+
children: [previous.section, " / "]
|
|
18
|
+
}) : null, previous.name]
|
|
19
|
+
})]
|
|
20
|
+
}) : /* @__PURE__ */ jsx("span", {}), next ? /* @__PURE__ */ jsxs(Link, {
|
|
21
|
+
href: next.url,
|
|
22
|
+
className: "group text-muted-foreground hover:text-foreground inline-flex min-w-0 items-center gap-1.5 transition-colors",
|
|
23
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
24
|
+
className: "min-w-0 truncate",
|
|
25
|
+
children: [next.section ? /* @__PURE__ */ jsxs("span", {
|
|
26
|
+
className: "opacity-60",
|
|
27
|
+
children: [next.section, " / "]
|
|
28
|
+
}) : null, next.name]
|
|
29
|
+
}), /* @__PURE__ */ jsx(ChevronRight, { className: "size-4 shrink-0 transition-transform group-hover:translate-x-0.5" })]
|
|
30
|
+
}) : /* @__PURE__ */ jsx("span", {})]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export { DocsFooter };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","names":[],"sources":["../../src/site/footer.tsx"],"sourcesContent":["import Link from \"next/link\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\n\ntype FooterItem = {\n name: ReactNode;\n url: string;\n section?: ReactNode;\n};\n\ntype DocsFooterProps = {\n previous?: FooterItem | undefined;\n next?: FooterItem | undefined;\n};\n\nexport function DocsFooter({ previous, next }: DocsFooterProps) {\n if (!previous && !next) return null;\n\n return (\n <nav\n aria-label=\"Previous and next page\"\n className=\"not-prose mt-16 flex items-center justify-between gap-4 text-sm\"\n >\n {previous ? (\n <Link\n href={previous.url}\n className=\"group text-muted-foreground hover:text-foreground inline-flex min-w-0 items-center gap-1.5 transition-colors\"\n >\n <ChevronLeft className=\"size-4 shrink-0 transition-transform group-hover:-translate-x-0.5\" />\n <span className=\"min-w-0 truncate\">\n {previous.section ? (\n <span className=\"opacity-60\">{previous.section} / </span>\n ) : null}\n {previous.name}\n </span>\n </Link>\n ) : (\n <span />\n )}\n\n {next ? (\n <Link\n href={next.url}\n className=\"group text-muted-foreground hover:text-foreground inline-flex min-w-0 items-center gap-1.5 transition-colors\"\n >\n <span className=\"min-w-0 truncate\">\n {next.section ? (\n <span className=\"opacity-60\">{next.section} / </span>\n ) : null}\n {next.name}\n </span>\n <ChevronRight className=\"size-4 shrink-0 transition-transform group-hover:translate-x-0.5\" />\n </Link>\n ) : (\n <span />\n )}\n </nav>\n );\n}\n"],"mappings":";;;;AAeA,SAAgB,WAAW,EAAE,UAAU,QAAyB;CAC9D,IAAI,CAAC,YAAY,CAAC,MAAM,OAAO;CAE/B,OACE,qBAAC,OAAD;EACE,cAAW;EACX,WAAU;EAFZ,UAAA,CAIG,WACC,qBAAC,MAAD;GACE,MAAM,SAAS;GACf,WAAU;GAFZ,UAAA,CAIE,oBAAC,aAAD,EAAa,WAAU,oEAAqE,CAAA,GAC5F,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACG,SAAS,UACR,qBAAC,QAAD;KAAM,WAAU;KAAhB,UAAA,CAA8B,SAAS,SAAQ,KAAS;IACtD,CAAA,IAAA,MACH,SAAS,IACN;GACF,CAAA,CAAA;EAEN,CAAA,IAAA,oBAAC,QAAD,CAAO,CAAA,GAGR,OACC,qBAAC,MAAD;GACE,MAAM,KAAK;GACX,WAAU;GAFZ,UAAA,CAIE,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACG,KAAK,UACJ,qBAAC,QAAD;KAAM,WAAU;KAAhB,UAAA,CAA8B,KAAK,SAAQ,KAAS;IAClD,CAAA,IAAA,MACH,KAAK,IACF;GACN,CAAA,GAAA,oBAAC,cAAD,EAAc,WAAU,mEAAoE,CAAA,CACxF;EAEN,CAAA,IAAA,oBAAC,QAAD,CAAO,CAAA,CAEN;;AAET"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
+
export declare function DocsSiteHeader({ brand, mobileControls, condensedNavigation, desktopNavigation, mobileNavigation, navigationRoot: NavigationRoot, scrolled, }: {
|
|
3
|
+
brand: ReactNode;
|
|
4
|
+
mobileControls: ReactNode;
|
|
5
|
+
condensedNavigation: ReactNode;
|
|
6
|
+
desktopNavigation: ReactNode;
|
|
7
|
+
mobileNavigation: (close: () => void) => ReactNode;
|
|
8
|
+
navigationRoot: ComponentType<{
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}>;
|
|
11
|
+
scrolled: boolean;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/site/header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EAAE,cAAc,EAC9B,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,SAAS,CAAC;IACjB,cAAc,EAAE,SAAS,CAAC;IAC1B,mBAAmB,EAAE,SAAS,CAAC;IAC/B,iBAAiB,EAAE,SAAS,CAAC;IAC7B,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC;IACnD,cAAc,EAAE,aAAa,CAAC;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACvD,QAAQ,EAAE,OAAO,CAAC;CACnB,+BAuFA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "./utils.js";
|
|
3
|
+
import { DOCS_SIDEBAR_ID, useDocsSidebar } from "./sidebar.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Menu, PanelLeft, X } from "lucide-react";
|
|
6
|
+
import { useId, useRef, useState } from "react";
|
|
7
|
+
// src/site/header.tsx
|
|
8
|
+
function DocsSiteHeader({ brand, mobileControls, condensedNavigation, desktopNavigation, mobileNavigation, navigationRoot: NavigationRoot, scrolled }) {
|
|
9
|
+
const { open: sidebarOpen, setOpen: setSidebarOpen, toggle: toggleSidebar } = useDocsSidebar();
|
|
10
|
+
const [navMenuOpen, setNavMenuOpen] = useState(false);
|
|
11
|
+
const navMenuId = useId();
|
|
12
|
+
const navMenuToggle = useRef(null);
|
|
13
|
+
const closeNavigation = () => {
|
|
14
|
+
setNavMenuOpen(false);
|
|
15
|
+
navMenuToggle.current?.focus();
|
|
16
|
+
};
|
|
17
|
+
const toggleNavigation = () => {
|
|
18
|
+
if (!navMenuOpen) setSidebarOpen(false);
|
|
19
|
+
setNavMenuOpen((open) => !open);
|
|
20
|
+
};
|
|
21
|
+
const toggleMenu = () => {
|
|
22
|
+
if (!sidebarOpen) setNavMenuOpen(false);
|
|
23
|
+
toggleSidebar();
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ jsx("header", {
|
|
26
|
+
className: "sticky top-0 z-50",
|
|
27
|
+
children: /* @__PURE__ */ jsxs(NavigationRoot, { children: [/* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: cn("relative z-10 transition-colors duration-200", scrolled ? "bg-background/80 backdrop-blur-md" : "bg-transparent", "group-data-[menu-open=true]:bg-background", "flex h-12 w-full items-center px-4"),
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: "flex min-w-0 flex-1 items-center",
|
|
32
|
+
children: brand
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ jsxs("div", {
|
|
35
|
+
className: "ml-auto flex shrink-0 items-center gap-1 md:hidden",
|
|
36
|
+
children: [
|
|
37
|
+
mobileControls,
|
|
38
|
+
/* @__PURE__ */ jsx("button", {
|
|
39
|
+
type: "button",
|
|
40
|
+
ref: navMenuToggle,
|
|
41
|
+
onClick: toggleNavigation,
|
|
42
|
+
className: "text-muted-foreground hover:text-foreground flex size-8 items-center justify-center transition-colors",
|
|
43
|
+
"aria-label": "Site navigation",
|
|
44
|
+
"aria-expanded": navMenuOpen,
|
|
45
|
+
"aria-controls": navMenuId,
|
|
46
|
+
children: navMenuOpen ? /* @__PURE__ */ jsx(X, { className: "size-4" }) : /* @__PURE__ */ jsx(Menu, { className: "size-4" })
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsx("button", {
|
|
49
|
+
type: "button",
|
|
50
|
+
onClick: toggleMenu,
|
|
51
|
+
className: "text-muted-foreground hover:text-foreground flex size-8 items-center justify-center transition-colors",
|
|
52
|
+
"aria-label": "Toggle sidebar",
|
|
53
|
+
"aria-expanded": sidebarOpen,
|
|
54
|
+
"aria-controls": DOCS_SIDEBAR_ID,
|
|
55
|
+
children: sidebarOpen ? /* @__PURE__ */ jsx(X, { className: "size-4" }) : /* @__PURE__ */ jsx(PanelLeft, { className: "size-4" })
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ jsx("div", {
|
|
60
|
+
className: "ml-auto hidden items-center gap-4 md:flex lg:hidden",
|
|
61
|
+
children: condensedNavigation
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ jsx("div", {
|
|
64
|
+
className: "ml-auto hidden items-center gap-4 lg:flex",
|
|
65
|
+
children: desktopNavigation
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: cn("bg-background fixed inset-x-0 top-12 bottom-0 z-40 transition-opacity duration-200 md:hidden", navMenuOpen ? "opacity-100" : "pointer-events-none opacity-0"),
|
|
70
|
+
id: navMenuId,
|
|
71
|
+
inert: !navMenuOpen,
|
|
72
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
73
|
+
className: "flex h-full flex-col gap-1 overflow-y-auto px-4 pt-4",
|
|
74
|
+
children: mobileNavigation(closeNavigation)
|
|
75
|
+
})
|
|
76
|
+
})] })
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
export { DocsSiteHeader };
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.js","names":[],"sources":["../../src/site/header.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n useId,\n useRef,\n useState,\n type ComponentType,\n type ReactNode,\n} from \"react\";\nimport { Menu, PanelLeft, X } from \"lucide-react\";\nimport { DOCS_SIDEBAR_ID, useDocsSidebar } from \"./sidebar\";\nimport { cn } from \"./utils\";\n\nexport function DocsSiteHeader({\n brand,\n mobileControls,\n condensedNavigation,\n desktopNavigation,\n mobileNavigation,\n navigationRoot: NavigationRoot,\n scrolled,\n}: {\n brand: ReactNode;\n mobileControls: ReactNode;\n condensedNavigation: ReactNode;\n desktopNavigation: ReactNode;\n mobileNavigation: (close: () => void) => ReactNode;\n navigationRoot: ComponentType<{ children: ReactNode }>;\n scrolled: boolean;\n}) {\n const {\n open: sidebarOpen,\n setOpen: setSidebarOpen,\n toggle: toggleSidebar,\n } = useDocsSidebar();\n const [navMenuOpen, setNavMenuOpen] = useState(false);\n const navMenuId = useId();\n const navMenuToggle = useRef<HTMLButtonElement>(null);\n const closeNavigation = () => {\n setNavMenuOpen(false);\n navMenuToggle.current?.focus();\n };\n const toggleNavigation = () => {\n if (!navMenuOpen) setSidebarOpen(false);\n setNavMenuOpen((open) => !open);\n };\n const toggleMenu = () => {\n if (!sidebarOpen) setNavMenuOpen(false);\n toggleSidebar();\n };\n return (\n <header className=\"sticky top-0 z-50\">\n <NavigationRoot>\n <div\n className={cn(\n \"relative z-10 transition-colors duration-200\",\n scrolled ? \"bg-background/80 backdrop-blur-md\" : \"bg-transparent\",\n \"group-data-[menu-open=true]:bg-background\",\n \"flex h-12 w-full items-center px-4\",\n )}\n >\n <div className=\"flex min-w-0 flex-1 items-center\">{brand}</div>\n <div className=\"ml-auto flex shrink-0 items-center gap-1 md:hidden\">\n {mobileControls}\n <button\n type=\"button\"\n ref={navMenuToggle}\n onClick={toggleNavigation}\n className=\"text-muted-foreground hover:text-foreground flex size-8 items-center justify-center transition-colors\"\n aria-label=\"Site navigation\"\n aria-expanded={navMenuOpen}\n aria-controls={navMenuId}\n >\n {navMenuOpen ? (\n <X className=\"size-4\" />\n ) : (\n <Menu className=\"size-4\" />\n )}\n </button>\n <button\n type=\"button\"\n onClick={toggleMenu}\n className=\"text-muted-foreground hover:text-foreground flex size-8 items-center justify-center transition-colors\"\n aria-label=\"Toggle sidebar\"\n aria-expanded={sidebarOpen}\n aria-controls={DOCS_SIDEBAR_ID}\n >\n {sidebarOpen ? (\n <X className=\"size-4\" />\n ) : (\n <PanelLeft className=\"size-4\" />\n )}\n </button>\n </div>\n <div className=\"ml-auto hidden items-center gap-4 md:flex lg:hidden\">\n {condensedNavigation}\n </div>\n <div className=\"ml-auto hidden items-center gap-4 lg:flex\">\n {desktopNavigation}\n </div>\n </div>\n <div\n className={cn(\n \"bg-background fixed inset-x-0 top-12 bottom-0 z-40 transition-opacity duration-200 md:hidden\",\n navMenuOpen ? \"opacity-100\" : \"pointer-events-none opacity-0\",\n )}\n id={navMenuId}\n inert={!navMenuOpen}\n >\n <div className=\"flex h-full flex-col gap-1 overflow-y-auto px-4 pt-4\">\n {mobileNavigation(closeNavigation)}\n </div>\n </div>\n </NavigationRoot>\n </header>\n );\n}\n"],"mappings":";;;;;;;AAaA,SAAgB,eAAe,EAC7B,OACA,gBACA,qBACA,mBACA,kBACA,gBAAgB,gBAChB,YASC;CACD,MAAM,EACJ,MAAM,aACN,SAAS,gBACT,QAAQ,kBACN,eAAe;CACnB,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CACpD,MAAM,YAAY,MAAM;CACxB,MAAM,gBAAgB,OAA0B,IAAI;CACpD,MAAM,wBAAwB;EAC5B,eAAe,KAAK;EACpB,cAAc,SAAS,MAAM;CAC/B;CACA,MAAM,yBAAyB;EAC7B,IAAI,CAAC,aAAa,eAAe,KAAK;EACtC,gBAAgB,SAAS,CAAC,IAAI;CAChC;CACA,MAAM,mBAAmB;EACvB,IAAI,CAAC,aAAa,eAAe,KAAK;EACtC,cAAc;CAChB;CACA,OACE,oBAAC,UAAD;EAAQ,WAAU;EAChB,UAAA,qBAAC,gBAAD,EAAA,UAAA,CACE,qBAAC,OAAD;GACE,WAAW,GACT,gDACA,WAAW,sCAAsC,kBACjD,6CACA,oCACF;GANF,UAAA;IAQE,oBAAC,OAAD;KAAK,WAAU;KAAoC,UAAA;IAAW,CAAA;IAC9D,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACG;MACD,oBAAC,UAAD;OACE,MAAK;OACL,KAAK;OACL,SAAS;OACT,WAAU;OACV,cAAW;OACX,iBAAe;OACf,iBAAe;OAEd,UAAA,cACC,oBAAC,GAAD,EAAG,WAAU,SAAU,CAAA,IAEvB,oBAAC,MAAD,EAAM,WAAU,SAAU,CAAA;MAEtB,CAAA;MACR,oBAAC,UAAD;OACE,MAAK;OACL,SAAS;OACT,WAAU;OACV,cAAW;OACX,iBAAe;OACf,iBAAe;OAEd,UAAA,cACC,oBAAC,GAAD,EAAG,WAAU,SAAU,CAAA,IAEvB,oBAAC,WAAD,EAAW,WAAU,SAAU,CAAA;MAE3B,CAAA;KACL;;IACL,oBAAC,OAAD;KAAK,WAAU;KACZ,UAAA;IACE,CAAA;IACL,oBAAC,OAAD;KAAK,WAAU;KACZ,UAAA;IACE,CAAA;GACF;EACL,CAAA,GAAA,oBAAC,OAAD;GACE,WAAW,GACT,gGACA,cAAc,gBAAgB,+BAChC;GACA,IAAI;GACJ,OAAO,CAAC;GAER,UAAA,oBAAC,OAAD;IAAK,WAAU;IACZ,UAAA,iBAAiB,eAAe;GAC9B,CAAA;EACF,CAAA,CACS,EAAA,CAAA;CACV,CAAA;AAEZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/site/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAa1E;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAc5E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "./constants.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/site/layout.tsx
|
|
4
|
+
function DocsShell({ children }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", {
|
|
6
|
+
className: "docs-shell",
|
|
7
|
+
style: { "--sidebar-width": `260px` },
|
|
8
|
+
children
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function DocsContent({ children }) {
|
|
12
|
+
return /* @__PURE__ */ jsx("div", {
|
|
13
|
+
"data-docs-content": "",
|
|
14
|
+
className: "@container md:ml-(--sidebar-width)",
|
|
15
|
+
style: { "--sidebar-width": `260px` },
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export { DocsContent, DocsShell };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","names":[],"sources":["../../src/site/layout.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { DOCS_SIDEBAR_WIDTH } from \"./constants\";\n\nexport function DocsShell({ children }: { children: ReactNode }): ReactNode {\n return (\n <div\n className=\"docs-shell\"\n style={\n {\n \"--sidebar-width\": `${DOCS_SIDEBAR_WIDTH}px`,\n } as React.CSSProperties\n }\n >\n {children}\n </div>\n );\n}\n\nexport function DocsContent({ children }: { children: ReactNode }): ReactNode {\n return (\n <div\n data-docs-content=\"\"\n className=\"@container md:ml-(--sidebar-width)\"\n style={\n {\n \"--sidebar-width\": `${DOCS_SIDEBAR_WIDTH}px`,\n } as React.CSSProperties\n }\n >\n {children}\n </div>\n );\n}\n"],"mappings":";;;AAGA,SAAgB,UAAU,EAAE,YAAgD;CAC1E,OACE,oBAAC,OAAD;EACE,WAAU;EACV,OACE,EACE,mBAAmB,QACrB;EAGD;CACE,CAAA;AAET;AAEA,SAAgB,YAAY,EAAE,YAAgD;CAC5E,OACE,oBAAC,OAAD;EACE,qBAAkB;EAClB,WAAU;EACV,OACE,EACE,mBAAmB,QACrB;EAGD;CACE,CAAA;AAET"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
export declare function DocsPageShell({ toc, footer, children, mainProps, }: {
|
|
3
|
+
toc?: ReactNode;
|
|
4
|
+
footer?: ReactNode;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
mainProps?: Omit<ComponentProps<"main">, "children">;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function DocsBody({ className, ...props }: ComponentProps<"article">): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/site/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,MAAM,EACN,QAAQ,EACR,SAAS,GACV,EAAE;IACD,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;CACtD,+BAoBA;AAED,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,SAAS,CAAC,+BAE1E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cn } from "./utils.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
// src/site/page.tsx
|
|
4
|
+
function DocsPageShell({ toc, footer, children, mainProps }) {
|
|
5
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6
|
+
className: "docs-layout",
|
|
7
|
+
children: [
|
|
8
|
+
/* @__PURE__ */ jsx("main", {
|
|
9
|
+
...mainProps,
|
|
10
|
+
className: cn("mx-auto w-full max-w-(--docs-article-width) justify-self-center px-4 pt-4 pb-10 md:px-6", mainProps?.className),
|
|
11
|
+
children
|
|
12
|
+
}),
|
|
13
|
+
toc,
|
|
14
|
+
footer && /* @__PURE__ */ jsx("footer", {
|
|
15
|
+
className: "mx-auto w-full max-w-(--docs-article-width) justify-self-center px-4 pb-10 md:px-6",
|
|
16
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
17
|
+
className: "border-t pt-6",
|
|
18
|
+
children: footer
|
|
19
|
+
})
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function DocsBody({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx("article", {
|
|
26
|
+
...props,
|
|
27
|
+
className: cn("docs-prose prose", className)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export { DocsBody, DocsPageShell };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","names":[],"sources":["../../src/site/page.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from \"react\";\nimport { cn } from \"./utils\";\n\nexport function DocsPageShell({\n toc,\n footer,\n children,\n mainProps,\n}: {\n toc?: ReactNode;\n footer?: ReactNode;\n children: ReactNode;\n mainProps?: Omit<ComponentProps<\"main\">, \"children\">;\n}) {\n return (\n <div className=\"docs-layout\">\n <main\n {...mainProps}\n className={cn(\n \"mx-auto w-full max-w-(--docs-article-width) justify-self-center px-4 pt-4 pb-10 md:px-6\",\n mainProps?.className,\n )}\n >\n {children}\n </main>\n {toc}\n {footer && (\n <footer className=\"mx-auto w-full max-w-(--docs-article-width) justify-self-center px-4 pb-10 md:px-6\">\n <div className=\"border-t pt-6\">{footer}</div>\n </footer>\n )}\n </div>\n );\n}\n\nexport function DocsBody({ className, ...props }: ComponentProps<\"article\">) {\n return <article {...props} className={cn(\"docs-prose prose\", className)} />;\n}\n"],"mappings":";;;AAGA,SAAgB,cAAc,EAC5B,KACA,QACA,UACA,aAMC;CACD,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,oBAAC,QAAD;IACE,GAAI;IACJ,WAAW,GACT,2FACA,WAAW,SACb;IAEC;GACG,CAAA;GACL;GACA,UACC,oBAAC,UAAD;IAAQ,WAAU;IAChB,UAAA,oBAAC,OAAD;KAAK,WAAU;KAAiB,UAAA;IAAY,CAAA;GACtC,CAAA;EAEP;;AAET;AAEA,SAAgB,SAAS,EAAE,WAAW,GAAG,SAAoC;CAC3E,OAAO,oBAAC,WAAD;EAAS,GAAI;EAAO,WAAW,GAAG,oBAAoB,SAAS;CAAI,CAAA;AAC5E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function DocsPagerNavigation({ previous, next, children, }: {
|
|
3
|
+
previous?: {
|
|
4
|
+
url: string;
|
|
5
|
+
name?: ReactNode;
|
|
6
|
+
} | undefined;
|
|
7
|
+
next?: {
|
|
8
|
+
url: string;
|
|
9
|
+
name?: ReactNode;
|
|
10
|
+
} | undefined;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=pager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pager.d.ts","sourceRoot":"","sources":["../../src/site/pager.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,SAAS,CAAC;IACzD,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,SAAS,CAAC;IACrD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,+BAoCA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
4
|
+
// src/site/pager.tsx
|
|
5
|
+
const pagerLabel = (direction, name) => typeof name === "string" && name !== "" ? `${direction}: ${name}` : `${direction} page`;
|
|
6
|
+
function DocsPagerNavigation({ previous, next, children }) {
|
|
7
|
+
const buttonClass = "flex size-7 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground sm:size-8";
|
|
8
|
+
const disabledClass = "flex size-7 items-center justify-center rounded-md bg-muted/30 text-muted-foreground/40 cursor-not-allowed sm:size-8";
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: "flex items-center gap-1",
|
|
11
|
+
children: [
|
|
12
|
+
previous ? /* @__PURE__ */ jsx(Link, {
|
|
13
|
+
href: previous.url,
|
|
14
|
+
className: buttonClass,
|
|
15
|
+
"aria-label": pagerLabel("Previous", previous.name),
|
|
16
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" })
|
|
17
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: disabledClass,
|
|
19
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" })
|
|
20
|
+
}),
|
|
21
|
+
next ? /* @__PURE__ */ jsx(Link, {
|
|
22
|
+
href: next.url,
|
|
23
|
+
className: buttonClass,
|
|
24
|
+
"aria-label": pagerLabel("Next", next.name),
|
|
25
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4" })
|
|
26
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: disabledClass,
|
|
28
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4" })
|
|
29
|
+
}),
|
|
30
|
+
children
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export { DocsPagerNavigation };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=pager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pager.js","names":[],"sources":["../../src/site/pager.tsx"],"sourcesContent":["import Link from \"next/link\";\nimport type { ReactNode } from \"react\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\n\nconst pagerLabel = (direction: \"Previous\" | \"Next\", name: ReactNode) =>\n typeof name === \"string\" && name !== \"\"\n ? `${direction}: ${name}`\n : `${direction} page`;\n\nexport function DocsPagerNavigation({\n previous,\n next,\n children,\n}: {\n previous?: { url: string; name?: ReactNode } | undefined;\n next?: { url: string; name?: ReactNode } | undefined;\n children?: ReactNode;\n}) {\n const buttonClass =\n \"flex size-7 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground sm:size-8\";\n const disabledClass =\n \"flex size-7 items-center justify-center rounded-md bg-muted/30 text-muted-foreground/40 cursor-not-allowed sm:size-8\";\n return (\n <div className=\"flex items-center gap-1\">\n {previous ? (\n <Link\n href={previous.url}\n className={buttonClass}\n aria-label={pagerLabel(\"Previous\", previous.name)}\n >\n <ChevronLeft className=\"size-4\" />\n </Link>\n ) : (\n <div className={disabledClass}>\n <ChevronLeft className=\"size-4\" />\n </div>\n )}\n {next ? (\n <Link\n href={next.url}\n className={buttonClass}\n aria-label={pagerLabel(\"Next\", next.name)}\n >\n <ChevronRight className=\"size-4\" />\n </Link>\n ) : (\n <div className={disabledClass}>\n <ChevronRight className=\"size-4\" />\n </div>\n )}\n {children}\n </div>\n );\n}\n"],"mappings":";;;;AAIA,MAAM,cAAc,WAAgC,SAClD,OAAO,SAAS,YAAY,SAAS,KACjC,GAAG,UAAU,IAAI,SACjB,GAAG,UAAU;AAEnB,SAAgB,oBAAoB,EAClC,UACA,MACA,YAKC;CACD,MAAM,cACJ;CACF,MAAM,gBACJ;CACF,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACG,WACC,oBAAC,MAAD;IACE,MAAM,SAAS;IACf,WAAW;IACX,cAAY,WAAW,YAAY,SAAS,IAAI;IAEhD,UAAA,oBAAC,aAAD,EAAa,WAAU,SAAU,CAAA;GAC7B,CAAA,IAEN,oBAAC,OAAD;IAAK,WAAW;IACd,UAAA,oBAAC,aAAD,EAAa,WAAU,SAAU,CAAA;GAC9B,CAAA;GAEN,OACC,oBAAC,MAAD;IACE,MAAM,KAAK;IACX,WAAW;IACX,cAAY,WAAW,QAAQ,KAAK,IAAI;IAExC,UAAA,oBAAC,cAAD,EAAc,WAAU,SAAU,CAAA;GAC9B,CAAA,IAEN,oBAAC,OAAD;IAAK,WAAW;IACd,UAAA,oBAAC,cAAD,EAAc,WAAU,SAAU,CAAA;GAC/B,CAAA;GAEN;EACE;;AAET"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { DocsNode, DocsFolder } from "./tree.js";
|
|
3
|
+
export declare function DocsSidebarNavigation({ sections, pathname, activeSectionId, isVisible, onNavigate, banner, footer, platform, }: {
|
|
4
|
+
sections: readonly DocsFolder[];
|
|
5
|
+
pathname: string;
|
|
6
|
+
activeSectionId: string | null;
|
|
7
|
+
isVisible?: (node: DocsNode) => boolean;
|
|
8
|
+
onNavigate: () => void;
|
|
9
|
+
banner?: ReactNode;
|
|
10
|
+
footer?: ReactNode;
|
|
11
|
+
platform?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=sidebar-navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-navigation.d.ts","sourceRoot":"","sources":["../../src/site/sidebar-navigation.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAe;AAwKnD,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,SAAmB,EACnB,UAAU,EACV,MAAM,EACN,MAAM,EACN,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;IACxC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,+BA4EA"}
|