@@ -9,29 +9,34 @@ import { NavItem, NavSections } from "../types"
9
9
import SubMenu from "./SubMenu"
10
10
import { useNavMenu } from "./useNavMenu"
11
11
12
- export const navMenu = tv ( {
12
+ export const navMenuVariants = tv ( {
13
13
slots : {
14
14
base : "text-body" ,
15
- item : "w-full relative -me-4 py-4 hover:text-menu-active [&:hover_p]:text-menu-active focus-visible:text-menu-active [&:focus-visible_p]:text-menu-active hover:outline-0 hover:rounded-md hover:shadow-none focus-visible:outline-0 focus-visible:rounded-md focus-visible:shadow-none" ,
15
+ item : "has-[button[data-state=open]]:rounded-s-md has-[button[data-state=open]]:rounded-e-none has-[button[data-state=open]]:-me-4 has-[button[data-state=open]]:pe-4" ,
16
+ link : "w-full relative -me-4 py-4 hover:text-menu-active [&:hover_p]:text-menu-active focus-visible:text-menu-active [&:focus-visible_p]:text-menu-active hover:outline-0 rounded-md hover:shadow-none focus-visible:outline-0 focus-visible:rounded-md focus-visible:shadow-none" ,
16
17
submenu : "grid h-full w-full grid-cols-1" ,
17
18
} ,
18
19
variants : {
19
20
level : {
20
21
1 : {
21
22
submenu : "grid-cols-3 bg-menu-1-background" ,
22
- item : "data-[active=true]:bg-menu-1-active-background hover:bg-menu-1-active-background focus-visible:bg-menu-1-active-background" ,
23
+ item : "has-[button[data-state=open]]:bg-menu-1-active-background" ,
24
+ link : "data-[active=true]:bg-menu-1-active-background hover:bg-menu-1-active-background focus-visible:bg-menu-1-active-background" ,
23
25
} ,
24
26
2 : {
25
27
submenu : "grid-cols-2 bg-menu-2-background" ,
26
- item : "hover:bg-menu-2-active-background focus-visible:bg-menu-2-active-background data-[active=true]:bg-menu-2-active-background" ,
28
+ item : "has-[button[data-state=open]]:bg-menu-2-active-background" ,
29
+ link : "hover:bg-menu-2-active-background focus-visible:bg-menu-2-active-background data-[active=true]:bg-menu-2-active-background" ,
27
30
} ,
28
31
3 : {
29
32
submenu : "grid-cols-1 bg-menu-3-background" ,
30
- item : "data-[active=true]:bg-menu-3-active-background hover:bg-menu-3-active-background" ,
33
+ item : "has-[button[data-state=open]]:bg-menu-3-active-background" ,
34
+ link : "data-[active=true]:bg-menu-3-active-background hover:bg-menu-3-active-background" ,
31
35
} ,
32
36
4 : {
33
37
submenu : "grid-cols-1 bg-menu-4-background" ,
34
- item : "data-[active=true]:bg-menu-4-active-background hover:bg-menu-4-active-background" ,
38
+ item : "has-[button[data-state=open]]:bg-menu-4-active-background" ,
39
+ link : "data-[active=true]:bg-menu-4-active-background hover:bg-menu-4-active-background" ,
35
40
} ,
36
41
} ,
37
42
} ,
@@ -46,7 +51,7 @@ type MenuContentProps = {
46
51
// Desktop Menu content
47
52
const MenuContent = ( { items, isOpen, sections } : MenuContentProps ) => {
48
53
const { activeSection, containerVariants, onClose } = useNavMenu ( sections )
49
- const { base } = navMenu ( )
54
+ const { base } = navMenuVariants ( )
50
55
51
56
return (
52
57
< Content asChild >
0 commit comments