@farming-labs/theme 0.2.87 → 0.2.89
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 +1 -1
- package/dist/docs-layout.mjs +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/shadcn/index.d.mts +102 -0
- package/dist/shadcn/index.mjs +105 -0
- package/dist/tanstack-layout.mjs +2 -2
- package/package.json +8 -2
- package/styles/shadcn.css +3 -0
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ import { hardline } from "@farming-labs/theme/hardline";
|
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
Available preset subpaths include `default`, `darksharp`, `pixel-border`, `colorful`, `shiny`,
|
|
68
|
-
`darkbold`, `greentree`, `hardline`, `concrete`, `command-grid`, `ledger`, and `threadline`.
|
|
68
|
+
`darkbold`, `greentree`, `hardline`, `concrete`, `command-grid`, `ledger`, `shadcn`, and `threadline`.
|
|
69
69
|
|
|
70
70
|
## Main entrypoints
|
|
71
71
|
|
package/dist/docs-layout.mjs
CHANGED
|
@@ -712,7 +712,7 @@ function createDocsLayout(config, options) {
|
|
|
712
712
|
return function DocsLayoutWrapper({ children }) {
|
|
713
713
|
const tree = applySidebarFolderIndexBehavior(buildTree(config, localeContext, !!sidebarFlat), {
|
|
714
714
|
sidebar: config.sidebar,
|
|
715
|
-
defaultBehavior: "link"
|
|
715
|
+
defaultBehavior: config.theme?.name === "shadcn" ? "hidden" : "link"
|
|
716
716
|
});
|
|
717
717
|
const localizedTree = i18n ? localizeTreeUrls(tree, activeLocale) : tree;
|
|
718
718
|
const finalSidebarProps = { ...sidebarProps };
|
package/dist/index.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ import { DocsPageClient } from "./docs-page-client.mjs";
|
|
|
8
8
|
import { HardlineUIDefaults, hardline } from "./hardline/index.mjs";
|
|
9
9
|
import { RootProvider } from "./provider.mjs";
|
|
10
10
|
import { LedgerUIDefaults, ledger } from "./ledger/index.mjs";
|
|
11
|
+
import { ShadcnUIDefaults, shadcn } from "./shadcn/index.mjs";
|
|
11
12
|
import { ThreadlineUIDefaults, threadline, threadlinePageActions } from "./threadline/index.mjs";
|
|
12
13
|
import { DocsFeedback, DocsFeedbackProps } from "./docs-feedback.mjs";
|
|
13
14
|
import { PageActions } from "./page-actions.mjs";
|
|
@@ -20,4 +21,4 @@ import { AIConfig, BreadcrumbConfig, ChangelogConfig, ChangelogFrontmatter, Copy
|
|
|
20
21
|
import { DocsBody, DocsPage } from "fumadocs-ui/layouts/docs/page";
|
|
21
22
|
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
|
22
23
|
import { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre } from "fumadocs-ui/components/codeblock";
|
|
23
|
-
export { type AIConfig, Agent, type AgentProps, Audience, type AudienceProps, type BreadcrumbConfig, type ChangelogConfig, type ChangelogFrontmatter, CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CodeGroup, type CodeGroupProps, CommandGridUIDefaults, ConcreteUIDefaults, type CopyMarkdownConfig, type CopyMarkdownFormat, DocsBody, DocsClientHooks, DocsCommandSearch, type DocsConfig, type DocsContentAudience, DocsFeedback, type DocsFeedbackData, type DocsFeedbackProps, type DocsFeedbackValue, DocsLayout, type DocsMetadata, type DocsNav, DocsPage, DocsPageClient, type DocsTheme, type FeedbackConfig, type FontStyle, DefaultUIDefaults as FumadocsUIDefaults, HardlineUIDefaults, HoverLink, type HoverLinkProps, Human, type HumanProps, LedgerUIDefaults, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, PageActions, type PageActionsConfig, type PageAgentAppliesTo, type PageAgentCommand, type PageAgentFailureMode, type PageAgentFrontmatter, type PageAgentVerification, type PageFrontmatter, Pre, Prompt, type PromptProps, RootProvider, type SidebarConfig, Tab, Tabs, type ThemeToggleConfig, ThreadlineUIDefaults, type TypographyConfig, type UIConfig, commandGrid, concrete, createDocsLayout, createDocsMetadata, createPageMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs, hardline, ledger, threadline, threadlinePageActions, withLangInUrl };
|
|
24
|
+
export { type AIConfig, Agent, type AgentProps, Audience, type AudienceProps, type BreadcrumbConfig, type ChangelogConfig, type ChangelogFrontmatter, CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CodeGroup, type CodeGroupProps, CommandGridUIDefaults, ConcreteUIDefaults, type CopyMarkdownConfig, type CopyMarkdownFormat, DocsBody, DocsClientHooks, DocsCommandSearch, type DocsConfig, type DocsContentAudience, DocsFeedback, type DocsFeedbackData, type DocsFeedbackProps, type DocsFeedbackValue, DocsLayout, type DocsMetadata, type DocsNav, DocsPage, DocsPageClient, type DocsTheme, type FeedbackConfig, type FontStyle, DefaultUIDefaults as FumadocsUIDefaults, HardlineUIDefaults, HoverLink, type HoverLinkProps, Human, type HumanProps, LedgerUIDefaults, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, PageActions, type PageActionsConfig, type PageAgentAppliesTo, type PageAgentCommand, type PageAgentFailureMode, type PageAgentFrontmatter, type PageAgentVerification, type PageFrontmatter, Pre, Prompt, type PromptProps, RootProvider, ShadcnUIDefaults, type SidebarConfig, Tab, Tabs, type ThemeToggleConfig, ThreadlineUIDefaults, type TypographyConfig, type UIConfig, commandGrid, concrete, createDocsLayout, createDocsMetadata, createPageMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs, hardline, ledger, shadcn, threadline, threadlinePageActions, withLangInUrl };
|
package/dist/index.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { CommandGridUIDefaults, commandGrid } from "./command-grid/index.mjs";
|
|
|
10
10
|
import { ConcreteUIDefaults, concrete } from "./concrete/index.mjs";
|
|
11
11
|
import { HardlineUIDefaults, hardline } from "./hardline/index.mjs";
|
|
12
12
|
import { LedgerUIDefaults, ledger } from "./ledger/index.mjs";
|
|
13
|
+
import { ShadcnUIDefaults, shadcn } from "./shadcn/index.mjs";
|
|
13
14
|
import { ThreadlineUIDefaults, threadline, threadlinePageActions } from "./threadline/index.mjs";
|
|
14
15
|
import { DocsClientHooks } from "./docs-client-hooks.mjs";
|
|
15
16
|
import { HoverLink } from "./hover-link.mjs";
|
|
@@ -21,4 +22,4 @@ import { DocsBody, DocsPage } from "fumadocs-ui/layouts/docs/page";
|
|
|
21
22
|
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
|
22
23
|
import { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre } from "fumadocs-ui/components/codeblock";
|
|
23
24
|
|
|
24
|
-
export { Agent, Audience, CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CodeGroup, CommandGridUIDefaults, ConcreteUIDefaults, DocsBody, DocsClientHooks, DocsCommandSearch, DocsFeedback, DocsLayout, DocsPage, DocsPageClient, DefaultUIDefaults as FumadocsUIDefaults, HardlineUIDefaults, HoverLink, Human, LedgerUIDefaults, PageActions, Pre, Prompt, RootProvider, Tab, Tabs, ThreadlineUIDefaults, commandGrid, concrete, createDocsLayout, createDocsMetadata, createPageMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs, hardline, ledger, threadline, threadlinePageActions, withLangInUrl };
|
|
25
|
+
export { Agent, Audience, CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CodeGroup, CommandGridUIDefaults, ConcreteUIDefaults, DocsBody, DocsClientHooks, DocsCommandSearch, DocsFeedback, DocsLayout, DocsPage, DocsPageClient, DefaultUIDefaults as FumadocsUIDefaults, HardlineUIDefaults, HoverLink, Human, LedgerUIDefaults, PageActions, Pre, Prompt, RootProvider, ShadcnUIDefaults, Tab, Tabs, ThreadlineUIDefaults, commandGrid, concrete, createDocsLayout, createDocsMetadata, createPageMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs, hardline, ledger, shadcn, threadline, threadlinePageActions, withLangInUrl };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as _farming_labs_docs0 from "@farming-labs/docs";
|
|
2
|
+
|
|
3
|
+
//#region src/shadcn/index.d.ts
|
|
4
|
+
declare const ShadcnUIDefaults: {
|
|
5
|
+
colors: {
|
|
6
|
+
primary: string;
|
|
7
|
+
primaryForeground: string;
|
|
8
|
+
background: string;
|
|
9
|
+
foreground: string;
|
|
10
|
+
muted: string;
|
|
11
|
+
mutedForeground: string;
|
|
12
|
+
border: string;
|
|
13
|
+
card: string;
|
|
14
|
+
cardForeground: string;
|
|
15
|
+
accent: string;
|
|
16
|
+
accentForeground: string;
|
|
17
|
+
secondary: string;
|
|
18
|
+
secondaryForeground: string;
|
|
19
|
+
popover: string;
|
|
20
|
+
popoverForeground: string;
|
|
21
|
+
ring: string;
|
|
22
|
+
};
|
|
23
|
+
typography: {
|
|
24
|
+
font: {
|
|
25
|
+
style: {
|
|
26
|
+
sans: string;
|
|
27
|
+
mono: string;
|
|
28
|
+
};
|
|
29
|
+
h1: {
|
|
30
|
+
size: string;
|
|
31
|
+
weight: number;
|
|
32
|
+
lineHeight: string;
|
|
33
|
+
letterSpacing: string;
|
|
34
|
+
};
|
|
35
|
+
h2: {
|
|
36
|
+
size: string;
|
|
37
|
+
weight: number;
|
|
38
|
+
lineHeight: string;
|
|
39
|
+
letterSpacing: string;
|
|
40
|
+
};
|
|
41
|
+
h3: {
|
|
42
|
+
size: string;
|
|
43
|
+
weight: number;
|
|
44
|
+
lineHeight: string;
|
|
45
|
+
letterSpacing: string;
|
|
46
|
+
};
|
|
47
|
+
h4: {
|
|
48
|
+
size: string;
|
|
49
|
+
weight: number;
|
|
50
|
+
lineHeight: string;
|
|
51
|
+
letterSpacing: string;
|
|
52
|
+
};
|
|
53
|
+
body: {
|
|
54
|
+
size: string;
|
|
55
|
+
weight: number;
|
|
56
|
+
lineHeight: string;
|
|
57
|
+
};
|
|
58
|
+
small: {
|
|
59
|
+
size: string;
|
|
60
|
+
weight: number;
|
|
61
|
+
lineHeight: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
radius: string;
|
|
66
|
+
layout: {
|
|
67
|
+
contentWidth: number;
|
|
68
|
+
sidebarWidth: number;
|
|
69
|
+
tocWidth: number;
|
|
70
|
+
toc: {
|
|
71
|
+
enabled: boolean;
|
|
72
|
+
depth: number;
|
|
73
|
+
style: "default";
|
|
74
|
+
};
|
|
75
|
+
header: {
|
|
76
|
+
height: number;
|
|
77
|
+
sticky: boolean;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
sidebar: {
|
|
81
|
+
style: "default";
|
|
82
|
+
};
|
|
83
|
+
components: {
|
|
84
|
+
Callout: {
|
|
85
|
+
variant: string;
|
|
86
|
+
icon: boolean;
|
|
87
|
+
};
|
|
88
|
+
CodeBlock: {
|
|
89
|
+
showCopyButton: boolean;
|
|
90
|
+
};
|
|
91
|
+
HoverLink: {
|
|
92
|
+
linkLabel: string;
|
|
93
|
+
showIndicator: boolean;
|
|
94
|
+
};
|
|
95
|
+
Tabs: {
|
|
96
|
+
style: "underline";
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
declare const shadcn: (overrides?: Partial<_farming_labs_docs0.DocsTheme>) => _farming_labs_docs0.DocsTheme;
|
|
101
|
+
//#endregion
|
|
102
|
+
export { ShadcnUIDefaults, shadcn };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { createTheme } from "@farming-labs/docs";
|
|
2
|
+
|
|
3
|
+
//#region src/shadcn/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* Unofficial shadcn/ui docs-inspired theme preset.
|
|
6
|
+
* Recreates the compact neutral documentation shell without shadcn branding
|
|
7
|
+
* or content.
|
|
8
|
+
*
|
|
9
|
+
* CSS: `@import "@farming-labs/theme/shadcn/css";`
|
|
10
|
+
*/
|
|
11
|
+
const ShadcnUIDefaults = {
|
|
12
|
+
colors: {
|
|
13
|
+
primary: "oklch(0 0 0)",
|
|
14
|
+
primaryForeground: "oklch(0.985 0 0)",
|
|
15
|
+
background: "oklch(1 0 0)",
|
|
16
|
+
foreground: "oklch(0 0 0)",
|
|
17
|
+
muted: "oklch(0.97 0 0)",
|
|
18
|
+
mutedForeground: "oklch(0.556 0 0)",
|
|
19
|
+
border: "oklch(0.922 0 0)",
|
|
20
|
+
card: "oklch(1 0 0)",
|
|
21
|
+
cardForeground: "oklch(0 0 0)",
|
|
22
|
+
accent: "oklch(0.97 0 0)",
|
|
23
|
+
accentForeground: "oklch(0.205 0 0)",
|
|
24
|
+
secondary: "oklch(0.97 0 0)",
|
|
25
|
+
secondaryForeground: "oklch(0.205 0 0)",
|
|
26
|
+
popover: "oklch(1 0 0)",
|
|
27
|
+
popoverForeground: "oklch(0 0 0)",
|
|
28
|
+
ring: "oklch(0.708 0 0)"
|
|
29
|
+
},
|
|
30
|
+
typography: { font: {
|
|
31
|
+
style: {
|
|
32
|
+
sans: "'Geist', 'Geist Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
33
|
+
mono: "'Geist Mono', 'Geist Mono Fallback', ui-monospace, SFMono-Regular, Menlo, monospace"
|
|
34
|
+
},
|
|
35
|
+
h1: {
|
|
36
|
+
size: "1.875rem",
|
|
37
|
+
weight: 600,
|
|
38
|
+
lineHeight: "1.2",
|
|
39
|
+
letterSpacing: "-0.025em"
|
|
40
|
+
},
|
|
41
|
+
h2: {
|
|
42
|
+
size: "1.25rem",
|
|
43
|
+
weight: 600,
|
|
44
|
+
lineHeight: "1.4",
|
|
45
|
+
letterSpacing: "-0.015em"
|
|
46
|
+
},
|
|
47
|
+
h3: {
|
|
48
|
+
size: "1.125rem",
|
|
49
|
+
weight: 600,
|
|
50
|
+
lineHeight: "1.45",
|
|
51
|
+
letterSpacing: "-0.01em"
|
|
52
|
+
},
|
|
53
|
+
h4: {
|
|
54
|
+
size: "1rem",
|
|
55
|
+
weight: 600,
|
|
56
|
+
lineHeight: "1.5",
|
|
57
|
+
letterSpacing: "0"
|
|
58
|
+
},
|
|
59
|
+
body: {
|
|
60
|
+
size: "0.9375rem",
|
|
61
|
+
weight: 400,
|
|
62
|
+
lineHeight: "1.75"
|
|
63
|
+
},
|
|
64
|
+
small: {
|
|
65
|
+
size: "0.8rem",
|
|
66
|
+
weight: 500,
|
|
67
|
+
lineHeight: "1.5"
|
|
68
|
+
}
|
|
69
|
+
} },
|
|
70
|
+
radius: "0.625rem",
|
|
71
|
+
layout: {
|
|
72
|
+
contentWidth: 640,
|
|
73
|
+
sidebarWidth: 288,
|
|
74
|
+
tocWidth: 256,
|
|
75
|
+
toc: {
|
|
76
|
+
enabled: true,
|
|
77
|
+
depth: 4,
|
|
78
|
+
style: "default"
|
|
79
|
+
},
|
|
80
|
+
header: {
|
|
81
|
+
height: 56,
|
|
82
|
+
sticky: true
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
sidebar: { style: "default" },
|
|
86
|
+
components: {
|
|
87
|
+
Callout: {
|
|
88
|
+
variant: "soft",
|
|
89
|
+
icon: true
|
|
90
|
+
},
|
|
91
|
+
CodeBlock: { showCopyButton: true },
|
|
92
|
+
HoverLink: {
|
|
93
|
+
linkLabel: "Open page",
|
|
94
|
+
showIndicator: false
|
|
95
|
+
},
|
|
96
|
+
Tabs: { style: "underline" }
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const shadcn = createTheme({
|
|
100
|
+
name: "shadcn",
|
|
101
|
+
ui: ShadcnUIDefaults
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
//#endregion
|
|
105
|
+
export { ShadcnUIDefaults, shadcn };
|
package/dist/tanstack-layout.mjs
CHANGED
|
@@ -282,10 +282,10 @@ function TanstackDocsLayout({ config, tree, locale, description, readingTime, la
|
|
|
282
282
|
const i18n = config.i18n;
|
|
283
283
|
const resolvedTree = resolveTreeIcons(locale ? localizeTreeUrls(applySidebarFolderIndexBehavior(tree, {
|
|
284
284
|
sidebar: config.sidebar,
|
|
285
|
-
defaultBehavior: "link"
|
|
285
|
+
defaultBehavior: config.theme?.name === "shadcn" ? "hidden" : "link"
|
|
286
286
|
}), locale) : applySidebarFolderIndexBehavior(tree, {
|
|
287
287
|
sidebar: config.sidebar,
|
|
288
|
-
defaultBehavior: "link"
|
|
288
|
+
defaultBehavior: config.theme?.name === "shadcn" ? "hidden" : "link"
|
|
289
289
|
}), config.icons);
|
|
290
290
|
const finalSidebarProps = { ...sidebarProps };
|
|
291
291
|
const sidebarFooter = sidebarProps.footer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/theme",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.89",
|
|
4
4
|
"description": "Theme package for @farming-labs/docs — layout, provider, MDX components, and styles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -88,6 +88,11 @@
|
|
|
88
88
|
"import": "./dist/ledger/index.mjs",
|
|
89
89
|
"default": "./dist/ledger/index.mjs"
|
|
90
90
|
},
|
|
91
|
+
"./shadcn": {
|
|
92
|
+
"types": "./dist/shadcn/index.d.mts",
|
|
93
|
+
"import": "./dist/shadcn/index.mjs",
|
|
94
|
+
"default": "./dist/shadcn/index.mjs"
|
|
95
|
+
},
|
|
91
96
|
"./threadline": {
|
|
92
97
|
"types": "./dist/threadline/index.d.mts",
|
|
93
98
|
"import": "./dist/threadline/index.mjs",
|
|
@@ -126,6 +131,7 @@
|
|
|
126
131
|
"./concrete/css": "./styles/concrete.css",
|
|
127
132
|
"./command-grid/css": "./styles/command-grid.css",
|
|
128
133
|
"./ledger/css": "./styles/ledger.css",
|
|
134
|
+
"./shadcn/css": "./styles/shadcn.css",
|
|
129
135
|
"./threadline/css": "./styles/threadline.css",
|
|
130
136
|
"./presets/neutral": "./styles/presets/neutral.css",
|
|
131
137
|
"./presets/black": "./styles/presets/black.css",
|
|
@@ -148,7 +154,7 @@
|
|
|
148
154
|
"tsdown": "^0.20.3",
|
|
149
155
|
"typescript": "^5.9.3",
|
|
150
156
|
"vitest": "^4.1.8",
|
|
151
|
-
"@farming-labs/docs": "0.2.
|
|
157
|
+
"@farming-labs/docs": "0.2.89"
|
|
152
158
|
},
|
|
153
159
|
"peerDependencies": {
|
|
154
160
|
"@farming-labs/docs": ">=0.0.1",
|