onedocs 0.1.24 → 0.1.26

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.
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button } from "./button";
3
3
  export function CTASection({ title, description, cta, children }) {
4
- return (_jsx("section", { children: _jsxs("div", { className: "flex flex-col items-center justify-center text-center py-16 px-6", children: [_jsx("h2", { className: "text-2xl font-semibold text-fd-foreground sm:text-3xl", children: title }), description && (_jsx("p", { className: "mt-2 text-fd-muted-foreground max-w-md", children: description })), _jsx(Button, { href: cta.href, className: "mt-6", children: cta.label }), children] }) }));
4
+ return (_jsx("section", { children: _jsxs("div", { className: "flex flex-col items-center justify-center text-center py-16 px-6 lg:px-16 xl:px-20", children: [_jsx("h2", { className: "text-2xl font-semibold text-fd-foreground sm:text-3xl", children: title }), description && (_jsx("p", { className: "mt-2 text-fd-muted-foreground max-w-md", children: description })), _jsx(Button, { href: cta.href, className: "mt-6", children: cta.label }), children] }) }));
5
5
  }
package/dist/config.d.ts CHANGED
@@ -31,6 +31,15 @@ export interface I18nConfig {
31
31
  defaultLanguage: string;
32
32
  languages: string[];
33
33
  }
