chore: consolidate super toolbar items and remove need for scroll [skip e2e]
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import {
|
||||
CSSProperties,
|
||||
ComponentPropsWithoutRef,
|
||||
forwardRef,
|
||||
KeyboardEventHandler,
|
||||
ReactNode,
|
||||
useCallback,
|
||||
useImperativeHandle,
|
||||
useRef,
|
||||
@@ -12,15 +11,11 @@ import { useListKeyboardNavigation } from '@/Hooks/useListKeyboardNavigation'
|
||||
import { mergeRefs } from '@/Hooks/mergeRefs'
|
||||
import { MutuallyExclusiveMediaQueryBreakpoints, useMediaQuery } from '@/Hooks/useMediaQuery'
|
||||
|
||||
type MenuProps = {
|
||||
className?: string
|
||||
style?: CSSProperties | undefined
|
||||
interface MenuProps extends ComponentPropsWithoutRef<'menu'> {
|
||||
a11yLabel: string
|
||||
children: ReactNode
|
||||
closeMenu?: () => void
|
||||
isOpen: boolean
|
||||
initialFocus?: number
|
||||
onKeyDown?: KeyboardEventHandler<HTMLMenuElement>
|
||||
shouldAutoFocus?: boolean
|
||||
}
|
||||
|
||||
@@ -35,6 +30,7 @@ const Menu = forwardRef(
|
||||
initialFocus,
|
||||
onKeyDown,
|
||||
shouldAutoFocus = true,
|
||||
...props
|
||||
}: MenuProps,
|
||||
forwardedRef,
|
||||
) => {
|
||||
@@ -73,6 +69,7 @@ const Menu = forwardRef(
|
||||
ref={mergeRefs([menuElementRef, forwardedRef])}
|
||||
style={style}
|
||||
aria-label={a11yLabel}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</menu>
|
||||
|
||||
@@ -7,7 +7,7 @@ import { PlatformedKeyboardShortcut } from '@standardnotes/ui-services'
|
||||
import { KeyboardShortcutIndicator } from '../KeyboardShortcutIndicator/KeyboardShortcutIndicator'
|
||||
import MenuListItem from './MenuListItem'
|
||||
|
||||
type MenuItemProps = {
|
||||
export interface MenuItemProps extends ComponentPropsWithoutRef<'button'> {
|
||||
children: ReactNode
|
||||
onClick?: MouseEventHandler<HTMLButtonElement>
|
||||
onBlur?: (event: { relatedTarget: EventTarget | null }) => void
|
||||
@@ -17,7 +17,7 @@ type MenuItemProps = {
|
||||
tabIndex?: number
|
||||
disabled?: boolean
|
||||
shortcut?: PlatformedKeyboardShortcut
|
||||
} & ComponentPropsWithoutRef<'button'>
|
||||
}
|
||||
|
||||
const MenuItem = forwardRef(
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user