1
1
"use client" ;
2
2
3
3
import 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" ;
5
6
import { useRouter , usePathname } from "next/navigation" ;
6
7
import { DemoList } from "@/components/demo-list/demo-list" ;
7
8
import { ThemeToggle } from "@/components/ui/theme-toggle" ;
8
- import { Eye , Code , Book , ChevronDown } from "lucide-react" ;
9
+ import { ChevronDown } from "lucide-react" ;
9
10
import featureConfig from "@/config" ;
10
11
import {
11
12
DropdownMenu ,
@@ -98,8 +99,10 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
98
99
}
99
100
} , [ ] ) ;
100
101
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
+
101
104
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
103
106
${ isMobile ? 'w-80 shadow-xl' : 'w-74 min-w-[296px] flex-shrink-0 rounded-lg' }
104
107
` } >
105
108
{ /* Sidebar Header */ }
@@ -111,7 +114,7 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
111
114
</ h1 >
112
115
</ div >
113
116
114
- < ThemeToggle />
117
+ { /* <ThemeToggle />*/ }
115
118
</ div >
116
119
</ div >
117
120
@@ -120,21 +123,23 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
120
123
< div className = "p-4 border-b" >
121
124
{ /* Integration picker */ }
122
125
{ ! 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" / >
125
128
< DropdownMenu >
126
129
< 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 >
131
136
</ DropdownMenuTrigger >
132
- < DropdownMenuContent className = "w-56 " >
137
+ < DropdownMenuContent className = "w-64 bg-palette-surface-container border-palette-border-container shadow-elevation-md " >
133
138
{ menuIntegrations . map ( ( integration ) => (
134
139
< DropdownMenuItem
135
140
key = { integration . id }
136
141
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 "
138
143
>
139
144
< span > { integration . name } </ span >
140
145
</ DropdownMenuItem >
@@ -147,30 +152,30 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
147
152
{ /* Preview/Code Tabs */ }
148
153
{ ! viewPickerHidden &&
149
154
< div className = "mb-1" >
150
- < label className = "block text-sm font-medium text-muted-foreground mb-2" > View</ label >
155
+ < SectionTitle title = " View" / >
151
156
< Tabs
152
157
value = { view }
153
158
onValueChange = { tab => setView ( tab as View ) }
154
- className = "w-full"
159
+ className = "w-full rounded-lg bg-none border-none "
155
160
>
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 " >
157
162
< TabsTrigger
158
163
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 }
160
165
>
161
166
< Eye className = "h-3 w-3" />
162
167
< span > Preview</ span >
163
168
</ TabsTrigger >
164
169
< TabsTrigger
165
170
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 }
167
172
>
168
173
< Code className = "h-3 w-3" />
169
174
< span > Code</ span >
170
175
</ TabsTrigger >
171
176
< TabsTrigger
172
177
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 }
174
179
>
175
180
< Book className = "h-3 w-3" />
176
181
< span > Docs</ span >
@@ -199,3 +204,28 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
199
204
</ div >
200
205
) ;
201
206
}
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