boltdocs 1.10.2 → 2.0.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.
Files changed (250) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/dist/cache-7G6D532T.mjs +1 -0
  4. package/dist/chunk-A4HQPEPU.mjs +1 -0
  5. package/dist/chunk-BA5NH5HU.mjs +1 -0
  6. package/dist/chunk-BQCD3DWG.mjs +1 -0
  7. package/dist/chunk-H63UMKYF.mjs +1 -0
  8. package/dist/chunk-IWHRQHS7.mjs +1 -0
  9. package/dist/chunk-JZXLCA2E.mjs +1 -0
  10. package/dist/chunk-MFU7Q6WF.mjs +1 -0
  11. package/dist/chunk-QYPNX5UN.mjs +1 -0
  12. package/dist/chunk-XEAPSFMB.mjs +1 -0
  13. package/dist/client/components/mdx/index.d.mts +209 -0
  14. package/dist/client/components/mdx/index.d.ts +209 -0
  15. package/dist/client/components/mdx/index.js +1 -0
  16. package/dist/client/components/mdx/index.mjs +1 -0
  17. package/dist/client/hooks/index.d.mts +133 -0
  18. package/dist/client/hooks/index.d.ts +133 -0
  19. package/dist/client/hooks/index.js +1 -0
  20. package/dist/client/hooks/index.mjs +1 -0
  21. package/dist/client/index.d.mts +138 -298
  22. package/dist/client/index.d.ts +138 -298
  23. package/dist/client/index.js +1 -3630
  24. package/dist/client/index.mjs +1 -697
  25. package/dist/client/ssr.d.mts +7 -3
  26. package/dist/client/ssr.d.ts +7 -3
  27. package/dist/client/ssr.js +1 -2928
  28. package/dist/client/ssr.mjs +1 -33
  29. package/dist/{config-BsFQ-ErD.d.ts → config-CX4l-ZNp.d.mts} +42 -35
  30. package/dist/{config-BsFQ-ErD.d.mts → config-CX4l-ZNp.d.ts} +42 -35
  31. package/dist/node/index.d.mts +2 -4
  32. package/dist/node/index.d.ts +2 -4
  33. package/dist/node/index.js +31 -1161
  34. package/dist/node/index.mjs +31 -736
  35. package/dist/search-dialog-EB3N4TYM.mjs +1 -0
  36. package/dist/types-BuZWFT7r.d.ts +159 -0
  37. package/dist/types-CvT-SGbK.d.mts +159 -0
  38. package/dist/use-routes-5bAtAAYX.d.mts +30 -0
  39. package/dist/use-routes-BefRXY3v.d.ts +30 -0
  40. package/package.json +34 -12
  41. package/src/client/app/config-context.tsx +18 -0
  42. package/src/client/app/docs-layout.tsx +14 -0
  43. package/src/client/app/index.tsx +137 -262
  44. package/src/client/app/mdx-component.tsx +52 -0
  45. package/src/client/app/mdx-components-context.tsx +23 -0
  46. package/src/client/app/mdx-page.tsx +20 -0
  47. package/src/client/app/preload.tsx +38 -30
  48. package/src/client/app/router.tsx +30 -0
  49. package/src/client/app/scroll-handler.tsx +40 -0
  50. package/src/client/app/theme-context.tsx +75 -0
  51. package/src/client/components/default-layout.tsx +80 -0
  52. package/src/client/components/docs-layout.tsx +105 -0
  53. package/src/client/components/icons-dev.tsx +74 -0
  54. package/src/client/components/mdx/admonition.tsx +107 -0
  55. package/src/client/components/mdx/badge.tsx +41 -0
  56. package/src/client/components/mdx/button.tsx +35 -0
  57. package/src/client/components/mdx/card.tsx +124 -0
  58. package/src/client/components/mdx/code-block.tsx +119 -0
  59. package/src/client/components/mdx/component-preview.tsx +47 -0
  60. package/src/client/components/mdx/component-props.tsx +83 -0
  61. package/src/client/components/mdx/field.tsx +66 -0
  62. package/src/client/components/mdx/file-tree.tsx +287 -0
  63. package/src/client/components/mdx/hooks/use-code-block.ts +56 -0
  64. package/src/client/components/mdx/hooks/use-component-preview.ts +16 -0
  65. package/src/client/components/mdx/hooks/useTable.ts +74 -0
  66. package/src/client/components/mdx/hooks/useTabs.ts +68 -0
  67. package/src/client/components/mdx/image.tsx +23 -0
  68. package/src/client/components/mdx/index.ts +53 -0
  69. package/src/client/components/mdx/link.tsx +38 -0
  70. package/src/client/components/mdx/list.tsx +192 -0
  71. package/src/client/components/mdx/table.tsx +156 -0
  72. package/src/client/components/mdx/tabs.tsx +135 -0
  73. package/src/client/components/mdx/video.tsx +68 -0
  74. package/src/client/components/primitives/breadcrumbs.tsx +79 -0
  75. package/src/client/components/primitives/button-group.tsx +54 -0
  76. package/src/client/components/primitives/button.tsx +145 -0
  77. package/src/client/components/primitives/helpers/observer.ts +120 -0
  78. package/src/client/components/primitives/index.ts +17 -0
  79. package/src/client/components/primitives/link.tsx +122 -0
  80. package/src/client/components/primitives/menu.tsx +159 -0
  81. package/src/client/components/primitives/navbar.tsx +359 -0
  82. package/src/client/components/primitives/navigation-menu.tsx +116 -0
  83. package/src/client/components/primitives/on-this-page.tsx +461 -0
  84. package/src/client/components/primitives/page-nav.tsx +87 -0
  85. package/src/client/components/primitives/popover.tsx +47 -0
  86. package/src/client/components/primitives/search-dialog.tsx +183 -0
  87. package/src/client/components/primitives/sidebar.tsx +154 -0
  88. package/src/client/components/primitives/tabs.tsx +90 -0
  89. package/src/client/components/primitives/tooltip.tsx +83 -0
  90. package/src/client/components/primitives/types.ts +11 -0
  91. package/src/client/components/ui-base/breadcrumbs.tsx +42 -0
  92. package/src/client/components/ui-base/copy-markdown.tsx +112 -0
  93. package/src/client/components/ui-base/error-boundary.tsx +52 -0
  94. package/src/client/components/ui-base/github-stars.tsx +27 -0
  95. package/src/client/components/ui-base/head.tsx +69 -0
  96. package/src/client/components/ui-base/loading.tsx +87 -0
  97. package/src/client/components/ui-base/navbar.tsx +138 -0
  98. package/src/client/components/ui-base/not-found.tsx +24 -0
  99. package/src/client/components/ui-base/on-this-page.tsx +152 -0
  100. package/src/client/components/ui-base/page-nav.tsx +39 -0
  101. package/src/client/components/ui-base/powered-by.tsx +19 -0
  102. package/src/client/components/ui-base/progress-bar.tsx +67 -0
  103. package/src/client/components/ui-base/search-dialog.tsx +82 -0
  104. package/src/client/components/ui-base/sidebar.tsx +104 -0
  105. package/src/client/components/ui-base/tabs.tsx +65 -0
  106. package/src/client/components/ui-base/theme-toggle.tsx +32 -0
  107. package/src/client/hooks/index.ts +12 -0
  108. package/src/client/hooks/use-breadcrumbs.ts +22 -0
  109. package/src/client/hooks/use-i18n.ts +84 -0
  110. package/src/client/hooks/use-localized-to.ts +95 -0
  111. package/src/client/hooks/use-location.ts +5 -0
  112. package/src/client/hooks/use-navbar.ts +60 -0
  113. package/src/client/hooks/use-onthispage.ts +23 -0
  114. package/src/client/hooks/use-page-nav.ts +22 -0
  115. package/src/client/hooks/use-routes.ts +72 -0
  116. package/src/client/hooks/use-search.ts +71 -0
  117. package/src/client/hooks/use-sidebar.ts +49 -0
  118. package/src/client/hooks/use-tabs.ts +43 -0
  119. package/src/client/hooks/use-version.ts +78 -0
  120. package/src/client/index.ts +55 -17
  121. package/src/client/integrations/codesandbox.ts +179 -0
  122. package/src/client/ssr.tsx +27 -16
  123. package/src/client/theme/neutral.css +360 -0
  124. package/src/client/types.ts +131 -27
  125. package/src/client/utils/cn.ts +6 -0
  126. package/src/client/utils/copy-clipboard.ts +22 -0
  127. package/src/client/utils/get-base-file-path.ts +21 -0
  128. package/src/client/utils/github.ts +121 -0
  129. package/src/client/utils/use-on-change.ts +15 -0
  130. package/src/client/virtual.d.ts +24 -0
  131. package/src/node/cache.ts +156 -156
  132. package/src/node/config.ts +159 -103
  133. package/src/node/index.ts +13 -13
  134. package/src/node/mdx.ts +213 -61
  135. package/src/node/plugin/entry.ts +29 -18
  136. package/src/node/plugin/html.ts +11 -11
  137. package/src/node/plugin/index.ts +161 -84
  138. package/src/node/plugin/types.ts +2 -4
  139. package/src/node/routes/cache.ts +6 -6
  140. package/src/node/routes/index.ts +206 -113
  141. package/src/node/routes/parser.ts +102 -82
  142. package/src/node/routes/sorter.ts +15 -15
  143. package/src/node/routes/types.ts +24 -24
  144. package/src/node/ssg/index.ts +73 -47
  145. package/src/node/ssg/meta.ts +4 -4
  146. package/src/node/ssg/options.ts +5 -5
  147. package/src/node/ssg/sitemap.ts +14 -14
  148. package/src/node/utils.ts +54 -31
  149. package/tsconfig.json +25 -20
  150. package/tsup.config.ts +23 -14
  151. package/dist/PackageManagerTabs-NVT7G625.mjs +0 -99
  152. package/dist/SearchDialog-AGVF6JBO.mjs +0 -194
  153. package/dist/SearchDialog-YPDOM7Q6.css +0 -2847
  154. package/dist/Video-KNTY5BNO.mjs +0 -6
  155. package/dist/cache-KNL5B4EE.mjs +0 -12
  156. package/dist/chunk-7SFUJWTB.mjs +0 -211
  157. package/dist/chunk-FFBNU6IJ.mjs +0 -386
  158. package/dist/chunk-FMTOYQLO.mjs +0 -37
  159. package/dist/chunk-TKLQWU7H.mjs +0 -1920
  160. package/dist/chunk-Z7JHYNAS.mjs +0 -57
  161. package/dist/client/index.css +0 -2847
  162. package/dist/client/ssr.css +0 -2847
  163. package/dist/types-Dj-bfnC3.d.mts +0 -74
  164. package/dist/types-Dj-bfnC3.d.ts +0 -74
  165. package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -61
  166. package/src/client/theme/components/CodeBlock/index.ts +0 -1
  167. package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +0 -131
  168. package/src/client/theme/components/PackageManagerTabs/index.ts +0 -1
  169. package/src/client/theme/components/PackageManagerTabs/pkg-tabs.css +0 -64
  170. package/src/client/theme/components/Playground/Playground.tsx +0 -180
  171. package/src/client/theme/components/Playground/index.ts +0 -1
  172. package/src/client/theme/components/Playground/playground.css +0 -238
  173. package/src/client/theme/components/Video/Video.tsx +0 -84
  174. package/src/client/theme/components/Video/index.ts +0 -1
  175. package/src/client/theme/components/Video/video.css +0 -41
  176. package/src/client/theme/components/mdx/Admonition.tsx +0 -80
  177. package/src/client/theme/components/mdx/Badge.tsx +0 -31
  178. package/src/client/theme/components/mdx/Button.tsx +0 -50
  179. package/src/client/theme/components/mdx/Card.tsx +0 -80
  180. package/src/client/theme/components/mdx/Field.tsx +0 -60
  181. package/src/client/theme/components/mdx/FileTree.tsx +0 -229
  182. package/src/client/theme/components/mdx/List.tsx +0 -57
  183. package/src/client/theme/components/mdx/Table.tsx +0 -151
  184. package/src/client/theme/components/mdx/Tabs.tsx +0 -123
  185. package/src/client/theme/components/mdx/index.ts +0 -27
  186. package/src/client/theme/components/mdx/mdx-components.css +0 -764
  187. package/src/client/theme/icons/bun.tsx +0 -62
  188. package/src/client/theme/icons/deno.tsx +0 -20
  189. package/src/client/theme/icons/discord.tsx +0 -12
  190. package/src/client/theme/icons/github.tsx +0 -15
  191. package/src/client/theme/icons/npm.tsx +0 -13
  192. package/src/client/theme/icons/pnpm.tsx +0 -72
  193. package/src/client/theme/icons/twitter.tsx +0 -12
  194. package/src/client/theme/styles/markdown.css +0 -394
  195. package/src/client/theme/styles/variables.css +0 -175
  196. package/src/client/theme/styles.css +0 -39
  197. package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +0 -68
  198. package/src/client/theme/ui/Breadcrumbs/index.ts +0 -1
  199. package/src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx +0 -82
  200. package/src/client/theme/ui/CopyMarkdown/copy-markdown.css +0 -112
  201. package/src/client/theme/ui/CopyMarkdown/index.ts +0 -1
  202. package/src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx +0 -50
  203. package/src/client/theme/ui/ErrorBoundary/error-boundary.css +0 -55
  204. package/src/client/theme/ui/ErrorBoundary/index.ts +0 -1
  205. package/src/client/theme/ui/Footer/footer.css +0 -32
  206. package/src/client/theme/ui/Head/Head.tsx +0 -69
  207. package/src/client/theme/ui/Head/index.ts +0 -1
  208. package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +0 -125
  209. package/src/client/theme/ui/LanguageSwitcher/index.ts +0 -1
  210. package/src/client/theme/ui/LanguageSwitcher/language-switcher.css +0 -98
  211. package/src/client/theme/ui/Layout/Layout.tsx +0 -203
  212. package/src/client/theme/ui/Layout/base.css +0 -106
  213. package/src/client/theme/ui/Layout/index.ts +0 -2
  214. package/src/client/theme/ui/Layout/pagination.css +0 -72
  215. package/src/client/theme/ui/Layout/responsive.css +0 -47
  216. package/src/client/theme/ui/Link/Link.tsx +0 -392
  217. package/src/client/theme/ui/Link/LinkPreview.tsx +0 -59
  218. package/src/client/theme/ui/Link/index.ts +0 -2
  219. package/src/client/theme/ui/Link/link-preview.css +0 -48
  220. package/src/client/theme/ui/Loading/Loading.tsx +0 -10
  221. package/src/client/theme/ui/Loading/index.ts +0 -1
  222. package/src/client/theme/ui/Loading/loading.css +0 -30
  223. package/src/client/theme/ui/Navbar/GithubStars.tsx +0 -27
  224. package/src/client/theme/ui/Navbar/Navbar.tsx +0 -193
  225. package/src/client/theme/ui/Navbar/Tabs.tsx +0 -99
  226. package/src/client/theme/ui/Navbar/index.ts +0 -2
  227. package/src/client/theme/ui/Navbar/navbar.css +0 -347
  228. package/src/client/theme/ui/NotFound/NotFound.tsx +0 -19
  229. package/src/client/theme/ui/NotFound/index.ts +0 -1
  230. package/src/client/theme/ui/NotFound/not-found.css +0 -64
  231. package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +0 -244
  232. package/src/client/theme/ui/OnThisPage/index.ts +0 -1
  233. package/src/client/theme/ui/OnThisPage/toc.css +0 -152
  234. package/src/client/theme/ui/PoweredBy/PoweredBy.tsx +0 -18
  235. package/src/client/theme/ui/PoweredBy/index.ts +0 -1
  236. package/src/client/theme/ui/PoweredBy/powered-by.css +0 -76
  237. package/src/client/theme/ui/ProgressBar/ProgressBar.css +0 -17
  238. package/src/client/theme/ui/ProgressBar/ProgressBar.tsx +0 -51
  239. package/src/client/theme/ui/ProgressBar/index.ts +0 -1
  240. package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +0 -209
  241. package/src/client/theme/ui/SearchDialog/index.ts +0 -1
  242. package/src/client/theme/ui/SearchDialog/search.css +0 -152
  243. package/src/client/theme/ui/Sidebar/Sidebar.tsx +0 -244
  244. package/src/client/theme/ui/Sidebar/index.ts +0 -1
  245. package/src/client/theme/ui/Sidebar/sidebar.css +0 -230
  246. package/src/client/theme/ui/ThemeToggle/ThemeToggle.tsx +0 -69
  247. package/src/client/theme/ui/ThemeToggle/index.ts +0 -1
  248. package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +0 -136
  249. package/src/client/theme/ui/VersionSwitcher/index.ts +0 -1
  250. package/src/client/utils.ts +0 -49
