@usecross/docs 0.11.0 → 0.12.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as CodeBlockProps, D as DocSetMeta, a as DocsLayoutProps, b as DocContent, M as MarkdownProps, S as SidebarProps, T as TableOfContentsProps, c as DocsAppConfig } from './types-Qbhh2Ihz.js';
3
- export { N as NavItem, d as NavSection, e as SharedProps, f as TOCItem } from './types-Qbhh2Ihz.js';
2
+ import { C as CodeBlockProps, D as DocSetMeta, a as DocsLayoutProps, b as DocContent, M as MarkdownProps, S as SidebarProps, T as TableOfContentsProps, A as APIPageProps, N as NavSection, G as GriffeModule, c as GriffeClass, d as GriffeFunction, e as GriffeDocstring, f as GriffeParameter, g as GriffeDocstringSection, h as DocsAppConfig } from './types-_anC1UJu.js';
3
+ export { u as ClassDocProps, w as DocstringProps, F as FunctionDocProps, r as GriffeAttribute, p as GriffeDecorator, o as GriffeDocstringElement, m as GriffeDocstringSectionKind, n as GriffeExpression, l as GriffeKind, s as GriffeMember, q as GriffeObjectBase, t as ModuleDocProps, i as NavItem, P as ParameterTableProps, j as SharedProps, v as SignatureProps, k as TOCItem } from './types-_anC1UJu.js';
4
4
  import { ReactNode } from 'react';
5
5
  import { ClassValue } from 'clsx';
6
6
  import { HighlighterCore } from 'shiki/core';
