radiant-docs 0.1.37 → 0.1.39
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/package.json +1 -1
- package/template/astro.config.mjs +2 -0
- package/template/src/components/Footer.astro +1 -1
- package/template/src/components/Header.astro +8 -8
- package/template/src/components/OpenApiPage.astro +18 -18
- package/template/src/components/Search.astro +18 -18
- package/template/src/components/Sidebar.astro +4 -2
- package/template/src/components/SidebarDropdown.astro +82 -79
- package/template/src/components/SidebarSegmented.astro +5 -5
- package/template/src/components/TableOfContents.astro +24 -15
- package/template/src/components/ThemeSwitcher.astro +15 -8
- package/template/src/components/chat/AskAiWidget.tsx +4 -3
- package/template/src/components/endpoint/PlaygroundBar.astro +3 -3
- package/template/src/components/endpoint/PlaygroundButton.astro +2 -2
- package/template/src/components/endpoint/PlaygroundField.astro +53 -53
- package/template/src/components/endpoint/PlaygroundForm.astro +38 -22
- package/template/src/components/endpoint/RequestSnippets.astro +54 -21
- package/template/src/components/endpoint/ResponseDisplay.astro +24 -24
- package/template/src/components/endpoint/ResponseFieldTree.astro +12 -12
- package/template/src/components/endpoint/ResponseFields.astro +19 -19
- package/template/src/components/endpoint/ResponseSnippets.astro +66 -29
- package/template/src/components/ui/CodeTabEdge.astro +6 -4
- package/template/src/components/ui/Field.astro +7 -7
- package/template/src/components/ui/demo/Demo.astro +1 -1
- package/template/src/components/user/Accordion.astro +3 -3
- package/template/src/components/user/Callout.astro +8 -8
- package/template/src/components/user/CodeBlock.astro +63 -25
- package/template/src/components/user/CodeGroup.astro +259 -22
- package/template/src/components/user/ComponentPreviewBlock.astro +36 -10
- package/template/src/components/user/Image.astro +2 -2
- package/template/src/components/user/Step.astro +4 -4
- package/template/src/components/user/Tab.astro +1 -1
- package/template/src/components/user/Tabs.astro +142 -42
- package/template/src/layouts/Layout.astro +1 -1
- package/template/src/lib/code/code-block.ts +150 -15
- package/template/src/lib/mdx/remark-resolve-internal-links.ts +639 -0
- package/template/src/pages/404.astro +44 -0
- package/template/src/styles/global.css +51 -19
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ import path from "path";
|
|
|
11
11
|
import { getConfig, validateMdxContent } from "./src/lib/validation";
|
|
12
12
|
import remarkCodeBlockComponent from "./src/lib/mdx/remark-code-block-component";
|
|
13
13
|
import remarkDemoteH1 from "./src/lib/mdx/remark-demote-h1";
|
|
14
|
+
import remarkResolveInternalLinks from "./src/lib/mdx/remark-resolve-internal-links";
|
|
14
15
|
import remarkStandaloneImageComponent from "./src/lib/mdx/remark-standalone-image-component";
|
|
15
16
|
import rehypeExternalLinks from "./src/lib/mdx/rehype-external-links";
|
|
16
17
|
import remarkGfm from "remark-gfm";
|
|
@@ -303,6 +304,7 @@ export default defineConfig({
|
|
|
303
304
|
mdx({
|
|
304
305
|
remarkPlugins: [
|
|
305
306
|
remarkGfm,
|
|
307
|
+
remarkResolveInternalLinks,
|
|
306
308
|
remarkDemoteH1,
|
|
307
309
|
remarkStandaloneImageComponent,
|
|
308
310
|
remarkCodeBlockComponent,
|
|
@@ -91,7 +91,7 @@ const socialIcons: Record<string, string> = {
|
|
|
91
91
|
href="https://radiant.io"
|
|
92
92
|
class:list={[
|
|
93
93
|
"group flex items-center gap-1.5 text-[13px] text-neutral-400 dark:text-neutral-500 hover:text-neutral-600 dark:hover:text-neutral-300 transition-colors duration-200",
|
|
94
|
-
askAiEnabled && "sm:pr-
|
|
94
|
+
askAiEnabled && "sm:pr-13",
|
|
95
95
|
]}
|
|
96
96
|
>
|
|
97
97
|
Built with <span
|
|
@@ -15,9 +15,9 @@ const config = await getConfig();
|
|
|
15
15
|
|
|
16
16
|
<header
|
|
17
17
|
class:list={[
|
|
18
|
-
"fixed z-30 top-1 inset-x-1 shadow-[0px_-20px_0px_20px_var(--
|
|
18
|
+
"fixed z-30 top-1 inset-x-1 shadow-[0px_-20px_0px_20px_var(--background-dark)] h-16 border-x border-t border-border rounded-t-2xl overflow-hidden border-b bg-background border-b-border-light",
|
|
19
19
|
config.navbar?.blur &&
|
|
20
|
-
"sm:bg-background/80 sm:backdrop-blur-[18px] sm:backdrop-saturate-50 sm:border-b-neutral-100/85 sm:bg-clip-padding",
|
|
20
|
+
"sm:bg-background/80 sm:backdrop-blur-[18px] sm:backdrop-saturate-50 sm:border-b-neutral-100/85 sm:dark:border-neutral-800/85 sm:bg-clip-padding",
|
|
21
21
|
]}
|
|
22
22
|
data-pagefind-ignore
|
|
23
23
|
data-vaul-scale-chrome
|
|
@@ -34,12 +34,12 @@ const config = await getConfig();
|
|
|
34
34
|
x-bind:class="open ? 'rotate-90': ''"
|
|
35
35
|
>
|
|
36
36
|
<div
|
|
37
|
-
class="w-[14px] h-0.5 bg-neutral-900 rounded-full origin-[20%_50%] transition"
|
|
37
|
+
class="w-[14px] h-0.5 bg-neutral-900 dark:bg-white rounded-full origin-[20%_50%] transition"
|
|
38
38
|
x-bind:class="open ? 'rotate-45': ''"
|
|
39
39
|
>
|
|
40
40
|
</div>
|
|
41
41
|
<div
|
|
42
|
-
class="w-[14px] h-0.5 bg-neutral-900 rounded-full origin-[20%_50%] transition"
|
|
42
|
+
class="w-[14px] h-0.5 bg-neutral-900 dark:bg-white rounded-full origin-[20%_50%] transition"
|
|
43
43
|
x-bind:class="open ? '-rotate-45': ''"
|
|
44
44
|
>
|
|
45
45
|
</div>
|
|
@@ -58,7 +58,7 @@ const config = await getConfig();
|
|
|
58
58
|
showAskAiTrigger ? (
|
|
59
59
|
<button
|
|
60
60
|
type="button"
|
|
61
|
-
class="hidden md:inline-flex items-center gap-2 h-8 rounded-lg [corner-shape:superellipse(1.2)] bg-linear-to-b from-neutral-900/85 to-neutral-900 px-3 text-[13px] font-[350] text-white shadow-sm dark:bg-white dark:text-neutral-900 cursor-pointer"
|
|
61
|
+
class="hidden md:inline-flex items-center gap-2 h-8 rounded-lg [corner-shape:superellipse(1.2)] bg-linear-to-b from-neutral-900/85 dark:from-neutral-100 to-neutral-900 dark:to-neutral-200 px-3 text-[13px] font-[350] dark:font-medium text-white shadow-sm dark:bg-white dark:text-neutral-900 cursor-pointer"
|
|
62
62
|
onclick="window.dispatchEvent(new CustomEvent('ask-ai:open'));"
|
|
63
63
|
>
|
|
64
64
|
<img
|
|
@@ -87,7 +87,7 @@ const config = await getConfig();
|
|
|
87
87
|
{config.navbar.links.map((l, i, a) => (
|
|
88
88
|
<a
|
|
89
89
|
class:list={[
|
|
90
|
-
"items-center gap-1 text-[13px] font-[450] text-neutral-600/85 hover:text-neutral-600 duration-200 px-1.5 py-[5px] whitespace-nowrap",
|
|
90
|
+
"items-center gap-1 text-[13px] font-[450] dark:font-normal text-neutral-600/85 hover:text-neutral-600 dark:text-neutral-200/90 dark:hover:text-neutral-200 duration-200 px-1.5 py-[5px] whitespace-nowrap",
|
|
91
91
|
showAskAiTrigger && a.length === 3 && i === 2
|
|
92
92
|
? "hidden 2xl:flex"
|
|
93
93
|
: "flex",
|
|
@@ -110,7 +110,7 @@ const config = await getConfig();
|
|
|
110
110
|
{config.navbar.secondary && (
|
|
111
111
|
<a
|
|
112
112
|
class:list={[
|
|
113
|
-
"h-[33px] items-center gap-1.5 px-[11px] text-[13px] bg-white/90 text-neutral-600/85 hover:text-neutral-600 rounded-lg [corner-shape:superellipse(1.2)] border border-neutral-200
|
|
113
|
+
"h-[33px] items-center gap-1.5 px-[11px] text-[13px] bg-white/90 dark:bg-neutral-800/80 text-neutral-600/85 hover:text-neutral-600 dark:text-neutral-200/95 dark:hover:text-neutral-200 rounded-lg [corner-shape:superellipse(1.2)] border border-neutral-200 dark:border-neutral-700/40 shadow-xs transition-all whitespace-nowrap",
|
|
114
114
|
config.navbar.primary ? "hidden lg:flex" : "flex",
|
|
115
115
|
]}
|
|
116
116
|
href={config.navbar.secondary.href}
|
|
@@ -129,7 +129,7 @@ const config = await getConfig();
|
|
|
129
129
|
{config.navbar.primary && (
|
|
130
130
|
<a
|
|
131
131
|
class:list={[
|
|
132
|
-
"font-[350] h-8 flex items-center gap-2 px-3 text-[13px] rounded-lg [corner-shape:superellipse(1.2)] bg-linear-to-b from-neutral-900/85 to-neutral-900 text-white duration-200 shadow-sm transition-all whitespace-nowrap",
|
|
132
|
+
"font-[350] dark:font-[450] h-8 flex items-center gap-2 px-3 text-[13px] rounded-lg [corner-shape:superellipse(1.2)] bg-linear-to-b from-neutral-900/85 to-neutral-900 dark:from-neutral-100 dark:to-neutral-200 text-white dark:text-neutral-950 duration-200 shadow-sm transition-all whitespace-nowrap",
|
|
133
133
|
]}
|
|
134
134
|
href={config.navbar.primary.href}
|
|
135
135
|
>
|
|
@@ -908,7 +908,7 @@ const formattedBodyDescription = bodyDescription
|
|
|
908
908
|
{
|
|
909
909
|
formattedDescription && (
|
|
910
910
|
<div
|
|
911
|
-
class="mb-6 prose-rules text-neutral-500 **:text-neutral-500"
|
|
911
|
+
class="mb-6 prose-rules text-neutral-500 **:text-neutral-500 dark:text-neutral-400 dark:**:text-neutral-400"
|
|
912
912
|
set:html={formattedDescription}
|
|
913
913
|
/>
|
|
914
914
|
)
|
|
@@ -952,31 +952,31 @@ const formattedBodyDescription = bodyDescription
|
|
|
952
952
|
<h4 class="text-xl font-semibold">{headers[key]}</h4>
|
|
953
953
|
{key === "body" && formattedBodyDescription && (
|
|
954
954
|
<div
|
|
955
|
-
class="mt-2 prose-rules prose-sm! text-neutral-500 **:text-neutral-500"
|
|
955
|
+
class="mt-2 prose-rules prose-sm! text-neutral-500 **:text-neutral-500 dark:text-neutral-400 dark:**:text-neutral-400"
|
|
956
956
|
set:html={formattedBodyDescription}
|
|
957
957
|
/>
|
|
958
958
|
)}
|
|
959
959
|
{hasCommonFields && (
|
|
960
960
|
<div x-data="{ expanded: false }" class="mt-4">
|
|
961
961
|
<div
|
|
962
|
-
class="w-full overflow-hidden rounded-xl border border-neutral-200 bg-white transition-colors duration-200"
|
|
963
|
-
x-bind:class="expanded ? 'border-neutral-300' : 'border-neutral-200'"
|
|
962
|
+
class="w-full overflow-hidden rounded-xl border border-neutral-200 bg-white transition-colors duration-200 dark:border-neutral-800 dark:bg-(--rd-code-surface)"
|
|
963
|
+
x-bind:class="expanded ? 'border-neutral-300 dark:border-neutral-700' : 'border-neutral-200 dark:border-neutral-800'"
|
|
964
964
|
>
|
|
965
965
|
<button
|
|
966
966
|
type="button"
|
|
967
967
|
x-on:click="expanded = !expanded"
|
|
968
968
|
x-bind:aria-expanded="expanded"
|
|
969
|
-
class="group flex w-full items-center justify-between gap-3 px-4 py-2.5 text-left text-sm font-medium text-neutral-700 hover:bg-neutral-50 cursor-pointer transition-colors duration-200"
|
|
969
|
+
class="group flex w-full items-center justify-between gap-3 px-4 py-2.5 text-left text-sm font-medium text-neutral-700 hover:bg-neutral-50 cursor-pointer transition-colors duration-200 dark:text-neutral-300 dark:hover:bg-neutral-800/60"
|
|
970
970
|
>
|
|
971
971
|
<span class="inline-flex items-center gap-2">
|
|
972
|
-
<ListChevronsToggle class="size-4 shrink-0 text-neutral-400 group-hover:text-neutral-600 transition duration-200" />
|
|
972
|
+
<ListChevronsToggle class="size-4 shrink-0 text-neutral-400 group-hover:text-neutral-600 transition duration-200 dark:text-neutral-500 dark:group-hover:text-neutral-300" />
|
|
973
973
|
<span>
|
|
974
974
|
{sectionFields.length} {noun}
|
|
975
975
|
</span>
|
|
976
976
|
</span>
|
|
977
977
|
</button>
|
|
978
978
|
<div x-show="expanded" x-collapse x-cloak>
|
|
979
|
-
<div class="border-t border-neutral-100 p-4">
|
|
979
|
+
<div class="border-t border-neutral-100 p-4 dark:border-neutral-800">
|
|
980
980
|
<ResponseFieldTree fields={sectionFields} />
|
|
981
981
|
</div>
|
|
982
982
|
</div>
|
|
@@ -990,30 +990,30 @@ const formattedBodyDescription = bodyDescription
|
|
|
990
990
|
hasCommonFields ? "mt-3" : "mt-4",
|
|
991
991
|
]}
|
|
992
992
|
>
|
|
993
|
-
<p class="text-xs text-neutral-500">
|
|
993
|
+
<p class="text-xs text-neutral-500 dark:text-neutral-400">
|
|
994
994
|
{sectionVariantData?.variantType === "anyOf"
|
|
995
995
|
? "One or more variants may apply."
|
|
996
996
|
: "One of these variants applies."}
|
|
997
997
|
</p>
|
|
998
998
|
{sectionVariants.map((variant, index) => (
|
|
999
999
|
<>
|
|
1000
|
-
<div class="rounded-lg border border-neutral-200 bg-white p-3">
|
|
1001
|
-
<div class="mb-2 text-xs font-medium text-neutral-600">
|
|
1000
|
+
<div class="rounded-lg border border-neutral-200 bg-white p-3 dark:border-neutral-800 dark:bg-neutral-900/60">
|
|
1001
|
+
<div class="mb-2 text-xs font-medium text-neutral-600 dark:text-neutral-400">
|
|
1002
1002
|
{variant.label}
|
|
1003
1003
|
</div>
|
|
1004
1004
|
<div x-data="{ expanded: false }">
|
|
1005
1005
|
<div
|
|
1006
|
-
class="w-full overflow-hidden rounded-lg border border-neutral-200 bg-white transition-colors duration-200"
|
|
1007
|
-
x-bind:class="expanded ? 'border-neutral-300' : 'border-neutral-200'"
|
|
1006
|
+
class="w-full overflow-hidden rounded-lg border border-neutral-200 bg-white transition-colors duration-200 dark:border-neutral-800 dark:bg-(--rd-code-surface)"
|
|
1007
|
+
x-bind:class="expanded ? 'border-neutral-300 dark:border-neutral-700' : 'border-neutral-200 dark:border-neutral-800'"
|
|
1008
1008
|
>
|
|
1009
1009
|
<button
|
|
1010
1010
|
type="button"
|
|
1011
1011
|
x-on:click="expanded = !expanded"
|
|
1012
1012
|
x-bind:aria-expanded="expanded"
|
|
1013
|
-
class="group flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-xs font-medium text-neutral-700 hover:bg-neutral-50 cursor-pointer transition-colors duration-200"
|
|
1013
|
+
class="group flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-xs font-medium text-neutral-700 hover:bg-neutral-50 cursor-pointer transition-colors duration-200 dark:text-neutral-300 dark:hover:bg-neutral-800/60"
|
|
1014
1014
|
>
|
|
1015
1015
|
<span class="inline-flex items-center gap-2">
|
|
1016
|
-
<ListChevronsToggle class="size-4 shrink-0 text-neutral-400 group-hover:text-neutral-600 transition duration-200" />
|
|
1016
|
+
<ListChevronsToggle class="size-4 shrink-0 text-neutral-400 group-hover:text-neutral-600 transition duration-200 dark:text-neutral-500 dark:group-hover:text-neutral-300" />
|
|
1017
1017
|
<span>
|
|
1018
1018
|
{variant.fields.length}{" "}
|
|
1019
1019
|
{variant.fields.length === 1
|
|
@@ -1023,7 +1023,7 @@ const formattedBodyDescription = bodyDescription
|
|
|
1023
1023
|
</span>
|
|
1024
1024
|
</button>
|
|
1025
1025
|
<div x-show="expanded" x-collapse x-cloak>
|
|
1026
|
-
<div class="border-t border-neutral-100 px-3 py-3">
|
|
1026
|
+
<div class="border-t border-neutral-100 px-3 py-3 dark:border-neutral-800">
|
|
1027
1027
|
<ResponseFieldTree
|
|
1028
1028
|
fields={variant.fields}
|
|
1029
1029
|
/>
|
|
@@ -1035,11 +1035,11 @@ const formattedBodyDescription = bodyDescription
|
|
|
1035
1035
|
{sectionVariantData?.variantType === "oneOf" &&
|
|
1036
1036
|
index < sectionVariants.length - 1 && (
|
|
1037
1037
|
<div class="flex items-center gap-2 py-0">
|
|
1038
|
-
<div class="h-px flex-1 bg-neutral-200" />
|
|
1039
|
-
<span class="px-1 text-[10px] uppercase tracking-wide text-neutral-500">
|
|
1038
|
+
<div class="h-px flex-1 bg-neutral-200 dark:bg-neutral-800" />
|
|
1039
|
+
<span class="px-1 text-[10px] uppercase tracking-wide text-neutral-500 dark:text-neutral-400">
|
|
1040
1040
|
OR
|
|
1041
1041
|
</span>
|
|
1042
|
-
<div class="h-px flex-1 bg-neutral-200" />
|
|
1042
|
+
<div class="h-px flex-1 bg-neutral-200 dark:bg-neutral-800" />
|
|
1043
1043
|
</div>
|
|
1044
1044
|
)}
|
|
1045
1045
|
</>
|
|
@@ -12,7 +12,7 @@ import { Icon } from "astro-icon/components";
|
|
|
12
12
|
<!-- Search Trigger Button -->
|
|
13
13
|
<button
|
|
14
14
|
x-on:click="open()"
|
|
15
|
-
class="md:bg-white/90 dark:md:bg-neutral-800 flex items-center gap-2 h-[33px] md:min-w-64 px-3 -mr-3 xs:mr-0 text-xs text-neutral-500/80 dark:text-neutral-400/
|
|
15
|
+
class="md:bg-white/90 dark:md:bg-neutral-800 flex items-center gap-2 h-[33px] md:min-w-64 px-3 -mr-3 xs:mr-0 text-xs text-neutral-500/80 dark:text-neutral-400/70 hover:text-neutral-500 dark:hover:text-neutral-400 md:border border-border rounded-lg cursor-pointer md:shadow-xs md:hover:shadow-sm transition"
|
|
16
16
|
>
|
|
17
17
|
<Icon name="lucide:search" class="size-5 md:size-4" />
|
|
18
18
|
<span class="hidden md:inline">Search documentation</span>
|
|
@@ -49,11 +49,11 @@ import { Icon } from "astro-icon/components";
|
|
|
49
49
|
<!-- Search Input -->
|
|
50
50
|
<div
|
|
51
51
|
class="flex items-center gap-3 px-4"
|
|
52
|
-
:class="{ 'border-b border-neutral-200/80': results.length > 0 || (query.length > 0 && !loading) }"
|
|
52
|
+
:class="{ 'border-b border-neutral-200/80 dark:border-neutral-700/70': results.length > 0 || (query.length > 0 && !loading) }"
|
|
53
53
|
>
|
|
54
54
|
<Icon
|
|
55
55
|
name="lucide:search"
|
|
56
|
-
class="size-5 sm:size-[18px] text-neutral-400 shrink-0"
|
|
56
|
+
class="size-5 sm:size-[18px] text-neutral-400 dark:text-neutral-500 shrink-0"
|
|
57
57
|
/>
|
|
58
58
|
<input
|
|
59
59
|
x-ref="searchInput"
|
|
@@ -65,18 +65,18 @@ import { Icon } from "astro-icon/components";
|
|
|
65
65
|
x-on:keydown.enter.prevent="goToSelected()"
|
|
66
66
|
type="text"
|
|
67
67
|
placeholder="Search documentation..."
|
|
68
|
-
class="flex-1 py-4 text-base bg-transparent outline-none placeholder:text-neutral-400 sm:text-sm"
|
|
68
|
+
class="flex-1 py-4 text-base bg-transparent text-neutral-900 dark:text-neutral-100 outline-none placeholder:text-neutral-400 dark:placeholder:text-neutral-500 sm:text-sm"
|
|
69
69
|
/>
|
|
70
70
|
<div x-show="loading" class="shrink-0 p-1">
|
|
71
71
|
<Icon
|
|
72
72
|
name="lucide:loader"
|
|
73
|
-
class="w-4 h-4 text-neutral-400 animate-spin"
|
|
73
|
+
class="w-4 h-4 text-neutral-400 dark:text-neutral-500 animate-spin"
|
|
74
74
|
/>
|
|
75
75
|
</div>
|
|
76
76
|
<button
|
|
77
77
|
x-show="query.length > 0 && !loading"
|
|
78
78
|
x-on:click="clear()"
|
|
79
|
-
class="shrink-0 p-1 text-neutral-400 hover:text-neutral-600 transition-colors"
|
|
79
|
+
class="shrink-0 p-1 text-neutral-400 dark:text-neutral-500 hover:text-neutral-600 dark:hover:text-neutral-300 transition-colors"
|
|
80
80
|
>
|
|
81
81
|
<Icon name="lucide:x" class="w-4 h-4" />
|
|
82
82
|
</button>
|
|
@@ -87,14 +87,14 @@ import { Icon } from "astro-icon/components";
|
|
|
87
87
|
<!-- No Results -->
|
|
88
88
|
<div
|
|
89
89
|
x-show="query.length > 0 && results.length === 0 && !loading"
|
|
90
|
-
class="px-4 py-8 text-center text-neutral-500"
|
|
90
|
+
class="px-4 py-8 text-center text-neutral-500 dark:text-neutral-400"
|
|
91
91
|
>
|
|
92
92
|
<Icon
|
|
93
93
|
name="lucide:search-slash"
|
|
94
|
-
class="size-8 mx-auto mb-3 text-neutral-300"
|
|
94
|
+
class="size-8 mx-auto mb-3 text-neutral-300 dark:text-neutral-600"
|
|
95
95
|
/>
|
|
96
96
|
<p class="text-sm">
|
|
97
|
-
No results found for <strong class="text-neutral-600"
|
|
97
|
+
No results found for <strong class="text-neutral-600 dark:text-neutral-300"
|
|
98
98
|
>"<span x-text="query"></span>"</strong
|
|
99
99
|
>.
|
|
100
100
|
</p>
|
|
@@ -103,7 +103,7 @@ import { Icon } from "astro-icon/components";
|
|
|
103
103
|
<!-- Results List -->
|
|
104
104
|
<ul
|
|
105
105
|
x-show="results.length > 0"
|
|
106
|
-
class="divide-y divide-neutral-200/80"
|
|
106
|
+
class="divide-y divide-neutral-200/80 dark:divide-neutral-700/70"
|
|
107
107
|
>
|
|
108
108
|
<template
|
|
109
109
|
x-for="(result, index) in results"
|
|
@@ -115,30 +115,30 @@ import { Icon } from "astro-icon/components";
|
|
|
115
115
|
x-on:click="close()"
|
|
116
116
|
x-on:mouseenter="selectedIndex = index"
|
|
117
117
|
class="flex flex-col gap-1 px-4 py-3 transition-colors"
|
|
118
|
-
:class="{ 'bg-neutral-100/60': selectedIndex === index }"
|
|
118
|
+
:class="{ 'bg-neutral-100/60 dark:bg-neutral-700/30': selectedIndex === index }"
|
|
119
119
|
>
|
|
120
120
|
<div class="flex items-center gap-2">
|
|
121
121
|
<!-- Page icon -->
|
|
122
122
|
<Icon
|
|
123
123
|
name="lucide:file"
|
|
124
124
|
x-show="result.type === 'page'"
|
|
125
|
-
class="w-4 h-4 text-neutral-400 shrink-0"
|
|
125
|
+
class="w-4 h-4 text-neutral-400 dark:text-neutral-500 shrink-0"
|
|
126
126
|
/>
|
|
127
127
|
<!-- Heading icon -->
|
|
128
128
|
<Icon
|
|
129
129
|
name="lucide:hash"
|
|
130
130
|
x-show="result.type === 'heading'"
|
|
131
|
-
class="w-4 h-4 text-neutral-400 shrink-0"
|
|
131
|
+
class="w-4 h-4 text-neutral-400 dark:text-neutral-500 shrink-0"
|
|
132
132
|
/>
|
|
133
133
|
<!-- Content/body text icon -->
|
|
134
134
|
<Icon
|
|
135
135
|
name="lucide:text"
|
|
136
136
|
x-show="result.type === 'content'"
|
|
137
|
-
class="w-4 h-4 text-neutral-400 shrink-0"
|
|
137
|
+
class="w-4 h-4 text-neutral-400 dark:text-neutral-500 shrink-0"
|
|
138
138
|
/>
|
|
139
139
|
<!-- Parent title breadcrumb -->
|
|
140
140
|
<span
|
|
141
|
-
class="text-sm text-neutral-500 truncate"
|
|
141
|
+
class="text-sm text-neutral-500 dark:text-neutral-400 truncate"
|
|
142
142
|
x-show="result.parentTitle"
|
|
143
143
|
>
|
|
144
144
|
<span x-text="result.parentTitle"></span>
|
|
@@ -147,17 +147,17 @@ import { Icon } from "astro-icon/components";
|
|
|
147
147
|
<!-- Title: highlighted for page/heading, plain for content -->
|
|
148
148
|
<span
|
|
149
149
|
x-show="result.type === 'page' || result.type === 'heading'"
|
|
150
|
-
class="font-medium text-neutral-900 truncate [&_mark]:bg-neutral-200 [&_mark]:text-neutral-900 [&_mark]:rounded [&_mark]:px-0.5"
|
|
150
|
+
class="font-medium text-neutral-900 dark:text-neutral-100 truncate [&_mark]:bg-neutral-200 [&_mark]:text-neutral-900 dark:[&_mark]:bg-neutral-700 dark:[&_mark]:text-neutral-100 [&_mark]:rounded [&_mark]:px-0.5"
|
|
151
151
|
x-html="highlightMatch(result.title, query)"></span>
|
|
152
152
|
<span
|
|
153
153
|
x-show="result.type === 'content'"
|
|
154
|
-
class="font-medium text-neutral-900 truncate"
|
|
154
|
+
class="font-medium text-neutral-900 dark:text-neutral-100 truncate"
|
|
155
155
|
x-text="result.title"></span>
|
|
156
156
|
</div>
|
|
157
157
|
<!-- Excerpt: only for content type -->
|
|
158
158
|
<p
|
|
159
159
|
x-show="result.type === 'content'"
|
|
160
|
-
class="text-sm text-neutral-600 line-clamp-2 pl-6 [&_mark]:bg-neutral-200 [&_mark]:text-neutral-900 [&_mark]:rounded [&_mark]:px-0.5"
|
|
160
|
+
class="text-sm text-neutral-600 dark:text-neutral-300 line-clamp-2 pl-6 [&_mark]:bg-neutral-200 [&_mark]:text-neutral-900 dark:[&_mark]:bg-neutral-700 dark:[&_mark]:text-neutral-100 [&_mark]:rounded [&_mark]:px-0.5"
|
|
161
161
|
x-html="result.excerpt"
|
|
162
162
|
>
|
|
163
163
|
</p>
|
|
@@ -7,11 +7,13 @@ const config: DocsConfig = await getConfig();
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
<aside class="flex flex-col h-full">
|
|
10
|
-
<nav
|
|
10
|
+
<nav
|
|
11
|
+
class="overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
12
|
+
>
|
|
11
13
|
<SidebarMenu navigation={config.navigation} />
|
|
12
14
|
</nav>
|
|
13
15
|
<div
|
|
14
|
-
class="mt-auto bg-
|
|
16
|
+
class="mt-auto bg-background z-10 p-3 border-t border-t-border-light flex gap-1.5 justify-end items-center"
|
|
15
17
|
>
|
|
16
18
|
<span class="text-neutral-400 text-xs font-light">Theme</span>
|
|
17
19
|
<ThemeSwitcher />
|
|
@@ -69,88 +69,91 @@ const currentPrefix = parentSlug
|
|
|
69
69
|
<div x-data=`{
|
|
70
70
|
open: false,
|
|
71
71
|
}`>
|
|
72
|
-
<div
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
72
|
+
<div class="mt-3 mx-2 z-10 relative dark:bg-neutral-900 rounded-lg">
|
|
73
|
+
<div
|
|
74
|
+
class:list={[
|
|
75
|
+
"",
|
|
76
|
+
menu.label &&
|
|
77
|
+
"rounded-lg bg-neutral-100 dark:bg-neutral-800/60 p-[3px]",
|
|
78
|
+
]}
|
|
79
|
+
>
|
|
80
|
+
{
|
|
81
|
+
menu.label && (
|
|
82
|
+
<label class="font-semibold text-xs px-2 py-1.5 block">
|
|
83
|
+
{menu.label}
|
|
84
|
+
</label>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
<div class="relative">
|
|
88
|
+
<button
|
|
89
|
+
class="flex items-center w-full text-sm text-neutral-700 dark:text-neutral-200 bg-white dark:bg-neutral-700/30 border-t border-x border-neutral-200/70 dark:border-neutral-700/40 dark:border-b rounded-lg shadow-xs px-3 py-2 cursor-pointer"
|
|
90
|
+
x-on:click="open = true"
|
|
91
|
+
aria-haspopup="menu"
|
|
92
|
+
aria-expanded
|
|
93
|
+
>
|
|
94
|
+
{
|
|
95
|
+
menu.items[currentMenuIndex].icon && (
|
|
96
|
+
<Icon
|
|
97
|
+
class="mr-2 size-4 opacity-80"
|
|
98
|
+
name={menu.items[currentMenuIndex].icon}
|
|
99
|
+
/>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
<span class="font-medium">{menu.items[currentMenuIndex].label}</span>
|
|
103
|
+
<Icon class="ml-auto" name="lucide:chevrons-up-down" />
|
|
104
|
+
</button>
|
|
105
|
+
<div class="fixed inset-0 z-50" x-show="open" x-on:click="open = false">
|
|
106
|
+
</div>
|
|
107
|
+
<ul
|
|
108
|
+
class:list={[
|
|
109
|
+
"z-50 absolute bg-white dark:bg-neutral-800 border dark:border-neutral-700/40 rounded-lg inset-x-0 top-full py-[3px] shadow-xl overflow-hidden",
|
|
110
|
+
menu.label ? "mt-1.5" : "mt-1",
|
|
111
|
+
]}
|
|
112
|
+
x-init
|
|
113
|
+
role="menu"
|
|
114
|
+
x-show="open"
|
|
115
|
+
x-transition.origin.top
|
|
116
|
+
x-cloak
|
|
117
|
+
>
|
|
118
|
+
{
|
|
119
|
+
menu.items.map(({ label }, index) => {
|
|
120
|
+
return (
|
|
121
|
+
<li
|
|
122
|
+
x-data={`{
|
|
121
123
|
index: ${index}
|
|
122
124
|
}`}
|
|
123
|
-
|
|
124
|
-
>
|
|
125
|
-
<a
|
|
126
|
-
class="flex items-center px-3 py-2 cursor-pointer text-sm text-neutral-700 relative z-0 before:-z-10 before:absolute before:inset-x-1 before:inset-y-px before:rounded-md before:duration-150"
|
|
127
|
-
class:list={[
|
|
128
|
-
index === currentMenuIndex
|
|
129
|
-
? "before:bg-neutral-200/50 text-neutral-900"
|
|
130
|
-
: "hover:before:bg-neutral-100/70",
|
|
131
|
-
]}
|
|
132
|
-
href={firstHrefOfMenuItems[index] ?? "/"}
|
|
125
|
+
role="menuitem"
|
|
133
126
|
>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
127
|
+
<a
|
|
128
|
+
class="flex items-center px-3 py-2 cursor-pointer text-sm text-neutral-700 dark:text-neutral-300 relative z-0 before:-z-10 before:absolute before:inset-x-1 before:inset-y-px before:rounded-md before:duration-150"
|
|
129
|
+
class:list={[
|
|
130
|
+
index === currentMenuIndex
|
|
131
|
+
? "before:bg-neutral-200/50 dark:before:bg-neutral-700/50 text-neutral-900 dark:text-white"
|
|
132
|
+
: "hover:before:bg-neutral-100/70 dark:hover:before:bg-neutral-700/30",
|
|
133
|
+
]}
|
|
134
|
+
href={firstHrefOfMenuItems[index] ?? "/"}
|
|
135
|
+
>
|
|
136
|
+
{menu.items[index].icon && (
|
|
137
|
+
<Icon
|
|
138
|
+
class="mr-2 size-4 opacity-75"
|
|
139
|
+
name={menu.items[index].icon}
|
|
140
|
+
/>
|
|
141
|
+
)}
|
|
142
|
+
{label}
|
|
143
|
+
{index === currentMenuIndex && (
|
|
144
|
+
<Icon
|
|
145
|
+
class="ml-auto text-primary [&_path]:stroke-3"
|
|
146
|
+
name="lucide:check"
|
|
147
|
+
stroke-width={10}
|
|
148
|
+
/>
|
|
149
|
+
)}
|
|
150
|
+
</a>
|
|
151
|
+
</li>
|
|
152
|
+
);
|
|
153
|
+
})
|
|
154
|
+
}
|
|
155
|
+
</ul>
|
|
156
|
+
</div>
|
|
154
157
|
</div>
|
|
155
158
|
</div>
|
|
156
159
|
<div
|
|
@@ -65,22 +65,22 @@ const currentPrefix = parentSlug
|
|
|
65
65
|
: menuItemSlug;
|
|
66
66
|
---
|
|
67
67
|
|
|
68
|
-
<div class="mt-3 mx-2">
|
|
68
|
+
<div class="mt-3 mx-2 z-10 relative dark:bg-neutral-900 rounded-lg">
|
|
69
69
|
{
|
|
70
70
|
menu.label && (
|
|
71
71
|
<label class="font-semibold text-xs px-2 pb-1 block">{menu.label}</label>
|
|
72
72
|
)
|
|
73
73
|
}
|
|
74
|
-
<ul class="rounded-lg bg-neutral-100 p-[3px]">
|
|
74
|
+
<ul class="rounded-lg bg-neutral-100 dark:bg-neutral-800/60 p-[3px]">
|
|
75
75
|
{
|
|
76
76
|
menu.items.map((item, index) => (
|
|
77
77
|
<li>
|
|
78
78
|
<a
|
|
79
|
-
class="flex items-center px-3 py-1.5 cursor-pointer text-sm rounded-md border-x border-t"
|
|
79
|
+
class="flex items-center px-3 py-1.5 cursor-pointer text-sm rounded-md border-x border-t transition-colors duration-150"
|
|
80
80
|
class:list={[
|
|
81
81
|
index === currentMenuIndex
|
|
82
|
-
? "bg-white border-neutral-200/70 shadow-sm shadow-neutral-200 text-neutral-900"
|
|
83
|
-
: "text-neutral-600 border-transparent",
|
|
82
|
+
? "bg-white dark:bg-neutral-700/30 border-neutral-200/70 dark:border-neutral-700/40 dark:border-b shadow-sm shadow-neutral-200/80 dark:shadow-neutral-950/20 text-neutral-900 dark:text-white"
|
|
83
|
+
: "text-neutral-600 dark:text-neutral-300 border-transparent hover:text-primary dark:hover:text-primary",
|
|
84
84
|
]}
|
|
85
85
|
href={firstHrefOfMenuItems[index] ?? "/"}
|
|
86
86
|
>
|