@react-aria/menu 3.7.1-nightly.3598 → 3.7.1-nightly.3600
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/main.js +116 -67
- package/dist/main.js.map +1 -1
- package/dist/module.mjs +116 -67
- package/dist/module.mjs.map +1 -1
- package/package.json +14 -14
package/dist/main.js
CHANGED
|
@@ -16,7 +16,27 @@ $parcel$export(module.exports, "useMenuTrigger", () => $7211ab9328763fb9$export$
|
|
|
16
16
|
$parcel$export(module.exports, "useMenu", () => $a3815f0132802737$export$38eaa17faae8f579);
|
|
17
17
|
$parcel$export(module.exports, "useMenuItem", () => $38191ed02615ec07$export$9d32628fc2aea7da);
|
|
18
18
|
$parcel$export(module.exports, "useMenuSection", () => $63008655e23408c5$export$73f7a44322579622);
|
|
19
|
-
|
|
19
|
+
/*
|
|
20
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
21
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
23
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
26
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
27
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
28
|
+
* governing permissions and limitations under the License.
|
|
29
|
+
*/ /*
|
|
30
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
31
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
32
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
33
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
34
|
+
*
|
|
35
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
36
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
37
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
38
|
+
* governing permissions and limitations under the License.
|
|
39
|
+
*/ var $5128c2fd7e261f09$exports = {};
|
|
20
40
|
var $429891642bf97c51$exports = {};
|
|
21
41
|
$429891642bf97c51$exports = {
|
|
22
42
|
"longPressMessage": `اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة`
|
|
@@ -264,52 +284,52 @@ $5128c2fd7e261f09$exports = {
|
|
|
264
284
|
|
|
265
285
|
|
|
266
286
|
function $7211ab9328763fb9$export$dc9c12ed27dd1b49(props, state, ref) {
|
|
267
|
-
let { type: type =
|
|
268
|
-
let menuTriggerId = $fHYTQ$reactariautils.useId();
|
|
269
|
-
let { triggerProps: triggerProps , overlayProps: overlayProps } = $fHYTQ$reactariaoverlays.useOverlayTrigger({
|
|
287
|
+
let { type: type = "menu" , isDisabled: isDisabled , trigger: trigger = "press" } = props;
|
|
288
|
+
let menuTriggerId = (0, $fHYTQ$reactariautils.useId)();
|
|
289
|
+
let { triggerProps: triggerProps , overlayProps: overlayProps } = (0, $fHYTQ$reactariaoverlays.useOverlayTrigger)({
|
|
270
290
|
type: type
|
|
271
291
|
}, state, ref);
|
|
272
292
|
let onKeyDown = (e)=>{
|
|
273
293
|
if (isDisabled) return;
|
|
274
|
-
if (trigger ===
|
|
294
|
+
if (trigger === "longPress" && !e.altKey) return;
|
|
275
295
|
if (ref && ref.current) switch(e.key){
|
|
276
|
-
case
|
|
277
|
-
case
|
|
278
|
-
if (trigger ===
|
|
296
|
+
case "Enter":
|
|
297
|
+
case " ":
|
|
298
|
+
if (trigger === "longPress") return;
|
|
279
299
|
// fallthrough
|
|
280
|
-
case
|
|
300
|
+
case "ArrowDown":
|
|
281
301
|
// Stop propagation, unless it would already be handled by useKeyboard.
|
|
282
|
-
if (!(
|
|
302
|
+
if (!("continuePropagation" in e)) e.stopPropagation();
|
|
283
303
|
e.preventDefault();
|
|
284
|
-
state.toggle(
|
|
304
|
+
state.toggle("first");
|
|
285
305
|
break;
|
|
286
|
-
case
|
|
287
|
-
if (!(
|
|
306
|
+
case "ArrowUp":
|
|
307
|
+
if (!("continuePropagation" in e)) e.stopPropagation();
|
|
288
308
|
e.preventDefault();
|
|
289
|
-
state.toggle(
|
|
309
|
+
state.toggle("last");
|
|
290
310
|
break;
|
|
291
311
|
}
|
|
292
312
|
};
|
|
293
|
-
let stringFormatter = $fHYTQ$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($5128c2fd7e261f09$exports)));
|
|
294
|
-
let { longPressProps: longPressProps } = $fHYTQ$reactariainteractions.useLongPress({
|
|
295
|
-
isDisabled: isDisabled || trigger !==
|
|
296
|
-
accessibilityDescription: stringFormatter.format(
|
|
313
|
+
let stringFormatter = (0, $fHYTQ$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($5128c2fd7e261f09$exports))));
|
|
314
|
+
let { longPressProps: longPressProps } = (0, $fHYTQ$reactariainteractions.useLongPress)({
|
|
315
|
+
isDisabled: isDisabled || trigger !== "longPress",
|
|
316
|
+
accessibilityDescription: stringFormatter.format("longPressMessage"),
|
|
297
317
|
onLongPressStart () {
|
|
298
318
|
state.close();
|
|
299
319
|
},
|
|
300
320
|
onLongPress () {
|
|
301
|
-
state.open(
|
|
321
|
+
state.open("first");
|
|
302
322
|
}
|
|
303
323
|
});
|
|
304
324
|
let pressProps = {
|
|
305
325
|
onPressStart (e) {
|
|
306
326
|
// For consistency with native, open the menu on mouse/key down, but touch up.
|
|
307
|
-
if (e.pointerType !==
|
|
327
|
+
if (e.pointerType !== "touch" && e.pointerType !== "keyboard" && !isDisabled) // If opened with a screen reader, auto focus the first item.
|
|
308
328
|
// Otherwise, the menu itself will be focused.
|
|
309
|
-
state.toggle(e.pointerType ===
|
|
329
|
+
state.toggle(e.pointerType === "virtual" ? "first" : null);
|
|
310
330
|
},
|
|
311
331
|
onPress (e) {
|
|
312
|
-
if (e.pointerType ===
|
|
332
|
+
if (e.pointerType === "touch" && !isDisabled) state.toggle();
|
|
313
333
|
}
|
|
314
334
|
};
|
|
315
335
|
// omit onPress from triggerProps since we override it above.
|
|
@@ -317,13 +337,13 @@ function $7211ab9328763fb9$export$dc9c12ed27dd1b49(props, state, ref) {
|
|
|
317
337
|
return {
|
|
318
338
|
menuTriggerProps: {
|
|
319
339
|
...triggerProps,
|
|
320
|
-
...trigger ===
|
|
340
|
+
...trigger === "press" ? pressProps : longPressProps,
|
|
321
341
|
id: menuTriggerId,
|
|
322
342
|
onKeyDown: onKeyDown
|
|
323
343
|
},
|
|
324
344
|
menuProps: {
|
|
325
345
|
...overlayProps,
|
|
326
|
-
|
|
346
|
+
"aria-labelledby": menuTriggerId,
|
|
327
347
|
autoFocus: state.focusStrategy || true,
|
|
328
348
|
onClose: state.close
|
|
329
349
|
}
|
|
@@ -331,16 +351,26 @@ function $7211ab9328763fb9$export$dc9c12ed27dd1b49(props, state, ref) {
|
|
|
331
351
|
}
|
|
332
352
|
|
|
333
353
|
|
|
334
|
-
|
|
354
|
+
/*
|
|
355
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
356
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
357
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
358
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
359
|
+
*
|
|
360
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
361
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
362
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
363
|
+
* governing permissions and limitations under the License.
|
|
364
|
+
*/
|
|
335
365
|
|
|
336
366
|
const $a3815f0132802737$export$6f49b4016bfc8d56 = new WeakMap();
|
|
337
367
|
function $a3815f0132802737$export$38eaa17faae8f579(props, state, ref) {
|
|
338
368
|
let { shouldFocusWrap: shouldFocusWrap = true , ...otherProps } = props;
|
|
339
|
-
if (!props[
|
|
340
|
-
let domProps = $fHYTQ$reactariautils.filterDOMProps(props, {
|
|
369
|
+
if (!props["aria-label"] && !props["aria-labelledby"]) console.warn("An aria-label or aria-labelledby prop is required for accessibility.");
|
|
370
|
+
let domProps = (0, $fHYTQ$reactariautils.filterDOMProps)(props, {
|
|
341
371
|
labelable: true
|
|
342
372
|
});
|
|
343
|
-
let { listProps: listProps } = $fHYTQ$reactariaselection.useSelectableList({
|
|
373
|
+
let { listProps: listProps } = (0, $fHYTQ$reactariaselection.useSelectableList)({
|
|
344
374
|
...otherProps,
|
|
345
375
|
ref: ref,
|
|
346
376
|
selectionManager: state.selectionManager,
|
|
@@ -353,15 +383,25 @@ function $a3815f0132802737$export$38eaa17faae8f579(props, state, ref) {
|
|
|
353
383
|
onAction: props.onAction
|
|
354
384
|
});
|
|
355
385
|
return {
|
|
356
|
-
menuProps: $fHYTQ$reactariautils.mergeProps(domProps, {
|
|
357
|
-
role:
|
|
386
|
+
menuProps: (0, $fHYTQ$reactariautils.mergeProps)(domProps, {
|
|
387
|
+
role: "menu",
|
|
358
388
|
...listProps
|
|
359
389
|
})
|
|
360
390
|
};
|
|
361
391
|
}
|
|
362
392
|
|
|
363
393
|
|
|
364
|
-
|
|
394
|
+
/*
|
|
395
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
396
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
397
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
398
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
399
|
+
*
|
|
400
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
401
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
402
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
403
|
+
* governing permissions and limitations under the License.
|
|
404
|
+
*/
|
|
365
405
|
|
|
366
406
|
|
|
367
407
|
|
|
@@ -373,71 +413,71 @@ function $38191ed02615ec07$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
373
413
|
var _isSelected;
|
|
374
414
|
let isSelected = (_isSelected = props.isSelected) !== null && _isSelected !== void 0 ? _isSelected : state.selectionManager.isSelected(key);
|
|
375
415
|
let isFocused = state.selectionManager.focusedKey === key;
|
|
376
|
-
let data = $a3815f0132802737$export$6f49b4016bfc8d56.get(state);
|
|
416
|
+
let data = (0, $a3815f0132802737$export$6f49b4016bfc8d56).get(state);
|
|
377
417
|
let onClose = props.onClose || data.onClose;
|
|
378
418
|
let onAction = props.onAction || data.onAction;
|
|
379
|
-
let role =
|
|
380
|
-
if (state.selectionManager.selectionMode ===
|
|
381
|
-
else if (state.selectionManager.selectionMode ===
|
|
382
|
-
let labelId = $fHYTQ$reactariautils.useSlotId();
|
|
383
|
-
let descriptionId = $fHYTQ$reactariautils.useSlotId();
|
|
384
|
-
let keyboardId = $fHYTQ$reactariautils.useSlotId();
|
|
419
|
+
let role = "menuitem";
|
|
420
|
+
if (state.selectionManager.selectionMode === "single") role = "menuitemradio";
|
|
421
|
+
else if (state.selectionManager.selectionMode === "multiple") role = "menuitemcheckbox";
|
|
422
|
+
let labelId = (0, $fHYTQ$reactariautils.useSlotId)();
|
|
423
|
+
let descriptionId = (0, $fHYTQ$reactariautils.useSlotId)();
|
|
424
|
+
let keyboardId = (0, $fHYTQ$reactariautils.useSlotId)();
|
|
385
425
|
let ariaProps = {
|
|
386
|
-
|
|
426
|
+
"aria-disabled": isDisabled,
|
|
387
427
|
role: role,
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
428
|
+
"aria-label": props["aria-label"],
|
|
429
|
+
"aria-labelledby": labelId,
|
|
430
|
+
"aria-describedby": [
|
|
391
431
|
descriptionId,
|
|
392
432
|
keyboardId
|
|
393
|
-
].filter(Boolean).join(
|
|
433
|
+
].filter(Boolean).join(" ") || undefined
|
|
394
434
|
};
|
|
395
|
-
if (state.selectionManager.selectionMode !==
|
|
435
|
+
if (state.selectionManager.selectionMode !== "none") ariaProps["aria-checked"] = isSelected;
|
|
396
436
|
if (isVirtualized) {
|
|
397
|
-
ariaProps[
|
|
398
|
-
ariaProps[
|
|
437
|
+
ariaProps["aria-posinset"] = state.collection.getItem(key).index;
|
|
438
|
+
ariaProps["aria-setsize"] = (0, $fHYTQ$reactstatelycollections.getItemCount)(state.collection);
|
|
399
439
|
}
|
|
400
440
|
let onKeyDown = (e)=>{
|
|
401
441
|
// Ignore repeating events, which may have started on the menu trigger before moving
|
|
402
442
|
// focus to the menu item. We want to wait for a second complete key press sequence.
|
|
403
443
|
if (e.repeat) return;
|
|
404
444
|
switch(e.key){
|
|
405
|
-
case
|
|
406
|
-
if (!isDisabled && state.selectionManager.selectionMode ===
|
|
445
|
+
case " ":
|
|
446
|
+
if (!isDisabled && state.selectionManager.selectionMode === "none" && closeOnSelect !== false && onClose) onClose();
|
|
407
447
|
break;
|
|
408
|
-
case
|
|
448
|
+
case "Enter":
|
|
409
449
|
// The Enter key should always close on select, except if overridden.
|
|
410
450
|
if (!isDisabled && closeOnSelect !== false && onClose) onClose();
|
|
411
451
|
break;
|
|
412
452
|
}
|
|
413
453
|
};
|
|
414
454
|
let onPressStart = (e)=>{
|
|
415
|
-
if (e.pointerType ===
|
|
455
|
+
if (e.pointerType === "keyboard" && onAction) onAction(key);
|
|
416
456
|
};
|
|
417
457
|
let onPressUp = (e)=>{
|
|
418
|
-
if (e.pointerType !==
|
|
458
|
+
if (e.pointerType !== "keyboard") {
|
|
419
459
|
if (onAction) onAction(key);
|
|
420
460
|
// Pressing a menu item should close by default in single selection mode but not multiple
|
|
421
461
|
// selection mode, except if overridden by the closeOnSelect prop.
|
|
422
|
-
if (onClose && (closeOnSelect !== null && closeOnSelect !== void 0 ? closeOnSelect : state.selectionManager.selectionMode !==
|
|
462
|
+
if (onClose && (closeOnSelect !== null && closeOnSelect !== void 0 ? closeOnSelect : state.selectionManager.selectionMode !== "multiple")) onClose();
|
|
423
463
|
}
|
|
424
464
|
};
|
|
425
|
-
let { itemProps: itemProps } = $fHYTQ$reactariaselection.useSelectableItem({
|
|
465
|
+
let { itemProps: itemProps } = (0, $fHYTQ$reactariaselection.useSelectableItem)({
|
|
426
466
|
selectionManager: state.selectionManager,
|
|
427
467
|
key: key,
|
|
428
468
|
ref: ref,
|
|
429
469
|
shouldSelectOnPressUp: true,
|
|
430
470
|
allowsDifferentPressOrigin: true
|
|
431
471
|
});
|
|
432
|
-
let { pressProps: pressProps , isPressed: isPressed } = $fHYTQ$reactariainteractions.usePress({
|
|
472
|
+
let { pressProps: pressProps , isPressed: isPressed } = (0, $fHYTQ$reactariainteractions.usePress)({
|
|
433
473
|
onPressStart: onPressStart,
|
|
434
474
|
onPressUp: onPressUp,
|
|
435
475
|
isDisabled: isDisabled
|
|
436
476
|
});
|
|
437
|
-
let { hoverProps: hoverProps } = $fHYTQ$reactariainteractions.useHover({
|
|
477
|
+
let { hoverProps: hoverProps } = (0, $fHYTQ$reactariainteractions.useHover)({
|
|
438
478
|
isDisabled: isDisabled,
|
|
439
479
|
onHoverStart () {
|
|
440
|
-
if (
|
|
480
|
+
if (!(0, $fHYTQ$reactariainteractions.isFocusVisible)()) {
|
|
441
481
|
state.selectionManager.setFocused(true);
|
|
442
482
|
state.selectionManager.setFocusedKey(key);
|
|
443
483
|
}
|
|
@@ -446,7 +486,7 @@ function $38191ed02615ec07$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
446
486
|
return {
|
|
447
487
|
menuItemProps: {
|
|
448
488
|
...ariaProps,
|
|
449
|
-
|
|
489
|
+
...(0, $fHYTQ$reactariautils.mergeProps)(itemProps, pressProps, hoverProps, {
|
|
450
490
|
onKeyDown: onKeyDown
|
|
451
491
|
})
|
|
452
492
|
},
|
|
@@ -467,26 +507,35 @@ function $38191ed02615ec07$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
467
507
|
}
|
|
468
508
|
|
|
469
509
|
|
|
470
|
-
|
|
510
|
+
/*
|
|
511
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
512
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
513
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
514
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
515
|
+
*
|
|
516
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
517
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
518
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
519
|
+
* governing permissions and limitations under the License.
|
|
520
|
+
*/
|
|
471
521
|
function $63008655e23408c5$export$73f7a44322579622(props) {
|
|
472
|
-
let { heading: heading ,
|
|
473
|
-
let headingId = $fHYTQ$reactariautils.useId();
|
|
522
|
+
let { heading: heading , "aria-label": ariaLabel } = props;
|
|
523
|
+
let headingId = (0, $fHYTQ$reactariautils.useId)();
|
|
474
524
|
return {
|
|
475
525
|
itemProps: {
|
|
476
|
-
role:
|
|
526
|
+
role: "presentation"
|
|
477
527
|
},
|
|
478
528
|
headingProps: heading ? {
|
|
479
529
|
// Techincally, menus cannot contain headings according to ARIA.
|
|
480
530
|
// We hide the heading from assistive technology, and only use it
|
|
481
531
|
// as a label for the nested group.
|
|
482
532
|
id: headingId,
|
|
483
|
-
|
|
484
|
-
} : {
|
|
485
|
-
},
|
|
533
|
+
"aria-hidden": true
|
|
534
|
+
} : {},
|
|
486
535
|
groupProps: {
|
|
487
|
-
role:
|
|
488
|
-
|
|
489
|
-
|
|
536
|
+
role: "group",
|
|
537
|
+
"aria-label": ariaLabel,
|
|
538
|
+
"aria-labelledby": heading ? headingId : undefined
|
|
490
539
|
}
|
|
491
540
|
};
|
|
492
541
|
}
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AGAA,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,8FAAsD;AAC/F,CAAC;;;;ACDD,yBAAc,GAAG,CAAC;IAA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SAAS;YAAA,CAAC;QAC9D,CAAC;QACD,UAAU,EAAE,CAAC;YACX,EAAE,EAAE,OAAO;QACb,CAAC;QACD,gBAAgB,EAAE,CAAC;YACjB,EAAE,EAAE,aAAa;QACnB,CAAC;QACD,qBAAqB,EAAE,CAAC;YACtB,EAAE,EAAE,UAAU;QAChB,CAAC;mBACD,SAAS;oBACT,UAAU;mBACV,SAAS;oBACT,UAAU;IACZ,CAAC;AACH,CAAC;;;;SC/Ke,yCAAc,CAAC,KAA2B,EAAmB,CAAC;IAC5E,GAAG,CAAC,CAAC,UAAA,OAAO,GAAE,CAAY,aAAE,SAAS,EAAA,CAAC,GAAG,KAAK;IAC9C,GAAG,CAAC,SAAS,GAAG,2BAAK;IAErB,MAAM,CAAC,CAAC;QACN,SAAS,EAAE,CAAC;YACV,IAAI,EAAE,CAAc;QACtB,CAAC;QACD,YAAY,EAAE,OAAO,GAAG,CAAC;YACvB,EAAgE,AAAhE,8DAAgE;YAChE,EAAiE,AAAjE,+DAAiE;YACjE,EAAmC,AAAnC,iCAAmC;YACnC,EAAE,EAAE,SAAS;YACb,CAAa,cAAE,IAAI;QACrB,CAAC,GAAG,CAAC;QAAA,CAAC;QACN,UAAU,EAAE,CAAC;YACX,IAAI,EAAE,CAAO;YACb,CAAY,aAAE,SAAS;YACvB,CAAiB,kBAAE,OAAO,GAAG,SAAS,GAAG,SAAS;QACpD,CAAC;IACH,CAAC;AACH,CAAC;;","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 {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 ...listProps\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 {getItemCount} from '@react-stately/collections';\nimport {isFocusVisible, useHover, usePress} from '@react-aria/interactions';\nimport {Key, RefObject} from 'react';\nimport {menuData} from './useMenu';\nimport {mergeProps, useSlotId} from '@react-aria/utils';\nimport {TreeState} from '@react-stately/tree';\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\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 } = props;\n\n let isDisabled = props.isDisabled ?? state.disabledKeys.has(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n let isFocused = state.selectionManager.focusedKey === key;\n\n let data = menuData.get(state);\n let onClose = props.onClose || data.onClose;\n let onAction = 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,\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 let onKeyDown = (e: KeyboardEvent) => {\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 return;\n }\n\n switch (e.key) {\n case ' ':\n if (!isDisabled && state.selectionManager.selectionMode === 'none' && 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 && onClose) {\n onClose();\n }\n break;\n }\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 (onClose && (closeOnSelect ?? state.selectionManager.selectionMode !== 'multiple')) {\n onClose();\n }\n }\n };\n\n let {itemProps} = 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});\n let {hoverProps} = useHover({\n isDisabled,\n onHoverStart() {\n if (!isFocusVisible()) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n }\n }\n });\n\n return {\n menuItemProps: {\n ...ariaProps,\n ...mergeProps(itemProps, pressProps, hoverProps, {onKeyDown})\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, and only use it\n // as a label for the nested group.\n id: headingId,\n 'aria-hidden': true\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;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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,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 {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 ...listProps\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 {getItemCount} from '@react-stately/collections';\nimport {isFocusVisible, useHover, usePress} from '@react-aria/interactions';\nimport {Key, RefObject} from 'react';\nimport {menuData} from './useMenu';\nimport {mergeProps, useSlotId} from '@react-aria/utils';\nimport {TreeState} from '@react-stately/tree';\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\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 } = props;\n\n let isDisabled = props.isDisabled ?? state.disabledKeys.has(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n let isFocused = state.selectionManager.focusedKey === key;\n\n let data = menuData.get(state);\n let onClose = props.onClose || data.onClose;\n let onAction = 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,\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 let onKeyDown = (e: KeyboardEvent) => {\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 return;\n }\n\n switch (e.key) {\n case ' ':\n if (!isDisabled && state.selectionManager.selectionMode === 'none' && 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 && onClose) {\n onClose();\n }\n break;\n }\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 (onClose && (closeOnSelect ?? state.selectionManager.selectionMode !== 'multiple')) {\n onClose();\n }\n }\n };\n\n let {itemProps} = 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});\n let {hoverProps} = useHover({\n isDisabled,\n onHoverStart() {\n if (!isFocusVisible()) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n }\n }\n });\n\n return {\n menuItemProps: {\n ...ariaProps,\n ...mergeProps(itemProps, pressProps, hoverProps, {onKeyDown})\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, and only use it\n // as a label for the nested group.\n id: headingId,\n 'aria-hidden': true\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.mjs
CHANGED
|
@@ -8,7 +8,27 @@ import {getItemCount as $1Hnir$getItemCount} from "@react-stately/collections";
|
|
|
8
8
|
function $parcel$interopDefault(a) {
|
|
9
9
|
return a && a.__esModule ? a.default : a;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
/*
|
|
12
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
13
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
15
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
18
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
19
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
20
|
+
* governing permissions and limitations under the License.
|
|
21
|
+
*/ /*
|
|
22
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
23
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
24
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
25
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
28
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
29
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
30
|
+
* governing permissions and limitations under the License.
|
|
31
|
+
*/ var $9bdd31893c9700c3$exports = {};
|
|
12
32
|
var $c0398ad35c3639b7$exports = {};
|
|
13
33
|
$c0398ad35c3639b7$exports = {
|
|
14
34
|
"longPressMessage": `اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة`
|
|
@@ -256,52 +276,52 @@ $9bdd31893c9700c3$exports = {
|
|
|
256
276
|
|
|
257
277
|
|
|
258
278
|
function $168583247155ddda$export$dc9c12ed27dd1b49(props, state, ref) {
|
|
259
|
-
let { type: type =
|
|
260
|
-
let menuTriggerId = $1Hnir$useId();
|
|
261
|
-
let { triggerProps: triggerProps , overlayProps: overlayProps } = $1Hnir$useOverlayTrigger({
|
|
279
|
+
let { type: type = "menu" , isDisabled: isDisabled , trigger: trigger = "press" } = props;
|
|
280
|
+
let menuTriggerId = (0, $1Hnir$useId)();
|
|
281
|
+
let { triggerProps: triggerProps , overlayProps: overlayProps } = (0, $1Hnir$useOverlayTrigger)({
|
|
262
282
|
type: type
|
|
263
283
|
}, state, ref);
|
|
264
284
|
let onKeyDown = (e)=>{
|
|
265
285
|
if (isDisabled) return;
|
|
266
|
-
if (trigger ===
|
|
286
|
+
if (trigger === "longPress" && !e.altKey) return;
|
|
267
287
|
if (ref && ref.current) switch(e.key){
|
|
268
|
-
case
|
|
269
|
-
case
|
|
270
|
-
if (trigger ===
|
|
288
|
+
case "Enter":
|
|
289
|
+
case " ":
|
|
290
|
+
if (trigger === "longPress") return;
|
|
271
291
|
// fallthrough
|
|
272
|
-
case
|
|
292
|
+
case "ArrowDown":
|
|
273
293
|
// Stop propagation, unless it would already be handled by useKeyboard.
|
|
274
|
-
if (!(
|
|
294
|
+
if (!("continuePropagation" in e)) e.stopPropagation();
|
|
275
295
|
e.preventDefault();
|
|
276
|
-
state.toggle(
|
|
296
|
+
state.toggle("first");
|
|
277
297
|
break;
|
|
278
|
-
case
|
|
279
|
-
if (!(
|
|
298
|
+
case "ArrowUp":
|
|
299
|
+
if (!("continuePropagation" in e)) e.stopPropagation();
|
|
280
300
|
e.preventDefault();
|
|
281
|
-
state.toggle(
|
|
301
|
+
state.toggle("last");
|
|
282
302
|
break;
|
|
283
303
|
}
|
|
284
304
|
};
|
|
285
|
-
let stringFormatter = $1Hnir$useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($9bdd31893c9700c3$exports)));
|
|
286
|
-
let { longPressProps: longPressProps } = $1Hnir$useLongPress({
|
|
287
|
-
isDisabled: isDisabled || trigger !==
|
|
288
|
-
accessibilityDescription: stringFormatter.format(
|
|
305
|
+
let stringFormatter = (0, $1Hnir$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($9bdd31893c9700c3$exports))));
|
|
306
|
+
let { longPressProps: longPressProps } = (0, $1Hnir$useLongPress)({
|
|
307
|
+
isDisabled: isDisabled || trigger !== "longPress",
|
|
308
|
+
accessibilityDescription: stringFormatter.format("longPressMessage"),
|
|
289
309
|
onLongPressStart () {
|
|
290
310
|
state.close();
|
|
291
311
|
},
|
|
292
312
|
onLongPress () {
|
|
293
|
-
state.open(
|
|
313
|
+
state.open("first");
|
|
294
314
|
}
|
|
295
315
|
});
|
|
296
316
|
let pressProps = {
|
|
297
317
|
onPressStart (e) {
|
|
298
318
|
// For consistency with native, open the menu on mouse/key down, but touch up.
|
|
299
|
-
if (e.pointerType !==
|
|
319
|
+
if (e.pointerType !== "touch" && e.pointerType !== "keyboard" && !isDisabled) // If opened with a screen reader, auto focus the first item.
|
|
300
320
|
// Otherwise, the menu itself will be focused.
|
|
301
|
-
state.toggle(e.pointerType ===
|
|
321
|
+
state.toggle(e.pointerType === "virtual" ? "first" : null);
|
|
302
322
|
},
|
|
303
323
|
onPress (e) {
|
|
304
|
-
if (e.pointerType ===
|
|
324
|
+
if (e.pointerType === "touch" && !isDisabled) state.toggle();
|
|
305
325
|
}
|
|
306
326
|
};
|
|
307
327
|
// omit onPress from triggerProps since we override it above.
|
|
@@ -309,13 +329,13 @@ function $168583247155ddda$export$dc9c12ed27dd1b49(props, state, ref) {
|
|
|
309
329
|
return {
|
|
310
330
|
menuTriggerProps: {
|
|
311
331
|
...triggerProps,
|
|
312
|
-
...trigger ===
|
|
332
|
+
...trigger === "press" ? pressProps : longPressProps,
|
|
313
333
|
id: menuTriggerId,
|
|
314
334
|
onKeyDown: onKeyDown
|
|
315
335
|
},
|
|
316
336
|
menuProps: {
|
|
317
337
|
...overlayProps,
|
|
318
|
-
|
|
338
|
+
"aria-labelledby": menuTriggerId,
|
|
319
339
|
autoFocus: state.focusStrategy || true,
|
|
320
340
|
onClose: state.close
|
|
321
341
|
}
|
|
@@ -323,16 +343,26 @@ function $168583247155ddda$export$dc9c12ed27dd1b49(props, state, ref) {
|
|
|
323
343
|
}
|
|
324
344
|
|
|
325
345
|
|
|
326
|
-
|
|
346
|
+
/*
|
|
347
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
348
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
349
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
350
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
351
|
+
*
|
|
352
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
353
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
354
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
355
|
+
* governing permissions and limitations under the License.
|
|
356
|
+
*/
|
|
327
357
|
|
|
328
358
|
const $d5336fe17ce95402$export$6f49b4016bfc8d56 = new WeakMap();
|
|
329
359
|
function $d5336fe17ce95402$export$38eaa17faae8f579(props, state, ref) {
|
|
330
360
|
let { shouldFocusWrap: shouldFocusWrap = true , ...otherProps } = props;
|
|
331
|
-
if (!props[
|
|
332
|
-
let domProps = $1Hnir$filterDOMProps(props, {
|
|
361
|
+
if (!props["aria-label"] && !props["aria-labelledby"]) console.warn("An aria-label or aria-labelledby prop is required for accessibility.");
|
|
362
|
+
let domProps = (0, $1Hnir$filterDOMProps)(props, {
|
|
333
363
|
labelable: true
|
|
334
364
|
});
|
|
335
|
-
let { listProps: listProps } = $1Hnir$useSelectableList({
|
|
365
|
+
let { listProps: listProps } = (0, $1Hnir$useSelectableList)({
|
|
336
366
|
...otherProps,
|
|
337
367
|
ref: ref,
|
|
338
368
|
selectionManager: state.selectionManager,
|
|
@@ -345,15 +375,25 @@ function $d5336fe17ce95402$export$38eaa17faae8f579(props, state, ref) {
|
|
|
345
375
|
onAction: props.onAction
|
|
346
376
|
});
|
|
347
377
|
return {
|
|
348
|
-
menuProps: $1Hnir$mergeProps(domProps, {
|
|
349
|
-
role:
|
|
378
|
+
menuProps: (0, $1Hnir$mergeProps)(domProps, {
|
|
379
|
+
role: "menu",
|
|
350
380
|
...listProps
|
|
351
381
|
})
|
|
352
382
|
};
|
|
353
383
|
}
|
|
354
384
|
|
|
355
385
|
|
|
356
|
-
|
|
386
|
+
/*
|
|
387
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
388
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
389
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
390
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
391
|
+
*
|
|
392
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
393
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
394
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
395
|
+
* governing permissions and limitations under the License.
|
|
396
|
+
*/
|
|
357
397
|
|
|
358
398
|
|
|
359
399
|
|
|
@@ -365,71 +405,71 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
365
405
|
var _isSelected;
|
|
366
406
|
let isSelected = (_isSelected = props.isSelected) !== null && _isSelected !== void 0 ? _isSelected : state.selectionManager.isSelected(key);
|
|
367
407
|
let isFocused = state.selectionManager.focusedKey === key;
|
|
368
|
-
let data = $d5336fe17ce95402$export$6f49b4016bfc8d56.get(state);
|
|
408
|
+
let data = (0, $d5336fe17ce95402$export$6f49b4016bfc8d56).get(state);
|
|
369
409
|
let onClose = props.onClose || data.onClose;
|
|
370
410
|
let onAction = props.onAction || data.onAction;
|
|
371
|
-
let role =
|
|
372
|
-
if (state.selectionManager.selectionMode ===
|
|
373
|
-
else if (state.selectionManager.selectionMode ===
|
|
374
|
-
let labelId = $1Hnir$useSlotId();
|
|
375
|
-
let descriptionId = $1Hnir$useSlotId();
|
|
376
|
-
let keyboardId = $1Hnir$useSlotId();
|
|
411
|
+
let role = "menuitem";
|
|
412
|
+
if (state.selectionManager.selectionMode === "single") role = "menuitemradio";
|
|
413
|
+
else if (state.selectionManager.selectionMode === "multiple") role = "menuitemcheckbox";
|
|
414
|
+
let labelId = (0, $1Hnir$useSlotId)();
|
|
415
|
+
let descriptionId = (0, $1Hnir$useSlotId)();
|
|
416
|
+
let keyboardId = (0, $1Hnir$useSlotId)();
|
|
377
417
|
let ariaProps = {
|
|
378
|
-
|
|
418
|
+
"aria-disabled": isDisabled,
|
|
379
419
|
role: role,
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
420
|
+
"aria-label": props["aria-label"],
|
|
421
|
+
"aria-labelledby": labelId,
|
|
422
|
+
"aria-describedby": [
|
|
383
423
|
descriptionId,
|
|
384
424
|
keyboardId
|
|
385
|
-
].filter(Boolean).join(
|
|
425
|
+
].filter(Boolean).join(" ") || undefined
|
|
386
426
|
};
|
|
387
|
-
if (state.selectionManager.selectionMode !==
|
|
427
|
+
if (state.selectionManager.selectionMode !== "none") ariaProps["aria-checked"] = isSelected;
|
|
388
428
|
if (isVirtualized) {
|
|
389
|
-
ariaProps[
|
|
390
|
-
ariaProps[
|
|
429
|
+
ariaProps["aria-posinset"] = state.collection.getItem(key).index;
|
|
430
|
+
ariaProps["aria-setsize"] = (0, $1Hnir$getItemCount)(state.collection);
|
|
391
431
|
}
|
|
392
432
|
let onKeyDown = (e)=>{
|
|
393
433
|
// Ignore repeating events, which may have started on the menu trigger before moving
|
|
394
434
|
// focus to the menu item. We want to wait for a second complete key press sequence.
|
|
395
435
|
if (e.repeat) return;
|
|
396
436
|
switch(e.key){
|
|
397
|
-
case
|
|
398
|
-
if (!isDisabled && state.selectionManager.selectionMode ===
|
|
437
|
+
case " ":
|
|
438
|
+
if (!isDisabled && state.selectionManager.selectionMode === "none" && closeOnSelect !== false && onClose) onClose();
|
|
399
439
|
break;
|
|
400
|
-
case
|
|
440
|
+
case "Enter":
|
|
401
441
|
// The Enter key should always close on select, except if overridden.
|
|
402
442
|
if (!isDisabled && closeOnSelect !== false && onClose) onClose();
|
|
403
443
|
break;
|
|
404
444
|
}
|
|
405
445
|
};
|
|
406
446
|
let onPressStart = (e)=>{
|
|
407
|
-
if (e.pointerType ===
|
|
447
|
+
if (e.pointerType === "keyboard" && onAction) onAction(key);
|
|
408
448
|
};
|
|
409
449
|
let onPressUp = (e)=>{
|
|
410
|
-
if (e.pointerType !==
|
|
450
|
+
if (e.pointerType !== "keyboard") {
|
|
411
451
|
if (onAction) onAction(key);
|
|
412
452
|
// Pressing a menu item should close by default in single selection mode but not multiple
|
|
413
453
|
// selection mode, except if overridden by the closeOnSelect prop.
|
|
414
|
-
if (onClose && (closeOnSelect !== null && closeOnSelect !== void 0 ? closeOnSelect : state.selectionManager.selectionMode !==
|
|
454
|
+
if (onClose && (closeOnSelect !== null && closeOnSelect !== void 0 ? closeOnSelect : state.selectionManager.selectionMode !== "multiple")) onClose();
|
|
415
455
|
}
|
|
416
456
|
};
|
|
417
|
-
let { itemProps: itemProps } = $1Hnir$useSelectableItem({
|
|
457
|
+
let { itemProps: itemProps } = (0, $1Hnir$useSelectableItem)({
|
|
418
458
|
selectionManager: state.selectionManager,
|
|
419
459
|
key: key,
|
|
420
460
|
ref: ref,
|
|
421
461
|
shouldSelectOnPressUp: true,
|
|
422
462
|
allowsDifferentPressOrigin: true
|
|
423
463
|
});
|
|
424
|
-
let { pressProps: pressProps , isPressed: isPressed } = $1Hnir$usePress({
|
|
464
|
+
let { pressProps: pressProps , isPressed: isPressed } = (0, $1Hnir$usePress)({
|
|
425
465
|
onPressStart: onPressStart,
|
|
426
466
|
onPressUp: onPressUp,
|
|
427
467
|
isDisabled: isDisabled
|
|
428
468
|
});
|
|
429
|
-
let { hoverProps: hoverProps } = $1Hnir$useHover({
|
|
469
|
+
let { hoverProps: hoverProps } = (0, $1Hnir$useHover)({
|
|
430
470
|
isDisabled: isDisabled,
|
|
431
471
|
onHoverStart () {
|
|
432
|
-
if (
|
|
472
|
+
if (!(0, $1Hnir$isFocusVisible)()) {
|
|
433
473
|
state.selectionManager.setFocused(true);
|
|
434
474
|
state.selectionManager.setFocusedKey(key);
|
|
435
475
|
}
|
|
@@ -438,7 +478,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
438
478
|
return {
|
|
439
479
|
menuItemProps: {
|
|
440
480
|
...ariaProps,
|
|
441
|
-
|
|
481
|
+
...(0, $1Hnir$mergeProps)(itemProps, pressProps, hoverProps, {
|
|
442
482
|
onKeyDown: onKeyDown
|
|
443
483
|
})
|
|
444
484
|
},
|
|
@@ -459,26 +499,35 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
459
499
|
}
|
|
460
500
|
|
|
461
501
|
|
|
462
|
-
|
|
502
|
+
/*
|
|
503
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
504
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
505
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
506
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
507
|
+
*
|
|
508
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
509
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
510
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
511
|
+
* governing permissions and limitations under the License.
|
|
512
|
+
*/
|
|
463
513
|
function $3e5eb2498db5b506$export$73f7a44322579622(props) {
|
|
464
|
-
let { heading: heading ,
|
|
465
|
-
let headingId = $1Hnir$useId();
|
|
514
|
+
let { heading: heading , "aria-label": ariaLabel } = props;
|
|
515
|
+
let headingId = (0, $1Hnir$useId)();
|
|
466
516
|
return {
|
|
467
517
|
itemProps: {
|
|
468
|
-
role:
|
|
518
|
+
role: "presentation"
|
|
469
519
|
},
|
|
470
520
|
headingProps: heading ? {
|
|
471
521
|
// Techincally, menus cannot contain headings according to ARIA.
|
|
472
522
|
// We hide the heading from assistive technology, and only use it
|
|
473
523
|
// as a label for the nested group.
|
|
474
524
|
id: headingId,
|
|
475
|
-
|
|
476
|
-
} : {
|
|
477
|
-
},
|
|
525
|
+
"aria-hidden": true
|
|
526
|
+
} : {},
|
|
478
527
|
groupProps: {
|
|
479
|
-
role:
|
|
480
|
-
|
|
481
|
-
|
|
528
|
+
role: "group",
|
|
529
|
+
"aria-label": ariaLabel,
|
|
530
|
+
"aria-labelledby": heading ? headingId : undefined
|
|
482
531
|
}
|
|
483
532
|
};
|
|
484
533
|
}
|
package/dist/module.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;AGAA,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,8FAAsD;AAC/F,CAAC;;;;ACDD,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,iJAAgF;AACzH,CAAC;;;;ACDD,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,+EAAwE;AACjH,CAAC;;;;ACDD,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,2DAAyD;AAClG,CAAC;;;;ACDD,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,8EAA0E;AACnH,CAAC;;;;ACDD,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,8HAAuE;AAChH,CAAC;;;;ACDD,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,gDAAgD;AACzF,CAAC;;;;ACDD,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,+DAA8D;AACvG,CAAC;;;;ACDD,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,qEAAkE;AAC3G,CAAC;;;;ACDD,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,4EAAwE;AACjH,CAAC;;;;ACDD,yBAAc,GAAG,CAAC;IAAE,CAAkB,oBAAG,8FAAyF;AAClI,CAAC;;;;ACDD,yBAAc,GAAG,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,IAAI;QACrB,CAAC,GAAG,CAAC;QAAA,CAAC;QACN,UAAU,EAAE,CAAC;YACX,IAAI,EAAE,CAAO;YACb,CAAY,aAAE,SAAS;YACvB,CAAiB,kBAAE,OAAO,GAAG,SAAS,GAAG,SAAS;QACpD,CAAC;IACH,CAAC;AACH,CAAC;;","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 {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 ...listProps\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 {getItemCount} from '@react-stately/collections';\nimport {isFocusVisible, useHover, usePress} from '@react-aria/interactions';\nimport {Key, RefObject} from 'react';\nimport {menuData} from './useMenu';\nimport {mergeProps, useSlotId} from '@react-aria/utils';\nimport {TreeState} from '@react-stately/tree';\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\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 } = props;\n\n let isDisabled = props.isDisabled ?? state.disabledKeys.has(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n let isFocused = state.selectionManager.focusedKey === key;\n\n let data = menuData.get(state);\n let onClose = props.onClose || data.onClose;\n let onAction = 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,\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 let onKeyDown = (e: KeyboardEvent) => {\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 return;\n }\n\n switch (e.key) {\n case ' ':\n if (!isDisabled && state.selectionManager.selectionMode === 'none' && 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 && onClose) {\n onClose();\n }\n break;\n }\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 (onClose && (closeOnSelect ?? state.selectionManager.selectionMode !== 'multiple')) {\n onClose();\n }\n }\n };\n\n let {itemProps} = 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});\n let {hoverProps} = useHover({\n isDisabled,\n onHoverStart() {\n if (!isFocusVisible()) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n }\n }\n });\n\n return {\n menuItemProps: {\n ...ariaProps,\n ...mergeProps(itemProps, pressProps, hoverProps, {onKeyDown})\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, and only use it\n // as a label for the nested group.\n id: headingId,\n 'aria-hidden': true\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaL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AG,CAAA,GAAA,iBAAS,EAAE,WAAW,YAAY,YAAY;2BAAC;YAAS,EAAE;QAC/D;QACA,YAAY;YACV,IAAI;QACN;QACA,kBAAkB;YAChB,IAAI;QACN;QACA,uBAAuB;YACrB,IAAI;QACN;mBACA;oBACA;mBACA;oBACA;IACF;AACF;;;ACtNA;;;;;;;;;;CAUC,GAED;AA2BO,SAAS,0CAAe,KAA2B,EAAmB;IAC3E,IAAI,WAAC,QAAO,EAAE,cAAc,UAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,YAAK,AAAD;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UAAU;YACtB,gEAAgE;YAChE,iEAAiE;YACjE,mCAAmC;YACnC,IAAI;YACJ,eAAe,IAAI;QACrB,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 {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 ...listProps\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 {getItemCount} from '@react-stately/collections';\nimport {isFocusVisible, useHover, usePress} from '@react-aria/interactions';\nimport {Key, RefObject} from 'react';\nimport {menuData} from './useMenu';\nimport {mergeProps, useSlotId} from '@react-aria/utils';\nimport {TreeState} from '@react-stately/tree';\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\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 } = props;\n\n let isDisabled = props.isDisabled ?? state.disabledKeys.has(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n let isFocused = state.selectionManager.focusedKey === key;\n\n let data = menuData.get(state);\n let onClose = props.onClose || data.onClose;\n let onAction = 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,\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 let onKeyDown = (e: KeyboardEvent) => {\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 return;\n }\n\n switch (e.key) {\n case ' ':\n if (!isDisabled && state.selectionManager.selectionMode === 'none' && 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 && onClose) {\n onClose();\n }\n break;\n }\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 (onClose && (closeOnSelect ?? state.selectionManager.selectionMode !== 'multiple')) {\n onClose();\n }\n }\n };\n\n let {itemProps} = 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});\n let {hoverProps} = useHover({\n isDisabled,\n onHoverStart() {\n if (!isFocusVisible()) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n }\n }\n });\n\n return {\n menuItemProps: {\n ...ariaProps,\n ...mergeProps(itemProps, pressProps, hoverProps, {onKeyDown})\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, and only use it\n // as a label for the nested group.\n id: headingId,\n 'aria-hidden': true\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.mjs.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/menu",
|
|
3
|
-
"version": "3.7.1-nightly.
|
|
3
|
+
"version": "3.7.1-nightly.3600+bfce84fee",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@react-aria/
|
|
27
|
-
"@react-aria/
|
|
28
|
-
"@react-aria/
|
|
29
|
-
"@react-aria/
|
|
30
|
-
"@react-
|
|
31
|
-
"@react-stately/
|
|
32
|
-
"@react-stately/
|
|
33
|
-
"@react-
|
|
34
|
-
"@react-types/
|
|
35
|
-
"@react-types/
|
|
36
|
-
"@
|
|
25
|
+
"@react-aria/i18n": "3.0.0-nightly.1900+bfce84fee",
|
|
26
|
+
"@react-aria/interactions": "3.0.0-nightly.1900+bfce84fee",
|
|
27
|
+
"@react-aria/overlays": "3.0.0-nightly.1900+bfce84fee",
|
|
28
|
+
"@react-aria/selection": "3.0.0-nightly.1900+bfce84fee",
|
|
29
|
+
"@react-aria/utils": "3.0.0-nightly.1900+bfce84fee",
|
|
30
|
+
"@react-stately/collections": "3.0.0-nightly.1900+bfce84fee",
|
|
31
|
+
"@react-stately/menu": "3.4.4-nightly.3600+bfce84fee",
|
|
32
|
+
"@react-stately/tree": "3.0.0-nightly.1900+bfce84fee",
|
|
33
|
+
"@react-types/button": "3.7.1-nightly.3600+bfce84fee",
|
|
34
|
+
"@react-types/menu": "3.7.4-nightly.3600+bfce84fee",
|
|
35
|
+
"@react-types/shared": "3.0.0-nightly.1900+bfce84fee",
|
|
36
|
+
"@swc/helpers": "^0.4.14"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "bfce84fee12a027d9cbc38b43e1747e3e4b4b169"
|
|
46
46
|
}
|