@react-types/menu 3.10.6 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -5
- package/src/index.d.ts +3 -75
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/menu",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -9,14 +9,17 @@
|
|
|
9
9
|
"url": "https://github.com/adobe/react-spectrum"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@react-
|
|
13
|
-
"@react-
|
|
12
|
+
"@react-aria/menu": "^3.22.0",
|
|
13
|
+
"@react-spectrum/menu": "^3.23.0",
|
|
14
|
+
"@react-stately/menu": "^3.10.0"
|
|
14
15
|
},
|
|
15
16
|
"peerDependencies": {
|
|
16
|
-
"react": "^
|
|
17
|
+
"@react-spectrum/provider": "^3.0.0",
|
|
18
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
19
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
17
20
|
},
|
|
18
21
|
"publishConfig": {
|
|
19
22
|
"access": "public"
|
|
20
23
|
},
|
|
21
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
|
|
22
25
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -10,78 +10,6 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export type MenuTriggerType = 'press' | 'longPress';
|
|
18
|
-
|
|
19
|
-
export interface MenuTriggerProps extends OverlayTriggerProps {
|
|
20
|
-
/**
|
|
21
|
-
* How the menu is triggered.
|
|
22
|
-
* @default 'press'
|
|
23
|
-
*/
|
|
24
|
-
trigger?: MenuTriggerType
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface SpectrumMenuTriggerProps extends MenuTriggerProps {
|
|
28
|
-
/**
|
|
29
|
-
* The contents of the MenuTrigger - a trigger and a Menu.
|
|
30
|
-
*/
|
|
31
|
-
children: ReactElement[],
|
|
32
|
-
/**
|
|
33
|
-
* Alignment of the menu relative to the trigger.
|
|
34
|
-
* @default 'start'
|
|
35
|
-
*/
|
|
36
|
-
align?: Alignment,
|
|
37
|
-
/**
|
|
38
|
-
* Where the Menu opens relative to its trigger.
|
|
39
|
-
* @default 'bottom'
|
|
40
|
-
*/
|
|
41
|
-
direction?: 'bottom' | 'top' | 'left' | 'right' | 'start' | 'end',
|
|
42
|
-
/**
|
|
43
|
-
* Whether the menu should automatically flip direction when space is limited.
|
|
44
|
-
* @default true
|
|
45
|
-
*/
|
|
46
|
-
shouldFlip?: boolean,
|
|
47
|
-
/**
|
|
48
|
-
* Whether the Menu closes when a selection is made.
|
|
49
|
-
* @default true
|
|
50
|
-
*/
|
|
51
|
-
closeOnSelect?: boolean
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface MenuProps<T> extends CollectionBase<T>, MultipleSelection {
|
|
55
|
-
/** Where the focus should be set. */
|
|
56
|
-
autoFocus?: boolean | FocusStrategy,
|
|
57
|
-
/** Whether keyboard navigation is circular. */
|
|
58
|
-
shouldFocusWrap?: boolean,
|
|
59
|
-
/** Handler that is called when an item is selected. */
|
|
60
|
-
onAction?: (key: Key) => void,
|
|
61
|
-
/** Handler that is called when the menu should close after selecting an item. */
|
|
62
|
-
onClose?: () => void
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface AriaMenuProps<T> extends MenuProps<T>, DOMProps, AriaLabelingProps {
|
|
66
|
-
/**
|
|
67
|
-
* Whether pressing the escape key should clear selection in the menu or not.
|
|
68
|
-
*
|
|
69
|
-
* Most experiences should not modify this option as it eliminates a keyboard user's ability to
|
|
70
|
-
* easily clear selection. Only use if the escape key is being handled externally or should not
|
|
71
|
-
* trigger selection clearing contextually.
|
|
72
|
-
* @default 'clearSelection'
|
|
73
|
-
*/
|
|
74
|
-
escapeKeyBehavior?: 'clearSelection' | 'none'
|
|
75
|
-
}
|
|
76
|
-
export interface SpectrumMenuProps<T> extends AriaMenuProps<T>, StyleProps {}
|
|
77
|
-
|
|
78
|
-
export interface SpectrumActionMenuProps<T> extends CollectionBase<T>, Omit<SpectrumMenuTriggerProps, 'children'>, StyleProps, DOMProps, AriaLabelingProps {
|
|
79
|
-
/** Whether the button is disabled. */
|
|
80
|
-
isDisabled?: boolean,
|
|
81
|
-
/** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */
|
|
82
|
-
isQuiet?: boolean,
|
|
83
|
-
/** Whether the element should receive focus on render. */
|
|
84
|
-
autoFocus?: boolean,
|
|
85
|
-
/** Handler that is called when an item is selected. */
|
|
86
|
-
onAction?: (key: Key) => void
|
|
87
|
-
}
|
|
13
|
+
export {MenuTriggerType, MenuTriggerProps} from '@react-stately/menu';
|
|
14
|
+
export {MenuProps, AriaMenuProps} from '@react-aria/menu';
|
|
15
|
+
export {SpectrumMenuTriggerProps, SpectrumMenuProps, SpectrumActionMenuProps} from '@react-spectrum/menu';
|