boltdocs 2.7.11 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -54
- package/dist/banner-3N4Jd_L9.d.ts +100 -0
- package/dist/banner-MynZD_Ox.d.cts +100 -0
- package/dist/cache-BMUyNiiA.mjs +6 -0
- package/dist/cache-CKm45d2w.cjs +6 -0
- package/dist/client/index.cjs +782 -443
- package/dist/client/index.d.cts +86 -110
- package/dist/client/index.d.ts +87 -111
- package/dist/client/index.js +773 -439
- package/dist/client/mdx.cjs +8 -3
- package/dist/client/mdx.d.cts +39 -93
- package/dist/client/mdx.d.ts +38 -93
- package/dist/client/mdx.js +3 -3
- package/dist/client/primitives.cjs +7 -7
- package/dist/client/primitives.d.cts +411 -347
- package/dist/client/primitives.d.ts +411 -347
- package/dist/client/primitives.js +4 -4
- package/dist/client/theme/neutral.css +1 -1
- package/dist/{docs-layout-BXHV0xw_.cjs → docs-layout-CwCq42Zt.cjs} +95 -178
- package/dist/{docs-layout-DwFndmj5.js → docs-layout-Dn6S5g59.js} +99 -163
- package/dist/doctor-BArviV8X.cjs +28 -0
- package/dist/doctor-CgLA7_Uv.mjs +28 -0
- package/dist/{doctor-CrytFkqW.cjs → doctor-DyNUVe96.cjs} +1 -1
- package/dist/{routes-DP1vmWRj.cjs → doctor-aN_leTbh.mjs} +1 -1
- package/dist/{generator-ClVanhvi.mjs → generator-BHCrLU6h.mjs} +2 -2
- package/dist/{generator-CHqxiQhF.cjs → generator-CC2yHzhZ.cjs} +2 -2
- package/dist/{icons-dev-3cZMyt8r.cjs → icons-dev-DvJ-hh9x.cjs} +116 -111
- package/dist/{icons-dev-Df8OQ481.js → icons-dev-Oju24Wjp.js} +120 -114
- package/dist/{image-DtrI2cw3.cjs → image-Ch4-GxdO.cjs} +13 -13
- package/dist/{image-jxPb-2iV.js → image-Do8V9PCW.js} +13 -13
- package/dist/{mdx-UTTLFWJq.js → mdx-5oeCOFhH.js} +111 -81
- package/dist/{mdx-BdWkJTeB.cjs → mdx-BGM7LjW5.cjs} +109 -97
- package/dist/node/cli-entry.cjs +3 -1
- package/dist/node/cli-entry.mjs +3 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +258 -152
- package/dist/node/index.d.mts +258 -150
- package/dist/node/index.mjs +1 -1
- package/dist/node/routes/worker.cjs +1 -1
- package/dist/node/routes/worker.mjs +1 -1
- package/dist/node-CefnjllX.cjs +159 -0
- package/dist/node-DruKROCt.mjs +159 -0
- package/dist/package-CmP_9rJ8.cjs +6 -0
- package/dist/{package-K0zsjGIz.mjs → package-DpbnBMR1.mjs} +1 -1
- package/dist/parser-B0YtJPDz.mjs +6 -0
- package/dist/parser-B7-6PyQz.cjs +6 -0
- package/dist/{parser-Aq8LoH-0.cjs → parser-BzB-zCkF.cjs} +1 -1
- package/dist/routes-ChS-zgzh.mjs +6 -0
- package/dist/routes-DJNJ-rTt.cjs +6 -0
- package/dist/routes-DiYC4nD2.cjs +6 -0
- package/dist/routes-rKlxFkqq.mjs +6 -0
- package/dist/{search-dialog-C7xuvyNk.cjs → search-dialog-BXVoecTx.cjs} +175 -78
- package/dist/{search-dialog-BwkDuI9R.cjs → search-dialog-BYhOov4S.cjs} +118 -7
- package/dist/{search-dialog-D-DDN7zJ.js → search-dialog-C09riYmx.js} +113 -8
- package/dist/{search-dialog-CIQg6k8c.cjs → search-dialog-CUeAfy-8.cjs} +1 -1
- package/dist/{search-dialog-BNF10tDl.js → search-dialog-D8gLkhUV.js} +158 -80
- package/dist/{search-dialog-BHuIiUC6.js → search-dialog-DHc_8FFX.js} +1 -1
- package/dist/{sidebar-CyZS9YOm.d.ts → sidebar-DNq4_ZAa.d.ts} +117 -51
- package/dist/{sidebar-CcBkrm06.d.cts → sidebar-Dlkgbxs6.d.cts} +117 -51
- package/dist/utils-BYITg7T5.mjs +7 -0
- package/dist/utils-Cjmx1hhk.cjs +7 -0
- package/dist/worker-pool-CtqklOXq.cjs +6 -0
- package/dist/worker-pool-k0DY6k8T.mjs +6 -0
- package/package.json +3 -3
- package/src/shared/config-utils.ts +4 -0
- package/src/shared/types.ts +52 -6
- package/dist/cache-Ba-DZQNH.cjs +0 -6
- package/dist/cache-BuMZ58L5.mjs +0 -6
- package/dist/cards-BakZPTz9.d.ts +0 -30
- package/dist/cards-CQn9mXZS.d.cts +0 -30
- package/dist/doctor-Be7Ly1oM.mjs +0 -21
- package/dist/doctor-jMxWZyLJ.cjs +0 -21
- package/dist/node-BSM4qcDK.cjs +0 -111
- package/dist/node-BspZN3R2.mjs +0 -111
- package/dist/package-DIIrjuWI.cjs +0 -6
- package/dist/parser-CdNbqN5y.cjs +0 -6
- package/dist/parser-nE792MLO.mjs +0 -6
- package/dist/rolldown-runtime-fkIsjY3S.mjs +0 -6
- package/dist/routes-2k3tbUmC.cjs +0 -6
- package/dist/routes-CpxZIsMM.mjs +0 -6
- package/dist/utils-CG65J0Sc.mjs +0 -7
- package/dist/utils-CKunkU96.cjs +0 -7
- package/dist/worker-pool-CGn7DrLb.mjs +0 -6
- package/dist/worker-pool-Crbqgw5R.cjs +0 -6
- /package/dist/{meta-loader-CWg2gnbY.mjs → meta-loader-DzwDFtdT.mjs} +0 -0
|
@@ -3,21 +3,55 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { n as Navbar, t as SearchDialog$1 } from "./search-dialog-
|
|
8
|
-
import { useNavigate } from "react-router-dom";
|
|
6
|
+
import { J as Search, et as useConfig, x as useRoutes } from "./icons-dev-Oju24Wjp.js";
|
|
7
|
+
import { n as Navbar, r as ErrorBoundary, t as SearchDialog$1 } from "./search-dialog-D8gLkhUV.js";
|
|
9
8
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
9
|
+
import { useNavigate } from "react-router-dom";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Index } from "flexsearch";
|
|
12
12
|
import searchData from "virtual:boltdocs-search";
|
|
13
13
|
|
|
14
|
+
//#region src/client/components/internal/error-boundary.tsx
|
|
15
|
+
function InternalFallback({ error, resetErrorBoundary }) {
|
|
16
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
17
|
+
className: "p-2 font-mono flex flex-col items-center justify-between min-h-[30vh]",
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx("p", {
|
|
20
|
+
className: "text-lg font-semibold text-red-500",
|
|
21
|
+
children: "Something went wrong"
|
|
22
|
+
}),
|
|
23
|
+
error?.message && /* @__PURE__ */ jsx("pre", {
|
|
24
|
+
className: "text-sm mt-2 max-w-md overflow-auto whitespace-pre-wrap break-word",
|
|
25
|
+
children: error.message
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsx("button", {
|
|
28
|
+
type: "button",
|
|
29
|
+
onClick: resetErrorBoundary,
|
|
30
|
+
className: "px-2 py-3 mt-2 bg-slate-100 rounded border-slate-200 border font-mono font-semibold text-slate-700 hover:scale-105 transition-transform active:scale-95 cursor-pointer",
|
|
31
|
+
children: "Try again"
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function InternalErrorBoundary({ children, fallback }) {
|
|
37
|
+
return /* @__PURE__ */ jsx(ErrorBoundary, {
|
|
38
|
+
fallback,
|
|
39
|
+
FallbackComponent: !fallback ? InternalFallback : void 0,
|
|
40
|
+
children
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
14
45
|
//#region src/client/hooks/use-search.ts
|
|
15
46
|
function useSearch(routes) {
|
|
16
47
|
const { currentLocale, currentVersion } = useRoutes();
|
|
48
|
+
const algoliaConfig = useConfig().integrations?.algolia;
|
|
17
49
|
const [isOpen, setIsOpen] = useState(false);
|
|
18
50
|
const [query, setQuery] = useState("");
|
|
19
51
|
const [index, setIndex] = useState(null);
|
|
52
|
+
const [algoliaResults, setAlgoliaResults] = useState([]);
|
|
20
53
|
useEffect(() => {
|
|
54
|
+
if (algoliaConfig) return;
|
|
21
55
|
if (!isOpen || index) return;
|
|
22
56
|
const newIndex = new Index({
|
|
23
57
|
preset: "match",
|
|
@@ -27,7 +61,75 @@ function useSearch(routes) {
|
|
|
27
61
|
});
|
|
28
62
|
for (const doc of searchData) newIndex.add(doc.id, `${doc.title} ${doc.content}`);
|
|
29
63
|
setIndex(newIndex);
|
|
30
|
-
}, [
|
|
64
|
+
}, [
|
|
65
|
+
isOpen,
|
|
66
|
+
index,
|
|
67
|
+
algoliaConfig
|
|
68
|
+
]);
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!algoliaConfig) return;
|
|
71
|
+
if (!query) {
|
|
72
|
+
setAlgoliaResults([]);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const delayDebounceFn = setTimeout(async () => {
|
|
76
|
+
try {
|
|
77
|
+
const url = `https://${algoliaConfig.appId}-dsn.algolia.net/1/indexes/${algoliaConfig.indexName}/query`;
|
|
78
|
+
const facetFilters = [];
|
|
79
|
+
if (currentLocale) facetFilters.push(`lang:${currentLocale}`);
|
|
80
|
+
if (currentVersion) facetFilters.push(`version:${currentVersion}`);
|
|
81
|
+
let params = `query=${encodeURIComponent(query)}&hitsPerPage=20`;
|
|
82
|
+
if (facetFilters.length > 0) params += `&facetFilters=${encodeURIComponent(JSON.stringify(facetFilters))}`;
|
|
83
|
+
const response = await fetch(url, {
|
|
84
|
+
method: "POST",
|
|
85
|
+
headers: {
|
|
86
|
+
"Content-Type": "application/json",
|
|
87
|
+
"X-Algolia-API-Key": algoliaConfig.apiKey,
|
|
88
|
+
"X-Algolia-Application-Id": algoliaConfig.appId
|
|
89
|
+
},
|
|
90
|
+
body: JSON.stringify({ params })
|
|
91
|
+
});
|
|
92
|
+
if (!response.ok) throw new Error(`Algolia search request failed: ${response.statusText}`);
|
|
93
|
+
setAlgoliaResults(((await response.json()).hits || []).map((hit) => {
|
|
94
|
+
let path = hit.url || "";
|
|
95
|
+
try {
|
|
96
|
+
if (path.startsWith("http://") || path.startsWith("https://")) {
|
|
97
|
+
const urlObj = new URL(path);
|
|
98
|
+
path = urlObj.pathname + urlObj.search + urlObj.hash;
|
|
99
|
+
}
|
|
100
|
+
} catch (e) {}
|
|
101
|
+
const hierarchy = hit.hierarchy || {};
|
|
102
|
+
const levels = [
|
|
103
|
+
hierarchy.lvl0,
|
|
104
|
+
hierarchy.lvl1,
|
|
105
|
+
hierarchy.lvl2,
|
|
106
|
+
hierarchy.lvl3,
|
|
107
|
+
hierarchy.lvl4,
|
|
108
|
+
hierarchy.lvl5,
|
|
109
|
+
hierarchy.lvl6
|
|
110
|
+
].filter(Boolean);
|
|
111
|
+
const title = levels[levels.length - 1] || "Documentation";
|
|
112
|
+
const bio = levels.join(" > ");
|
|
113
|
+
return {
|
|
114
|
+
id: hit.objectID || path,
|
|
115
|
+
title,
|
|
116
|
+
path,
|
|
117
|
+
bio,
|
|
118
|
+
groupTitle: hierarchy.lvl0 || "Docs",
|
|
119
|
+
isHeading: !!hit.anchor || path.includes("#")
|
|
120
|
+
};
|
|
121
|
+
}));
|
|
122
|
+
} catch (err) {
|
|
123
|
+
console.error("Error fetching search results from Algolia:", err);
|
|
124
|
+
}
|
|
125
|
+
}, 250);
|
|
126
|
+
return () => clearTimeout(delayDebounceFn);
|
|
127
|
+
}, [
|
|
128
|
+
query,
|
|
129
|
+
algoliaConfig,
|
|
130
|
+
currentLocale,
|
|
131
|
+
currentVersion
|
|
132
|
+
]);
|
|
31
133
|
const searchDataMap = useMemo(() => {
|
|
32
134
|
const map = /* @__PURE__ */ new Map();
|
|
33
135
|
for (const doc of searchData) map.set(doc.id, doc);
|
|
@@ -50,6 +152,7 @@ function useSearch(routes) {
|
|
|
50
152
|
bio: r.description || "",
|
|
51
153
|
groupTitle: r.groupTitle
|
|
52
154
|
}));
|
|
155
|
+
if (algoliaConfig) return algoliaResults;
|
|
53
156
|
if (!index) return [];
|
|
54
157
|
const searchResults = index.search(query, {
|
|
55
158
|
limit: 20,
|
|
@@ -81,7 +184,9 @@ function useSearch(routes) {
|
|
|
81
184
|
currentLocale,
|
|
82
185
|
currentVersion,
|
|
83
186
|
routes,
|
|
84
|
-
searchDataMap
|
|
187
|
+
searchDataMap,
|
|
188
|
+
algoliaConfig,
|
|
189
|
+
algoliaResults
|
|
85
190
|
]),
|
|
86
191
|
input: {
|
|
87
192
|
value: query,
|
|
@@ -145,7 +250,7 @@ function SearchDialog({ routes }) {
|
|
|
145
250
|
className: "rounded-xl text-muted transition-all duration-200 hover:text-body active:scale-95 focus-visible:ring-2 focus-visible:ring-primary-500/30",
|
|
146
251
|
children: /* @__PURE__ */ jsx(Search, { size: 20 })
|
|
147
252
|
}),
|
|
148
|
-
/* @__PURE__ */ jsx(SearchDialog$1.Overlay, {
|
|
253
|
+
/* @__PURE__ */ jsx(InternalErrorBoundary, { children: /* @__PURE__ */ jsx(SearchDialog$1.Overlay, {
|
|
149
254
|
isOpen,
|
|
150
255
|
isDismissable: true,
|
|
151
256
|
onOpenChange: () => setIsOpen(false),
|
|
@@ -200,9 +305,9 @@ function SearchDialog({ routes }) {
|
|
|
200
305
|
})
|
|
201
306
|
})
|
|
202
307
|
})
|
|
203
|
-
})
|
|
308
|
+
}) })
|
|
204
309
|
] });
|
|
205
310
|
}
|
|
206
311
|
|
|
207
312
|
//#endregion
|
|
208
|
-
export { useSearch as n, SearchDialog as t };
|
|
313
|
+
export { useSearch as n, InternalErrorBoundary as r, SearchDialog as t };
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
const require_search_dialog = require('./search-dialog-
|
|
6
|
+
const require_search_dialog = require('./search-dialog-BYhOov4S.cjs');
|
|
7
7
|
|
|
8
8
|
exports.SearchDialog = require_search_dialog.SearchDialog;
|
|
@@ -3,45 +3,113 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { useEffect, useState } from "react";
|
|
6
|
+
import { G as Moon, I as FileText, K as MoreVertical, L as Hash, N as CornerDownLeft, P as ExternalLink, Y as Sun, Z as X, _ as Link, h as XSocial, o as Discord, s as Github, t as Bluesky, y as cn } from "./icons-dev-Oju24Wjp.js";
|
|
7
|
+
import { Component, useEffect, useState } from "react";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import * as RAC from "react-aria-components";
|
|
10
10
|
import { Button, Dialog, Modal, ModalOverlay, Separator, ToggleButton } from "react-aria-components";
|
|
11
11
|
|
|
12
|
+
//#region src/client/components/primitives/button.tsx
|
|
13
|
+
function Button$1({ ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(RAC.Button, { ...props });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/client/components/primitives/error-boundary.tsx
|
|
19
|
+
var ErrorBoundary = class extends Component {
|
|
20
|
+
state = {
|
|
21
|
+
hasError: false,
|
|
22
|
+
error: null
|
|
23
|
+
};
|
|
24
|
+
static getDerivedStateFromError(error) {
|
|
25
|
+
return {
|
|
26
|
+
hasError: true,
|
|
27
|
+
error
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
componentDidCatch(error, errorInfo) {
|
|
31
|
+
if (this.props.onError) this.props.onError(error, errorInfo);
|
|
32
|
+
else console.error("ErrorBoundary caught an unhandled error:", error, errorInfo);
|
|
33
|
+
}
|
|
34
|
+
resetErrorBoundary = () => {
|
|
35
|
+
if (this.props.onReset) this.props.onReset();
|
|
36
|
+
this.setState({
|
|
37
|
+
hasError: false,
|
|
38
|
+
error: null
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
render() {
|
|
42
|
+
const { hasError, error } = this.state;
|
|
43
|
+
const { children, fallback, FallbackComponent } = this.props;
|
|
44
|
+
if (hasError && error) {
|
|
45
|
+
if (FallbackComponent) return /* @__PURE__ */ jsx(FallbackComponent, {
|
|
46
|
+
error,
|
|
47
|
+
resetErrorBoundary: this.resetErrorBoundary
|
|
48
|
+
});
|
|
49
|
+
if (fallback) return fallback;
|
|
50
|
+
return /* @__PURE__ */ jsx(ErrorBoundaryFallback, {
|
|
51
|
+
error,
|
|
52
|
+
resetErrorBoundary: this.resetErrorBoundary
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return children;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
function ErrorBoundaryFallback({ error, resetErrorBoundary }) {
|
|
59
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: "flex flex-col items-center justify-center min-h-[40vh] text-center gap-4 px-6 py-8 border border-subtle bg-surface rounded-2xl max-w-lg mx-auto shadow-xs",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx("div", {
|
|
63
|
+
className: "text-lg font-bold text-rose-600 dark:text-rose-400",
|
|
64
|
+
children: "Something went wrong"
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ jsx("p", {
|
|
67
|
+
className: "text-sm text-muted max-w-sm leading-relaxed",
|
|
68
|
+
children: error?.message || "An unexpected error occurred while rendering this page."
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ jsx(Button$1, {
|
|
71
|
+
className: "rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 cursor-pointer outline-none select-none",
|
|
72
|
+
onPress: resetErrorBoundary,
|
|
73
|
+
children: "Try again"
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
12
80
|
//#region src/client/components/primitives/navbar.tsx
|
|
13
|
-
|
|
81
|
+
function Navbar({ children, className, ...props }) {
|
|
14
82
|
return /* @__PURE__ */ jsx("header", {
|
|
15
83
|
className: cn("boltdocs-navbar sticky top-0 z-50 w-full", className),
|
|
16
84
|
...props,
|
|
17
85
|
children
|
|
18
86
|
});
|
|
19
|
-
}
|
|
20
|
-
|
|
87
|
+
}
|
|
88
|
+
function NavbarContent({ children, className }) {
|
|
21
89
|
return /* @__PURE__ */ jsx("div", {
|
|
22
90
|
className: cn("mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6", className),
|
|
23
91
|
children
|
|
24
92
|
});
|
|
25
|
-
}
|
|
26
|
-
|
|
93
|
+
}
|
|
94
|
+
function NavbarLeft({ children, className }) {
|
|
27
95
|
return /* @__PURE__ */ jsx("div", {
|
|
28
96
|
className: cn("flex flex-1 items-center justify-start gap-4 min-w-0", className),
|
|
29
97
|
children
|
|
30
98
|
});
|
|
31
|
-
}
|
|
32
|
-
|
|
99
|
+
}
|
|
100
|
+
function NavbarRight({ children, className }) {
|
|
33
101
|
return /* @__PURE__ */ jsx("div", {
|
|
34
102
|
className: cn("flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0", className),
|
|
35
103
|
children
|
|
36
104
|
});
|
|
37
|
-
}
|
|
38
|
-
|
|
105
|
+
}
|
|
106
|
+
function NavbarCenter({ children, className }) {
|
|
39
107
|
return /* @__PURE__ */ jsx("div", {
|
|
40
108
|
className: cn("hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full", className),
|
|
41
109
|
children
|
|
42
110
|
});
|
|
43
|
-
}
|
|
44
|
-
|
|
111
|
+
}
|
|
112
|
+
function NavbarLogo({ src, alt, width = 24, height = 24, className, href = "/" }) {
|
|
45
113
|
return /* @__PURE__ */ jsx(Link, {
|
|
46
114
|
href,
|
|
47
115
|
className: cn("flex items-center gap-2 shrink-0 outline-none", className),
|
|
@@ -53,8 +121,8 @@ const NavbarLogo = ({ src, alt, width = 24, height = 24, className, href = "/" }
|
|
|
53
121
|
className: "h-6 w-6 object-contain"
|
|
54
122
|
}) : null
|
|
55
123
|
});
|
|
56
|
-
}
|
|
57
|
-
|
|
124
|
+
}
|
|
125
|
+
function NavbarTitle({ children, className, href = "/" }) {
|
|
58
126
|
return /* @__PURE__ */ jsx(Link, {
|
|
59
127
|
href,
|
|
60
128
|
children: /* @__PURE__ */ jsx("span", {
|
|
@@ -62,14 +130,14 @@ const NavbarTitle = ({ children, className, href = "/" }) => {
|
|
|
62
130
|
children
|
|
63
131
|
})
|
|
64
132
|
});
|
|
65
|
-
}
|
|
66
|
-
|
|
133
|
+
}
|
|
134
|
+
function NavbarLinks({ children, className }) {
|
|
67
135
|
return /* @__PURE__ */ jsx("nav", {
|
|
68
136
|
className: cn("hidden md:flex items-center gap-6 text-sm font-medium", className),
|
|
69
137
|
children
|
|
70
138
|
});
|
|
71
|
-
}
|
|
72
|
-
|
|
139
|
+
}
|
|
140
|
+
function NavbarLink({ label, href, to, className }) {
|
|
73
141
|
return /* @__PURE__ */ jsxs(Link, {
|
|
74
142
|
href,
|
|
75
143
|
target: to === "external" ? "_blank" : void 0,
|
|
@@ -79,8 +147,8 @@ const NavbarLink = ({ label, href, to, className }) => {
|
|
|
79
147
|
children: /* @__PURE__ */ jsx(ExternalLink, { size: 12 })
|
|
80
148
|
})]
|
|
81
149
|
});
|
|
82
|
-
}
|
|
83
|
-
|
|
150
|
+
}
|
|
151
|
+
function NavbarDropdown({ label, className, children }) {
|
|
84
152
|
const [isOpen, setIsOpen] = useState(false);
|
|
85
153
|
return /* @__PURE__ */ jsxs("div", {
|
|
86
154
|
className: cn("relative", className),
|
|
@@ -112,30 +180,30 @@ const NavbarDropdown = ({ label, className, children }) => {
|
|
|
112
180
|
})
|
|
113
181
|
})]
|
|
114
182
|
});
|
|
115
|
-
}
|
|
116
|
-
|
|
183
|
+
}
|
|
184
|
+
function NavbarDropdownItem({ href, label, className }) {
|
|
117
185
|
return /* @__PURE__ */ jsx(Link, {
|
|
118
186
|
href,
|
|
119
187
|
className: cn("block px-2 py-1.5 rounded hover:bg-surface", className),
|
|
120
188
|
children: label
|
|
121
189
|
});
|
|
122
|
-
}
|
|
123
|
-
|
|
190
|
+
}
|
|
191
|
+
function NavbarSearchTriggerDesktop({ className, onPress, children }) {
|
|
124
192
|
return /* @__PURE__ */ jsx(Button, {
|
|
125
193
|
onPress,
|
|
126
194
|
className: cn("hidden lg:flex items-center justify-between gap-2 px-3 py-2 text-sm outline-none cursor-pointer w-full max-w-[720px]", className),
|
|
127
195
|
children
|
|
128
196
|
});
|
|
129
|
-
}
|
|
130
|
-
|
|
197
|
+
}
|
|
198
|
+
function NavbarSearchTriggerMobile({ className, onPress, children }) {
|
|
131
199
|
return /* @__PURE__ */ jsx(Button, {
|
|
132
200
|
onPress,
|
|
133
201
|
className: cn("lg:hidden flex h-10 w-10 items-center justify-center outline-none cursor-pointer", className),
|
|
134
202
|
"aria-label": "Search",
|
|
135
203
|
children
|
|
136
204
|
});
|
|
137
|
-
}
|
|
138
|
-
|
|
205
|
+
}
|
|
206
|
+
function NavbarSearchTriggerKbd({ className }) {
|
|
139
207
|
const [mounted, setMounted] = useState(false);
|
|
140
208
|
const isMac = mounted && /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
141
209
|
useEffect(() => {
|
|
@@ -151,13 +219,13 @@ const NavbarSearchTriggerKbd = ({ className }) => {
|
|
|
151
219
|
children: "K"
|
|
152
220
|
})]
|
|
153
221
|
});
|
|
154
|
-
}
|
|
222
|
+
}
|
|
155
223
|
const NavbarSearchTrigger = {
|
|
156
224
|
Desktop: NavbarSearchTriggerDesktop,
|
|
157
225
|
Mobile: NavbarSearchTriggerMobile,
|
|
158
226
|
Kbd: NavbarSearchTriggerKbd
|
|
159
227
|
};
|
|
160
|
-
|
|
228
|
+
function NavbarTheme({ className, theme, onThemeChange }) {
|
|
161
229
|
return /* @__PURE__ */ jsx(ToggleButton, {
|
|
162
230
|
isSelected: theme === "dark",
|
|
163
231
|
onChange: onThemeChange,
|
|
@@ -165,14 +233,14 @@ const NavbarTheme = ({ className, theme, onThemeChange }) => {
|
|
|
165
233
|
"aria-label": "Toggle theme",
|
|
166
234
|
children: theme === "dark" ? /* @__PURE__ */ jsx(Sun, { size: 20 }) : /* @__PURE__ */ jsx(Moon, { size: 20 })
|
|
167
235
|
});
|
|
168
|
-
}
|
|
169
|
-
|
|
236
|
+
}
|
|
237
|
+
function Icon({ name }) {
|
|
170
238
|
if (name === "github") return /* @__PURE__ */ jsx(Github, {});
|
|
171
239
|
if (name === "discord") return /* @__PURE__ */ jsx(Discord, {});
|
|
172
240
|
if (name === "x") return /* @__PURE__ */ jsx(XSocial, {});
|
|
173
241
|
if (name === "bluesky") return /* @__PURE__ */ jsx(Bluesky, {});
|
|
174
|
-
}
|
|
175
|
-
|
|
242
|
+
}
|
|
243
|
+
function NavbarSocials({ icon, link, className }) {
|
|
176
244
|
return /* @__PURE__ */ jsx(Link, {
|
|
177
245
|
href: link,
|
|
178
246
|
target: "_blank",
|
|
@@ -180,22 +248,22 @@ const NavbarSocials = ({ icon, link, className }) => {
|
|
|
180
248
|
className: cn("outline-none", className),
|
|
181
249
|
children: /* @__PURE__ */ jsx(Icon, { name: icon })
|
|
182
250
|
});
|
|
183
|
-
}
|
|
184
|
-
|
|
251
|
+
}
|
|
252
|
+
function NavbarSplit({ className }) {
|
|
185
253
|
return /* @__PURE__ */ jsx(Separator, {
|
|
186
254
|
orientation: "vertical",
|
|
187
255
|
className: cn("h-full w-px", className)
|
|
188
256
|
});
|
|
189
|
-
}
|
|
190
|
-
|
|
257
|
+
}
|
|
258
|
+
function NavbarMore({ onPress, className }) {
|
|
191
259
|
return /* @__PURE__ */ jsx(Button, {
|
|
192
260
|
onPress,
|
|
193
261
|
className: cn("md:hidden flex items-center justify-center outline-none cursor-pointer", className),
|
|
194
262
|
"aria-label": "More navigation",
|
|
195
263
|
children: /* @__PURE__ */ jsx(MoreVertical, { size: 20 })
|
|
196
264
|
});
|
|
197
|
-
}
|
|
198
|
-
|
|
265
|
+
}
|
|
266
|
+
function NavbarMobileMenu({ isOpen, onClose, children, className }) {
|
|
199
267
|
return /* @__PURE__ */ jsx(ModalOverlay, {
|
|
200
268
|
isOpen,
|
|
201
269
|
onOpenChange: (open) => !open && onClose(),
|
|
@@ -220,8 +288,8 @@ const NavbarMobileMenu = ({ isOpen, onClose, children, className }) => {
|
|
|
220
288
|
})
|
|
221
289
|
})
|
|
222
290
|
});
|
|
223
|
-
}
|
|
224
|
-
|
|
291
|
+
}
|
|
292
|
+
function NavbarMobileLink({ label, href, to, onPress, className }) {
|
|
225
293
|
return /* @__PURE__ */ jsx(Link, {
|
|
226
294
|
href,
|
|
227
295
|
target: to === "external" ? "_blank" : void 0,
|
|
@@ -229,7 +297,7 @@ const NavbarMobileLink = ({ label, href, to, onPress, className }) => {
|
|
|
229
297
|
className: cn("group flex items-center outline-none", className),
|
|
230
298
|
children: label
|
|
231
299
|
});
|
|
232
|
-
}
|
|
300
|
+
}
|
|
233
301
|
Navbar.Root = Navbar;
|
|
234
302
|
Navbar.Left = NavbarLeft;
|
|
235
303
|
Navbar.Right = NavbarRight;
|
|
@@ -254,52 +322,62 @@ Navbar.MobileLink = NavbarMobileLink;
|
|
|
254
322
|
/**
|
|
255
323
|
* Pure, unstyled SearchDialog Overlay (maps to RAC.ModalOverlay)
|
|
256
324
|
*/
|
|
257
|
-
|
|
325
|
+
function SearchDialog({ className, ...props }) {
|
|
258
326
|
return /* @__PURE__ */ jsx(RAC.ModalOverlay, {
|
|
259
327
|
className: cn("fixed inset-0 z-100", className),
|
|
260
328
|
...props
|
|
261
329
|
});
|
|
262
|
-
}
|
|
330
|
+
}
|
|
263
331
|
/**
|
|
264
332
|
* Pure, unstyled SearchDialog Content (maps to RAC.Modal)
|
|
265
333
|
*/
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
334
|
+
function SearchDialogContent({ className, ...props }) {
|
|
335
|
+
return /* @__PURE__ */ jsx(RAC.Modal, {
|
|
336
|
+
className: cn(className),
|
|
337
|
+
...props
|
|
338
|
+
});
|
|
339
|
+
}
|
|
270
340
|
/**
|
|
271
341
|
* Pure, unstyled SearchDialog Dialog (maps to RAC.Dialog)
|
|
272
342
|
*/
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
343
|
+
function SearchDialogDialog({ className, ...props }) {
|
|
344
|
+
return /* @__PURE__ */ jsx(RAC.Dialog, {
|
|
345
|
+
className: cn("flex flex-col focus:outline-none", className),
|
|
346
|
+
...props
|
|
347
|
+
});
|
|
348
|
+
}
|
|
277
349
|
/**
|
|
278
350
|
* Pure, unstyled SearchDialog Input Field (maps to RAC.SearchField)
|
|
279
351
|
*/
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
352
|
+
function SearchDialogField({ className, ...props }) {
|
|
353
|
+
return /* @__PURE__ */ jsx(RAC.SearchField, {
|
|
354
|
+
className: cn("flex items-center", className),
|
|
355
|
+
...props
|
|
356
|
+
});
|
|
357
|
+
}
|
|
284
358
|
/**
|
|
285
359
|
* Pure, unstyled SearchInput (maps to RAC.Input)
|
|
286
360
|
*/
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
361
|
+
function SearchDialogSearchInput({ className, ...props }) {
|
|
362
|
+
return /* @__PURE__ */ jsx(RAC.Input, {
|
|
363
|
+
className: cn("w-full bg-transparent outline-none border-none", className),
|
|
364
|
+
...props
|
|
365
|
+
});
|
|
366
|
+
}
|
|
291
367
|
/**
|
|
292
368
|
* Pure, unstyled Clear Button (maps to RAC.Button with slot="clear")
|
|
293
369
|
*/
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
370
|
+
function SearchDialogClearButton({ className, ...props }) {
|
|
371
|
+
return /* @__PURE__ */ jsx(RAC.Button, {
|
|
372
|
+
slot: "clear",
|
|
373
|
+
className: cn(className),
|
|
374
|
+
...props
|
|
375
|
+
});
|
|
376
|
+
}
|
|
299
377
|
/**
|
|
300
378
|
* Pure, unstyled Autocomplete container (maps to RAC.Autocomplete)
|
|
301
379
|
*/
|
|
302
|
-
|
|
380
|
+
function SearchDialogAutocomplete({ children, className, onSelectionChange, ...props }) {
|
|
303
381
|
const Autocomplete = RAC.Autocomplete;
|
|
304
382
|
return /* @__PURE__ */ jsx("div", {
|
|
305
383
|
className: cn("flex-1 min-h-0", className),
|
|
@@ -310,21 +388,21 @@ const SearchDialogAutocomplete = ({ children, className, onSelectionChange, ...p
|
|
|
310
388
|
children
|
|
311
389
|
})
|
|
312
390
|
});
|
|
313
|
-
}
|
|
391
|
+
}
|
|
314
392
|
/**
|
|
315
393
|
* Pure, unstyled List Box (maps to RAC.ListBox)
|
|
316
394
|
*/
|
|
317
|
-
|
|
395
|
+
function SearchDialogList({ children, className, ...props }) {
|
|
318
396
|
return /* @__PURE__ */ jsx(RAC.ListBox, {
|
|
319
397
|
...props,
|
|
320
398
|
className: cn("flex-1 overflow-y-auto outline-none min-h-0", className),
|
|
321
399
|
children
|
|
322
400
|
});
|
|
323
|
-
}
|
|
401
|
+
}
|
|
324
402
|
/**
|
|
325
403
|
* Pure, unstyled List Box Item (maps to RAC.ListBoxItem)
|
|
326
404
|
*/
|
|
327
|
-
|
|
405
|
+
function SearchDialogItemRoot({ children, className, ...props }) {
|
|
328
406
|
return /* @__PURE__ */ jsx(RAC.ListBoxItem, {
|
|
329
407
|
...props,
|
|
330
408
|
className: cn("group flex items-center outline-none cursor-pointer", className),
|
|
@@ -336,25 +414,25 @@ const SearchDialogItemRoot = ({ children, className, ...props }) => {
|
|
|
336
414
|
}), /* @__PURE__ */ jsx(CornerDownLeft, { size: 10 })]
|
|
337
415
|
})] })
|
|
338
416
|
});
|
|
339
|
-
}
|
|
340
|
-
|
|
417
|
+
}
|
|
418
|
+
function SearchDialogItemIcon({ isHeading, className }) {
|
|
341
419
|
return /* @__PURE__ */ jsx("div", {
|
|
342
420
|
className: cn("shrink-0", className),
|
|
343
421
|
children: isHeading ? /* @__PURE__ */ jsx(Hash, { size: 18 }) : /* @__PURE__ */ jsx(FileText, { size: 18 })
|
|
344
422
|
});
|
|
345
|
-
}
|
|
346
|
-
|
|
423
|
+
}
|
|
424
|
+
function SearchDialogItemTitle({ children, className }) {
|
|
347
425
|
return /* @__PURE__ */ jsx("span", {
|
|
348
426
|
className: cn("block truncate flex-1", className),
|
|
349
427
|
children
|
|
350
428
|
});
|
|
351
|
-
}
|
|
352
|
-
|
|
429
|
+
}
|
|
430
|
+
function SearchDialogItemBio({ children, className }) {
|
|
353
431
|
return /* @__PURE__ */ jsx("span", {
|
|
354
432
|
className: cn("ml-2 truncate hidden sm:inline", className),
|
|
355
433
|
children
|
|
356
434
|
});
|
|
357
|
-
}
|
|
435
|
+
}
|
|
358
436
|
SearchDialog.Root = SearchDialog;
|
|
359
437
|
SearchDialog.Overlay = SearchDialog;
|
|
360
438
|
SearchDialog.Content = SearchDialogContent;
|
|
@@ -372,4 +450,4 @@ SearchDialog.Item = Object.assign(SearchDialogItemRoot, {
|
|
|
372
450
|
});
|
|
373
451
|
|
|
374
452
|
//#endregion
|
|
375
|
-
export { Navbar as n, SearchDialog as t };
|
|
453
|
+
export { Button$1 as a, ErrorBoundaryFallback as i, Navbar as n, ErrorBoundary as r, SearchDialog as t };
|