Skip to content

Commit 977c431

Browse files
authored
v0.2.19
2 parents 63cbabf + fec80ea commit 977c431

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@channel.io/design-system",
3-
"version": "0.2.18",
3+
"version": "0.2.19",
44
"description": "Design System by Channel",
55
"repository": {
66
"type": "git",

src/components/List/ListMenuGroup/ListMenuGroup.styled.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { isNil } from 'lodash-es'
44
/* Internal dependencies */
55
import { styled } from '../../../styling/Theme'
66
import { Icon } from '../../Icon'
7-
import { StyledWrapperProps } from './ListMenuGroup.types'
7+
import { StyledWrapperProps, StyledContentWrapperProps } from './ListMenuGroup.types'
88

99
export const GroupItemWrapper = styled.div<StyledWrapperProps>`
1010
display: flex;
@@ -20,28 +20,34 @@ export const GroupItemWrapper = styled.div<StyledWrapperProps>`
2020
cursor: pointer;
2121
border-radius: 6px;
2222
23-
&:hover {
24-
background-color: ${props => (props.open ? 'initial' : props.theme?.colors?.background3)};
25-
}
26-
2723
${props => !isNil(props.currentMenuItemIndex) && `
2824
color: ${props.theme?.colors?.focus5};
2925
background-color: ${props.theme?.colors?.background2};
3026
`}
27+
28+
&:hover {
29+
background-color: ${props => (isNil(props.currentMenuItemIndex) && props.theme?.colors?.background3)};
30+
}
3131
`
3232

3333
export const StyledIcon = styled(Icon)`
3434
color: ${props => props.theme?.colors?.text5};
3535
`
3636

37-
export const GroupItemContentWrapper = styled.div`
37+
export const GroupItemContentWrapper = styled.div<StyledContentWrapperProps>`
3838
display: flex;
3939
flex: 1;
4040
align-items: center;
41+
42+
${props => !isNil(props.currentMenuItemIndex) && `
43+
svg {
44+
color: ${props.theme?.colors?.focus5};
45+
}
46+
`}
4147
`
4248

4349
export const ChildrenWrapper = styled.div`
4450
& > * {
45-
padding-left: 42px;
51+
padding-left: 38px;
4652
}
4753
`

src/components/List/ListMenuGroup/ListMenuGroup.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ forwardedRef: React.Ref<HTMLElement>,
8686

8787
const Content = useMemo(() => (
8888
<>
89-
<GroupItemContentWrapper>
89+
<GroupItemContentWrapper
90+
currentMenuItemIndex={currentMenuItemIndex}
91+
open={open}
92+
>
9093
{ !isNil(leftIcon) && (
9194
<StyledIcon
9295
name={leftIcon}
@@ -115,6 +118,7 @@ forwardedRef: React.Ref<HTMLElement>,
115118
rightContent,
116119
children,
117120
handleClickIcon,
121+
currentMenuItemIndex,
118122
])
119123

120124
const Items = useMemo(() => (

src/components/List/ListMenuGroup/ListMenuGroup.types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ export default interface ListMenuGroupProps extends ContentComponentProps {
1919

2020
export interface StyledWrapperProps extends ContentComponentProps {
2121
open?: boolean
22-
content?: React.ReactNode
2322
rightContent?: React.ReactNode
2423
currentMenuItemIndex?: number | null
2524
arrowClassName?: string
2625
selectedOptionIndex?: number
2726
onChangeOption?: (optionKey?: string, optionIndex?: number) => void
2827
}
28+
29+
export interface StyledContentWrapperProps extends ContentComponentProps {
30+
open?: boolean
31+
currentMenuItemIndex?: number | null
32+
}

0 commit comments

Comments
 (0)