@@ -413,6 +416,8 @@ const props = withDefaults(defineProps<{
isHomePage?: boolean
// Client area flag - shows cabinet tabs instead of search
isClientArea?: boolean
+ // AI chat sidebar state
+ chatOpen?: boolean
// Dynamic height for hero effect
height?: number
// Collapse progress for hero layout
@@ -423,6 +428,7 @@ const props = withDefaults(defineProps<{
})
defineEmits([
+ 'toggle-chat',
'toggle-theme',
'sign-out',
'sign-in',
@@ -445,6 +451,7 @@ const route = useRoute()
const { locale, locales } = useI18n()
const switchLocalePath = useSwitchLocalePath()
const { t } = useI18n()
+const { chatOpen } = toRefs(props)
// Check if client area tab is active
const isClientAreaTabActive = (path: string) => {
diff --git a/app/layouts/topnav.vue b/app/layouts/topnav.vue
index 2474009..435d656 100644
--- a/app/layouts/topnav.vue
+++ b/app/layouts/topnav.vue
@@ -1,7 +1,14 @@
-
-
+
+
+
+
+
@@ -34,7 +41,9 @@
:is-collapsed="isHomePage ? heroIsCollapsed : (isCatalogSection || isClientArea)"
:is-home-page="isHomePage"
:is-client-area="isClientArea"
+ :chat-open="isChatOpen"
@toggle-theme="toggleTheme"
+ @toggle-chat="isChatOpen = !isChatOpen"
@set-catalog-mode="setCatalogMode"
@sign-out="onClickSignOut"
@sign-in="signIn()"
@@ -64,12 +73,13 @@
v-if="!isHomePage && !isCatalogSection && !isClientArea"
:section="currentSection"
/>
-
+
-
-
-
-
+
+
+
+
+
@@ -83,6 +93,14 @@ const localePath = useLocalePath()
const { locale, locales } = useI18n()
const switchLocalePath = useSwitchLocalePath()
+const isChatOpen = useState('ai-chat-open', () => false)
+const chatWidth = computed(() => (isChatOpen.value ? 'clamp(240px, 15vw, 360px)' : '0px'))
+const contentStyle = computed(() => ({
+ transform: isChatOpen.value ? `translateX(${chatWidth.value})` : 'translateX(0)',
+ width: isChatOpen.value ? `calc(100% - ${chatWidth.value})` : '100%',
+ transition: 'transform 250ms ease, width 250ms ease'
+}))
+
// Catalog search state
const {
selectMode,