@@ -21,7 +21,7 @@ import InfoOutline from '@spectrum-icons/workflow/InfoOutline';
21
21
// @ts -ignore
22
22
import intlMessages from '../intl/*.json' ;
23
23
import { mergeRefs , useObjectRef , useSlotId } from '@react-aria/utils' ;
24
- import React , { useMemo , useRef } from 'react' ;
24
+ import React , { cloneElement , useMemo , useRef } from 'react' ;
25
25
import styles from '@adobe/spectrum-css-temp/components/menu/vars.css' ;
26
26
import { Text } from '@react-spectrum/text' ;
27
27
import { TreeState } from '@react-stately/tree' ;
@@ -96,6 +96,16 @@ export function MenuItem<T>(props: MenuItemProps<T>) {
96
96
let contents = typeof rendered === 'string'
97
97
? < Text > { rendered } </ Text >
98
98
: rendered ;
99
+
100
+ let unavailableIcon = cloneElement ( < InfoOutline /> , {
101
+ UNSAFE_className : classNames (
102
+ styles ,
103
+ 'spectrum-Menu-unavailableIcon'
104
+ ) ,
105
+ slot : 'end' ,
106
+ size : 'XS' ,
107
+ 'aria-label' : stringFormatter . format ( 'unavailable' )
108
+ } ) ;
99
109
100
110
return (
101
111
< FocusRing focusRingClass = { classNames ( styles , 'focus-ring' ) } >
@@ -141,7 +151,7 @@ export function MenuItem<T>(props: MenuItemProps<T>) {
141
151
} />
142
152
}
143
153
{
144
- isUnavailable && < InfoOutline slot = "end" size = "XS" alignSelf = "center" aria-label = { stringFormatter . format ( 'unavailable' ) } />
154
+ isUnavailable && unavailableIcon
145
155
}
146
156
{
147
157
isUnavailable == null && isSubmenuTrigger && ( direction === 'rtl' ? < ChevronLeft slot = "chevron" /> : < ChevronRight slot = "chevron" /> )
0 commit comments