Skip to content

Commit a4b3d0b

Browse files
committed
Server, Credits, and Introduction
1 parent e9eeadc commit a4b3d0b

23 files changed

+636
-23
lines changed

package-lock.json

Lines changed: 99 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"@astrojs/mdx": "^3.1.4",
1212
"@astrojs/react": "^3.6.2",
1313
"@astrojs/tailwind": "^5.1.0",
14+
"@radix-ui/react-accordion": "^1.2.0",
1415
"@radix-ui/react-dialog": "^1.1.1",
1516
"@radix-ui/react-slot": "^1.1.0",
1617
"@shadcn/ui": "^0.0.4",

src/components/FAQ.jsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import {
2+
Accordion,
3+
AccordionContent,
4+
AccordionItem,
5+
AccordionTrigger,
6+
} from "@/components/ui/accordion";
7+
8+
export function FAQ() {
9+
return (
10+
<Accordion className="not-prose" type="single" collapsible>
11+
<AccordionItem value="item-1">
12+
<AccordionTrigger>Can I use a custom UV config?</AccordionTrigger>
13+
<AccordionContent>
14+
Yes, just serve the files before calling "app.serveChemical()".
15+
</AccordionContent>
16+
</AccordionItem>
17+
<AccordionItem value="item-2">
18+
<AccordionTrigger>Do I need to set the Baremux transport?</AccordionTrigger>
19+
<AccordionContent>
20+
No, Chemical automatically sets transports for you.
21+
</AccordionContent>
22+
</AccordionItem>
23+
<AccordionItem value="item-3">
24+
<AccordionTrigger>Libcurl vs Epoxy</AccordionTrigger>
25+
<AccordionContent>
26+
Libcurl supports supports Firefox but is slower.
27+
</AccordionContent>
28+
</AccordionItem>
29+
<AccordionItem value="item-4">
30+
<AccordionTrigger>There are no bare clients.</AccordionTrigger>
31+
<AccordionContent>
32+
Shut up.
33+
</AccordionContent>
34+
</AccordionItem>
35+
</Accordion>
36+
);
37+
}

src/components/Navbar.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { MobileNav } from "./MobileNav.jsx";
1111
>
1212
<div class="flex justify-center items-center gap-2">
1313
<Text element="h3" as="h3" className="font-bold">Chemical</Text>
14-
<Badge variant="outline">v1.6.6</Badge>
14+
<Badge variant="outline">v1.7.2</Badge>
1515
</div>
1616
<div class="hidden md:flex justify-center items-center gap-8">
1717
<a href="/">Home</a>

src/components/ui/accordion.jsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import * as React from "react"
2+
import * as AccordionPrimitive from "@radix-ui/react-accordion"
3+
import { ChevronDown } from "lucide-react"
4+
5+
import { cn } from "@/lib/utils"
6+
7+
const Accordion = AccordionPrimitive.Root
8+
9+
const AccordionItem = React.forwardRef(({ className, ...props }, ref) => (
10+
<AccordionPrimitive.Item ref={ref} className={cn("border-b", className)} {...props} />
11+
))
12+
AccordionItem.displayName = "AccordionItem"
13+
14+
const AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => (
15+
<AccordionPrimitive.Header className="flex">
16+
<AccordionPrimitive.Trigger
17+
ref={ref}
18+
className={cn(
19+
"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
20+
className
21+
)}
22+
{...props}>
23+
{children}
24+
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
25+
</AccordionPrimitive.Trigger>
26+
</AccordionPrimitive.Header>
27+
))
28+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
29+
30+
const AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => (
31+
<AccordionPrimitive.Content
32+
ref={ref}
33+
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
34+
{...props}>
35+
<div className={cn("pb-4 pt-0", className)}>{children}</div>
36+
</AccordionPrimitive.Content>
37+
))
38+
39+
AccordionContent.displayName = AccordionPrimitive.Content.displayName
40+
41+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }

