@usecross/docs 0.6.0 → 0.7.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/index.d.ts +16 -4
- package/dist/index.js +353 -161
- package/dist/index.js.map +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/{types-CR-kx8KP.d.ts → types-DlF8TX2Q.d.ts} +20 -1
- package/package.json +1 -1
- package/src/components/DocSetSelector.tsx +239 -0
- package/src/components/DocsLayout.tsx +9 -9
- package/src/components/Sidebar.tsx +12 -2
- package/src/components/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/styles.css +3 -0
- package/src/types.ts +20 -0
package/dist/index.js
CHANGED
|
@@ -117,36 +117,227 @@ function InlineCode({ children }) {
|
|
|
117
117
|
return /* @__PURE__ */ jsx("code", { className: "rounded bg-slate-100 px-1.5 py-0.5 text-sm font-medium text-slate-800", children });
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
// src/components/
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
|
|
124
|
-
// src/components/Sidebar.tsx
|
|
125
|
-
import { Link } from "@inertiajs/react";
|
|
120
|
+
// src/components/DocSetSelector.tsx
|
|
121
|
+
import { useState as useState2, useRef, useEffect as useEffect2 } from "react";
|
|
122
|
+
import { router } from "@inertiajs/react";
|
|
126
123
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
var ChevronUpDownIcon = ({ className }) => /* @__PURE__ */ jsx2(
|
|
125
|
+
"svg",
|
|
126
|
+
{
|
|
127
|
+
className,
|
|
128
|
+
viewBox: "0 0 16 16",
|
|
129
|
+
fill: "none",
|
|
130
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
131
|
+
children: /* @__PURE__ */ jsx2(
|
|
132
|
+
"path",
|
|
133
|
+
{
|
|
134
|
+
d: "M5 6l3-3 3 3M5 10l3 3 3-3",
|
|
135
|
+
stroke: "currentColor",
|
|
136
|
+
strokeWidth: "1.5",
|
|
137
|
+
strokeLinecap: "round",
|
|
138
|
+
strokeLinejoin: "round"
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
var CheckIcon = ({ className }) => /* @__PURE__ */ jsx2(
|
|
144
|
+
"svg",
|
|
145
|
+
{
|
|
146
|
+
className,
|
|
147
|
+
viewBox: "0 0 16 16",
|
|
148
|
+
fill: "none",
|
|
149
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
150
|
+
children: /* @__PURE__ */ jsx2(
|
|
151
|
+
"path",
|
|
152
|
+
{
|
|
153
|
+
d: "M3.5 8.5l3 3 6-6.5",
|
|
154
|
+
stroke: "currentColor",
|
|
155
|
+
strokeWidth: "1.75",
|
|
156
|
+
strokeLinecap: "round",
|
|
157
|
+
strokeLinejoin: "round"
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
var PackageIcon = ({ className }) => /* @__PURE__ */ jsxs2(
|
|
163
|
+
"svg",
|
|
164
|
+
{
|
|
165
|
+
className,
|
|
166
|
+
viewBox: "0 0 20 20",
|
|
167
|
+
fill: "none",
|
|
168
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
169
|
+
children: [
|
|
170
|
+
/* @__PURE__ */ jsx2(
|
|
171
|
+
"path",
|
|
172
|
+
{
|
|
173
|
+
d: "M10 2L17 6v8l-7 4-7-4V6l7-4z",
|
|
174
|
+
stroke: "currentColor",
|
|
175
|
+
strokeWidth: "1.5",
|
|
176
|
+
strokeLinejoin: "round"
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
/* @__PURE__ */ jsx2(
|
|
180
|
+
"path",
|
|
181
|
+
{
|
|
182
|
+
d: "M10 10v8M10 10l7-4M10 10L3 6",
|
|
183
|
+
stroke: "currentColor",
|
|
184
|
+
strokeWidth: "1.5",
|
|
185
|
+
strokeLinecap: "round",
|
|
186
|
+
strokeLinejoin: "round"
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
function DocSetSelector({ docSets, currentDocSet, className }) {
|
|
193
|
+
const [isOpen, setIsOpen] = useState2(false);
|
|
194
|
+
const dropdownRef = useRef(null);
|
|
195
|
+
const current = docSets.find((ds) => ds.slug === currentDocSet) || docSets[0];
|
|
196
|
+
useEffect2(() => {
|
|
197
|
+
const handleClickOutside = (event) => {
|
|
198
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
199
|
+
setIsOpen(false);
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
if (isOpen) {
|
|
203
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
204
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
205
|
+
}
|
|
206
|
+
}, [isOpen]);
|
|
207
|
+
useEffect2(() => {
|
|
208
|
+
const handleEscape = (event) => {
|
|
209
|
+
if (event.key === "Escape") setIsOpen(false);
|
|
210
|
+
};
|
|
211
|
+
if (isOpen) {
|
|
212
|
+
document.addEventListener("keydown", handleEscape);
|
|
213
|
+
return () => document.removeEventListener("keydown", handleEscape);
|
|
214
|
+
}
|
|
215
|
+
}, [isOpen]);
|
|
216
|
+
const handleSelect = (docSet) => {
|
|
217
|
+
setIsOpen(false);
|
|
218
|
+
if (docSet.slug !== currentDocSet) {
|
|
219
|
+
router.visit(`${docSet.prefix}/`);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
return /* @__PURE__ */ jsxs2("div", { className: cn("relative", className), ref: dropdownRef, children: [
|
|
223
|
+
/* @__PURE__ */ jsxs2(
|
|
224
|
+
"button",
|
|
225
|
+
{
|
|
226
|
+
onClick: () => setIsOpen(!isOpen),
|
|
227
|
+
className: cn(
|
|
228
|
+
"w-full flex items-center gap-2.5 px-3 py-2",
|
|
229
|
+
"bg-gray-100/80 dark:bg-white/5",
|
|
230
|
+
"border border-gray-200 dark:border-white/10",
|
|
231
|
+
"rounded-lg",
|
|
232
|
+
"hover:bg-gray-200/80 dark:hover:bg-white/10",
|
|
233
|
+
"transition-colors duration-150",
|
|
234
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50"
|
|
235
|
+
),
|
|
236
|
+
"aria-label": "Select documentation",
|
|
237
|
+
"aria-expanded": isOpen,
|
|
238
|
+
"aria-haspopup": "listbox",
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ jsx2("div", { className: "flex-shrink-0 w-5 h-5 flex items-center justify-center text-gray-600 dark:text-gray-400", children: current.icon ? /* @__PURE__ */ jsx2("span", { className: "text-base leading-none", children: current.icon }) : current.iconUrl ? /* @__PURE__ */ jsx2("img", { src: current.iconUrl, alt: "", className: "w-5 h-5" }) : /* @__PURE__ */ jsx2(PackageIcon, { className: "w-5 h-5" }) }),
|
|
241
|
+
/* @__PURE__ */ jsx2("span", { className: "flex-1 text-left text-sm font-medium text-gray-900 dark:text-white truncate", children: current.name }),
|
|
242
|
+
/* @__PURE__ */ jsx2(ChevronUpDownIcon, { className: "flex-shrink-0 w-4 h-4 text-gray-400 dark:text-gray-500" })
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
),
|
|
246
|
+
/* @__PURE__ */ jsx2(
|
|
247
|
+
"div",
|
|
132
248
|
{
|
|
133
|
-
href: item.href,
|
|
134
249
|
className: cn(
|
|
135
|
-
"
|
|
136
|
-
|
|
250
|
+
"absolute left-0 right-0 mt-1.5",
|
|
251
|
+
"py-1",
|
|
252
|
+
"bg-white dark:bg-[#1a1a1a]",
|
|
253
|
+
"border border-gray-200 dark:border-white/10",
|
|
254
|
+
"rounded-lg",
|
|
255
|
+
"shadow-lg shadow-black/5 dark:shadow-black/30",
|
|
256
|
+
"z-50",
|
|
257
|
+
"transition-all duration-150 ease-out origin-top",
|
|
258
|
+
isOpen ? "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"
|
|
137
259
|
),
|
|
138
|
-
|
|
260
|
+
role: "listbox",
|
|
261
|
+
"aria-label": "Select documentation set",
|
|
262
|
+
children: docSets.map((docSet) => {
|
|
263
|
+
const isSelected = docSet.slug === currentDocSet;
|
|
264
|
+
return /* @__PURE__ */ jsxs2(
|
|
265
|
+
"button",
|
|
266
|
+
{
|
|
267
|
+
onClick: () => handleSelect(docSet),
|
|
268
|
+
className: cn(
|
|
269
|
+
"w-full flex items-center gap-2.5 px-3 py-2",
|
|
270
|
+
"transition-colors duration-100",
|
|
271
|
+
"focus:outline-none",
|
|
272
|
+
isSelected ? "bg-primary-50 dark:bg-primary-500/10" : "hover:bg-gray-50 dark:hover:bg-white/5"
|
|
273
|
+
),
|
|
274
|
+
role: "option",
|
|
275
|
+
"aria-selected": isSelected,
|
|
276
|
+
children: [
|
|
277
|
+
/* @__PURE__ */ jsx2("div", { className: cn(
|
|
278
|
+
"flex-shrink-0 w-5 h-5 flex items-center justify-center",
|
|
279
|
+
isSelected ? "text-primary-600 dark:text-primary-400" : "text-gray-500 dark:text-gray-400"
|
|
280
|
+
), children: docSet.icon ? /* @__PURE__ */ jsx2("span", { className: "text-base leading-none", children: docSet.icon }) : docSet.iconUrl ? /* @__PURE__ */ jsx2("img", { src: docSet.iconUrl, alt: "", className: "w-5 h-5" }) : /* @__PURE__ */ jsx2(PackageIcon, { className: "w-5 h-5" }) }),
|
|
281
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex-1 text-left min-w-0", children: [
|
|
282
|
+
/* @__PURE__ */ jsx2(
|
|
283
|
+
"div",
|
|
284
|
+
{
|
|
285
|
+
className: cn(
|
|
286
|
+
"text-sm font-medium truncate",
|
|
287
|
+
isSelected ? "text-primary-700 dark:text-primary-300" : "text-gray-900 dark:text-white"
|
|
288
|
+
),
|
|
289
|
+
children: docSet.name
|
|
290
|
+
}
|
|
291
|
+
),
|
|
292
|
+
docSet.description && /* @__PURE__ */ jsx2("div", { className: cn(
|
|
293
|
+
"text-xs truncate",
|
|
294
|
+
isSelected ? "text-primary-600/70 dark:text-primary-400/70" : "text-gray-500 dark:text-gray-400"
|
|
295
|
+
), children: docSet.description })
|
|
296
|
+
] }),
|
|
297
|
+
isSelected && /* @__PURE__ */ jsx2(CheckIcon, { className: "flex-shrink-0 w-4 h-4 text-primary-600 dark:text-primary-400" })
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
docSet.slug || "_root"
|
|
301
|
+
);
|
|
302
|
+
})
|
|
139
303
|
}
|
|
140
|
-
)
|
|
141
|
-
] }
|
|
304
|
+
)
|
|
305
|
+
] });
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// src/components/DocsLayout.tsx
|
|
309
|
+
import { Head, Link as Link2, usePage } from "@inertiajs/react";
|
|
310
|
+
import { useState as useState5 } from "react";
|
|
311
|
+
|
|
312
|
+
// src/components/Sidebar.tsx
|
|
313
|
+
import { Link } from "@inertiajs/react";
|
|
314
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
315
|
+
function Sidebar({ nav, currentPath, className, docSets, currentDocSet }) {
|
|
316
|
+
return /* @__PURE__ */ jsxs3("nav", { className: cn("space-y-6", className), children: [
|
|
317
|
+
docSets && docSets.length > 1 && /* @__PURE__ */ jsx3(DocSetSelector, { docSets, currentDocSet: currentDocSet ?? "", className: "mb-6" }),
|
|
318
|
+
/* @__PURE__ */ jsx3("div", { className: "space-y-8", children: nav.map((section) => /* @__PURE__ */ jsxs3("div", { children: [
|
|
319
|
+
/* @__PURE__ */ jsx3("h3", { className: "mb-3 text-xs font-mono uppercase tracking-widest text-gray-500 dark:text-gray-400", children: section.title }),
|
|
320
|
+
/* @__PURE__ */ jsx3("ul", { className: "space-y-1 border-l-2 border-gray-200 dark:border-gray-700", children: section.items.map((item) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsx3(
|
|
321
|
+
Link,
|
|
322
|
+
{
|
|
323
|
+
href: item.href,
|
|
324
|
+
className: cn(
|
|
325
|
+
"block border-l-2 py-1.5 pl-4 text-sm transition-colors -ml-0.5",
|
|
326
|
+
currentPath === item.href ? "border-primary-500 text-gray-900 dark:text-white font-bold" : "border-transparent text-gray-600 dark:text-gray-300 hover:border-gray-900 dark:hover:border-white hover:text-gray-900 dark:hover:text-white"
|
|
327
|
+
),
|
|
328
|
+
children: item.title
|
|
329
|
+
}
|
|
330
|
+
) }, item.href)) })
|
|
331
|
+
] }, section.title)) })
|
|
332
|
+
] });
|
|
142
333
|
}
|
|
143
334
|
|
|
144
335
|
// src/components/ThemeToggle.tsx
|
|
145
|
-
import { useState as
|
|
336
|
+
import { useState as useState4, useRef as useRef2, useEffect as useEffect4 } from "react";
|
|
146
337
|
|
|
147
338
|
// src/components/ThemeProvider.tsx
|
|
148
|
-
import { createContext, useContext, useEffect as
|
|
149
|
-
import { jsx as
|
|
339
|
+
import { createContext, useContext, useEffect as useEffect3, useState as useState3 } from "react";
|
|
340
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
150
341
|
var ThemeContext = createContext(null);
|
|
151
342
|
var STORAGE_KEY = "cross-docs-theme";
|
|
152
343
|
function getSystemTheme() {
|
|
@@ -166,17 +357,17 @@ function ThemeProvider({
|
|
|
166
357
|
defaultTheme: defaultTheme2 = "system",
|
|
167
358
|
forcedTheme
|
|
168
359
|
}) {
|
|
169
|
-
const [theme, setThemeState] =
|
|
360
|
+
const [theme, setThemeState] = useState3(() => {
|
|
170
361
|
if (typeof window === "undefined") return defaultTheme2;
|
|
171
362
|
return getStoredTheme() ?? defaultTheme2;
|
|
172
363
|
});
|
|
173
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
364
|
+
const [resolvedTheme, setResolvedTheme] = useState3(() => {
|
|
174
365
|
if (forcedTheme) return forcedTheme;
|
|
175
366
|
if (typeof window === "undefined") return "light";
|
|
176
367
|
if (theme === "system") return getSystemTheme();
|
|
177
368
|
return theme;
|
|
178
369
|
});
|
|
179
|
-
|
|
370
|
+
useEffect3(() => {
|
|
180
371
|
if (forcedTheme) {
|
|
181
372
|
setResolvedTheme(forcedTheme);
|
|
182
373
|
return;
|
|
@@ -198,7 +389,7 @@ function ThemeProvider({
|
|
|
198
389
|
mediaQuery.addEventListener("change", handleChange);
|
|
199
390
|
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
200
391
|
}, [theme, forcedTheme]);
|
|
201
|
-
|
|
392
|
+
useEffect3(() => {
|
|
202
393
|
const root = document.documentElement;
|
|
203
394
|
root.classList.remove("light", "dark");
|
|
204
395
|
root.classList.add(resolvedTheme);
|
|
@@ -207,7 +398,7 @@ function ThemeProvider({
|
|
|
207
398
|
setThemeState(newTheme);
|
|
208
399
|
localStorage.setItem(STORAGE_KEY, newTheme);
|
|
209
400
|
};
|
|
210
|
-
return /* @__PURE__ */
|
|
401
|
+
return /* @__PURE__ */ jsx4(ThemeContext.Provider, { value: { theme, resolvedTheme, setTheme }, children });
|
|
211
402
|
}
|
|
212
403
|
function useTheme() {
|
|
213
404
|
const context = useContext(ThemeContext);
|
|
@@ -228,15 +419,15 @@ var themeInitScript = `
|
|
|
228
419
|
`.trim();
|
|
229
420
|
|
|
230
421
|
// src/components/ThemeToggle.tsx
|
|
231
|
-
import { jsx as
|
|
232
|
-
var SunIcon = ({ className }) => /* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
422
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
423
|
+
var SunIcon = ({ className }) => /* @__PURE__ */ jsxs4("svg", { className, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
424
|
+
/* @__PURE__ */ jsx5("circle", { cx: "12", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
425
|
+
/* @__PURE__ */ jsx5("path", { d: "M12 5V3M12 21v-2M5 12H3m18 0h-2M7.05 7.05 5.636 5.636m12.728 12.728L16.95 16.95M7.05 16.95l-1.414 1.414M18.364 5.636 16.95 7.05", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
235
426
|
] });
|
|
236
|
-
var MoonIcon = ({ className }) => /* @__PURE__ */
|
|
237
|
-
var MonitorIcon = ({ className }) => /* @__PURE__ */
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */
|
|
427
|
+
var MoonIcon = ({ className }) => /* @__PURE__ */ jsx5("svg", { className, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx5("path", { d: "M21.752 15.002A9.718 9.718 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
428
|
+
var MonitorIcon = ({ className }) => /* @__PURE__ */ jsxs4("svg", { className, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
429
|
+
/* @__PURE__ */ jsx5("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
430
|
+
/* @__PURE__ */ jsx5("path", { d: "M8 21h8m-4-4v4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
240
431
|
] });
|
|
241
432
|
var themeOptions = [
|
|
242
433
|
{ value: "light", label: "Light", icon: SunIcon },
|
|
@@ -245,9 +436,9 @@ var themeOptions = [
|
|
|
245
436
|
];
|
|
246
437
|
function ThemeToggle({ className, size = "md" }) {
|
|
247
438
|
const { theme, resolvedTheme, setTheme } = useTheme();
|
|
248
|
-
const [isOpen, setIsOpen] =
|
|
249
|
-
const dropdownRef =
|
|
250
|
-
|
|
439
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
440
|
+
const dropdownRef = useRef2(null);
|
|
441
|
+
useEffect4(() => {
|
|
251
442
|
const handleClickOutside = (event) => {
|
|
252
443
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
253
444
|
setIsOpen(false);
|
|
@@ -258,7 +449,7 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
258
449
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
259
450
|
}
|
|
260
451
|
}, [isOpen]);
|
|
261
|
-
|
|
452
|
+
useEffect4(() => {
|
|
262
453
|
const handleEscape = (event) => {
|
|
263
454
|
if (event.key === "Escape") setIsOpen(false);
|
|
264
455
|
};
|
|
@@ -272,8 +463,8 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
272
463
|
md: "w-5 h-5",
|
|
273
464
|
lg: "w-[22px] h-[22px]"
|
|
274
465
|
};
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
466
|
+
return /* @__PURE__ */ jsxs4("div", { className: "relative", ref: dropdownRef, children: [
|
|
467
|
+
/* @__PURE__ */ jsxs4(
|
|
277
468
|
"button",
|
|
278
469
|
{
|
|
279
470
|
onClick: () => setIsOpen(!isOpen),
|
|
@@ -291,7 +482,7 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
291
482
|
"aria-expanded": isOpen,
|
|
292
483
|
"aria-haspopup": "listbox",
|
|
293
484
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ jsx5(
|
|
295
486
|
SunIcon,
|
|
296
487
|
{
|
|
297
488
|
className: cn(
|
|
@@ -301,7 +492,7 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
301
492
|
)
|
|
302
493
|
}
|
|
303
494
|
),
|
|
304
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ jsx5(
|
|
305
496
|
MoonIcon,
|
|
306
497
|
{
|
|
307
498
|
className: cn(
|
|
@@ -314,7 +505,7 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
314
505
|
]
|
|
315
506
|
}
|
|
316
507
|
),
|
|
317
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ jsx5(
|
|
318
509
|
"div",
|
|
319
510
|
{
|
|
320
511
|
className: cn(
|
|
@@ -333,7 +524,7 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
333
524
|
children: themeOptions.map((option, index) => {
|
|
334
525
|
const Icon = option.icon;
|
|
335
526
|
const isSelected = theme === option.value;
|
|
336
|
-
return /* @__PURE__ */
|
|
527
|
+
return /* @__PURE__ */ jsxs4(
|
|
337
528
|
"button",
|
|
338
529
|
{
|
|
339
530
|
onClick: () => {
|
|
@@ -354,13 +545,13 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
354
545
|
animationDelay: isOpen ? `${index * 25}ms` : "0ms"
|
|
355
546
|
},
|
|
356
547
|
children: [
|
|
357
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ jsx5(Icon, { className: cn(
|
|
358
549
|
"w-4 h-4 flex-shrink-0",
|
|
359
550
|
"transition-transform duration-150",
|
|
360
551
|
isSelected ? "scale-110" : "scale-100"
|
|
361
552
|
) }),
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ jsx5("span", { className: "flex-1 text-left", children: option.label }),
|
|
554
|
+
/* @__PURE__ */ jsx5("div", { className: cn(
|
|
364
555
|
"w-1.5 h-1.5 rounded-full",
|
|
365
556
|
"transition-all duration-200",
|
|
366
557
|
isSelected ? "bg-primary-500 scale-100 opacity-100" : "bg-transparent scale-0 opacity-0"
|
|
@@ -376,23 +567,23 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
376
567
|
}
|
|
377
568
|
|
|
378
569
|
// src/components/DocsLayout.tsx
|
|
379
|
-
import { jsx as
|
|
570
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
380
571
|
function MobileMenuButton({ onClick, isOpen }) {
|
|
381
|
-
return /* @__PURE__ */
|
|
572
|
+
return /* @__PURE__ */ jsxs5(
|
|
382
573
|
"button",
|
|
383
574
|
{
|
|
384
575
|
onClick,
|
|
385
576
|
className: "inline-flex items-center justify-center p-2 -ml-2 text-gray-700 hover:text-primary-500 dark:text-gray-300 dark:hover:text-primary-400 lg:hidden transition-colors",
|
|
386
577
|
"aria-expanded": isOpen,
|
|
387
578
|
children: [
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
isOpen ? /* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ jsx6("span", { className: "sr-only", children: isOpen ? "Close menu" : "Open menu" }),
|
|
580
|
+
isOpen ? /* @__PURE__ */ jsx6("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) : /* @__PURE__ */ jsx6("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) })
|
|
390
581
|
]
|
|
391
582
|
}
|
|
392
583
|
);
|
|
393
584
|
}
|
|
394
585
|
function GitHubIcon() {
|
|
395
|
-
return /* @__PURE__ */
|
|
586
|
+
return /* @__PURE__ */ jsx6("svg", { className: "w-6 h-6", fill: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx6(
|
|
396
587
|
"path",
|
|
397
588
|
{
|
|
398
589
|
fillRule: "evenodd",
|
|
@@ -414,28 +605,28 @@ function DocsLayout({
|
|
|
414
605
|
footer
|
|
415
606
|
}) {
|
|
416
607
|
const sharedProps = usePage().props;
|
|
417
|
-
const { nav, currentPath } = sharedProps;
|
|
418
|
-
const [mobileMenuOpen, setMobileMenuOpen] =
|
|
608
|
+
const { nav, currentPath, docSets, currentDocSet } = sharedProps;
|
|
609
|
+
const [mobileMenuOpen, setMobileMenuOpen] = useState5(false);
|
|
419
610
|
const { resolvedTheme } = useTheme();
|
|
420
611
|
const logoUrl = propLogoUrl ?? sharedProps.logoUrl;
|
|
421
612
|
const logoInvertedUrl = propLogoInvertedUrl ?? sharedProps.logoInvertedUrl;
|
|
422
613
|
const githubUrl = propGithubUrl ?? sharedProps.githubUrl;
|
|
423
614
|
const navLinks = propNavLinks ?? sharedProps.navLinks ?? [];
|
|
424
|
-
const headerLogo = logoInverted || logo || (logoInvertedUrl ? /* @__PURE__ */
|
|
615
|
+
const headerLogo = logoInverted || logo || (logoInvertedUrl ? /* @__PURE__ */ jsx6("img", { src: logoInvertedUrl, alt: "Logo", className: "h-8" }) : logoUrl ? /* @__PURE__ */ jsx6("img", { src: logoUrl, alt: "Logo", className: "h-8" }) : null);
|
|
425
616
|
const footerLogoUrl = sharedProps.footerLogoUrl || logoUrl;
|
|
426
617
|
const footerLogoInvertedUrl = sharedProps.footerLogoInvertedUrl || logoInvertedUrl;
|
|
427
618
|
const currentFooterLogoUrl = resolvedTheme === "dark" ? footerLogoInvertedUrl || footerLogoUrl : footerLogoUrl;
|
|
428
|
-
const footerLogo = logo || (currentFooterLogoUrl ? /* @__PURE__ */
|
|
429
|
-
return /* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
headerLogo ? /* @__PURE__ */
|
|
619
|
+
const footerLogo = logo || (currentFooterLogoUrl ? /* @__PURE__ */ jsx6("img", { src: currentFooterLogoUrl, alt: "Logo", className: "h-6" }) : null);
|
|
620
|
+
return /* @__PURE__ */ jsxs5("div", { className: "min-h-screen bg-white dark:bg-[#0f0f0f] flex flex-col transition-colors duration-200", children: [
|
|
621
|
+
/* @__PURE__ */ jsx6(Head, { title }),
|
|
622
|
+
/* @__PURE__ */ jsx6("nav", { className: "fixed w-full z-50 bg-white/95 dark:bg-[#0f0f0f]/95 backdrop-blur-sm border-b border-gray-200 dark:border-gray-800 transition-colors", children: /* @__PURE__ */ jsx6("div", { className: "px-4 lg:px-10", children: /* @__PURE__ */ jsxs5("div", { className: "flex justify-between h-16 items-center", children: [
|
|
623
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
624
|
+
/* @__PURE__ */ jsx6(MobileMenuButton, { onClick: () => setMobileMenuOpen(!mobileMenuOpen), isOpen: mobileMenuOpen }),
|
|
625
|
+
headerLogo ? /* @__PURE__ */ jsx6(Link2, { href: "/", className: "flex items-center", children: headerLogo }) : /* @__PURE__ */ jsx6(Link2, { href: "/", className: "font-bold text-lg text-gray-900 dark:text-white", children: "Docs" })
|
|
435
626
|
] }),
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
/* @__PURE__ */
|
|
438
|
-
navLinks.map((link) => /* @__PURE__ */
|
|
627
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-6", children: [
|
|
628
|
+
/* @__PURE__ */ jsx6("div", { className: "-mr-2", children: /* @__PURE__ */ jsx6(ThemeToggle, { size: "sm" }) }),
|
|
629
|
+
navLinks.map((link) => /* @__PURE__ */ jsx6(
|
|
439
630
|
Link2,
|
|
440
631
|
{
|
|
441
632
|
href: link.href,
|
|
@@ -444,31 +635,31 @@ function DocsLayout({
|
|
|
444
635
|
},
|
|
445
636
|
link.href
|
|
446
637
|
)),
|
|
447
|
-
githubUrl && /* @__PURE__ */
|
|
638
|
+
githubUrl && /* @__PURE__ */ jsx6(
|
|
448
639
|
"a",
|
|
449
640
|
{
|
|
450
641
|
href: githubUrl,
|
|
451
642
|
target: "_blank",
|
|
452
643
|
rel: "noopener noreferrer",
|
|
453
644
|
className: "text-gray-700 dark:text-gray-300 hover:text-primary-600 dark:hover:text-primary-400 transition-colors",
|
|
454
|
-
children: /* @__PURE__ */
|
|
645
|
+
children: /* @__PURE__ */ jsx6(GitHubIcon, {})
|
|
455
646
|
}
|
|
456
647
|
)
|
|
457
648
|
] })
|
|
458
649
|
] }) }) }),
|
|
459
|
-
mobileMenuOpen && /* @__PURE__ */
|
|
460
|
-
/* @__PURE__ */
|
|
461
|
-
/* @__PURE__ */
|
|
650
|
+
mobileMenuOpen && /* @__PURE__ */ jsxs5("div", { className: "fixed inset-0 z-40 lg:hidden", children: [
|
|
651
|
+
/* @__PURE__ */ jsx6("div", { className: "fixed inset-0 bg-black/50 dark:bg-black/70", onClick: () => setMobileMenuOpen(false) }),
|
|
652
|
+
/* @__PURE__ */ jsx6("div", { className: "fixed inset-y-0 left-0 w-64 overflow-y-auto bg-white dark:bg-[#0f0f0f] px-4 py-6 pt-20 border-r border-gray-200 dark:border-gray-800 transition-colors", children: /* @__PURE__ */ jsx6(Sidebar, { nav, currentPath, docSets, currentDocSet }) })
|
|
462
653
|
] }),
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
/* @__PURE__ */
|
|
465
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ jsx6("div", { className: "bg-white dark:bg-[#0f0f0f] pt-16 w-full flex-1 transition-colors", children: /* @__PURE__ */ jsxs5("div", { className: "flex", children: [
|
|
655
|
+
/* @__PURE__ */ jsx6("aside", { className: "hidden lg:block w-72 flex-shrink-0 border-r border-gray-200 dark:border-gray-800 min-h-[calc(100vh-4rem)] transition-colors", children: /* @__PURE__ */ jsx6("nav", { className: "sticky top-16 px-4 py-6 max-h-[calc(100vh-4rem)] overflow-y-auto", children: /* @__PURE__ */ jsx6(Sidebar, { nav, currentPath, docSets, currentDocSet }) }) }),
|
|
656
|
+
/* @__PURE__ */ jsx6("main", { className: "flex-1 min-w-0 p-4 lg:px-10 lg:py-6", children: /* @__PURE__ */ jsx6("article", { className: "prose prose-lg max-w-3xl prose-headings:font-bold prose-headings:tracking-tight prose-h1:text-3xl prose-h1:mb-4 prose-h2:text-2xl prose-h2:mt-10 first:prose-h2:mt-0 prose-h3:text-xl prose-a:text-primary-600 dark:prose-a:text-primary-400 prose-a:no-underline hover:prose-a:underline prose-code:bg-gray-100 dark:prose-code:bg-gray-800 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:before:content-none prose-code:after:content-none dark:prose-headings:text-white dark:prose-strong:text-white dark:text-gray-300", children }) })
|
|
466
657
|
] }) }),
|
|
467
|
-
footer || /* @__PURE__ */
|
|
468
|
-
footerLogo && /* @__PURE__ */
|
|
469
|
-
/* @__PURE__ */
|
|
470
|
-
navLinks.map((link) => /* @__PURE__ */
|
|
471
|
-
githubUrl && /* @__PURE__ */
|
|
658
|
+
footer || /* @__PURE__ */ jsx6("footer", { className: "border-t border-gray-200 dark:border-gray-800 py-8 bg-white dark:bg-[#0f0f0f] transition-colors", children: /* @__PURE__ */ jsxs5("div", { className: "px-4 lg:px-10 flex flex-col md:flex-row justify-between items-center gap-6", children: [
|
|
659
|
+
footerLogo && /* @__PURE__ */ jsx6(Link2, { href: "/", children: footerLogo }),
|
|
660
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex gap-8 text-sm text-gray-600 dark:text-gray-400", children: [
|
|
661
|
+
navLinks.map((link) => /* @__PURE__ */ jsx6(Link2, { href: link.href, className: "hover:text-black dark:hover:text-white transition-colors", children: link.label }, link.href)),
|
|
662
|
+
githubUrl && /* @__PURE__ */ jsx6(
|
|
472
663
|
"a",
|
|
473
664
|
{
|
|
474
665
|
href: githubUrl,
|
|
@@ -487,7 +678,7 @@ function DocsLayout({
|
|
|
487
678
|
import ReactMarkdown from "react-markdown";
|
|
488
679
|
import remarkGfm from "remark-gfm";
|
|
489
680
|
import rehypeRaw from "rehype-raw";
|
|
490
|
-
import { Fragment, jsx as
|
|
681
|
+
import { Fragment, jsx as jsx7 } from "react/jsx-runtime";
|
|
491
682
|
function Markdown({ content, components }) {
|
|
492
683
|
const lowercaseComponents = components ? Object.entries(components).reduce(
|
|
493
684
|
(acc, [name, Component]) => {
|
|
@@ -496,7 +687,7 @@ function Markdown({ content, components }) {
|
|
|
496
687
|
},
|
|
497
688
|
{}
|
|
498
689
|
) : {};
|
|
499
|
-
return /* @__PURE__ */
|
|
690
|
+
return /* @__PURE__ */ jsx7(
|
|
500
691
|
ReactMarkdown,
|
|
501
692
|
{
|
|
502
693
|
remarkPlugins: [remarkGfm],
|
|
@@ -505,14 +696,14 @@ function Markdown({ content, components }) {
|
|
|
505
696
|
...lowercaseComponents,
|
|
506
697
|
// Override pre to avoid double wrapping with CodeBlock
|
|
507
698
|
pre({ children }) {
|
|
508
|
-
return /* @__PURE__ */
|
|
699
|
+
return /* @__PURE__ */ jsx7(Fragment, { children });
|
|
509
700
|
},
|
|
510
701
|
// Custom code block rendering with syntax highlighting
|
|
511
702
|
code({ node, className, children, ...props }) {
|
|
512
703
|
const match = /language-(\w+)/.exec(className || "");
|
|
513
704
|
const isInline = !match && !className;
|
|
514
705
|
if (isInline) {
|
|
515
|
-
return /* @__PURE__ */
|
|
706
|
+
return /* @__PURE__ */ jsx7(
|
|
516
707
|
"code",
|
|
517
708
|
{
|
|
518
709
|
className: "rounded bg-gray-100 px-1.5 py-0.5 text-sm font-medium text-gray-800 dark:bg-gray-800 dark:text-gray-200",
|
|
@@ -525,7 +716,7 @@ function Markdown({ content, components }) {
|
|
|
525
716
|
const titleMatch = /title="([^"]+)"/.exec(meta);
|
|
526
717
|
const filename = titleMatch ? titleMatch[1] : void 0;
|
|
527
718
|
const showLineNumbers = meta.includes("showLineNumbers");
|
|
528
|
-
return /* @__PURE__ */
|
|
719
|
+
return /* @__PURE__ */ jsx7(
|
|
529
720
|
CodeBlock,
|
|
530
721
|
{
|
|
531
722
|
code: String(children).replace(/\n$/, ""),
|
|
@@ -538,7 +729,7 @@ function Markdown({ content, components }) {
|
|
|
538
729
|
// Custom link styling
|
|
539
730
|
a({ href, children }) {
|
|
540
731
|
const isExternal = href?.startsWith("http");
|
|
541
|
-
return /* @__PURE__ */
|
|
732
|
+
return /* @__PURE__ */ jsx7(
|
|
542
733
|
"a",
|
|
543
734
|
{
|
|
544
735
|
href,
|
|
@@ -550,13 +741,13 @@ function Markdown({ content, components }) {
|
|
|
550
741
|
},
|
|
551
742
|
// Tables
|
|
552
743
|
table({ children }) {
|
|
553
|
-
return /* @__PURE__ */
|
|
744
|
+
return /* @__PURE__ */ jsx7("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsx7("table", { className: "w-full text-left text-sm", children }) });
|
|
554
745
|
},
|
|
555
746
|
th({ children }) {
|
|
556
|
-
return /* @__PURE__ */
|
|
747
|
+
return /* @__PURE__ */ jsx7("th", { className: "border-b border-gray-200 bg-gray-50 px-4 py-2 font-semibold dark:border-gray-700 dark:bg-gray-800", children });
|
|
557
748
|
},
|
|
558
749
|
td({ children }) {
|
|
559
|
-
return /* @__PURE__ */
|
|
750
|
+
return /* @__PURE__ */ jsx7("td", { className: "border-b border-gray-200 px-4 py-2 dark:border-gray-700", children });
|
|
560
751
|
}
|
|
561
752
|
},
|
|
562
753
|
children: content
|
|
@@ -566,31 +757,31 @@ function Markdown({ content, components }) {
|
|
|
566
757
|
|
|
567
758
|
// src/context/ComponentsContext.tsx
|
|
568
759
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
569
|
-
import { jsx as
|
|
760
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
570
761
|
var ComponentsContext = createContext2({});
|
|
571
762
|
function ComponentsProvider({
|
|
572
763
|
children,
|
|
573
764
|
components
|
|
574
765
|
}) {
|
|
575
|
-
return /* @__PURE__ */
|
|
766
|
+
return /* @__PURE__ */ jsx8(ComponentsContext.Provider, { value: { components }, children });
|
|
576
767
|
}
|
|
577
768
|
function useComponents() {
|
|
578
769
|
return useContext2(ComponentsContext);
|
|
579
770
|
}
|
|
580
771
|
|
|
581
772
|
// src/components/DocsPage.tsx
|
|
582
|
-
import { jsx as
|
|
773
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
583
774
|
function DocsPage({ content, ...layoutProps }) {
|
|
584
775
|
const { components } = useComponents();
|
|
585
|
-
return /* @__PURE__ */
|
|
776
|
+
return /* @__PURE__ */ jsx9(DocsLayout, { title: content?.title ?? "", description: content?.description, ...layoutProps, children: /* @__PURE__ */ jsx9(Markdown, { content: content?.body ?? "", components }) });
|
|
586
777
|
}
|
|
587
778
|
|
|
588
779
|
// src/components/EmojiConfetti.tsx
|
|
589
|
-
import { useState as
|
|
590
|
-
import { jsx as
|
|
780
|
+
import { useState as useState6, useCallback } from "react";
|
|
781
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
591
782
|
function EmojiConfetti({ children, emoji }) {
|
|
592
|
-
const [particles, setParticles] =
|
|
593
|
-
const [isActive, setIsActive] =
|
|
783
|
+
const [particles, setParticles] = useState6([]);
|
|
784
|
+
const [isActive, setIsActive] = useState6(false);
|
|
594
785
|
const triggerBurst = useCallback(() => {
|
|
595
786
|
if (isActive) return;
|
|
596
787
|
setIsActive(true);
|
|
@@ -617,17 +808,17 @@ function EmojiConfetti({ children, emoji }) {
|
|
|
617
808
|
setIsActive(false);
|
|
618
809
|
}, 1e3);
|
|
619
810
|
}, [isActive]);
|
|
620
|
-
return /* @__PURE__ */
|
|
811
|
+
return /* @__PURE__ */ jsxs6(
|
|
621
812
|
"span",
|
|
622
813
|
{
|
|
623
814
|
className: "relative inline-block",
|
|
624
815
|
onMouseEnter: triggerBurst,
|
|
625
816
|
children: [
|
|
626
817
|
children,
|
|
627
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ jsx10("span", { className: "absolute inset-0 pointer-events-none overflow-visible", children: particles.map((p) => {
|
|
628
819
|
const endX = p.x + Math.cos(p.angle) * p.velocity;
|
|
629
820
|
const endY = p.y + Math.sin(p.angle) * p.velocity;
|
|
630
|
-
return /* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ jsx10(
|
|
631
822
|
"span",
|
|
632
823
|
{
|
|
633
824
|
className: "absolute",
|
|
@@ -653,8 +844,8 @@ function EmojiConfetti({ children, emoji }) {
|
|
|
653
844
|
|
|
654
845
|
// src/components/HomePage.tsx
|
|
655
846
|
import { Head as Head2, Link as Link3 } from "@inertiajs/react";
|
|
656
|
-
import { createContext as createContext3, useContext as useContext3, useState as
|
|
657
|
-
import { Fragment as Fragment2, jsx as
|
|
847
|
+
import { createContext as createContext3, useContext as useContext3, useState as useState7 } from "react";
|
|
848
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
658
849
|
var HomePageContext = createContext3(null);
|
|
659
850
|
function useHomePage() {
|
|
660
851
|
const context = useContext3(HomePageContext);
|
|
@@ -664,28 +855,28 @@ function useHomePage() {
|
|
|
664
855
|
return context;
|
|
665
856
|
}
|
|
666
857
|
function InstallCommand({ command }) {
|
|
667
|
-
const [copied, setCopied] =
|
|
858
|
+
const [copied, setCopied] = useState7(false);
|
|
668
859
|
const copyToClipboard = async () => {
|
|
669
860
|
await navigator.clipboard.writeText(command);
|
|
670
861
|
setCopied(true);
|
|
671
862
|
setTimeout(() => setCopied(false), 2e3);
|
|
672
863
|
};
|
|
673
|
-
return /* @__PURE__ */
|
|
864
|
+
return /* @__PURE__ */ jsxs7(
|
|
674
865
|
"button",
|
|
675
866
|
{
|
|
676
867
|
onClick: copyToClipboard,
|
|
677
868
|
className: "group relative flex items-center bg-gray-900 dark:bg-white border border-gray-900 dark:border-white px-4 h-14 font-mono text-sm text-white dark:text-gray-900 hover:bg-white dark:hover:bg-gray-900 hover:text-gray-900 dark:hover:text-white transition-colors cursor-pointer",
|
|
678
869
|
children: [
|
|
679
|
-
/* @__PURE__ */
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
-
/* @__PURE__ */
|
|
870
|
+
/* @__PURE__ */ jsx11("span", { className: "text-primary-500 dark:text-primary-600 mr-2", children: "$" }),
|
|
871
|
+
/* @__PURE__ */ jsx11("span", { children: command }),
|
|
872
|
+
/* @__PURE__ */ jsx11(
|
|
682
873
|
"svg",
|
|
683
874
|
{
|
|
684
875
|
className: `ml-4 w-4 h-4 transition ${copied ? "text-green-400" : "opacity-50 group-hover:opacity-100"}`,
|
|
685
876
|
fill: "none",
|
|
686
877
|
stroke: "currentColor",
|
|
687
878
|
viewBox: "0 0 24 24",
|
|
688
|
-
children: /* @__PURE__ */
|
|
879
|
+
children: /* @__PURE__ */ jsx11(
|
|
689
880
|
"path",
|
|
690
881
|
{
|
|
691
882
|
strokeLinecap: "round",
|
|
@@ -696,7 +887,7 @@ function InstallCommand({ command }) {
|
|
|
696
887
|
)
|
|
697
888
|
}
|
|
698
889
|
),
|
|
699
|
-
/* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ jsx11(
|
|
700
891
|
"span",
|
|
701
892
|
{
|
|
702
893
|
className: `absolute -top-8 left-1/2 -translate-x-1/2 bg-gray-900 dark:bg-white text-white dark:text-gray-900 text-xs py-1 px-2 rounded transition-opacity duration-300 whitespace-nowrap ${copied ? "opacity-100" : "opacity-0"}`,
|
|
@@ -708,7 +899,7 @@ function InstallCommand({ command }) {
|
|
|
708
899
|
);
|
|
709
900
|
}
|
|
710
901
|
function GitHubIcon2() {
|
|
711
|
-
return /* @__PURE__ */
|
|
902
|
+
return /* @__PURE__ */ jsx11("svg", { className: "w-6 h-6", fill: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx11(
|
|
712
903
|
"path",
|
|
713
904
|
{
|
|
714
905
|
fillRule: "evenodd",
|
|
@@ -720,17 +911,17 @@ function GitHubIcon2() {
|
|
|
720
911
|
function DefaultLogo() {
|
|
721
912
|
const { title, logoUrl } = useHomePage();
|
|
722
913
|
if (logoUrl) {
|
|
723
|
-
return /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ jsx11(Link3, { href: "/", className: "flex items-center", children: /* @__PURE__ */ jsx11("img", { src: logoUrl, alt: title, className: "h-8" }) });
|
|
724
915
|
}
|
|
725
|
-
return /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ jsx11(Link3, { href: "/", className: "font-bold text-lg text-gray-900 dark:text-white", children: title });
|
|
726
917
|
}
|
|
727
918
|
function HomeHeader({ renderLogo } = {}) {
|
|
728
919
|
const { navLinks, githubUrl } = useHomePage();
|
|
729
|
-
return /* @__PURE__ */
|
|
730
|
-
renderLogo ? renderLogo() : /* @__PURE__ */
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
-
/* @__PURE__ */
|
|
733
|
-
navLinks.map((link) => /* @__PURE__ */
|
|
920
|
+
return /* @__PURE__ */ jsx11("nav", { className: "fixed w-full z-50 bg-white/95 dark:bg-[#0f0f0f]/95 backdrop-blur-sm border-b border-gray-200 dark:border-gray-800 transition-colors", children: /* @__PURE__ */ jsx11("div", { className: "px-4 lg:px-10", children: /* @__PURE__ */ jsxs7("div", { className: "flex justify-between h-16 items-center", children: [
|
|
921
|
+
renderLogo ? renderLogo() : /* @__PURE__ */ jsx11(DefaultLogo, {}),
|
|
922
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-6", children: [
|
|
923
|
+
/* @__PURE__ */ jsx11("div", { className: "-mr-2", children: /* @__PURE__ */ jsx11(ThemeToggle, { size: "sm" }) }),
|
|
924
|
+
navLinks.map((link) => /* @__PURE__ */ jsx11(
|
|
734
925
|
Link3,
|
|
735
926
|
{
|
|
736
927
|
href: link.href,
|
|
@@ -739,14 +930,14 @@ function HomeHeader({ renderLogo } = {}) {
|
|
|
739
930
|
},
|
|
740
931
|
link.href
|
|
741
932
|
)),
|
|
742
|
-
githubUrl && /* @__PURE__ */
|
|
933
|
+
githubUrl && /* @__PURE__ */ jsx11(
|
|
743
934
|
"a",
|
|
744
935
|
{
|
|
745
936
|
href: githubUrl,
|
|
746
937
|
target: "_blank",
|
|
747
938
|
rel: "noopener noreferrer",
|
|
748
939
|
className: "text-gray-700 dark:text-gray-300 hover:text-primary-600 dark:hover:text-primary-400 transition-colors",
|
|
749
|
-
children: /* @__PURE__ */
|
|
940
|
+
children: /* @__PURE__ */ jsx11(GitHubIcon2, {})
|
|
750
941
|
}
|
|
751
942
|
)
|
|
752
943
|
] })
|
|
@@ -754,19 +945,19 @@ function HomeHeader({ renderLogo } = {}) {
|
|
|
754
945
|
}
|
|
755
946
|
function HomeHero() {
|
|
756
947
|
const { title, tagline, description, ctaText, ctaHref, installCommand, heroLogoUrl } = useHomePage();
|
|
757
|
-
return /* @__PURE__ */
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
heroLogoUrl ? /* @__PURE__ */
|
|
948
|
+
return /* @__PURE__ */ jsx11("section", { className: "pt-16", children: /* @__PURE__ */ jsx11("div", { className: "px-4 lg:px-10 py-16 lg:py-24", children: /* @__PURE__ */ jsxs7("div", { className: "max-w-4xl", children: [
|
|
949
|
+
/* @__PURE__ */ jsx11("div", { className: "mb-4 text-sm font-mono uppercase tracking-widest text-gray-500 dark:text-gray-400", children: tagline }),
|
|
950
|
+
heroLogoUrl ? /* @__PURE__ */ jsx11("h1", { className: "mb-6 lg:mb-8", children: /* @__PURE__ */ jsx11(
|
|
760
951
|
"img",
|
|
761
952
|
{
|
|
762
953
|
src: heroLogoUrl,
|
|
763
954
|
alt: title,
|
|
764
955
|
className: "h-auto w-auto max-w-[580px]"
|
|
765
956
|
}
|
|
766
|
-
) }) : /* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */
|
|
957
|
+
) }) : /* @__PURE__ */ jsx11("h1", { className: "text-5xl lg:text-7xl font-bold tracking-tight mb-6 text-gray-900 dark:text-white", children: title }),
|
|
958
|
+
/* @__PURE__ */ jsx11("p", { className: "text-xl lg:text-2xl text-gray-600 dark:text-gray-300 max-w-2xl leading-relaxed mb-8", children: description }),
|
|
959
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col sm:flex-row gap-3", children: [
|
|
960
|
+
/* @__PURE__ */ jsx11(
|
|
770
961
|
Link3,
|
|
771
962
|
{
|
|
772
963
|
href: ctaHref,
|
|
@@ -774,19 +965,19 @@ function HomeHero() {
|
|
|
774
965
|
children: ctaText
|
|
775
966
|
}
|
|
776
967
|
),
|
|
777
|
-
installCommand && /* @__PURE__ */
|
|
968
|
+
installCommand && /* @__PURE__ */ jsx11(InstallCommand, { command: installCommand })
|
|
778
969
|
] })
|
|
779
970
|
] }) }) });
|
|
780
971
|
}
|
|
781
972
|
function HomeFeatureItem({ feature, index, totalFeatures }) {
|
|
782
|
-
return /* @__PURE__ */
|
|
973
|
+
return /* @__PURE__ */ jsxs7(
|
|
783
974
|
"div",
|
|
784
975
|
{
|
|
785
976
|
className: `p-4 lg:p-10 border-b sm:border-b border-gray-200 dark:border-gray-800 ${index % 2 === 0 ? "sm:border-r" : ""} ${index >= totalFeatures - 2 ? "sm:border-b-0" : ""} ${index === totalFeatures - 1 && totalFeatures % 2 === 1 ? "border-b-0" : ""} transition-colors`,
|
|
786
977
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
789
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ jsx11("div", { className: "text-5xl font-bold text-primary-500 dark:text-primary-400 mb-4", children: String(index + 1).padStart(2, "0") }),
|
|
979
|
+
/* @__PURE__ */ jsx11("h3", { className: "text-xl font-bold mb-2 text-gray-900 dark:text-white", children: feature.title }),
|
|
980
|
+
/* @__PURE__ */ jsx11("p", { className: "text-gray-600 dark:text-gray-300", children: feature.description })
|
|
790
981
|
]
|
|
791
982
|
}
|
|
792
983
|
);
|
|
@@ -796,17 +987,17 @@ function HomeFeatures({ renderFeature } = {}) {
|
|
|
796
987
|
if (features.length === 0) {
|
|
797
988
|
return null;
|
|
798
989
|
}
|
|
799
|
-
return /* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
802
|
-
/* @__PURE__ */
|
|
990
|
+
return /* @__PURE__ */ jsx11("section", { className: "border-t border-gray-200 dark:border-gray-800 transition-colors", children: /* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-12", children: [
|
|
991
|
+
/* @__PURE__ */ jsxs7("div", { className: "col-span-12 lg:col-span-4 p-4 lg:p-10 border-b lg:border-b-0 lg:border-r border-gray-200 dark:border-gray-800 transition-colors", children: [
|
|
992
|
+
/* @__PURE__ */ jsx11("div", { className: "text-sm font-mono uppercase tracking-widest text-gray-500 dark:text-gray-400 mb-4", children: "Features" }),
|
|
993
|
+
/* @__PURE__ */ jsxs7("h2", { className: "text-4xl lg:text-5xl font-bold tracking-tight text-gray-900 dark:text-white", children: [
|
|
803
994
|
"Why ",
|
|
804
995
|
title,
|
|
805
996
|
"?"
|
|
806
997
|
] })
|
|
807
998
|
] }),
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
(feature, index) => renderFeature ? /* @__PURE__ */
|
|
999
|
+
/* @__PURE__ */ jsx11("div", { className: "col-span-12 lg:col-span-8 grid grid-cols-1 sm:grid-cols-2", children: features.map(
|
|
1000
|
+
(feature, index) => renderFeature ? /* @__PURE__ */ jsx11("div", { children: renderFeature(feature, index, HomeFeatureItem) }, index) : /* @__PURE__ */ jsx11(
|
|
810
1001
|
HomeFeatureItem,
|
|
811
1002
|
{
|
|
812
1003
|
feature,
|
|
@@ -820,11 +1011,11 @@ function HomeFeatures({ renderFeature } = {}) {
|
|
|
820
1011
|
}
|
|
821
1012
|
function HomeCTA() {
|
|
822
1013
|
const { ctaHref } = useHomePage();
|
|
823
|
-
return /* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
826
|
-
/* @__PURE__ */
|
|
827
|
-
/* @__PURE__ */
|
|
1014
|
+
return /* @__PURE__ */ jsx11("section", { className: "border-t border-gray-200 dark:border-gray-800 transition-colors", children: /* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-12 items-center", children: [
|
|
1015
|
+
/* @__PURE__ */ jsxs7("div", { className: "col-span-12 lg:col-span-8 p-4 lg:p-10", children: [
|
|
1016
|
+
/* @__PURE__ */ jsx11("h2", { className: "text-4xl lg:text-6xl font-bold tracking-tight mb-4 text-gray-900 dark:text-white", children: "Ready to start?" }),
|
|
1017
|
+
/* @__PURE__ */ jsx11("p", { className: "text-xl text-gray-600 dark:text-gray-300 mb-8 max-w-2xl", children: "Get up and running in minutes. Check out our documentation to learn more." }),
|
|
1018
|
+
/* @__PURE__ */ jsx11(
|
|
828
1019
|
Link3,
|
|
829
1020
|
{
|
|
830
1021
|
href: ctaHref,
|
|
@@ -833,12 +1024,12 @@ function HomeCTA() {
|
|
|
833
1024
|
}
|
|
834
1025
|
)
|
|
835
1026
|
] }),
|
|
836
|
-
/* @__PURE__ */
|
|
1027
|
+
/* @__PURE__ */ jsx11(
|
|
837
1028
|
Link3,
|
|
838
1029
|
{
|
|
839
1030
|
href: ctaHref,
|
|
840
1031
|
className: "col-span-12 lg:col-span-4 h-full bg-primary-500 hidden lg:flex items-center justify-center p-4 lg:p-10 hover:bg-gray-900 dark:hover:bg-white transition-colors min-h-[200px] group",
|
|
841
|
-
children: /* @__PURE__ */
|
|
1032
|
+
children: /* @__PURE__ */ jsx11("div", { className: "text-white group-hover:text-white dark:group-hover:text-gray-900 text-8xl font-bold transition-colors", children: "\u2192" })
|
|
842
1033
|
}
|
|
843
1034
|
)
|
|
844
1035
|
] }) });
|
|
@@ -847,11 +1038,11 @@ function HomeFooter() {
|
|
|
847
1038
|
const { title, logoUrl, footerLogoUrl, footerLogoInvertedUrl, navLinks, githubUrl } = useHomePage();
|
|
848
1039
|
const { resolvedTheme } = useTheme();
|
|
849
1040
|
const currentLogoUrl = resolvedTheme === "dark" ? footerLogoInvertedUrl || footerLogoUrl || logoUrl : footerLogoUrl || logoUrl;
|
|
850
|
-
return /* @__PURE__ */
|
|
851
|
-
currentLogoUrl && /* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
navLinks.map((link) => /* @__PURE__ */
|
|
854
|
-
githubUrl && /* @__PURE__ */
|
|
1041
|
+
return /* @__PURE__ */ jsx11("footer", { className: "border-t border-gray-200 dark:border-gray-800 py-8 bg-white dark:bg-[#0f0f0f] transition-colors", children: /* @__PURE__ */ jsxs7("div", { className: "px-4 lg:px-10 flex flex-col md:flex-row justify-between items-center gap-6", children: [
|
|
1042
|
+
currentLogoUrl && /* @__PURE__ */ jsx11(Link3, { href: "/", children: /* @__PURE__ */ jsx11("img", { src: currentLogoUrl, alt: title, className: "h-6" }) }),
|
|
1043
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex gap-8 text-sm text-gray-600 dark:text-gray-300", children: [
|
|
1044
|
+
navLinks.map((link) => /* @__PURE__ */ jsx11(Link3, { href: link.href, className: "hover:text-black dark:hover:text-white transition-colors", children: link.label }, link.href)),
|
|
1045
|
+
githubUrl && /* @__PURE__ */ jsx11(
|
|
855
1046
|
"a",
|
|
856
1047
|
{
|
|
857
1048
|
href: githubUrl,
|
|
@@ -865,7 +1056,7 @@ function HomeFooter() {
|
|
|
865
1056
|
] }) });
|
|
866
1057
|
}
|
|
867
1058
|
function HomeSpacer() {
|
|
868
|
-
return /* @__PURE__ */
|
|
1059
|
+
return /* @__PURE__ */ jsx11(
|
|
869
1060
|
"div",
|
|
870
1061
|
{
|
|
871
1062
|
className: "grow dark:hidden",
|
|
@@ -874,7 +1065,7 @@ function HomeSpacer() {
|
|
|
874
1065
|
);
|
|
875
1066
|
}
|
|
876
1067
|
function HomeSpacerDark() {
|
|
877
|
-
return /* @__PURE__ */
|
|
1068
|
+
return /* @__PURE__ */ jsx11(
|
|
878
1069
|
"div",
|
|
879
1070
|
{
|
|
880
1071
|
className: "grow hidden dark:block",
|
|
@@ -883,14 +1074,14 @@ function HomeSpacerDark() {
|
|
|
883
1074
|
);
|
|
884
1075
|
}
|
|
885
1076
|
function DefaultHomeLayout() {
|
|
886
|
-
return /* @__PURE__ */
|
|
887
|
-
/* @__PURE__ */
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
892
|
-
/* @__PURE__ */
|
|
893
|
-
/* @__PURE__ */
|
|
1077
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1078
|
+
/* @__PURE__ */ jsx11(HomeHeader, {}),
|
|
1079
|
+
/* @__PURE__ */ jsx11(HomeHero, {}),
|
|
1080
|
+
/* @__PURE__ */ jsx11(HomeFeatures, {}),
|
|
1081
|
+
/* @__PURE__ */ jsx11(HomeCTA, {}),
|
|
1082
|
+
/* @__PURE__ */ jsx11(HomeSpacer, {}),
|
|
1083
|
+
/* @__PURE__ */ jsx11(HomeSpacerDark, {}),
|
|
1084
|
+
/* @__PURE__ */ jsx11(HomeFooter, {})
|
|
894
1085
|
] });
|
|
895
1086
|
}
|
|
896
1087
|
function HomePage({
|
|
@@ -902,9 +1093,9 @@ function HomePage({
|
|
|
902
1093
|
...props,
|
|
903
1094
|
navLinks
|
|
904
1095
|
};
|
|
905
|
-
return /* @__PURE__ */
|
|
906
|
-
/* @__PURE__ */
|
|
907
|
-
children || /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ jsx11(HomePageContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs7("div", { className: "min-h-screen bg-white dark:bg-[#0f0f0f] flex flex-col transition-colors duration-200", children: [
|
|
1097
|
+
/* @__PURE__ */ jsx11(Head2, { title: props.title }),
|
|
1098
|
+
children || /* @__PURE__ */ jsx11(DefaultHomeLayout, {})
|
|
908
1099
|
] }) });
|
|
909
1100
|
}
|
|
910
1101
|
HomePage.Header = HomeHeader;
|
|
@@ -917,7 +1108,7 @@ HomePage.Footer = HomeFooter;
|
|
|
917
1108
|
// src/app.tsx
|
|
918
1109
|
import { createInertiaApp } from "@inertiajs/react";
|
|
919
1110
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
920
|
-
import { jsx as
|
|
1111
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
921
1112
|
function createDocsApp(config) {
|
|
922
1113
|
const { pages, title, components } = config;
|
|
923
1114
|
if (typeof window !== "undefined") {
|
|
@@ -934,7 +1125,7 @@ function createDocsApp(config) {
|
|
|
934
1125
|
return page;
|
|
935
1126
|
},
|
|
936
1127
|
setup({ el, App, props }) {
|
|
937
|
-
const appElement = /* @__PURE__ */
|
|
1128
|
+
const appElement = /* @__PURE__ */ jsx12(ThemeProvider, { children: /* @__PURE__ */ jsx12(ComponentsProvider, { components, children: /* @__PURE__ */ jsx12(App, { ...props }) }) });
|
|
938
1129
|
if (el.hasChildNodes()) {
|
|
939
1130
|
hydrateRoot(el, appElement);
|
|
940
1131
|
} else {
|
|
@@ -945,6 +1136,7 @@ function createDocsApp(config) {
|
|
|
945
1136
|
}
|
|
946
1137
|
export {
|
|
947
1138
|
CodeBlock,
|
|
1139
|
+
DocSetSelector,
|
|
948
1140
|
DocsLayout,
|
|
949
1141
|
DocsPage,
|
|
950
1142
|
EmojiConfetti,
|