@@ -1,15 +1,17 @@
1
- import { B as BoltdocsConfig } from '../config-BsFQ-ErD.js';
2
- export { a as BoltdocsThemeConfig } from '../config-BsFQ-ErD.js';
3
- import { C as CreateBoltdocsAppOptions, a as ComponentRoute } from '../types-Dj-bfnC3.js';
1
+ import { B as BoltdocsConfig } from '../config-CX4l-ZNp.js';
2
+ export { a as BoltdocsThemeConfig } from '../config-CX4l-ZNp.js';
3
+ import { a as CreateBoltdocsAppOptions, C as ComponentRoute, O as OnThisPageProps, S as SandboxOptions } from '../types-BuZWFT7r.js';
4
+ export { L as LayoutProps, b as SandboxEmbedOptions, c as SandboxFile, d as SandboxFiles } from '../types-BuZWFT7r.js';
5
+ export { u as useRoutes } from '../use-routes-BefRXY3v.js';
6
+ import * as React$1 from 'react';
7
+ import React__default, { Component, ReactNode, ErrorInfo } from 'react';
4
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import React from 'react';
9
+ export { Admonition, AdmonitionProps, Badge, BadgeProps, Button, ButtonProps, Card, CardProps, Cards, CardsProps, Caution, CodeBlock, ComponentPreview, ComponentPreviewProps, ComponentProps, ComponentPropsProps, CopyMarkdown, Danger, Field, FieldProps, FileTree, FileTreeProps, Image, ImageProps, Important, InfoBox, Link, LinkProps, List, ListProps, Note, Tab, TabProps, Table, TableProps, Tabs, TabsProps, Tip, Video, Warning } from './components/mdx/index.js';
6
10
  import 'vite';
