boltdocs 1.10.2 → 1.11.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 (225) hide show
  1. package/package.json +29 -7
  2. package/src/client/app/config-context.tsx +18 -0
  3. package/src/client/app/docs-layout.tsx +14 -0
  4. package/src/client/app/index.tsx +132 -260
  5. package/src/client/app/mdx-component.tsx +52 -0
  6. package/src/client/app/mdx-components-context.tsx +23 -0
  7. package/src/client/app/mdx-page.tsx +20 -0
  8. package/src/client/app/preload.tsx +38 -30
  9. package/src/client/app/router.tsx +30 -0
  10. package/src/client/app/scroll-handler.tsx +40 -0
  11. package/src/client/app/theme-context.tsx +75 -0
  12. package/src/client/components/default-layout.tsx +80 -0
  13. package/src/client/components/docs-layout.tsx +105 -0
  14. package/src/client/components/icons-dev.tsx +74 -0
  15. package/src/client/components/mdx/admonition.tsx +107 -0
  16. package/src/client/components/mdx/badge.tsx +41 -0
  17. package/src/client/components/mdx/button.tsx +35 -0
  18. package/src/client/components/mdx/card.tsx +124 -0
  19. package/src/client/components/mdx/code-block.tsx +119 -0
  20. package/src/client/components/mdx/component-preview.tsx +47 -0
  21. package/src/client/components/mdx/component-props.tsx +83 -0
  22. package/src/client/components/mdx/field.tsx +66 -0
  23. package/src/client/components/mdx/file-tree.tsx +287 -0
  24. package/src/client/components/mdx/hooks/use-code-block.ts +56 -0
  25. package/src/client/components/mdx/hooks/use-component-preview.ts +16 -0
  26. package/src/client/components/mdx/hooks/useTable.ts +74 -0
  27. package/src/client/components/mdx/hooks/useTabs.ts +68 -0
  28. package/src/client/components/mdx/image.tsx +23 -0
  29. package/src/client/components/mdx/index.ts +53 -0
  30. package/src/client/components/mdx/link.tsx +38 -0
  31. package/src/client/components/mdx/list.tsx +192 -0
  32. package/src/client/components/mdx/table.tsx +156 -0
  33. package/src/client/components/mdx/tabs.tsx +135 -0
  34. package/src/client/components/mdx/video.tsx +68 -0
  35. package/src/client/components/primitives/breadcrumbs.tsx +79 -0
  36. package/src/client/components/primitives/button-group.tsx +54 -0
  37. package/src/client/components/primitives/button.tsx +145 -0
  38. package/src/client/components/primitives/helpers/observer.ts +120 -0
  39. package/src/client/components/primitives/index.ts +17 -0
  40. package/src/client/components/primitives/link.tsx +122 -0
  41. package/src/client/components/primitives/menu.tsx +159 -0
  42. package/src/client/components/primitives/navbar.tsx +359 -0
  43. package/src/client/components/primitives/navigation-menu.tsx +116 -0
  44. package/src/client/components/primitives/on-this-page.tsx +461 -0
  45. package/src/client/components/primitives/page-nav.tsx +87 -0
  46. package/src/client/components/primitives/popover.tsx +47 -0
  47. package/src/client/components/primitives/search-dialog.tsx +183 -0
  48. package/src/client/components/primitives/sidebar.tsx +154 -0
  49. package/src/client/components/primitives/tabs.tsx +90 -0
  50. package/src/client/components/primitives/tooltip.tsx +83 -0
  51. package/src/client/components/primitives/types.ts +11 -0
  52. package/src/client/components/ui-base/breadcrumbs.tsx +42 -0
  53. package/src/client/components/ui-base/copy-markdown.tsx +112 -0
  54. package/src/client/components/ui-base/error-boundary.tsx +52 -0
  55. package/src/client/components/ui-base/github-stars.tsx +27 -0
  56. package/src/client/components/ui-base/head.tsx +69 -0
  57. package/src/client/components/ui-base/loading.tsx +87 -0
  58. package/src/client/components/ui-base/navbar.tsx +138 -0
  59. package/src/client/components/ui-base/not-found.tsx +24 -0
  60. package/src/client/components/ui-base/on-this-page.tsx +152 -0
  61. package/src/client/components/ui-base/page-nav.tsx +39 -0
  62. package/src/client/components/ui-base/powered-by.tsx +19 -0
  63. package/src/client/components/ui-base/progress-bar.tsx +67 -0
  64. package/src/client/components/ui-base/search-dialog.tsx +82 -0
  65. package/src/client/components/ui-base/sidebar.tsx +104 -0
  66. package/src/client/components/ui-base/tabs.tsx +65 -0
  67. package/src/client/components/ui-base/theme-toggle.tsx +32 -0
  68. package/src/client/hooks/index.ts +12 -0
  69. package/src/client/hooks/use-breadcrumbs.ts +22 -0
  70. package/src/client/hooks/use-i18n.ts +84 -0
  71. package/src/client/hooks/use-localized-to.ts +95 -0
  72. package/src/client/hooks/use-location.ts +5 -0
  73. package/src/client/hooks/use-navbar.ts +60 -0
  74. package/src/client/hooks/use-onthispage.ts +23 -0
  75. package/src/client/hooks/use-page-nav.ts +22 -0
  76. package/src/client/hooks/use-routes.ts +72 -0
  77. package/src/client/hooks/use-search.ts +71 -0
  78. package/src/client/hooks/use-sidebar.ts +49 -0
  79. package/src/client/hooks/use-tabs.ts +43 -0
  80. package/src/client/hooks/use-version.ts +78 -0
  81. package/src/client/index.ts +55 -17
  82. package/src/client/integrations/codesandbox.ts +179 -0
  83. package/src/client/ssr.tsx +27 -16
  84. package/src/client/theme/neutral.css +360 -0
  85. package/src/client/types.ts +131 -27
  86. package/src/client/utils/cn.ts +6 -0
  87. package/src/client/utils/copy-clipboard.ts +22 -0
  88. package/src/client/utils/get-base-file-path.ts +21 -0
  89. package/src/client/utils/github.ts +121 -0
  90. package/src/client/utils/use-on-change.ts +15 -0
  91. package/src/client/virtual.d.ts +24 -0
  92. package/src/node/cache.ts +156 -156
  93. package/src/node/config.ts +159 -103
  94. package/src/node/index.ts +13 -13
  95. package/src/node/mdx.ts +213 -61
  96. package/src/node/plugin/entry.ts +29 -18
  97. package/src/node/plugin/html.ts +11 -11
  98. package/src/node/plugin/index.ts +161 -83
  99. package/src/node/plugin/types.ts +2 -4
  100. package/src/node/routes/cache.ts +6 -6
  101. package/src/node/routes/index.ts +206 -113
  102. package/src/node/routes/parser.ts +106 -81
  103. package/src/node/routes/sorter.ts +15 -15
  104. package/src/node/routes/types.ts +24 -24
  105. package/src/node/ssg/index.ts +46 -46
  106. package/src/node/ssg/meta.ts +4 -4
  107. package/src/node/ssg/options.ts +5 -5
  108. package/src/node/ssg/sitemap.ts +14 -14
  109. package/src/node/utils.ts +31 -31
  110. package/tsconfig.json +25 -20
  111. package/tsup.config.ts +23 -14
  112. package/dist/PackageManagerTabs-NVT7G625.mjs +0 -99
  113. package/dist/SearchDialog-AGVF6JBO.mjs +0 -194
  114. package/dist/SearchDialog-YPDOM7Q6.css +0 -2847
  115. package/dist/Video-KNTY5BNO.mjs +0 -6
  116. package/dist/cache-KNL5B4EE.mjs +0 -12
  117. package/dist/chunk-7SFUJWTB.mjs +0 -211
  118. package/dist/chunk-FFBNU6IJ.mjs +0 -386
  119. package/dist/chunk-FMTOYQLO.mjs +0 -37
  120. package/dist/chunk-TKLQWU7H.mjs +0 -1920
  121. package/dist/chunk-Z7JHYNAS.mjs +0 -57
  122. package/dist/client/index.css +0 -2847
  123. package/dist/client/index.d.mts +0 -372
  124. package/dist/client/index.d.ts +0 -372
  125. package/dist/client/index.js +0 -3630
  126. package/dist/client/index.mjs +0 -697
  127. package/dist/client/ssr.css +0 -2847
  128. package/dist/client/ssr.d.mts +0 -27
  129. package/dist/client/ssr.d.ts +0 -27
  130. package/dist/client/ssr.js +0 -2928
  131. package/dist/client/ssr.mjs +0 -33
  132. package/dist/config-BsFQ-ErD.d.mts +0 -159
  133. package/dist/config-BsFQ-ErD.d.ts +0 -159
  134. package/dist/node/index.d.mts +0 -91
  135. package/dist/node/index.d.ts +0 -91
  136. package/dist/node/index.js +0 -1187
  137. package/dist/node/index.mjs +0 -762
  138. package/dist/types-Dj-bfnC3.d.mts +0 -74
  139. package/dist/types-Dj-bfnC3.d.ts +0 -74
  140. package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -61
  141. package/src/client/theme/components/CodeBlock/index.ts +0 -1
  142. package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +0 -131
  143. package/src/client/theme/components/PackageManagerTabs/index.ts +0 -1
  144. package/src/client/theme/components/PackageManagerTabs/pkg-tabs.css +0 -64
  145. package/src/client/theme/components/Playground/Playground.tsx +0 -180
  146. package/src/client/theme/components/Playground/index.ts +0 -1
  147. package/src/client/theme/components/Playground/playground.css +0 -238
  148. package/src/client/theme/components/Video/Video.tsx +0 -84
  149. package/src/client/theme/components/Video/index.ts +0 -1
  150. package/src/client/theme/components/Video/video.css +0 -41
  151. package/src/client/theme/components/mdx/Admonition.tsx +0 -80
  152. package/src/client/theme/components/mdx/Badge.tsx +0 -31
  153. package/src/client/theme/components/mdx/Button.tsx +0 -50
  154. package/src/client/theme/components/mdx/Card.tsx +0 -80
  155. package/src/client/theme/components/mdx/Field.tsx +0 -60
  156. package/src/client/theme/components/mdx/FileTree.tsx +0 -229
  157. package/src/client/theme/components/mdx/List.tsx +0 -57
  158. package/src/client/theme/components/mdx/Table.tsx +0 -151
  159. package/src/client/theme/components/mdx/Tabs.tsx +0 -123
  160. package/src/client/theme/components/mdx/index.ts +0 -27
  161. package/src/client/theme/components/mdx/mdx-components.css +0 -764
  162. package/src/client/theme/icons/bun.tsx +0 -62
  163. package/src/client/theme/icons/deno.tsx +0 -20
  164. package/src/client/theme/icons/discord.tsx +0 -12
  165. package/src/client/theme/icons/github.tsx +0 -15
  166. package/src/client/theme/icons/npm.tsx +0 -13
  167. package/src/client/theme/icons/pnpm.tsx +0 -72
  168. package/src/client/theme/icons/twitter.tsx +0 -12
  169. package/src/client/theme/styles/markdown.css +0 -394
  170. package/src/client/theme/styles/variables.css +0 -175
  171. package/src/client/theme/styles.css +0 -39
  172. package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +0 -68
  173. package/src/client/theme/ui/Breadcrumbs/index.ts +0 -1
  174. package/src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx +0 -82
  175. package/src/client/theme/ui/CopyMarkdown/copy-markdown.css +0 -112
  176. package/src/client/theme/ui/CopyMarkdown/index.ts +0 -1
  177. package/src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx +0 -50
  178. package/src/client/theme/ui/ErrorBoundary/error-boundary.css +0 -55
  179. package/src/client/theme/ui/ErrorBoundary/index.ts +0 -1
  180. package/src/client/theme/ui/Footer/footer.css +0 -32
  181. package/src/client/theme/ui/Head/Head.tsx +0 -69
  182. package/src/client/theme/ui/Head/index.ts +0 -1
  183. package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +0 -125
  184. package/src/client/theme/ui/LanguageSwitcher/index.ts +0 -1
  185. package/src/client/theme/ui/LanguageSwitcher/language-switcher.css +0 -98
  186. package/src/client/theme/ui/Layout/Layout.tsx +0 -203
  187. package/src/client/theme/ui/Layout/base.css +0 -106
  188. package/src/client/theme/ui/Layout/index.ts +0 -2
  189. package/src/client/theme/ui/Layout/pagination.css +0 -72
  190. package/src/client/theme/ui/Layout/responsive.css +0 -47
  191. package/src/client/theme/ui/Link/Link.tsx +0 -392
  192. package/src/client/theme/ui/Link/LinkPreview.tsx +0 -59
  193. package/src/client/theme/ui/Link/index.ts +0 -2
  194. package/src/client/theme/ui/Link/link-preview.css +0 -48
  195. package/src/client/theme/ui/Loading/Loading.tsx +0 -10
  196. package/src/client/theme/ui/Loading/index.ts +0 -1
  197. package/src/client/theme/ui/Loading/loading.css +0 -30
  198. package/src/client/theme/ui/Navbar/GithubStars.tsx +0 -27
  199. package/src/client/theme/ui/Navbar/Navbar.tsx +0 -193
  200. package/src/client/theme/ui/Navbar/Tabs.tsx +0 -99
  201. package/src/client/theme/ui/Navbar/index.ts +0 -2
  202. package/src/client/theme/ui/Navbar/navbar.css +0 -347
  203. package/src/client/theme/ui/NotFound/NotFound.tsx +0 -19
  204. package/src/client/theme/ui/NotFound/index.ts +0 -1
  205. package/src/client/theme/ui/NotFound/not-found.css +0 -64
  206. package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +0 -244
  207. package/src/client/theme/ui/OnThisPage/index.ts +0 -1
  208. package/src/client/theme/ui/OnThisPage/toc.css +0 -152
  209. package/src/client/theme/ui/PoweredBy/PoweredBy.tsx +0 -18
  210. package/src/client/theme/ui/PoweredBy/index.ts +0 -1
  211. package/src/client/theme/ui/PoweredBy/powered-by.css +0 -76
  212. package/src/client/theme/ui/ProgressBar/ProgressBar.css +0 -17
  213. package/src/client/theme/ui/ProgressBar/ProgressBar.tsx +0 -51
  214. package/src/client/theme/ui/ProgressBar/index.ts +0 -1
  215. package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +0 -209
  216. package/src/client/theme/ui/SearchDialog/index.ts +0 -1
  217. package/src/client/theme/ui/SearchDialog/search.css +0 -152
  218. package/src/client/theme/ui/Sidebar/Sidebar.tsx +0 -244
  219. package/src/client/theme/ui/Sidebar/index.ts +0 -1
  220. package/src/client/theme/ui/Sidebar/sidebar.css +0 -230
  221. package/src/client/theme/ui/ThemeToggle/ThemeToggle.tsx +0 -69
  222. package/src/client/theme/ui/ThemeToggle/index.ts +0 -1
  223. package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +0 -136
  224. package/src/client/theme/ui/VersionSwitcher/index.ts +0 -1
  225. package/src/client/utils.ts +0 -49
