@react-aria/menu 3.14.1-nightly.4624 → 3.14.1

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.
@@ -18,7 +18,7 @@ import {useLocale as $dXlYe$useLocale} from "@react-aria/i18n";
18
18
 
19
19
 
20
20
  function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
21
- let { parentMenuRef: parentMenuRef, submenuRef: submenuRef, type: type = "menu", isDisabled: isDisabled, node: node, delay: delay = 200 } = props;
21
+ let { parentMenuRef: parentMenuRef, submenuRef: submenuRef, type: type = 'menu', isDisabled: isDisabled, node: node, delay: delay = 200 } = props;
22
22
  let submenuTriggerId = (0, $dXlYe$useId)();
23
23
  let overlayId = (0, $dXlYe$useId)();
24
24
  let { direction: direction } = (0, $dXlYe$useLocale)();
@@ -48,21 +48,21 @@ function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
48
48
  ]);
49
49
  let submenuKeyDown = (e)=>{
50
50
  switch(e.key){
51
- case "ArrowLeft":
52
- if (direction === "ltr" && e.currentTarget.contains(e.target)) {
51
+ case 'ArrowLeft':
52
+ if (direction === 'ltr' && e.currentTarget.contains(e.target)) {
53
53
  e.stopPropagation();
54
54
  onSubmenuClose();
55
55
  ref.current.focus();
56
56
  }
57
57
  break;
58
- case "ArrowRight":
59
- if (direction === "rtl" && e.currentTarget.contains(e.target)) {
58
+ case 'ArrowRight':
59
+ if (direction === 'rtl' && e.currentTarget.contains(e.target)) {
60
60
  e.stopPropagation();
61
61
  onSubmenuClose();
62
62
  ref.current.focus();
63
63
  }
64
64
  break;
65
- case "Escape":
65
+ case 'Escape':
66
66
  e.stopPropagation();
67
67
  state.closeAll();
68
68
  break;
@@ -70,9 +70,9 @@ function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
70
70
  };
71
71
  let submenuProps = {
72
72
  id: overlayId,
73
- "aria-label": node.textValue,
73
+ 'aria-label': node.textValue,
74
74
  submenuLevel: state.submenuLevel,
75
- ...type === "menu" && {
75
+ ...type === 'menu' && {
76
76
  onClose: state.closeAll,
77
77
  autoFocus: state.focusStrategy,
78
78
  onKeyDown: submenuKeyDown
@@ -80,25 +80,25 @@ function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
80
80
  };
81
81
  let submenuTriggerKeyDown = (e)=>{
82
82
  switch(e.key){
83
- case "ArrowRight":
83
+ case 'ArrowRight':
84
84
  if (!isDisabled) {
85
- if (direction === "ltr") {
86
- if (!state.isOpen) onSubmenuOpen("first");
87
- if (type === "menu" && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) submenuRef.current.focus();
85
+ if (direction === 'ltr') {
86
+ if (!state.isOpen) onSubmenuOpen('first');
87
+ if (type === 'menu' && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) submenuRef.current.focus();
88
88
  } else if (state.isOpen) onSubmenuClose();
89
89
  else e.continuePropagation();
90
90
  }
91
91
  break;
92
- case "ArrowLeft":
92
+ case 'ArrowLeft':
93
93
  if (!isDisabled) {
94
- if (direction === "rtl") {
95
- if (!state.isOpen) onSubmenuOpen("first");
96
- if (type === "menu" && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) submenuRef.current.focus();
94
+ if (direction === 'rtl') {
95
+ if (!state.isOpen) onSubmenuOpen('first');
96
+ if (type === 'menu' && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) submenuRef.current.focus();
97
97
  } else if (state.isOpen) onSubmenuClose();
98
98
  else e.continuePropagation();
99
99
  }
100
100
  break;
101
- case "Escape":
101
+ case 'Escape':
102
102
  state.closeAll();
103
103
  break;
104
104
  default:
@@ -107,11 +107,11 @@ function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
107
107
  }
108
108
  };
109
109
  let onPressStart = (e)=>{
110
- if (!isDisabled && (e.pointerType === "virtual" || e.pointerType === "keyboard")) // If opened with a screen reader or keyboard, auto focus the first submenu item.
111
- onSubmenuOpen("first");
110
+ if (!isDisabled && (e.pointerType === 'virtual' || e.pointerType === 'keyboard')) // If opened with a screen reader or keyboard, auto focus the first submenu item.
111
+ onSubmenuOpen('first');
112
112
  };
113
113
  let onPress = (e)=>{
114
- if (!isDisabled && (e.pointerType === "touch" || e.pointerType === "mouse")) // For touch or on a desktop device with a small screen open on press up to possible problems with
114
+ if (!isDisabled && (e.pointerType === 'touch' || e.pointerType === 'mouse')) // For touch or on a desktop device with a small screen open on press up to possible problems with
115
115
  // press up happening on the newly opened tray items
116
116
  onSubmenuOpen();
117
117
  };
@@ -140,9 +140,9 @@ function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
140
140
  return {
141
141
  submenuTriggerProps: {
142
142
  id: submenuTriggerId,
143
- "aria-controls": state.isOpen ? overlayId : undefined,
144
- "aria-haspopup": !isDisabled ? type : undefined,
145
- "aria-expanded": state.isOpen ? "true" : "false",
143
+ 'aria-controls': state.isOpen ? overlayId : undefined,
144
+ 'aria-haspopup': !isDisabled ? type : undefined,
145
+ 'aria-expanded': state.isOpen ? 'true' : 'false',
146
146
  onPressStart: onPressStart,
147
147
  onPress: onPress,
148
148
  onHoverChange: onHoverChange,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/menu",
3
- "version": "3.14.1-nightly.4624+d80999e89",
3
+ "version": "3.14.1",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,18 +22,18 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@react-aria/focus": "3.0.0-nightly.2912+d80999e89",
26
- "@react-aria/i18n": "3.0.0-nightly.2912+d80999e89",
27
- "@react-aria/interactions": "3.0.0-nightly.2912+d80999e89",
28
- "@react-aria/overlays": "3.0.0-nightly.2912+d80999e89",
29
- "@react-aria/selection": "3.0.0-nightly.2912+d80999e89",
30
- "@react-aria/utils": "3.0.0-nightly.2912+d80999e89",
31
- "@react-stately/collections": "3.0.0-nightly.2912+d80999e89",
32
- "@react-stately/menu": "3.7.1-nightly.4624+d80999e89",
33
- "@react-stately/tree": "3.0.0-nightly.2912+d80999e89",
34
- "@react-types/button": "3.9.4-nightly.4624+d80999e89",
35
- "@react-types/menu": "3.9.9-nightly.4624+d80999e89",
36
- "@react-types/shared": "3.0.0-nightly.2912+d80999e89",
25
+ "@react-aria/focus": "^3.17.1",
26
+ "@react-aria/i18n": "^3.11.1",
27
+ "@react-aria/interactions": "^3.21.3",
28
+ "@react-aria/overlays": "^3.22.1",
29
+ "@react-aria/selection": "^3.18.1",
30
+ "@react-aria/utils": "^3.24.1",
31
+ "@react-stately/collections": "^3.10.7",
32
+ "@react-stately/menu": "^3.7.1",
33
+ "@react-stately/tree": "^3.8.1",
34
+ "@react-types/button": "^3.9.4",
35
+ "@react-types/menu": "^3.9.9",
36
+ "@react-types/shared": "^3.23.1",
37
37
  "@swc/helpers": "^0.5.0"
38
38
  },
39
39
  "peerDependencies": {
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "d80999e897b4d4db9fcfb4e9b8fcdc9fdd700882"
46
+ "gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
47
47
  }