ardo 2.4.1 → 2.6.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 (68) hide show
  1. package/README.md +2 -2
  2. package/dist/{Features-BlVr5s_C.d.ts → FileTree-BGMcsIGZ.d.ts} +70 -13
  3. package/dist/Search-MXGJE6PQ.js +9 -0
  4. package/dist/Search-MXGJE6PQ.js.map +1 -0
  5. package/dist/{chunk-2L4ZS6W2.js → chunk-6MXVILOZ.js} +23 -14
  6. package/dist/chunk-6MXVILOZ.js.map +1 -0
  7. package/dist/{chunk-4IRLOOXV.js → chunk-7L64KVOU.js} +110 -1
  8. package/dist/chunk-7L64KVOU.js.map +1 -0
  9. package/dist/{chunk-352PJ3N7.js → chunk-ASEDNN4I.js} +54 -16
  10. package/dist/chunk-ASEDNN4I.js.map +1 -0
  11. package/dist/chunk-BHHI2BO4.js +194 -0
  12. package/dist/chunk-BHHI2BO4.js.map +1 -0
  13. package/dist/chunk-FZP2AVJL.js +43 -0
  14. package/dist/chunk-FZP2AVJL.js.map +1 -0
  15. package/dist/{chunk-O64PX2AK.js → chunk-M5VLOQYV.js} +2 -2
  16. package/dist/chunk-MJQGGJQZ.js +88 -0
  17. package/dist/chunk-MJQGGJQZ.js.map +1 -0
  18. package/dist/{chunk-FGRL2G4S.js → chunk-NBRHGTR2.js} +3 -1
  19. package/dist/chunk-NBRHGTR2.js.map +1 -0
  20. package/dist/chunk-QELSOHIY.js +46 -0
  21. package/dist/chunk-QELSOHIY.js.map +1 -0
  22. package/dist/chunk-ZPYFCNRO.js +742 -0
  23. package/dist/chunk-ZPYFCNRO.js.map +1 -0
  24. package/dist/config/index.d.ts +6 -5
  25. package/dist/config/index.js +3 -1
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.js +22 -13
  28. package/dist/mdx/provider.js +4 -2
  29. package/dist/mdx/provider.js.map +1 -1
  30. package/dist/runtime/index.d.ts +10 -10
  31. package/dist/runtime/index.js +10 -8
  32. package/dist/typedoc/index.d.ts +2 -0
  33. package/dist/typedoc/index.js +2 -2
  34. package/dist/{types-tjxB5eh7.d.ts → types-DArVCX06.d.ts} +10 -3
  35. package/dist/ui/icons/alert-triangle.svg +1 -0
  36. package/dist/ui/icons/check.svg +1 -0
  37. package/dist/ui/icons/chevron-down.svg +1 -0
  38. package/dist/ui/icons/copy.svg +1 -0
  39. package/dist/ui/icons/file-text.svg +1 -0
  40. package/dist/ui/icons/folder.svg +1 -0
  41. package/dist/ui/icons/github.svg +1 -0
  42. package/dist/ui/icons/info.svg +1 -0
  43. package/dist/ui/icons/lightbulb.svg +1 -0
  44. package/dist/ui/icons/linkedin.svg +1 -0
  45. package/dist/ui/icons/message-circle.svg +1 -0
  46. package/dist/ui/icons/monitor.svg +1 -0
  47. package/dist/ui/icons/moon.svg +1 -0
  48. package/dist/ui/icons/package.svg +1 -0
  49. package/dist/ui/icons/search.svg +1 -0
  50. package/dist/ui/icons/sun.svg +1 -0
  51. package/dist/ui/icons/twitter.svg +1 -0
  52. package/dist/ui/icons/x-circle.svg +1 -0
  53. package/dist/ui/icons/youtube.svg +1 -0
  54. package/dist/ui/index.d.ts +11 -7
  55. package/dist/ui/index.js +12 -4
  56. package/dist/ui/styles.css +293 -0
  57. package/dist/vite/index.d.ts +2 -2
  58. package/dist/vite/index.js +3 -3
  59. package/package.json +11 -3
  60. package/dist/chunk-2L4ZS6W2.js.map +0 -1
  61. package/dist/chunk-352PJ3N7.js.map +0 -1
  62. package/dist/chunk-4IRLOOXV.js.map +0 -1
  63. package/dist/chunk-C4W4YI7C.js +0 -812
  64. package/dist/chunk-C4W4YI7C.js.map +0 -1
  65. package/dist/chunk-EOV2OUTW.js +0 -86
  66. package/dist/chunk-EOV2OUTW.js.map +0 -1
  67. package/dist/chunk-FGRL2G4S.js.map +0 -1
  68. /package/dist/{chunk-O64PX2AK.js.map → chunk-M5VLOQYV.js.map} +0 -0