34
+ export interface SocialLink {
35
+ icon: ReactNode;
36
+ href: string;
37
+ label: string;
38
+ }
39
+ export interface FooterConfig {
40
+ links?: NavLink[];
41
+ socials?: SocialLink[];
42
+ }
34
43
  export interface OnedocsConfig {
35
44
  title: string;
36
45
  description?: string;
@@ -43,6 +52,7 @@ export interface OnedocsConfig {
43
52
  links?: NavLink[];
44
53
  github?: string;
45
54
  };
55
+ footer?: FooterConfig;
46
56
  homepage?: HomepageConfig;
47
57
  docs?: {
48
58
  dir?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM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AW,UAAU;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE;QACJ,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,IAAI,CAAC,EAAE;QACL,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,CAMjE"}
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { DocsPage, DocsBody } from "./layouts/docs-page";
3
3
  export { HomeLayout, HomePage } from "./layouts/home";
4
4
  export { createBaseOptions } from "./layouts/shared";
5
5
  export { defineConfig } from "./config";
6
- export type { OnedocsConfig } from "./config";
6
+ export type { OnedocsConfig, SocialLink, FooterConfig } from "./config";
7
7
  export { createSource, loader } from "./source";
8
8
  export { InstallBlock } from "./components/install-block";
9
9
  export { CodeBlock } from "./components/code-block";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/layouts/home.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAK/C,UAAU,eAAe;IACvB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAI/D;AAED,UAAU,aAAa;IACrB,MAAM,EAAE,aAAa,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,aAAa,2CAiGxE"}
1
+ {"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/layouts/home.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAK/C,UAAU,eAAe;IACvB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAI/D;AAED,UAAU,aAAa;IACrB,MAAM,EAAE,aAAa,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,aAAa,2CAkIxE"}
@@ -14,5 +14,5 @@ export function HomePage({ config, packageName, children }) {
14
14
  const renderedHeroLeft = typeof heroLeft === 'function'
15
15
  ? heroLeft({})
16
16
  : heroLeft;
17
- return (_jsx(HomeLayout, { config: config, children: _jsxs("main", { className: "flex-1 flex flex-col min-h-[calc(100vh-var(--fd-nav-height))]", children: [_jsxs("div", { className: "flex-1 flex flex-col relative mx-auto w-full max-w-(--fd-layout-width)", children: [_jsx("div", { className: "absolute inset-0 border-x pointer-events-none" }), _jsxs("div", { className: "relative", children: [_jsx("section", { id: "hero", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-4", children: [_jsx("div", { className: "lg:col-span-2 px-6 py-8 lg:p-12", children: renderedHeroLeft ? (renderedHeroLeft) : (_jsxs(_Fragment, { children: [_jsx("h1", { className: "text-left text-4xl font-medium leading-tight text-fd-foreground sm:text-5xl", children: homepage?.hero?.title ?? config.title }), _jsx("p", { className: "text-left max-w-xl leading-normal text-fd-muted-foreground sm:text-lg sm:leading-normal text-balance mt-4", children: homepage?.hero?.description ?? config.description }), _jsxs("div", { className: "flex flex-wrap items-end gap-x-8 gap-y-6 mt-4 w-full", children: [packageName && (_jsx("div", { className: "flex-1", children: _jsx(InstallBlock, { packageName: packageName }) })), _jsx(Button, { href: homepage?.hero?.cta?.href ?? "/docs", children: homepage?.hero?.cta?.label ?? "Get Started" })] })] })) }), _jsx("div", { className: "lg:col-span-2 hidden lg:block", children: heroRight ? (_jsx("div", { className: "flex h-full items-center px-6 py-8 lg:p-12", children: heroRight })) : null })] }) }), homepage?.features && homepage.features.length > 0 && (_jsx("section", { id: "features", children: _jsx("div", { className: "border-y", children: _jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 [&>*]:border-b [&>*:nth-last-child(-n+1)]:border-b-0 sm:[&>*:nth-last-child(-n+2)]:border-b-0 lg:[&>*:nth-last-child(-n+4)]:border-b-0", children: homepage.features.map((feature) => (_jsxs("div", { className: "flex flex-col gap-y-2 items-start justify-start py-8 px-6 transition-colors hover:bg-fd-secondary/20 sm:border-r sm:[&:nth-child(2n)]:border-r-0 lg:[&:nth-child(2n)]:border-r lg:[&:nth-child(4n)]:border-r-0", children: [feature.icon && (_jsx("div", { className: "bg-fd-primary/10 p-2 rounded-lg mb-2", children: feature.icon })), _jsx("h3", { className: "text-base font-medium text-fd-card-foreground", children: feature.title }), _jsx("p", { className: "text-sm text-fd-muted-foreground", children: feature.description })] }, feature.title))) }) }) }))] }), children && (_jsx("div", { className: "flex-1 flex items-center justify-center", children: children }))] }), _jsx("footer", { className: "relative mx-auto w-full max-w-(--fd-layout-width)", children: _jsx("div", { className: "border-x border-t px-6 py-4", children: _jsxs("p", { className: "text-sm text-fd-muted-foreground", children: ["\u00A9 ", currentYear, " ", config.title] }) }) })] }) }));
17
+ return (_jsx(HomeLayout, { config: config, children: _jsxs("main", { className: "flex-1 flex flex-col min-h-[calc(100vh-var(--fd-nav-height))]", children: [_jsxs("div", { className: "flex-1 flex flex-col relative mx-auto w-full max-w-(--fd-layout-width)", children: [_jsx("div", { className: "absolute inset-0 border-x pointer-events-none" }), _jsxs("div", { className: "relative", children: [_jsx("section", { id: "hero", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-4", children: [_jsx("div", { className: "lg:col-span-2 px-6 py-8 lg:px-16 lg:py-12 xl:px-20 xl:py-16", children: renderedHeroLeft ? (renderedHeroLeft) : (_jsxs(_Fragment, { children: [_jsx("h1", { className: "text-left text-4xl font-medium leading-tight text-fd-foreground sm:text-5xl", children: homepage?.hero?.title ?? config.title }), _jsx("p", { className: "text-left max-w-xl leading-normal text-fd-muted-foreground sm:text-lg sm:leading-normal text-balance mt-4", children: homepage?.hero?.description ?? config.description }), _jsxs("div", { className: "flex flex-wrap items-end gap-x-8 gap-y-6 mt-4 w-full", children: [packageName && (_jsx("div", { className: "flex-1", children: _jsx(InstallBlock, { packageName: packageName }) })), _jsx(Button, { href: homepage?.hero?.cta?.href ?? "/docs", children: homepage?.hero?.cta?.label ?? "Get Started" })] })] })) }), _jsx("div", { className: "lg:col-span-2 hidden lg:block", children: heroRight ? (_jsx("div", { className: "flex h-full items-center px-6 py-8 lg:px-16 lg:py-12 xl:px-20 xl:py-16", children: heroRight })) : null })] }) }), homepage?.features && homepage.features.length > 0 && (_jsx("section", { id: "features", children: _jsx("div", { className: "border-y", children: _jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 [&>*]:border-b [&>*:nth-last-child(-n+1)]:border-b-0 sm:[&>*:nth-last-child(-n+2)]:border-b-0 lg:[&>*:nth-last-child(-n+4)]:border-b-0", children: homepage.features.map((feature) => (_jsxs("div", { className: "flex flex-col gap-y-2 items-start justify-start p-8 transition-colors hover:bg-fd-secondary/20 sm:border-r sm:[&:nth-child(2n)]:border-r-0 lg:[&:nth-child(2n)]:border-r lg:[&:nth-child(4n)]:border-r-0", children: [feature.icon && (_jsx("div", { className: "bg-fd-primary/10 p-2 rounded-lg mb-2", children: feature.icon })), _jsx("h3", { className: "text-base font-medium text-fd-card-foreground", children: feature.title }), _jsx("p", { className: "text-sm text-fd-muted-foreground", children: feature.description })] }, feature.title))) }) }) }))] }), children && (_jsx("div", { className: "flex-1 flex items-center justify-center", children: children }))] }), _jsx("footer", { className: "relative mx-auto w-full max-w-(--fd-layout-width)", children: _jsxs("div", { className: "border-x border-t px-6 py-4 flex items-center justify-between gap-4", children: [_jsxs("p", { className: "text-sm text-fd-muted-foreground", children: ["\u00A9 ", currentYear, " ", config.title] }), _jsxs("div", { className: "flex items-center gap-4", children: [config.footer?.links && config.footer.links.length > 0 && (_jsx("div", { className: "flex items-center gap-4", children: config.footer.links.map((link) => (_jsx("a", { href: link.href, target: "_blank", rel: "noopener noreferrer", className: "text-sm text-fd-muted-foreground transition-colors hover:text-fd-foreground", children: link.label }, link.label))) })), config.footer?.socials && config.footer.socials.length > 0 && (_jsx("div", { className: "flex items-center gap-3", children: config.footer.socials.map((social) => (_jsx("a", { href: social.href, target: "_blank", rel: "noopener noreferrer", "aria-label": social.label, className: "text-fd-muted-foreground transition-colors hover:text-fd-foreground [&_svg]:size-4", children: social.icon }, social.label))) }))] })] }) })] }) }));
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onedocs",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "type": "module",
5
5
  "description": "Zero-config documentation for Next.js + Fumadocs. Install one dependency, write markdown, ship docs.",
6
6
  "license": "MIT",
@@ -75,7 +75,8 @@
75
75
  "clean": "rm -rf dist",
76
76
  "build": "bun run clean && tsc -p tsconfig.json",
77
77
  "dev": "tsc -w -p tsconfig.json",
78
- "prepack": "bun run build"
78
+ "prepack": "bun run build",
79
+ "test": "vitest run"
79
80
  },
80
81
  "peerDependencies": {
81
82
  "fumadocs-core": "^16.4.7",
@@ -95,6 +96,7 @@
95
96
  "fumadocs-ui": "^16.4.7",
96
97
  "lucide-react": "^0.562.0",
97
98
  "next": "^16.1.4",
98
- "typescript": "^5.9.3"
99
+ "typescript": "^5.9.3",
100
+ "vitest": "^3.1.4"
99
101
  }
100
102
  }