@react-types/menu
Advanced tools
Comparing version 3.0.0-alpha.1 to 3.0.0-rc.0
{ | ||
"name": "@react-types/menu", | ||
"version": "3.0.0-alpha.1", | ||
"version": "3.0.0-rc.0", | ||
"description": "Spectrum UI components in React", | ||
@@ -12,3 +12,4 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-types/shared": "^3.0.0-rc.2" | ||
"@react-types/overlays": "3.0.0-rc.0", | ||
"@react-types/shared": "3.0.0-rc.3" | ||
}, | ||
@@ -21,3 +22,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "207e6ee9076905c96638a7f81a367758872e1410" | ||
"gitHead": "461d6321126ae9b4f1508aa912f7b36bf8a603f8" | ||
} |
@@ -13,15 +13,20 @@ /* | ||
import {Alignment, CollectionBase, DOMProps, MultipleSelection, StyleProps} from '@react-types/shared'; | ||
import {Alignment, AriaLabelingProps, CollectionBase, DOMProps, MultipleSelection, StyleProps} from '@react-types/shared'; | ||
import {Key, ReactElement} from 'react'; | ||
import {OverlayTriggerProps} from '@react-types/overlays'; | ||
export type FocusStrategy = 'first' | 'last'; | ||
export interface MenuTriggerProps { | ||
export interface MenuTriggerProps extends OverlayTriggerProps { | ||
// trigger?: 'press' | 'longPress', | ||
/** Where the Menu aligns with its trigger. */ | ||
align?: Alignment, | ||
direction?: 'bottom' | 'top', // left right? | ||
/** Where the Menu opens relative to its trigger. */ | ||
direction?: 'bottom' | 'top', | ||
/** Whether the Menu closes when a selection is made. */ | ||
closeOnSelect?: boolean, | ||
isOpen?: boolean, | ||
defaultOpen?: boolean, | ||
onOpenChange?: (isOpen: boolean) => void, | ||
/** | ||
* Whether the element should flip its orientation when there is insufficient | ||
* space for it to render within the view. | ||
*/ | ||
shouldFlip?: boolean | ||
@@ -31,2 +36,6 @@ } | ||
export interface SpectrumMenuTriggerProps extends MenuTriggerProps { | ||
/** | ||
* The contents of the MenuTrigger, a trigger and a Menu. See the MenuTrigger | ||
* [Content section](#content) for more information on what to provide as children. | ||
*/ | ||
children: ReactElement[] | ||
@@ -36,8 +45,11 @@ } | ||
export interface MenuProps<T> extends CollectionBase<T>, MultipleSelection { | ||
/** Where the focus should be set. */ | ||
autoFocus?: boolean | FocusStrategy, | ||
/** Whether keyboard navigation is circular. */ | ||
shouldFocusWrap?: boolean, | ||
/** Handler that is called when an item is selected. */ | ||
onAction?: (key: Key) => void | ||
} | ||
export interface SpectrumMenuProps<T> extends MenuProps<T>, DOMProps, StyleProps { | ||
} | ||
export interface AriaMenuProps<T> extends MenuProps<T>, DOMProps, AriaLabelingProps {} | ||
export interface SpectrumMenuProps<T> extends AriaMenuProps<T>, StyleProps {} |
14047
46
3
+ Added@react-types/overlays@3.0.0-rc.0(transitive)
+ Added@react-types/shared@3.0.0-rc.3(transitive)
- Removed@react-types/shared@3.23.1(transitive)