@react-types/menu
Advanced tools
Comparing version 3.0.0-alpha.1 to 3.0.0-nightly-07431f4b1-241030
{ | ||
"name": "@react-types/menu", | ||
"version": "3.0.0-alpha.1", | ||
"version": "3.0.0-nightly-07431f4b1-241030", | ||
"description": "Spectrum UI components in React", | ||
@@ -9,9 +9,10 @@ "license": "Apache-2.0", | ||
"type": "git", | ||
"url": "https://github.com/adobe-private/react-spectrum-v3" | ||
"url": "https://github.com/adobe/react-spectrum" | ||
}, | ||
"dependencies": { | ||
"@react-types/shared": "^3.0.0-rc.2" | ||
"@react-types/overlays": "^3.0.0-nightly-07431f4b1-241030", | ||
"@react-types/shared": "^3.0.0-nightly-07431f4b1-241030" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.12.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
}, | ||
@@ -21,3 +22,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "207e6ee9076905c96638a7f81a367758872e1410" | ||
} | ||
"stableVersion": "3.9.12" | ||
} |
@@ -13,29 +13,66 @@ /* | ||
import {Alignment, CollectionBase, DOMProps, MultipleSelection, StyleProps} from '@react-types/shared'; | ||
import {Key, ReactElement} from 'react'; | ||
import {Alignment, AriaLabelingProps, CollectionBase, DOMProps, FocusStrategy, Key, MultipleSelection, StyleProps} from '@react-types/shared'; | ||
import {OverlayTriggerProps} from '@react-types/overlays'; | ||
import {ReactElement} from 'react'; | ||
export type FocusStrategy = 'first' | 'last'; | ||
export type MenuTriggerType = 'press' | 'longPress'; | ||
export interface MenuTriggerProps { | ||
// trigger?: 'press' | 'longPress', | ||
align?: Alignment, | ||
direction?: 'bottom' | 'top', // left right? | ||
closeOnSelect?: boolean, | ||
isOpen?: boolean, | ||
defaultOpen?: boolean, | ||
onOpenChange?: (isOpen: boolean) => void, | ||
shouldFlip?: boolean | ||
export interface MenuTriggerProps extends OverlayTriggerProps { | ||
/** | ||
* How the menu is triggered. | ||
* @default 'press' | ||
*/ | ||
trigger?: MenuTriggerType | ||
} | ||
export interface SpectrumMenuTriggerProps extends MenuTriggerProps { | ||
children: ReactElement[] | ||
/** | ||
* The contents of the MenuTrigger - a trigger and a Menu. | ||
*/ | ||
children: ReactElement[], | ||
/** | ||
* Alignment of the menu relative to the trigger. | ||
* @default 'start' | ||
*/ | ||
align?: Alignment, | ||
/** | ||
* Where the Menu opens relative to its trigger. | ||
* @default 'bottom' | ||
*/ | ||
direction?: 'bottom' | 'top' | 'left' | 'right' | 'start' | 'end', | ||
/** | ||
* Whether the menu should automatically flip direction when space is limited. | ||
* @default true | ||
*/ | ||
shouldFlip?: boolean, | ||
/** | ||
* Whether the Menu closes when a selection is made. | ||
* @default true | ||
*/ | ||
closeOnSelect?: boolean | ||
} | ||
export interface MenuProps<T> extends CollectionBase<T>, MultipleSelection { | ||
/** Where the focus should be set. */ | ||
autoFocus?: boolean | FocusStrategy, | ||
/** Whether keyboard navigation is circular. */ | ||
shouldFocusWrap?: boolean, | ||
onAction?: (key: Key) => void | ||
/** Handler that is called when an item is selected. */ | ||
onAction?: (key: Key) => void, | ||
/** Handler that is called when the menu should close after selecting an item. */ | ||
onClose?: () => 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 {} | ||
export interface SpectrumActionMenuProps<T> extends CollectionBase<T>, Omit<SpectrumMenuTriggerProps, 'children'>, StyleProps, DOMProps, AriaLabelingProps { | ||
/** Whether the button is disabled. */ | ||
isDisabled?: boolean, | ||
/** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */ | ||
isQuiet?: boolean, | ||
/** Whether the element should receive focus on render. */ | ||
autoFocus?: boolean, | ||
/** Handler that is called when an item is selected. */ | ||
onAction?: (key: Key) => void | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
70
0
3
3638
3
+ Added@react-types/overlays@^3.0.0-nightly-07431f4b1-241030
+ Added@react-types/overlays@3.8.11(transitive)
+ Addedreact@19.0.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact@16.14.0(transitive)
- Removedreact-is@16.13.1(transitive)