@@ -51,7 +51,7 @@ const accordionTriggerClassName = cn(
5151 '[&[data-state=open]>svg]:rotate-90' ,
5252) ;
5353
54- const accordionLinkClassName = 'pl-3 py-[6px] ' ;
54+ const accordionLinkClassName = 'pl-3 py-1 ' ;
5555
5656const iconClassName = 'text-neutral-1300 dark:text-neutral-000 transition-transform' ;
5757
@@ -66,10 +66,7 @@ const ChildAccordion = ({ content, tree }: { content: (NavProductPage | NavProdu
6666 . map ( ( page , index ) => 'expand' in page && page . expand && `item-${ tree . join ( '-' ) } -${ index } ` )
6767 . filter ( ( item ) => typeof item === 'string' ) ;
6868
69- const [ openSections , setOpenSections ] = useState < string [ ] > ( [
70- `item-${ previousTree . join ( '-' ) } ` ,
71- ...preExpandedItems ,
72- ] ) ;
69+ const [ openSections , setOpenSections ] = useState < string [ ] > ( [ `item-${ previousTree . join ( '-' ) } ` , ...preExpandedItems ] ) ;
7370
7471 useEffect ( ( ) => {
7572 if ( activeTriggerRef . current ) {
@@ -131,19 +128,20 @@ const ChildAccordion = ({ content, tree }: { content: (NavProductPage | NavProdu
131128 className = { cn ( accordionTriggerClassName , 'font-medium rounded-lg' , {
132129 'border-l border-neutral-300 dark:border-neutral-1000 hover:border-neutral-500 dark:hover:border-neutral-800 rounded-l-none' :
133130 layer > 1 ,
131+ '-ml-2 pl-2' : layer <= 1 ,
134132 'text-neutral-1300 dark:text-neutral-000 font-bold' : isActive ,
135133 'border-orange-600 bg-orange-100 hover:bg-orange-100' : isSelected ,
136134 } ) }
137135 >
138136 { hasDeeperLayer ? (
139- < div className = { cn ( accordionLinkClassName , 'flex-1' ) } >
137+ < div className = { cn ( layer > 1 ? accordionLinkClassName : 'py-1' , 'flex-1' ) } >
140138 < span > { page . name } </ span >
141139 </ div >
142140 ) : (
143141 'link' in page && (
144142 < Link
145143 className = { cn (
146- accordionLinkClassName ,
144+ layer > 1 ? accordionLinkClassName : 'py-1' ,
147145 'ui-text-label3 font-medium w-full h-full pr-5 flex justify-between items-center gap-2' ,
148146 isActive && 'text-neutral-1300 dark:text-neutral-000 font-bold' ,
149147 ) }
@@ -184,13 +182,18 @@ const ChildAccordion = ({ content, tree }: { content: (NavProductPage | NavProdu
184182/** Render top-level nav sections as static headings with their content always expanded. */
185183const SectionNav = ( { content, tree } : { content : ( NavProductPage | NavProductContent ) [ ] ; tree : number [ ] } ) => {
186184 return (
187- < div className = "px-3 pt-8 pb-3" >
185+ < div className = "px-3 pt-9 pb-3" >
188186 { content . map ( ( page , index ) => {
189187 const hasDeeperLayer = 'pages' in page && page . pages ;
190188
191189 return (
192- < div key = { page . name } className = { cn ( index > 0 && 'mt-2 pt-2' ) } >
193- < div className = "ui-text-label2 font-bold text-neutral-1300 dark:text-neutral-000 py-[6px]" >
190+ < div key = { page . name } >
191+ < div
192+ className = { cn (
193+ 'ui-text-label2 font-bold text-neutral-1300 dark:text-neutral-000 pb-1.5' ,
194+ index > 0 ? 'pt-5' : 'pt-0' ,
195+ ) }
196+ >
194197 { page . name }
195198 </ div >
196199 { hasDeeperLayer && < ChildAccordion content = { page . pages } tree = { [ ...tree , index ] } /> }
@@ -236,12 +239,12 @@ const LeftSidebar = ({ className, inHeader = false }: LeftSidebarProps) => {
236239 // When the product bar is visible (non-platform products), add its height to the sticky offset
237240 const hasProductBar = activeProductKey !== null && activeProductKey !== 'platform' ;
238241 const stickyTopPx = HEADER_HEIGHT + ( hasProductBar ? PRODUCT_BAR_HEIGHT : 0 ) ;
239- const stickyTopStyle = inHeader ? undefined : { top : `${ stickyTopPx } px` } ;
242+ const stickyTopStyle = inHeader ? undefined : { top : `${ stickyTopPx } px` , height : `calc(100dvh - ${ stickyTopPx } px)` } ;
240243 const stickyTopClass = inHeader ? 'top-16' : '' ;
241244
242245 return (
243246 < div
244- className = { cn ( 'sticky h-full ' , stickyTopClass , inHeader ? 'w-full' : 'w-[312px] hidden md:block' , className ) }
247+ className = { cn ( 'sticky' , stickyTopClass , inHeader ? 'w-full' : 'w-[312px] hidden md:block' , className ) }
245248 style = { stickyTopStyle }
246249 >
247250 { inHeader && (
@@ -258,10 +261,7 @@ const LeftSidebar = ({ className, inHeader = false }: LeftSidebarProps) => {
258261 'bg-neutral-000 dark:bg-neutral-1300 overflow-x-hidden overflow-y-auto' ,
259262 inHeader
260263 ? 'w-full h-[calc(100dvh-64px-128px)]'
261- : [
262- 'w-[312px] border-r border-neutral-300 dark:border-neutral-1000' ,
263- `h-[calc(100dvh-${ stickyTopPx } px)]` ,
264- ] ,
264+ : 'w-[312px] h-full border-r border-neutral-300 dark:border-neutral-1000' ,
265265 ) }
266266 >
267267 { content . length > 0 ? (
0 commit comments