@farming-labs/theme 0.0.2-beta.9 → 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.
- package/dist/ai-search-dialog.d.mts +23 -1
- package/dist/ai-search-dialog.mjs +247 -37
- package/dist/colorful/index.d.mts +78 -0
- package/dist/colorful/index.mjs +82 -0
- package/dist/darkbold/index.d.mts +80 -0
- package/dist/darkbold/index.mjs +84 -0
- package/dist/docs-ai-features.d.mts +3 -1
- package/dist/docs-ai-features.mjs +63 -10
- package/dist/docs-api.d.mts +7 -6
- package/dist/docs-api.mjs +73 -4
- package/dist/docs-command-search.d.mts +10 -0
- package/dist/docs-command-search.mjs +654 -0
- package/dist/docs-layout.d.mts +20 -11
- package/dist/docs-layout.mjs +230 -50
- package/dist/docs-page-client.d.mts +20 -0
- package/dist/docs-page-client.mjs +119 -25
- package/dist/greentree/index.d.mts +80 -0
- package/dist/greentree/index.mjs +84 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +3 -2
- package/dist/page-actions.d.mts +4 -1
- package/dist/page-actions.mjs +8 -4
- package/dist/search.d.mts +1 -1
- package/dist/shiny/index.d.mts +79 -0
- package/dist/shiny/index.mjs +83 -0
- package/dist/sidebar-search-ai.d.mts +11 -0
- package/dist/sidebar-search-ai.mjs +128 -0
- package/package.json +38 -14
- package/styles/ai.css +408 -81
- package/styles/base.css +211 -14
- package/styles/colorful.css +266 -0
- package/styles/darkbold.css +575 -0
- package/styles/darksharp.css +27 -11
- package/styles/default.css +22 -1
- package/styles/greentree.css +719 -0
- package/styles/omni.css +359 -0
- package/styles/pixel-border.css +115 -52
- package/styles/shiny.css +505 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as _farming_labs_docs0 from "@farming-labs/docs";
|
|
2
|
+
|
|
3
|
+
//#region src/greentree/index.d.ts
|
|
4
|
+
declare const GreenTreeUIDefaults: {
|
|
5
|
+
colors: {
|
|
6
|
+
primary: string;
|
|
7
|
+
background: string;
|
|
8
|
+
muted: string;
|
|
9
|
+
border: string;
|
|
10
|
+
};
|
|
11
|
+
typography: {
|
|
12
|
+
font: {
|
|
13
|
+
style: {
|
|
14
|
+
sans: string;
|
|
15
|
+
mono: string;
|
|
16
|
+
};
|
|
17
|
+
h1: {
|
|
18
|
+
size: string;
|
|
19
|
+
weight: number;
|
|
20
|
+
lineHeight: string;
|
|
21
|
+
letterSpacing: string;
|
|
22
|
+
};
|
|
23
|
+
h2: {
|
|
24
|
+
size: string;
|
|
25
|
+
weight: number;
|
|
26
|
+
lineHeight: string;
|
|
27
|
+
letterSpacing: string;
|
|
28
|
+
};
|
|
29
|
+
h3: {
|
|
30
|
+
size: string;
|
|
31
|
+
weight: number;
|
|
32
|
+
lineHeight: string;
|
|
33
|
+
letterSpacing: string;
|
|
34
|
+
};
|
|
35
|
+
h4: {
|
|
36
|
+
size: string;
|
|
37
|
+
weight: number;
|
|
38
|
+
lineHeight: string;
|
|
39
|
+
};
|
|
40
|
+
body: {
|
|
41
|
+
size: string;
|
|
42
|
+
weight: number;
|
|
43
|
+
lineHeight: string;
|
|
44
|
+
};
|
|
45
|
+
small: {
|
|
46
|
+
size: string;
|
|
47
|
+
weight: number;
|
|
48
|
+
lineHeight: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
layout: {
|
|
53
|
+
contentWidth: number;
|
|
54
|
+
sidebarWidth: number;
|
|
55
|
+
toc: {
|
|
56
|
+
enabled: boolean;
|
|
57
|
+
depth: number;
|
|
58
|
+
style: "default";
|
|
59
|
+
};
|
|
60
|
+
header: {
|
|
61
|
+
height: number;
|
|
62
|
+
sticky: boolean;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
components: {
|
|
66
|
+
Callout: {
|
|
67
|
+
variant: string;
|
|
68
|
+
icon: boolean;
|
|
69
|
+
};
|
|
70
|
+
CodeBlock: {
|
|
71
|
+
showCopyButton: boolean;
|
|
72
|
+
};
|
|
73
|
+
Tabs: {
|
|
74
|
+
style: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
declare const greentree: (overrides?: Partial<_farming_labs_docs0.DocsTheme>) => _farming_labs_docs0.DocsTheme;
|
|
79
|
+
//#endregion
|
|
80
|
+
export { GreenTreeUIDefaults, greentree };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { createTheme } from "@farming-labs/docs";
|
|
2
|
+
|
|
3
|
+
//#region src/greentree/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* GreenTree theme preset.
|
|
6
|
+
* Mintlify-inspired design with emerald green accent, Inter typography.
|
|
7
|
+
*
|
|
8
|
+
* CSS: `@import "@farming-labs/theme/greentree/css";`
|
|
9
|
+
*/
|
|
10
|
+
const GreenTreeUIDefaults = {
|
|
11
|
+
colors: {
|
|
12
|
+
primary: "#0D9373",
|
|
13
|
+
background: "#fff",
|
|
14
|
+
muted: "#505351",
|
|
15
|
+
border: "#DFE1E0"
|
|
16
|
+
},
|
|
17
|
+
typography: { font: {
|
|
18
|
+
style: {
|
|
19
|
+
sans: "Inter, -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif",
|
|
20
|
+
mono: "ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace"
|
|
21
|
+
},
|
|
22
|
+
h1: {
|
|
23
|
+
size: "2.25rem",
|
|
24
|
+
weight: 500,
|
|
25
|
+
lineHeight: "1.2",
|
|
26
|
+
letterSpacing: "-0.025em"
|
|
27
|
+
},
|
|
28
|
+
h2: {
|
|
29
|
+
size: "1.875rem",
|
|
30
|
+
weight: 600,
|
|
31
|
+
lineHeight: "1.25",
|
|
32
|
+
letterSpacing: "-0.02em"
|
|
33
|
+
},
|
|
34
|
+
h3: {
|
|
35
|
+
size: "1.5rem",
|
|
36
|
+
weight: 600,
|
|
37
|
+
lineHeight: "1.3",
|
|
38
|
+
letterSpacing: "-0.01em"
|
|
39
|
+
},
|
|
40
|
+
h4: {
|
|
41
|
+
size: "1.25rem",
|
|
42
|
+
weight: 600,
|
|
43
|
+
lineHeight: "1.4"
|
|
44
|
+
},
|
|
45
|
+
body: {
|
|
46
|
+
size: "1rem",
|
|
47
|
+
weight: 400,
|
|
48
|
+
lineHeight: "1.7"
|
|
49
|
+
},
|
|
50
|
+
small: {
|
|
51
|
+
size: "0.875rem",
|
|
52
|
+
weight: 400,
|
|
53
|
+
lineHeight: "1.5"
|
|
54
|
+
}
|
|
55
|
+
} },
|
|
56
|
+
layout: {
|
|
57
|
+
contentWidth: 768,
|
|
58
|
+
sidebarWidth: 240,
|
|
59
|
+
toc: {
|
|
60
|
+
enabled: true,
|
|
61
|
+
depth: 3,
|
|
62
|
+
style: "default"
|
|
63
|
+
},
|
|
64
|
+
header: {
|
|
65
|
+
height: 56,
|
|
66
|
+
sticky: true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
components: {
|
|
70
|
+
Callout: {
|
|
71
|
+
variant: "soft",
|
|
72
|
+
icon: true
|
|
73
|
+
},
|
|
74
|
+
CodeBlock: { showCopyButton: true },
|
|
75
|
+
Tabs: { style: "default" }
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const greentree = createTheme({
|
|
79
|
+
name: "greentree",
|
|
80
|
+
ui: GreenTreeUIDefaults
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
export { GreenTreeUIDefaults, greentree };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DefaultUIDefaults, fumadocs } from "./default/index.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { DocsCommandSearch } from "./docs-command-search.mjs";
|
|
3
|
+
import { createDocsLayout, createDocsMetadata, createPageMetadata } from "./docs-layout.mjs";
|
|
3
4
|
import { DocsPageClient } from "./docs-page-client.mjs";
|
|
4
5
|
import { RootProvider } from "./provider.mjs";
|
|
5
6
|
import { PageActions } from "./page-actions.mjs";
|
|
@@ -8,4 +9,4 @@ import { DocsBody, DocsPage } from "fumadocs-ui/layouts/docs/page";
|
|
|
8
9
|
import { AIConfig, BreadcrumbConfig, CopyMarkdownConfig, DocsConfig, DocsMetadata, DocsNav, DocsTheme, FontStyle, OGConfig, OpenDocsConfig, OpenDocsProvider, PageActionsConfig, PageFrontmatter, SidebarConfig, ThemeToggleConfig, TypographyConfig, UIConfig, createTheme, deepMerge, defineDocs, extendTheme } from "@farming-labs/docs";
|
|
9
10
|
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
|
10
11
|
import { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre } from "fumadocs-ui/components/codeblock";
|
|
11
|
-
export { type AIConfig, type BreadcrumbConfig, CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, type CopyMarkdownConfig, DocsBody, type DocsConfig, DocsLayout, type DocsMetadata, type DocsNav, DocsPage, DocsPageClient, type DocsTheme, type FontStyle, DefaultUIDefaults as FumadocsUIDefaults, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, PageActions, type PageActionsConfig, type PageFrontmatter, Pre, RootProvider, type SidebarConfig, Tab, Tabs, type ThemeToggleConfig, type TypographyConfig, type UIConfig, createDocsLayout, createDocsMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs };
|
|
12
|
+
export { type AIConfig, type BreadcrumbConfig, CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, type CopyMarkdownConfig, DocsBody, DocsCommandSearch, type DocsConfig, DocsLayout, type DocsMetadata, type DocsNav, DocsPage, DocsPageClient, type DocsTheme, type FontStyle, DefaultUIDefaults as FumadocsUIDefaults, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, PageActions, type PageActionsConfig, type PageFrontmatter, Pre, RootProvider, type SidebarConfig, Tab, Tabs, type ThemeToggleConfig, type TypographyConfig, type UIConfig, createDocsLayout, createDocsMetadata, createPageMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DocsCommandSearch } from "./docs-command-search.mjs";
|
|
1
2
|
import { PageActions } from "./page-actions.mjs";
|
|
2
3
|
import { DocsPageClient } from "./docs-page-client.mjs";
|
|
3
|
-
import { createDocsLayout, createDocsMetadata } from "./docs-layout.mjs";
|
|
4
|
+
import { createDocsLayout, createDocsMetadata, createPageMetadata } from "./docs-layout.mjs";
|
|
4
5
|
import { RootProvider } from "./provider.mjs";
|
|
5
6
|
import { DefaultUIDefaults, fumadocs } from "./default/index.mjs";
|
|
6
7
|
import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
|
@@ -9,4 +10,4 @@ import { createTheme, deepMerge, defineDocs, extendTheme } from "@farming-labs/d
|
|
|
9
10
|
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
|
10
11
|
import { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre } from "fumadocs-ui/components/codeblock";
|
|
11
12
|
|
|
12
|
-
export { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, DocsBody, DocsLayout, DocsPage, DocsPageClient, DefaultUIDefaults as FumadocsUIDefaults, PageActions, Pre, RootProvider, Tab, Tabs, createDocsLayout, createDocsMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs };
|
|
13
|
+
export { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, DocsBody, DocsCommandSearch, DocsLayout, DocsPage, DocsPageClient, DefaultUIDefaults as FumadocsUIDefaults, PageActions, Pre, RootProvider, Tab, Tabs, createDocsLayout, createDocsMetadata, createPageMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs };
|
package/dist/page-actions.d.mts
CHANGED
|
@@ -11,11 +11,14 @@ interface PageActionsProps {
|
|
|
11
11
|
copyMarkdown?: boolean;
|
|
12
12
|
openDocs?: boolean;
|
|
13
13
|
providers?: SerializedProvider[];
|
|
14
|
+
/** GitHub file URL (edit view) for the current page. Used when urlTemplate contains {githubUrl}. */
|
|
15
|
+
githubFileUrl?: string | null;
|
|
14
16
|
}
|
|
15
17
|
declare function PageActions({
|
|
16
18
|
copyMarkdown,
|
|
17
19
|
openDocs,
|
|
18
|
-
providers
|
|
20
|
+
providers,
|
|
21
|
+
githubFileUrl
|
|
19
22
|
}: PageActionsProps): react_jsx_runtime0.JSX.Element | null;
|
|
20
23
|
//#endregion
|
|
21
24
|
export { PageActions };
|
package/dist/page-actions.mjs
CHANGED
|
@@ -72,7 +72,7 @@ const DEFAULT_PROVIDERS = [{
|
|
|
72
72
|
name: "Claude",
|
|
73
73
|
urlTemplate: "https://claude.ai/new?q=Read+{mdxUrl},+I+want+to+ask+questions+about+it."
|
|
74
74
|
}];
|
|
75
|
-
function PageActions({ copyMarkdown, openDocs, providers }) {
|
|
75
|
+
function PageActions({ copyMarkdown, openDocs, providers, githubFileUrl }) {
|
|
76
76
|
const [copied, setCopied] = useState(false);
|
|
77
77
|
const [dropdownOpen, setDropdownOpen] = useState(false);
|
|
78
78
|
const dropdownRef = useRef(null);
|
|
@@ -89,12 +89,16 @@ function PageActions({ copyMarkdown, openDocs, providers }) {
|
|
|
89
89
|
} catch {}
|
|
90
90
|
}, []);
|
|
91
91
|
const handleOpen = useCallback((template) => {
|
|
92
|
+
if (/\{githubUrl\}/.test(template) && !githubFileUrl) {
|
|
93
|
+
setDropdownOpen(false);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
92
96
|
const pageUrl = window.location.href;
|
|
93
97
|
const mdxUrl = `${window.location.origin}${pathname}.mdx`;
|
|
94
|
-
|
|
98
|
+
let url = template.replace(/\{url\}/g, encodeURIComponent(pageUrl)).replace(/\{mdxUrl\}/g, encodeURIComponent(mdxUrl)).replace(/\{githubUrl\}/g, githubFileUrl ?? "");
|
|
95
99
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
96
100
|
setDropdownOpen(false);
|
|
97
|
-
}, [pathname]);
|
|
101
|
+
}, [pathname, githubFileUrl]);
|
|
98
102
|
useEffect(() => {
|
|
99
103
|
if (!dropdownOpen) return;
|
|
100
104
|
function handleClick(e) {
|
|
@@ -116,7 +120,7 @@ function PageActions({ copyMarkdown, openDocs, providers }) {
|
|
|
116
120
|
onClick: handleCopyMarkdown,
|
|
117
121
|
className: "fd-page-action-btn",
|
|
118
122
|
"data-copied": copied,
|
|
119
|
-
children: [copied ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(CopyIcon, {}), /* @__PURE__ */ jsx("span", { children: copied ? "Copied!" : "Copy
|
|
123
|
+
children: [copied ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(CopyIcon, {}), /* @__PURE__ */ jsx("span", { children: copied ? "Copied!" : "Copy page" })]
|
|
120
124
|
}), openDocs && resolvedProviders.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
121
125
|
ref: dropdownRef,
|
|
122
126
|
className: "fd-page-action-dropdown",
|
package/dist/search.d.mts
CHANGED
|
@@ -27,7 +27,7 @@ declare function createDocsSearchAPI(options?: {
|
|
|
27
27
|
entry?: string;
|
|
28
28
|
language?: string;
|
|
29
29
|
}): {
|
|
30
|
-
GET
|
|
30
|
+
GET(request: Request): Response | Promise<Response>;
|
|
31
31
|
POST(request: Request): Promise<Response>;
|
|
32
32
|
};
|
|
33
33
|
//#endregion
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as _farming_labs_docs0 from "@farming-labs/docs";
|
|
2
|
+
|
|
3
|
+
//#region src/shiny/index.d.ts
|
|
4
|
+
declare const ShinyUIDefaults: {
|
|
5
|
+
colors: {
|
|
6
|
+
primary: string;
|
|
7
|
+
background: string;
|
|
8
|
+
muted: string;
|
|
9
|
+
border: string;
|
|
10
|
+
};
|
|
11
|
+
typography: {
|
|
12
|
+
font: {
|
|
13
|
+
style: {
|
|
14
|
+
sans: string;
|
|
15
|
+
mono: string;
|
|
16
|
+
};
|
|
17
|
+
h1: {
|
|
18
|
+
size: string;
|
|
19
|
+
weight: number;
|
|
20
|
+
lineHeight: string;
|
|
21
|
+
letterSpacing: string;
|
|
22
|
+
};
|
|
23
|
+
h2: {
|
|
24
|
+
size: string;
|
|
25
|
+
weight: number;
|
|
26
|
+
lineHeight: string;
|
|
27
|
+
letterSpacing: string;
|
|
28
|
+
};
|
|
29
|
+
h3: {
|
|
30
|
+
size: string;
|
|
31
|
+
weight: number;
|
|
32
|
+
lineHeight: string;
|
|
33
|
+
};
|
|
34
|
+
h4: {
|
|
35
|
+
size: string;
|
|
36
|
+
weight: number;
|
|
37
|
+
lineHeight: string;
|
|
38
|
+
};
|
|
39
|
+
body: {
|
|
40
|
+
size: string;
|
|
41
|
+
weight: number;
|
|
42
|
+
lineHeight: string;
|
|
43
|
+
};
|
|
44
|
+
small: {
|
|
45
|
+
size: string;
|
|
46
|
+
weight: number;
|
|
47
|
+
lineHeight: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
layout: {
|
|
52
|
+
contentWidth: number;
|
|
53
|
+
sidebarWidth: number;
|
|
54
|
+
toc: {
|
|
55
|
+
enabled: boolean;
|
|
56
|
+
depth: number;
|
|
57
|
+
style: "default";
|
|
58
|
+
};
|
|
59
|
+
header: {
|
|
60
|
+
height: number;
|
|
61
|
+
sticky: boolean;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
components: {
|
|
65
|
+
Callout: {
|
|
66
|
+
variant: string;
|
|
67
|
+
icon: boolean;
|
|
68
|
+
};
|
|
69
|
+
CodeBlock: {
|
|
70
|
+
showCopyButton: boolean;
|
|
71
|
+
};
|
|
72
|
+
Tabs: {
|
|
73
|
+
style: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
declare const shiny: (overrides?: Partial<_farming_labs_docs0.DocsTheme>) => _farming_labs_docs0.DocsTheme;
|
|
78
|
+
//#endregion
|
|
79
|
+
export { ShinyUIDefaults, shiny };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { createTheme } from "@farming-labs/docs";
|
|
2
|
+
|
|
3
|
+
//#region src/shiny/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* Shiny theme preset — Clerk docs-inspired, clean, polished UI with
|
|
6
|
+
* purple accents and a professional light/dark design.
|
|
7
|
+
*
|
|
8
|
+
* CSS: `@import "@farming-labs/theme/shiny/css";`
|
|
9
|
+
*/
|
|
10
|
+
const ShinyUIDefaults = {
|
|
11
|
+
colors: {
|
|
12
|
+
primary: "hsl(256, 100%, 64%)",
|
|
13
|
+
background: "#f7f7f8",
|
|
14
|
+
muted: "#73738c",
|
|
15
|
+
border: "#e5e5ea"
|
|
16
|
+
},
|
|
17
|
+
typography: { font: {
|
|
18
|
+
style: {
|
|
19
|
+
sans: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
20
|
+
mono: "ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace"
|
|
21
|
+
},
|
|
22
|
+
h1: {
|
|
23
|
+
size: "2rem",
|
|
24
|
+
weight: 600,
|
|
25
|
+
lineHeight: "1.2",
|
|
26
|
+
letterSpacing: "-0.02em"
|
|
27
|
+
},
|
|
28
|
+
h2: {
|
|
29
|
+
size: "1.5rem",
|
|
30
|
+
weight: 600,
|
|
31
|
+
lineHeight: "1.3",
|
|
32
|
+
letterSpacing: "-0.01em"
|
|
33
|
+
},
|
|
34
|
+
h3: {
|
|
35
|
+
size: "1.25rem",
|
|
36
|
+
weight: 600,
|
|
37
|
+
lineHeight: "1.4"
|
|
38
|
+
},
|
|
39
|
+
h4: {
|
|
40
|
+
size: "1.125rem",
|
|
41
|
+
weight: 600,
|
|
42
|
+
lineHeight: "1.4"
|
|
43
|
+
},
|
|
44
|
+
body: {
|
|
45
|
+
size: "0.9375rem",
|
|
46
|
+
weight: 400,
|
|
47
|
+
lineHeight: "1.7"
|
|
48
|
+
},
|
|
49
|
+
small: {
|
|
50
|
+
size: "0.8125rem",
|
|
51
|
+
weight: 400,
|
|
52
|
+
lineHeight: "1.5"
|
|
53
|
+
}
|
|
54
|
+
} },
|
|
55
|
+
layout: {
|
|
56
|
+
contentWidth: 768,
|
|
57
|
+
sidebarWidth: 280,
|
|
58
|
+
toc: {
|
|
59
|
+
enabled: true,
|
|
60
|
+
depth: 3,
|
|
61
|
+
style: "default"
|
|
62
|
+
},
|
|
63
|
+
header: {
|
|
64
|
+
height: 64,
|
|
65
|
+
sticky: true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
components: {
|
|
69
|
+
Callout: {
|
|
70
|
+
variant: "soft",
|
|
71
|
+
icon: true
|
|
72
|
+
},
|
|
73
|
+
CodeBlock: { showCopyButton: true },
|
|
74
|
+
Tabs: { style: "default" }
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const shiny = createTheme({
|
|
78
|
+
name: "shiny",
|
|
79
|
+
ui: ShinyUIDefaults
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
export { ShinyUIDefaults, shiny };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/sidebar-search-ai.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Custom search toggle for sidebar that includes an AI sparkle button.
|
|
6
|
+
* Rendered via fumadocs-ui's `searchToggle.components.lg` prop.
|
|
7
|
+
* Communicates with DocsAIFeatures via custom DOM events.
|
|
8
|
+
*/
|
|
9
|
+
declare function SidebarSearchWithAI(): react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { SidebarSearchWithAI };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/sidebar-search-ai.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Custom search toggle for sidebar that includes an AI sparkle button.
|
|
9
|
+
* Rendered via fumadocs-ui's `searchToggle.components.lg` prop.
|
|
10
|
+
* Communicates with DocsAIFeatures via custom DOM events.
|
|
11
|
+
*/
|
|
12
|
+
function SidebarSearchWithAI() {
|
|
13
|
+
const [mounted, setMounted] = useState(false);
|
|
14
|
+
useEffect(() => setMounted(true), []);
|
|
15
|
+
function openSearch() {
|
|
16
|
+
window.dispatchEvent(new CustomEvent("fd-open-search"));
|
|
17
|
+
}
|
|
18
|
+
function openAI() {
|
|
19
|
+
window.dispatchEvent(new CustomEvent("fd-open-ai"));
|
|
20
|
+
}
|
|
21
|
+
if (!mounted) return /* @__PURE__ */ jsxs("div", {
|
|
22
|
+
className: "fd-sidebar-search-ai-row",
|
|
23
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
24
|
+
type: "button",
|
|
25
|
+
"data-search-full": "",
|
|
26
|
+
className: "fd-sidebar-search-btn",
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("svg", {
|
|
29
|
+
width: "16",
|
|
30
|
+
height: "16",
|
|
31
|
+
viewBox: "0 0 24 24",
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
strokeWidth: "2",
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round",
|
|
37
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
38
|
+
cx: "11",
|
|
39
|
+
cy: "11",
|
|
40
|
+
r: "8"
|
|
41
|
+
}), /* @__PURE__ */ jsx("path", { d: "m21 21-4.3-4.3" })]
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ jsx("span", { children: "Search" }),
|
|
44
|
+
/* @__PURE__ */ jsxs("span", {
|
|
45
|
+
className: "fd-sidebar-search-kbd",
|
|
46
|
+
children: [/* @__PURE__ */ jsx("kbd", { children: "⌘" }), /* @__PURE__ */ jsx("kbd", { children: "K" })]
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
50
|
+
type: "button",
|
|
51
|
+
className: "fd-sidebar-ai-btn",
|
|
52
|
+
"aria-label": "Ask AI",
|
|
53
|
+
title: "Ask AI",
|
|
54
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
55
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
56
|
+
width: "16",
|
|
57
|
+
height: "16",
|
|
58
|
+
viewBox: "0 0 24 24",
|
|
59
|
+
fill: "none",
|
|
60
|
+
stroke: "currentColor",
|
|
61
|
+
strokeWidth: "2",
|
|
62
|
+
strokeLinecap: "round",
|
|
63
|
+
strokeLinejoin: "round",
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsx("path", { d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z" }),
|
|
66
|
+
/* @__PURE__ */ jsx("path", { d: "M20 3v4" }),
|
|
67
|
+
/* @__PURE__ */ jsx("path", { d: "M22 5h-4" })
|
|
68
|
+
]
|
|
69
|
+
})
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
72
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
73
|
+
className: "fd-sidebar-search-ai-row",
|
|
74
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
75
|
+
type: "button",
|
|
76
|
+
onClick: openSearch,
|
|
77
|
+
"data-search-full": "",
|
|
78
|
+
className: "fd-sidebar-search-btn",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsxs("svg", {
|
|
81
|
+
width: "16",
|
|
82
|
+
height: "16",
|
|
83
|
+
viewBox: "0 0 24 24",
|
|
84
|
+
fill: "none",
|
|
85
|
+
stroke: "currentColor",
|
|
86
|
+
strokeWidth: "2",
|
|
87
|
+
strokeLinecap: "round",
|
|
88
|
+
strokeLinejoin: "round",
|
|
89
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
90
|
+
cx: "11",
|
|
91
|
+
cy: "11",
|
|
92
|
+
r: "8"
|
|
93
|
+
}), /* @__PURE__ */ jsx("path", { d: "m21 21-4.3-4.3" })]
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ jsx("span", { children: "Search" }),
|
|
96
|
+
/* @__PURE__ */ jsxs("span", {
|
|
97
|
+
className: "fd-sidebar-search-kbd",
|
|
98
|
+
children: [/* @__PURE__ */ jsx("kbd", { children: "⌘" }), /* @__PURE__ */ jsx("kbd", { children: "K" })]
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
102
|
+
type: "button",
|
|
103
|
+
onClick: openAI,
|
|
104
|
+
className: "fd-sidebar-ai-btn",
|
|
105
|
+
"aria-label": "Ask AI",
|
|
106
|
+
title: "Ask AI",
|
|
107
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
108
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
109
|
+
width: "16",
|
|
110
|
+
height: "16",
|
|
111
|
+
viewBox: "0 0 24 24",
|
|
112
|
+
fill: "none",
|
|
113
|
+
stroke: "currentColor",
|
|
114
|
+
strokeWidth: "2",
|
|
115
|
+
strokeLinecap: "round",
|
|
116
|
+
strokeLinejoin: "round",
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ jsx("path", { d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z" }),
|
|
119
|
+
/* @__PURE__ */ jsx("path", { d: "M20 3v4" }),
|
|
120
|
+
/* @__PURE__ */ jsx("path", { d: "M22 5h-4" })
|
|
121
|
+
]
|
|
122
|
+
})
|
|
123
|
+
})]
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
//#endregion
|
|
128
|
+
export { SidebarSearchWithAI };
|
package/package.json
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/theme",
|
|
3
|
-
"version": "0.0.2
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Theme package for @farming-labs/docs — layout, provider, MDX components, and styles",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"docs",
|
|
7
|
+
"documentation",
|
|
8
|
+
"fumadocs",
|
|
9
|
+
"theme"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "Farming Labs",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"styles"
|
|
16
|
+
],
|
|
5
17
|
"type": "module",
|
|
6
18
|
"main": "./dist/index.mjs",
|
|
7
19
|
"types": "./dist/index.d.mts",
|
|
@@ -31,6 +43,26 @@
|
|
|
31
43
|
"import": "./dist/pixel-border/index.mjs",
|
|
32
44
|
"default": "./dist/pixel-border/index.mjs"
|
|
33
45
|
},
|
|
46
|
+
"./colorful": {
|
|
47
|
+
"types": "./dist/colorful/index.d.mts",
|
|
48
|
+
"import": "./dist/colorful/index.mjs",
|
|
49
|
+
"default": "./dist/colorful/index.mjs"
|
|
50
|
+
},
|
|
51
|
+
"./shiny": {
|
|
52
|
+
"types": "./dist/shiny/index.d.mts",
|
|
53
|
+
"import": "./dist/shiny/index.mjs",
|
|
54
|
+
"default": "./dist/shiny/index.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./darkbold": {
|
|
57
|
+
"types": "./dist/darkbold/index.d.mts",
|
|
58
|
+
"import": "./dist/darkbold/index.mjs",
|
|
59
|
+
"default": "./dist/darkbold/index.mjs"
|
|
60
|
+
},
|
|
61
|
+
"./greentree": {
|
|
62
|
+
"types": "./dist/greentree/index.d.mts",
|
|
63
|
+
"import": "./dist/greentree/index.mjs",
|
|
64
|
+
"default": "./dist/greentree/index.mjs"
|
|
65
|
+
},
|
|
34
66
|
"./search": {
|
|
35
67
|
"types": "./dist/search.d.mts",
|
|
36
68
|
"import": "./dist/search.mjs",
|
|
@@ -46,22 +78,14 @@
|
|
|
46
78
|
"./default/css": "./styles/default.css",
|
|
47
79
|
"./darksharp/css": "./styles/darksharp.css",
|
|
48
80
|
"./pixel-border/css": "./styles/pixel-border.css",
|
|
81
|
+
"./colorful/css": "./styles/colorful.css",
|
|
82
|
+
"./shiny/css": "./styles/shiny.css",
|
|
83
|
+
"./darkbold/css": "./styles/darkbold.css",
|
|
84
|
+
"./greentree/css": "./styles/greentree.css",
|
|
49
85
|
"./presets/neutral": "./styles/presets/neutral.css",
|
|
50
86
|
"./presets/black": "./styles/presets/black.css",
|
|
51
87
|
"./presets/base": "./styles/presets/base.css"
|
|
52
88
|
},
|
|
53
|
-
"files": [
|
|
54
|
-
"dist",
|
|
55
|
-
"styles"
|
|
56
|
-
],
|
|
57
|
-
"keywords": [
|
|
58
|
-
"docs",
|
|
59
|
-
"fumadocs",
|
|
60
|
-
"theme",
|
|
61
|
-
"documentation"
|
|
62
|
-
],
|
|
63
|
-
"author": "Farming Labs",
|
|
64
|
-
"license": "MIT",
|
|
65
89
|
"dependencies": {
|
|
66
90
|
"fumadocs-core": "^16.6.1",
|
|
67
91
|
"fumadocs-ui": "^16.6.1",
|
|
@@ -74,7 +98,7 @@
|
|
|
74
98
|
"next": ">=14.0.0",
|
|
75
99
|
"tsdown": "^0.20.3",
|
|
76
100
|
"typescript": "^5.9.3",
|
|
77
|
-
"@farming-labs/docs": "0.0.2
|
|
101
|
+
"@farming-labs/docs": "0.0.2"
|
|
78
102
|
},
|
|
79
103
|
"peerDependencies": {
|
|
80
104
|
"@farming-labs/docs": ">=0.0.1",
|