ardo 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Features-BlVr5s_C.d.ts → Features-rHF_bj67.d.ts} +27 -12
- package/dist/Search-RJRSEY42.js +9 -0
- package/dist/Search-RJRSEY42.js.map +1 -0
- package/dist/{chunk-EOV2OUTW.js → chunk-3O2PF4HA.js} +2 -42
- package/dist/chunk-3O2PF4HA.js.map +1 -0
- package/dist/{chunk-PCMPLBJA.js → chunk-5K5L7ZYS.js} +15 -16
- package/dist/chunk-5K5L7ZYS.js.map +1 -0
- package/dist/{chunk-4IRLOOXV.js → chunk-7L64KVOU.js} +110 -1
- package/dist/chunk-7L64KVOU.js.map +1 -0
- package/dist/{chunk-FGRL2G4S.js → chunk-BH7JD5XJ.js} +2 -1
- package/dist/chunk-BH7JD5XJ.js.map +1 -0
- package/dist/chunk-FZP2AVJL.js +43 -0
- package/dist/chunk-FZP2AVJL.js.map +1 -0
- package/dist/chunk-GAYGMYIS.js +194 -0
- package/dist/chunk-GAYGMYIS.js.map +1 -0
- package/dist/{chunk-O64PX2AK.js → chunk-M5VLOQYV.js} +2 -2
- package/dist/chunk-MJQGGJQZ.js +88 -0
- package/dist/chunk-MJQGGJQZ.js.map +1 -0
- package/dist/{chunk-2L4ZS6W2.js → chunk-NJWWPDO2.js} +23 -14
- package/dist/chunk-NJWWPDO2.js.map +1 -0
- package/dist/chunk-X7MG5VTZ.js +682 -0
- package/dist/chunk-X7MG5VTZ.js.map +1 -0
- package/dist/config/index.d.ts +4 -3
- package/dist/config/index.js +3 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -10
- package/dist/mdx/provider.js +4 -2
- package/dist/mdx/provider.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +5 -3
- package/dist/typedoc/index.d.ts +2 -0
- package/dist/typedoc/index.js +2 -2
- package/dist/{types-tjxB5eh7.d.ts → types-DSD5zwMd.d.ts} +6 -1
- package/dist/ui/icons/alert-triangle.svg +1 -0
- package/dist/ui/icons/check.svg +1 -0
- package/dist/ui/icons/chevron-down.svg +1 -0
- package/dist/ui/icons/copy.svg +1 -0
- package/dist/ui/icons/file-text.svg +1 -0
- package/dist/ui/icons/github.svg +1 -0
- package/dist/ui/icons/info.svg +1 -0
- package/dist/ui/icons/lightbulb.svg +1 -0
- package/dist/ui/icons/linkedin.svg +1 -0
- package/dist/ui/icons/message-circle.svg +1 -0
- package/dist/ui/icons/monitor.svg +1 -0
- package/dist/ui/icons/moon.svg +1 -0
- package/dist/ui/icons/package.svg +1 -0
- package/dist/ui/icons/search.svg +1 -0
- package/dist/ui/icons/sun.svg +1 -0
- package/dist/ui/icons/twitter.svg +1 -0
- package/dist/ui/icons/x-circle.svg +1 -0
- package/dist/ui/icons/youtube.svg +1 -0
- package/dist/ui/index.d.ts +11 -7
- package/dist/ui/index.js +8 -4
- package/dist/ui/styles.css +117 -0
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +3 -3
- package/package.json +10 -2
- package/dist/chunk-2L4ZS6W2.js.map +0 -1
- package/dist/chunk-4IRLOOXV.js.map +0 -1
- package/dist/chunk-C4W4YI7C.js +0 -812
- package/dist/chunk-C4W4YI7C.js.map +0 -1
- package/dist/chunk-EOV2OUTW.js.map +0 -1
- package/dist/chunk-FGRL2G4S.js.map +0 -1
- package/dist/chunk-PCMPLBJA.js.map +0 -1
- /package/dist/{chunk-O64PX2AK.js.map → chunk-M5VLOQYV.js.map} +0 -0
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Content
|
|
3
|
+
} from "./chunk-NJWWPDO2.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-3O2PF4HA.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-RJRSEY42.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 linkClassName = ["ardo-sidebar-link", isChildActive && "child-active"].filter(Boolean).join(" ");
|
|
201
|
+
const hasChildren = Children.count(children) > 0;
|
|
202
|
+
return /* @__PURE__ */ jsxs4("li", { className: className ?? "ardo-sidebar-item", children: [
|
|
203
|
+
/* @__PURE__ */ jsxs4("div", { className: "ardo-sidebar-item-header", children: [
|
|
204
|
+
to ? /* @__PURE__ */ jsx4(
|
|
205
|
+
NavLink,
|
|
206
|
+
{
|
|
207
|
+
to,
|
|
208
|
+
className: ({ isActive }) => [linkClassName, 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
|
+
ardoLink = true
|
|
327
|
+
}) {
|
|
328
|
+
const hasContent = message || copyright || children || project || sponsor || buildTime || ardoLink;
|
|
329
|
+
if (!hasContent) {
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
return /* @__PURE__ */ jsx5("footer", { className: className ?? "ardo-footer", children: /* @__PURE__ */ jsx5("div", { className: "ardo-footer-container", children: children ?? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
333
|
+
(project || ardoLink || sponsor) && /* @__PURE__ */ jsxs5("p", { className: "ardo-footer-primary", children: [
|
|
334
|
+
project?.name && /* @__PURE__ */ jsx5(Fragment, { children: project.homepage ? /* @__PURE__ */ jsxs5("a", { href: project.homepage, className: "ardo-footer-link", children: [
|
|
335
|
+
project.name,
|
|
336
|
+
project.version ? ` v${project.version}` : ""
|
|
337
|
+
] }) : /* @__PURE__ */ jsxs5("span", { children: [
|
|
338
|
+
project.name,
|
|
339
|
+
project.version ? ` v${project.version}` : ""
|
|
340
|
+
] }) }),
|
|
341
|
+
project?.name && ardoLink && /* @__PURE__ */ jsx5("span", { className: "ardo-footer-separator", "aria-hidden": "true" }),
|
|
342
|
+
ardoLink && /* @__PURE__ */ jsx5("a", { href: "https://ardo.dev", className: "ardo-footer-link", children: "Built with Ardo" }),
|
|
343
|
+
(project?.name || ardoLink) && sponsor && /* @__PURE__ */ jsx5("span", { className: "ardo-footer-separator", "aria-hidden": "true" }),
|
|
344
|
+
sponsor && /* @__PURE__ */ jsxs5("a", { href: sponsor.link, className: "ardo-footer-link", children: [
|
|
345
|
+
"Sponsored by ",
|
|
346
|
+
sponsor.text
|
|
347
|
+
] })
|
|
348
|
+
] }),
|
|
349
|
+
message && /* @__PURE__ */ jsx5("p", { className: "ardo-footer-message", dangerouslySetInnerHTML: { __html: message } }),
|
|
350
|
+
copyright && /* @__PURE__ */ jsx5(
|
|
351
|
+
"p",
|
|
352
|
+
{
|
|
353
|
+
className: "ardo-footer-copyright",
|
|
354
|
+
dangerouslySetInnerHTML: { __html: copyright }
|
|
355
|
+
}
|
|
356
|
+
),
|
|
357
|
+
buildTime && /* @__PURE__ */ jsxs5("p", { className: "ardo-footer-build-time", children: [
|
|
358
|
+
"Built on ",
|
|
359
|
+
formatBuildTime(buildTime)
|
|
360
|
+
] })
|
|
361
|
+
] }) }) });
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// src/ui/Nav.tsx
|
|
365
|
+
import { useState as useState4, createContext as createContext2, useContext as useContext2 } from "react";
|
|
366
|
+
import { NavLink as RouterNavLink } from "react-router";
|
|
367
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
368
|
+
var NavContext = createContext2(null);
|
|
369
|
+
function useNavContext() {
|
|
370
|
+
return useContext2(NavContext);
|
|
371
|
+
}
|
|
372
|
+
function Nav({ children, className }) {
|
|
373
|
+
return /* @__PURE__ */ jsx6("nav", { className: className ?? "ardo-nav", children });
|
|
374
|
+
}
|
|
375
|
+
function NavLink2({
|
|
376
|
+
to,
|
|
377
|
+
href,
|
|
378
|
+
children,
|
|
379
|
+
className,
|
|
380
|
+
activeMatch: _activeMatch
|
|
381
|
+
}) {
|
|
382
|
+
const navContext = useNavContext();
|
|
383
|
+
const baseClassName = className ?? "ardo-nav-link";
|
|
384
|
+
const handleClick = () => {
|
|
385
|
+
navContext?.setMobileMenuOpen(false);
|
|
386
|
+
};
|
|
387
|
+
if (href) {
|
|
388
|
+
return /* @__PURE__ */ jsx6(
|
|
389
|
+
"a",
|
|
390
|
+
{
|
|
391
|
+
href,
|
|
392
|
+
className: baseClassName,
|
|
393
|
+
target: "_blank",
|
|
394
|
+
rel: "noopener noreferrer",
|
|
395
|
+
onClick: handleClick,
|
|
396
|
+
children
|
|
397
|
+
}
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
if (to) {
|
|
401
|
+
return /* @__PURE__ */ jsx6(
|
|
402
|
+
RouterNavLink,
|
|
403
|
+
{
|
|
404
|
+
to,
|
|
405
|
+
className: ({ isActive }) => [baseClassName, isActive && "active"].filter(Boolean).join(" "),
|
|
406
|
+
onClick: handleClick,
|
|
407
|
+
children
|
|
408
|
+
}
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
return /* @__PURE__ */ jsx6("span", { className: baseClassName, children });
|
|
412
|
+
}
|
|
413
|
+
function NavDropdown({ text, children, className }) {
|
|
414
|
+
const [open, setOpen] = useState4(false);
|
|
415
|
+
return /* @__PURE__ */ jsxs6(
|
|
416
|
+
"div",
|
|
417
|
+
{
|
|
418
|
+
className: className ?? "ardo-nav-dropdown",
|
|
419
|
+
onMouseEnter: () => setOpen(true),
|
|
420
|
+
onMouseLeave: () => setOpen(false),
|
|
421
|
+
children: [
|
|
422
|
+
/* @__PURE__ */ jsxs6("button", { className: "ardo-nav-dropdown-button", children: [
|
|
423
|
+
text,
|
|
424
|
+
/* @__PURE__ */ jsx6("span", { className: "ardo-nav-dropdown-icon", children: "\u25BC" })
|
|
425
|
+
] }),
|
|
426
|
+
open && /* @__PURE__ */ jsx6("div", { className: "ardo-nav-dropdown-menu", children })
|
|
427
|
+
]
|
|
428
|
+
}
|
|
429
|
+
);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// src/ui/TOC.tsx
|
|
433
|
+
import { useState as useState5, useEffect as useEffect2 } from "react";
|
|
434
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
435
|
+
function TOC() {
|
|
436
|
+
const toc = useTOC();
|
|
437
|
+
const themeConfig = useThemeConfig();
|
|
438
|
+
const [activeId, setActiveId] = useState5("");
|
|
439
|
+
const label = themeConfig.outline?.label ?? "On this page";
|
|
440
|
+
useEffect2(() => {
|
|
441
|
+
if (toc.length === 0) return;
|
|
442
|
+
const headingElements = toc.map((item) => document.getElementById(item.id)).filter(Boolean);
|
|
443
|
+
if (headingElements.length === 0) return;
|
|
444
|
+
const observer = new IntersectionObserver(
|
|
445
|
+
(entries) => {
|
|
446
|
+
for (const entry of entries) {
|
|
447
|
+
if (entry.isIntersecting) {
|
|
448
|
+
setActiveId(entry.target.id);
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
rootMargin: "-80px 0px -80% 0px",
|
|
455
|
+
threshold: 0
|
|
456
|
+
}
|
|
457
|
+
);
|
|
458
|
+
headingElements.forEach((el) => el && observer.observe(el));
|
|
459
|
+
return () => {
|
|
460
|
+
headingElements.forEach((el) => el && observer.unobserve(el));
|
|
461
|
+
};
|
|
462
|
+
}, [toc]);
|
|
463
|
+
if (toc.length === 0) {
|
|
464
|
+
return null;
|
|
465
|
+
}
|
|
466
|
+
return /* @__PURE__ */ jsx7("aside", { className: "ardo-toc", children: /* @__PURE__ */ jsxs7("div", { className: "ardo-toc-container", children: [
|
|
467
|
+
/* @__PURE__ */ jsx7("h3", { className: "ardo-toc-title", children: label }),
|
|
468
|
+
/* @__PURE__ */ jsx7("nav", { className: "ardo-toc-nav", "aria-label": "Table of contents", children: /* @__PURE__ */ jsx7(TOCItems, { items: toc, activeId }) })
|
|
469
|
+
] }) });
|
|
470
|
+
}
|
|
471
|
+
function TOCItems({ items, activeId }) {
|
|
472
|
+
return /* @__PURE__ */ jsx7("ul", { className: "ardo-toc-list", children: items.map((item) => /* @__PURE__ */ jsx7(TOCItemComponent, { item, activeId }, item.id)) });
|
|
473
|
+
}
|
|
474
|
+
function TOCItemComponent({ item, activeId }) {
|
|
475
|
+
const isActive = item.id === activeId;
|
|
476
|
+
const hasActiveChild = hasActiveDescendant(item, activeId);
|
|
477
|
+
return /* @__PURE__ */ jsxs7("li", { className: "ardo-toc-item", children: [
|
|
478
|
+
/* @__PURE__ */ jsx7(
|
|
479
|
+
"a",
|
|
480
|
+
{
|
|
481
|
+
href: `#${item.id}`,
|
|
482
|
+
className: [
|
|
483
|
+
`ardo-toc-link ardo-toc-link-${item.level}`,
|
|
484
|
+
isActive && "active",
|
|
485
|
+
hasActiveChild && "child-active"
|
|
486
|
+
].filter(Boolean).join(" "),
|
|
487
|
+
onClick: (e) => {
|
|
488
|
+
e.preventDefault();
|
|
489
|
+
const element = document.getElementById(item.id);
|
|
490
|
+
if (element) {
|
|
491
|
+
element.scrollIntoView({ behavior: "smooth" });
|
|
492
|
+
window.history.pushState(null, "", `#${item.id}`);
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
children: item.text
|
|
496
|
+
}
|
|
497
|
+
),
|
|
498
|
+
item.children && item.children.length > 0 && /* @__PURE__ */ jsx7(TOCItems, { items: item.children, activeId })
|
|
499
|
+
] });
|
|
500
|
+
}
|
|
501
|
+
function hasActiveDescendant(item, activeId) {
|
|
502
|
+
if (!item.children) return false;
|
|
503
|
+
for (const child of item.children) {
|
|
504
|
+
if (child.id === activeId) return true;
|
|
505
|
+
if (hasActiveDescendant(child, activeId)) return true;
|
|
506
|
+
}
|
|
507
|
+
return false;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// src/ui/DocPage.tsx
|
|
511
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
512
|
+
function DocPage({ children }) {
|
|
513
|
+
const pageData = usePageData();
|
|
514
|
+
const showToc = pageData?.frontmatter.outline !== false && pageData?.toc && pageData.toc.length > 0;
|
|
515
|
+
return /* @__PURE__ */ jsx8(Layout, { children: /* @__PURE__ */ jsxs8("div", { className: "ardo-doc-page", children: [
|
|
516
|
+
/* @__PURE__ */ jsx8(Content, { children }),
|
|
517
|
+
showToc && /* @__PURE__ */ jsx8(TOC, {})
|
|
518
|
+
] }) });
|
|
519
|
+
}
|
|
520
|
+
function DocContent({ children }) {
|
|
521
|
+
const pageData = usePageData();
|
|
522
|
+
const showToc = pageData?.frontmatter.outline !== false && pageData?.toc && pageData.toc.length > 0;
|
|
523
|
+
return /* @__PURE__ */ jsxs8("div", { className: "ardo-doc-page", children: [
|
|
524
|
+
/* @__PURE__ */ jsx8(Content, { children }),
|
|
525
|
+
showToc && /* @__PURE__ */ jsx8(TOC, {})
|
|
526
|
+
] });
|
|
527
|
+
}
|
|
528
|
+
function DocLayout({ content }) {
|
|
529
|
+
return /* @__PURE__ */ jsx8(DocPage, { children: content });
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// src/ui/HomePage.tsx
|
|
533
|
+
import { Link as Link2 } from "react-router";
|
|
534
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
535
|
+
function HomePage() {
|
|
536
|
+
const pageData = usePageData();
|
|
537
|
+
const config = useConfig();
|
|
538
|
+
const themeConfig = useThemeConfig();
|
|
539
|
+
const hero = pageData?.frontmatter.hero;
|
|
540
|
+
const features = pageData?.frontmatter.features;
|
|
541
|
+
return /* @__PURE__ */ jsxs9("div", { className: "ardo-home", children: [
|
|
542
|
+
/* @__PURE__ */ jsx9(
|
|
543
|
+
Header,
|
|
544
|
+
{
|
|
545
|
+
logo: themeConfig.logo,
|
|
546
|
+
title: themeConfig.siteTitle !== false ? config.title : void 0,
|
|
547
|
+
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,
|
|
548
|
+
actions: themeConfig.socialLinks?.map((link, index) => /* @__PURE__ */ jsx9(SocialLink, { href: link.link, icon: link.icon, ariaLabel: link.ariaLabel }, index))
|
|
549
|
+
}
|
|
550
|
+
),
|
|
551
|
+
/* @__PURE__ */ jsxs9("main", { className: "ardo-home-main", children: [
|
|
552
|
+
hero && /* @__PURE__ */ jsx9("section", { className: "ardo-hero", children: /* @__PURE__ */ jsxs9("div", { className: "ardo-hero-container", children: [
|
|
553
|
+
hero.image && /* @__PURE__ */ jsx9("div", { className: "ardo-hero-image", children: /* @__PURE__ */ jsx9(
|
|
554
|
+
"img",
|
|
555
|
+
{
|
|
556
|
+
src: typeof hero.image === "string" ? hero.image : hero.image.light,
|
|
557
|
+
alt: hero.name || config.title
|
|
558
|
+
}
|
|
559
|
+
) }),
|
|
560
|
+
/* @__PURE__ */ jsxs9("div", { className: "ardo-hero-content", children: [
|
|
561
|
+
hero.name && /* @__PURE__ */ jsx9("h1", { className: "ardo-hero-name", children: hero.name }),
|
|
562
|
+
hero.text && /* @__PURE__ */ jsx9("p", { className: "ardo-hero-text", children: hero.text }),
|
|
563
|
+
hero.tagline && /* @__PURE__ */ jsx9("p", { className: "ardo-hero-tagline", children: hero.tagline }),
|
|
564
|
+
hero.actions && hero.actions.length > 0 && /* @__PURE__ */ jsx9("div", { className: "ardo-hero-actions", children: hero.actions.map((action, index) => /* @__PURE__ */ jsx9(
|
|
565
|
+
Link2,
|
|
566
|
+
{
|
|
567
|
+
to: action.link,
|
|
568
|
+
className: `ardo-hero-action ardo-hero-action-${action.theme || "brand"}`,
|
|
569
|
+
children: action.text
|
|
570
|
+
},
|
|
571
|
+
index
|
|
572
|
+
)) })
|
|
573
|
+
] })
|
|
574
|
+
] }) }),
|
|
575
|
+
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: [
|
|
576
|
+
feature.icon && /* @__PURE__ */ jsx9("div", { className: "ardo-feature-icon", children: feature.icon }),
|
|
577
|
+
/* @__PURE__ */ jsx9("h3", { className: "ardo-feature-title", children: feature.title }),
|
|
578
|
+
/* @__PURE__ */ jsx9("p", { className: "ardo-feature-details", children: feature.details }),
|
|
579
|
+
feature.link && /* @__PURE__ */ jsx9(Link2, { to: feature.link, className: "ardo-feature-link", children: feature.linkText || "Learn more" })
|
|
580
|
+
] }, index)) }) })
|
|
581
|
+
] }),
|
|
582
|
+
/* @__PURE__ */ jsx9(Footer, {})
|
|
583
|
+
] });
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// src/ui/components/Hero.tsx
|
|
587
|
+
import { Link as Link3 } from "react-router";
|
|
588
|
+
import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
589
|
+
function Hero({ name, text, tagline, image, actions, className, version }) {
|
|
590
|
+
const imageUrl = typeof image === "string" ? image : image?.light;
|
|
591
|
+
const imageAlt = typeof image === "string" ? name : image?.alt ?? name;
|
|
592
|
+
return /* @__PURE__ */ jsx10("section", { className: className ?? "ardo-hero", children: /* @__PURE__ */ jsxs10("div", { className: "ardo-hero-container ardo-hero-animate", children: [
|
|
593
|
+
image && /* @__PURE__ */ jsx10("div", { className: "ardo-hero-image", children: /* @__PURE__ */ jsx10("img", { src: imageUrl, alt: imageAlt }) }),
|
|
594
|
+
/* @__PURE__ */ jsxs10("div", { className: "ardo-hero-content", children: [
|
|
595
|
+
version && /* @__PURE__ */ jsxs10("span", { className: "ardo-hero-version", children: [
|
|
596
|
+
"v",
|
|
597
|
+
version
|
|
598
|
+
] }),
|
|
599
|
+
name && /* @__PURE__ */ jsx10("h1", { className: "ardo-hero-name", children: name }),
|
|
600
|
+
text && /* @__PURE__ */ jsx10("p", { className: "ardo-hero-text", children: text }),
|
|
601
|
+
tagline && /* @__PURE__ */ jsx10("p", { className: "ardo-hero-tagline", children: tagline }),
|
|
602
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsx10("div", { className: "ardo-hero-actions", children: actions.map((action, index) => {
|
|
603
|
+
const link = action.link;
|
|
604
|
+
const isExternal = typeof link === "string" && (link.startsWith("http://") || link.startsWith("https://"));
|
|
605
|
+
const className2 = `ardo-hero-action ardo-hero-action-${action.theme || "brand"}`;
|
|
606
|
+
const content = /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
607
|
+
action.icon,
|
|
608
|
+
action.text
|
|
609
|
+
] });
|
|
610
|
+
if (isExternal) {
|
|
611
|
+
return /* @__PURE__ */ jsx10(
|
|
612
|
+
"a",
|
|
613
|
+
{
|
|
614
|
+
href: link,
|
|
615
|
+
className: className2,
|
|
616
|
+
target: "_blank",
|
|
617
|
+
rel: "noopener noreferrer",
|
|
618
|
+
children: content
|
|
619
|
+
},
|
|
620
|
+
index
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
return /* @__PURE__ */ jsx10(Link3, { to: link, className: className2, children: content }, index);
|
|
624
|
+
}) })
|
|
625
|
+
] })
|
|
626
|
+
] }) });
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// src/ui/components/Features.tsx
|
|
630
|
+
import { Link as Link4 } from "react-router";
|
|
631
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
632
|
+
function FeatureCard({
|
|
633
|
+
title,
|
|
634
|
+
icon,
|
|
635
|
+
details,
|
|
636
|
+
link,
|
|
637
|
+
linkText,
|
|
638
|
+
className,
|
|
639
|
+
style
|
|
640
|
+
}) {
|
|
641
|
+
return /* @__PURE__ */ jsxs11("div", { className: className ?? "ardo-feature", style, children: [
|
|
642
|
+
icon && /* @__PURE__ */ jsx11("div", { className: "ardo-feature-icon", children: icon }),
|
|
643
|
+
/* @__PURE__ */ jsx11("h3", { className: "ardo-feature-title", children: title }),
|
|
644
|
+
/* @__PURE__ */ jsx11("p", { className: "ardo-feature-details", children: details }),
|
|
645
|
+
link && /* @__PURE__ */ jsx11(Link4, { to: link, className: "ardo-feature-link", children: linkText || "Learn more" })
|
|
646
|
+
] });
|
|
647
|
+
}
|
|
648
|
+
function Features({ items, title, subtitle, className }) {
|
|
649
|
+
if (!items || items.length === 0) {
|
|
650
|
+
return null;
|
|
651
|
+
}
|
|
652
|
+
return /* @__PURE__ */ jsxs11("section", { className: className ?? "ardo-features", children: [
|
|
653
|
+
(title || subtitle) && /* @__PURE__ */ jsxs11("div", { className: "ardo-features-header", children: [
|
|
654
|
+
title && /* @__PURE__ */ jsx11("h2", { className: "ardo-features-title", children: title }),
|
|
655
|
+
subtitle && /* @__PURE__ */ jsx11("p", { className: "ardo-features-subtitle", children: subtitle })
|
|
656
|
+
] }),
|
|
657
|
+
/* @__PURE__ */ jsx11("div", { className: "ardo-features-container", children: items.map((feature, index) => /* @__PURE__ */ jsx11(FeatureCard, { ...feature, style: { animationDelay: `${index * 80}ms` } }, index)) })
|
|
658
|
+
] });
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
export {
|
|
662
|
+
Layout,
|
|
663
|
+
ThemeToggle,
|
|
664
|
+
Header,
|
|
665
|
+
SocialLink,
|
|
666
|
+
Sidebar,
|
|
667
|
+
SidebarGroup,
|
|
668
|
+
SidebarLink,
|
|
669
|
+
Footer,
|
|
670
|
+
Nav,
|
|
671
|
+
NavLink2 as NavLink,
|
|
672
|
+
NavDropdown,
|
|
673
|
+
TOC,
|
|
674
|
+
DocPage,
|
|
675
|
+
DocContent,
|
|
676
|
+
DocLayout,
|
|
677
|
+
HomePage,
|
|
678
|
+
Hero,
|
|
679
|
+
FeatureCard,
|
|
680
|
+
Features
|
|
681
|
+
};
|
|
682
|
+
//# sourceMappingURL=chunk-X7MG5VTZ.js.map
|