11
+ import 'class-variance-authority/types';
12
+ import 'react-aria-components';
13
+ import 'class-variance-authority';
7
14
 
8
- declare global {
9
- interface ImportMeta {
10
- env: Record<string, any>;
11
- }
12
- }
13
15
  /**
14
16
  * Creates and mounts the Boltdocs documentation app.
15
17
  *
@@ -34,54 +36,82 @@ declare global {
34
36
  declare function createBoltdocsApp(options: CreateBoltdocsAppOptions): void;
35
37
 
36
38
  /**
37
- * The top navigation bar of the documentation site.
39
+ * Hook to access the Boltdocs configuration.
38
40
  */
39
- declare function Navbar({ config, routes, allRoutes, currentLocale, currentVersion, }: {
40
- config: BoltdocsConfig;
41
- routes?: ComponentRoute[];
42
- allRoutes?: ComponentRoute[];
43
- currentLocale?: string;
44
- currentVersion?: string;
45
- }): react_jsx_runtime.JSX.Element;
41
+ declare function useConfig(): BoltdocsConfig;
46
42
 
47
- interface RouteItem {
48
- path: string;
49
- title: string;
50
- group?: string;
51
- groupTitle?: string;
52
- sidebarPosition?: number;
53
- badge?: string | {
54
- text: string;
55
- expires?: string;
56
- };
57
- icon?: string;
58
- tab?: string;
59
- groupIcon?: string;
43
+ type Theme = 'light' | 'dark';
44
+ interface ThemeContextType {
45
+ theme: Theme;
46
+ toggleTheme: () => void;
47
+ setTheme: (theme: Theme) => void;
48
+ }
49
+ declare function useTheme(): ThemeContextType;
50
+
51
+ type MdxComponentsType = Record<string, React__default.ComponentType<any>>;
52
+ declare function useMdxComponents(): MdxComponentsType;
53
+
54
+ /**
55
+ * Props shared by all layout slot components.
56
+ */
57
+ interface SlotProps {
58
+ children?: React__default.ReactNode;
59
+ className?: string;
60
+ style?: React__default.CSSProperties;
60
61
  }
61
62
  /**
62
- * The sidebar navigation component.
63
- * Groups documentation routes logically based on the `group` property.
64
- * Highlights the active link based on the current URL path.
63
+ * Root layout shell. Renders a full-height flex column.
65
64
  *
66
- * @param routes - Array of all generated routes to be displayed
67
- * @param config - Global configuration (which can contain sidebar overrides)
65
+ * Usage:
66
+ * ```tsx
67
+ * <DocsLayout>
68
+ * <Navbar />
69
+ * <DocsLayout.Body>...</DocsLayout.Body>
70
+ * </DocsLayout>
71
+ * ```
72
+ */
73
+ declare function DocsLayoutRoot({ children, className, style }: SlotProps): react_jsx_runtime.JSX.Element;
74
+ /**
75
+ * Horizontal flex container for sidebar + content + toc.
68
76
  */
77
+ declare function Body({ children, className, style }: SlotProps): react_jsx_runtime.JSX.Element;
78
+ /**
79
+ * Main scrollable content area.
80
+ */
81
+ declare function Content({ children, className, style }: SlotProps): react_jsx_runtime.JSX.Element;
82
+ /**
83
+ * Content header row (breadcrumbs + copy markdown).
84
+ */
85
+ declare function ContentHeader({ children, className, style }: SlotProps): react_jsx_runtime.JSX.Element;
86
+ /**
87
+ * Footer area inside the content section (page nav).
88
+ */
89
+ declare function ContentFooter({ children, className, style }: SlotProps): react_jsx_runtime.JSX.Element;
90
+ declare const DocsLayout: typeof DocsLayoutRoot & {
91
+ Body: typeof Body;
92
+ Content: typeof Content;
93
+ ContentHeader: typeof ContentHeader;
94
+ ContentFooter: typeof ContentFooter;
95
+ };
96
+
97
+ interface LayoutProps {
98
+ children: React.ReactNode;
99
+ }
100
+ /**
101
+ * The built-in default layout for Boltdocs.
102
+ * Users who create their own `layout.tsx` can import the same building blocks
103
+ * and rearrange, wrap, or replace any section.
104
+ */
105
+ declare function DefaultLayout({ children }: LayoutProps): react_jsx_runtime.JSX.Element;
106
+
107
+ declare function Navbar(): react_jsx_runtime.JSX.Element;
108
+
69
109
  declare function Sidebar({ routes, config, }: {
70
- routes: RouteItem[];
110
+ routes: ComponentRoute[];
71
111
  config: BoltdocsConfig;
72
112
  }): react_jsx_runtime.JSX.Element;
73
113
 
74
- interface TocHeading {
75
- id: string;
76
- text: string;
77
- level: number;
78
- }
79
- declare function OnThisPage({ headings, editLink, communityHelp, filePath, }: {
80
- headings?: TocHeading[];
81
- editLink?: string;
82
- communityHelp?: string;
83
- filePath?: string;
84
- }): react_jsx_runtime.JSX.Element | null;
114
+ declare function OnThisPage({ headings: rawHeadings, editLink, communityHelp, filePath, }: OnThisPageProps): react_jsx_runtime.JSX.Element | null;
85
115
 
86
116
  interface HeadProps {
87
117
  siteTitle: string;
@@ -94,279 +124,89 @@ interface HeadProps {
94
124
  }
95
125
  declare function Head({ siteTitle, siteDescription, routes }: HeadProps): null;
96
126
 
97
- interface BreadcrumbsProps {
98
- routes: ComponentRoute[];
99
- config: BoltdocsConfig;
100
- }
101
- declare function Breadcrumbs({ routes, config }: BreadcrumbsProps): react_jsx_runtime.JSX.Element | null;
127
+ declare function Breadcrumbs(): react_jsx_runtime.JSX.Element | null;
102
128
 
103
- interface ThemeLayoutProps {
104
- config: BoltdocsConfig;
105
- routes: ComponentRoute[];
106
- children: React.ReactNode;
107
- /** Custom navbar component (slots) */
108
- navbar?: React.ReactNode;
109
- /** Custom sidebar component (slots) */
110
- sidebar?: React.ReactNode;
111
- /** Custom table of contents (OnThisPage) component (slots) */
112
- toc?: React.ReactNode;
113
- /** Custom background component (slots) */
114
- background?: React.ReactNode;
115
- /** Custom head/metadata component (slots) */
116
- head?: React.ReactNode;
117
- /** Custom breadcrumbs component (slots) */
118
- breadcrumbs?: React.ReactNode;
119
- /** Custom class name for the root layout element */
120
- className?: string;
121
- /** Custom styles for the root layout element */
122
- style?: React.CSSProperties;
123
- }
124
129
  /**
125
- * The main structural layout for documentation pages.
126
- * Integrates the Navbar, Sidebar, and OnThisPage components into a cohesive shell.
127
- * It also manages mobile interaction states like the sidebar overlay toggle.
128
- *
129
- * @param config - The global Boltdocs configuration object
130
- * @param routes - The array of available doc routes (used to render the sidebar)
131
- */
132
- declare function ThemeLayout({ config, routes, children, navbar, sidebar, toc, background, head, breadcrumbs, className, style, }: ThemeLayoutProps): react_jsx_runtime.JSX.Element;
133
-
134
- interface PlaygroundProps {
135
- code?: string;
136
- children?: string | React.ReactNode;
137
- preview?: React.ReactNode;
138
- scope?: Record<string, any>;
139
- readonly?: boolean;
140
- noInline?: boolean;
141
- }
142
- declare function Playground({ code: propsCode, children, preview, scope, readonly, noInline: forceNoInline, }: PlaygroundProps): react_jsx_runtime.JSX.Element;
143
-
144
- declare function NotFound(): react_jsx_runtime.JSX.Element;
145
-
146
- declare function Loading(): react_jsx_runtime.JSX.Element;
147
-
148
- interface CodeBlockProps {
149
- children?: React.ReactNode;
150
- className?: string;
151
- [key: string]: any;
152
- }
153
- /**
154
- * A specialized wrapper for code snippets compiled from MDX blocks.
155
- * Provides syntax highlighting styling scaffolding and a "Copy to Clipboard" button.
156
- */
157
- declare function CodeBlock({ children, ...props }: CodeBlockProps): react_jsx_runtime.JSX.Element;
158
-
159
- interface VideoProps {
160
- /** Video source URL */
161
- src?: string;
162
- /** Poster/thumbnail image URL */
163
- poster?: string;
164
- /** Alt text for accessibility */
165
- alt?: string;
166
- /** Show native video controls (default: true) */
167
- controls?: boolean;
168
- /** Preload strategy (default: 'none') */
169
- preload?: string;
170
- /** Children (e.g. <source> elements) */
171
- children?: React.ReactNode;
172
- /** Allow any additional HTML video attributes */
173
- [key: string]: any;
174
- }
175
- /**
176
- * Optimized video component with lazy loading via IntersectionObserver.
177
- * The `<video>` element is only rendered once it enters the viewport,
178
- * preventing unnecessary network downloads on initial page load.
179
- *
180
- * Usage in MDX:
181
- * ```mdx
182
- * <video src="/demo.mp4" poster="/demo-thumb.jpg" />
183
- * ```
130
+ * Component to display the previous and next page navigation buttons.
184
131
  */
185
- declare function Video({ src, poster, alt, children, controls, preload, ...rest }: VideoProps): react_jsx_runtime.JSX.Element;
132
+ declare function PageNav(): react_jsx_runtime.JSX.Element | null;
186
133
 
187
- type ButtonProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
188
- /** Visual variant */
189
- variant?: "primary" | "secondary" | "outline" | "ghost";
190
- /** Size */
191
- size?: "sm" | "md" | "lg";
192
- /** If provided, renders as a link */
193
- href?: string;
194
- children: React.ReactNode;
195
- };
196
134
  /**
197
- * A versatile button/link component for use in MDX pages and the home page.
135
+ * A reading progress bar component that tracks the scroll position
136
+ * within the Boltdocs content area.
198
137
  *
199
- * ```mdx
200
- * <Button variant="primary" href="/docs/getting-started">Get Started →</Button>
201
- * <Button variant="secondary" href="https://github.com">GitHub</Button>
202
- * ```
138
+ * It utilizes react-aria-components for accessibility and is fixed
139
+ * to the top of the viewport for a premium, non-intrusive UI experience.
203
140
  */
204
- declare function Button({ variant, size, href, children, className, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
141
+ declare function ProgressBar(): react_jsx_runtime.JSX.Element;
205
142
 
206
- interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
207
- /** Color variant */
208
- variant?: "default" | "primary" | "success" | "warning" | "danger" | "info";
209
- children: React.ReactNode;
143
+ interface Props {
144
+ children?: ReactNode;
145
+ fallback?: ReactNode;
210
146
  }
211
- /**
212
- * Inline badge / pill for labels, statuses, or tags.
213
- *
214
- * ```mdx
215
- * <Badge variant="success">Stable</Badge>
216
- * <Badge variant="warning">Beta</Badge>
217
- * ```
218
- */
219
- declare function Badge({ variant, children, className, ...rest }: BadgeProps): react_jsx_runtime.JSX.Element;
220
-
221
- interface CardsProps extends React.HTMLAttributes<HTMLDivElement> {
222
- /** Number of columns (defaults to 3) */
223
- cols?: 1 | 2 | 3 | 4;
224
- children: React.ReactNode;
147
+ interface State {
148
+ hasError: boolean;
149
+ error?: Error;
225
150
  }
226
- /**
227
- * Grid wrapper for `<Card>` components.
228
- *
229
- * ```mdx
230
- * <Cards cols={3}>
231
- * <Card title="Fast" icon="⚡">Instant HMR.</Card>
232
- * <Card title="Simple" icon="📁">File-system routing.</Card>
233
- * </Cards>
234
- * ```
235
- */
236
- declare function Cards({ cols, children, className, ...rest }: CardsProps): react_jsx_runtime.JSX.Element;
237
- interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
238
- /** Card heading */
239
- title?: string;
240
- /** Emoji or icon string displayed above the title */
241
- icon?: React.ReactNode;
242
- /** If provided, the entire card becomes a link */
243
- href?: string;
244
- children?: React.ReactNode;
151
+ declare class ErrorBoundary extends Component<Props, State> {
152
+ state: State;
153
+ static getDerivedStateFromError(error: Error): State;
154
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
155
+ render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
245
156
  }
246
- /**
247
- * Individual feature/info card.
248
- */
249
- declare function Card({ title, icon, href, children, className, ...rest }: CardProps): react_jsx_runtime.JSX.Element;
250
157
 
251
- interface TabProps {
252
- /** The label shown in the tab bar */
253
- label: string;
254
- children: React.ReactNode;
255
- }
256
- /**
257
- * A single tab panel. Must be used inside `<Tabs>`.
258
- *
259
- * ```mdx
260
- * <Tab label="npm">npm install boltdocs</Tab>
261
- * ```
262
- */
263
- declare function Tab({ children }: TabProps): react_jsx_runtime.JSX.Element;
264
- interface TabsProps {
265
- /** Which tab index is initially active (0-based, default 0) */
266
- defaultIndex?: number;
267
- children: React.ReactNode;
268
- }
158
+ declare function NotFound(): react_jsx_runtime.JSX.Element;
159
+
269
160
  /**
270
- * Tab container that manages active state.
161
+ * A premium loading component that includes an SVG fill animation
162
+ * and a synchronized progress indicator.
271
163
  *
272
- * ```mdx
273
- * <Tabs>
274
- * <Tab label="npm">npm install boltdocs</Tab>
275
- * <Tab label="pnpm">pnpm add boltdocs</Tab>
276
- * </Tabs>
277
- * ```
164
+ * It features a glassmorphism container and a Bolt-style SVG logo
165
+ * with a dynamic fill effect.
278
166
  */
279
- declare function Tabs({ defaultIndex, children }: TabsProps): react_jsx_runtime.JSX.Element;
167
+ declare function Loading(): react_jsx_runtime.JSX.Element;
280
168
 
281
- interface AdmonitionProps extends React.HTMLAttributes<HTMLDivElement> {
282
- /** Admonition type — controls color and icon */
283
- type?: "note" | "tip" | "info" | "warning" | "danger";
284
- /** Override the default title */
285
- title?: string;
286
- children: React.ReactNode;
287
- }
288
169
  /**
289
- * Callout / admonition box for notes, warnings, etc.
290
- *
291
- * ```mdx
292
- * <Admonition type="warning" title="Breaking Change">
293
- * This API has changed in v2.
294
- * </Admonition>
295
- * ```
170
+ * Helper to define a sandbox and get a URL for the CodeSandbox Define API.
171
+ * Uses the official SDK `getParameters` for proper LZ-string compression.
296
172
  */
297
- declare function Admonition({ type, title, children, className, ...rest }: AdmonitionProps): react_jsx_runtime.JSX.Element;
298
- declare const Note: (props: Omit<AdmonitionProps, "type">) => react_jsx_runtime.JSX.Element;
299
- declare const Tip: (props: Omit<AdmonitionProps, "type">) => react_jsx_runtime.JSX.Element;
300
- declare const Warning: (props: Omit<AdmonitionProps, "type">) => react_jsx_runtime.JSX.Element;
301
- declare const Danger: (props: Omit<AdmonitionProps, "type">) => react_jsx_runtime.JSX.Element;
302
- declare const InfoBox: (props: Omit<AdmonitionProps, "type">) => react_jsx_runtime.JSX.Element;
303
-
304
- interface ListProps extends React.HTMLAttributes<HTMLUListElement> {
305
- /** Visual variant */
306
- variant?: "checked" | "arrow" | "default";
307
- children: React.ReactNode;
308
- }
173
+ declare function defineSandbox(options: SandboxOptions): {
174
+ parameters: string;
175
+ url: string;
176
+ options: SandboxOptions;
177
+ };
309
178
  /**
310
- * Enhanced list component with icon variants.
179
+ * CORE API: Open a CodeSandbox using a form POST to the Define API.
311
180
  *
312
- * ```mdx
313
- * <List variant="checked">
314
- * <li>File-system routing</li>
315
- * <li>MDX support</li>
316
- * <li>Syntax highlighting</li>
317
- * </List>
318
- * ```
319
- */
320
- declare function List({ variant, children, className, ...rest }: ListProps): react_jsx_runtime.JSX.Element;
321
-
322
- interface FileTreeProps {
323
- children: React.ReactNode;
324
- }
181
+ * Uses a hidden form + POST which avoids URL length limits and is the
182
+ * recommended approach from CodeSandbox documentation. The SDK's
183
+ * `getParameters` handles LZ-string compression internally.
184
+ */
185
+ declare function openSandbox(options: SandboxOptions): {
186
+ parameters: string;
187
+ url: string;
188
+ options: SandboxOptions;
189
+ };
325
190
  /**
326
- * FileTree component displays a customized, styled tree structure for markdown lists.
191
+ * Generate an embeddable iframe URL for a CodeSandbox.
192
+ *
193
+ * This gives you more control than `openSandbox` — you can embed the sandbox
194
+ * inline on the page rather than opening a new tab. The returned URL can be
195
+ * used as the `src` of an `<iframe>`.
327
196
  *
328
- * ```mdx
329
- * <FileTree>
330
- * - src/
331
- * - index.ts
332
- * - components/
333
- * - Button.tsx
334
- * - package.json
335
- * </FileTree>
197
+ * @example
198
+ * ```tsx
199
+ * const url = embedSandbox({
200
+ * files: { "index.js": { content: "console.log('hello')" } },
201
+ * embed: { view: "editor", theme: "dark" },
202
+ * }).url;
203
+ * // url → "https://codesandbox.io/api/v1/sandboxes/define?parameters=…&embed=1&view=editor&theme=dark"
336
204
  * ```
337
205
  */
338
- declare function FileTree({ children }: FileTreeProps): react_jsx_runtime.JSX.Element;
339
-
340
- interface TableProps {
341
- headers?: string[];
342
- data?: (string | React.ReactNode)[][];
343
- children?: React.ReactNode;
344
- className?: string;
345
- sortable?: boolean;
346
- paginated?: boolean;
347
- pageSize?: number;
348
- }
349
- declare function Table({ headers, data, children, className, sortable, paginated, pageSize, }: TableProps): react_jsx_runtime.JSX.Element;
350
-
351
- interface FieldProps {
352
- /** The name of the property or field */
353
- name: string;
354
- /** The data type of the field (e.g., "string", "number", "boolean") */
355
- type?: string;
356
- /** The default value if not provided */
357
- defaultValue?: string;
358
- /** Whether the field is required */
359
- required?: boolean;
360
- /** Description or additional content */
361
- children: React.ReactNode;
362
- /** Optional anchor ID for linking */
363
- id?: string;
364
- /** Optional extra class name */
365
- className?: string;
366
- }
367
- /**
368
- * A highly aesthetic and readable component for documenting API fields/properties.
369
- */
370
- declare function Field({ name, type, defaultValue, required, children, id, className, }: FieldProps): react_jsx_runtime.JSX.Element;
206
+ declare function embedSandbox(options: SandboxOptions): {
207
+ parameters: string;
208
+ url: string;
209
+ options: SandboxOptions;
210
+ };
371
211
 
372
- export { Admonition, type AdmonitionProps, Badge, type BadgeProps, BoltdocsConfig, Breadcrumbs, Button, type ButtonProps, Card, type CardProps, Cards, type CardsProps, CodeBlock, ComponentRoute, CreateBoltdocsAppOptions, Danger, Field, type FieldProps, FileTree, type FileTreeProps, Head, InfoBox, List, type ListProps, Loading, Navbar, NotFound, Note, OnThisPage, Playground, Sidebar, Tab, type TabProps, Table, type TableProps, Tabs, type TabsProps, ThemeLayout, Tip, Video, Warning, createBoltdocsApp };
212
+ export { BoltdocsConfig, Breadcrumbs, ComponentRoute, CreateBoltdocsAppOptions, DefaultLayout, DocsLayout, ErrorBoundary, Head, Loading, Navbar, NotFound, OnThisPage, PageNav, ProgressBar, SandboxOptions, Sidebar, createBoltdocsApp, defineSandbox, embedSandbox, openSandbox, useConfig, useMdxComponents, useTheme };