11import cx from 'classnames' ;
2- import PropTypes from 'prop-types' ;
32import React , { Children , HTMLProps , ReactNode , Ref } from 'react' ;
43
54import { BaseMenuItem } from '../MenuItem' ;
65
6+ import { Id } from '../../types' ;
77import { preventInputBlur } from '../../utils' ;
8- import { checkPropType , isRequiredForA11y } from '../../propTypes' ;
98
109const MenuDivider = ( ) => < div className = "dropdown-divider" role = "separator" /> ;
1110
@@ -14,28 +13,19 @@ const MenuHeader = (props: HTMLProps<HTMLDivElement>) => (
1413 < div { ...props } className = "dropdown-header" role = "heading" />
1514) ;
1615
17- const propTypes = {
18- 'aria-label' : PropTypes . string ,
16+ export interface MenuProps extends HTMLProps < HTMLDivElement > {
1917 /**
2018 * Message to display in the menu if there are no valid results.
2119 */
22- emptyLabel : PropTypes . node ,
20+ emptyLabel ?: ReactNode ;
2321 /**
2422 * Needed for accessibility.
2523 */
26- id : checkPropType (
27- PropTypes . oneOfType ( [ PropTypes . number , PropTypes . string ] ) ,
28- isRequiredForA11y
29- ) ,
24+ id ?: Id ;
25+ innerRef ?: Ref < HTMLDivElement > ;
3026 /**
3127 * Maximum height of the dropdown menu.
3228 */
33- maxHeight : PropTypes . string ,
34- } ;
35-
36- export interface MenuProps extends HTMLProps < HTMLDivElement > {
37- emptyLabel ?: ReactNode ;
38- innerRef ?: Ref < HTMLDivElement > ;
3929 maxHeight ?: string ;
4030}
4131
@@ -82,7 +72,6 @@ const Menu = ({
8272 ) ;
8373} ;
8474
85- Menu . propTypes = propTypes ;
8675Menu . Divider = MenuDivider ;
8776Menu . Header = MenuHeader ;
8877
0 commit comments