11import { Fragment } from 'react' ;
22import type { ReactNode } from 'react' ;
3- import { Separator } from '@base-ui/react' ;
43import { ArrowUpRight } from 'lucide-react' ;
54import type { DocBlock , SiteContent } from '../content/types' ;
65import CodeBlock from './CodeBlock' ;
76import Rich from './Rich' ;
87
98const DocSection = ( { id, title, children } : { id : string ; title : string ; children : ReactNode } ) => (
10- < section id = { id } className = "scroll-mt-6 space-y-4" >
11- < div className = "space-y-2" >
12- < h2 className = "text-xl font-semibold tracking-tight text-text" > { title } </ h2 >
13- < Separator className = "h-px w-full bg-line" />
14- </ div >
15- < div className = "space-y-4 text-sm leading-7 text-muted" > { children } </ div >
9+ < section id = { id } className = "scroll-mt-6" >
10+ < h2 className = "border-b border-line pb-3 text-lg font-medium text-text" > { title } </ h2 >
11+ < div className = "mt-5 space-y-4 text-sm leading-7 text-secondary" > { children } </ div >
1612 </ section >
1713) ;
1814
1915const DocTable = ( { head, rows } : { head : string [ ] ; rows : string [ ] [ ] } ) => (
2016 < div className = "w-full overflow-x-auto" >
21- < table className = "w-full min-w-[520px] border-collapse text-sm" >
17+ < table className = "w-full min-w-[520px] border-collapse text-sm tabular-nums " >
2218 < thead >
2319 < tr >
2420 { head . map ( ( cell ) => (
25- < th
26- key = { cell }
27- className = "border-b border-line py-2 pr-4 text-left text-xs font-medium uppercase tracking-[0.14em] text-muted"
28- >
21+ < th key = { cell } className = "border-b border-line py-2 pr-4 text-left text-xs font-normal text-muted" >
2922 < Rich text = { cell } />
3023 </ th >
3124 ) ) }
@@ -37,7 +30,7 @@ const DocTable = ({ head, rows }: { head: string[]; rows: string[][] }) => (
3730 { row . map ( ( cell , index ) => (
3831 < td
3932 key = { `${ row [ 0 ] } -${ index } ` }
40- className = "border-b border-line/60 py-2 pr-4 align-top leading-6 text-muted first:whitespace-nowrap first:text-text"
33+ className = "border-b border-line/60 py-3 pr-4 align-top leading-6 text-secondary first:whitespace-nowrap first:text-text"
4134 >
4235 < Rich text = { cell } />
4336 </ td >
@@ -75,7 +68,7 @@ const DocBlockView = ({ block }: { block: DocBlock }) => {
7568 return < CodeBlock title = { block . title } code = { block . code } hint = { block . hint } /> ;
7669 case 'note' :
7770 return (
78- < div className = "rounded-sm border border-line bg-surface px-4 py-3 text-xs leading-6 text-muted" >
71+ < div className = "rounded-lg border border-line bg-surface px-4 py-3 text-xs leading-6 text-muted" >
7972 < Rich text = { block . text } />
8073 </ div >
8174 ) ;
@@ -86,10 +79,10 @@ const DocBlockView = ({ block }: { block: DocBlock }) => {
8679 href = { block . href }
8780 target = "_blank"
8881 rel = "noreferrer"
89- className = "inline-flex items-center gap-1 underline decoration-line underline-offset-4 transition hover:text -text"
82+ className = "inline-flex items-center gap-1 text-text underline decoration-line underline-offset-4 transition-colors hover:decoration -text"
9083 >
9184 { block . label }
92- < ArrowUpRight className = "h-3.5 w-3.5 " />
85+ < ArrowUpRight aria-hidden strokeWidth = { 1.5 } className = "h-4 w-4 text-muted " />
9386 </ a >
9487 </ p >
9588 ) ;
@@ -100,23 +93,23 @@ const DocsPage = ({ content }: { content: SiteContent }) => {
10093 const { docs } = content ;
10194
10295 return (
103- < main className = "px-4 pb-12 pt-4 sm:px-6 lg :px-8" >
96+ < main className = "px-5 pb-20 sm :px-8" >
10497 < div className = "mx-auto w-full max-w-6xl" >
105- < div className = "space-y-3 border-b border-line pb-6 pt-4 " >
106- < h1 className = "text-4xl font-semibold tracking-tight text-text sm:text-5xl " > { docs . heading } </ h1 >
107- < p className = "max-w-2xl text-sm leading-7 text-muted sm:text-base " >
98+ < div className = "border-b border-line pb-8 pt-16 lg:pt-20 " >
99+ < h1 className = "text-3xl font-medium text-text sm:text-4xl " > { docs . heading } </ h1 >
100+ < p className = "mt-3 max-w-2xl text-base leading-8 text-secondary " >
108101 < Rich text = { docs . intro } />
109102 </ p >
110103 </ div >
111104
112- < div className = "grid gap-10 pt-6 lg:grid-cols-[200px_minmax(0,1fr)] lg:gap-12 " >
113- < aside className = "lg:sticky lg:top-6 lg:self-start" >
105+ < div className = "grid gap-10 pt-10 lg:grid-cols-[200px_minmax(0,1fr)] lg:gap-16 " >
106+ < aside className = "lg:sticky lg:top-8 lg:self-start" >
114107 < nav aria-label = { docs . contents } >
115- < p className = "mb-3 text-xs font-medium uppercase tracking-[0.28em] text-muted" > { docs . contents } </ p >
116- < ul className = "space-y-1.5 text-sm" >
108+ < p className = "mb-2 text-xs text-muted" > { docs . contents } </ p >
109+ < ul className = "space-y-2 border-l border-line pl-4 text-sm" >
117110 { docs . sections . map ( ( { id, title } ) => (
118111 < li key = { id } >
119- < a href = { `#${ id } ` } className = "text-muted transition hover:text-text" >
112+ < a href = { `#${ id } ` } className = "text-muted transition-colors hover:text-text" >
120113 { title }
121114 </ a >
122115 </ li >
@@ -125,7 +118,7 @@ const DocsPage = ({ content }: { content: SiteContent }) => {
125118 </ nav >
126119 </ aside >
127120
128- < article className = "min-w-0 space-y-10 " >
121+ < article className = "min-w-0 max-w-[46rem] space-y-12 " >
129122 { docs . sections . map ( ( section ) => (
130123 < Fragment key = { section . id } >
131124 < DocSection id = { section . id } title = { section . title } >
0 commit comments