feat(core): added code to handle keyboard inputs (#4006)

Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
Priyansh Gupta
2023-08-31 23:45:55 +05:30
committed by GitHub
parent 6be176b4e3
commit 18d5a99af5
4 changed files with 111 additions and 21 deletions

View File

@@ -15,6 +15,7 @@ export type IconMenuProps = PropsWithChildren<{
disabled?: boolean;
active?: boolean;
disableHover?: boolean;
userFocused?: boolean;
gap?: string;
fontSize?: string;
}> &

View File

@@ -62,11 +62,13 @@ export const StyledMenuItem = styled('button')<{
disabled?: boolean;
active?: boolean;
disableHover?: boolean;
userFocused?: boolean;
}>(({
isDir = false,
disabled = false,
active = false,
disableHover = false,
userFocused = false,
}) => {
return {
width: '100%',
@@ -99,7 +101,11 @@ export const StyledMenuItem = styled('button')<{
: {
backgroundColor: 'var(--affine-hover-color)',
},
...(userFocused && !disabled
? {
backgroundColor: 'var(--affine-hover-color)',
}
: {}),
...(active && !disabled
? {
backgroundColor: 'var(--affine-hover-color)',