This repository was archived by the owner on Feb 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +55
-2
lines changed Expand file tree Collapse file tree 3 files changed +55
-2
lines changed Original file line number Diff line number Diff line change 12
12
13
13
.sbui-menu__item--active {
14
14
@apply bg-gray-100;
15
- @apply dark:bg-dark-800;
15
+ @apply dark:bg-dark-900;
16
+
17
+ @apply text-gray-900;
18
+ @apply dark:text-white;
19
+ }
20
+
21
+ .sbui-menu__item--active .sbui-menu__content {
22
+ @apply text-gray-900;
23
+ @apply dark:text-white;
24
+ }
25
+
26
+ .sbui-menu__item--active--bar {
27
+ @apply border-l-4 border-brand-500;
28
+ border-left-style : solid;
16
29
}
17
30
18
31
.sbui-menu__item--rounded {
Original file line number Diff line number Diff line change @@ -46,6 +46,42 @@ export const withRounded = (args: any) => (
46
46
</ Menu >
47
47
)
48
48
49
+ export const withGroupTitles = ( ) => (
50
+ < Menu >
51
+ < Menu . Group title = "First group" />
52
+ < Menu . Item rounded icon = { < IconMail /> } >
53
+ Account settings
54
+ </ Menu . Item >
55
+ < Menu . Item rounded icon = { < IconMail /> } >
56
+ Account settings
57
+ </ Menu . Item >
58
+ < Menu . Item rounded icon = { < IconMail /> } >
59
+ Account settings
60
+ </ Menu . Item >
61
+ < Menu . Group title = "Second group" />
62
+ < Menu . Item rounded icon = { < IconMail /> } >
63
+ Account settings
64
+ </ Menu . Item >
65
+ < Menu . Item rounded icon = { < IconMail /> } >
66
+ Account settings
67
+ </ Menu . Item >
68
+ </ Menu >
69
+ )
70
+
71
+ export const withActiveBar = ( ) => (
72
+ < Menu >
73
+ < Menu . Group title = "First group" />
74
+ < Menu . Item icon = { < IconMail /> } > Account settings</ Menu . Item >
75
+ < Menu . Item active showActiveBar icon = { < IconMail /> } >
76
+ Account settings
77
+ </ Menu . Item >
78
+ < Menu . Item icon = { < IconMail /> } > Account settings</ Menu . Item >
79
+ < Menu . Group title = "Second group" />
80
+ < Menu . Item icon = { < IconMail /> } > Account settings</ Menu . Item >
81
+ < Menu . Item icon = { < IconMail /> } > Account settings</ Menu . Item >
82
+ </ Menu >
83
+ )
84
+
49
85
Default . args = {
50
86
title : 'I am a title' ,
51
87
titleExtra : < Typography . Link > Learn more</ Typography . Link > ,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ interface ItemProps {
21
21
rounded ?: boolean
22
22
onClick ?: any
23
23
doNotCloseOverlay ?: boolean
24
+ showActiveBar ?: boolean
24
25
}
25
26
26
27
export function Item ( {
@@ -30,9 +31,12 @@ export function Item({
30
31
rounded,
31
32
onClick,
32
33
doNotCloseOverlay = false ,
34
+ showActiveBar = false ,
33
35
} : ItemProps ) {
34
36
let classes = [ MenuStyles [ 'sbui-menu__item' ] ]
35
37
if ( active ) classes . push ( MenuStyles [ 'sbui-menu__item--active' ] )
38
+ if ( active && showActiveBar )
39
+ classes . push ( MenuStyles [ 'sbui-menu__item--active--bar' ] )
36
40
if ( rounded ) classes . push ( MenuStyles [ 'sbui-menu__item--rounded' ] )
37
41
38
42
const itemOnClick = onClick
@@ -69,7 +73,7 @@ export function Item({
69
73
}
70
74
71
75
interface GroupProps {
72
- children : React . ReactNode
76
+ children ? : React . ReactNode
73
77
icon ?: React . ReactNode
74
78
title : string
75
79
}
You can’t perform that action at this time.
0 commit comments