@@ -155,11 +155,19 @@ declare namespace HomePage {
155
155
  */
156
156
  declare function Markdown({ content, components }: MarkdownProps): react_jsx_runtime.JSX.Element;
157
157
 
158
+ interface ExtendedSidebarProps extends SidebarProps {
159
+ /** Use compact styling (smaller text) */
160
+ compact?: boolean;
161
+ /** Make sections collapsible */
162
+ collapsible?: boolean;
163
+ /** Collapse sections with more than N items by default */
164
+ collapseThreshold?: number;
165
+ }
158
166
  /**
159
167
  * Documentation sidebar with section-based navigation.
160
- * In multi-docs mode, includes a dropdown selector at the top.
168
+ * Supports both docs and API navigation styles.
161
169
  */
162
- declare function Sidebar({ nav, currentPath, className, docSets, currentDocSet }: SidebarProps): react_jsx_runtime.JSX.Element;
170
+ declare function Sidebar({ nav, currentPath, className, docSets, currentDocSet, compact, collapsible, collapseThreshold, }: ExtendedSidebarProps): react_jsx_runtime.JSX.Element;
163
171
 
164
172
  /**
165
173
  * Table of contents component with scroll spy functionality.
@@ -201,6 +209,151 @@ interface ThemeToggleProps {
201
209
  */
202
210
  declare function ThemeToggle({ className, size }: ThemeToggleProps): react_jsx_runtime.JSX.Element;
203
211
 
212
+ /**
213
+ * Main API documentation page component.
214
+ *
215
+ * Renders API documentation with a separate sidebar navigation.
216
+ * Automatically handles different item types (modules, classes, functions).
217
+ *
218
+ * @example
219
+ * // In your pages configuration:
220
+ * createDocsApp({
221
+ * pages: {
222
+ * 'api/APIPage': APIPage,
223
+ * // ...
224
+ * }
225
+ * })
226
+ */
227
+ declare function APIPage({ apiData, currentItem, currentPath, currentModule, apiNav, prefix, logoUrl, logoInvertedUrl, footerLogoUrl, footerLogoInvertedUrl, githubUrl, navLinks, header, headerHeight, footer, }: APIPageProps): react_jsx_runtime.JSX.Element;
228
+
229
+ interface APILayoutProps {
230
+ children: React.ReactNode;
231
+ title: string;
232
+ apiNav: NavSection[];
233
+ currentPath: string;
234
+ logoUrl?: string;
235
+ logoInvertedUrl?: string;
236
+ footerLogoUrl?: string;
237
+ footerLogoInvertedUrl?: string;
238
+ githubUrl?: string;
239
+ navLinks?: Array<{
240
+ label: string;
241
+ href: string;
242
+ }>;
243
+ /** Right sidebar content (e.g., table of contents) */
244
+ rightSidebar?: React.ReactNode;
245
+ /** Custom header component (replaces entire header). Can be a ReactNode or a function that receives mobile menu props. */
246
+ header?: React.ReactNode | ((props: {
247
+ mobileMenuOpen: boolean;
248
+ toggleMobileMenu: () => void;
249
+ }) => React.ReactNode);
250
+ /** Header height in pixels. Used to calculate content offset. Defaults to 64 (h-16). */
251
+ headerHeight?: number;
252
+ /** Custom footer component */
253
+ footer?: React.ReactNode;
254
+ }
255
+ /**
256
+ * Layout component for API documentation pages.
257
+ * Uses the shared Sidebar component with compact styling and collapsible sections.
258
+ */
259
+ declare function APILayout({ children, title, apiNav, currentPath, logoUrl: propLogoUrl, logoInvertedUrl: propLogoInvertedUrl, footerLogoUrl: propFooterLogoUrl, footerLogoInvertedUrl: propFooterLogoInvertedUrl, githubUrl: propGithubUrl, navLinks: propNavLinks, rightSidebar, header, headerHeight: propHeaderHeight, footer, }: APILayoutProps): react_jsx_runtime.JSX.Element;
260
+
261
+ interface ModuleDocProps {
262
+ module: GriffeModule;
263
+ /** URL prefix for links */
264
+ prefix?: string;
265
+ /** Show full module content or just summary */
266
+ showFull?: boolean;
267
+ /** Additional CSS class */
268
+ className?: string;
269
+ /** Override display path (e.g., for aliases to show alias name instead of target path) */
270
+ displayPath?: string;
271
+ /** GitHub repository URL for "Open in GitHub" links */
272
+ githubUrl?: string;
273
+ }
274
+ /**
275
+ * Renders documentation for a module including its classes, functions, and submodules.
276
+ */
277
+ declare function ModuleDoc({ module, prefix, showFull, className, displayPath, githubUrl }: ModuleDocProps): react_jsx_runtime.JSX.Element;
278
+
279
+ interface ClassDocProps {
280
+ cls: GriffeClass;
281
+ /** URL prefix for links */
282
+ prefix?: string;
283
+ /** Current path for breadcrumb */
284
+ currentPath?: string;
285
+ /** GitHub repo URL for source links */
286
+ githubUrl?: string;
287
+ /** Additional CSS class */
288
+ className?: string;
289
+ /** Override display path (e.g., for aliases to show alias name instead of target path) */
290
+ displayPath?: string;
291
+ }
292
+ /**
293
+ * Renders documentation for a class matching strawberry.rocks design.
294
+ * Includes: Title, Constructor, Methods (collapsible), Attributes, and footer.
295
+ */
296
+ declare function ClassDoc({ cls, prefix: _prefix, currentPath: _currentPath, githubUrl, className, displayPath }: ClassDocProps): react_jsx_runtime.JSX.Element;
297
+
298
+ interface FunctionDocProps {
299
+ fn: GriffeFunction;
300
+ /** Whether this is a method (inside a class) */
301
+ isMethod?: boolean;
302
+ /** Show function name as title */
303
+ showName?: boolean;
304
+ /** GitHub repo URL for source links */
305
+ githubUrl?: string;
306
+ /** Additional CSS class */
307
+ className?: string;
308
+ /** Override display path (e.g., for aliases to show alias name instead of target path) */
309
+ displayPath?: string;
310
+ }
311
+ /**
312
+ * Renders documentation for a function or method matching strawberry.rocks design.
313
+ */
314
+ declare function FunctionDoc({ fn, isMethod, showName, githubUrl, className, displayPath }: FunctionDocProps): react_jsx_runtime.JSX.Element;
315
+
316
+ interface SignatureProps {
317
+ fn: GriffeFunction;
318
+ /** Show full path or just function name */
319
+ showPath?: boolean;
320
+ /** Additional CSS class */
321
+ className?: string;
322
+ }
323
+ /**
324
+ * Renders a Python function/method signature with syntax highlighting.
325
+ * Uses dark background style matching strawberry.rocks.
326
+ */
327
+ declare function Signature({ fn, showPath, className }: SignatureProps): react_jsx_runtime.JSX.Element;
328
+
329
+ interface DocstringProps {
330
+ docstring: GriffeDocstring | undefined;
331
+ /** Show raw text instead of parsed sections */
332
+ raw?: boolean;
333
+ /** Only show the text/description part, skip parameters/returns/etc */
334
+ showOnlyText?: boolean;
335
+ /** Additional CSS class */
336
+ className?: string;
337
+ }
338
+ /**
339
+ * Renders a parsed docstring with sections for parameters, returns, raises, etc.
340
+ */
341
+ declare function Docstring({ docstring, raw, showOnlyText, className }: DocstringProps): react_jsx_runtime.JSX.Element | null;
342
+
343
+ interface ParameterTableProps {
344
+ parameters: GriffeParameter[];
345
+ /** Docstring sections for parameter descriptions */
346
+ docstringSections?: GriffeDocstringSection[];
347
+ /** Additional CSS class */
348
+ className?: string;
349
+ }
350
+ /**
351
+ * Renders a two-column parameter list matching strawberry.rocks design.
352
+ * Left column: parameter name badge
353
+ * Right column: description, type, and default value
354
+ */
355
+ declare function ParameterTable({ parameters, docstringSections, className }: ParameterTableProps): react_jsx_runtime.JSX.Element | null;
356
+
204
357
  /**
205
358
  * Create and mount an Inertia.js documentation app.
206
359
  *
@@ -237,4 +390,4 @@ declare function configureHighlighter(options: {
237
390
  langs?: Promise<any>[];
238
391
  }): void;
239
392
 
240
- export { CodeBlock, CodeBlockProps, DocContent, DocSetMeta, DocSetSelector, DocsAppConfig, DocsLayout, DocsLayoutProps, DocsPage, EmojiConfetti, HomeCTA, type HomeFeature, HomeFeatureItem, type HomeFeatureItemProps, HomeFeatures, type HomeFeaturesProps, HomeFooter, HomeHeader, type HomeHeaderProps, HomeHero, HomePage, type HomePageContextValue, type HomePageProps, InlineCode, Markdown, MarkdownProps, MobileMenuButton, type ResolvedTheme, Sidebar, SidebarProps, TableOfContents, TableOfContentsProps, type Theme, ThemeProvider, ThemeToggle, cn, configureHighlighter, createDocsApp, getHighlighter, themeInitScript, useTheme };
393
+ export { APILayout, APIPage, APIPageProps, ClassDoc, CodeBlock, CodeBlockProps, DocContent, DocSetMeta, DocSetSelector, DocsAppConfig, DocsLayout, DocsLayoutProps, DocsPage, Docstring, EmojiConfetti, FunctionDoc, GriffeClass, GriffeDocstring, GriffeDocstringSection, GriffeFunction, GriffeModule, GriffeParameter, HomeCTA, type HomeFeature, HomeFeatureItem, type HomeFeatureItemProps, HomeFeatures, type HomeFeaturesProps, HomeFooter, HomeHeader, type HomeHeaderProps, HomeHero, HomePage, type HomePageContextValue, type HomePageProps, InlineCode, Markdown, MarkdownProps, MobileMenuButton, ModuleDoc, NavSection, ParameterTable, type ResolvedTheme, Sidebar, SidebarProps, Signature, TableOfContents, TableOfContentsProps, type Theme, ThemeProvider, ThemeToggle, cn, configureHighlighter, createDocsApp, getHighlighter, themeInitScript, useTheme };