Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-types/menu

Package Overview
Dependencies
Maintainers
2
Versions
839
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-types/menu - npm Package Compare versions

Comparing version 3.0.0-alpha.1 to 3.0.0-nightly-07431f4b1-241030

README.md

13

package.json
{
"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
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc