@usecross/docs 0.7.0 → 0.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/dist/index.d.ts +10 -4
- package/dist/index.js +306 -145
- package/dist/index.js.map +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/{types-DlF8TX2Q.d.ts → types-DlTTA3Dc.d.ts} +15 -1
- package/package.json +1 -1
- package/src/components/DocsLayout.tsx +11 -0
- package/src/components/DocsPage.tsx +6 -1
- package/src/components/Markdown.tsx +45 -0
- package/src/components/TableOfContents.tsx +180 -0
- package/src/components/index.ts +1 -0
- package/src/index.ts +3 -0
- package/src/types.ts +16 -0
package/dist/index.js
CHANGED
|
@@ -307,7 +307,7 @@ function DocSetSelector({ docSets, currentDocSet, className }) {
|
|
|
307
307
|
|
|
308
308
|
// src/components/DocsLayout.tsx
|
|
309
309
|
import { Head, Link as Link2, usePage } from "@inertiajs/react";
|
|
310
|
-
import { useState as
|
|
310
|
+
import { useState as useState6 } from "react";
|
|
311
311
|
|
|
312
312
|
// src/components/Sidebar.tsx
|
|
313
313
|
import { Link } from "@inertiajs/react";
|
|
@@ -332,12 +332,138 @@ function Sidebar({ nav, currentPath, className, docSets, currentDocSet }) {
|
|
|
332
332
|
] });
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
+
// src/components/TableOfContents.tsx
|
|
336
|
+
import { useEffect as useEffect3, useState as useState3, useRef as useRef2 } from "react";
|
|
337
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
338
|
+
function TableOfContents({ items, className = "" }) {
|
|
339
|
+
const [activeId, setActiveId] = useState3(() => {
|
|
340
|
+
if (typeof window !== "undefined" && window.location.hash) {
|
|
341
|
+
return window.location.hash.slice(1);
|
|
342
|
+
}
|
|
343
|
+
return "";
|
|
344
|
+
});
|
|
345
|
+
const isClickScrolling = useRef2(false);
|
|
346
|
+
useEffect3(() => {
|
|
347
|
+
if (items.length === 0) return;
|
|
348
|
+
const handleHashChange = () => {
|
|
349
|
+
const hash = window.location.hash.slice(1);
|
|
350
|
+
if (hash) {
|
|
351
|
+
setActiveId(hash);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
window.addEventListener("hashchange", handleHashChange);
|
|
355
|
+
const handleScroll = () => {
|
|
356
|
+
if (isClickScrolling.current) return;
|
|
357
|
+
const headerOffset = 100;
|
|
358
|
+
let currentId = "";
|
|
359
|
+
const scrollTop = window.scrollY;
|
|
360
|
+
const scrollHeight = document.documentElement.scrollHeight;
|
|
361
|
+
const clientHeight = document.documentElement.clientHeight;
|
|
362
|
+
const isAtBottom = scrollTop + clientHeight >= scrollHeight - 50;
|
|
363
|
+
if (isAtBottom) {
|
|
364
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
365
|
+
const element = document.getElementById(items[i].id);
|
|
366
|
+
if (element) {
|
|
367
|
+
const rect = element.getBoundingClientRect();
|
|
368
|
+
if (rect.top < clientHeight && rect.bottom > 0) {
|
|
369
|
+
currentId = items[i].id;
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
} else {
|
|
375
|
+
for (const item of items) {
|
|
376
|
+
const element = document.getElementById(item.id);
|
|
377
|
+
if (element) {
|
|
378
|
+
const rect = element.getBoundingClientRect();
|
|
379
|
+
if (rect.top <= headerOffset) {
|
|
380
|
+
currentId = item.id;
|
|
381
|
+
} else {
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if (!currentId && items.length > 0) {
|
|
388
|
+
currentId = items[0].id;
|
|
389
|
+
}
|
|
390
|
+
if (currentId) {
|
|
391
|
+
setActiveId(currentId);
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
let ticking = false;
|
|
395
|
+
const scrollListener = () => {
|
|
396
|
+
if (!ticking) {
|
|
397
|
+
requestAnimationFrame(() => {
|
|
398
|
+
handleScroll();
|
|
399
|
+
ticking = false;
|
|
400
|
+
});
|
|
401
|
+
ticking = true;
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
window.addEventListener("scroll", scrollListener, { passive: true });
|
|
405
|
+
if (!window.location.hash) {
|
|
406
|
+
handleScroll();
|
|
407
|
+
}
|
|
408
|
+
return () => {
|
|
409
|
+
window.removeEventListener("scroll", scrollListener);
|
|
410
|
+
window.removeEventListener("hashchange", handleHashChange);
|
|
411
|
+
};
|
|
412
|
+
}, [items]);
|
|
413
|
+
const handleClick = (e, id) => {
|
|
414
|
+
e.preventDefault();
|
|
415
|
+
const element = document.getElementById(id);
|
|
416
|
+
if (element) {
|
|
417
|
+
isClickScrolling.current = true;
|
|
418
|
+
setActiveId(id);
|
|
419
|
+
const top = element.getBoundingClientRect().top + window.scrollY - 80;
|
|
420
|
+
window.scrollTo({ top, behavior: "smooth" });
|
|
421
|
+
window.history.pushState(null, "", `#${id}`);
|
|
422
|
+
let lastScrollY = window.scrollY;
|
|
423
|
+
let stableCount = 0;
|
|
424
|
+
const checkScrollEnd = () => {
|
|
425
|
+
if (window.scrollY === lastScrollY) {
|
|
426
|
+
stableCount++;
|
|
427
|
+
if (stableCount >= 5) {
|
|
428
|
+
isClickScrolling.current = false;
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
} else {
|
|
432
|
+
stableCount = 0;
|
|
433
|
+
lastScrollY = window.scrollY;
|
|
434
|
+
}
|
|
435
|
+
requestAnimationFrame(checkScrollEnd);
|
|
436
|
+
};
|
|
437
|
+
requestAnimationFrame(checkScrollEnd);
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
if (items.length === 0) {
|
|
441
|
+
return null;
|
|
442
|
+
}
|
|
443
|
+
return /* @__PURE__ */ jsxs4("nav", { className, children: [
|
|
444
|
+
/* @__PURE__ */ jsx4("h5", { className: "mb-4 text-sm font-semibold tracking-wide text-gray-500 dark:text-gray-400 uppercase", children: "On this page" }),
|
|
445
|
+
/* @__PURE__ */ jsx4("ul", { className: "space-y-2.5 text-sm border-l border-gray-200 dark:border-gray-700", children: items.map((item) => {
|
|
446
|
+
const isActive = activeId === item.id;
|
|
447
|
+
const indent = item.level === 3 ? "pl-6" : "pl-4";
|
|
448
|
+
return /* @__PURE__ */ jsx4("li", { children: /* @__PURE__ */ jsx4(
|
|
449
|
+
"a",
|
|
450
|
+
{
|
|
451
|
+
href: `#${item.id}`,
|
|
452
|
+
onClick: (e) => handleClick(e, item.id),
|
|
453
|
+
className: `block ${indent} -ml-px border-l transition-colors ${isActive ? "border-primary-500 text-primary-600 dark:text-primary-400" : "border-transparent text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:border-gray-300 dark:hover:border-gray-600"}`,
|
|
454
|
+
children: item.text
|
|
455
|
+
}
|
|
456
|
+
) }, item.id);
|
|
457
|
+
}) })
|
|
458
|
+
] });
|
|
459
|
+
}
|
|
460
|
+
|
|
335
461
|
// src/components/ThemeToggle.tsx
|
|
336
|
-
import { useState as
|
|
462
|
+
import { useState as useState5, useRef as useRef3, useEffect as useEffect5 } from "react";
|
|
337
463
|
|
|
338
464
|
// src/components/ThemeProvider.tsx
|
|
339
|
-
import { createContext, useContext, useEffect as
|
|
340
|
-
import { jsx as
|
|
465
|
+
import { createContext, useContext, useEffect as useEffect4, useState as useState4 } from "react";
|
|
466
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
341
467
|
var ThemeContext = createContext(null);
|
|
342
468
|
var STORAGE_KEY = "cross-docs-theme";
|
|
343
469
|
function getSystemTheme() {
|
|
@@ -357,17 +483,17 @@ function ThemeProvider({
|
|
|
357
483
|
defaultTheme: defaultTheme2 = "system",
|
|
358
484
|
forcedTheme
|
|
359
485
|
}) {
|
|
360
|
-
const [theme, setThemeState] =
|
|
486
|
+
const [theme, setThemeState] = useState4(() => {
|
|
361
487
|
if (typeof window === "undefined") return defaultTheme2;
|
|
362
488
|
return getStoredTheme() ?? defaultTheme2;
|
|
363
489
|
});
|
|
364
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
490
|
+
const [resolvedTheme, setResolvedTheme] = useState4(() => {
|
|
365
491
|
if (forcedTheme) return forcedTheme;
|
|
366
492
|
if (typeof window === "undefined") return "light";
|
|
367
493
|
if (theme === "system") return getSystemTheme();
|
|
368
494
|
return theme;
|
|
369
495
|
});
|
|
370
|
-
|
|
496
|
+
useEffect4(() => {
|
|
371
497
|
if (forcedTheme) {
|
|
372
498
|
setResolvedTheme(forcedTheme);
|
|
373
499
|
return;
|
|
@@ -389,7 +515,7 @@ function ThemeProvider({
|
|
|
389
515
|
mediaQuery.addEventListener("change", handleChange);
|
|
390
516
|
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
391
517
|
}, [theme, forcedTheme]);
|
|
392
|
-
|
|
518
|
+
useEffect4(() => {
|
|
393
519
|
const root = document.documentElement;
|
|
394
520
|
root.classList.remove("light", "dark");
|
|
395
521
|
root.classList.add(resolvedTheme);
|
|
@@ -398,7 +524,7 @@ function ThemeProvider({
|
|
|
398
524
|
setThemeState(newTheme);
|
|
399
525
|
localStorage.setItem(STORAGE_KEY, newTheme);
|
|
400
526
|
};
|
|
401
|
-
return /* @__PURE__ */
|
|
527
|
+
return /* @__PURE__ */ jsx5(ThemeContext.Provider, { value: { theme, resolvedTheme, setTheme }, children });
|
|
402
528
|
}
|
|
403
529
|
function useTheme() {
|
|
404
530
|
const context = useContext(ThemeContext);
|
|
@@ -419,15 +545,15 @@ var themeInitScript = `
|
|
|
419
545
|
`.trim();
|
|
420
546
|
|
|
421
547
|
// src/components/ThemeToggle.tsx
|
|
422
|
-
import { jsx as
|
|
423
|
-
var SunIcon = ({ className }) => /* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
/* @__PURE__ */
|
|
548
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
549
|
+
var SunIcon = ({ className }) => /* @__PURE__ */ jsxs5("svg", { className, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
550
|
+
/* @__PURE__ */ jsx6("circle", { cx: "12", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
551
|
+
/* @__PURE__ */ jsx6("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" })
|
|
426
552
|
] });
|
|
427
|
-
var MoonIcon = ({ className }) => /* @__PURE__ */
|
|
428
|
-
var MonitorIcon = ({ className }) => /* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
553
|
+
var MoonIcon = ({ className }) => /* @__PURE__ */ jsx6("svg", { className, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx6("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" }) });
|
|
554
|
+
var MonitorIcon = ({ className }) => /* @__PURE__ */ jsxs5("svg", { className, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
555
|
+
/* @__PURE__ */ jsx6("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
556
|
+
/* @__PURE__ */ jsx6("path", { d: "M8 21h8m-4-4v4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
431
557
|
] });
|
|
432
558
|
var themeOptions = [
|
|
433
559
|
{ value: "light", label: "Light", icon: SunIcon },
|
|
@@ -436,9 +562,9 @@ var themeOptions = [
|
|
|
436
562
|
];
|
|
437
563
|
function ThemeToggle({ className, size = "md" }) {
|
|
438
564
|
const { theme, resolvedTheme, setTheme } = useTheme();
|
|
439
|
-
const [isOpen, setIsOpen] =
|
|
440
|
-
const dropdownRef =
|
|
441
|
-
|
|
565
|
+
const [isOpen, setIsOpen] = useState5(false);
|
|
566
|
+
const dropdownRef = useRef3(null);
|
|
567
|
+
useEffect5(() => {
|
|
442
568
|
const handleClickOutside = (event) => {
|
|
443
569
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
444
570
|
setIsOpen(false);
|
|
@@ -449,7 +575,7 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
449
575
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
450
576
|
}
|
|
451
577
|
}, [isOpen]);
|
|
452
|
-
|
|
578
|
+
useEffect5(() => {
|
|
453
579
|
const handleEscape = (event) => {
|
|
454
580
|
if (event.key === "Escape") setIsOpen(false);
|
|
455
581
|
};
|
|
@@ -463,8 +589,8 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
463
589
|
md: "w-5 h-5",
|
|
464
590
|
lg: "w-[22px] h-[22px]"
|
|
465
591
|
};
|
|
466
|
-
return /* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ jsxs5("div", { className: "relative", ref: dropdownRef, children: [
|
|
593
|
+
/* @__PURE__ */ jsxs5(
|
|
468
594
|
"button",
|
|
469
595
|
{
|
|
470
596
|
onClick: () => setIsOpen(!isOpen),
|
|
@@ -482,7 +608,7 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
482
608
|
"aria-expanded": isOpen,
|
|
483
609
|
"aria-haspopup": "listbox",
|
|
484
610
|
children: [
|
|
485
|
-
/* @__PURE__ */
|
|
611
|
+
/* @__PURE__ */ jsx6(
|
|
486
612
|
SunIcon,
|
|
487
613
|
{
|
|
488
614
|
className: cn(
|
|
@@ -492,7 +618,7 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
492
618
|
)
|
|
493
619
|
}
|
|
494
620
|
),
|
|
495
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ jsx6(
|
|
496
622
|
MoonIcon,
|
|
497
623
|
{
|
|
498
624
|
className: cn(
|
|
@@ -505,7 +631,7 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
505
631
|
]
|
|
506
632
|
}
|
|
507
633
|
),
|
|
508
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ jsx6(
|
|
509
635
|
"div",
|
|
510
636
|
{
|
|
511
637
|
className: cn(
|
|
@@ -524,7 +650,7 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
524
650
|
children: themeOptions.map((option, index) => {
|
|
525
651
|
const Icon = option.icon;
|
|
526
652
|
const isSelected = theme === option.value;
|
|
527
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ jsxs5(
|
|
528
654
|
"button",
|
|
529
655
|
{
|
|
530
656
|
onClick: () => {
|
|
@@ -545,13 +671,13 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
545
671
|
animationDelay: isOpen ? `${index * 25}ms` : "0ms"
|
|
546
672
|
},
|
|
547
673
|
children: [
|
|
548
|
-
/* @__PURE__ */
|
|
674
|
+
/* @__PURE__ */ jsx6(Icon, { className: cn(
|
|
549
675
|
"w-4 h-4 flex-shrink-0",
|
|
550
676
|
"transition-transform duration-150",
|
|
551
677
|
isSelected ? "scale-110" : "scale-100"
|
|
552
678
|
) }),
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ jsx6("span", { className: "flex-1 text-left", children: option.label }),
|
|
680
|
+
/* @__PURE__ */ jsx6("div", { className: cn(
|
|
555
681
|
"w-1.5 h-1.5 rounded-full",
|
|
556
682
|
"transition-all duration-200",
|
|
557
683
|
isSelected ? "bg-primary-500 scale-100 opacity-100" : "bg-transparent scale-0 opacity-0"
|
|
@@ -567,23 +693,23 @@ function ThemeToggle({ className, size = "md" }) {
|
|
|
567
693
|
}
|
|
568
694
|
|
|
569
695
|
// src/components/DocsLayout.tsx
|
|
570
|
-
import { jsx as
|
|
696
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
571
697
|
function MobileMenuButton({ onClick, isOpen }) {
|
|
572
|
-
return /* @__PURE__ */
|
|
698
|
+
return /* @__PURE__ */ jsxs6(
|
|
573
699
|
"button",
|
|
574
700
|
{
|
|
575
701
|
onClick,
|
|
576
702
|
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",
|
|
577
703
|
"aria-expanded": isOpen,
|
|
578
704
|
children: [
|
|
579
|
-
/* @__PURE__ */
|
|
580
|
-
isOpen ? /* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ jsx7("span", { className: "sr-only", children: isOpen ? "Close menu" : "Open menu" }),
|
|
706
|
+
isOpen ? /* @__PURE__ */ jsx7("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx7("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) : /* @__PURE__ */ jsx7("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx7("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) })
|
|
581
707
|
]
|
|
582
708
|
}
|
|
583
709
|
);
|
|
584
710
|
}
|
|
585
711
|
function GitHubIcon() {
|
|
586
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ jsx7("svg", { className: "w-6 h-6", fill: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx7(
|
|
587
713
|
"path",
|
|
588
714
|
{
|
|
589
715
|
fillRule: "evenodd",
|
|
@@ -602,31 +728,32 @@ function DocsLayout({
|
|
|
602
728
|
logoInvertedUrl: propLogoInvertedUrl,
|
|
603
729
|
githubUrl: propGithubUrl,
|
|
604
730
|
navLinks: propNavLinks,
|
|
605
|
-
footer
|
|
731
|
+
footer,
|
|
732
|
+
toc
|
|
606
733
|
}) {
|
|
607
734
|
const sharedProps = usePage().props;
|
|
608
735
|
const { nav, currentPath, docSets, currentDocSet } = sharedProps;
|
|
609
|
-
const [mobileMenuOpen, setMobileMenuOpen] =
|
|
736
|
+
const [mobileMenuOpen, setMobileMenuOpen] = useState6(false);
|
|
610
737
|
const { resolvedTheme } = useTheme();
|
|
611
738
|
const logoUrl = propLogoUrl ?? sharedProps.logoUrl;
|
|
612
739
|
const logoInvertedUrl = propLogoInvertedUrl ?? sharedProps.logoInvertedUrl;
|
|
613
740
|
const githubUrl = propGithubUrl ?? sharedProps.githubUrl;
|
|
614
741
|
const navLinks = propNavLinks ?? sharedProps.navLinks ?? [];
|
|
615
|
-
const headerLogo = logoInverted || logo || (logoInvertedUrl ? /* @__PURE__ */
|
|
742
|
+
const headerLogo = logoInverted || logo || (logoInvertedUrl ? /* @__PURE__ */ jsx7("img", { src: logoInvertedUrl, alt: "Logo", className: "h-8" }) : logoUrl ? /* @__PURE__ */ jsx7("img", { src: logoUrl, alt: "Logo", className: "h-8" }) : null);
|
|
616
743
|
const footerLogoUrl = sharedProps.footerLogoUrl || logoUrl;
|
|
617
744
|
const footerLogoInvertedUrl = sharedProps.footerLogoInvertedUrl || logoInvertedUrl;
|
|
618
745
|
const currentFooterLogoUrl = resolvedTheme === "dark" ? footerLogoInvertedUrl || footerLogoUrl : footerLogoUrl;
|
|
619
|
-
const footerLogo = logo || (currentFooterLogoUrl ? /* @__PURE__ */
|
|
620
|
-
return /* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
headerLogo ? /* @__PURE__ */
|
|
746
|
+
const footerLogo = logo || (currentFooterLogoUrl ? /* @__PURE__ */ jsx7("img", { src: currentFooterLogoUrl, alt: "Logo", className: "h-6" }) : null);
|
|
747
|
+
return /* @__PURE__ */ jsxs6("div", { className: "min-h-screen bg-white dark:bg-[#0f0f0f] flex flex-col transition-colors duration-200", children: [
|
|
748
|
+
/* @__PURE__ */ jsx7(Head, { title }),
|
|
749
|
+
/* @__PURE__ */ jsx7("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__ */ jsx7("div", { className: "px-4 lg:px-10", children: /* @__PURE__ */ jsxs6("div", { className: "flex justify-between h-16 items-center", children: [
|
|
750
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
|
|
751
|
+
/* @__PURE__ */ jsx7(MobileMenuButton, { onClick: () => setMobileMenuOpen(!mobileMenuOpen), isOpen: mobileMenuOpen }),
|
|
752
|
+
headerLogo ? /* @__PURE__ */ jsx7(Link2, { href: "/", className: "flex items-center", children: headerLogo }) : /* @__PURE__ */ jsx7(Link2, { href: "/", className: "font-bold text-lg text-gray-900 dark:text-white", children: "Docs" })
|
|
626
753
|
] }),
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
/* @__PURE__ */
|
|
629
|
-
navLinks.map((link) => /* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-6", children: [
|
|
755
|
+
/* @__PURE__ */ jsx7("div", { className: "-mr-2", children: /* @__PURE__ */ jsx7(ThemeToggle, { size: "sm" }) }),
|
|
756
|
+
navLinks.map((link) => /* @__PURE__ */ jsx7(
|
|
630
757
|
Link2,
|
|
631
758
|
{
|
|
632
759
|
href: link.href,
|
|
@@ -635,31 +762,32 @@ function DocsLayout({
|
|
|
635
762
|
},
|
|
636
763
|
link.href
|
|
637
764
|
)),
|
|
638
|
-
githubUrl && /* @__PURE__ */
|
|
765
|
+
githubUrl && /* @__PURE__ */ jsx7(
|
|
639
766
|
"a",
|
|
640
767
|
{
|
|
641
768
|
href: githubUrl,
|
|
642
769
|
target: "_blank",
|
|
643
770
|
rel: "noopener noreferrer",
|
|
644
771
|
className: "text-gray-700 dark:text-gray-300 hover:text-primary-600 dark:hover:text-primary-400 transition-colors",
|
|
645
|
-
children: /* @__PURE__ */
|
|
772
|
+
children: /* @__PURE__ */ jsx7(GitHubIcon, {})
|
|
646
773
|
}
|
|
647
774
|
)
|
|
648
775
|
] })
|
|
649
776
|
] }) }) }),
|
|
650
|
-
mobileMenuOpen && /* @__PURE__ */
|
|
651
|
-
/* @__PURE__ */
|
|
652
|
-
/* @__PURE__ */
|
|
777
|
+
mobileMenuOpen && /* @__PURE__ */ jsxs6("div", { className: "fixed inset-0 z-40 lg:hidden", children: [
|
|
778
|
+
/* @__PURE__ */ jsx7("div", { className: "fixed inset-0 bg-black/50 dark:bg-black/70", onClick: () => setMobileMenuOpen(false) }),
|
|
779
|
+
/* @__PURE__ */ jsx7("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__ */ jsx7(Sidebar, { nav, currentPath, docSets, currentDocSet }) })
|
|
653
780
|
] }),
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ jsx7("div", { className: "bg-white dark:bg-[#0f0f0f] pt-16 w-full flex-1 transition-colors", children: /* @__PURE__ */ jsxs6("div", { className: "flex", children: [
|
|
782
|
+
/* @__PURE__ */ jsx7("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__ */ jsx7("nav", { className: "sticky top-16 px-4 py-6 max-h-[calc(100vh-4rem)] overflow-y-auto", children: /* @__PURE__ */ jsx7(Sidebar, { nav, currentPath, docSets, currentDocSet }) }) }),
|
|
783
|
+
/* @__PURE__ */ jsx7("main", { className: "flex-1 min-w-0 p-4 lg:px-10 lg:py-6", children: /* @__PURE__ */ jsx7("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 }) }),
|
|
784
|
+
toc && toc.length > 0 && /* @__PURE__ */ jsx7("aside", { className: "hidden xl:block w-64 flex-shrink-0 min-h-[calc(100vh-4rem)] transition-colors", children: /* @__PURE__ */ jsx7("div", { className: "sticky top-16 px-4 py-6 max-h-[calc(100vh-4rem)] overflow-y-auto", children: /* @__PURE__ */ jsx7(TableOfContents, { items: toc }) }) })
|
|
657
785
|
] }) }),
|
|
658
|
-
footer || /* @__PURE__ */
|
|
659
|
-
footerLogo && /* @__PURE__ */
|
|
660
|
-
/* @__PURE__ */
|
|
661
|
-
navLinks.map((link) => /* @__PURE__ */
|
|
662
|
-
githubUrl && /* @__PURE__ */
|
|
786
|
+
footer || /* @__PURE__ */ jsx7("footer", { className: "border-t border-gray-200 dark:border-gray-800 py-8 bg-white dark:bg-[#0f0f0f] transition-colors", children: /* @__PURE__ */ jsxs6("div", { className: "px-4 lg:px-10 flex flex-col md:flex-row justify-between items-center gap-6", children: [
|
|
787
|
+
footerLogo && /* @__PURE__ */ jsx7(Link2, { href: "/", children: footerLogo }),
|
|
788
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex gap-8 text-sm text-gray-600 dark:text-gray-400", children: [
|
|
789
|
+
navLinks.map((link) => /* @__PURE__ */ jsx7(Link2, { href: link.href, className: "hover:text-black dark:hover:text-white transition-colors", children: link.label }, link.href)),
|
|
790
|
+
githubUrl && /* @__PURE__ */ jsx7(
|
|
663
791
|
"a",
|
|
664
792
|
{
|
|
665
793
|
href: githubUrl,
|
|
@@ -678,7 +806,19 @@ function DocsLayout({
|
|
|
678
806
|
import ReactMarkdown from "react-markdown";
|
|
679
807
|
import remarkGfm from "remark-gfm";
|
|
680
808
|
import rehypeRaw from "rehype-raw";
|
|
681
|
-
import { Fragment, jsx as
|
|
809
|
+
import { Fragment, jsx as jsx8 } from "react/jsx-runtime";
|
|
810
|
+
function slugify(text) {
|
|
811
|
+
return text.toLowerCase().replace(/[\s_]+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
812
|
+
}
|
|
813
|
+
function getTextContent(children) {
|
|
814
|
+
if (typeof children === "string") return children;
|
|
815
|
+
if (typeof children === "number") return String(children);
|
|
816
|
+
if (Array.isArray(children)) return children.map(getTextContent).join("");
|
|
817
|
+
if (children && typeof children === "object" && "props" in children) {
|
|
818
|
+
return getTextContent(children.props.children);
|
|
819
|
+
}
|
|
820
|
+
return "";
|
|
821
|
+
}
|
|
682
822
|
function Markdown({ content, components }) {
|
|
683
823
|
const lowercaseComponents = components ? Object.entries(components).reduce(
|
|
684
824
|
(acc, [name, Component]) => {
|
|
@@ -687,7 +827,7 @@ function Markdown({ content, components }) {
|
|
|
687
827
|
},
|
|
688
828
|
{}
|
|
689
829
|
) : {};
|
|
690
|
-
return /* @__PURE__ */
|
|
830
|
+
return /* @__PURE__ */ jsx8(
|
|
691
831
|
ReactMarkdown,
|
|
692
832
|
{
|
|
693
833
|
remarkPlugins: [remarkGfm],
|
|
@@ -696,14 +836,14 @@ function Markdown({ content, components }) {
|
|
|
696
836
|
...lowercaseComponents,
|
|
697
837
|
// Override pre to avoid double wrapping with CodeBlock
|
|
698
838
|
pre({ children }) {
|
|
699
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ jsx8(Fragment, { children });
|
|
700
840
|
},
|
|
701
841
|
// Custom code block rendering with syntax highlighting
|
|
702
842
|
code({ node, className, children, ...props }) {
|
|
703
843
|
const match = /language-(\w+)/.exec(className || "");
|
|
704
844
|
const isInline = !match && !className;
|
|
705
845
|
if (isInline) {
|
|
706
|
-
return /* @__PURE__ */
|
|
846
|
+
return /* @__PURE__ */ jsx8(
|
|
707
847
|
"code",
|
|
708
848
|
{
|
|
709
849
|
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",
|
|
@@ -716,7 +856,7 @@ function Markdown({ content, components }) {
|
|
|
716
856
|
const titleMatch = /title="([^"]+)"/.exec(meta);
|
|
717
857
|
const filename = titleMatch ? titleMatch[1] : void 0;
|
|
718
858
|
const showLineNumbers = meta.includes("showLineNumbers");
|
|
719
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ jsx8(
|
|
720
860
|
CodeBlock,
|
|
721
861
|
{
|
|
722
862
|
code: String(children).replace(/\n$/, ""),
|
|
@@ -729,7 +869,7 @@ function Markdown({ content, components }) {
|
|
|
729
869
|
// Custom link styling
|
|
730
870
|
a({ href, children }) {
|
|
731
871
|
const isExternal = href?.startsWith("http");
|
|
732
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ jsx8(
|
|
733
873
|
"a",
|
|
734
874
|
{
|
|
735
875
|
href,
|
|
@@ -741,13 +881,24 @@ function Markdown({ content, components }) {
|
|
|
741
881
|
},
|
|
742
882
|
// Tables
|
|
743
883
|
table({ children }) {
|
|
744
|
-
return /* @__PURE__ */
|
|
884
|
+
return /* @__PURE__ */ jsx8("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsx8("table", { className: "w-full text-left text-sm", children }) });
|
|
745
885
|
},
|
|
746
886
|
th({ children }) {
|
|
747
|
-
return /* @__PURE__ */
|
|
887
|
+
return /* @__PURE__ */ jsx8("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 });
|
|
748
888
|
},
|
|
749
889
|
td({ children }) {
|
|
750
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ jsx8("td", { className: "border-b border-gray-200 px-4 py-2 dark:border-gray-700", children });
|
|
891
|
+
},
|
|
892
|
+
// Headings with anchor IDs for TOC
|
|
893
|
+
h2({ children }) {
|
|
894
|
+
const text = getTextContent(children);
|
|
895
|
+
const id = slugify(text);
|
|
896
|
+
return /* @__PURE__ */ jsx8("h2", { id, children });
|
|
897
|
+
},
|
|
898
|
+
h3({ children }) {
|
|
899
|
+
const text = getTextContent(children);
|
|
900
|
+
const id = slugify(text);
|
|
901
|
+
return /* @__PURE__ */ jsx8("h3", { id, children });
|
|
751
902
|
}
|
|
752
903
|
},
|
|
753
904
|
children: content
|
|
@@ -757,31 +908,40 @@ function Markdown({ content, components }) {
|
|
|
757
908
|
|
|
758
909
|
// src/context/ComponentsContext.tsx
|
|
759
910
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
760
|
-
import { jsx as
|
|
911
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
761
912
|
var ComponentsContext = createContext2({});
|
|
762
913
|
function ComponentsProvider({
|
|
763
914
|
children,
|
|
764
915
|
components
|
|
765
916
|
}) {
|
|
766
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ jsx9(ComponentsContext.Provider, { value: { components }, children });
|
|
767
918
|
}
|
|
768
919
|
function useComponents() {
|
|
769
920
|
return useContext2(ComponentsContext);
|
|
770
921
|
}
|
|
771
922
|
|
|
772
923
|
// src/components/DocsPage.tsx
|
|
773
|
-
import { jsx as
|
|
924
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
774
925
|
function DocsPage({ content, ...layoutProps }) {
|
|
775
926
|
const { components } = useComponents();
|
|
776
|
-
return /* @__PURE__ */
|
|
927
|
+
return /* @__PURE__ */ jsx10(
|
|
928
|
+
DocsLayout,
|
|
929
|
+
{
|
|
930
|
+
title: content?.title ?? "",
|
|
931
|
+
description: content?.description,
|
|
932
|
+
toc: content?.toc,
|
|
933
|
+
...layoutProps,
|
|
934
|
+
children: /* @__PURE__ */ jsx10(Markdown, { content: content?.body ?? "", components })
|
|
935
|
+
}
|
|
936
|
+
);
|
|
777
937
|
}
|
|
778
938
|
|
|
779
939
|
// src/components/EmojiConfetti.tsx
|
|
780
|
-
import { useState as
|
|
781
|
-
import { jsx as
|
|
940
|
+
import { useState as useState7, useCallback } from "react";
|
|
941
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
782
942
|
function EmojiConfetti({ children, emoji }) {
|
|
783
|
-
const [particles, setParticles] =
|
|
784
|
-
const [isActive, setIsActive] =
|
|
943
|
+
const [particles, setParticles] = useState7([]);
|
|
944
|
+
const [isActive, setIsActive] = useState7(false);
|
|
785
945
|
const triggerBurst = useCallback(() => {
|
|
786
946
|
if (isActive) return;
|
|
787
947
|
setIsActive(true);
|
|
@@ -808,17 +968,17 @@ function EmojiConfetti({ children, emoji }) {
|
|
|
808
968
|
setIsActive(false);
|
|
809
969
|
}, 1e3);
|
|
810
970
|
}, [isActive]);
|
|
811
|
-
return /* @__PURE__ */
|
|
971
|
+
return /* @__PURE__ */ jsxs7(
|
|
812
972
|
"span",
|
|
813
973
|
{
|
|
814
974
|
className: "relative inline-block",
|
|
815
975
|
onMouseEnter: triggerBurst,
|
|
816
976
|
children: [
|
|
817
977
|
children,
|
|
818
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ jsx11("span", { className: "absolute inset-0 pointer-events-none overflow-visible", children: particles.map((p) => {
|
|
819
979
|
const endX = p.x + Math.cos(p.angle) * p.velocity;
|
|
820
980
|
const endY = p.y + Math.sin(p.angle) * p.velocity;
|
|
821
|
-
return /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ jsx11(
|
|
822
982
|
"span",
|
|
823
983
|
{
|
|
824
984
|
className: "absolute",
|
|
@@ -844,8 +1004,8 @@ function EmojiConfetti({ children, emoji }) {
|
|
|
844
1004
|
|
|
845
1005
|
// src/components/HomePage.tsx
|
|
846
1006
|
import { Head as Head2, Link as Link3 } from "@inertiajs/react";
|
|
847
|
-
import { createContext as createContext3, useContext as useContext3, useState as
|
|
848
|
-
import { Fragment as Fragment2, jsx as
|
|
1007
|
+
import { createContext as createContext3, useContext as useContext3, useState as useState8 } from "react";
|
|
1008
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
849
1009
|
var HomePageContext = createContext3(null);
|
|
850
1010
|
function useHomePage() {
|
|
851
1011
|
const context = useContext3(HomePageContext);
|
|
@@ -855,28 +1015,28 @@ function useHomePage() {
|
|
|
855
1015
|
return context;
|
|
856
1016
|
}
|
|
857
1017
|
function InstallCommand({ command }) {
|
|
858
|
-
const [copied, setCopied] =
|
|
1018
|
+
const [copied, setCopied] = useState8(false);
|
|
859
1019
|
const copyToClipboard = async () => {
|
|
860
1020
|
await navigator.clipboard.writeText(command);
|
|
861
1021
|
setCopied(true);
|
|
862
1022
|
setTimeout(() => setCopied(false), 2e3);
|
|
863
1023
|
};
|
|
864
|
-
return /* @__PURE__ */
|
|
1024
|
+
return /* @__PURE__ */ jsxs8(
|
|
865
1025
|
"button",
|
|
866
1026
|
{
|
|
867
1027
|
onClick: copyToClipboard,
|
|
868
1028
|
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",
|
|
869
1029
|
children: [
|
|
870
|
-
/* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ jsx12("span", { className: "text-primary-500 dark:text-primary-600 mr-2", children: "$" }),
|
|
1031
|
+
/* @__PURE__ */ jsx12("span", { children: command }),
|
|
1032
|
+
/* @__PURE__ */ jsx12(
|
|
873
1033
|
"svg",
|
|
874
1034
|
{
|
|
875
1035
|
className: `ml-4 w-4 h-4 transition ${copied ? "text-green-400" : "opacity-50 group-hover:opacity-100"}`,
|
|
876
1036
|
fill: "none",
|
|
877
1037
|
stroke: "currentColor",
|
|
878
1038
|
viewBox: "0 0 24 24",
|
|
879
|
-
children: /* @__PURE__ */
|
|
1039
|
+
children: /* @__PURE__ */ jsx12(
|
|
880
1040
|
"path",
|
|
881
1041
|
{
|
|
882
1042
|
strokeLinecap: "round",
|
|
@@ -887,7 +1047,7 @@ function InstallCommand({ command }) {
|
|
|
887
1047
|
)
|
|
888
1048
|
}
|
|
889
1049
|
),
|
|
890
|
-
/* @__PURE__ */
|
|
1050
|
+
/* @__PURE__ */ jsx12(
|
|
891
1051
|
"span",
|
|
892
1052
|
{
|
|
893
1053
|
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"}`,
|
|
@@ -899,7 +1059,7 @@ function InstallCommand({ command }) {
|
|
|
899
1059
|
);
|
|
900
1060
|
}
|
|
901
1061
|
function GitHubIcon2() {
|
|
902
|
-
return /* @__PURE__ */
|
|
1062
|
+
return /* @__PURE__ */ jsx12("svg", { className: "w-6 h-6", fill: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx12(
|
|
903
1063
|
"path",
|
|
904
1064
|
{
|
|
905
1065
|
fillRule: "evenodd",
|
|
@@ -911,17 +1071,17 @@ function GitHubIcon2() {
|
|
|
911
1071
|
function DefaultLogo() {
|
|
912
1072
|
const { title, logoUrl } = useHomePage();
|
|
913
1073
|
if (logoUrl) {
|
|
914
|
-
return /* @__PURE__ */
|
|
1074
|
+
return /* @__PURE__ */ jsx12(Link3, { href: "/", className: "flex items-center", children: /* @__PURE__ */ jsx12("img", { src: logoUrl, alt: title, className: "h-8" }) });
|
|
915
1075
|
}
|
|
916
|
-
return /* @__PURE__ */
|
|
1076
|
+
return /* @__PURE__ */ jsx12(Link3, { href: "/", className: "font-bold text-lg text-gray-900 dark:text-white", children: title });
|
|
917
1077
|
}
|
|
918
1078
|
function HomeHeader({ renderLogo } = {}) {
|
|
919
1079
|
const { navLinks, githubUrl } = useHomePage();
|
|
920
|
-
return /* @__PURE__ */
|
|
921
|
-
renderLogo ? renderLogo() : /* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
/* @__PURE__ */
|
|
924
|
-
navLinks.map((link) => /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ jsx12("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__ */ jsx12("div", { className: "px-4 lg:px-10", children: /* @__PURE__ */ jsxs8("div", { className: "flex justify-between h-16 items-center", children: [
|
|
1081
|
+
renderLogo ? renderLogo() : /* @__PURE__ */ jsx12(DefaultLogo, {}),
|
|
1082
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-6", children: [
|
|
1083
|
+
/* @__PURE__ */ jsx12("div", { className: "-mr-2", children: /* @__PURE__ */ jsx12(ThemeToggle, { size: "sm" }) }),
|
|
1084
|
+
navLinks.map((link) => /* @__PURE__ */ jsx12(
|
|
925
1085
|
Link3,
|
|
926
1086
|
{
|
|
927
1087
|
href: link.href,
|
|
@@ -930,14 +1090,14 @@ function HomeHeader({ renderLogo } = {}) {
|
|
|
930
1090
|
},
|
|
931
1091
|
link.href
|
|
932
1092
|
)),
|
|
933
|
-
githubUrl && /* @__PURE__ */
|
|
1093
|
+
githubUrl && /* @__PURE__ */ jsx12(
|
|
934
1094
|
"a",
|
|
935
1095
|
{
|
|
936
1096
|
href: githubUrl,
|
|
937
1097
|
target: "_blank",
|
|
938
1098
|
rel: "noopener noreferrer",
|
|
939
1099
|
className: "text-gray-700 dark:text-gray-300 hover:text-primary-600 dark:hover:text-primary-400 transition-colors",
|
|
940
|
-
children: /* @__PURE__ */
|
|
1100
|
+
children: /* @__PURE__ */ jsx12(GitHubIcon2, {})
|
|
941
1101
|
}
|
|
942
1102
|
)
|
|
943
1103
|
] })
|
|
@@ -945,19 +1105,19 @@ function HomeHeader({ renderLogo } = {}) {
|
|
|
945
1105
|
}
|
|
946
1106
|
function HomeHero() {
|
|
947
1107
|
const { title, tagline, description, ctaText, ctaHref, installCommand, heroLogoUrl } = useHomePage();
|
|
948
|
-
return /* @__PURE__ */
|
|
949
|
-
/* @__PURE__ */
|
|
950
|
-
heroLogoUrl ? /* @__PURE__ */
|
|
1108
|
+
return /* @__PURE__ */ jsx12("section", { className: "pt-16", children: /* @__PURE__ */ jsx12("div", { className: "px-4 lg:px-10 py-16 lg:py-24", children: /* @__PURE__ */ jsxs8("div", { className: "max-w-4xl", children: [
|
|
1109
|
+
/* @__PURE__ */ jsx12("div", { className: "mb-4 text-sm font-mono uppercase tracking-widest text-gray-500 dark:text-gray-400", children: tagline }),
|
|
1110
|
+
heroLogoUrl ? /* @__PURE__ */ jsx12("h1", { className: "mb-6 lg:mb-8", children: /* @__PURE__ */ jsx12(
|
|
951
1111
|
"img",
|
|
952
1112
|
{
|
|
953
1113
|
src: heroLogoUrl,
|
|
954
1114
|
alt: title,
|
|
955
1115
|
className: "h-auto w-auto max-w-[580px]"
|
|
956
1116
|
}
|
|
957
|
-
) }) : /* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
/* @__PURE__ */
|
|
1117
|
+
) }) : /* @__PURE__ */ jsx12("h1", { className: "text-5xl lg:text-7xl font-bold tracking-tight mb-6 text-gray-900 dark:text-white", children: title }),
|
|
1118
|
+
/* @__PURE__ */ jsx12("p", { className: "text-xl lg:text-2xl text-gray-600 dark:text-gray-300 max-w-2xl leading-relaxed mb-8", children: description }),
|
|
1119
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col sm:flex-row gap-3", children: [
|
|
1120
|
+
/* @__PURE__ */ jsx12(
|
|
961
1121
|
Link3,
|
|
962
1122
|
{
|
|
963
1123
|
href: ctaHref,
|
|
@@ -965,19 +1125,19 @@ function HomeHero() {
|
|
|
965
1125
|
children: ctaText
|
|
966
1126
|
}
|
|
967
1127
|
),
|
|
968
|
-
installCommand && /* @__PURE__ */
|
|
1128
|
+
installCommand && /* @__PURE__ */ jsx12(InstallCommand, { command: installCommand })
|
|
969
1129
|
] })
|
|
970
1130
|
] }) }) });
|
|
971
1131
|
}
|
|
972
1132
|
function HomeFeatureItem({ feature, index, totalFeatures }) {
|
|
973
|
-
return /* @__PURE__ */
|
|
1133
|
+
return /* @__PURE__ */ jsxs8(
|
|
974
1134
|
"div",
|
|
975
1135
|
{
|
|
976
1136
|
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`,
|
|
977
1137
|
children: [
|
|
978
|
-
/* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
/* @__PURE__ */
|
|
1138
|
+
/* @__PURE__ */ jsx12("div", { className: "text-5xl font-bold text-primary-500 dark:text-primary-400 mb-4", children: String(index + 1).padStart(2, "0") }),
|
|
1139
|
+
/* @__PURE__ */ jsx12("h3", { className: "text-xl font-bold mb-2 text-gray-900 dark:text-white", children: feature.title }),
|
|
1140
|
+
/* @__PURE__ */ jsx12("p", { className: "text-gray-600 dark:text-gray-300", children: feature.description })
|
|
981
1141
|
]
|
|
982
1142
|
}
|
|
983
1143
|
);
|
|
@@ -987,17 +1147,17 @@ function HomeFeatures({ renderFeature } = {}) {
|
|
|
987
1147
|
if (features.length === 0) {
|
|
988
1148
|
return null;
|
|
989
1149
|
}
|
|
990
|
-
return /* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
1150
|
+
return /* @__PURE__ */ jsx12("section", { className: "border-t border-gray-200 dark:border-gray-800 transition-colors", children: /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-12", children: [
|
|
1151
|
+
/* @__PURE__ */ jsxs8("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: [
|
|
1152
|
+
/* @__PURE__ */ jsx12("div", { className: "text-sm font-mono uppercase tracking-widest text-gray-500 dark:text-gray-400 mb-4", children: "Features" }),
|
|
1153
|
+
/* @__PURE__ */ jsxs8("h2", { className: "text-4xl lg:text-5xl font-bold tracking-tight text-gray-900 dark:text-white", children: [
|
|
994
1154
|
"Why ",
|
|
995
1155
|
title,
|
|
996
1156
|
"?"
|
|
997
1157
|
] })
|
|
998
1158
|
] }),
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
(feature, index) => renderFeature ? /* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ jsx12("div", { className: "col-span-12 lg:col-span-8 grid grid-cols-1 sm:grid-cols-2", children: features.map(
|
|
1160
|
+
(feature, index) => renderFeature ? /* @__PURE__ */ jsx12("div", { children: renderFeature(feature, index, HomeFeatureItem) }, index) : /* @__PURE__ */ jsx12(
|
|
1001
1161
|
HomeFeatureItem,
|
|
1002
1162
|
{
|
|
1003
1163
|
feature,
|
|
@@ -1011,11 +1171,11 @@ function HomeFeatures({ renderFeature } = {}) {
|
|
|
1011
1171
|
}
|
|
1012
1172
|
function HomeCTA() {
|
|
1013
1173
|
const { ctaHref } = useHomePage();
|
|
1014
|
-
return /* @__PURE__ */
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
/* @__PURE__ */
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
/* @__PURE__ */
|
|
1174
|
+
return /* @__PURE__ */ jsx12("section", { className: "border-t border-gray-200 dark:border-gray-800 transition-colors", children: /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-12 items-center", children: [
|
|
1175
|
+
/* @__PURE__ */ jsxs8("div", { className: "col-span-12 lg:col-span-8 p-4 lg:p-10", children: [
|
|
1176
|
+
/* @__PURE__ */ jsx12("h2", { className: "text-4xl lg:text-6xl font-bold tracking-tight mb-4 text-gray-900 dark:text-white", children: "Ready to start?" }),
|
|
1177
|
+
/* @__PURE__ */ jsx12("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." }),
|
|
1178
|
+
/* @__PURE__ */ jsx12(
|
|
1019
1179
|
Link3,
|
|
1020
1180
|
{
|
|
1021
1181
|
href: ctaHref,
|
|
@@ -1024,12 +1184,12 @@ function HomeCTA() {
|
|
|
1024
1184
|
}
|
|
1025
1185
|
)
|
|
1026
1186
|
] }),
|
|
1027
|
-
/* @__PURE__ */
|
|
1187
|
+
/* @__PURE__ */ jsx12(
|
|
1028
1188
|
Link3,
|
|
1029
1189
|
{
|
|
1030
1190
|
href: ctaHref,
|
|
1031
1191
|
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",
|
|
1032
|
-
children: /* @__PURE__ */
|
|
1192
|
+
children: /* @__PURE__ */ jsx12("div", { className: "text-white group-hover:text-white dark:group-hover:text-gray-900 text-8xl font-bold transition-colors", children: "\u2192" })
|
|
1033
1193
|
}
|
|
1034
1194
|
)
|
|
1035
1195
|
] }) });
|
|
@@ -1038,11 +1198,11 @@ function HomeFooter() {
|
|
|
1038
1198
|
const { title, logoUrl, footerLogoUrl, footerLogoInvertedUrl, navLinks, githubUrl } = useHomePage();
|
|
1039
1199
|
const { resolvedTheme } = useTheme();
|
|
1040
1200
|
const currentLogoUrl = resolvedTheme === "dark" ? footerLogoInvertedUrl || footerLogoUrl || logoUrl : footerLogoUrl || logoUrl;
|
|
1041
|
-
return /* @__PURE__ */
|
|
1042
|
-
currentLogoUrl && /* @__PURE__ */
|
|
1043
|
-
/* @__PURE__ */
|
|
1044
|
-
navLinks.map((link) => /* @__PURE__ */
|
|
1045
|
-
githubUrl && /* @__PURE__ */
|
|
1201
|
+
return /* @__PURE__ */ jsx12("footer", { className: "border-t border-gray-200 dark:border-gray-800 py-8 bg-white dark:bg-[#0f0f0f] transition-colors", children: /* @__PURE__ */ jsxs8("div", { className: "px-4 lg:px-10 flex flex-col md:flex-row justify-between items-center gap-6", children: [
|
|
1202
|
+
currentLogoUrl && /* @__PURE__ */ jsx12(Link3, { href: "/", children: /* @__PURE__ */ jsx12("img", { src: currentLogoUrl, alt: title, className: "h-6" }) }),
|
|
1203
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex gap-8 text-sm text-gray-600 dark:text-gray-300", children: [
|
|
1204
|
+
navLinks.map((link) => /* @__PURE__ */ jsx12(Link3, { href: link.href, className: "hover:text-black dark:hover:text-white transition-colors", children: link.label }, link.href)),
|
|
1205
|
+
githubUrl && /* @__PURE__ */ jsx12(
|
|
1046
1206
|
"a",
|
|
1047
1207
|
{
|
|
1048
1208
|
href: githubUrl,
|
|
@@ -1056,7 +1216,7 @@ function HomeFooter() {
|
|
|
1056
1216
|
] }) });
|
|
1057
1217
|
}
|
|
1058
1218
|
function HomeSpacer() {
|
|
1059
|
-
return /* @__PURE__ */
|
|
1219
|
+
return /* @__PURE__ */ jsx12(
|
|
1060
1220
|
"div",
|
|
1061
1221
|
{
|
|
1062
1222
|
className: "grow dark:hidden",
|
|
@@ -1065,7 +1225,7 @@ function HomeSpacer() {
|
|
|
1065
1225
|
);
|
|
1066
1226
|
}
|
|
1067
1227
|
function HomeSpacerDark() {
|
|
1068
|
-
return /* @__PURE__ */
|
|
1228
|
+
return /* @__PURE__ */ jsx12(
|
|
1069
1229
|
"div",
|
|
1070
1230
|
{
|
|
1071
1231
|
className: "grow hidden dark:block",
|
|
@@ -1074,14 +1234,14 @@ function HomeSpacerDark() {
|
|
|
1074
1234
|
);
|
|
1075
1235
|
}
|
|
1076
1236
|
function DefaultHomeLayout() {
|
|
1077
|
-
return /* @__PURE__ */
|
|
1078
|
-
/* @__PURE__ */
|
|
1079
|
-
/* @__PURE__ */
|
|
1080
|
-
/* @__PURE__ */
|
|
1081
|
-
/* @__PURE__ */
|
|
1082
|
-
/* @__PURE__ */
|
|
1083
|
-
/* @__PURE__ */
|
|
1084
|
-
/* @__PURE__ */
|
|
1237
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1238
|
+
/* @__PURE__ */ jsx12(HomeHeader, {}),
|
|
1239
|
+
/* @__PURE__ */ jsx12(HomeHero, {}),
|
|
1240
|
+
/* @__PURE__ */ jsx12(HomeFeatures, {}),
|
|
1241
|
+
/* @__PURE__ */ jsx12(HomeCTA, {}),
|
|
1242
|
+
/* @__PURE__ */ jsx12(HomeSpacer, {}),
|
|
1243
|
+
/* @__PURE__ */ jsx12(HomeSpacerDark, {}),
|
|
1244
|
+
/* @__PURE__ */ jsx12(HomeFooter, {})
|
|
1085
1245
|
] });
|
|
1086
1246
|
}
|
|
1087
1247
|
function HomePage({
|
|
@@ -1093,9 +1253,9 @@ function HomePage({
|
|
|
1093
1253
|
...props,
|
|
1094
1254
|
navLinks
|
|
1095
1255
|
};
|
|
1096
|
-
return /* @__PURE__ */
|
|
1097
|
-
/* @__PURE__ */
|
|
1098
|
-
children || /* @__PURE__ */
|
|
1256
|
+
return /* @__PURE__ */ jsx12(HomePageContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs8("div", { className: "min-h-screen bg-white dark:bg-[#0f0f0f] flex flex-col transition-colors duration-200", children: [
|
|
1257
|
+
/* @__PURE__ */ jsx12(Head2, { title: props.title }),
|
|
1258
|
+
children || /* @__PURE__ */ jsx12(DefaultHomeLayout, {})
|
|
1099
1259
|
] }) });
|
|
1100
1260
|
}
|
|
1101
1261
|
HomePage.Header = HomeHeader;
|
|
@@ -1108,7 +1268,7 @@ HomePage.Footer = HomeFooter;
|
|
|
1108
1268
|
// src/app.tsx
|
|
1109
1269
|
import { createInertiaApp } from "@inertiajs/react";
|
|
1110
1270
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
1111
|
-
import { jsx as
|
|
1271
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1112
1272
|
function createDocsApp(config) {
|
|
1113
1273
|
const { pages, title, components } = config;
|
|
1114
1274
|
if (typeof window !== "undefined") {
|
|
@@ -1125,7 +1285,7 @@ function createDocsApp(config) {
|
|
|
1125
1285
|
return page;
|
|
1126
1286
|
},
|
|
1127
1287
|
setup({ el, App, props }) {
|
|
1128
|
-
const appElement = /* @__PURE__ */
|
|
1288
|
+
const appElement = /* @__PURE__ */ jsx13(ThemeProvider, { children: /* @__PURE__ */ jsx13(ComponentsProvider, { components, children: /* @__PURE__ */ jsx13(App, { ...props }) }) });
|
|
1129
1289
|
if (el.hasChildNodes()) {
|
|
1130
1290
|
hydrateRoot(el, appElement);
|
|
1131
1291
|
} else {
|
|
@@ -1150,6 +1310,7 @@ export {
|
|
|
1150
1310
|
InlineCode,
|
|
1151
1311
|
Markdown,
|
|
1152
1312
|
Sidebar,
|
|
1313
|
+
TableOfContents,
|
|
1153
1314
|
ThemeProvider,
|
|
1154
1315
|
ThemeToggle,
|
|
1155
1316
|
cn,
|