@react-aria/menu 3.9.2-nightly.3964 → 3.9.2-nightly.3971

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/dist/import.mjs CHANGED
@@ -30,7 +30,7 @@ function $parcel$interopDefault(a) {
30
30
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
31
31
  * OF ANY KIND, either express or implied. See the License for the specific language
32
32
  * governing permissions and limitations under the License.
33
- */ var $9bdd31893c9700c3$exports = {};
33
+ */ var $2cbb7ca666678a14$exports = {};
34
34
  var $c0398ad35c3639b7$exports = {};
35
35
  $c0398ad35c3639b7$exports = {
36
36
  "longPressMessage": `اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة`
@@ -235,7 +235,7 @@ $f1b682a4c8c5631c$exports = {
235
235
  };
236
236
 
237
237
 
238
- $9bdd31893c9700c3$exports = {
238
+ $2cbb7ca666678a14$exports = {
239
239
  "ar-AE": $c0398ad35c3639b7$exports,
240
240
  "bg-BG": $7af657c4165927c3$exports,
241
241
  "cs-CZ": $d95d4da6d531ab81$exports,
@@ -304,7 +304,7 @@ function $168583247155ddda$export$dc9c12ed27dd1b49(props, state, ref) {
304
304
  break;
305
305
  }
306
306
  };
307
- let stringFormatter = (0, $1Hnir$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($9bdd31893c9700c3$exports))));
307
+ let stringFormatter = (0, $1Hnir$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($2cbb7ca666678a14$exports))));
308
308
  let { longPressProps: longPressProps } = (0, $1Hnir$useLongPress)({
309
309
  isDisabled: isDisabled || trigger !== "longPress",
310
310
  accessibilityDescription: stringFormatter.format("longPressMessage"),
package/dist/main.js CHANGED
@@ -38,7 +38,7 @@ $parcel$export(module.exports, "useMenuSection", () => $63008655e23408c5$export$
38
38
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
39
39
  * OF ANY KIND, either express or implied. See the License for the specific language
40
40
  * governing permissions and limitations under the License.
41
- */ var $5128c2fd7e261f09$exports = {};
41
+ */ var $d1742ec2644a0949$exports = {};
42
42
  var $429891642bf97c51$exports = {};
43
43
  $429891642bf97c51$exports = {
44
44
  "longPressMessage": `اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة`
@@ -243,7 +243,7 @@ $bd9ff3a1da9d944a$exports = {
243
243
  };
244
244
 
245
245
 
246
- $5128c2fd7e261f09$exports = {
246
+ $d1742ec2644a0949$exports = {
247
247
  "ar-AE": $429891642bf97c51$exports,
248
248
  "bg-BG": $40d90b799072e111$exports,
249
249
  "cs-CZ": $587b89d60e4f3e24$exports,
@@ -312,7 +312,7 @@ function $7211ab9328763fb9$export$dc9c12ed27dd1b49(props, state, ref) {
312
312
  break;
313
313
  }
314
314
  };
315
- let stringFormatter = (0, $fHYTQ$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($5128c2fd7e261f09$exports))));
315
+ let stringFormatter = (0, $fHYTQ$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($d1742ec2644a0949$exports))));
316
316
  let { longPressProps: longPressProps } = (0, $fHYTQ$reactariainteractions.useLongPress)({
317
317
  isDisabled: isDisabled || trigger !== "longPress",
318
318
  accessibilityDescription: stringFormatter.format("longPressMessage"),
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;;;AEAA,4BAAiB;IAAG,oBAAoB,CAAC,sDAAsD,CAAC;AAChG;;ADDA;;AEAA,4BAAiB;IAAG,oBAAoB,CAAC,gFAAgF,CAAC;AAC1H;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,wEAAwE,CAAC;AAClH;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,yDAAyD,CAAC;AACnG;;;;ACDA,4B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AAM;gBACR,KAAK;oBACH,IAAI,uBAAuB,cAAc,OACvC;yBAEA,EAAE,mBAAmB;oBAEvB,KAAM;gBACR,KAAK;oBACH,IAAI,uBAAuB,cAAc,OACvC;yBAEA,EAAE,mBAAmB;oBAEvB,KAAM;gBACR;oBACE,EAAE,mBAAmB;oBACrB,KAAM;YACV;QACF;IACF;IAEA,OAAO;QACL,eAAe;YACb,GAAG,SAAS;YACZ,GAAG,CAAA,GAAA,gCAAS,EAAE,WAAW,YAAY,YAAY,cAAc;QACjE;QACA,YAAY;YACV,IAAI;QACN;QACA,kBAAkB;YAChB,IAAI;QACN;QACA,uBAAuB;YACrB,IAAI;QACN;mBACA;oBACA;mBACA;oBACA;IACF;AACF;;;AC9RA;;;;;;;;;;CAUC,GAED;AA2BO,SAAS,0CAAe,KAA2B,EAAmB;IAC3E,IAAI,WAAC,QAAO,EAAE,cAAc,UAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,2BAAK,AAAD;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UAAU;YACtB,gEAAgE;YAChE,4EAA4E;YAC5E,mDAAmD;YACnD,IAAI;YACJ,MAAM;QACR,IAAI,CAAC,CAAC;QACN,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY,SAAS;QACpD;IACF;AACF;","sources":["packages/@react-aria/menu/src/index.ts","packages/@react-aria/menu/src/useMenuTrigger.ts","packages/@react-aria/menu/intl/*.js","packages/@react-aria/menu/intl/ar-AE.json","packages/@react-aria/menu/intl/bg-BG.json","packages/@react-aria/menu/intl/cs-CZ.json","packages/@react-aria/menu/intl/da-DK.json","packages/@react-aria/menu/intl/de-DE.json","packages/@react-aria/menu/intl/el-GR.json","packages/@react-aria/menu/intl/en-US.json","packages/@react-aria/menu/intl/es-ES.json","packages/@react-aria/menu/intl/et-EE.json","packages/@react-aria/menu/intl/fi-FI.json","packages/@react-aria/menu/intl/fr-FR.json","packages/@react-aria/menu/intl/he-IL.json","packages/@react-aria/menu/intl/hr-HR.json","packages/@react-aria/menu/intl/hu-HU.json","packages/@react-aria/menu/intl/it-IT.json","packages/@react-aria/menu/intl/ja-JP.json","packages/@react-aria/menu/intl/ko-KR.json","packages/@react-aria/menu/intl/lt-LT.json","packages/@react-aria/menu/intl/lv-LV.json","packages/@react-aria/menu/intl/nb-NO.json","packages/@react-aria/menu/intl/nl-NL.json","packages/@react-aria/menu/intl/pl-PL.json","packages/@react-aria/menu/intl/pt-BR.json","packages/@react-aria/menu/intl/pt-PT.json","packages/@react-aria/menu/intl/ro-RO.json","packages/@react-aria/menu/intl/ru-RU.json","packages/@react-aria/menu/intl/sk-SK.json","packages/@react-aria/menu/intl/sl-SI.json","packages/@react-aria/menu/intl/sr-SP.json","packages/@react-aria/menu/intl/sv-SE.json","packages/@react-aria/menu/intl/tr-TR.json","packages/@react-aria/menu/intl/uk-UA.json","packages/@react-aria/menu/intl/zh-CN.json","packages/@react-aria/menu/intl/zh-TW.json","packages/@react-aria/menu/src/useMenu.ts","packages/@react-aria/menu/src/useMenuItem.ts","packages/@react-aria/menu/src/useMenuSection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useMenuTrigger} from './useMenuTrigger';\nexport {useMenu} from './useMenu';\nexport {useMenuItem} from './useMenuItem';\nexport {useMenuSection} from './useMenuSection';\n\nexport type {AriaMenuProps} from '@react-types/menu';\nexport type {AriaMenuTriggerProps, MenuTriggerAria} from './useMenuTrigger';\nexport type {AriaMenuOptions, MenuAria} from './useMenu';\nexport type {AriaMenuItemProps, MenuItemAria} from './useMenuItem';\nexport type {AriaMenuSectionProps, MenuSectionAria} from './useMenuSection';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaMenuOptions} from './useMenu';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {MenuTriggerState} from '@react-stately/menu';\nimport {MenuTriggerType} from '@react-types/menu';\nimport {RefObject} from 'react';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useLongPress} from '@react-aria/interactions';\nimport {useOverlayTrigger} from '@react-aria/overlays';\n\nexport interface AriaMenuTriggerProps {\n /** The type of menu that the menu trigger opens. */\n type?: 'menu' | 'listbox',\n /** Whether menu trigger is disabled. */\n isDisabled?: boolean,\n /** How menu is triggered. */\n trigger?: MenuTriggerType\n}\n\nexport interface MenuTriggerAria<T> {\n /** Props for the menu trigger element. */\n menuTriggerProps: AriaButtonProps,\n\n /** Props for the menu. */\n menuProps: AriaMenuOptions<T>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n * @param props - Props for the menu trigger.\n * @param state - State for the menu trigger.\n */\nexport function useMenuTrigger<T>(props: AriaMenuTriggerProps, state: MenuTriggerState, ref: RefObject<Element>): MenuTriggerAria<T> {\n let {\n type = 'menu' as AriaMenuTriggerProps['type'],\n isDisabled,\n trigger = 'press'\n } = props;\n\n let menuTriggerId = useId();\n let {triggerProps, overlayProps} = useOverlayTrigger({type}, state, ref);\n\n let onKeyDown = (e) => {\n if (isDisabled) {\n return;\n }\n\n if (trigger === 'longPress' && !e.altKey) {\n return;\n }\n\n if (ref && ref.current) {\n switch (e.key) {\n case 'Enter':\n case ' ':\n if (trigger === 'longPress') {\n return;\n }\n // fallthrough\n case 'ArrowDown':\n // Stop propagation, unless it would already be handled by useKeyboard.\n if (!('continuePropagation' in e)) {\n e.stopPropagation();\n }\n e.preventDefault();\n state.toggle('first');\n break;\n case 'ArrowUp':\n if (!('continuePropagation' in e)) {\n e.stopPropagation();\n }\n e.preventDefault();\n state.toggle('last');\n break;\n }\n }\n };\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n let {longPressProps} = useLongPress({\n isDisabled: isDisabled || trigger !== 'longPress',\n accessibilityDescription: stringFormatter.format('longPressMessage'),\n onLongPressStart() {\n state.close();\n },\n onLongPress() {\n state.open('first');\n }\n });\n\n let pressProps = {\n onPressStart(e) {\n // For consistency with native, open the menu on mouse/key down, but touch up.\n if (e.pointerType !== 'touch' && e.pointerType !== 'keyboard' && !isDisabled) {\n // If opened with a screen reader, auto focus the first item.\n // Otherwise, the menu itself will be focused.\n state.toggle(e.pointerType === 'virtual' ? 'first' : null);\n }\n },\n onPress(e) {\n if (e.pointerType === 'touch' && !isDisabled) {\n state.toggle();\n }\n }\n };\n\n // omit onPress from triggerProps since we override it above.\n delete triggerProps.onPress;\n\n return {\n menuTriggerProps: {\n ...triggerProps,\n ...(trigger === 'press' ? pressProps : longPressProps),\n id: menuTriggerId,\n onKeyDown\n },\n menuProps: {\n ...overlayProps,\n 'aria-labelledby': menuTriggerId,\n autoFocus: state.focusStrategy || true,\n onClose: state.close\n }\n };\n}\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"longPressMessage\": \"اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة\"\n}\n","{\n \"longPressMessage\": \"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто\"\n}\n","{\n \"longPressMessage\": \"Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku\"\n}\n","{\n \"longPressMessage\": \"Langt tryk eller tryk på Alt + pil ned for at åbne menuen\"\n}\n","{\n \"longPressMessage\": \"Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen\"\n}\n","{\n \"longPressMessage\": \"Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού\"\n}\n","{\n \"longPressMessage\": \"Long press or press Alt + ArrowDown to open menu\"\n}\n","{\n \"longPressMessage\": \"Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú\"\n}\n","{\n \"longPressMessage\": \"Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool\"\n}\n","{\n \"longPressMessage\": \"Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli\"\n}\n","{\n \"longPressMessage\": \"Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu.\"\n}\n","{\n \"longPressMessage\": \"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט\"\n}\n","{\n \"longPressMessage\": \"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika\"\n}\n","{\n \"longPressMessage\": \"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához\"\n}\n","{\n \"longPressMessage\": \"Premere a lungo o premere Alt + Freccia giù per aprire il menu\"\n}\n","{\n \"longPressMessage\": \"長押しまたは Alt+下矢印キーでメニューを開く\"\n}\n","{\n \"longPressMessage\": \"길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기\"\n}\n","{\n \"longPressMessage\": \"Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“.\"\n}\n","{\n \"longPressMessage\": \"Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa\"\n}\n","{\n \"longPressMessage\": \"Langt trykk eller trykk Alt + PilNed for å åpne menyen\"\n}\n","{\n \"longPressMessage\": \"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen\"\n}\n","{\n \"longPressMessage\": \"Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu\"\n}\n","{\n \"longPressMessage\": \"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu\"\n}\n","{\n \"longPressMessage\": \"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu\"\n}\n","{\n \"longPressMessage\": \"Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul\"\n}\n","{\n \"longPressMessage\": \"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню\"\n}\n","{\n \"longPressMessage\": \"Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol\"\n}\n","{\n \"longPressMessage\": \"Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol\"\n}\n","{\n \"longPressMessage\": \"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni\"\n}\n","{\n \"longPressMessage\": \"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn\"\n}\n","{\n \"longPressMessage\": \"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın\"\n}\n","{\n \"longPressMessage\": \"Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню\"\n}\n","{\n \"longPressMessage\": \"长按或按 Alt + 向下方向键以打开菜单\"\n}\n","{\n \"longPressMessage\": \"長按或按 Alt+向下鍵以開啟功能表\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaMenuProps} from '@react-types/menu';\nimport {DOMAttributes, KeyboardDelegate} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {Key, RefObject} from 'react';\nimport {TreeState} from '@react-stately/tree';\nimport {useSelectableList} from '@react-aria/selection';\n\nexport interface MenuAria {\n /** Props for the menu element. */\n menuProps: DOMAttributes\n}\n\nexport interface AriaMenuOptions<T> extends Omit<AriaMenuProps<T>, 'children'> {\n /** Whether the menu uses virtual scrolling. */\n isVirtualized?: boolean,\n\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate\n}\n\ninterface MenuData {\n onClose?: () => void,\n onAction?: (key: Key) => void\n}\n\nexport const menuData = new WeakMap<TreeState<unknown>, MenuData>();\n\n/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n * @param props - Props for the menu.\n * @param state - State for the menu, as returned by `useListState`.\n */\nexport function useMenu<T>(props: AriaMenuOptions<T>, state: TreeState<T>, ref: RefObject<HTMLElement>): MenuAria {\n let {\n shouldFocusWrap = true,\n ...otherProps\n } = props;\n\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn('An aria-label or aria-labelledby prop is required for accessibility.');\n }\n\n let domProps = filterDOMProps(props, {labelable: true});\n let {listProps} = useSelectableList({\n ...otherProps,\n ref,\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n shouldFocusWrap\n });\n\n menuData.set(state, {\n onClose: props.onClose,\n onAction: props.onAction\n });\n\n return {\n menuProps: mergeProps(domProps, {\n role: 'menu',\n // this forces AT to move their cursors into any open sub dialogs, the sub dialogs contain hidden close buttons in order to come back to this level of the menu\n 'aria-hidden': state.expandedKeys.size > 0 ? true : undefined,\n ...listProps,\n onKeyDown: (e) => {\n // don't clear the menu selected keys if the user is presses escape since escape closes the menu\n if (e.key !== 'Escape') {\n listProps.onKeyDown(e);\n }\n }\n })\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableElement, PressEvent} from '@react-types/shared';\nimport {focusSafely} from '@react-aria/focus';\nimport {getItemCount} from '@react-stately/collections';\nimport {isFocusVisible, useHover, useKeyboard, usePress} from '@react-aria/interactions';\nimport {Key, RefObject, useCallback, useRef} from 'react';\nimport {menuData} from './useMenu';\nimport {mergeProps, useEffectEvent, useLayoutEffect, useSlotId} from '@react-aria/utils';\nimport {TreeState} from '@react-stately/tree';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSelectableItem} from '@react-aria/selection';\n\nexport interface MenuItemAria {\n /** Props for the menu item element. */\n menuItemProps: DOMAttributes,\n\n /** Props for the main text element inside the menu item. */\n labelProps: DOMAttributes,\n\n /** Props for the description text element inside the menu item, if any. */\n descriptionProps: DOMAttributes,\n\n /** Props for the keyboard shortcut text element inside the item, if any. */\n keyboardShortcutProps: DOMAttributes,\n\n /** Whether the item is currently focused. */\n isFocused: boolean,\n /** Whether the item is currently selected. */\n isSelected: boolean,\n /** Whether the item is currently in a pressed state. */\n isPressed: boolean,\n /** Whether the item is disabled. */\n isDisabled: boolean\n}\n\nexport interface AriaMenuItemProps {\n /**\n * Whether the menu item is disabled.\n * @deprecated - pass disabledKeys to useTreeState instead.\n */\n isDisabled?: boolean,\n\n /**\n * Whether the menu item is selected.\n * @deprecated - pass selectedKeys to useTreeState instead.\n */\n isSelected?: boolean,\n\n /** A screen reader only label for the menu item. */\n 'aria-label'?: string,\n\n /** The unique key for the menu item. */\n key?: Key,\n\n /**\n * Handler that is called when the menu should close after selecting an item.\n * @deprecated - pass to the menu instead.\n */\n onClose?: () => void,\n\n /**\n * Whether the menu should close when the menu item is selected.\n * @default true\n */\n closeOnSelect?: boolean,\n\n /** Whether the menu item is contained in a virtual scrolling menu. */\n isVirtualized?: boolean,\n\n /**\n * Handler that is called when the user activates the item.\n * @deprecated - pass to the menu instead.\n */\n onAction?: (key: Key) => void,\n\n /** What kind of popup the item opens. */\n 'aria-haspopup'?: 'menu' | 'dialog'\n}\n\n/**\n * Provides the behavior and accessibility implementation for an item in a menu.\n * See `useMenu` for more details about menus.\n * @param props - Props for the item.\n * @param state - State for the menu, as returned by `useTreeState`.\n */\nexport function useMenuItem<T>(props: AriaMenuItemProps, state: TreeState<T>, ref: RefObject<FocusableElement>): MenuItemAria {\n let {\n key,\n closeOnSelect,\n isVirtualized,\n 'aria-haspopup': hasPopup\n } = props;\n let {direction} = useLocale();\n\n let isMenuDialogTrigger = state.collection.getItem(key).hasChildNodes;\n let isOpen = state.expandedKeys.has(key);\n\n let isDisabled = props.isDisabled ?? state.disabledKeys.has(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n\n let openTimeout = useRef<ReturnType<typeof setTimeout> | undefined>();\n let cancelOpenTimeout = useCallback(() => {\n if (openTimeout.current) {\n clearTimeout(openTimeout.current);\n openTimeout.current = undefined;\n }\n }, [openTimeout]);\n\n let onSubmenuOpen = useEffectEvent(() => {\n cancelOpenTimeout();\n state.setExpandedKeys(new Set([key]));\n });\n\n useLayoutEffect(() => {\n return () => cancelOpenTimeout();\n }, [cancelOpenTimeout]);\n\n let data = menuData.get(state);\n let onClose = props.onClose || data.onClose;\n let onActionMenuDialogTrigger = useCallback(() => {\n onSubmenuOpen();\n // will need to disable this lint rule when using useEffectEvent https://react.dev/learn/separating-events-from-effects#logic-inside-effects-is-reactive\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n let onAction = isMenuDialogTrigger ? onActionMenuDialogTrigger : props.onAction || data.onAction;\n\n let role = 'menuitem';\n if (state.selectionManager.selectionMode === 'single') {\n role = 'menuitemradio';\n } else if (state.selectionManager.selectionMode === 'multiple') {\n role = 'menuitemcheckbox';\n }\n\n let labelId = useSlotId();\n let descriptionId = useSlotId();\n let keyboardId = useSlotId();\n\n let ariaProps = {\n 'aria-disabled': isDisabled || undefined,\n role,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': labelId,\n 'aria-describedby': [descriptionId, keyboardId].filter(Boolean).join(' ') || undefined\n };\n\n if (state.selectionManager.selectionMode !== 'none') {\n ariaProps['aria-checked'] = isSelected;\n }\n\n if (isVirtualized) {\n ariaProps['aria-posinset'] = state.collection.getItem(key).index;\n ariaProps['aria-setsize'] = getItemCount(state.collection);\n }\n\n if (hasPopup != null) {\n ariaProps['aria-haspopup'] = hasPopup;\n ariaProps['aria-expanded'] = isOpen ? 'true' : 'false';\n }\n\n let onPressStart = (e: PressEvent) => {\n if (e.pointerType === 'keyboard' && onAction) {\n onAction(key);\n }\n };\n\n let onPressUp = (e: PressEvent) => {\n if (e.pointerType !== 'keyboard') {\n if (onAction) {\n onAction(key);\n }\n\n // Pressing a menu item should close by default in single selection mode but not multiple\n // selection mode, except if overridden by the closeOnSelect prop.\n if (!isMenuDialogTrigger && onClose && (closeOnSelect ?? state.selectionManager.selectionMode !== 'multiple')) {\n onClose();\n }\n }\n };\n\n let {itemProps, isFocused} = useSelectableItem({\n selectionManager: state.selectionManager,\n key,\n ref,\n shouldSelectOnPressUp: true,\n allowsDifferentPressOrigin: true\n });\n\n let {pressProps, isPressed} = usePress({onPressStart, onPressUp, isDisabled: isDisabled || (isMenuDialogTrigger && state.expandedKeys.has(key))});\n let {hoverProps} = useHover({\n isDisabled,\n onHoverStart() {\n if (!isFocusVisible() && !(isMenuDialogTrigger && state.expandedKeys.has(key))) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n // focus immediately so that a focus scope opened on hover has the correct restore node\n let isFocused = key === state.selectionManager.focusedKey;\n if (isFocused && state.selectionManager.isFocused && document.activeElement !== ref.current) {\n focusSafely(ref.current);\n }\n }\n },\n onHoverChange: isHovered => {\n if (isHovered && isMenuDialogTrigger && !state.expandedKeys.has(key)) {\n if (!openTimeout.current) {\n openTimeout.current = setTimeout(() => {\n onSubmenuOpen();\n }, 200);\n }\n } else if (!isHovered) {\n cancelOpenTimeout();\n }\n }\n });\n\n let {keyboardProps} = useKeyboard({\n onKeyDown: (e) => {\n // Ignore repeating events, which may have started on the menu trigger before moving\n // focus to the menu item. We want to wait for a second complete key press sequence.\n if (e.repeat) {\n e.continuePropagation();\n return;\n }\n\n switch (e.key) {\n case ' ':\n if (!isDisabled && state.selectionManager.selectionMode === 'none' && !isMenuDialogTrigger && closeOnSelect !== false && onClose) {\n onClose();\n }\n break;\n case 'Enter':\n // The Enter key should always close on select, except if overridden.\n if (!isDisabled && closeOnSelect !== false && !isMenuDialogTrigger && onClose) {\n onClose();\n }\n break;\n case 'ArrowRight':\n if (isMenuDialogTrigger && direction === 'ltr') {\n onSubmenuOpen();\n } else {\n e.continuePropagation();\n }\n break;\n case 'ArrowLeft':\n if (isMenuDialogTrigger && direction === 'rtl') {\n onSubmenuOpen();\n } else {\n e.continuePropagation();\n }\n break;\n default:\n e.continuePropagation();\n break;\n }\n }\n });\n\n return {\n menuItemProps: {\n ...ariaProps,\n ...mergeProps(itemProps, pressProps, hoverProps, keyboardProps)\n },\n labelProps: {\n id: labelId\n },\n descriptionProps: {\n id: descriptionId\n },\n keyboardShortcutProps: {\n id: keyboardId\n },\n isFocused,\n isSelected,\n isPressed,\n isDisabled\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '@react-aria/utils';\n\nexport interface AriaMenuSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface MenuSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a menu.\n * See `useMenu` for more details about menus.\n * @param props - Props for the section.\n */\nexport function useMenuSection(props: AriaMenuSectionProps): MenuSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Techincally, menus cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a label for the nested group.\n id: headingId,\n role: 'presentation'\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;;;AEAA,4BAAiB;I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c;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF;","sources":["packages/@react-aria/menu/src/index.ts","packages/@react-aria/menu/src/useMenuTrigger.ts","packages/@react-aria/menu/src/*.js","packages/@react-aria/menu/intl/ar-AE.json","packages/@react-aria/menu/intl/bg-BG.json","packages/@react-aria/menu/intl/cs-CZ.json","packages/@react-aria/menu/intl/da-DK.json","packages/@react-aria/menu/intl/de-DE.json","packages/@react-aria/menu/intl/el-GR.json","packages/@react-aria/menu/intl/en-US.json","packages/@react-aria/menu/intl/es-ES.json","packages/@react-aria/menu/intl/et-EE.json","packages/@react-aria/menu/intl/fi-FI.json","packages/@react-aria/menu/intl/fr-FR.json","packages/@react-aria/menu/intl/he-IL.json","packages/@react-aria/menu/intl/hr-HR.json","packages/@react-aria/menu/intl/hu-HU.json","packages/@react-aria/menu/intl/it-IT.json","packages/@react-aria/menu/intl/ja-JP.json","packages/@react-aria/menu/intl/ko-KR.json","packages/@react-aria/menu/intl/lt-LT.json","packages/@react-aria/menu/intl/lv-LV.json","packages/@react-aria/menu/intl/nb-NO.json","packages/@react-aria/menu/intl/nl-NL.json","packages/@react-aria/menu/intl/pl-PL.json","packages/@react-aria/menu/intl/pt-BR.json","packages/@react-aria/menu/intl/pt-PT.json","packages/@react-aria/menu/intl/ro-RO.json","packages/@react-aria/menu/intl/ru-RU.json","packages/@react-aria/menu/intl/sk-SK.json","packages/@react-aria/menu/intl/sl-SI.json","packages/@react-aria/menu/intl/sr-SP.json","packages/@react-aria/menu/intl/sv-SE.json","packages/@react-aria/menu/intl/tr-TR.json","packages/@react-aria/menu/intl/uk-UA.json","packages/@react-aria/menu/intl/zh-CN.json","packages/@react-aria/menu/intl/zh-TW.json","packages/@react-aria/menu/src/useMenu.ts","packages/@react-aria/menu/src/useMenuItem.ts","packages/@react-aria/menu/src/useMenuSection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useMenuTrigger} from './useMenuTrigger';\nexport {useMenu} from './useMenu';\nexport {useMenuItem} from './useMenuItem';\nexport {useMenuSection} from './useMenuSection';\n\nexport type {AriaMenuProps} from '@react-types/menu';\nexport type {AriaMenuTriggerProps, MenuTriggerAria} from './useMenuTrigger';\nexport type {AriaMenuOptions, MenuAria} from './useMenu';\nexport type {AriaMenuItemProps, MenuItemAria} from './useMenuItem';\nexport type {AriaMenuSectionProps, MenuSectionAria} from './useMenuSection';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaMenuOptions} from './useMenu';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {MenuTriggerState} from '@react-stately/menu';\nimport {MenuTriggerType} from '@react-types/menu';\nimport {RefObject} from 'react';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useLongPress} from '@react-aria/interactions';\nimport {useOverlayTrigger} from '@react-aria/overlays';\n\nexport interface AriaMenuTriggerProps {\n /** The type of menu that the menu trigger opens. */\n type?: 'menu' | 'listbox',\n /** Whether menu trigger is disabled. */\n isDisabled?: boolean,\n /** How menu is triggered. */\n trigger?: MenuTriggerType\n}\n\nexport interface MenuTriggerAria<T> {\n /** Props for the menu trigger element. */\n menuTriggerProps: AriaButtonProps,\n\n /** Props for the menu. */\n menuProps: AriaMenuOptions<T>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n * @param props - Props for the menu trigger.\n * @param state - State for the menu trigger.\n */\nexport function useMenuTrigger<T>(props: AriaMenuTriggerProps, state: MenuTriggerState, ref: RefObject<Element>): MenuTriggerAria<T> {\n let {\n type = 'menu' as AriaMenuTriggerProps['type'],\n isDisabled,\n trigger = 'press'\n } = props;\n\n let menuTriggerId = useId();\n let {triggerProps, overlayProps} = useOverlayTrigger({type}, state, ref);\n\n let onKeyDown = (e) => {\n if (isDisabled) {\n return;\n }\n\n if (trigger === 'longPress' && !e.altKey) {\n return;\n }\n\n if (ref && ref.current) {\n switch (e.key) {\n case 'Enter':\n case ' ':\n if (trigger === 'longPress') {\n return;\n }\n // fallthrough\n case 'ArrowDown':\n // Stop propagation, unless it would already be handled by useKeyboard.\n if (!('continuePropagation' in e)) {\n e.stopPropagation();\n }\n e.preventDefault();\n state.toggle('first');\n break;\n case 'ArrowUp':\n if (!('continuePropagation' in e)) {\n e.stopPropagation();\n }\n e.preventDefault();\n state.toggle('last');\n break;\n }\n }\n };\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n let {longPressProps} = useLongPress({\n isDisabled: isDisabled || trigger !== 'longPress',\n accessibilityDescription: stringFormatter.format('longPressMessage'),\n onLongPressStart() {\n state.close();\n },\n onLongPress() {\n state.open('first');\n }\n });\n\n let pressProps = {\n onPressStart(e) {\n // For consistency with native, open the menu on mouse/key down, but touch up.\n if (e.pointerType !== 'touch' && e.pointerType !== 'keyboard' && !isDisabled) {\n // If opened with a screen reader, auto focus the first item.\n // Otherwise, the menu itself will be focused.\n state.toggle(e.pointerType === 'virtual' ? 'first' : null);\n }\n },\n onPress(e) {\n if (e.pointerType === 'touch' && !isDisabled) {\n state.toggle();\n }\n }\n };\n\n // omit onPress from triggerProps since we override it above.\n delete triggerProps.onPress;\n\n return {\n menuTriggerProps: {\n ...triggerProps,\n ...(trigger === 'press' ? pressProps : longPressProps),\n id: menuTriggerId,\n onKeyDown\n },\n menuProps: {\n ...overlayProps,\n 'aria-labelledby': menuTriggerId,\n autoFocus: state.focusStrategy || true,\n onClose: state.close\n }\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"longPressMessage\": \"اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة\"\n}\n","{\n \"longPressMessage\": \"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто\"\n}\n","{\n \"longPressMessage\": \"Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku\"\n}\n","{\n \"longPressMessage\": \"Langt tryk eller tryk på Alt + pil ned for at åbne menuen\"\n}\n","{\n \"longPressMessage\": \"Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen\"\n}\n","{\n \"longPressMessage\": \"Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού\"\n}\n","{\n \"longPressMessage\": \"Long press or press Alt + ArrowDown to open menu\"\n}\n","{\n \"longPressMessage\": \"Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú\"\n}\n","{\n \"longPressMessage\": \"Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool\"\n}\n","{\n \"longPressMessage\": \"Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli\"\n}\n","{\n \"longPressMessage\": \"Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu.\"\n}\n","{\n \"longPressMessage\": \"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט\"\n}\n","{\n \"longPressMessage\": \"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika\"\n}\n","{\n \"longPressMessage\": \"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához\"\n}\n","{\n \"longPressMessage\": \"Premere a lungo o premere Alt + Freccia giù per aprire il menu\"\n}\n","{\n \"longPressMessage\": \"長押しまたは Alt+下矢印キーでメニューを開く\"\n}\n","{\n \"longPressMessage\": \"길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기\"\n}\n","{\n \"longPressMessage\": \"Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“.\"\n}\n","{\n \"longPressMessage\": \"Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa\"\n}\n","{\n \"longPressMessage\": \"Langt trykk eller trykk Alt + PilNed for å åpne menyen\"\n}\n","{\n \"longPressMessage\": \"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen\"\n}\n","{\n \"longPressMessage\": \"Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu\"\n}\n","{\n \"longPressMessage\": \"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu\"\n}\n","{\n \"longPressMessage\": \"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu\"\n}\n","{\n \"longPressMessage\": \"Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul\"\n}\n","{\n \"longPressMessage\": \"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню\"\n}\n","{\n \"longPressMessage\": \"Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol\"\n}\n","{\n \"longPressMessage\": \"Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol\"\n}\n","{\n \"longPressMessage\": \"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni\"\n}\n","{\n \"longPressMessage\": \"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn\"\n}\n","{\n \"longPressMessage\": \"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın\"\n}\n","{\n \"longPressMessage\": \"Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню\"\n}\n","{\n \"longPressMessage\": \"长按或按 Alt + 向下方向键以打开菜单\"\n}\n","{\n \"longPressMessage\": \"長按或按 Alt+向下鍵以開啟功能表\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaMenuProps} from '@react-types/menu';\nimport {DOMAttributes, KeyboardDelegate} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {Key, RefObject} from 'react';\nimport {TreeState} from '@react-stately/tree';\nimport {useSelectableList} from '@react-aria/selection';\n\nexport interface MenuAria {\n /** Props for the menu element. */\n menuProps: DOMAttributes\n}\n\nexport interface AriaMenuOptions<T> extends Omit<AriaMenuProps<T>, 'children'> {\n /** Whether the menu uses virtual scrolling. */\n isVirtualized?: boolean,\n\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate\n}\n\ninterface MenuData {\n onClose?: () => void,\n onAction?: (key: Key) => void\n}\n\nexport const menuData = new WeakMap<TreeState<unknown>, MenuData>();\n\n/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n * @param props - Props for the menu.\n * @param state - State for the menu, as returned by `useListState`.\n */\nexport function useMenu<T>(props: AriaMenuOptions<T>, state: TreeState<T>, ref: RefObject<HTMLElement>): MenuAria {\n let {\n shouldFocusWrap = true,\n ...otherProps\n } = props;\n\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn('An aria-label or aria-labelledby prop is required for accessibility.');\n }\n\n let domProps = filterDOMProps(props, {labelable: true});\n let {listProps} = useSelectableList({\n ...otherProps,\n ref,\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n shouldFocusWrap\n });\n\n menuData.set(state, {\n onClose: props.onClose,\n onAction: props.onAction\n });\n\n return {\n menuProps: mergeProps(domProps, {\n role: 'menu',\n // this forces AT to move their cursors into any open sub dialogs, the sub dialogs contain hidden close buttons in order to come back to this level of the menu\n 'aria-hidden': state.expandedKeys.size > 0 ? true : undefined,\n ...listProps,\n onKeyDown: (e) => {\n // don't clear the menu selected keys if the user is presses escape since escape closes the menu\n if (e.key !== 'Escape') {\n listProps.onKeyDown(e);\n }\n }\n })\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableElement, PressEvent} from '@react-types/shared';\nimport {focusSafely} from '@react-aria/focus';\nimport {getItemCount} from '@react-stately/collections';\nimport {isFocusVisible, useHover, useKeyboard, usePress} from '@react-aria/interactions';\nimport {Key, RefObject, useCallback, useRef} from 'react';\nimport {menuData} from './useMenu';\nimport {mergeProps, useEffectEvent, useLayoutEffect, useSlotId} from '@react-aria/utils';\nimport {TreeState} from '@react-stately/tree';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSelectableItem} from '@react-aria/selection';\n\nexport interface MenuItemAria {\n /** Props for the menu item element. */\n menuItemProps: DOMAttributes,\n\n /** Props for the main text element inside the menu item. */\n labelProps: DOMAttributes,\n\n /** Props for the description text element inside the menu item, if any. */\n descriptionProps: DOMAttributes,\n\n /** Props for the keyboard shortcut text element inside the item, if any. */\n keyboardShortcutProps: DOMAttributes,\n\n /** Whether the item is currently focused. */\n isFocused: boolean,\n /** Whether the item is currently selected. */\n isSelected: boolean,\n /** Whether the item is currently in a pressed state. */\n isPressed: boolean,\n /** Whether the item is disabled. */\n isDisabled: boolean\n}\n\nexport interface AriaMenuItemProps {\n /**\n * Whether the menu item is disabled.\n * @deprecated - pass disabledKeys to useTreeState instead.\n */\n isDisabled?: boolean,\n\n /**\n * Whether the menu item is selected.\n * @deprecated - pass selectedKeys to useTreeState instead.\n */\n isSelected?: boolean,\n\n /** A screen reader only label for the menu item. */\n 'aria-label'?: string,\n\n /** The unique key for the menu item. */\n key?: Key,\n\n /**\n * Handler that is called when the menu should close after selecting an item.\n * @deprecated - pass to the menu instead.\n */\n onClose?: () => void,\n\n /**\n * Whether the menu should close when the menu item is selected.\n * @default true\n */\n closeOnSelect?: boolean,\n\n /** Whether the menu item is contained in a virtual scrolling menu. */\n isVirtualized?: boolean,\n\n /**\n * Handler that is called when the user activates the item.\n * @deprecated - pass to the menu instead.\n */\n onAction?: (key: Key) => void,\n\n /** What kind of popup the item opens. */\n 'aria-haspopup'?: 'menu' | 'dialog'\n}\n\n/**\n * Provides the behavior and accessibility implementation for an item in a menu.\n * See `useMenu` for more details about menus.\n * @param props - Props for the item.\n * @param state - State for the menu, as returned by `useTreeState`.\n */\nexport function useMenuItem<T>(props: AriaMenuItemProps, state: TreeState<T>, ref: RefObject<FocusableElement>): MenuItemAria {\n let {\n key,\n closeOnSelect,\n isVirtualized,\n 'aria-haspopup': hasPopup\n } = props;\n let {direction} = useLocale();\n\n let isMenuDialogTrigger = state.collection.getItem(key).hasChildNodes;\n let isOpen = state.expandedKeys.has(key);\n\n let isDisabled = props.isDisabled ?? state.disabledKeys.has(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n\n let openTimeout = useRef<ReturnType<typeof setTimeout> | undefined>();\n let cancelOpenTimeout = useCallback(() => {\n if (openTimeout.current) {\n clearTimeout(openTimeout.current);\n openTimeout.current = undefined;\n }\n }, [openTimeout]);\n\n let onSubmenuOpen = useEffectEvent(() => {\n cancelOpenTimeout();\n state.setExpandedKeys(new Set([key]));\n });\n\n useLayoutEffect(() => {\n return () => cancelOpenTimeout();\n }, [cancelOpenTimeout]);\n\n let data = menuData.get(state);\n let onClose = props.onClose || data.onClose;\n let onActionMenuDialogTrigger = useCallback(() => {\n onSubmenuOpen();\n // will need to disable this lint rule when using useEffectEvent https://react.dev/learn/separating-events-from-effects#logic-inside-effects-is-reactive\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n let onAction = isMenuDialogTrigger ? onActionMenuDialogTrigger : props.onAction || data.onAction;\n\n let role = 'menuitem';\n if (state.selectionManager.selectionMode === 'single') {\n role = 'menuitemradio';\n } else if (state.selectionManager.selectionMode === 'multiple') {\n role = 'menuitemcheckbox';\n }\n\n let labelId = useSlotId();\n let descriptionId = useSlotId();\n let keyboardId = useSlotId();\n\n let ariaProps = {\n 'aria-disabled': isDisabled || undefined,\n role,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': labelId,\n 'aria-describedby': [descriptionId, keyboardId].filter(Boolean).join(' ') || undefined\n };\n\n if (state.selectionManager.selectionMode !== 'none') {\n ariaProps['aria-checked'] = isSelected;\n }\n\n if (isVirtualized) {\n ariaProps['aria-posinset'] = state.collection.getItem(key).index;\n ariaProps['aria-setsize'] = getItemCount(state.collection);\n }\n\n if (hasPopup != null) {\n ariaProps['aria-haspopup'] = hasPopup;\n ariaProps['aria-expanded'] = isOpen ? 'true' : 'false';\n }\n\n let onPressStart = (e: PressEvent) => {\n if (e.pointerType === 'keyboard' && onAction) {\n onAction(key);\n }\n };\n\n let onPressUp = (e: PressEvent) => {\n if (e.pointerType !== 'keyboard') {\n if (onAction) {\n onAction(key);\n }\n\n // Pressing a menu item should close by default in single selection mode but not multiple\n // selection mode, except if overridden by the closeOnSelect prop.\n if (!isMenuDialogTrigger && onClose && (closeOnSelect ?? state.selectionManager.selectionMode !== 'multiple')) {\n onClose();\n }\n }\n };\n\n let {itemProps, isFocused} = useSelectableItem({\n selectionManager: state.selectionManager,\n key,\n ref,\n shouldSelectOnPressUp: true,\n allowsDifferentPressOrigin: true\n });\n\n let {pressProps, isPressed} = usePress({onPressStart, onPressUp, isDisabled: isDisabled || (isMenuDialogTrigger && state.expandedKeys.has(key))});\n let {hoverProps} = useHover({\n isDisabled,\n onHoverStart() {\n if (!isFocusVisible() && !(isMenuDialogTrigger && state.expandedKeys.has(key))) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n // focus immediately so that a focus scope opened on hover has the correct restore node\n let isFocused = key === state.selectionManager.focusedKey;\n if (isFocused && state.selectionManager.isFocused && document.activeElement !== ref.current) {\n focusSafely(ref.current);\n }\n }\n },\n onHoverChange: isHovered => {\n if (isHovered && isMenuDialogTrigger && !state.expandedKeys.has(key)) {\n if (!openTimeout.current) {\n openTimeout.current = setTimeout(() => {\n onSubmenuOpen();\n }, 200);\n }\n } else if (!isHovered) {\n cancelOpenTimeout();\n }\n }\n });\n\n let {keyboardProps} = useKeyboard({\n onKeyDown: (e) => {\n // Ignore repeating events, which may have started on the menu trigger before moving\n // focus to the menu item. We want to wait for a second complete key press sequence.\n if (e.repeat) {\n e.continuePropagation();\n return;\n }\n\n switch (e.key) {\n case ' ':\n if (!isDisabled && state.selectionManager.selectionMode === 'none' && !isMenuDialogTrigger && closeOnSelect !== false && onClose) {\n onClose();\n }\n break;\n case 'Enter':\n // The Enter key should always close on select, except if overridden.\n if (!isDisabled && closeOnSelect !== false && !isMenuDialogTrigger && onClose) {\n onClose();\n }\n break;\n case 'ArrowRight':\n if (isMenuDialogTrigger && direction === 'ltr') {\n onSubmenuOpen();\n } else {\n e.continuePropagation();\n }\n break;\n case 'ArrowLeft':\n if (isMenuDialogTrigger && direction === 'rtl') {\n onSubmenuOpen();\n } else {\n e.continuePropagation();\n }\n break;\n default:\n e.continuePropagation();\n break;\n }\n }\n });\n\n return {\n menuItemProps: {\n ...ariaProps,\n ...mergeProps(itemProps, pressProps, hoverProps, keyboardProps)\n },\n labelProps: {\n id: labelId\n },\n descriptionProps: {\n id: descriptionId\n },\n keyboardShortcutProps: {\n id: keyboardId\n },\n isFocused,\n isSelected,\n isPressed,\n isDisabled\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '@react-aria/utils';\n\nexport interface AriaMenuSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface MenuSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a menu.\n * See `useMenu` for more details about menus.\n * @param props - Props for the section.\n */\nexport function useMenuSection(props: AriaMenuSectionProps): MenuSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Techincally, menus cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a label for the nested group.\n id: headingId,\n role: 'presentation'\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -30,7 +30,7 @@ function $parcel$interopDefault(a) {
30
30
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
31
31
  * OF ANY KIND, either express or implied. See the License for the specific language
32
32
  * governing permissions and limitations under the License.
33
- */ var $9bdd31893c9700c3$exports = {};
33
+ */ var $2cbb7ca666678a14$exports = {};
34
34
  var $c0398ad35c3639b7$exports = {};
35
35
  $c0398ad35c3639b7$exports = {
36
36
  "longPressMessage": `اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة`
@@ -235,7 +235,7 @@ $f1b682a4c8c5631c$exports = {
235
235
  };
236
236
 
237
237
 
238
- $9bdd31893c9700c3$exports = {
238
+ $2cbb7ca666678a14$exports = {
239
239
  "ar-AE": $c0398ad35c3639b7$exports,
240
240
  "bg-BG": $7af657c4165927c3$exports,
241
241
  "cs-CZ": $d95d4da6d531ab81$exports,
@@ -304,7 +304,7 @@ function $168583247155ddda$export$dc9c12ed27dd1b49(props, state, ref) {
304
304
  break;
305
305
  }
306
306
  };
307
- let stringFormatter = (0, $1Hnir$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($9bdd31893c9700c3$exports))));
307
+ let stringFormatter = (0, $1Hnir$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($2cbb7ca666678a14$exports))));
308
308
  let { longPressProps: longPressProps } = (0, $1Hnir$useLongPress)({
309
309
  isDisabled: isDisabled || trigger !== "longPress",
310
310
  accessibilityDescription: stringFormatter.format("longPressMessage"),
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;;;AEAA,4BAAiB;IAAG,oBAAoB,CAAC,sDAAsD,CAAC;AAChG;;ADDA;;AEAA,4BAAiB;IAAG,oBAAoB,CAAC,gFAAgF,CAAC;AAC1H;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,wEAAwE,CAAC;AAClH;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,yDAAyD,CAAC;AACnG;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,0EAA0E,CAAC;AACpH;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,uEAAuE,CAAC;AACjH;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,gDAAgD,CAAC;AAC1F;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,8DAA8D,CAAC;AACxG;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,kEAAkE,CAAC;AAC5G;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,wEAAwE,CAAC;AAClH;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,yFAAyF,CAAC;AACnI;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,0DAA0D,CAAC;AACpG;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,gFAAgF,CAAC;AAC1H;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,oFAAoF,CAAC;AAC9H;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,8DAA8D,CAAC;AACxG;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,wBAAwB,CAAC;AAClE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mDAAmD;YACnD,IAAI;YACJ,MAAM;QACR,IAAI,CAAC,CAAC;QACN,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY,SAAS;QACpD;IACF;AACF;","sources":["packages/@react-aria/menu/src/index.ts","packages/@react-aria/menu/src/useMenuTrigger.ts","packages/@react-aria/menu/intl/*.js","packages/@react-aria/menu/intl/ar-AE.json","packages/@react-aria/menu/intl/bg-BG.json","packages/@react-aria/menu/intl/cs-CZ.json","packages/@react-aria/menu/intl/da-DK.json","packages/@react-aria/menu/intl/de-DE.json","packages/@react-aria/menu/intl/el-GR.json","packages/@react-aria/menu/intl/en-US.json","packages/@react-aria/menu/intl/es-ES.json","packages/@react-aria/menu/intl/et-EE.json","packages/@react-aria/menu/intl/fi-FI.json","packages/@react-aria/menu/intl/fr-FR.json","packages/@react-aria/menu/intl/he-IL.json","packages/@react-aria/menu/intl/hr-HR.json","packages/@react-aria/menu/intl/hu-HU.json","packages/@react-aria/menu/intl/it-IT.json","packages/@react-aria/menu/intl/ja-JP.json","packages/@react-aria/menu/intl/ko-KR.json","packages/@react-aria/menu/intl/lt-LT.json","packages/@react-aria/menu/intl/lv-LV.json","packages/@react-aria/menu/intl/nb-NO.json","packages/@react-aria/menu/intl/nl-NL.json","packages/@react-aria/menu/intl/pl-PL.json","packages/@react-aria/menu/intl/pt-BR.json","packages/@react-aria/menu/intl/pt-PT.json","packages/@react-aria/menu/intl/ro-RO.json","packages/@react-aria/menu/intl/ru-RU.json","packages/@react-aria/menu/intl/sk-SK.json","packages/@react-aria/menu/intl/sl-SI.json","packages/@react-aria/menu/intl/sr-SP.json","packages/@react-aria/menu/intl/sv-SE.json","packages/@react-aria/menu/intl/tr-TR.json","packages/@react-aria/menu/intl/uk-UA.json","packages/@react-aria/menu/intl/zh-CN.json","packages/@react-aria/menu/intl/zh-TW.json","packages/@react-aria/menu/src/useMenu.ts","packages/@react-aria/menu/src/useMenuItem.ts","packages/@react-aria/menu/src/useMenuSection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useMenuTrigger} from './useMenuTrigger';\nexport {useMenu} from './useMenu';\nexport {useMenuItem} from './useMenuItem';\nexport {useMenuSection} from './useMenuSection';\n\nexport type {AriaMenuProps} from '@react-types/menu';\nexport type {AriaMenuTriggerProps, MenuTriggerAria} from './useMenuTrigger';\nexport type {AriaMenuOptions, MenuAria} from './useMenu';\nexport type {AriaMenuItemProps, MenuItemAria} from './useMenuItem';\nexport type {AriaMenuSectionProps, MenuSectionAria} from './useMenuSection';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaMenuOptions} from './useMenu';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {MenuTriggerState} from '@react-stately/menu';\nimport {MenuTriggerType} from '@react-types/menu';\nimport {RefObject} from 'react';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useLongPress} from '@react-aria/interactions';\nimport {useOverlayTrigger} from '@react-aria/overlays';\n\nexport interface AriaMenuTriggerProps {\n /** The type of menu that the menu trigger opens. */\n type?: 'menu' | 'listbox',\n /** Whether menu trigger is disabled. */\n isDisabled?: boolean,\n /** How menu is triggered. */\n trigger?: MenuTriggerType\n}\n\nexport interface MenuTriggerAria<T> {\n /** Props for the menu trigger element. */\n menuTriggerProps: AriaButtonProps,\n\n /** Props for the menu. */\n menuProps: AriaMenuOptions<T>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n * @param props - Props for the menu trigger.\n * @param state - State for the menu trigger.\n */\nexport function useMenuTrigger<T>(props: AriaMenuTriggerProps, state: MenuTriggerState, ref: RefObject<Element>): MenuTriggerAria<T> {\n let {\n type = 'menu' as AriaMenuTriggerProps['type'],\n isDisabled,\n trigger = 'press'\n } = props;\n\n let menuTriggerId = useId();\n let {triggerProps, overlayProps} = useOverlayTrigger({type}, state, ref);\n\n let onKeyDown = (e) => {\n if (isDisabled) {\n return;\n }\n\n if (trigger === 'longPress' && !e.altKey) {\n return;\n }\n\n if (ref && ref.current) {\n switch (e.key) {\n case 'Enter':\n case ' ':\n if (trigger === 'longPress') {\n return;\n }\n // fallthrough\n case 'ArrowDown':\n // Stop propagation, unless it would already be handled by useKeyboard.\n if (!('continuePropagation' in e)) {\n e.stopPropagation();\n }\n e.preventDefault();\n state.toggle('first');\n break;\n case 'ArrowUp':\n if (!('continuePropagation' in e)) {\n e.stopPropagation();\n }\n e.preventDefault();\n state.toggle('last');\n break;\n }\n }\n };\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n let {longPressProps} = useLongPress({\n isDisabled: isDisabled || trigger !== 'longPress',\n accessibilityDescription: stringFormatter.format('longPressMessage'),\n onLongPressStart() {\n state.close();\n },\n onLongPress() {\n state.open('first');\n }\n });\n\n let pressProps = {\n onPressStart(e) {\n // For consistency with native, open the menu on mouse/key down, but touch up.\n if (e.pointerType !== 'touch' && e.pointerType !== 'keyboard' && !isDisabled) {\n // If opened with a screen reader, auto focus the first item.\n // Otherwise, the menu itself will be focused.\n state.toggle(e.pointerType === 'virtual' ? 'first' : null);\n }\n },\n onPress(e) {\n if (e.pointerType === 'touch' && !isDisabled) {\n state.toggle();\n }\n }\n };\n\n // omit onPress from triggerProps since we override it above.\n delete triggerProps.onPress;\n\n return {\n menuTriggerProps: {\n ...triggerProps,\n ...(trigger === 'press' ? pressProps : longPressProps),\n id: menuTriggerId,\n onKeyDown\n },\n menuProps: {\n ...overlayProps,\n 'aria-labelledby': menuTriggerId,\n autoFocus: state.focusStrategy || true,\n onClose: state.close\n }\n };\n}\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"longPressMessage\": \"اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة\"\n}\n","{\n \"longPressMessage\": \"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто\"\n}\n","{\n \"longPressMessage\": \"Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku\"\n}\n","{\n \"longPressMessage\": \"Langt tryk eller tryk på Alt + pil ned for at åbne menuen\"\n}\n","{\n \"longPressMessage\": \"Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen\"\n}\n","{\n \"longPressMessage\": \"Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού\"\n}\n","{\n \"longPressMessage\": \"Long press or press Alt + ArrowDown to open menu\"\n}\n","{\n \"longPressMessage\": \"Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú\"\n}\n","{\n \"longPressMessage\": \"Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool\"\n}\n","{\n \"longPressMessage\": \"Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli\"\n}\n","{\n \"longPressMessage\": \"Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu.\"\n}\n","{\n \"longPressMessage\": \"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט\"\n}\n","{\n \"longPressMessage\": \"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika\"\n}\n","{\n \"longPressMessage\": \"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához\"\n}\n","{\n \"longPressMessage\": \"Premere a lungo o premere Alt + Freccia giù per aprire il menu\"\n}\n","{\n \"longPressMessage\": \"長押しまたは Alt+下矢印キーでメニューを開く\"\n}\n","{\n \"longPressMessage\": \"길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기\"\n}\n","{\n \"longPressMessage\": \"Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“.\"\n}\n","{\n \"longPressMessage\": \"Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa\"\n}\n","{\n \"longPressMessage\": \"Langt trykk eller trykk Alt + PilNed for å åpne menyen\"\n}\n","{\n \"longPressMessage\": \"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen\"\n}\n","{\n \"longPressMessage\": \"Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu\"\n}\n","{\n \"longPressMessage\": \"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu\"\n}\n","{\n \"longPressMessage\": \"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu\"\n}\n","{\n \"longPressMessage\": \"Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul\"\n}\n","{\n \"longPressMessage\": \"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню\"\n}\n","{\n \"longPressMessage\": \"Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol\"\n}\n","{\n \"longPressMessage\": \"Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol\"\n}\n","{\n \"longPressMessage\": \"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni\"\n}\n","{\n \"longPressMessage\": \"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn\"\n}\n","{\n \"longPressMessage\": \"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın\"\n}\n","{\n \"longPressMessage\": \"Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню\"\n}\n","{\n \"longPressMessage\": \"长按或按 Alt + 向下方向键以打开菜单\"\n}\n","{\n \"longPressMessage\": \"長按或按 Alt+向下鍵以開啟功能表\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaMenuProps} from '@react-types/menu';\nimport {DOMAttributes, KeyboardDelegate} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {Key, RefObject} from 'react';\nimport {TreeState} from '@react-stately/tree';\nimport {useSelectableList} from '@react-aria/selection';\n\nexport interface MenuAria {\n /** Props for the menu element. */\n menuProps: DOMAttributes\n}\n\nexport interface AriaMenuOptions<T> extends Omit<AriaMenuProps<T>, 'children'> {\n /** Whether the menu uses virtual scrolling. */\n isVirtualized?: boolean,\n\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate\n}\n\ninterface MenuData {\n onClose?: () => void,\n onAction?: (key: Key) => void\n}\n\nexport const menuData = new WeakMap<TreeState<unknown>, MenuData>();\n\n/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n * @param props - Props for the menu.\n * @param state - State for the menu, as returned by `useListState`.\n */\nexport function useMenu<T>(props: AriaMenuOptions<T>, state: TreeState<T>, ref: RefObject<HTMLElement>): MenuAria {\n let {\n shouldFocusWrap = true,\n ...otherProps\n } = props;\n\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn('An aria-label or aria-labelledby prop is required for accessibility.');\n }\n\n let domProps = filterDOMProps(props, {labelable: true});\n let {listProps} = useSelectableList({\n ...otherProps,\n ref,\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n shouldFocusWrap\n });\n\n menuData.set(state, {\n onClose: props.onClose,\n onAction: props.onAction\n });\n\n return {\n menuProps: mergeProps(domProps, {\n role: 'menu',\n // this forces AT to move their cursors into any open sub dialogs, the sub dialogs contain hidden close buttons in order to come back to this level of the menu\n 'aria-hidden': state.expandedKeys.size > 0 ? true : undefined,\n ...listProps,\n onKeyDown: (e) => {\n // don't clear the menu selected keys if the user is presses escape since escape closes the menu\n if (e.key !== 'Escape') {\n listProps.onKeyDown(e);\n }\n }\n })\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableElement, PressEvent} from '@react-types/shared';\nimport {focusSafely} from '@react-aria/focus';\nimport {getItemCount} from '@react-stately/collections';\nimport {isFocusVisible, useHover, useKeyboard, usePress} from '@react-aria/interactions';\nimport {Key, RefObject, useCallback, useRef} from 'react';\nimport {menuData} from './useMenu';\nimport {mergeProps, useEffectEvent, useLayoutEffect, useSlotId} from '@react-aria/utils';\nimport {TreeState} from '@react-stately/tree';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSelectableItem} from '@react-aria/selection';\n\nexport interface MenuItemAria {\n /** Props for the menu item element. */\n menuItemProps: DOMAttributes,\n\n /** Props for the main text element inside the menu item. */\n labelProps: DOMAttributes,\n\n /** Props for the description text element inside the menu item, if any. */\n descriptionProps: DOMAttributes,\n\n /** Props for the keyboard shortcut text element inside the item, if any. */\n keyboardShortcutProps: DOMAttributes,\n\n /** Whether the item is currently focused. */\n isFocused: boolean,\n /** Whether the item is currently selected. */\n isSelected: boolean,\n /** Whether the item is currently in a pressed state. */\n isPressed: boolean,\n /** Whether the item is disabled. */\n isDisabled: boolean\n}\n\nexport interface AriaMenuItemProps {\n /**\n * Whether the menu item is disabled.\n * @deprecated - pass disabledKeys to useTreeState instead.\n */\n isDisabled?: boolean,\n\n /**\n * Whether the menu item is selected.\n * @deprecated - pass selectedKeys to useTreeState instead.\n */\n isSelected?: boolean,\n\n /** A screen reader only label for the menu item. */\n 'aria-label'?: string,\n\n /** The unique key for the menu item. */\n key?: Key,\n\n /**\n * Handler that is called when the menu should close after selecting an item.\n * @deprecated - pass to the menu instead.\n */\n onClose?: () => void,\n\n /**\n * Whether the menu should close when the menu item is selected.\n * @default true\n */\n closeOnSelect?: boolean,\n\n /** Whether the menu item is contained in a virtual scrolling menu. */\n isVirtualized?: boolean,\n\n /**\n * Handler that is called when the user activates the item.\n * @deprecated - pass to the menu instead.\n */\n onAction?: (key: Key) => void,\n\n /** What kind of popup the item opens. */\n 'aria-haspopup'?: 'menu' | 'dialog'\n}\n\n/**\n * Provides the behavior and accessibility implementation for an item in a menu.\n * See `useMenu` for more details about menus.\n * @param props - Props for the item.\n * @param state - State for the menu, as returned by `useTreeState`.\n */\nexport function useMenuItem<T>(props: AriaMenuItemProps, state: TreeState<T>, ref: RefObject<FocusableElement>): MenuItemAria {\n let {\n key,\n closeOnSelect,\n isVirtualized,\n 'aria-haspopup': hasPopup\n } = props;\n let {direction} = useLocale();\n\n let isMenuDialogTrigger = state.collection.getItem(key).hasChildNodes;\n let isOpen = state.expandedKeys.has(key);\n\n let isDisabled = props.isDisabled ?? state.disabledKeys.has(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n\n let openTimeout = useRef<ReturnType<typeof setTimeout> | undefined>();\n let cancelOpenTimeout = useCallback(() => {\n if (openTimeout.current) {\n clearTimeout(openTimeout.current);\n openTimeout.current = undefined;\n }\n }, [openTimeout]);\n\n let onSubmenuOpen = useEffectEvent(() => {\n cancelOpenTimeout();\n state.setExpandedKeys(new Set([key]));\n });\n\n useLayoutEffect(() => {\n return () => cancelOpenTimeout();\n }, [cancelOpenTimeout]);\n\n let data = menuData.get(state);\n let onClose = props.onClose || data.onClose;\n let onActionMenuDialogTrigger = useCallback(() => {\n onSubmenuOpen();\n // will need to disable this lint rule when using useEffectEvent https://react.dev/learn/separating-events-from-effects#logic-inside-effects-is-reactive\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n let onAction = isMenuDialogTrigger ? onActionMenuDialogTrigger : props.onAction || data.onAction;\n\n let role = 'menuitem';\n if (state.selectionManager.selectionMode === 'single') {\n role = 'menuitemradio';\n } else if (state.selectionManager.selectionMode === 'multiple') {\n role = 'menuitemcheckbox';\n }\n\n let labelId = useSlotId();\n let descriptionId = useSlotId();\n let keyboardId = useSlotId();\n\n let ariaProps = {\n 'aria-disabled': isDisabled || undefined,\n role,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': labelId,\n 'aria-describedby': [descriptionId, keyboardId].filter(Boolean).join(' ') || undefined\n };\n\n if (state.selectionManager.selectionMode !== 'none') {\n ariaProps['aria-checked'] = isSelected;\n }\n\n if (isVirtualized) {\n ariaProps['aria-posinset'] = state.collection.getItem(key).index;\n ariaProps['aria-setsize'] = getItemCount(state.collection);\n }\n\n if (hasPopup != null) {\n ariaProps['aria-haspopup'] = hasPopup;\n ariaProps['aria-expanded'] = isOpen ? 'true' : 'false';\n }\n\n let onPressStart = (e: PressEvent) => {\n if (e.pointerType === 'keyboard' && onAction) {\n onAction(key);\n }\n };\n\n let onPressUp = (e: PressEvent) => {\n if (e.pointerType !== 'keyboard') {\n if (onAction) {\n onAction(key);\n }\n\n // Pressing a menu item should close by default in single selection mode but not multiple\n // selection mode, except if overridden by the closeOnSelect prop.\n if (!isMenuDialogTrigger && onClose && (closeOnSelect ?? state.selectionManager.selectionMode !== 'multiple')) {\n onClose();\n }\n }\n };\n\n let {itemProps, isFocused} = useSelectableItem({\n selectionManager: state.selectionManager,\n key,\n ref,\n shouldSelectOnPressUp: true,\n allowsDifferentPressOrigin: true\n });\n\n let {pressProps, isPressed} = usePress({onPressStart, onPressUp, isDisabled: isDisabled || (isMenuDialogTrigger && state.expandedKeys.has(key))});\n let {hoverProps} = useHover({\n isDisabled,\n onHoverStart() {\n if (!isFocusVisible() && !(isMenuDialogTrigger && state.expandedKeys.has(key))) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n // focus immediately so that a focus scope opened on hover has the correct restore node\n let isFocused = key === state.selectionManager.focusedKey;\n if (isFocused && state.selectionManager.isFocused && document.activeElement !== ref.current) {\n focusSafely(ref.current);\n }\n }\n },\n onHoverChange: isHovered => {\n if (isHovered && isMenuDialogTrigger && !state.expandedKeys.has(key)) {\n if (!openTimeout.current) {\n openTimeout.current = setTimeout(() => {\n onSubmenuOpen();\n }, 200);\n }\n } else if (!isHovered) {\n cancelOpenTimeout();\n }\n }\n });\n\n let {keyboardProps} = useKeyboard({\n onKeyDown: (e) => {\n // Ignore repeating events, which may have started on the menu trigger before moving\n // focus to the menu item. We want to wait for a second complete key press sequence.\n if (e.repeat) {\n e.continuePropagation();\n return;\n }\n\n switch (e.key) {\n case ' ':\n if (!isDisabled && state.selectionManager.selectionMode === 'none' && !isMenuDialogTrigger && closeOnSelect !== false && onClose) {\n onClose();\n }\n break;\n case 'Enter':\n // The Enter key should always close on select, except if overridden.\n if (!isDisabled && closeOnSelect !== false && !isMenuDialogTrigger && onClose) {\n onClose();\n }\n break;\n case 'ArrowRight':\n if (isMenuDialogTrigger && direction === 'ltr') {\n onSubmenuOpen();\n } else {\n e.continuePropagation();\n }\n break;\n case 'ArrowLeft':\n if (isMenuDialogTrigger && direction === 'rtl') {\n onSubmenuOpen();\n } else {\n e.continuePropagation();\n }\n break;\n default:\n e.continuePropagation();\n break;\n }\n }\n });\n\n return {\n menuItemProps: {\n ...ariaProps,\n ...mergeProps(itemProps, pressProps, hoverProps, keyboardProps)\n },\n labelProps: {\n id: labelId\n },\n descriptionProps: {\n id: descriptionId\n },\n keyboardShortcutProps: {\n id: keyboardId\n },\n isFocused,\n isSelected,\n isPressed,\n isDisabled\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '@react-aria/utils';\n\nexport interface AriaMenuSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface MenuSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a menu.\n * See `useMenu` for more details about menus.\n * @param props - Props for the section.\n */\nexport function useMenuSection(props: AriaMenuSectionProps): MenuSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Techincally, menus cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a label for the nested group.\n id: headingId,\n role: 'presentation'\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;;;AEAA,4BAAiB;IAAG,oBAAoB,CAAC,sDAAsD,CAAC;AAChG;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,gFAAgF,CAAC;AAC1H;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,wEAAwE,CAAC;AAClH;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,yDAAyD,CAAC;AACnG;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,0EAA0E,CAAC;AACpH;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,uEAAuE,CAAC;AACjH;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,gDAAgD,CAAC;AAC1F;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,8DAA8D,CAAC;AACxG;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,kEAAkE,CAAC;AAC5G;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,wEAAwE,CAAC;AAClH;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,yFAAyF,CAAC;AACnI;;;;ACDA,4BAAiB;IAAG,oBAAoB,CAAC,0DAA0D,CAAC;AACpG;;;;ACDA,4BAAiB;IAAG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,SAAS;YACZ,GAAG,CAAA,GAAA,iBAAS,EAAE,WAAW,YAAY,YAAY,cAAc;QACjE;QACA,YAAY;YACV,IAAI;QACN;QACA,kBAAkB;YAChB,IAAI;QACN;QACA,uBAAuB;YACrB,IAAI;QACN;mBACA;oBACA;mBACA;oBACA;IACF;AACF;;;AC9RA;;;;;;;;;;CAUC;AA6BM,SAAS,0CAAe,KAA2B;IACxD,IAAI,WAAC,QAAO,EAAE,cAAc,UAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,YAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UAAU;YACtB,gEAAgE;YAChE,4EAA4E;YAC5E,mDAAmD;YACnD,IAAI;YACJ,MAAM;QACR,IAAI,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF;","sources":["packages/@react-aria/menu/src/index.ts","packages/@react-aria/menu/src/useMenuTrigger.ts","packages/@react-aria/menu/src/*.js","packages/@react-aria/menu/intl/ar-AE.json","packages/@react-aria/menu/intl/bg-BG.json","packages/@react-aria/menu/intl/cs-CZ.json","packages/@react-aria/menu/intl/da-DK.json","packages/@react-aria/menu/intl/de-DE.json","packages/@react-aria/menu/intl/el-GR.json","packages/@react-aria/menu/intl/en-US.json","packages/@react-aria/menu/intl/es-ES.json","packages/@react-aria/menu/intl/et-EE.json","packages/@react-aria/menu/intl/fi-FI.json","packages/@react-aria/menu/intl/fr-FR.json","packages/@react-aria/menu/intl/he-IL.json","packages/@react-aria/menu/intl/hr-HR.json","packages/@react-aria/menu/intl/hu-HU.json","packages/@react-aria/menu/intl/it-IT.json","packages/@react-aria/menu/intl/ja-JP.json","packages/@react-aria/menu/intl/ko-KR.json","packages/@react-aria/menu/intl/lt-LT.json","packages/@react-aria/menu/intl/lv-LV.json","packages/@react-aria/menu/intl/nb-NO.json","packages/@react-aria/menu/intl/nl-NL.json","packages/@react-aria/menu/intl/pl-PL.json","packages/@react-aria/menu/intl/pt-BR.json","packages/@react-aria/menu/intl/pt-PT.json","packages/@react-aria/menu/intl/ro-RO.json","packages/@react-aria/menu/intl/ru-RU.json","packages/@react-aria/menu/intl/sk-SK.json","packages/@react-aria/menu/intl/sl-SI.json","packages/@react-aria/menu/intl/sr-SP.json","packages/@react-aria/menu/intl/sv-SE.json","packages/@react-aria/menu/intl/tr-TR.json","packages/@react-aria/menu/intl/uk-UA.json","packages/@react-aria/menu/intl/zh-CN.json","packages/@react-aria/menu/intl/zh-TW.json","packages/@react-aria/menu/src/useMenu.ts","packages/@react-aria/menu/src/useMenuItem.ts","packages/@react-aria/menu/src/useMenuSection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useMenuTrigger} from './useMenuTrigger';\nexport {useMenu} from './useMenu';\nexport {useMenuItem} from './useMenuItem';\nexport {useMenuSection} from './useMenuSection';\n\nexport type {AriaMenuProps} from '@react-types/menu';\nexport type {AriaMenuTriggerProps, MenuTriggerAria} from './useMenuTrigger';\nexport type {AriaMenuOptions, MenuAria} from './useMenu';\nexport type {AriaMenuItemProps, MenuItemAria} from './useMenuItem';\nexport type {AriaMenuSectionProps, MenuSectionAria} from './useMenuSection';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaMenuOptions} from './useMenu';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {MenuTriggerState} from '@react-stately/menu';\nimport {MenuTriggerType} from '@react-types/menu';\nimport {RefObject} from 'react';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useLongPress} from '@react-aria/interactions';\nimport {useOverlayTrigger} from '@react-aria/overlays';\n\nexport interface AriaMenuTriggerProps {\n /** The type of menu that the menu trigger opens. */\n type?: 'menu' | 'listbox',\n /** Whether menu trigger is disabled. */\n isDisabled?: boolean,\n /** How menu is triggered. */\n trigger?: MenuTriggerType\n}\n\nexport interface MenuTriggerAria<T> {\n /** Props for the menu trigger element. */\n menuTriggerProps: AriaButtonProps,\n\n /** Props for the menu. */\n menuProps: AriaMenuOptions<T>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n * @param props - Props for the menu trigger.\n * @param state - State for the menu trigger.\n */\nexport function useMenuTrigger<T>(props: AriaMenuTriggerProps, state: MenuTriggerState, ref: RefObject<Element>): MenuTriggerAria<T> {\n let {\n type = 'menu' as AriaMenuTriggerProps['type'],\n isDisabled,\n trigger = 'press'\n } = props;\n\n let menuTriggerId = useId();\n let {triggerProps, overlayProps} = useOverlayTrigger({type}, state, ref);\n\n let onKeyDown = (e) => {\n if (isDisabled) {\n return;\n }\n\n if (trigger === 'longPress' && !e.altKey) {\n return;\n }\n\n if (ref && ref.current) {\n switch (e.key) {\n case 'Enter':\n case ' ':\n if (trigger === 'longPress') {\n return;\n }\n // fallthrough\n case 'ArrowDown':\n // Stop propagation, unless it would already be handled by useKeyboard.\n if (!('continuePropagation' in e)) {\n e.stopPropagation();\n }\n e.preventDefault();\n state.toggle('first');\n break;\n case 'ArrowUp':\n if (!('continuePropagation' in e)) {\n e.stopPropagation();\n }\n e.preventDefault();\n state.toggle('last');\n break;\n }\n }\n };\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n let {longPressProps} = useLongPress({\n isDisabled: isDisabled || trigger !== 'longPress',\n accessibilityDescription: stringFormatter.format('longPressMessage'),\n onLongPressStart() {\n state.close();\n },\n onLongPress() {\n state.open('first');\n }\n });\n\n let pressProps = {\n onPressStart(e) {\n // For consistency with native, open the menu on mouse/key down, but touch up.\n if (e.pointerType !== 'touch' && e.pointerType !== 'keyboard' && !isDisabled) {\n // If opened with a screen reader, auto focus the first item.\n // Otherwise, the menu itself will be focused.\n state.toggle(e.pointerType === 'virtual' ? 'first' : null);\n }\n },\n onPress(e) {\n if (e.pointerType === 'touch' && !isDisabled) {\n state.toggle();\n }\n }\n };\n\n // omit onPress from triggerProps since we override it above.\n delete triggerProps.onPress;\n\n return {\n menuTriggerProps: {\n ...triggerProps,\n ...(trigger === 'press' ? pressProps : longPressProps),\n id: menuTriggerId,\n onKeyDown\n },\n menuProps: {\n ...overlayProps,\n 'aria-labelledby': menuTriggerId,\n autoFocus: state.focusStrategy || true,\n onClose: state.close\n }\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"longPressMessage\": \"اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة\"\n}\n","{\n \"longPressMessage\": \"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто\"\n}\n","{\n \"longPressMessage\": \"Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku\"\n}\n","{\n \"longPressMessage\": \"Langt tryk eller tryk på Alt + pil ned for at åbne menuen\"\n}\n","{\n \"longPressMessage\": \"Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen\"\n}\n","{\n \"longPressMessage\": \"Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού\"\n}\n","{\n \"longPressMessage\": \"Long press or press Alt + ArrowDown to open menu\"\n}\n","{\n \"longPressMessage\": \"Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú\"\n}\n","{\n \"longPressMessage\": \"Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool\"\n}\n","{\n \"longPressMessage\": \"Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli\"\n}\n","{\n \"longPressMessage\": \"Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu.\"\n}\n","{\n \"longPressMessage\": \"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט\"\n}\n","{\n \"longPressMessage\": \"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika\"\n}\n","{\n \"longPressMessage\": \"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához\"\n}\n","{\n \"longPressMessage\": \"Premere a lungo o premere Alt + Freccia giù per aprire il menu\"\n}\n","{\n \"longPressMessage\": \"長押しまたは Alt+下矢印キーでメニューを開く\"\n}\n","{\n \"longPressMessage\": \"길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기\"\n}\n","{\n \"longPressMessage\": \"Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“.\"\n}\n","{\n \"longPressMessage\": \"Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa\"\n}\n","{\n \"longPressMessage\": \"Langt trykk eller trykk Alt + PilNed for å åpne menyen\"\n}\n","{\n \"longPressMessage\": \"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen\"\n}\n","{\n \"longPressMessage\": \"Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu\"\n}\n","{\n \"longPressMessage\": \"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu\"\n}\n","{\n \"longPressMessage\": \"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu\"\n}\n","{\n \"longPressMessage\": \"Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul\"\n}\n","{\n \"longPressMessage\": \"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню\"\n}\n","{\n \"longPressMessage\": \"Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol\"\n}\n","{\n \"longPressMessage\": \"Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol\"\n}\n","{\n \"longPressMessage\": \"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni\"\n}\n","{\n \"longPressMessage\": \"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn\"\n}\n","{\n \"longPressMessage\": \"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın\"\n}\n","{\n \"longPressMessage\": \"Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню\"\n}\n","{\n \"longPressMessage\": \"长按或按 Alt + 向下方向键以打开菜单\"\n}\n","{\n \"longPressMessage\": \"長按或按 Alt+向下鍵以開啟功能表\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaMenuProps} from '@react-types/menu';\nimport {DOMAttributes, KeyboardDelegate} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {Key, RefObject} from 'react';\nimport {TreeState} from '@react-stately/tree';\nimport {useSelectableList} from '@react-aria/selection';\n\nexport interface MenuAria {\n /** Props for the menu element. */\n menuProps: DOMAttributes\n}\n\nexport interface AriaMenuOptions<T> extends Omit<AriaMenuProps<T>, 'children'> {\n /** Whether the menu uses virtual scrolling. */\n isVirtualized?: boolean,\n\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate\n}\n\ninterface MenuData {\n onClose?: () => void,\n onAction?: (key: Key) => void\n}\n\nexport const menuData = new WeakMap<TreeState<unknown>, MenuData>();\n\n/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n * @param props - Props for the menu.\n * @param state - State for the menu, as returned by `useListState`.\n */\nexport function useMenu<T>(props: AriaMenuOptions<T>, state: TreeState<T>, ref: RefObject<HTMLElement>): MenuAria {\n let {\n shouldFocusWrap = true,\n ...otherProps\n } = props;\n\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn('An aria-label or aria-labelledby prop is required for accessibility.');\n }\n\n let domProps = filterDOMProps(props, {labelable: true});\n let {listProps} = useSelectableList({\n ...otherProps,\n ref,\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n shouldFocusWrap\n });\n\n menuData.set(state, {\n onClose: props.onClose,\n onAction: props.onAction\n });\n\n return {\n menuProps: mergeProps(domProps, {\n role: 'menu',\n // this forces AT to move their cursors into any open sub dialogs, the sub dialogs contain hidden close buttons in order to come back to this level of the menu\n 'aria-hidden': state.expandedKeys.size > 0 ? true : undefined,\n ...listProps,\n onKeyDown: (e) => {\n // don't clear the menu selected keys if the user is presses escape since escape closes the menu\n if (e.key !== 'Escape') {\n listProps.onKeyDown(e);\n }\n }\n })\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableElement, PressEvent} from '@react-types/shared';\nimport {focusSafely} from '@react-aria/focus';\nimport {getItemCount} from '@react-stately/collections';\nimport {isFocusVisible, useHover, useKeyboard, usePress} from '@react-aria/interactions';\nimport {Key, RefObject, useCallback, useRef} from 'react';\nimport {menuData} from './useMenu';\nimport {mergeProps, useEffectEvent, useLayoutEffect, useSlotId} from '@react-aria/utils';\nimport {TreeState} from '@react-stately/tree';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSelectableItem} from '@react-aria/selection';\n\nexport interface MenuItemAria {\n /** Props for the menu item element. */\n menuItemProps: DOMAttributes,\n\n /** Props for the main text element inside the menu item. */\n labelProps: DOMAttributes,\n\n /** Props for the description text element inside the menu item, if any. */\n descriptionProps: DOMAttributes,\n\n /** Props for the keyboard shortcut text element inside the item, if any. */\n keyboardShortcutProps: DOMAttributes,\n\n /** Whether the item is currently focused. */\n isFocused: boolean,\n /** Whether the item is currently selected. */\n isSelected: boolean,\n /** Whether the item is currently in a pressed state. */\n isPressed: boolean,\n /** Whether the item is disabled. */\n isDisabled: boolean\n}\n\nexport interface AriaMenuItemProps {\n /**\n * Whether the menu item is disabled.\n * @deprecated - pass disabledKeys to useTreeState instead.\n */\n isDisabled?: boolean,\n\n /**\n * Whether the menu item is selected.\n * @deprecated - pass selectedKeys to useTreeState instead.\n */\n isSelected?: boolean,\n\n /** A screen reader only label for the menu item. */\n 'aria-label'?: string,\n\n /** The unique key for the menu item. */\n key?: Key,\n\n /**\n * Handler that is called when the menu should close after selecting an item.\n * @deprecated - pass to the menu instead.\n */\n onClose?: () => void,\n\n /**\n * Whether the menu should close when the menu item is selected.\n * @default true\n */\n closeOnSelect?: boolean,\n\n /** Whether the menu item is contained in a virtual scrolling menu. */\n isVirtualized?: boolean,\n\n /**\n * Handler that is called when the user activates the item.\n * @deprecated - pass to the menu instead.\n */\n onAction?: (key: Key) => void,\n\n /** What kind of popup the item opens. */\n 'aria-haspopup'?: 'menu' | 'dialog'\n}\n\n/**\n * Provides the behavior and accessibility implementation for an item in a menu.\n * See `useMenu` for more details about menus.\n * @param props - Props for the item.\n * @param state - State for the menu, as returned by `useTreeState`.\n */\nexport function useMenuItem<T>(props: AriaMenuItemProps, state: TreeState<T>, ref: RefObject<FocusableElement>): MenuItemAria {\n let {\n key,\n closeOnSelect,\n isVirtualized,\n 'aria-haspopup': hasPopup\n } = props;\n let {direction} = useLocale();\n\n let isMenuDialogTrigger = state.collection.getItem(key).hasChildNodes;\n let isOpen = state.expandedKeys.has(key);\n\n let isDisabled = props.isDisabled ?? state.disabledKeys.has(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n\n let openTimeout = useRef<ReturnType<typeof setTimeout> | undefined>();\n let cancelOpenTimeout = useCallback(() => {\n if (openTimeout.current) {\n clearTimeout(openTimeout.current);\n openTimeout.current = undefined;\n }\n }, [openTimeout]);\n\n let onSubmenuOpen = useEffectEvent(() => {\n cancelOpenTimeout();\n state.setExpandedKeys(new Set([key]));\n });\n\n useLayoutEffect(() => {\n return () => cancelOpenTimeout();\n }, [cancelOpenTimeout]);\n\n let data = menuData.get(state);\n let onClose = props.onClose || data.onClose;\n let onActionMenuDialogTrigger = useCallback(() => {\n onSubmenuOpen();\n // will need to disable this lint rule when using useEffectEvent https://react.dev/learn/separating-events-from-effects#logic-inside-effects-is-reactive\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n let onAction = isMenuDialogTrigger ? onActionMenuDialogTrigger : props.onAction || data.onAction;\n\n let role = 'menuitem';\n if (state.selectionManager.selectionMode === 'single') {\n role = 'menuitemradio';\n } else if (state.selectionManager.selectionMode === 'multiple') {\n role = 'menuitemcheckbox';\n }\n\n let labelId = useSlotId();\n let descriptionId = useSlotId();\n let keyboardId = useSlotId();\n\n let ariaProps = {\n 'aria-disabled': isDisabled || undefined,\n role,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': labelId,\n 'aria-describedby': [descriptionId, keyboardId].filter(Boolean).join(' ') || undefined\n };\n\n if (state.selectionManager.selectionMode !== 'none') {\n ariaProps['aria-checked'] = isSelected;\n }\n\n if (isVirtualized) {\n ariaProps['aria-posinset'] = state.collection.getItem(key).index;\n ariaProps['aria-setsize'] = getItemCount(state.collection);\n }\n\n if (hasPopup != null) {\n ariaProps['aria-haspopup'] = hasPopup;\n ariaProps['aria-expanded'] = isOpen ? 'true' : 'false';\n }\n\n let onPressStart = (e: PressEvent) => {\n if (e.pointerType === 'keyboard' && onAction) {\n onAction(key);\n }\n };\n\n let onPressUp = (e: PressEvent) => {\n if (e.pointerType !== 'keyboard') {\n if (onAction) {\n onAction(key);\n }\n\n // Pressing a menu item should close by default in single selection mode but not multiple\n // selection mode, except if overridden by the closeOnSelect prop.\n if (!isMenuDialogTrigger && onClose && (closeOnSelect ?? state.selectionManager.selectionMode !== 'multiple')) {\n onClose();\n }\n }\n };\n\n let {itemProps, isFocused} = useSelectableItem({\n selectionManager: state.selectionManager,\n key,\n ref,\n shouldSelectOnPressUp: true,\n allowsDifferentPressOrigin: true\n });\n\n let {pressProps, isPressed} = usePress({onPressStart, onPressUp, isDisabled: isDisabled || (isMenuDialogTrigger && state.expandedKeys.has(key))});\n let {hoverProps} = useHover({\n isDisabled,\n onHoverStart() {\n if (!isFocusVisible() && !(isMenuDialogTrigger && state.expandedKeys.has(key))) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n // focus immediately so that a focus scope opened on hover has the correct restore node\n let isFocused = key === state.selectionManager.focusedKey;\n if (isFocused && state.selectionManager.isFocused && document.activeElement !== ref.current) {\n focusSafely(ref.current);\n }\n }\n },\n onHoverChange: isHovered => {\n if (isHovered && isMenuDialogTrigger && !state.expandedKeys.has(key)) {\n if (!openTimeout.current) {\n openTimeout.current = setTimeout(() => {\n onSubmenuOpen();\n }, 200);\n }\n } else if (!isHovered) {\n cancelOpenTimeout();\n }\n }\n });\n\n let {keyboardProps} = useKeyboard({\n onKeyDown: (e) => {\n // Ignore repeating events, which may have started on the menu trigger before moving\n // focus to the menu item. We want to wait for a second complete key press sequence.\n if (e.repeat) {\n e.continuePropagation();\n return;\n }\n\n switch (e.key) {\n case ' ':\n if (!isDisabled && state.selectionManager.selectionMode === 'none' && !isMenuDialogTrigger && closeOnSelect !== false && onClose) {\n onClose();\n }\n break;\n case 'Enter':\n // The Enter key should always close on select, except if overridden.\n if (!isDisabled && closeOnSelect !== false && !isMenuDialogTrigger && onClose) {\n onClose();\n }\n break;\n case 'ArrowRight':\n if (isMenuDialogTrigger && direction === 'ltr') {\n onSubmenuOpen();\n } else {\n e.continuePropagation();\n }\n break;\n case 'ArrowLeft':\n if (isMenuDialogTrigger && direction === 'rtl') {\n onSubmenuOpen();\n } else {\n e.continuePropagation();\n }\n break;\n default:\n e.continuePropagation();\n break;\n }\n }\n });\n\n return {\n menuItemProps: {\n ...ariaProps,\n ...mergeProps(itemProps, pressProps, hoverProps, keyboardProps)\n },\n labelProps: {\n id: labelId\n },\n descriptionProps: {\n id: descriptionId\n },\n keyboardShortcutProps: {\n id: keyboardId\n },\n isFocused,\n isSelected,\n isPressed,\n isDisabled\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '@react-aria/utils';\n\nexport interface AriaMenuSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface MenuSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a menu.\n * See `useMenu` for more details about menus.\n * @param props - Props for the section.\n */\nexport function useMenuSection(props: AriaMenuSectionProps): MenuSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Techincally, menus cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a label for the nested group.\n id: headingId,\n role: 'presentation'\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/menu",
3
- "version": "3.9.2-nightly.3964+7f63e933e",
3
+ "version": "3.9.2-nightly.3971+e50dc5866",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,19 +22,19 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@react-aria/focus": "3.0.0-nightly.2262+7f63e933e",
26
- "@react-aria/i18n": "3.0.0-nightly.2262+7f63e933e",
27
- "@react-aria/interactions": "3.0.0-nightly.2262+7f63e933e",
28
- "@react-aria/overlays": "3.0.0-nightly.2262+7f63e933e",
29
- "@react-aria/selection": "3.0.0-nightly.2262+7f63e933e",
30
- "@react-aria/utils": "3.0.0-nightly.2262+7f63e933e",
31
- "@react-stately/collections": "3.0.0-nightly.2262+7f63e933e",
32
- "@react-stately/menu": "3.5.3-nightly.3964+7f63e933e",
33
- "@react-stately/tree": "3.0.0-nightly.2262+7f63e933e",
34
- "@react-types/button": "3.7.4-nightly.3964+7f63e933e",
35
- "@react-types/menu": "3.9.2-nightly.3964+7f63e933e",
36
- "@react-types/shared": "3.0.0-nightly.2262+7f63e933e",
37
- "@swc/helpers": "^0.4.14"
25
+ "@react-aria/focus": "3.0.0-nightly.2269+e50dc5866",
26
+ "@react-aria/i18n": "3.0.0-nightly.2269+e50dc5866",
27
+ "@react-aria/interactions": "3.0.0-nightly.2269+e50dc5866",
28
+ "@react-aria/overlays": "3.0.0-nightly.2269+e50dc5866",
29
+ "@react-aria/selection": "3.0.0-nightly.2269+e50dc5866",
30
+ "@react-aria/utils": "3.0.0-nightly.2269+e50dc5866",
31
+ "@react-stately/collections": "3.0.0-nightly.2269+e50dc5866",
32
+ "@react-stately/menu": "3.5.3-nightly.3971+e50dc5866",
33
+ "@react-stately/tree": "3.0.0-nightly.2269+e50dc5866",
34
+ "@react-types/button": "3.7.4-nightly.3971+e50dc5866",
35
+ "@react-types/menu": "3.9.2-nightly.3971+e50dc5866",
36
+ "@react-types/shared": "3.0.0-nightly.2269+e50dc5866",
37
+ "@swc/helpers": "^0.5.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "7f63e933e61f20891b4cf3f447ab817f918cb263"
46
+ "gitHead": "e50dc5866c85e5e4015802bec32f1fc24f7f138e"
47
47
  }