@usecross/docs 0.1.0
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/index.d.ts +178 -0
- package/dist/index.js +616 -0
- package/dist/index.js.map +1 -0
- package/dist/ssr.d.ts +21 -0
- package/dist/ssr.js +27 -0
- package/dist/ssr.js.map +1 -0
- package/dist/types-Vodb50Bj.d.ts +91 -0
- package/package.json +71 -0
- package/src/app.tsx +46 -0
- package/src/components/CodeBlock.tsx +87 -0
- package/src/components/DocsLayout.tsx +178 -0
- package/src/components/DocsPage.tsx +19 -0
- package/src/components/HomePage.tsx +434 -0
- package/src/components/Markdown.tsx +93 -0
- package/src/components/Sidebar.tsx +37 -0
- package/src/components/index.ts +6 -0
- package/src/index.ts +49 -0
- package/src/lib/shiki.ts +59 -0
- package/src/lib/utils.ts +9 -0
- package/src/ssr.tsx +39 -0
- package/src/styles.css +128 -0
- package/src/tailwind.preset.cjs +118 -0
- package/src/types.ts +91 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { C as CodeBlockProps, D as DocsLayoutProps, a as DocContent, M as MarkdownProps, S as SidebarProps, b as DocsAppConfig } from './types-Vodb50Bj.js';
|
|
3
|
+
export { N as NavItem, c as NavSection, d as SharedProps } from './types-Vodb50Bj.js';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { ClassValue } from 'clsx';
|
|
6
|
+
import { HighlighterCore } from 'shiki/core';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Syntax-highlighted code block component using Shiki.
|
|
10
|
+
*/
|
|
11
|
+
declare function CodeBlock({ code, language, filename, showLineNumbers, theme, className, }: CodeBlockProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Simple inline code component.
|
|
14
|
+
*/
|
|
15
|
+
declare function InlineCode({ children }: {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Full-featured documentation layout with sidebar, mobile menu, and header.
|
|
21
|
+
*/
|
|
22
|
+
declare function DocsLayout({ children, title, description: _description, logo, logoInverted, logoUrl: propLogoUrl, logoInvertedUrl: propLogoInvertedUrl, githubUrl: propGithubUrl, navLinks: propNavLinks, footer, }: DocsLayoutProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
interface DocsPageProps extends Omit<DocsLayoutProps, 'children' | 'title'> {
|
|
25
|
+
content: DocContent;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Default documentation page component.
|
|
29
|
+
* Renders markdown content within the DocsLayout.
|
|
30
|
+
*/
|
|
31
|
+
declare function DocsPage({ content, ...layoutProps }: DocsPageProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
|
|
33
|
+
interface HomeFeature {
|
|
34
|
+
title: string;
|
|
35
|
+
description: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
interface HomePageContextValue {
|
|
38
|
+
title: string;
|
|
39
|
+
tagline: string;
|
|
40
|
+
description: string;
|
|
41
|
+
installCommand: string;
|
|
42
|
+
ctaText: string;
|
|
43
|
+
ctaHref: string;
|
|
44
|
+
features: HomeFeature[];
|
|
45
|
+
logoUrl?: string;
|
|
46
|
+
heroLogoUrl?: string;
|
|
47
|
+
footerLogoUrl?: string;
|
|
48
|
+
githubUrl?: string;
|
|
49
|
+
navLinks: Array<{
|
|
50
|
+
label: string;
|
|
51
|
+
href: string;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
interface HomePageProps extends Omit<HomePageContextValue, 'navLinks'> {
|
|
55
|
+
navLinks?: Array<{
|
|
56
|
+
label: string;
|
|
57
|
+
href: string;
|
|
58
|
+
}>;
|
|
59
|
+
children?: ReactNode;
|
|
60
|
+
}
|
|
61
|
+
interface HomeHeaderProps {
|
|
62
|
+
renderLogo?: () => ReactNode;
|
|
63
|
+
}
|
|
64
|
+
interface HomeFeaturesProps {
|
|
65
|
+
renderFeature?: (feature: HomeFeature, index: number, DefaultFeature: typeof HomeFeatureItem) => ReactNode;
|
|
66
|
+
}
|
|
67
|
+
interface HomeFeatureItemProps {
|
|
68
|
+
feature: HomeFeature;
|
|
69
|
+
index: number;
|
|
70
|
+
totalFeatures: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Navigation header for the homepage.
|
|
74
|
+
* Accepts an optional renderLogo prop for custom logo rendering.
|
|
75
|
+
*/
|
|
76
|
+
declare function HomeHeader({ renderLogo }?: HomeHeaderProps): react_jsx_runtime.JSX.Element;
|
|
77
|
+
/**
|
|
78
|
+
* Hero section with title, tagline, description, and CTA.
|
|
79
|
+
* If heroLogoUrl is provided, displays an image instead of text title.
|
|
80
|
+
*/
|
|
81
|
+
declare function HomeHero(): react_jsx_runtime.JSX.Element;
|
|
82
|
+
/**
|
|
83
|
+
* Single feature item within the features grid.
|
|
84
|
+
*/
|
|
85
|
+
declare function HomeFeatureItem({ feature, index, totalFeatures }: HomeFeatureItemProps): react_jsx_runtime.JSX.Element;
|
|
86
|
+
/**
|
|
87
|
+
* Features section with customizable feature rendering.
|
|
88
|
+
*/
|
|
89
|
+
declare function HomeFeatures({ renderFeature }?: HomeFeaturesProps): react_jsx_runtime.JSX.Element | null;
|
|
90
|
+
/**
|
|
91
|
+
* Call-to-action section.
|
|
92
|
+
*/
|
|
93
|
+
declare function HomeCTA(): react_jsx_runtime.JSX.Element;
|
|
94
|
+
/**
|
|
95
|
+
* Footer section.
|
|
96
|
+
*/
|
|
97
|
+
declare function HomeFooter(): react_jsx_runtime.JSX.Element;
|
|
98
|
+
/**
|
|
99
|
+
* Homepage component for documentation sites.
|
|
100
|
+
*
|
|
101
|
+
* Can be used in two ways:
|
|
102
|
+
*
|
|
103
|
+
* 1. Simple - everything from config:
|
|
104
|
+
* ```tsx
|
|
105
|
+
* <HomePage {...props} />
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* 2. Composable - full control via children:
|
|
109
|
+
* ```tsx
|
|
110
|
+
* <HomePage {...props}>
|
|
111
|
+
* <HomePage.Header />
|
|
112
|
+
* <HomePage.Hero />
|
|
113
|
+
* <MyCustomSection />
|
|
114
|
+
* <HomePage.Features renderFeature={(feature, i, Default) => (
|
|
115
|
+
* <Default feature={feature} index={i} totalFeatures={4} />
|
|
116
|
+
* )} />
|
|
117
|
+
* <HomePage.CTA />
|
|
118
|
+
* <HomePage.Footer />
|
|
119
|
+
* </HomePage>
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
declare function HomePage({ children, navLinks, ...props }: HomePageProps): react_jsx_runtime.JSX.Element;
|
|
123
|
+
declare namespace HomePage {
|
|
124
|
+
var Header: typeof HomeHeader;
|
|
125
|
+
var Hero: typeof HomeHero;
|
|
126
|
+
var Features: typeof HomeFeatures;
|
|
127
|
+
var Feature: typeof HomeFeatureItem;
|
|
128
|
+
var CTA: typeof HomeCTA;
|
|
129
|
+
var Footer: typeof HomeFooter;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Markdown renderer with syntax highlighting and GFM support.
|
|
134
|
+
*/
|
|
135
|
+
declare function Markdown({ content, components }: MarkdownProps): react_jsx_runtime.JSX.Element;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Documentation sidebar with section-based navigation.
|
|
139
|
+
*/
|
|
140
|
+
declare function Sidebar({ nav, currentPath, className }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Create and mount an Inertia.js documentation app.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```tsx
|
|
147
|
+
* import { createDocsApp, DocsPage } from '@usecross/docs'
|
|
148
|
+
*
|
|
149
|
+
* createDocsApp({
|
|
150
|
+
* pages: {
|
|
151
|
+
* 'docs/DocsPage': DocsPage,
|
|
152
|
+
* },
|
|
153
|
+
* title: (title) => `${title} - My Docs`,
|
|
154
|
+
* })
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
declare function createDocsApp(config: DocsAppConfig): void;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Merge Tailwind CSS classes with clsx
|
|
161
|
+
*/
|
|
162
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Get or create a Shiki highlighter instance.
|
|
166
|
+
* Uses a singleton pattern to avoid creating multiple highlighters.
|
|
167
|
+
*/
|
|
168
|
+
declare function getHighlighter(): Promise<HighlighterCore>;
|
|
169
|
+
/**
|
|
170
|
+
* Configure the highlighter with custom themes and languages.
|
|
171
|
+
* Must be called before getHighlighter() is first called.
|
|
172
|
+
*/
|
|
173
|
+
declare function configureHighlighter(options: {
|
|
174
|
+
theme?: Promise<any>;
|
|
175
|
+
langs?: Promise<any>[];
|
|
176
|
+
}): void;
|
|
177
|
+
|
|
178
|
+
export { CodeBlock, CodeBlockProps, DocContent, DocsAppConfig, DocsLayout, DocsLayoutProps, DocsPage, HomeCTA, type HomeFeature, HomeFeatureItem, type HomeFeatureItemProps, HomeFeatures, type HomeFeaturesProps, HomeFooter, HomeHeader, type HomeHeaderProps, HomeHero, HomePage, type HomePageContextValue, type HomePageProps, InlineCode, Markdown, MarkdownProps, Sidebar, SidebarProps, cn, configureHighlighter, createDocsApp, getHighlighter };
|