@assistant-ui/docs-theme 0.0.0 → 0.0.2

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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +141 -0
  3. package/dist/action-icons.d.ts +5 -0
  4. package/dist/action-icons.d.ts.map +1 -0
  5. package/dist/action-icons.js +52 -0
  6. package/dist/action-icons.js.map +1 -0
  7. package/dist/brand.d.ts +7 -0
  8. package/dist/brand.d.ts.map +1 -0
  9. package/dist/brand.js +37 -0
  10. package/dist/brand.js.map +1 -0
  11. package/dist/config.d.ts +3 -0
  12. package/dist/config.d.ts.map +1 -0
  13. package/dist/config.js +22 -0
  14. package/dist/config.js.map +1 -0
  15. package/dist/header.d.ts +12 -0
  16. package/dist/header.d.ts.map +1 -0
  17. package/dist/header.js +73 -0
  18. package/dist/header.js.map +1 -0
  19. package/dist/index.d.ts +8 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +48 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/navigation.d.ts +23 -0
  24. package/dist/navigation.d.ts.map +1 -0
  25. package/dist/navigation.js +41 -0
  26. package/dist/navigation.js.map +1 -0
  27. package/dist/next.d.ts +29 -0
  28. package/dist/next.d.ts.map +1 -0
  29. package/dist/next.js +63 -0
  30. package/dist/next.js.map +1 -0
  31. package/dist/page-content.d.ts +12 -0
  32. package/dist/page-content.d.ts.map +1 -0
  33. package/dist/page-content.js +274 -0
  34. package/dist/page-content.js.map +1 -0
  35. package/dist/provider.d.ts +2 -0
  36. package/dist/provider.d.ts.map +1 -0
  37. package/dist/provider.js +1 -0
  38. package/package.json +91 -1
  39. package/src/action-icons.tsx +48 -0
  40. package/src/brand.tsx +36 -0
  41. package/src/config.ts +23 -0
  42. package/src/header.test.tsx +41 -0
  43. package/src/header.tsx +94 -0
  44. package/src/index.test.ts +37 -0
  45. package/src/index.ts +38 -0
  46. package/src/layout-hosts.test.tsx +98 -0
  47. package/src/navigation.test.ts +123 -0
  48. package/src/navigation.ts +61 -0
  49. package/src/next.test.tsx +110 -0
  50. package/src/next.tsx +101 -0
  51. package/src/page-content.test.tsx +87 -0
  52. package/src/page-content.tsx +416 -0
  53. package/src/provider.ts +1 -0
  54. package/styles/theme.css +858 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AgentbaseAI Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,141 @@