@@ -0,0 +1,742 @@
1
+ import {
2
+ Content
3
+ } from "./chunk-6MXVILOZ.js";
4
+ import {
5
+ ChevronDownIcon,
6
+ GithubIcon,
7
+ LinkedinIcon,
8
+ MessageCircleIcon,
9
+ MonitorIcon,
10
+ MoonIcon,
11
+ PackageIcon,
12
+ SunIcon,
13
+ TwitterIcon,
14
+ YoutubeIcon
15
+ } from "./chunk-MJQGGJQZ.js";
16
+ import {
17
+ useConfig,
18
+ usePageData,
19
+ useTOC,
20
+ useThemeConfig
21
+ } from "./chunk-QELSOHIY.js";
22
+
23
+ // src/ui/Layout.tsx
24
+ import { jsx, jsxs } from "react/jsx-runtime";
25
+ function Layout({ header, sidebar, footer, children, className }) {
26
+ return /* @__PURE__ */ jsxs("div", { className: className ?? "ardo-layout", children: [
27
+ /* @__PURE__ */ jsx("a", { href: "#main-content", className: "ardo-skip-link", children: "Skip to content" }),
28
+ header,
29
+ /* @__PURE__ */ jsxs("div", { className: "ardo-layout-container", children: [
30
+ sidebar,
31
+ /* @__PURE__ */ jsx("main", { id: "main-content", className: "ardo-main", children })
32
+ ] }),
33
+ footer
34
+ ] });
35
+ }
36
+
37
+ // src/ui/Header.tsx
38
+ import { useState as useState2, lazy, Suspense } from "react";
39
+ import { Link } from "react-router";
40
+
41
+ // src/ui/components/ThemeToggle.tsx
42
+ import { useState, useEffect } from "react";
43
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
44
+ function ThemeToggle() {
45
+ const [theme, setTheme] = useState("system");
46
+ const [mounted, setMounted] = useState(false);
47
+ useEffect(() => {
48
+ setMounted(true);
49
+ const stored = localStorage.getItem("ardo-theme");
50
+ if (stored) {
51
+ setTheme(stored);
52
+ applyTheme(stored);
53
+ } else {
54
+ applyTheme("system");
55
+ }
56
+ }, []);
57
+ const toggleTheme = () => {
58
+ const nextTheme = theme === "light" ? "dark" : theme === "dark" ? "system" : "light";
59
+ setTheme(nextTheme);
60
+ localStorage.setItem("ardo-theme", nextTheme);
61
+ applyTheme(nextTheme);
62
+ };
63
+ if (!mounted) {
64
+ return /* @__PURE__ */ jsx2("button", { className: "ardo-theme-toggle", "aria-label": "Toggle theme", children: /* @__PURE__ */ jsx2("span", { className: "ardo-theme-icon", children: /* @__PURE__ */ jsx2(SunIcon, { size: 20 }) }) });
65
+ }
66
+ return /* @__PURE__ */ jsx2(
67
+ "button",
68
+ {
69
+ className: "ardo-theme-toggle",
70
+ onClick: toggleTheme,
71
+ "aria-label": `Switch to ${theme === "light" ? "dark" : theme === "dark" ? "system" : "light"} theme`,
72
+ children: /* @__PURE__ */ jsxs2("span", { className: "ardo-theme-icon", children: [
73
+ theme === "light" && /* @__PURE__ */ jsx2(SunIcon, { size: 20 }),
74
+ theme === "dark" && /* @__PURE__ */ jsx2(MoonIcon, { size: 20 }),
75
+ theme === "system" && /* @__PURE__ */ jsx2(MonitorIcon, { size: 20 })
76
+ ] })
77
+ }
78
+ );
79
+ }
80
+ function applyTheme(theme) {
81
+ const root = document.documentElement;
82
+ if (theme === "system") {
83
+ const isDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
84
+ root.classList.toggle("dark", isDark);
85
+ root.classList.toggle("light", !isDark);
86
+ } else {
87
+ root.classList.toggle("dark", theme === "dark");
88
+ root.classList.toggle("light", theme === "light");
89
+ }
90
+ }
91
+
92
+ // src/ui/Header.tsx
93
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
94
+ var LazySearch = lazy(() => import("./Search-MXGJE6PQ.js").then((m) => ({ default: m.Search })));
95
+ function Header({
96
+ logo,
97
+ title,
98
+ nav,
99
+ actions,
100
+ search = true,
101
+ themeToggle = true,
102
+ className
103
+ }) {
104
+ const [mobileMenuOpen, setMobileMenuOpen] = useState2(false);
105
+ return /* @__PURE__ */ jsxs3("header", { className: className ?? "ardo-header", children: [
106
+ /* @__PURE__ */ jsxs3("div", { className: "ardo-header-container", children: [
107
+ /* @__PURE__ */ jsxs3("div", { className: "ardo-header-left", children: [
108
+ /* @__PURE__ */ jsx3(
109
+ "button",
110
+ {
111
+ className: "ardo-mobile-menu-button",
112
+ onClick: () => setMobileMenuOpen(!mobileMenuOpen),
113
+ "aria-label": "Toggle menu",
114
+ "aria-expanded": mobileMenuOpen,
115
+ children: /* @__PURE__ */ jsxs3("span", { className: "ardo-hamburger", children: [
116
+ /* @__PURE__ */ jsx3("span", {}),
117
+ /* @__PURE__ */ jsx3("span", {}),
118
+ /* @__PURE__ */ jsx3("span", {})
119
+ ] })
120
+ }
121
+ ),
122
+ /* @__PURE__ */ jsxs3(Link, { to: "/", className: "ardo-logo-link", children: [
123
+ logo && /* @__PURE__ */ jsx3(
124
+ "img",
125
+ {
126
+ src: typeof logo === "string" ? logo : logo.light,
127
+ alt: title ?? "Logo",
128
+ className: "ardo-logo"
129
+ }
130
+ ),
131
+ title && /* @__PURE__ */ jsx3("span", { className: "ardo-site-title", children: title })
132
+ ] })
133
+ ] }),
134
+ nav && /* @__PURE__ */ jsx3("div", { className: "ardo-nav", children: nav }),
135
+ /* @__PURE__ */ jsxs3("div", { className: "ardo-header-right", children: [
136
+ search && /* @__PURE__ */ jsx3(Suspense, { fallback: /* @__PURE__ */ jsx3("span", { className: "ardo-search-placeholder" }), children: /* @__PURE__ */ jsx3(LazySearch, {}) }),
137
+ themeToggle && /* @__PURE__ */ jsx3(ThemeToggle, {}),
138
+ actions
139
+ ] })
140
+ ] }),
141
+ mobileMenuOpen && /* @__PURE__ */ jsx3("div", { className: "ardo-mobile-menu", children: /* @__PURE__ */ jsx3("nav", { className: "ardo-mobile-nav", onClick: () => setMobileMenuOpen(false), children: nav }) })
142
+ ] });
143
+ }
144
+ function SocialLink({ href, icon, ariaLabel, className }) {
145
+ return /* @__PURE__ */ jsx3(
146
+ "a",
147
+ {
148
+ href,
149
+ target: "_blank",
150
+ rel: "noopener noreferrer",
151
+ className: className ?? "ardo-social-link",
152
+ "aria-label": ariaLabel ?? icon,
153
+ children: /* @__PURE__ */ jsx3(SocialIcon, { icon })
154
+ }
155
+ );
156
+ }
157
+ var socialIcons = {
158
+ github: GithubIcon,
159
+ twitter: TwitterIcon,
160
+ discord: MessageCircleIcon,
161
+ linkedin: LinkedinIcon,
162
+ youtube: YoutubeIcon,
163
+ npm: PackageIcon
164
+ };
165
+ function SocialIcon({ icon }) {
166
+ const IconComponent = socialIcons[icon] ?? GithubIcon;
167
+ return /* @__PURE__ */ jsx3(IconComponent, { size: 20 });
168
+ }
169
+
170
+ // src/ui/Sidebar.tsx
171
+ import {
172
+ useState as useState3,
173
+ Children,
174
+ isValidElement,
175
+ createContext,
176
+ useContext
177
+ } from "react";
178
+ import { NavLink, useLocation } from "react-router";
179
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
180
+ var SidebarContext = createContext({ currentPath: "" });
181
+ function useSidebarContext() {
182
+ return useContext(SidebarContext);
183
+ }
184
+ function Sidebar({ items, children, className }) {
185
+ const { pathname } = useLocation();
186
+ return /* @__PURE__ */ jsx4(SidebarContext.Provider, { value: { currentPath: pathname }, children: /* @__PURE__ */ jsx4("aside", { className: className ?? "ardo-sidebar", children: /* @__PURE__ */ jsx4("nav", { className: "ardo-sidebar-nav", "aria-label": "Main navigation", children: items ? /* @__PURE__ */ jsx4(SidebarItems, { items, depth: 0 }) : /* @__PURE__ */ jsx4("ul", { className: "ardo-sidebar-list ardo-sidebar-list-0", children }) }) }) });
187
+ }
188
+ function SidebarGroup({
189
+ title,
190
+ to,
191
+ collapsed: initialCollapsed = false,
192
+ collapsible = true,
193
+ children,
194
+ className
195
+ }) {
196
+ const [collapsed, setCollapsed] = useState3(initialCollapsed);
197
+ const { currentPath } = useSidebarContext();
198
+ const isChildActive = checkChildrenActive(children, currentPath);
199
+ const textClassName = ["ardo-sidebar-text", isChildActive && "child-active"].filter(Boolean).join(" ");
200
+ const hasChildren = Children.count(children) > 0;
201
+ return /* @__PURE__ */ jsxs4("li", { className: className ?? "ardo-sidebar-item", children: [
202
+ /* @__PURE__ */ jsxs4("div", { className: "ardo-sidebar-item-header", children: [
203
+ to ? /* @__PURE__ */ jsx4(
204
+ NavLink,
205
+ {
206
+ to,
207
+ end: true,
208
+ className: ({ isActive }) => [textClassName, isActive && "active"].filter(Boolean).join(" "),
209
+ children: title
210
+ }
211
+ ) : /* @__PURE__ */ jsx4(
212
+ "span",
213
+ {
214
+ className: textClassName,
215
+ onClick: () => collapsible && hasChildren && setCollapsed(!collapsed),
216
+ style: collapsible && hasChildren ? { cursor: "pointer" } : void 0,
217
+ children: title
218
+ }
219
+ ),
220
+ collapsible && hasChildren && /* @__PURE__ */ jsx4(
221
+ "button",
222
+ {
223
+ className: ["ardo-sidebar-collapse", collapsed && "collapsed"].filter(Boolean).join(" "),
224
+ onClick: () => setCollapsed(!collapsed),
225
+ "aria-label": collapsed ? "Expand" : "Collapse",
226
+ children: /* @__PURE__ */ jsx4(ChevronDownIcon, { size: 16 })
227
+ }
228
+ )
229
+ ] }),
230
+ hasChildren && !collapsed && /* @__PURE__ */ jsx4("ul", { className: "ardo-sidebar-list ardo-sidebar-list-1", children })
231
+ ] });
232
+ }
233
+ function SidebarLink({ to, children, className }) {
234
+ const baseClassName = className ?? "ardo-sidebar-link";
235
+ return /* @__PURE__ */ jsx4("li", { className: "ardo-sidebar-item", children: /* @__PURE__ */ jsx4(
236
+ NavLink,
237
+ {
238
+ to,
239
+ className: ({ isActive }) => [baseClassName, isActive && "active"].filter(Boolean).join(" "),
240
+ children
241
+ }
242
+ ) });
243
+ }
244
+ function SidebarItems({ items, depth }) {
245
+ return /* @__PURE__ */ jsx4("ul", { className: `ardo-sidebar-list ardo-sidebar-list-${depth}`, children: items.map((item, index) => /* @__PURE__ */ jsx4(SidebarItemComponent, { item, depth }, index)) });
246
+ }
247
+ function SidebarItemComponent({ item, depth }) {
248
+ const { currentPath } = useSidebarContext();
249
+ const [collapsed, setCollapsed] = useState3(item.collapsed ?? false);
250
+ const hasChildren = item.items && item.items.length > 0;
251
+ const isChildActive = hasChildren && item.items.some(
252
+ (child) => child.link === currentPath || child.items && child.items.some((grandchild) => grandchild.link === currentPath)
253
+ );
254
+ const linkClassName = ["ardo-sidebar-link", isChildActive && "child-active"].filter(Boolean).join(" ");
255
+ const textClassName = ["ardo-sidebar-text", isChildActive && "child-active"].filter(Boolean).join(" ");
256
+ return /* @__PURE__ */ jsxs4("li", { className: "ardo-sidebar-item", children: [
257
+ /* @__PURE__ */ jsxs4("div", { className: "ardo-sidebar-item-header", children: [
258
+ item.link ? /* @__PURE__ */ jsx4(
259
+ NavLink,
260
+ {
261
+ to: item.link,
262
+ className: ({ isActive }) => [linkClassName, isActive && "active"].filter(Boolean).join(" "),
263
+ children: item.text
264
+ }
265
+ ) : /* @__PURE__ */ jsx4("span", { className: textClassName, onClick: () => hasChildren && setCollapsed(!collapsed), children: item.text }),
266
+ hasChildren && /* @__PURE__ */ jsx4(
267
+ "button",
268
+ {
269
+ className: ["ardo-sidebar-collapse", collapsed && "collapsed"].filter(Boolean).join(" "),
270
+ onClick: () => setCollapsed(!collapsed),
271
+ "aria-label": collapsed ? "Expand" : "Collapse",
272
+ children: /* @__PURE__ */ jsx4(ChevronDownIcon, { size: 16 })
273
+ }
274
+ )
275
+ ] }),
276
+ hasChildren && !collapsed && /* @__PURE__ */ jsx4(SidebarItems, { items: item.items, depth: depth + 1 })
277
+ ] });
278
+ }
279
+ function checkChildrenActive(children, currentPath) {
280
+ let isActive = false;
281
+ Children.forEach(children, (child) => {
282
+ if (isActive) return;
283
+ if (isValidElement(child)) {
284
+ if (child.type === SidebarLink && child.props.to === currentPath) {
285
+ isActive = true;
286
+ return;
287
+ }
288
+ if (child.type === SidebarGroup) {
289
+ const groupProps = child.props;
290
+ if (groupProps.to === currentPath) {
291
+ isActive = true;
292
+ return;
293
+ }
294
+ if (groupProps.children && checkChildrenActive(groupProps.children, currentPath)) {
295
+ isActive = true;
296
+ return;
297
+ }
298
+ }
299
+ }
300
+ });
301
+ return isActive;
302
+ }
303
+
304
+ // src/ui/Footer.tsx
305
+ import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
306
+ function formatBuildTime(iso) {
307
+ try {
308
+ const date = new Date(iso);
309
+ return date.toLocaleDateString("en-US", {
310
+ month: "long",
311
+ day: "numeric",
312
+ year: "numeric"
313
+ });
314
+ } catch {
315
+ return iso;
316
+ }
317
+ }
318
+ function Footer({
319
+ message,
320
+ copyright,
321
+ children,
322
+ className,
323
+ project,
324
+ sponsor,
325
+ buildTime,
326
+ buildHash,
327
+ ardoLink = true
328
+ }) {
329
+ const hasContent = message || copyright || children || project || sponsor || buildTime || ardoLink;
330
+ if (!hasContent) {
331
+ return null;
332
+ }
333
+ return /* @__PURE__ */ jsx5("footer", { className: className ?? "ardo-footer", children: /* @__PURE__ */ jsx5("div", { className: "ardo-footer-container", children: children ?? /* @__PURE__ */ jsxs5(Fragment, { children: [
334
+ (project || ardoLink || sponsor) && /* @__PURE__ */ jsxs5("p", { className: "ardo-footer-primary", children: [
335
+ project?.name && /* @__PURE__ */ jsx5(Fragment, { children: project.homepage ? /* @__PURE__ */ jsxs5("a", { href: project.homepage, className: "ardo-footer-link", children: [
336
+ project.name,
337
+ project.version ? ` v${project.version}` : ""
338
+ ] }) : /* @__PURE__ */ jsxs5("span", { children: [
339
+ project.name,
340
+ project.version ? ` v${project.version}` : ""
341
+ ] }) }),
342
+ project?.name && ardoLink && /* @__PURE__ */ jsx5("span", { className: "ardo-footer-separator", "aria-hidden": "true" }),
343
+ ardoLink && /* @__PURE__ */ jsx5("a", { href: "https://ardo-docs.dev", className: "ardo-footer-link", children: "Built with Ardo" }),
344
+ (project?.name || ardoLink) && sponsor && /* @__PURE__ */ jsx5("span", { className: "ardo-footer-separator", "aria-hidden": "true" }),
345
+ sponsor && /* @__PURE__ */ jsxs5("a", { href: sponsor.link, className: "ardo-footer-link", children: [
346
+ "Sponsored by ",
347
+ sponsor.text
348
+ ] })
349
+ ] }),
350
+ message && /* @__PURE__ */ jsx5("p", { className: "ardo-footer-message", dangerouslySetInnerHTML: { __html: message } }),
351
+ copyright && /* @__PURE__ */ jsx5(
352
+ "p",
353
+ {
354
+ className: "ardo-footer-copyright",
355
+ dangerouslySetInnerHTML: { __html: copyright }
356
+ }
357
+ ),
358
+ buildTime && /* @__PURE__ */ jsxs5("p", { className: "ardo-footer-build-time", children: [
359
+ "Built on ",
360
+ formatBuildTime(buildTime),
361
+ buildHash && /* @__PURE__ */ jsxs5(Fragment, { children: [
362
+ " (",
363
+ buildHash,
364
+ ")"
365
+ ] })
366
+ ] })
367
+ ] }) }) });
368
+ }
369
+
370
+ // src/ui/Nav.tsx
371
+ import { useState as useState4, createContext as createContext2, useContext as useContext2 } from "react";
372
+ import { NavLink as RouterNavLink } from "react-router";
373
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
374
+ var NavContext = createContext2(null);
375
+ function useNavContext() {
376
+ return useContext2(NavContext);
377
+ }
378
+ function Nav({ children, className }) {
379
+ return /* @__PURE__ */ jsx6("nav", { className: className ?? "ardo-nav", children });
380
+ }
381
+ function NavLink2({
382
+ to,
383
+ href,
384
+ children,
385
+ className,
386
+ activeMatch: _activeMatch
387
+ }) {
388
+ const navContext = useNavContext();
389
+ const baseClassName = className ?? "ardo-nav-link";
390
+ const handleClick = () => {
391
+ navContext?.setMobileMenuOpen(false);
392
+ };
393
+ if (href) {
394
+ return /* @__PURE__ */ jsx6(
395
+ "a",
396
+ {
397
+ href,
398
+ className: baseClassName,
399
+ target: "_blank",
400
+ rel: "noopener noreferrer",
401
+ onClick: handleClick,
402
+ children
403
+ }
404
+ );
405
+ }
406
+ if (to) {
407
+ return /* @__PURE__ */ jsx6(
408
+ RouterNavLink,
409
+ {
410
+ to,
411
+ className: ({ isActive }) => [baseClassName, isActive && "active"].filter(Boolean).join(" "),
412
+ onClick: handleClick,
413
+ children
414
+ }
415
+ );
416
+ }
417
+ return /* @__PURE__ */ jsx6("span", { className: baseClassName, children });
418
+ }
419
+ function NavDropdown({ text, children, className }) {
420
+ const [open, setOpen] = useState4(false);
421
+ return /* @__PURE__ */ jsxs6(
422
+ "div",
423
+ {
424
+ className: className ?? "ardo-nav-dropdown",
425
+ onMouseEnter: () => setOpen(true),
426
+ onMouseLeave: () => setOpen(false),
427
+ children: [
428
+ /* @__PURE__ */ jsxs6("button", { className: "ardo-nav-dropdown-button", children: [
429
+ text,
430
+ /* @__PURE__ */ jsx6("span", { className: "ardo-nav-dropdown-icon", children: "\u25BC" })
431
+ ] }),
432
+ open && /* @__PURE__ */ jsx6("div", { className: "ardo-nav-dropdown-menu", children })
433
+ ]
434
+ }
435
+ );
436
+ }
437
+
438
+ // src/ui/TOC.tsx
439
+ import { useState as useState5, useEffect as useEffect2 } from "react";
440
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
441
+ function TOC() {
442
+ const toc = useTOC();
443
+ const themeConfig = useThemeConfig();
444
+ const [activeId, setActiveId] = useState5("");
445
+ const label = themeConfig.outline?.label ?? "On this page";
446
+ useEffect2(() => {
447
+ if (toc.length === 0) return;
448
+ const headingElements = toc.map((item) => document.getElementById(item.id)).filter(Boolean);
449
+ if (headingElements.length === 0) return;
450
+ const observer = new IntersectionObserver(
451
+ (entries) => {
452
+ for (const entry of entries) {
453
+ if (entry.isIntersecting) {
454
+ setActiveId(entry.target.id);
455
+ break;
456
+ }
457
+ }
458
+ },
459
+ {
460
+ rootMargin: "-80px 0px -80% 0px",
461
+ threshold: 0
462
+ }
463
+ );
464
+ headingElements.forEach((el) => el && observer.observe(el));
465
+ return () => {
466
+ headingElements.forEach((el) => el && observer.unobserve(el));
467
+ };
468
+ }, [toc]);
469
+ if (toc.length === 0) {
470
+ return null;
471
+ }
472
+ return /* @__PURE__ */ jsx7("aside", { className: "ardo-toc", children: /* @__PURE__ */ jsxs7("div", { className: "ardo-toc-container", children: [
473
+ /* @__PURE__ */ jsx7("h3", { className: "ardo-toc-title", children: label }),
474
+ /* @__PURE__ */ jsx7("nav", { className: "ardo-toc-nav", "aria-label": "Table of contents", children: /* @__PURE__ */ jsx7(TOCItems, { items: toc, activeId }) })
475
+ ] }) });
476
+ }
477
+ function TOCItems({ items, activeId }) {
478
+ return /* @__PURE__ */ jsx7("ul", { className: "ardo-toc-list", children: items.map((item) => /* @__PURE__ */ jsx7(TOCItemComponent, { item, activeId }, item.id)) });
479
+ }
480
+ function TOCItemComponent({ item, activeId }) {
481
+ const isActive = item.id === activeId;
482
+ const hasActiveChild = hasActiveDescendant(item, activeId);
483
+ return /* @__PURE__ */ jsxs7("li", { className: "ardo-toc-item", children: [
484
+ /* @__PURE__ */ jsx7(
485
+ "a",
486
+ {
487
+ href: `#${item.id}`,
488
+ className: [
489
+ `ardo-toc-link ardo-toc-link-${item.level}`,
490
+ isActive && "active",
491
+ hasActiveChild && "child-active"
492
+ ].filter(Boolean).join(" "),
493
+ onClick: (e) => {
494
+ e.preventDefault();
495
+ const element = document.getElementById(item.id);
496
+ if (element) {
497
+ element.scrollIntoView({ behavior: "smooth" });
498
+ window.history.pushState(null, "", `#${item.id}`);
499
+ }
500
+ },
501
+ children: item.text
502
+ }
503
+ ),
504
+ item.children && item.children.length > 0 && /* @__PURE__ */ jsx7(TOCItems, { items: item.children, activeId })
505
+ ] });
506
+ }
507
+ function hasActiveDescendant(item, activeId) {
508
+ if (!item.children) return false;
509
+ for (const child of item.children) {
510
+ if (child.id === activeId) return true;
511
+ if (hasActiveDescendant(child, activeId)) return true;
512
+ }
513
+ return false;
514
+ }
515
+
516
+ // src/ui/DocPage.tsx
517
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
518
+ function DocPage({ children }) {
519
+ const pageData = usePageData();
520
+ const showToc = pageData?.frontmatter.outline !== false && pageData?.toc && pageData.toc.length > 0;
521
+ return /* @__PURE__ */ jsx8(Layout, { children: /* @__PURE__ */ jsxs8("div", { className: "ardo-doc-page", children: [
522
+ /* @__PURE__ */ jsx8(Content, { children }),
523
+ showToc && /* @__PURE__ */ jsx8(TOC, {})
524
+ ] }) });
525
+ }
526
+ function DocContent({ children }) {
527
+ const pageData = usePageData();
528
+ const showToc = pageData?.frontmatter.outline !== false && pageData?.toc && pageData.toc.length > 0;
529
+ return /* @__PURE__ */ jsxs8("div", { className: "ardo-doc-page", children: [
530
+ /* @__PURE__ */ jsx8(Content, { children }),
531
+ showToc && /* @__PURE__ */ jsx8(TOC, {})
532
+ ] });
533
+ }
534
+ function DocLayout({ content }) {
535
+ return /* @__PURE__ */ jsx8(DocPage, { children: content });
536
+ }
537
+
538
+ // src/ui/HomePage.tsx
539
+ import { Link as Link2 } from "react-router";
540
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
541
+ function HomePage() {
542
+ const pageData = usePageData();
543
+ const config = useConfig();
544
+ const themeConfig = useThemeConfig();
545
+ const hero = pageData?.frontmatter.hero;
546
+ const features = pageData?.frontmatter.features;
547
+ return /* @__PURE__ */ jsxs9("div", { className: "ardo-home", children: [
548
+ /* @__PURE__ */ jsx9(
549
+ Header,
550
+ {
551
+ logo: themeConfig.logo,
552
+ title: themeConfig.siteTitle !== false ? config.title : void 0,
553
+ nav: themeConfig.nav && themeConfig.nav.length > 0 ? /* @__PURE__ */ jsx9(Nav, { children: themeConfig.nav.map((item, index) => /* @__PURE__ */ jsx9(NavLink2, { to: item.link, children: item.text }, index)) }) : void 0,
554
+ actions: themeConfig.socialLinks?.map((link, index) => /* @__PURE__ */ jsx9(SocialLink, { href: link.link, icon: link.icon, ariaLabel: link.ariaLabel }, index))
555
+ }
556
+ ),
557
+ /* @__PURE__ */ jsxs9("main", { className: "ardo-home-main", children: [
558
+ hero && /* @__PURE__ */ jsx9("section", { className: "ardo-hero", children: /* @__PURE__ */ jsxs9("div", { className: "ardo-hero-container", children: [
559
+ hero.image && /* @__PURE__ */ jsx9("div", { className: "ardo-hero-image", children: /* @__PURE__ */ jsx9(
560
+ "img",
561
+ {
562
+ src: typeof hero.image === "string" ? hero.image : hero.image.light,
563
+ alt: hero.name || config.title
564
+ }
565
+ ) }),
566
+ /* @__PURE__ */ jsxs9("div", { className: "ardo-hero-content", children: [
567
+ hero.name && /* @__PURE__ */ jsx9("h1", { className: "ardo-hero-name", children: hero.name }),
568
+ hero.text && /* @__PURE__ */ jsx9("p", { className: "ardo-hero-text", children: hero.text }),
569
+ hero.tagline && /* @__PURE__ */ jsx9("p", { className: "ardo-hero-tagline", children: hero.tagline }),
570
+ hero.actions && hero.actions.length > 0 && /* @__PURE__ */ jsx9("div", { className: "ardo-hero-actions", children: hero.actions.map((action, index) => /* @__PURE__ */ jsx9(
571
+ Link2,
572
+ {
573
+ to: action.link,
574
+ className: `ardo-hero-action ardo-hero-action-${action.theme || "brand"}`,
575
+ children: action.text
576
+ },
577
+ index
578
+ )) })
579
+ ] })
580
+ ] }) }),
581
+ features && features.length > 0 && /* @__PURE__ */ jsx9("section", { className: "ardo-features", children: /* @__PURE__ */ jsx9("div", { className: "ardo-features-container", children: features.map((feature, index) => /* @__PURE__ */ jsxs9("div", { className: "ardo-feature", children: [
582
+ feature.icon && /* @__PURE__ */ jsx9("div", { className: "ardo-feature-icon", children: feature.icon }),
583
+ /* @__PURE__ */ jsx9("h3", { className: "ardo-feature-title", children: feature.title }),
584
+ /* @__PURE__ */ jsx9("p", { className: "ardo-feature-details", children: feature.details }),
585
+ feature.link && /* @__PURE__ */ jsx9(Link2, { to: feature.link, className: "ardo-feature-link", children: feature.linkText || "Learn more" })
586
+ ] }, index)) }) })
587
+ ] }),
588
+ /* @__PURE__ */ jsx9(Footer, {})
589
+ ] });
590
+ }
591
+
592
+ // src/ui/components/Hero.tsx
593
+ import { Link as Link3 } from "react-router";
594
+ import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
595
+ function Hero({ name, text, tagline, image, actions, className, version }) {
596
+ const imageUrl = typeof image === "string" ? image : image?.light;
597
+ const imageAlt = typeof image === "string" ? name : image?.alt ?? name;
598
+ return /* @__PURE__ */ jsx10("section", { className: className ?? "ardo-hero", children: /* @__PURE__ */ jsxs10("div", { className: "ardo-hero-container ardo-hero-animate", children: [
599
+ image && /* @__PURE__ */ jsx10("div", { className: "ardo-hero-image", children: /* @__PURE__ */ jsx10("img", { src: imageUrl, alt: imageAlt }) }),
600
+ /* @__PURE__ */ jsxs10("div", { className: "ardo-hero-content", children: [
601
+ version && /* @__PURE__ */ jsxs10("span", { className: "ardo-hero-version", children: [
602
+ "v",
603
+ version
604
+ ] }),
605
+ name && /* @__PURE__ */ jsx10("h1", { className: "ardo-hero-name", children: name }),
606
+ text && /* @__PURE__ */ jsx10("p", { className: "ardo-hero-text", children: text }),
607
+ tagline && /* @__PURE__ */ jsx10("p", { className: "ardo-hero-tagline", children: tagline }),
608
+ actions && actions.length > 0 && /* @__PURE__ */ jsx10("div", { className: "ardo-hero-actions", children: actions.map((action, index) => {
609
+ const link = action.link;
610
+ const isExternal = typeof link === "string" && (link.startsWith("http://") || link.startsWith("https://"));
611
+ const className2 = `ardo-hero-action ardo-hero-action-${action.theme || "brand"}`;
612
+ const content = /* @__PURE__ */ jsxs10(Fragment2, { children: [
613
+ action.icon,
614
+ action.text
615
+ ] });
616
+ if (isExternal) {
617
+ return /* @__PURE__ */ jsx10(
618
+ "a",
619
+ {
620
+ href: link,
621
+ className: className2,
622
+ target: "_blank",
623
+ rel: "noopener noreferrer",
624
+ children: content
625
+ },
626
+ index
627
+ );
628
+ }
629
+ return /* @__PURE__ */ jsx10(Link3, { to: link, className: className2, children: content }, index);
630
+ }) })
631
+ ] })
632
+ ] }) });
633
+ }
634
+
635
+ // src/ui/components/Features.tsx
636
+ import { Link as Link4 } from "react-router";
637
+ import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
638
+ function FeatureCard({
639
+ title,
640
+ icon,
641
+ details,
642
+ link,
643
+ linkText,
644
+ className,
645
+ style
646
+ }) {
647
+ return /* @__PURE__ */ jsxs11("div", { className: className ?? "ardo-feature", style, children: [
648
+ icon && /* @__PURE__ */ jsx11("div", { className: "ardo-feature-icon", children: icon }),
649
+ /* @__PURE__ */ jsx11("h3", { className: "ardo-feature-title", children: title }),
650
+ /* @__PURE__ */ jsx11("p", { className: "ardo-feature-details", children: details }),
651
+ link && /* @__PURE__ */ jsx11(Link4, { to: link, className: "ardo-feature-link", children: linkText || "Learn more" })
652
+ ] });
653
+ }
654
+ function Features({ items, title, subtitle, className }) {
655
+ if (!items || items.length === 0) {
656
+ return null;
657
+ }
658
+ return /* @__PURE__ */ jsxs11("section", { className: className ?? "ardo-features", children: [
659
+ (title || subtitle) && /* @__PURE__ */ jsxs11("div", { className: "ardo-features-header", children: [
660
+ title && /* @__PURE__ */ jsx11("h2", { className: "ardo-features-title", children: title }),
661
+ subtitle && /* @__PURE__ */ jsx11("p", { className: "ardo-features-subtitle", children: subtitle })
662
+ ] }),
663
+ /* @__PURE__ */ jsx11("div", { className: "ardo-features-container", children: items.map((feature, index) => /* @__PURE__ */ jsx11(FeatureCard, { ...feature, style: { animationDelay: `${index * 80}ms` } }, index)) })
664
+ ] });
665
+ }
666
+
667
+ // src/ui/components/Steps.tsx
668
+ import { jsx as jsx12 } from "react/jsx-runtime";
669
+ function Steps({ children }) {
670
+ return /* @__PURE__ */ jsx12("div", { className: "ardo-steps", children });
671
+ }
672
+
673
+ // src/ui/components/FileTree.tsx
674
+ import {
675
+ Children as Children2,
676
+ isValidElement as isValidElement2,
677
+ cloneElement
678
+ } from "react";
679
+ import { jsx as jsx13 } from "react/jsx-runtime";
680
+ function getTextContent(node) {
681
+ if (typeof node === "string") return node;
682
+ if (typeof node === "number") return String(node);
683
+ if (!isValidElement2(node)) return "";
684
+ const children = node.props.children;
685
+ if (!children) return "";
686
+ return Children2.toArray(children).map(getTextContent).join("");
687
+ }
688
+ function isDirectory(node) {
689
+ const children = node.props.children;
690
+ const childArray = Children2.toArray(children);
691
+ for (const child of childArray) {
692
+ if (isValidElement2(child) && (child.type === "ul" || child.type === "ol")) {
693
+ return true;
694
+ }
695
+ }
696
+ const text = getTextContent(node).trim();
697
+ return text.endsWith("/");
698
+ }
699
+ function processChildren(children) {
700
+ return Children2.map(children, (child) => {
701
+ if (!isValidElement2(child)) return child;
702
+ const props = child.props;
703
+ const el = child;
704
+ if (child.type === "li") {
705
+ const isDir = isDirectory(child);
706
+ const className = [props.className, isDir ? "ardo-filetree-dir" : "ardo-filetree-file"].filter(Boolean).join(" ");
707
+ return cloneElement(el, { className }, processChildren(props.children));
708
+ }
709
+ if (child.type === "ul" || child.type === "ol") {
710
+ return cloneElement(el, {}, processChildren(props.children));
711
+ }
712
+ return child;
713
+ });
714
+ }
715
+ function FileTree({ children }) {
716
+ return /* @__PURE__ */ jsx13("div", { className: "ardo-filetree", children: processChildren(children) });
717
+ }
718
+
719
+ export {
720
+ Layout,
721
+ ThemeToggle,
722
+ Header,
723
+ SocialLink,
724
+ Sidebar,
725
+ SidebarGroup,
726
+ SidebarLink,
727
+ Footer,
728
+ Nav,
729
+ NavLink2 as NavLink,
730
+ NavDropdown,
731
+ TOC,
732
+ DocPage,
733
+ DocContent,
734
+ DocLayout,
735
+ HomePage,
736
+ Hero,
737
+ FeatureCard,
738
+ Features,
739
+ Steps,
740
+ FileTree
741
+ };
742
+ //# sourceMappingURL=chunk-ZPYFCNRO.js.map