11"use client" ;
22
33import React , { useState , useEffect } from "react" ;
4- import Image from "next/image" ;
4+ import { EyeIcon as Eye , CodeIcon as Code , BookOpenTextIcon as Book } from "@phosphor-icons/react" ;
5+ import { cn } from "@/lib/utils" ;
56import { useRouter , usePathname } from "next/navigation" ;
67import { DemoList } from "@/components/demo-list/demo-list" ;
78import { ThemeToggle } from "@/components/ui/theme-toggle" ;
8- import { Eye , Code , Book , ChevronDown } from "lucide-react" ;
9+ import { ChevronDown } from "lucide-react" ;
910import featureConfig from "@/config" ;
1011import {
1112 DropdownMenu ,
@@ -98,8 +99,10 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
9899 }
99100 } , [ ] ) ;
100101
102+ const tabClass = `cursor-pointer flex-1 h-8 px-2 text-sm text-primary shadow-none bg-none border-none font-medium gap-1 rounded-lg data-[state=active]:bg-white data-[state=active]:text-primary data-[state=active]:shadow-none`
103+
101104 return (
102- < div className = { `flex flex-col h-full bg-white/50 border-r
105+ < div className = { `flex flex-col h-full bg-white/50 border-2 overflow-hidden border-palette-border-default
103106 ${ isMobile ? 'w-80 shadow-xl' : 'w-74 min-w-[296px] flex-shrink-0 rounded-lg' }
104107 ` } >
105108 { /* Sidebar Header */ }
@@ -111,7 +114,7 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
111114 </ h1 >
112115 </ div >
113116
114- < ThemeToggle />
117+ { /* <ThemeToggle />*/ }
115118 </ div >
116119 </ div >
117120
@@ -120,21 +123,23 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
120123 < div className = "p-4 border-b" >
121124 { /* Integration picker */ }
122125 { ! frameworkPickerHidden && (
123- < div className = "mb-1 " >
124- < label className = "block text-sm font-medium text-muted-foreground mb-2" > Integrations</ label >
126+ < div className = "mb-spacing-4 " >
127+ < SectionTitle title = " Integrations" / >
125128 < DropdownMenu >
126129 < DropdownMenuTrigger asChild >
127- < Button variant = "outline" className = "w-full justify-between" >
128- { currentIntegration ? currentIntegration . name : "Select Integration" }
129- < ChevronDown className = "h-4 w-4 opacity-50" />
130- </ Button >
130+ < div className = "flex items-center justify-between h-spacing-8 rounded-sm gap-spacing-2 px-spacing-3 transition-colors hover:bg-palette-surface-containerHovered cursor-pointer" >
131+ < span className = "pb-[2px] text-palette-text-primary font-medium leading-[22px] inline-block truncate" >
132+ { currentIntegration ? currentIntegration . name : "Select Integration" }
133+ </ span >
134+ < ChevronDown className = "text-palette-icon-default transition-transform" size = { 16 } />
135+ </ div >
131136 </ DropdownMenuTrigger >
132- < DropdownMenuContent className = "w-56 " >
137+ < DropdownMenuContent className = "w-64 bg-palette-surface-container border-palette-border-container shadow-elevation-md " >
133138 { menuIntegrations . map ( ( integration ) => (
134139 < DropdownMenuItem
135140 key = { integration . id }
136141 onClick = { ( ) => handleIntegrationSelect ( integration . id ) }
137- className = "cursor-pointer"
142+ className = "cursor-pointer hover:bg-palette-grey-200 text-palette-text-primary text-base h-10 rounded-sm "
138143 >
139144 < span > { integration . name } </ span >
140145 </ DropdownMenuItem >
@@ -147,30 +152,30 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
147152 { /* Preview/Code Tabs */ }
148153 { ! viewPickerHidden &&
149154 < div className = "mb-1" >
150- < label className = "block text-sm font-medium text-muted-foreground mb-2" > View</ label >
155+ < SectionTitle title = " View" / >
151156 < Tabs
152157 value = { view }
153158 onValueChange = { tab => setView ( tab as View ) }
154- className = "w-full"
159+ className = "w-full rounded-lg bg-none border-none "
155160 >
156- < TabsList className = "w-full h-9 border shadow-sm rounded-lg p-1 " >
161+ < TabsList className = "w-full rounded-lg h-8 p-0 bg-transparent border-none " >
157162 < TabsTrigger
158163 value = "preview"
159- className = "flex-1 h-7 px-2 text-sm font-medium gap-1 rounded-md data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow"
164+ className = { tabClass }
160165 >
161166 < Eye className = "h-3 w-3" />
162167 < span > Preview</ span >
163168 </ TabsTrigger >
164169 < TabsTrigger
165170 value = "code"
166- className = "flex-1 h-7 px-2 text-sm font-medium gap-1 rounded-md data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow"
171+ className = { tabClass }
167172 >
168173 < Code className = "h-3 w-3" />
169174 < span > Code</ span >
170175 </ TabsTrigger >
171176 < TabsTrigger
172177 value = "readme"
173- className = "flex-1 h-7 px-2 text-sm font-medium gap-1 rounded-md data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow"
178+ className = { tabClass }
174179 >
175180 < Book className = "h-3 w-3" />
176181 < span > Docs</ span >
@@ -199,3 +204,28 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
199204 </ div >
200205 ) ;
201206}
207+
208+ function SectionTitle ( { title } : { title : string } ) {
209+ return (
210+ < div
211+ className = { cn (
212+ "items-center" ,
213+ "flex px-spacing-1 gap-spacing-2 mb-2" ,
214+ ) }
215+ >
216+ < label
217+ className = { cn (
218+ "transition-all duration-300 ease-in-out inline-block whitespace-nowrap paragraphs-Small-Regular-Uppercase text-[10px] text-palette-text-secondary opacity-100 scale-100 w-fit" ,
219+ ) }
220+ >
221+ { title }
222+ </ label >
223+ < div
224+ className = { cn (
225+ "h-[1px] bg-palette-border-container transition-all duration-300 ease-[cubic-bezier(0.36,0.01,0.22,1)]" ,
226+ "w-full" ,
227+ ) }
228+ />
229+ </ div >
230+ ) ;
231+ }
0 commit comments