1
+ # @assistant-ui/docs-theme
2
+
3
+ The assistant-ui theme for Farming Labs Docs on Next.js. It includes the header,
4
+ sidebar, search button, light/dark appearance, table of contents, page actions,
5
+ and previous/next navigation. Page actions sit alongside the title; bottom
6
+ navigation stays at the bottom of short pages and follows longer content.
7
+
8
+ Site content, repository links, fonts, and legal footer remain in the consuming
9
+ app. Consumers install this package from npm.
10
+ The private website in `apps/docs` is named `@assistant-ui/docs-site`.
11
+
12
+ ## Install
13
+
14
+ ```sh
15
+ pnpm add @assistant-ui/docs-theme @farming-labs/docs@0.2.127 @farming-labs/next@0.2.127 @farming-labs/theme@0.2.127 fumadocs-ui@16.17.1
16
+ ```
17
+
18
+ Use Farming Labs Docs, Next, and Theme 0.2.127 with Fumadocs UI 16.17.1.
19
+ Fumadocs UI is a required peer because the theme imports its shared contexts.
20
+ Package managers with automatic peer installation install it; otherwise, add
21
+ `fumadocs-ui@16.17.1` directly and satisfy its peers. With Yarn PnP, also install
22
+ `fumadocs-core@16.17.1` and align its Zod 4 peer with the version resolved by
23
+ `@farming-labs/theme`. PnP can create separate context instances for different
24
+ peer environments even when the Fumadocs versions match.
25
+
26
+ The Docs, Theme, and Fumadocs UI peers use exact versions as an exception to the
27
+ repository's caret-range convention. A future framework patch may change its
28
+ Fumadocs dependency, so accepting it independently could split the tree, search,
29
+ and TOC React contexts and break rendering. Update all three pins together and
30
+ run the full layout render tests when changing them. The framework owns
31
+ MDX rendering, content discovery, search, Markdown routes, and MCP endpoints;
32
+ this package supplies the appearance and navigation components.
33
+
34
+ ## Configure a site
35
+
36
+ ```tsx
37
+ // docs.config.tsx
38
+ import { defineDocs } from "@farming-labs/docs";
39
+ import { assistantUi, DocsBrand } from "@assistant-ui/docs-theme";
40
+
41
+ export default defineDocs({
42
+ entry: "docs",
43
+ theme: assistantUi(),
44
+ nav: { title: <DocsBrand name="my-project" />, url: "/docs" },
45
+ github: {
46
+ url: "https://github.com/my-org/my-project",
47
+ branch: "main",
48
+ directory: "apps/docs",
49
+ },
50
+ metadata: { titleTemplate: "%s – My project" },
51
+ mcp: true,
52
+ });
53
+ ```
54
+
55
+ `createDocsLayout` applies the assistant-ui layout defaults and hides the
56
+ framework's duplicate page actions. It defaults to a flat sidebar without a
57
+ collapse control. Keep `defineDocs` imported from Farming Labs so its build-time
58
+ config discovery continues to work. Existing ordering, metadata, search, and
59
+ content options are accepted.
60
+ Supply any React node as `nav.title` to use your own branding, or use
61
+ `<DocsBrand />` for assistant-ui without a product suffix.
62
+
63
+ ```tsx
64
+ // app/docs/layout.tsx
65
+ import { createDocsLayout, createDocsMetadata } from "@assistant-ui/docs-theme/next";
66
+ import config from "../../docs.config";
67
+
68
+ export const metadata = createDocsMetadata(config);
69
+
70
+ export default createDocsLayout(config, {
71
+ name: "My project",
72
+ homeUrl: "/",
73
+ links: [
74
+ { label: "GitHub", href: "https://github.com/my-org/my-project", external: true },
75
+ ],
76
+ mcpUrl: "/api/docs/mcp",
77
+ footer: <span>© My project</span>,
78
+ });
79
+ ```
80
+
81
+ Use `brand` for interactive header content such as a project switcher.
82
+ For a multilingual site, pass `locale` from the site's locale selection to
83
+ `createDocsLayout`. This selects the framework's localized content tree and
84
+ preserves locale parameters in header, pagination, and Markdown links.
85
+ Use `layoutProps` to provide a custom Fumadocs `tree`, navigation `slots`, or
86
+ sidebar options. Wrap a persistent sidebar banner in an element with
87
+ `data-docs-sidebar-banner` to keep it visible on desktop.
88
+
89
+ Both `mcpUrl` and `footer` are optional. The MCP action is omitted when no URL is
90
+ provided. Repository edit links use `github` and the App Router MDX file path;
91
+ for other content locations, pass an `editUrl` template to `createDocsLayout`,
92
+ such as `https://github.com/my-org/my-project/edit/main/src/app{path}/page.mdx`.
93
+ `{path}` is the current page URL path.
94
+
95
+ ```tsx
96
+ // app/layout.tsx
97
+ import { RootProvider } from "@assistant-ui/docs-theme/provider";
98
+ import "./global.css";
99
+
100
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
101
+ return (
102
+ <html lang="en" suppressHydrationWarning>
103
+ <body><RootProvider>{children}</RootProvider></body>
104
+ </html>
105
+ );
106
+ }
107
+ ```
108
+
109
+ ```css
110
+ /* app/global.css — replaces the direct Farming Labs theme CSS import */
111
+ @import "tailwindcss";
112
+ @import "@assistant-ui/docs-theme/styles.css";
113
+ ```
114
+
115
+ Keep the framework's `withDocs` Next configuration and API routes. Set up
116
+ Tailwind/PostCSS as in a normal Farming Labs Docs app. Import the theme stylesheet
117
+ once, after Tailwind. For the matching typography, load Public Sans and JetBrains
118
+ Mono in the host app with the CSS variables `--font-public-sans` and
119
+ `--font-jetbrains-mono`; system fonts are used when those are absent.
120
+
121
+ For theme token overrides, pass `theme: assistantUi({ ui: { ... } })` to
122
+ `defineDocs`. Additional visual overrides can follow the CSS import and target
123
+ the `aui-docs-*` classes. The theme doesn't import app aliases, MDX content, or
124
+ Harness-specific URLs.
125
+
126
+ ## Development
127
+
128
+ ```sh
129
+ pnpm --filter @assistant-ui/docs-theme typecheck
130
+ pnpm --filter @assistant-ui/docs-theme test
131
+ pnpm --filter @assistant-ui/docs-theme build
132
+ ```
133
+
134
+ Rebuild after changing package components; consumers import the compiled `dist`
135
+ exports. The `next` export stays on the server, while the header and page controls preserve their React client boundaries.
136
+ Import `provider` from the server root layout; it re-exports the framework's
137
+ client provider without pulling server-only framework exports into the browser.
138
+
139
+ In this workspace, use `"@assistant-ui/docs-theme": "workspace:*"`. To test local
140
+ changes in another repository, run `pnpm pack` in this package and install the
141
+ resulting archive with `pnpm add /path/to/package.tgz`.
@@ -0,0 +1,5 @@
1
+ import type { ComponentProps } from "react";
2
+ export declare const ClaudeIcon: (props: ComponentProps<"svg">) => import("react").JSX.Element;
3
+ export declare const McpIcon: (props: ComponentProps<"svg">) => import("react").JSX.Element;
4
+ export declare const OpenAIIcon: (props: ComponentProps<"svg">) => import("react").JSX.Element;
5
+ //# sourceMappingURL=action-icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-icons.d.ts","sourceRoot":"","sources":["../src/action-icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,eAAO,MAAM,UAAU,GAAI,OAAO,cAAc,CAAC,KAAK,CAAC,gCAMtD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,cAAc,CAAC,KAAK,CAAC,gCAuBnD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,cAAc,CAAC,KAAK,CAAC,gCAYtD,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ // src/action-icons.tsx
3
+ const ClaudeIcon = (props) => {
4
+ return /* @__PURE__ */ jsx("svg", {
5
+ "aria-hidden": "true",
6
+ ...props,
7
+ viewBox: "0 0 24 24",
8
+ fill: "currentColor",
9
+ children: /* @__PURE__ */ jsx("path", { d: "m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z" })
10
+ });
11
+ };
12
+ const McpIcon = (props) => {
13
+ return /* @__PURE__ */ jsxs("svg", {
14
+ "aria-hidden": "true",
15
+ ...props,
16
+ viewBox: "0 0 180 180",
17
+ fill: "none",
18
+ children: [
19
+ /* @__PURE__ */ jsx("path", {
20
+ d: "M18 84.8528L85.8822 16.9706C95.2548 7.59798 110.451 7.59798 119.823 16.9706C129.196 26.3431 129.196 41.5391 119.823 50.9117L68.5581 102.177",
21
+ stroke: "currentColor",
22
+ strokeWidth: 12,
23
+ strokeLinecap: "round"
24
+ }),
25
+ /* @__PURE__ */ jsx("path", {
26
+ d: "M69.2652 101.47L119.823 50.9117C129.196 41.5391 144.392 41.5391 153.765 50.9117L154.118 51.2652C163.491 60.6378 163.491 75.8338 154.118 85.2063L92.7248 146.6C89.6006 149.724 89.6006 154.789 92.7248 157.913L105.331 170.52",
27
+ stroke: "currentColor",
28
+ strokeWidth: 12,
29
+ strokeLinecap: "round"
30
+ }),
31
+ /* @__PURE__ */ jsx("path", {
32
+ d: "M102.853 33.9411L52.6482 84.1457C43.2756 93.5183 43.2756 108.714 52.6482 118.087C62.0208 127.459 77.2167 127.459 86.5893 118.087L136.794 67.8822",
33
+ stroke: "currentColor",
34
+ strokeWidth: 12,
35
+ strokeLinecap: "round"
36
+ })
37
+ ]
38
+ });
39
+ };
40
+ const OpenAIIcon = (props) => {
41
+ return /* @__PURE__ */ jsx("svg", {
42
+ viewBox: "0 0 256 260",
43
+ xmlns: "http://www.w3.org/2000/svg",
44
+ fill: "currentColor",
45
+ "aria-hidden": "true",
46
+ ...props,
47
+ children: /* @__PURE__ */ jsx("path", { d: "M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87 51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921 51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58 28.138-16.217 28.188 16.218v32.434l-28.086 16.218-28.188-16.218-.052-32.434Z" })
48
+ });
49
+ };
50
+ export { ClaudeIcon, McpIcon, OpenAIIcon };
51
+
52
+ //# sourceMappingURL=action-icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-icons.js","names":[],"sources":["../src/action-icons.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\nexport const ClaudeIcon = (props: ComponentProps<\"svg\">) => {\n return (\n <svg aria-hidden=\"true\" {...props} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z\" />\n </svg>\n );\n};\n\nexport const McpIcon = (props: ComponentProps<\"svg\">) => {\n return (\n <svg aria-hidden=\"true\" {...props} viewBox=\"0 0 180 180\" fill=\"none\">\n <path\n d=\"M18 84.8528L85.8822 16.9706C95.2548 7.59798 110.451 7.59798 119.823 16.9706C129.196 26.3431 129.196 41.5391 119.823 50.9117L68.5581 102.177\"\n stroke=\"currentColor\"\n strokeWidth={12}\n strokeLinecap=\"round\"\n />\n <path\n d=\"M69.2652 101.47L119.823 50.9117C129.196 41.5391 144.392 41.5391 153.765 50.9117L154.118 51.2652C163.491 60.6378 163.491 75.8338 154.118 85.2063L92.7248 146.6C89.6006 149.724 89.6006 154.789 92.7248 157.913L105.331 170.52\"\n stroke=\"currentColor\"\n strokeWidth={12}\n strokeLinecap=\"round\"\n />\n <path\n d=\"M102.853 33.9411L52.6482 84.1457C43.2756 93.5183 43.2756 108.714 52.6482 118.087C62.0208 127.459 77.2167 127.459 86.5893 118.087L136.794 67.8822\"\n stroke=\"currentColor\"\n strokeWidth={12}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n};\n\nexport const OpenAIIcon = (props: ComponentProps<\"svg\">) => {\n return (\n <svg\n viewBox=\"0 0 256 260\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87 51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921 51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58 28.138-16.217 28.188 16.218v32.434l-28.086 16.218-28.188-16.218-.052-32.434Z\" />\n </svg>\n );\n};\n"],"mappings":";;AAEA,MAAa,cAAc,UAAiC;CAC1D,OACE,oBAAC,OAAD;EAAK,eAAY;EAAO,GAAI;EAAO,SAAQ;EAAY,MAAK;EAC1D,UAAA,oBAAC,QAAD,EAAM,GAAE,sxDAAuxD,CAAA;CAC5xD,CAAA;AAET;AAEA,MAAa,WAAW,UAAiC;CACvD,OACE,qBAAC,OAAD;EAAK,eAAY;EAAO,GAAI;EAAO,SAAQ;EAAc,MAAK;EAA9D,UAAA;GACE,oBAAC,QAAD;IACE,GAAE;IACF,QAAO;IACP,aAAa;IACb,eAAc;GACf,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,QAAO;IACP,aAAa;IACb,eAAc;GACf,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,QAAO;IACP,aAAa;IACb,eAAc;GACf,CAAA;EACE;;AAET;AAEA,MAAa,cAAc,UAAiC;CAC1D,OACE,oBAAC,OAAD;EACE,SAAQ;EACR,OAAM;EACN,MAAK;EACL,eAAY;EACZ,GAAI;EAEJ,UAAA,oBAAC,QAAD,EAAM,GAAE,qhDAAshD,CAAA;CAC3hD,CAAA;AAET"}
@@ -0,0 +1,7 @@
1
+ export declare const DocsBrand: ({ name }: DocsBrand.Props) => import("react").JSX.Element;
2
+ export declare namespace DocsBrand {
3
+ interface Props {
4
+ name?: string;
5
+ }
6
+ }
7
+ //# sourceMappingURL=brand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../src/brand.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,UAAU,SAAS,CAAC,KAAK,gCA6BlD,CAAC;AAEF,yBAAiB,SAAS,CAAC;IACzB,UAAiB,KAAK;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;CACF"}
package/dist/brand.js ADDED
@@ -0,0 +1,37 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ // src/brand.tsx
3
+ const DocsBrand = ({ name }) => {
4
+ return /* @__PURE__ */ jsxs("span", {
5
+ className: "aui-docs-brand",
6
+ children: [
7
+ /* @__PURE__ */ jsxs("svg", {
8
+ "aria-hidden": "true",
9
+ className: "aui-docs-brand-logo",
10
+ viewBox: "40 40 24 24",
11
+ fill: "none",
12
+ children: [/* @__PURE__ */ jsx("path", {
13
+ d: "M52.5 44C52.5 43.9005 52.4704 43.8042 52.416 43.7227L52.3535 43.6465C52.2597 43.5527 52.1325 43.5 52 43.5H44C43.7284 43.5 43.5 43.7284 43.5 44V51.3789L44.9395 49.9395L45.0498 49.8398C45.3167 49.6212 45.652 49.5 46 49.5H52C52.1326 49.5 52.2597 49.4473 52.3535 49.3535C52.4473 49.2597 52.5 49.1326 52.5 49V44ZM55.5 49C55.5 49.9283 55.131 50.8182 54.4746 51.4746C53.8182 52.131 52.9282 52.5 52 52.5H46.6211L43.0605 56.0605C42.6315 56.4895 41.9863 56.6179 41.4258 56.3857C40.8654 56.1535 40.5 55.6066 40.5 55V44C40.5 42.0716 42.0716 40.5 44 40.5H52C52.9282 40.5 53.8182 40.869 54.4746 41.5254C55.131 42.1818 55.5 43.0718 55.5 44V49Z",
14
+ fill: "currentColor"
15
+ }), /* @__PURE__ */ jsx("path", {
16
+ d: "M60.5 51C60.5 50.9006 60.4704 50.8042 60.416 50.7227L60.3535 50.6465C60.2597 50.5527 60.1325 50.5 60 50.5H58C57.1716 50.5 56.5 49.8284 56.5 49C56.5 48.1716 57.1716 47.5 58 47.5H60C60.9282 47.5 61.8182 47.869 62.4746 48.5254C63.131 49.1818 63.5 50.0718 63.5 51V62C63.5 62.6066 63.1346 63.1535 62.5742 63.3857C62.0137 63.6179 61.3685 63.4895 60.9395 63.0605L57.3789 59.5H52C51.0718 59.5 50.1818 59.131 49.5254 58.4746C48.869 57.8182 48.5 56.9282 48.5 56V55C48.5 54.1716 49.1716 53.5 50 53.5C50.8284 53.5 51.5 54.1716 51.5 55V56C51.5 56.1326 51.5527 56.2597 51.6465 56.3535C51.7403 56.4473 51.8674 56.5 52 56.5H58C58.3978 56.5 58.7792 56.6581 59.0605 56.9395L60.5 58.3789V51Z",
17
+ fill: "currentColor"
18
+ })]
19
+ }),
20
+ /* @__PURE__ */ jsx("span", {
21
+ className: "aui-docs-brand-source",
22
+ children: "assistant-ui"
23
+ }),
24
+ name && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
25
+ "aria-hidden": "true",
26
+ className: "aui-docs-brand-slash",
27
+ children: "/"
28
+ }), /* @__PURE__ */ jsx("span", {
29
+ className: "aui-docs-brand-product",
30
+ children: name
31
+ })] })
32
+ ]
33
+ });
34
+ };
35
+ export { DocsBrand };
36
+
37
+ //# sourceMappingURL=brand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.js","names":[],"sources":["../src/brand.tsx"],"sourcesContent":["export const DocsBrand = ({ name }: DocsBrand.Props) => {\n return (\n <span className=\"aui-docs-brand\">\n <svg\n aria-hidden=\"true\"\n className=\"aui-docs-brand-logo\"\n viewBox=\"40 40 24 24\"\n fill=\"none\"\n >\n <path\n d=\"M52.5 44C52.5 43.9005 52.4704 43.8042 52.416 43.7227L52.3535 43.6465C52.2597 43.5527 52.1325 43.5 52 43.5H44C43.7284 43.5 43.5 43.7284 43.5 44V51.3789L44.9395 49.9395L45.0498 49.8398C45.3167 49.6212 45.652 49.5 46 49.5H52C52.1326 49.5 52.2597 49.4473 52.3535 49.3535C52.4473 49.2597 52.5 49.1326 52.5 49V44ZM55.5 49C55.5 49.9283 55.131 50.8182 54.4746 51.4746C53.8182 52.131 52.9282 52.5 52 52.5H46.6211L43.0605 56.0605C42.6315 56.4895 41.9863 56.6179 41.4258 56.3857C40.8654 56.1535 40.5 55.6066 40.5 55V44C40.5 42.0716 42.0716 40.5 44 40.5H52C52.9282 40.5 53.8182 40.869 54.4746 41.5254C55.131 42.1818 55.5 43.0718 55.5 44V49Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M60.5 51C60.5 50.9006 60.4704 50.8042 60.416 50.7227L60.3535 50.6465C60.2597 50.5527 60.1325 50.5 60 50.5H58C57.1716 50.5 56.5 49.8284 56.5 49C56.5 48.1716 57.1716 47.5 58 47.5H60C60.9282 47.5 61.8182 47.869 62.4746 48.5254C63.131 49.1818 63.5 50.0718 63.5 51V62C63.5 62.6066 63.1346 63.1535 62.5742 63.3857C62.0137 63.6179 61.3685 63.4895 60.9395 63.0605L57.3789 59.5H52C51.0718 59.5 50.1818 59.131 49.5254 58.4746C48.869 57.8182 48.5 56.9282 48.5 56V55C48.5 54.1716 49.1716 53.5 50 53.5C50.8284 53.5 51.5 54.1716 51.5 55V56C51.5 56.1326 51.5527 56.2597 51.6465 56.3535C51.7403 56.4473 51.8674 56.5 52 56.5H58C58.3978 56.5 58.7792 56.6581 59.0605 56.9395L60.5 58.3789V51Z\"\n fill=\"currentColor\"\n />\n </svg>\n <span className=\"aui-docs-brand-source\">assistant-ui</span>\n {name && (\n <>\n <span aria-hidden=\"true\" className=\"aui-docs-brand-slash\">\n /\n </span>\n <span className=\"aui-docs-brand-product\">{name}</span>\n </>\n )}\n </span>\n );\n};\n\nexport namespace DocsBrand {\n export interface Props {\n name?: string;\n }\n}\n"],"mappings":";;AAAA,MAAa,aAAa,EAAE,WAA4B;CACtD,OACE,qBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA;GACE,qBAAC,OAAD;IACE,eAAY;IACZ,WAAU;IACV,SAAQ;IACR,MAAK;IAJP,UAAA,CAME,oBAAC,QAAD;KACE,GAAE;KACF,MAAK;IACN,CAAA,GACD,oBAAC,QAAD;KACE,GAAE;KACF,MAAK;IACN,CAAA,CACE;;GACL,oBAAC,QAAD;IAAM,WAAU;IAAwB,UAAA;GAAkB,CAAA;GACzD,QACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;IAAM,eAAY;IAAO,WAAU;IAAuB,UAAA;GAEpD,CAAA,GACN,oBAAC,QAAD;IAAM,WAAU;IAA0B,UAAA;GAAW,CAAA,CACrD,EAAA,CAAA;EAEA;;AAEV"}
@@ -0,0 +1,3 @@
1
+ import { type DocsConfig } from "@farming-labs/docs";
2
+ export declare const withThemeDefaults: (options: DocsConfig) => DocsConfig;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,iBAAiB,GAAI,SAAS,UAAU,KAAG,UAgBpD,CAAC"}
package/dist/config.js ADDED
@@ -0,0 +1,22 @@
1
+ import { assistantUi } from "./index.js";
2
+ import { defineDocs } from "@farming-labs/docs";
3
+ // src/config.ts
4
+ const withThemeDefaults = (options) => defineDocs({
5
+ ...options,
6
+ theme: options.theme ?? assistantUi(),
7
+ sidebar: options.sidebar === false ? false : {
8
+ collapsible: false,
9
+ flat: true,
10
+ folderIndexBehavior: "link",
11
+ ...typeof options.sidebar === "object" ? options.sidebar : {}
12
+ },
13
+ breadcrumb: options.breadcrumb ?? { enabled: false },
14
+ lastUpdated: options.lastUpdated ?? false,
15
+ pageActions: {
16
+ copyMarkdown: false,
17
+ openDocs: false
18
+ }
19
+ });
20
+ export { withThemeDefaults };
21
+
22
+ //# sourceMappingURL=config.js.map
@@ -0,0 +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"}
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from "react";
2
+ import type { createDocsLayout } from "./next.js";
3
+ export declare const DocsHeader: ({ brand, brandSlot, homeUrl, docsUrl, name, links, themeToggle, }: {
4
+ brand: ReactNode;
5
+ brandSlot: ReactNode;
6
+ homeUrl: string;
7
+ docsUrl: string;
8
+ name: string;
9
+ links: createDocsLayout.Options["links"];
10
+ themeToggle: boolean;
11
+ }) => import("react").JSX.Element;
12
+ //# sourceMappingURL=header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../src/header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAe;AAE/C,eAAO,MAAM,UAAU,GAAI,mEAQxB;IACD,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,WAAW,EAAE,OAAO,CAAC;CACtB,gCAoEA,CAAC"}
package/dist/header.js ADDED
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import { Moon, Search, Sun } from "lucide-react";
5
+ import { useTheme } from "next-themes";
6
+ import { useSearchContext } from "fumadocs-ui/contexts/search";
7
+ // src/header.tsx
8
+ const DocsHeader = ({ brand, brandSlot, homeUrl, docsUrl, name, links, themeToggle }) => {
9
+ const { resolvedTheme, setTheme } = useTheme();
10
+ const { setOpenSearch, hotKey } = useSearchContext();
11
+ return /* @__PURE__ */ jsxs("header", {
12
+ className: "aui-docs-header",
13
+ children: [brandSlot ? /* @__PURE__ */ jsx("div", {
14
+ className: "aui-docs-header-brand",
15
+ children: brandSlot
16
+ }) : /* @__PURE__ */ jsx(Link, {
17
+ href: homeUrl,
18
+ className: "aui-docs-header-brand",
19
+ "aria-label": `${name} home`,
20
+ children: brand
21
+ }), /* @__PURE__ */ jsxs("div", {
22
+ className: "aui-docs-header-controls",
23
+ children: [
24
+ /* @__PURE__ */ jsxs("button", {
25
+ type: "button",
26
+ className: "aui-docs-header-search",
27
+ "aria-label": "Search documentation",
28
+ onClick: () => setOpenSearch(true),
29
+ children: [
30
+ /* @__PURE__ */ jsx(Search, { "aria-hidden": "true" }),
31
+ /* @__PURE__ */ jsx("span", { children: "Search..." }),
32
+ hotKey.length > 0 && /* @__PURE__ */ jsx("kbd", {
33
+ "aria-hidden": "true",
34
+ children: hotKey.map((key, index) => /* @__PURE__ */ jsxs("span", { children: [index > 0 && " ", key.display] }, index))
35
+ })
36
+ ]
37
+ }),
38
+ /* @__PURE__ */ jsxs("nav", {
39
+ className: "aui-docs-header-links",
40
+ "aria-label": "Site navigation",
41
+ children: [/* @__PURE__ */ jsx(Link, {
42
+ href: docsUrl,
43
+ "aria-current": "true",
44
+ children: "Docs"
45
+ }), links?.map((link) => /* @__PURE__ */ jsx("a", {
46
+ href: link.href,
47
+ ...link.external ? {
48
+ target: "_blank",
49
+ rel: "noreferrer noopener"
50
+ } : {},
51
+ children: link.label
52
+ }, link.href))]
53
+ }),
54
+ themeToggle && /* @__PURE__ */ jsxs("button", {
55
+ type: "button",
56
+ className: "aui-docs-theme-toggle",
57
+ "aria-label": "Toggle color theme",
58
+ onClick: () => setTheme(resolvedTheme === "dark" ? "light" : "dark"),
59
+ children: [/* @__PURE__ */ jsx(Sun, {
60
+ className: "aui-docs-theme-sun",
61
+ "aria-hidden": "true"
62
+ }), /* @__PURE__ */ jsx(Moon, {
63
+ className: "aui-docs-theme-moon",
64
+ "aria-hidden": "true"
65
+ })]
66
+ })
67
+ ]
68
+ })]
69
+ });
70
+ };
71
+ export { DocsHeader };
72
+
73
+ //# sourceMappingURL=header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.js","names":[],"sources":["../src/header.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport Link from \"next/link\";\nimport { Moon, Search, Sun } from \"lucide-react\";\nimport { useTheme } from \"next-themes\";\nimport { useSearchContext } from \"fumadocs-ui/contexts/search\";\nimport type { createDocsLayout } from \"./next\";\n\nexport const DocsHeader = ({\n brand,\n brandSlot,\n homeUrl,\n docsUrl,\n name,\n links,\n themeToggle,\n}: {\n brand: ReactNode;\n brandSlot: ReactNode;\n homeUrl: string;\n docsUrl: string;\n name: string;\n links: createDocsLayout.Options[\"links\"];\n themeToggle: boolean;\n}) => {\n const { resolvedTheme, setTheme } = useTheme();\n const { setOpenSearch, hotKey } = useSearchContext();\n return (\n <header className=\"aui-docs-header\">\n {brandSlot ? (\n <div className=\"aui-docs-header-brand\">{brandSlot}</div>\n ) : (\n <Link\n href={homeUrl}\n className=\"aui-docs-header-brand\"\n aria-label={`${name} home`}\n >\n {brand}\n </Link>\n )}\n <div className=\"aui-docs-header-controls\">\n <button\n type=\"button\"\n className=\"aui-docs-header-search\"\n aria-label=\"Search documentation\"\n onClick={() => setOpenSearch(true)}\n >\n <Search aria-hidden=\"true\" />\n <span>Search...</span>\n {hotKey.length > 0 && (\n <kbd aria-hidden=\"true\">\n {hotKey.map((key, index) => (\n <span key={index}>\n {index > 0 && \" \"}\n {key.display}\n </span>\n ))}\n </kbd>\n )}\n </button>\n <nav className=\"aui-docs-header-links\" aria-label=\"Site navigation\">\n <Link href={docsUrl} aria-current=\"true\">\n Docs\n </Link>\n {links?.map((link) => (\n <a\n key={link.href}\n href={link.href}\n {...(link.external\n ? { target: \"_blank\", rel: \"noreferrer noopener\" }\n : {})}\n >\n {link.label}\n </a>\n ))}\n </nav>\n {themeToggle && (\n <button\n type=\"button\"\n className=\"aui-docs-theme-toggle\"\n aria-label=\"Toggle color theme\"\n onClick={() =>\n setTheme(resolvedTheme === \"dark\" ? \"light\" : \"dark\")\n }\n >\n <Sun className=\"aui-docs-theme-sun\" aria-hidden=\"true\" />\n <Moon className=\"aui-docs-theme-moon\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n </header>\n );\n};\n"],"mappings":";;;;;;;AASA,MAAa,cAAc,EACzB,OACA,WACA,SACA,SACA,MACA,OACA,kBASI;CACJ,MAAM,EAAE,eAAe,aAAa,SAAS;CAC7C,MAAM,EAAE,eAAe,WAAW,iBAAiB;CACnD,OACE,qBAAC,UAAD;EAAQ,WAAU;EAAlB,UAAA,CACG,YACC,oBAAC,OAAD;GAAK,WAAU;GAAyB,UAAA;EAAe,CAAA,IAEvD,oBAAC,MAAD;GACE,MAAM;GACN,WAAU;GACV,cAAY,GAAG,KAAK;GAEnB,UAAA;EACG,CAAA,GAER,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,qBAAC,UAAD;KACE,MAAK;KACL,WAAU;KACV,cAAW;KACX,eAAe,cAAc,IAAI;KAJnC,UAAA;MAME,oBAAC,QAAD,EAAQ,eAAY,OAAQ,CAAA;MAC5B,oBAAC,QAAD,EAAA,UAAM,YAAe,CAAA;MACpB,OAAO,SAAS,KACf,oBAAC,OAAD;OAAK,eAAY;OACd,UAAA,OAAO,KAAK,KAAK,UAChB,qBAAC,QAAD,EAAA,UAAA,CACG,QAAQ,KAAK,KACb,IAAI,OACD,EAAA,GAHK,KAGL,CACP;MACE,CAAA;KAED;;IACR,qBAAC,OAAD;KAAK,WAAU;KAAwB,cAAW;KAAlD,UAAA,CACE,oBAAC,MAAD;MAAM,MAAM;MAAS,gBAAa;MAAO,UAAA;KAEnC,CAAA,GACL,OAAO,KAAK,SACX,oBAAC,KAAD;MAEE,MAAM,KAAK;MACX,GAAK,KAAK,WACN;OAAE,QAAQ;OAAU,KAAK;MAAsB,IAC/C,CAAC;MAEJ,UAAA,KAAK;KACL,GAPI,KAAK,IAOT,CACJ,CACE;;IACJ,eACC,qBAAC,UAAD;KACE,MAAK;KACL,WAAU;KACV,cAAW;KACX,eACE,SAAS,kBAAkB,SAAS,UAAU,MAAM;KALxD,UAAA,CAQE,oBAAC,KAAD;MAAK,WAAU;MAAqB,eAAY;KAAQ,CAAA,GACxD,oBAAC,MAAD;MAAM,WAAU;MAAsB,eAAY;KAAQ,CAAA,CACpD;;GAEP;EACC,CAAA,CAAA;;AAEZ"}
@@ -0,0 +1,8 @@
1
+ import { type DocsTheme } from "@farming-labs/docs";
2
+ export declare const assistantUi: (overrides?: assistantUi.Options) => DocsTheme;
3
+ export declare namespace assistantUi {
4
+ interface Options extends Partial<DocsTheme> {
5
+ }
6
+ }
7
+ export { DocsBrand } from "./brand.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA8BjE,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 ADDED
@@ -0,0 +1,48 @@
1
+ import { DocsBrand } from "./brand.js";
2
+ import { createTheme } from "@farming-labs/docs";
3
+ import { shadcn } from "@farming-labs/theme/shadcn";
4
+ // src/index.ts
5
+ const createAssistantTheme = createTheme({
6
+ ...shadcn({ ui: {
7
+ layout: {
8
+ contentWidth: 848,
9
+ sidebarWidth: 260,
10
+ tocWidth: 224,
11
+ header: { height: 48 }
12
+ },
13
+ typography: { font: {
14
+ style: {
15
+ sans: "var(--font-public-sans, ui-sans-serif), system-ui, sans-serif",
16
+ mono: "var(--font-jetbrains-mono, ui-monospace), monospace"
17
+ },
18
+ h1: {
19
+ size: "1.5rem",
20
+ weight: 500,
21
+ letterSpacing: "-0.025em"
22
+ },
23
+ h2: {
24
+ size: "1.25rem",
25
+ weight: 500,
26
+ letterSpacing: "-0.02em"
27
+ },
28
+ h3: {
29
+ size: "1rem",
30
+ weight: 500,
31
+ letterSpacing: "-0.01em"
32
+ },
33
+ body: {
34
+ size: "0.875rem",
35
+ lineHeight: "1.7"
36
+ }
37
+ } },
38
+ codeBlock: {
39
+ showCopyButton: true,
40
+ showLineNumbers: false
41
+ }
42
+ } }),
43
+ name: "assistant-ui"
44
+ });
45
+ const assistantUi = (overrides = {}) => createAssistantTheme(overrides);
46
+ export { DocsBrand, assistantUi };
47
+
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"}
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from "react";
2
+ import type { useTreeContext } from "fumadocs-ui/contexts/tree";
3
+ export declare const getPageNeighbors: (nodes: ReturnType<typeof useTreeContext>["root"]["children"], pathname: string) => {
4
+ current: getPageNeighbors.Link | undefined;
5
+ previous: getPageNeighbors.Link | undefined;
6
+ next: getPageNeighbors.Link | undefined;
7
+ };
8
+ export declare namespace getPageNeighbors {
9
+ interface Link {
10
+ name: ReactNode;
11
+ url: string;
12
+ section?: ReactNode;
13
+ }
14
+ }
15
+ export declare const getEditUrl: (pathname: string, github?: getEditUrl.Options) => string | undefined;
16
+ export declare namespace getEditUrl {
17
+ type Options = string | {
18
+ url: string;
19
+ branch?: string;
20
+ directory?: string;
21
+ };
22
+ }
23
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,eAAO,MAAM,gBAAgB,GAC3B,OAAO,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAC5D,UAAU,MAAM;;;;CAyBjB,CAAC;AAEF,yBAAiB,gBAAgB,CAAC;IAChC,UAAiB,IAAI;QACnB,IAAI,EAAE,SAAS,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,EAAE,SAAS,CAAC;KACrB;CACF;AAED,eAAO,MAAM,UAAU,GAAI,UAAU,MAAM,EAAE,SAAS,UAAU,CAAC,OAAO,uBAUvE,CAAC;AAEF,yBAAiB,UAAU,CAAC;IAC1B,KAAY,OAAO,GACf,MAAM,GACN;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACP"}
@@ -0,0 +1,41 @@
1
+ // src/navigation.ts
2
+ const getPageNeighbors = (nodes, pathname) => {
3
+ const pages = [];
4
+ const visit = (items, section) => {
5
+ for (const node of items) {
6
+ if (node.type === "page") pages.push({
7
+ name: node.name,
8
+ url: node.url,
9
+ section
10
+ });
11
+ if (node.type === "folder") {
12
+ if (node.index) pages.push({
13
+ name: node.index.name,
14
+ url: node.index.url
15
+ });
16
+ visit(node.children, node.name);
17
+ }
18
+ }
19
+ };
20
+ visit(nodes);
21
+ const index = pages.findIndex((page) => page.url.split(/[?#]/, 1)[0]?.replace(/\/$/, "") === pathname.replace(/\/$/, ""));
22
+ return {
23
+ current: pages[index],
24
+ previous: index >= 0 ? pages[index - 1] : void 0,
25
+ next: index >= 0 ? pages[index + 1] : void 0
26
+ };
27
+ };
28
+ const getEditUrl = (pathname, github) => {
29
+ if (!github) return void 0;
30
+ const base = typeof github === "string" ? { url: github } : github;
31
+ const path = base.directory ?? "";
32
+ let start = 0;
33
+ let end = path.length;
34
+ while (path[start] === "/") start++;
35
+ while (end > start && path[end - 1] === "/") end--;
36
+ const directory = path.slice(start, end);
37
+ return `${base.url.replace(/\/$/, "")}/edit/${base.branch ?? "main"}/${directory ? `${directory}/` : ""}app${pathname.replace(/\/$/, "")}/page.mdx`;
38
+ };
39
+ export { getEditUrl, getPageNeighbors };
40
+
41
+ //# sourceMappingURL=navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.js","names":[],"sources":["../src/navigation.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { useTreeContext } from \"fumadocs-ui/contexts/tree\";\n\nexport const getPageNeighbors = (\n nodes: ReturnType<typeof useTreeContext>[\"root\"][\"children\"],\n pathname: string,\n) => {\n const pages: getPageNeighbors.Link[] = [];\n const visit = (items: typeof nodes, section?: ReactNode) => {\n for (const node of items) {\n if (node.type === \"page\")\n pages.push({ name: node.name, url: node.url, section });\n if (node.type === \"folder\") {\n if (node.index)\n pages.push({ name: node.index.name, url: node.index.url });\n visit(node.children, node.name);\n }\n }\n };\n visit(nodes);\n const index = pages.findIndex(\n (page) =>\n page.url.split(/[?#]/, 1)[0]?.replace(/\\/$/, \"\") ===\n pathname.replace(/\\/$/, \"\"),\n );\n return {\n current: pages[index],\n previous: index >= 0 ? pages[index - 1] : undefined,\n next: index >= 0 ? pages[index + 1] : undefined,\n };\n};\n\nexport namespace getPageNeighbors {\n export interface Link {\n name: ReactNode;\n url: string;\n section?: ReactNode;\n }\n}\n\nexport const getEditUrl = (pathname: string, github?: getEditUrl.Options) => {\n if (!github) return undefined;\n const base = typeof github === \"string\" ? { url: github } : github;\n const path = base.directory ?? \"\";\n let start = 0;\n let end = path.length;\n while (path[start] === \"/\") start++;\n while (end > start && path[end - 1] === \"/\") end--;\n const directory = path.slice(start, end);\n return `${base.url.replace(/\\/$/, \"\")}/edit/${base.branch ?? \"main\"}/${directory ? `${directory}/` : \"\"}app${pathname.replace(/\\/$/, \"\")}/page.mdx`;\n};\n\nexport namespace getEditUrl {\n export type Options =\n | string\n | {\n url: string;\n branch?: string;\n directory?: string;\n };\n}\n"],"mappings":";AAGA,MAAa,oBACX,OACA,aACG;CACH,MAAM,QAAiC,CAAC;CACxC,MAAM,SAAS,OAAqB,YAAwB;EAC1D,KAAK,MAAM,QAAQ,OAAO;GACxB,IAAI,KAAK,SAAS,QAChB,MAAM,KAAK;IAAE,MAAM,KAAK;IAAM,KAAK,KAAK;IAAK;GAAQ,CAAC;GACxD,IAAI,KAAK,SAAS,UAAU;IAC1B,IAAI,KAAK,OACP,MAAM,KAAK;KAAE,MAAM,KAAK,MAAM;KAAM,KAAK,KAAK,MAAM;IAAI,CAAC;IAC3D,MAAM,KAAK,UAAU,KAAK,IAAI;GAChC;EACF;CACF;CACA,MAAM,KAAK;CACX,MAAM,QAAQ,MAAM,WACjB,SACC,KAAK,IAAI,MAAM,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,OAAO,EAAE,MAC/C,SAAS,QAAQ,OAAO,EAAE,CAC9B;CACA,OAAO;EACL,SAAS,MAAM;EACf,UAAU,SAAS,IAAI,MAAM,QAAQ,KAAK,KAAA;EAC1C,MAAM,SAAS,IAAI,MAAM,QAAQ,KAAK,KAAA;CACxC;AACF;AAUA,MAAa,cAAc,UAAkB,WAAgC;CAC3E,IAAI,CAAC,QAAQ,OAAO,KAAA;CACpB,MAAM,OAAO,OAAO,WAAW,WAAW,EAAE,KAAK,OAAO,IAAI;CAC5D,MAAM,OAAO,KAAK,aAAa;CAC/B,IAAI,QAAQ;CACZ,IAAI,MAAM,KAAK;CACf,OAAO,KAAK,WAAW,KAAK;CAC5B,OAAO,MAAM,SAAS,KAAK,MAAM,OAAO,KAAK;CAC7C,MAAM,YAAY,KAAK,MAAM,OAAO,GAAG;CACvC,OAAO,GAAG,KAAK,IAAI,QAAQ,OAAO,EAAE,EAAE,QAAQ,KAAK,UAAU,OAAO,GAAG,YAAY,GAAG,UAAU,KAAK,GAAG,KAAK,SAAS,QAAQ,OAAO,EAAE,EAAE;AAC3I"}
package/dist/next.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { type ReactNode } from "react";
2
+ import type { DocsLayoutProps } from "fumadocs-ui/layouts/docs";
3
+ import type { DocsConfig } from "@farming-labs/docs";
4
+ export declare const createDocsMetadata: (config: DocsConfig) => Record<string, unknown>;
5
+ export declare const createDocsLayout: (config: DocsConfig, options: createDocsLayout.Options) => ({ children }: {
6
+ children: ReactNode;
7
+ }) => import("react").JSX.Element;
8
+ export declare namespace createDocsLayout {
9
+ interface Options {
10
+ name: string;
11
+ /** Active locale from the site's Farming Labs i18n configuration. */
12
+ locale?: string;
13
+ /** Custom header branding, including interactive project switchers. */
14
+ brand?: ReactNode;
15
+ /** Framework layout overrides for custom page trees and sidebar slots. */
16
+ layoutProps?: Partial<Omit<DocsLayoutProps, "children">>;
17
+ homeUrl?: string;
18
+ links?: readonly {
19
+ label: string;
20
+ href: string;
21
+ external?: boolean;
22
+ }[];
23
+ footer?: ReactNode;
24
+ mcpUrl?: string;
25
+ /** Override the repository edit link. `{path}` expands to the current page URL path. */
26
+ editUrl?: string;
27
+ }
28
+ }
29
+ //# sourceMappingURL=next.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AASrD,eAAO,MAAM,kBAAkB,GAAI,QAAQ,UAAU,4BAChB,CAAC;AAEtC,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,UAAU,EAClB,SAAS,gBAAgB,CAAC,OAAO,oBAeH;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,gCAmDtD,CAAC;AAEF,yBAAiB,gBAAgB,CAAC;IAChC,UAAiB,OAAO;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,qEAAqE;QACrE,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,uEAAuE;QACvE,KAAK,CAAC,EAAE,SAAS,CAAC;QAClB,0EAA0E;QAC1E,WAAW,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,SAAS;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE,EAAE,CAAC;QACvE,MAAM,CAAC,EAAE,SAAS,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,wFAAwF;QACxF,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;CACF"}