@@ -1,193 +0,0 @@
1
- import React, { Suspense, lazy } from "react";
2
- import { Link, useLocation } from "react-router-dom";
3
- import { ChevronDown } from "lucide-react";
4
- import { BoltdocsConfig } from "../../../../node/config";
5
- import { ComponentRoute } from "../../../types";
6
- import { LanguageSwitcher } from "../LanguageSwitcher";
7
- import { VersionSwitcher } from "../VersionSwitcher";
8
- import { ThemeToggle } from "../ThemeToggle";
9
- import { Discord } from "../../icons/discord";
10
- import { XformerlyTwitter } from "../../icons/twitter";
11
- import { GithubStars } from "./GithubStars";
12
- import { Tabs } from "./Tabs";
13
-
14
- const SearchDialog = lazy(() =>
15
- import("../SearchDialog").then((m) => ({ default: m.SearchDialog })),
16
- );
17
-
18
- const ICON_MAP: Record<string, React.FC> = {
19
- discord: Discord,
20
- x: XformerlyTwitter,
21
- };
22
-
23
- function formatStars(stars: number) {
24
- if (stars >= 1000) {
25
- return (stars / 1000).toFixed(1) + "K";
26
- }
27
- return stars.toString();
28
- }
29
-
30
- /**
31
- * The top navigation bar of the documentation site.
32
- */
33
- export function Navbar({
34
- config,
35
- routes,
36
- allRoutes,
37
- currentLocale,
38
- currentVersion,
39
- }: {
40
- config: BoltdocsConfig;
41
- routes?: ComponentRoute[];
42
- allRoutes?: ComponentRoute[];
43
- currentLocale?: string;
44
- currentVersion?: string;
45
- }) {
46
- const location = useLocation();
47
- const isHomePage = location.pathname === "/";
48
- const title = config.themeConfig?.title || "Boltdocs";
49
- const navItems = config.themeConfig?.navbar || [];
50
- const socialLinks = config.themeConfig?.socialLinks || [];
51
- const hasTabs =
52
- !isHomePage &&
53
- config.themeConfig?.tabs &&
54
- config.themeConfig.tabs.length > 0;
55
-
56
- const leftItems = navItems.filter((item) => item.position !== "right");
57
- const rightItems = navItems.filter((item) => item.position === "right");
58
-
59
- const renderNavItem = (item: any, i: number) => {
60
- const text = item.label || item.text || "";
61
- const href = item.to || item.href || item.link || "";
62
- const isExternal =
63
- href.startsWith("http") || href.startsWith("//") || href.includes("://");
64
-
65
- return (
66
- <Link key={i} to={href} target={isExternal ? "_blank" : undefined}>
67
- {text}
68
- {isExternal && (
69
- <span className="navbar-external-icon">
70
- <svg
71
- viewBox="0 0 24 24"
72
- width="13"
73
- height="13"
74
- stroke="currentColor"
75
- strokeWidth="2"
76
- fill="none"
77
- strokeLinecap="round"
78
- strokeLinejoin="round"
79
- >
80
- <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
81
- <polyline points="15 3 21 3 21 9"></polyline>
82
- <line x1="10" y1="14" x2="21" y2="3"></line>
83
- </svg>
84
- </span>
85
- )}
86
- </Link>
87
- );
88
- };
89
-
90
- return (
91
- <header className={`boltdocs-navbar ${hasTabs ? "has-tabs" : ""}`}>
92
- <div
93
- className="navbar-container"
94
- style={{ height: "var(--ld-navbar-height)" }}
95
- >
96
- {/* LEFT SECTION */}
97
- <div className="navbar-left">
98
- <div className="navbar-logo">
99
- <Link to="/">
100
- {config.themeConfig?.logo ? (
101
- config.themeConfig.logo.trim().startsWith("<svg") ? (
102
- <span
103
- className="navbar-logo-svg"
104
- dangerouslySetInnerHTML={{
105
- __html: config.themeConfig.logo,
106
- }}
107
- />
108
- ) : (
109
- <img
110
- src={config.themeConfig.logo}
111
- alt={title}
112
- className="navbar-logo-img"
113
- />
114
- )
115
- ) : null}
116
- {title}
117
- </Link>
118
- </div>
119
-
120
- {config.versions && currentVersion && allRoutes ? (
121
- <VersionSwitcher
122
- versions={config.versions}
123
- currentVersion={currentVersion}
124
- currentLocale={currentLocale}
125
- allRoutes={allRoutes}
126
- />
127
- ) : config.themeConfig?.version ? (
128
- <div className="navbar-version">
129
- {config.themeConfig.version} <ChevronDown size={14} />
130
- </div>
131
- ) : null}
132
-
133
- <nav className="navbar-links" aria-label="Top Navigation Left">
134
- {leftItems.map(renderNavItem)}
135
- </nav>
136
- </div>
137
-
138
- {/* RIGHT SECTION */}
139
- <div className="navbar-right">
140
- <nav className="navbar-links" aria-label="Top Navigation Right">
141
- {rightItems.map(renderNavItem)}
142
- </nav>
143
-
144
- <Suspense fallback={<div className="navbar-search-placeholder" />}>
145
- <SearchDialog routes={routes || []} />
146
- </Suspense>
147
-
148
- {config.i18n && currentLocale && allRoutes && (
149
- <LanguageSwitcher
150
- i18n={config.i18n}
151
- currentLocale={currentLocale}
152
- allRoutes={allRoutes}
153
- />
154
- )}
155
-
156
- <ThemeToggle />
157
-
158
- {config.themeConfig?.githubRepo && (
159
- <GithubStars repo={config.themeConfig.githubRepo} />
160
- )}
161
-
162
- {/* Optional Divider if both groups have items */}
163
- {socialLinks.length > 0 && <div className="navbar-divider" />}
164
-
165
- <div className="navbar-icons">
166
- {socialLinks.map((link, i) => {
167
- const IconComp = ICON_MAP[link.icon.toLowerCase()];
168
- return (
169
- <a
170
- key={i}
171
- href={link.link}
172
- target="_blank"
173
- rel="noopener noreferrer"
174
- className="navbar-icon-btn"
175
- aria-label={link.icon}
176
- >
177
- {IconComp ? <IconComp /> : <span>{link.icon}</span>}
178
- </a>
179
- );
180
- })}
181
- </div>
182
- </div>
183
- </div>
184
-
185
- {hasTabs && config.themeConfig?.tabs && (
186
- <Tabs
187
- tabs={config.themeConfig.tabs}
188
- routes={allRoutes || routes || []}
189
- />
190
- )}
191
- </header>
192
- );
193
- }
@@ -1,99 +0,0 @@
1
- import React, { useEffect, useRef, useState } from "react";
2
- import { useLocation } from "react-router-dom";
3
- import { Link } from "../Link";
4
- import * as Icons from "lucide-react";
5
-
6
- interface TabConfig {
7
- id: string;
8
- text: string;
9
- icon?: string;
10
- }
11
-
12
- interface TabsProps {
13
- tabs: TabConfig[];
14
- routes: any[];
15
- }
16
-
17
- export function Tabs({ tabs, routes }: TabsProps) {
18
- const location = useLocation();
19
- const containerRef = useRef<HTMLDivElement>(null);
20
- const tabRefs = useRef<(HTMLAnchorElement | null)[]>([]);
21
- const [indicatorStyle, setIndicatorStyle] = useState<React.CSSProperties>({
22
- opacity: 0,
23
- transform: "translateX(0) scaleX(0)",
24
- width: 0,
25
- });
26
-
27
- const currentRoute = routes.find((r) => r.path === location.pathname);
28
- const currentTabId = currentRoute?.tab?.toLowerCase();
29
-
30
- // Find the active index - default to 0 if no tab detected
31
- const activeIndex = tabs.findIndex((tab) =>
32
- currentTabId ? currentTabId === tab.id.toLowerCase() : false
33
- );
34
-
35
- const finalActiveIndex = activeIndex === -1 ? 0 : activeIndex;
36
-
37
- useEffect(() => {
38
- const activeTab = tabRefs.current[finalActiveIndex];
39
- if (activeTab) {
40
- setIndicatorStyle({
41
- opacity: 1,
42
- width: activeTab.offsetWidth,
43
- transform: `translateX(${activeTab.offsetLeft}px)`,
44
- });
45
- }
46
- }, [finalActiveIndex, tabs, location.pathname]);
47
-
48
- if (!tabs || tabs.length === 0) return null;
49
-
50
- const renderTabIcon = (iconName?: string) => {
51
- if (!iconName) return null;
52
-
53
- if (iconName.trim().startsWith("<svg")) {
54
- return (
55
- <span
56
- className="tab-icon svg-icon"
57
- dangerouslySetInnerHTML={{ __html: iconName }}
58
- />
59
- );
60
- }
61
-
62
- const LucideIcon = (Icons as any)[iconName];
63
- if (LucideIcon) {
64
- return <LucideIcon size={16} className="tab-icon lucide-icon" />;
65
- }
66
-
67
- return <img src={iconName} alt="" className="tab-icon img-icon" />;
68
- };
69
-
70
- return (
71
- <div className="boltdocs-tabs-container">
72
- <div className="boltdocs-tabs" ref={containerRef}>
73
- {tabs.map((tab, index) => {
74
- const isActive = index === finalActiveIndex;
75
- const firstRoute = routes.find(
76
- (r) => r.tab && r.tab.toLowerCase() === tab.id.toLowerCase()
77
- );
78
- const linkTo = firstRoute ? firstRoute.path : "#";
79
-
80
- return (
81
- <Link
82
- key={tab.id}
83
- to={linkTo}
84
- ref={(el) => {
85
- tabRefs.current[index] = el;
86
- }}
87
- className={`boltdocs-tab-item ${isActive ? "active" : ""}`}
88
- >
89
- {renderTabIcon(tab.icon)}
90
- <span>{tab.text}</span>
91
- </Link>
92
- );
93
- })}
94
- {/* Sliding Indicator */}
95
- <div className="boltdocs-tab-indicator" style={indicatorStyle} />
96
- </div>
97
- </div>
98
- );
99
- }
@@ -1,2 +0,0 @@
1
- export { Navbar } from "./Navbar";
2
- export { GithubStars } from "./GithubStars";
@@ -1,347 +0,0 @@
1
- /* ═══════════════════════════════════════════════════════════
2
- NAVBAR
3
- ═══════════════════════════════════════════════════════════ */
4
- .boltdocs-navbar {
5
- display: flex;
6
- flex-direction: column;
7
- justify-content: center;
8
- background-color: var(--ld-navbar-bg);
9
- border-bottom: 1px solid var(--ld-border-subtle);
10
- position: sticky;
11
- top: 0;
12
- z-index: 100;
13
- }
14
-
15
- .boltdocs-navbar.has-tabs {
16
- --ld-header-height: 102px !important;
17
- height: 102px;
18
- }
19
-
20
- .boltdocs-navbar:not(.has-tabs) {
21
- --ld-header-height: var(--ld-navbar-height);
22
- height: var(--ld-navbar-height);
23
- }
24
-
25
- .navbar-container {
26
- display: flex;
27
- align-items: center;
28
- justify-content: space-between;
29
- width: 100%;
30
- max-width: 1440px;
31
- margin: 0 auto;
32
- padding: 0 1.5rem; /* Aligned exactly with main-container */
33
- }
34
-
35
- .navbar-logo {
36
- flex: 1;
37
- }
38
-
39
- .navbar-logo a {
40
- display: flex;
41
- align-items: center;
42
- gap: 0.5rem;
43
- font-weight: 700;
44
- font-size: 1.15rem;
45
- color: var(--ld-text-main);
46
- text-decoration: none;
47
- letter-spacing: -0.01em;
48
- }
49
-
50
- .navbar-logo a:hover {
51
- color: var(--ld-text-main);
52
- }
53
-
54
- .navbar-logo-img {
55
- height: 20px;
56
- width: auto;
57
- object-fit: contain;
58
- display: block;
59
- }
60
-
61
- .navbar-logo-svg {
62
- display: flex;
63
- align-items: center;
64
- }
65
-
66
- .navbar-logo-svg svg {
67
- height: 36px;
68
- width: auto;
69
- fill: currentColor;
70
- display: block;
71
- }
72
-
73
- .navbar-left {
74
- display: flex;
75
- align-items: center;
76
- gap: 1.25rem;
77
- }
78
-
79
- .navbar-version {
80
- display: flex;
81
- align-items: center;
82
- gap: 0.2rem;
83
- font-size: 0.75rem;
84
- font-weight: 500;
85
- color: var(--ld-text-muted);
86
- background-color: var(--ld-bg-soft);
87
- padding: 0.25rem 0.5rem;
88
- border-radius: var(--ld-radius-md);
89
- border: 1px solid var(--ld-border-subtle);
90
- cursor: pointer;
91
- transition: all 0.2s;
92
- }
93
-
94
- .navbar-version:hover {
95
- background-color: var(--ld-bg-mute);
96
- color: var(--ld-text-main);
97
- border-color: var(--ld-border-strong);
98
- }
99
-
100
- .navbar-right {
101
- display: flex;
102
- align-items: center;
103
- gap: 0.75rem;
104
- }
105
-
106
- .navbar-links {
107
- display: flex;
108
- align-items: center;
109
- gap: 0.25rem;
110
- }
111
-
112
- .navbar-links a {
113
- position: relative;
114
- padding: 0.4rem 0.75rem;
115
- color: var(--ld-text-muted);
116
- text-decoration: none;
117
- font-weight: 500;
118
- font-size: 0.875rem;
119
- border-radius: var(--ld-radius-md);
120
- transition:
121
- color 0.2s,
122
- background-color 0.2s;
123
- display: flex;
124
- align-items: center;
125
- gap: 0.35rem;
126
- }
127
-
128
- .navbar-external-icon {
129
- display: inline-flex;
130
- align-items: center;
131
- opacity: 0.6;
132
- margin-top: 1px;
133
- }
134
-
135
- .navbar-links a:hover {
136
- color: var(--ld-text-main);
137
- background-color: var(--ld-color-primary-muted);
138
- }
139
-
140
- .navbar-links a.active {
141
- color: var(--ld-color-primary);
142
- }
143
-
144
- .navbar-search {
145
- display: flex;
146
- align-items: center;
147
- gap: 0.5rem;
148
- padding: 0.35rem 0.75rem;
149
- background-color: transparent; /* Cleaner flat base */
150
- border: 1px solid transparent; /* Invisible border initially */
151
- border-radius: var(--ld-radius-full);
152
- backdrop-filter: blur(12px);
153
- -webkit-backdrop-filter: blur(12px);
154
- color: var(--ld-text-dim);
155
- font-size: 0.8125rem;
156
- min-width: 220px;
157
- cursor: pointer;
158
- transition: all 0.2s;
159
- }
160
-
161
- .navbar-search:hover {
162
- background-color: var(--ld-bg-mute);
163
- color: var(--ld-text-muted);
164
- }
165
-
166
- .navbar-search svg {
167
- width: 15px;
168
- height: 15px;
169
- opacity: 0.7;
170
- }
171
-
172
- .navbar-search kbd {
173
- margin-left: auto;
174
- padding: 0.15rem 0.4rem;
175
- font-family: var(--ld-font-sans);
176
- font-weight: 500;
177
- font-size: 0.65rem;
178
- background-color: var(--ld-bg-mute);
179
- border: 1px solid var(--ld-border-strong);
180
- border-radius: var(--ld-radius-md);
181
- color: var(--ld-text-dim);
182
- }
183
-
184
- /* ─── Github Stars Pill ────────────────────────────────── */
185
- .navbar-github-stars {
186
- display: flex;
187
- align-items: center;
188
- gap: 0.35rem;
189
- padding: 0.3rem 0.65rem;
190
- border-radius: var(--ld-radius-full);
191
- border: 1px solid var(--ld-border-subtle);
192
- background: var(--ld-bg-soft);
193
- color: var(--ld-text-muted);
194
- text-decoration: none;
195
- font-size: 0.8rem;
196
- font-weight: 500;
197
- transition: all 0.2s;
198
- }
199
-
200
- .navbar-github-stars:hover {
201
- color: var(--ld-text-main);
202
- background: var(--ld-bg-mute);
203
- border-color: var(--ld-border-strong);
204
- }
205
-
206
- .navbar-github-stars svg {
207
- width: 15px;
208
- height: 15px;
209
- }
210
-
211
- .navbar-divider {
212
- width: 1px;
213
- height: 18px;
214
- background-color: var(--ld-border-subtle);
215
- margin: 0 0.25rem;
216
- }
217
-
218
- .navbar-icons {
219
- display: flex;
220
- align-items: center;
221
- gap: 0.25rem;
222
- }
223
-
224
- .navbar-icon-btn {
225
- display: flex;
226
- align-items: center;
227
- justify-content: center;
228
- width: 2.15rem;
229
- height: 2.15rem;
230
- background: transparent;
231
- border: none;
232
- cursor: pointer;
233
- border-radius: var(--ld-radius-full);
234
- color: var(--ld-text-muted);
235
- text-decoration: none;
236
- transition:
237
- color 0.2s,
238
- background-color 0.2s;
239
- }
240
-
241
- .navbar-icon-btn:hover {
242
- color: var(--ld-text-main);
243
- background-color: var(--ld-bg-mute);
244
- }
245
-
246
- .navbar-icon-btn svg {
247
- width: 18px;
248
- height: 18px;
249
- }
250
-
251
- /* Tabs Styles */
252
- .boltdocs-tabs-container {
253
- position: relative;
254
- background: var(--ld-navbar-bg);
255
- padding: 0;
256
- height: 46px;
257
- }
258
-
259
- /* Border pseudo-element to allow indicator overlap */
260
- .boltdocs-tabs-container::after {
261
- content: "";
262
- position: absolute;
263
- bottom: 0px;
264
- left: 0;
265
- right: 0;
266
- height: 1px;
267
- background: var(--ld-border-subtle);
268
- z-index: 10;
269
- }
270
-
271
- .boltdocs-tabs {
272
- max-width: 1440px;
273
- margin: 0 auto;
274
- display: flex;
275
- gap: 2rem;
276
- overflow-x: auto;
277
- scrollbar-width: none;
278
- padding: 0 1.5rem;
279
- position: relative;
280
- height: 100%;
281
- }
282
-
283
- .boltdocs-tabs::-webkit-scrollbar {
284
- display: none;
285
- }
286
-
287
- .boltdocs-tab-item {
288
- padding: 0.85rem 0;
289
- padding-bottom: calc(0.85rem + 1px);
290
- font-size: 0.875rem;
291
- font-weight: 500;
292
- color: var(--ld-text-muted);
293
- text-decoration: none;
294
- position: relative;
295
- transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
296
- white-space: nowrap;
297
- display: flex;
298
- align-items: center;
299
- gap: 0.6rem;
300
- opacity: 0.7;
301
- z-index: 20;
302
- }
303
-
304
- .boltdocs-tab-item:hover {
305
- color: var(--ld-text-main);
306
- opacity: 1;
307
- }
308
-
309
- .tab-icon {
310
- flex-shrink: 0;
311
- display: flex;
312
- align-items: center;
313
- justify-content: center;
314
- transition: transform 0.2s ease;
315
- }
316
-
317
- .boltdocs-tab-item:hover .tab-icon {
318
- transform: translateY(-1px);
319
- }
320
-
321
- .tab-icon.lucide-icon,
322
- .tab-icon.svg-icon svg {
323
- width: 18px;
324
- height: 18px;
325
- stroke-width: 2.25px;
326
- }
327
-
328
- .boltdocs-tab-item.active {
329
- color: var(--ld-text-main);
330
- font-weight: 600;
331
- opacity: 1;
332
- text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
333
- }
334
-
335
- .boltdocs-tab-indicator {
336
- position: absolute;
337
- bottom: 0px; /* Aligned with the border pseudo-element */
338
- left: 0;
339
- height: 3px;
340
- background: var(--ld-color-primary);
341
- border-radius: 2px 2px 0 0;
342
- box-shadow: 0 -2px 15px var(--ld-color-primary-glow);
343
- transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
344
- z-index: 100; /* Higher than border pseudo-element */
345
- pointer-events: none;
346
- transform-origin: left;
347
- }
@@ -1,19 +0,0 @@
1
- import { Link } from "../Link";
2
- import { ArrowLeft } from "lucide-react";
3
-
4
- export function NotFound() {
5
- return (
6
- <div className="boltdocs-not-found">
7
- <div className="not-found-content">
8
- <span className="not-found-code">404</span>
9
- <h1 className="not-found-title">Page Not Found</h1>
10
- <p className="not-found-text">
11
- The page you're looking for doesn't exist or has been moved.
12
- </p>
13
- <Link to="/" className="not-found-link">
14
- <ArrowLeft size={16} /> Go to Home
15
- </Link>
16
- </div>
17
- </div>
18
- );
19
- }
@@ -1 +0,0 @@
1
- export { NotFound } from "./NotFound";