src/components/ui/table.jsx

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import * as React from "react"
2+
3+
import { cn } from "@/lib/utils"
4+
5+
const Table = React.forwardRef(({ className, ...props }, ref) => (
6+
<div className="relative w-full overflow-auto">
7+
<table
8+
ref={ref}
9+
className={cn("w-full caption-bottom text-sm", className)}
10+
{...props} />
11+
</div>
12+
))
13+
Table.displayName = "Table"
14+
15+
const TableHeader = React.forwardRef(({ className, ...props }, ref) => (
16+
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
17+
))
18+
TableHeader.displayName = "TableHeader"
19+
20+
const TableBody = React.forwardRef(({ className, ...props }, ref) => (
21+
<tbody
22+
ref={ref}
23+
className={cn("[&_tr:last-child]:border-0", className)}
24+
{...props} />
25+
))
26+
TableBody.displayName = "TableBody"
27+
28+
const TableFooter = React.forwardRef(({ className, ...props }, ref) => (
29+
<tfoot
30+
ref={ref}
31+
className={cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)}
32+
{...props} />
33+
))
34+
TableFooter.displayName = "TableFooter"
35+
36+
const TableRow = React.forwardRef(({ className, ...props }, ref) => (
37+
<tr
38+
ref={ref}
39+
className={cn(
40+
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
41+
className
42+
)}
43+
{...props} />
44+
))
45+
TableRow.displayName = "TableRow"
46+
47+
const TableHead = React.forwardRef(({ className, ...props }, ref) => (
48+
<th
49+
ref={ref}
50+
className={cn(
51+
"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
52+
className
53+
)}
54+
{...props} />
55+
))
56+
TableHead.displayName = "TableHead"
57+
58+
const TableCell = React.forwardRef(({ className, ...props }, ref) => (
59+
<td
60+
ref={ref}
61+
className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
62+
{...props} />
63+
))
64+
TableCell.displayName = "TableCell"
65+
66+
const TableCaption = React.forwardRef(({ className, ...props }, ref) => (
67+
<caption
68+
ref={ref}
69+
className={cn("mt-4 text-sm text-muted-foreground", className)}
70+
{...props} />
71+
))
72+
TableCaption.displayName = "TableCaption"
73+
74+
export {
75+
Table,
76+
TableHeader,
77+
TableBody,
78+
TableFooter,
79+
TableHead,
80+
TableRow,
81+
TableCell,
82+
TableCaption,
83+
}

src/layouts/Docs.astro

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@ const folders = [
2727
dir: "introduction",
2828
pages: ["get-started", "faq"],
2929
},
30-
{
31-
title: "Setup",
32-
dir: "setup",
33-
pages: ["server", "client", "vite-plugin", "building"],
30+
{
31+
title: "Server",
32+
dir: "server",
33+
pages: ["setup", "config"],
34+
},
35+
{
36+
title: "Client",
37+
dir: "client",
38+
pages: ["setup", "loaded", "encode", "decode", "transport", "wisp", "fetch", "suggestions"],
3439
},
3540
];
3641
@@ -72,7 +77,7 @@ const currentFolder = docPages.filter((folder) => {
7277
<body class="min-h-[100vh] flex flex-col px-8">
7378
<Navbar />
7479
<main class="py-8 flex gap-8 px-8">
75-
<aside class="sticky top-[89px] left-0 w-40 flex flex-col gap-2">
80+
<aside class="h-[calc(100vh_-_190px)] overflow-y-auto sticky self-start top-[105px] left-0 w-52 flex flex-col gap-2">
7681
{
7782
docPages.map((folder) => (
7883
<>
@@ -95,7 +100,7 @@ const currentFolder = docPages.filter((folder) => {
95100
))
96101
}
97102
</aside>
98-
<div>
103+
<div class="w-full">
99104
<Breadcrumb className="mb-4">
100105
<BreadcrumbList>
101106
<BreadcrumbItem>

0 commit comments

Comments
 (0)