boltdocs 2.7.10 → 2.8.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/README.md +2 -2
- 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 +2268 -1
- package/dist/client/index.d.cts +86 -110
- package/dist/client/index.d.ts +87 -111
- package/dist/client/index.js +2214 -1
- package/dist/client/mdx.cjs +12 -1
- package/dist/client/mdx.d.cts +39 -93
- package/dist/client/mdx.d.ts +38 -93
- package/dist/client/mdx.js +7 -1
- package/dist/client/primitives.cjs +60 -1
- package/dist/client/primitives.d.cts +411 -347
- package/dist/client/primitives.d.ts +411 -347
- package/dist/client/primitives.js +20 -1
- package/dist/docs-layout-CwCq42Zt.cjs +1348 -0
- package/dist/docs-layout-Dn6S5g59.js +1167 -0
- 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-DvJ-hh9x.cjs +1209 -0
- package/dist/icons-dev-Oju24Wjp.js +845 -0
- package/dist/image-Ch4-GxdO.cjs +268 -0
- package/dist/image-Do8V9PCW.js +214 -0
- package/dist/mdx-D3A2_l7P.js +520 -0
- package/dist/mdx-PLhhPJRS.cjs +531 -0
- 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-BmlP0eBP.cjs +159 -0
- package/dist/node-Y8_4ayje.mjs +159 -0
- package/dist/package-2nFy_NsW.cjs +6 -0
- package/dist/{package--0Yf0t1N.mjs → package-DAbtltXX.mjs} +1 -1
- package/dist/parser-B7-6PyQz.cjs +6 -0
- package/dist/{parser-Aq8LoH-0.cjs → parser-BzB-zCkF.cjs} +1 -1
- package/dist/parser-WGZdWs0X.mjs +6 -0
- package/dist/routes-BDDSxAl0.mjs +6 -0
- package/dist/routes-DJNJ-rTt.cjs +6 -0
- package/dist/routes-DiYC4nD2.cjs +6 -0
- package/dist/routes-_Bb2f4eI.mjs +6 -0
- package/dist/search-dialog-BXVoecTx.cjs +483 -0
- package/dist/search-dialog-BYhOov4S.cjs +331 -0
- package/dist/search-dialog-C09riYmx.js +313 -0
- package/dist/search-dialog-CUeAfy-8.cjs +8 -0
- package/dist/search-dialog-D8gLkhUV.js +453 -0
- package/dist/search-dialog-DHc_8FFX.js +8 -0
- package/dist/{sidebar-CcBkrm06.d.cts → sidebar-DNq4_ZAa.d.ts} +118 -52
- package/dist/{sidebar-CyZS9YOm.d.ts → sidebar-Dlkgbxs6.d.cts} +118 -52
- 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 +5 -6
- 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/docs-layout-KoWNZc8_.js +0 -6
- package/dist/docs-layout-x2yKt2cL.cjs +0 -6
- package/dist/doctor-Be7Ly1oM.mjs +0 -21
- package/dist/doctor-jMxWZyLJ.cjs +0 -21
- package/dist/icons-dev-B_RZIyxu.js +0 -6
- package/dist/icons-dev-BlV3wWFT.cjs +0 -6
- package/dist/image-BHhTvQzr.cjs +0 -6
- package/dist/image-CqKzYD8f.js +0 -6
- package/dist/mdx-DudBEac0.js +0 -7
- package/dist/mdx-r4cDQxWu.cjs +0 -7
- package/dist/node-DtEDyN1u.cjs +0 -111
- package/dist/node-_1jhMGYx.mjs +0 -111
- package/dist/package-DrwtlXfk.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/search-dialog-B584t9ZF.js +0 -6
- package/dist/search-dialog-BvBopRsZ.cjs +0 -6
- package/dist/search-dialog-ByvGScjt.js +0 -6
- package/dist/search-dialog-Cyko6TJm.cjs +0 -6
- package/dist/search-dialog-D6BNohIJ.js +0 -6
- package/dist/search-dialog-DuYTIefy.cjs +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/src/client/app/config-context.tsx +0 -51
- package/src/client/app/doc-page.tsx +0 -38
- package/src/client/app/docs-layout.tsx +0 -28
- package/src/client/app/head.tsx +0 -122
- package/src/client/app/helmet-compat.tsx +0 -36
- package/src/client/app/mdx-component.tsx +0 -8
- package/src/client/app/mdx-components-context.tsx +0 -72
- package/src/client/app/routes-context.tsx +0 -34
- package/src/client/app/scroll-handler.tsx +0 -74
- package/src/client/app/theme-context.tsx +0 -103
- package/src/client/app/ui-context.tsx +0 -42
- package/src/client/components/docs-layout-default.tsx +0 -85
- package/src/client/components/icons-dev.tsx +0 -282
- package/src/client/components/mdx/callout.tsx +0 -97
- package/src/client/components/mdx/card.tsx +0 -99
- package/src/client/components/mdx/cards.tsx +0 -27
- package/src/client/components/mdx/code-block.tsx +0 -184
- package/src/client/components/mdx/field.tsx +0 -33
- package/src/client/components/mdx/image.tsx +0 -44
- package/src/client/components/mdx/index.ts +0 -19
- package/src/client/components/mdx/table.tsx +0 -54
- package/src/client/components/mdx/typographics.tsx +0 -120
- package/src/client/components/mdx/use-code-block.ts +0 -34
- package/src/client/components/primitives/breadcrumbs.tsx +0 -54
- package/src/client/components/primitives/button-group.tsx +0 -54
- package/src/client/components/primitives/button.tsx +0 -6
- package/src/client/components/primitives/code-block.tsx +0 -120
- package/src/client/components/primitives/docs-layout.tsx +0 -125
- package/src/client/components/primitives/error-boundary.tsx +0 -107
- package/src/client/components/primitives/heading.tsx +0 -128
- package/src/client/components/primitives/helpers/observer.ts +0 -141
- package/src/client/components/primitives/image.tsx +0 -26
- package/src/client/components/primitives/link.tsx +0 -102
- package/src/client/components/primitives/menu.tsx +0 -137
- package/src/client/components/primitives/navbar.tsx +0 -466
- package/src/client/components/primitives/on-this-page.tsx +0 -430
- package/src/client/components/primitives/page-nav.tsx +0 -51
- package/src/client/components/primitives/popover.tsx +0 -28
- package/src/client/components/primitives/search-dialog.tsx +0 -193
- package/src/client/components/primitives/sidebar.tsx +0 -423
- package/src/client/components/primitives/skeleton.tsx +0 -26
- package/src/client/components/primitives/tabs.tsx +0 -70
- package/src/client/components/primitives/tooltip.tsx +0 -81
- package/src/client/components/primitives/types.ts +0 -11
- package/src/client/components/ui-base/banner.tsx +0 -66
- package/src/client/components/ui-base/breadcrumbs.tsx +0 -44
- package/src/client/components/ui-base/copy-markdown.tsx +0 -107
- package/src/client/components/ui-base/error-boundary.tsx +0 -15
- package/src/client/components/ui-base/github-stars.tsx +0 -29
- package/src/client/components/ui-base/icons.tsx +0 -240
- package/src/client/components/ui-base/index.ts +0 -16
- package/src/client/components/ui-base/last-updated.tsx +0 -27
- package/src/client/components/ui-base/navbar.tsx +0 -266
- package/src/client/components/ui-base/not-found.tsx +0 -26
- package/src/client/components/ui-base/on-this-page.tsx +0 -57
- package/src/client/components/ui-base/page-nav.tsx +0 -50
- package/src/client/components/ui-base/search-dialog.tsx +0 -163
- package/src/client/components/ui-base/search-highlight.tsx +0 -10
- package/src/client/components/ui-base/sidebar.tsx +0 -92
- package/src/client/components/ui-base/tabs.tsx +0 -83
- package/src/client/components/ui-base/theme-toggle.tsx +0 -130
- package/src/client/components/ui-base/version-i18n.tsx +0 -80
- package/src/client/hooks/index.ts +0 -13
- package/src/client/hooks/use-analytics.ts +0 -272
- package/src/client/hooks/use-breadcrumbs.ts +0 -22
- package/src/client/hooks/use-i18n.ts +0 -182
- package/src/client/hooks/use-localized-to.ts +0 -113
- package/src/client/hooks/use-location.ts +0 -5
- package/src/client/hooks/use-navbar.ts +0 -130
- package/src/client/hooks/use-page-nav.ts +0 -46
- package/src/client/hooks/use-routes.ts +0 -108
- package/src/client/hooks/use-search-highlight.ts +0 -185
- package/src/client/hooks/use-search.ts +0 -118
- package/src/client/hooks/use-sidebar.ts +0 -205
- package/src/client/hooks/use-tabs.ts +0 -46
- package/src/client/hooks/use-version.ts +0 -111
- package/src/client/index.ts +0 -31
- package/src/client/mdx.ts +0 -2
- package/src/client/primitives.ts +0 -19
- package/src/client/ssg/boltdocs-shell.tsx +0 -148
- package/src/client/ssg/create-routes.tsx +0 -473
- package/src/client/ssg/index.ts +0 -4
- package/src/client/ssg/mdx-page.tsx +0 -38
- package/src/client/store/boltdocs-context.tsx +0 -137
- package/src/client/theme/neutral.css +0 -141
- package/src/client/theme/reset.css +0 -189
- package/src/client/types.ts +0 -116
- package/src/client/utils/cn.ts +0 -6
- package/src/client/utils/copy-clipboard.ts +0 -22
- package/src/client/utils/get-base-file-path.ts +0 -21
- package/src/client/utils/github.ts +0 -121
- package/src/client/utils/i18n.ts +0 -23
- package/src/client/utils/path.ts +0 -9
- package/src/client/utils/react-to-text.ts +0 -34
- package/src/client/virtual.d.ts +0 -24
- /package/dist/{meta-loader-CWg2gnbY.mjs → meta-loader-DzwDFtdT.mjs} +0 -0
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
+
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
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
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import * as RAC from "react-aria-components";
|
|
10
|
+
import { Button, Dialog, Modal, ModalOverlay, Separator, ToggleButton } from "react-aria-components";
|
|
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
|
|
80
|
+
//#region src/client/components/primitives/navbar.tsx
|
|
81
|
+
function Navbar({ children, className, ...props }) {
|
|
82
|
+
return /* @__PURE__ */ jsx("header", {
|
|
83
|
+
className: cn("boltdocs-navbar sticky top-0 z-50 w-full", className),
|
|
84
|
+
...props,
|
|
85
|
+
children
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function NavbarContent({ children, className }) {
|
|
89
|
+
return /* @__PURE__ */ jsx("div", {
|
|
90
|
+
className: cn("mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6", className),
|
|
91
|
+
children
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function NavbarLeft({ children, className }) {
|
|
95
|
+
return /* @__PURE__ */ jsx("div", {
|
|
96
|
+
className: cn("flex flex-1 items-center justify-start gap-4 min-w-0", className),
|
|
97
|
+
children
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function NavbarRight({ children, className }) {
|
|
101
|
+
return /* @__PURE__ */ jsx("div", {
|
|
102
|
+
className: cn("flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0", className),
|
|
103
|
+
children
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function NavbarCenter({ children, className }) {
|
|
107
|
+
return /* @__PURE__ */ jsx("div", {
|
|
108
|
+
className: cn("hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full", className),
|
|
109
|
+
children
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function NavbarLogo({ src, alt, width = 24, height = 24, className, href = "/" }) {
|
|
113
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
114
|
+
href,
|
|
115
|
+
className: cn("flex items-center gap-2 shrink-0 outline-none", className),
|
|
116
|
+
children: src ? /* @__PURE__ */ jsx("img", {
|
|
117
|
+
src,
|
|
118
|
+
alt,
|
|
119
|
+
width,
|
|
120
|
+
height,
|
|
121
|
+
className: "h-6 w-6 object-contain"
|
|
122
|
+
}) : null
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function NavbarTitle({ children, className, href = "/" }) {
|
|
126
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
127
|
+
href,
|
|
128
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
129
|
+
className: cn("text-lg font-bold tracking-tight hidden sm:inline-block", className),
|
|
130
|
+
children
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function NavbarLinks({ children, className }) {
|
|
135
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
136
|
+
className: cn("hidden md:flex items-center gap-6 text-sm font-medium", className),
|
|
137
|
+
children
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function NavbarLink({ label, href, to, className }) {
|
|
141
|
+
return /* @__PURE__ */ jsxs(Link, {
|
|
142
|
+
href,
|
|
143
|
+
target: to === "external" ? "_blank" : void 0,
|
|
144
|
+
className: cn("transition-all outline-none", className),
|
|
145
|
+
children: [label, to === "external" && /* @__PURE__ */ jsx("span", {
|
|
146
|
+
className: "ml-1 inline-block",
|
|
147
|
+
children: /* @__PURE__ */ jsx(ExternalLink, { size: 12 })
|
|
148
|
+
})]
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function NavbarDropdown({ label, className, children }) {
|
|
152
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
153
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
154
|
+
className: cn("relative", className),
|
|
155
|
+
onMouseEnter: () => {
|
|
156
|
+
setIsOpen(true);
|
|
157
|
+
},
|
|
158
|
+
onMouseLeave: () => {
|
|
159
|
+
setIsOpen(false);
|
|
160
|
+
},
|
|
161
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
162
|
+
className: cn("flex items-center gap-1 outline-none cursor-pointer select-none font-medium text-muted hover:text-body transition-colors"),
|
|
163
|
+
children: [label, /* @__PURE__ */ jsx("svg", {
|
|
164
|
+
className: cn("w-4 h-4 transition-transform", isOpen && "rotate-180"),
|
|
165
|
+
fill: "none",
|
|
166
|
+
viewBox: "0 0 24 24",
|
|
167
|
+
stroke: "currentColor",
|
|
168
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
169
|
+
strokeLinecap: "round",
|
|
170
|
+
strokeLinejoin: "round",
|
|
171
|
+
strokeWidth: 2,
|
|
172
|
+
d: "M19 9l-7 7-7-7"
|
|
173
|
+
})
|
|
174
|
+
})]
|
|
175
|
+
}), isOpen && /* @__PURE__ */ jsx("div", {
|
|
176
|
+
className: "absolute top-full left-0 pt-1 z-[9999]",
|
|
177
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
178
|
+
className: "min-w-[180px] p-1 bg-surface border border-subtle rounded-md shadow-lg",
|
|
179
|
+
children
|
|
180
|
+
})
|
|
181
|
+
})]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function NavbarDropdownItem({ href, label, className }) {
|
|
185
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
186
|
+
href,
|
|
187
|
+
className: cn("block px-2 py-1.5 rounded hover:bg-surface", className),
|
|
188
|
+
children: label
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
function NavbarSearchTriggerDesktop({ className, onPress, children }) {
|
|
192
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
193
|
+
onPress,
|
|
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),
|
|
195
|
+
children
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function NavbarSearchTriggerMobile({ className, onPress, children }) {
|
|
199
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
200
|
+
onPress,
|
|
201
|
+
className: cn("lg:hidden flex h-10 w-10 items-center justify-center outline-none cursor-pointer", className),
|
|
202
|
+
"aria-label": "Search",
|
|
203
|
+
children
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
function NavbarSearchTriggerKbd({ className }) {
|
|
207
|
+
const [mounted, setMounted] = useState(false);
|
|
208
|
+
const isMac = mounted && /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
209
|
+
useEffect(() => {
|
|
210
|
+
setMounted(true);
|
|
211
|
+
}, []);
|
|
212
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
213
|
+
className: cn("hidden sm:flex items-center gap-1 pointer-events-none select-none", className),
|
|
214
|
+
children: [/* @__PURE__ */ jsx("kbd", {
|
|
215
|
+
className: "flex items-center justify-center font-mono text-[10px]",
|
|
216
|
+
children: isMac ? "⌘" : "Ctrl"
|
|
217
|
+
}), /* @__PURE__ */ jsx("kbd", {
|
|
218
|
+
className: "flex items-center justify-center font-mono text-[10px]",
|
|
219
|
+
children: "K"
|
|
220
|
+
})]
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
const NavbarSearchTrigger = {
|
|
224
|
+
Desktop: NavbarSearchTriggerDesktop,
|
|
225
|
+
Mobile: NavbarSearchTriggerMobile,
|
|
226
|
+
Kbd: NavbarSearchTriggerKbd
|
|
227
|
+
};
|
|
228
|
+
function NavbarTheme({ className, theme, onThemeChange }) {
|
|
229
|
+
return /* @__PURE__ */ jsx(ToggleButton, {
|
|
230
|
+
isSelected: theme === "dark",
|
|
231
|
+
onChange: onThemeChange,
|
|
232
|
+
className: cn("outline-none cursor-pointer", className),
|
|
233
|
+
"aria-label": "Toggle theme",
|
|
234
|
+
children: theme === "dark" ? /* @__PURE__ */ jsx(Sun, { size: 20 }) : /* @__PURE__ */ jsx(Moon, { size: 20 })
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
function Icon({ name }) {
|
|
238
|
+
if (name === "github") return /* @__PURE__ */ jsx(Github, {});
|
|
239
|
+
if (name === "discord") return /* @__PURE__ */ jsx(Discord, {});
|
|
240
|
+
if (name === "x") return /* @__PURE__ */ jsx(XSocial, {});
|
|
241
|
+
if (name === "bluesky") return /* @__PURE__ */ jsx(Bluesky, {});
|
|
242
|
+
}
|
|
243
|
+
function NavbarSocials({ icon, link, className }) {
|
|
244
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
245
|
+
href: link,
|
|
246
|
+
target: "_blank",
|
|
247
|
+
rel: "noopener noreferrer",
|
|
248
|
+
className: cn("outline-none", className),
|
|
249
|
+
children: /* @__PURE__ */ jsx(Icon, { name: icon })
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
function NavbarSplit({ className }) {
|
|
253
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
254
|
+
orientation: "vertical",
|
|
255
|
+
className: cn("h-full w-px", className)
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
function NavbarMore({ onPress, className }) {
|
|
259
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
260
|
+
onPress,
|
|
261
|
+
className: cn("md:hidden flex items-center justify-center outline-none cursor-pointer", className),
|
|
262
|
+
"aria-label": "More navigation",
|
|
263
|
+
children: /* @__PURE__ */ jsx(MoreVertical, { size: 20 })
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
function NavbarMobileMenu({ isOpen, onClose, children, className }) {
|
|
267
|
+
return /* @__PURE__ */ jsx(ModalOverlay, {
|
|
268
|
+
isOpen,
|
|
269
|
+
onOpenChange: (open) => !open && onClose(),
|
|
270
|
+
isDismissable: true,
|
|
271
|
+
className: cn("fixed inset-0 z-60 md:hidden transition-all duration-100", className),
|
|
272
|
+
children: /* @__PURE__ */ jsx(Modal, {
|
|
273
|
+
className: "fixed inset-0 outline-none",
|
|
274
|
+
children: /* @__PURE__ */ jsxs(Dialog, {
|
|
275
|
+
className: "relative h-full outline-none flex flex-col p-6 pt-[calc(1.5rem+env(safe-area-inset-top,0px))] pb-[calc(1.5rem+env(safe-area-inset-bottom,0px))] px-[calc(1.5rem+env(safe-area-inset-left,0px))]",
|
|
276
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
277
|
+
className: "flex items-center justify-between mb-6",
|
|
278
|
+
children: [/* @__PURE__ */ jsx("span", {}), /* @__PURE__ */ jsx(Button, {
|
|
279
|
+
onPress: onClose,
|
|
280
|
+
className: "flex items-center justify-center outline-none cursor-pointer text-muted hover:text-body transition-colors",
|
|
281
|
+
"aria-label": "Close menu",
|
|
282
|
+
children: /* @__PURE__ */ jsx(X, { size: 24 })
|
|
283
|
+
})]
|
|
284
|
+
}), /* @__PURE__ */ jsx("nav", {
|
|
285
|
+
className: "flex-1 overflow-y-auto flex flex-col gap-4",
|
|
286
|
+
children
|
|
287
|
+
})]
|
|
288
|
+
})
|
|
289
|
+
})
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
function NavbarMobileLink({ label, href, to, onPress, className }) {
|
|
293
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
294
|
+
href,
|
|
295
|
+
target: to === "external" ? "_blank" : void 0,
|
|
296
|
+
onClick: onPress,
|
|
297
|
+
className: cn("group flex items-center outline-none", className),
|
|
298
|
+
children: label
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
Navbar.Root = Navbar;
|
|
302
|
+
Navbar.Left = NavbarLeft;
|
|
303
|
+
Navbar.Right = NavbarRight;
|
|
304
|
+
Navbar.Center = NavbarCenter;
|
|
305
|
+
Navbar.Logo = NavbarLogo;
|
|
306
|
+
Navbar.Title = NavbarTitle;
|
|
307
|
+
Navbar.Links = NavbarLinks;
|
|
308
|
+
Navbar.Link = NavbarLink;
|
|
309
|
+
Navbar.Dropdown = NavbarDropdown;
|
|
310
|
+
Navbar.DropdownItem = NavbarDropdownItem;
|
|
311
|
+
Navbar.SearchTrigger = NavbarSearchTrigger;
|
|
312
|
+
Navbar.Theme = NavbarTheme;
|
|
313
|
+
Navbar.Socials = NavbarSocials;
|
|
314
|
+
Navbar.Split = NavbarSplit;
|
|
315
|
+
Navbar.Content = NavbarContent;
|
|
316
|
+
Navbar.More = NavbarMore;
|
|
317
|
+
Navbar.MobileMenu = NavbarMobileMenu;
|
|
318
|
+
Navbar.MobileLink = NavbarMobileLink;
|
|
319
|
+
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region src/client/components/primitives/search-dialog.tsx
|
|
322
|
+
/**
|
|
323
|
+
* Pure, unstyled SearchDialog Overlay (maps to RAC.ModalOverlay)
|
|
324
|
+
*/
|
|
325
|
+
function SearchDialog({ className, ...props }) {
|
|
326
|
+
return /* @__PURE__ */ jsx(RAC.ModalOverlay, {
|
|
327
|
+
className: cn("fixed inset-0 z-100", className),
|
|
328
|
+
...props
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Pure, unstyled SearchDialog Content (maps to RAC.Modal)
|
|
333
|
+
*/
|
|
334
|
+
function SearchDialogContent({ className, ...props }) {
|
|
335
|
+
return /* @__PURE__ */ jsx(RAC.Modal, {
|
|
336
|
+
className: cn(className),
|
|
337
|
+
...props
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Pure, unstyled SearchDialog Dialog (maps to RAC.Dialog)
|
|
342
|
+
*/
|
|
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
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Pure, unstyled SearchDialog Input Field (maps to RAC.SearchField)
|
|
351
|
+
*/
|
|
352
|
+
function SearchDialogField({ className, ...props }) {
|
|
353
|
+
return /* @__PURE__ */ jsx(RAC.SearchField, {
|
|
354
|
+
className: cn("flex items-center", className),
|
|
355
|
+
...props
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Pure, unstyled SearchInput (maps to RAC.Input)
|
|
360
|
+
*/
|
|
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
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Pure, unstyled Clear Button (maps to RAC.Button with slot="clear")
|
|
369
|
+
*/
|
|
370
|
+
function SearchDialogClearButton({ className, ...props }) {
|
|
371
|
+
return /* @__PURE__ */ jsx(RAC.Button, {
|
|
372
|
+
slot: "clear",
|
|
373
|
+
className: cn(className),
|
|
374
|
+
...props
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Pure, unstyled Autocomplete container (maps to RAC.Autocomplete)
|
|
379
|
+
*/
|
|
380
|
+
function SearchDialogAutocomplete({ children, className, onSelectionChange, ...props }) {
|
|
381
|
+
const Autocomplete = RAC.Autocomplete;
|
|
382
|
+
return /* @__PURE__ */ jsx("div", {
|
|
383
|
+
className: cn("flex-1 min-h-0", className),
|
|
384
|
+
children: /* @__PURE__ */ jsx(Autocomplete, {
|
|
385
|
+
...props,
|
|
386
|
+
onSelectionChange,
|
|
387
|
+
className: "flex flex-col min-h-0",
|
|
388
|
+
children
|
|
389
|
+
})
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Pure, unstyled List Box (maps to RAC.ListBox)
|
|
394
|
+
*/
|
|
395
|
+
function SearchDialogList({ children, className, ...props }) {
|
|
396
|
+
return /* @__PURE__ */ jsx(RAC.ListBox, {
|
|
397
|
+
...props,
|
|
398
|
+
className: cn("flex-1 overflow-y-auto outline-none min-h-0", className),
|
|
399
|
+
children
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Pure, unstyled List Box Item (maps to RAC.ListBoxItem)
|
|
404
|
+
*/
|
|
405
|
+
function SearchDialogItemRoot({ children, className, ...props }) {
|
|
406
|
+
return /* @__PURE__ */ jsx(RAC.ListBoxItem, {
|
|
407
|
+
...props,
|
|
408
|
+
className: cn("group flex items-center outline-none cursor-pointer", className),
|
|
409
|
+
children: (itemProps) => /* @__PURE__ */ jsxs(Fragment, { children: [children, (itemProps.isFocused || itemProps.isSelected) && /* @__PURE__ */ jsxs("div", {
|
|
410
|
+
className: "ml-auto opacity-50 flex items-center gap-1",
|
|
411
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
412
|
+
className: "text-[10px]",
|
|
413
|
+
children: "Select"
|
|
414
|
+
}), /* @__PURE__ */ jsx(CornerDownLeft, { size: 10 })]
|
|
415
|
+
})] })
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
function SearchDialogItemIcon({ isHeading, className }) {
|
|
419
|
+
return /* @__PURE__ */ jsx("div", {
|
|
420
|
+
className: cn("shrink-0", className),
|
|
421
|
+
children: isHeading ? /* @__PURE__ */ jsx(Hash, { size: 18 }) : /* @__PURE__ */ jsx(FileText, { size: 18 })
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
function SearchDialogItemTitle({ children, className }) {
|
|
425
|
+
return /* @__PURE__ */ jsx("span", {
|
|
426
|
+
className: cn("block truncate flex-1", className),
|
|
427
|
+
children
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
function SearchDialogItemBio({ children, className }) {
|
|
431
|
+
return /* @__PURE__ */ jsx("span", {
|
|
432
|
+
className: cn("ml-2 truncate hidden sm:inline", className),
|
|
433
|
+
children
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
SearchDialog.Root = SearchDialog;
|
|
437
|
+
SearchDialog.Overlay = SearchDialog;
|
|
438
|
+
SearchDialog.Content = SearchDialogContent;
|
|
439
|
+
SearchDialog.Dialog = SearchDialogDialog;
|
|
440
|
+
SearchDialog.Autocomplete = SearchDialogAutocomplete;
|
|
441
|
+
SearchDialog.List = SearchDialogList;
|
|
442
|
+
SearchDialog.Input = Object.assign(SearchDialogField, {
|
|
443
|
+
SearchInput: SearchDialogSearchInput,
|
|
444
|
+
Button: SearchDialogClearButton
|
|
445
|
+
});
|
|
446
|
+
SearchDialog.Item = Object.assign(SearchDialogItemRoot, {
|
|
447
|
+
Icon: SearchDialogItemIcon,
|
|
448
|
+
Title: SearchDialogItemTitle,
|
|
449
|
+
Bio: SearchDialogItemBio
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
//#endregion
|
|
453
|
+
export { Button$1 as a, ErrorBoundaryFallback as i, Navbar as n, ErrorBoundary as r, SearchDialog as t };
|