@eightshift/ui-components 2.0.2 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Button-OQ5EIPvt.js → Button-BPLceDeW.js} +5 -5
- package/dist/{Collection-CJM_asJz.js → Collection-CZxddMZS.js} +241 -135
- package/dist/{Color-B0HgM8f4.js → Color-MV5kBVXr.js} +1 -1
- package/dist/{ColorSwatch-Dv3Wxdl_.js → ColorSwatch-BqQfVu4L.js} +5 -5
- package/dist/{ComboBox-BnlZjJ3T.js → ComboBox-_RfyhwZw.js} +42 -21
- package/dist/{Dialog-CIh-hX93.js → Dialog-8tYeQ9n4.js} +202 -91
- package/dist/{FieldError-D7A6s7O5.js → FieldError-52GVSGgC.js} +2 -2
- package/dist/{FocusScope-Cs5_OoeA.js → FocusScope-Cri5BFRz.js} +206 -43
- package/dist/{Group-D6tr3U_n.js → Group-_emcIVxI.js} +3 -3
- package/dist/{Heading-DiYTXoIW.js → Heading-B2153VXe.js} +1 -1
- package/dist/{Hidden-DnOd_jPX.js → Hidden-rE6uR-lr.js} +2 -6
- package/dist/{Input-Se0m3ubj.js → Input-BxpFEIXV.js} +10 -10
- package/dist/{Label-Ca9uelsn.js → Label-icmbmNdI.js} +2 -2
- package/dist/{List-Br274SP1.js → List-CZMUbkFU.js} +3 -1
- package/dist/{ListBox-D9dFEh5A.js → ListBox-Ca6hiCqz.js} +29 -28
- package/dist/{OverlayArrow-1jx-ZyCR.js → OverlayArrow-CYXQSlEU.js} +7 -7
- package/dist/{Select-aab027f3.esm-HFNIFFya.js → Select-aab027f3.esm-PDJCDE95.js} +2 -2
- package/dist/{Separator-BhZycTUp.js → Separator-4IIDRlV_.js} +4 -4
- package/dist/{Slider-BZNaJylD.js → Slider-rz2XRMGm.js} +15 -16
- package/dist/{Text-aOUPPvTO.js → Text-DVSAPY-K.js} +1 -1
- package/dist/{VisuallyHidden-ClTQo25k.js → VisuallyHidden-f9zX67a_.js} +2 -2
- package/dist/assets/style-admin.css +1289 -1338
- package/dist/assets/style-editor.css +433 -482
- package/dist/assets/style.css +433 -482
- package/dist/assets/wp-font-enhancements.css +3 -3
- package/dist/assets/wp-ui-enhancements.css +45 -45
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +6 -6
- package/dist/components/checkbox/checkbox.js +13 -10
- package/dist/components/color-pickers/color-picker.js +1 -1
- package/dist/components/color-pickers/color-swatch.js +3 -3
- package/dist/components/color-pickers/gradient-editor.js +4 -4
- package/dist/components/color-pickers/solid-color-picker.js +22 -24
- package/dist/components/component-toggle/component-toggle.js +1 -1
- package/dist/components/container-panel/container-panel.js +9 -3
- package/dist/components/draggable/draggable-handle.js +2 -2
- package/dist/components/draggable/draggable.js +1167 -871
- package/dist/components/draggable-list/draggable-list-item.js +2 -2
- package/dist/components/draggable-list/draggable-list.js +2 -2
- package/dist/components/expandable/expandable.js +9 -9
- package/dist/components/input-field/input-field.js +10 -9
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +9 -10
- package/dist/components/matrix-align/matrix-align.js +2 -2
- package/dist/components/menu/menu.js +3 -3
- package/dist/components/modal/modal.js +7 -7
- package/dist/components/number-picker/number-picker.js +15 -13
- package/dist/components/option-select/option-select.js +1 -1
- package/dist/components/options-panel/options-panel.js +1 -1
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/placeholders/image-placeholder.js +1 -1
- package/dist/components/popover/popover.js +2 -2
- package/dist/components/radio/radio.js +20 -17
- package/dist/components/repeater/repeater-item.js +10 -3
- package/dist/components/repeater/repeater.js +34 -5
- package/dist/components/responsive/mini-responsive.js +8 -5
- package/dist/components/responsive/responsive-legacy.js +2 -2
- package/dist/components/responsive/responsive.js +10 -7
- package/dist/components/responsive-preview/responsive-preview.js +1 -1
- package/dist/components/rich-label/rich-label.js +4 -3
- package/dist/components/select/async-multi-select.js +4 -4
- package/dist/components/select/async-single-select.js +3 -3
- package/dist/components/select/custom-select-default-components.js +1 -1
- package/dist/components/select/multi-select-components.js +3 -3
- package/dist/components/select/multi-select.js +4 -4
- package/dist/components/select/react-select-component-wrappers.js +1 -1
- package/dist/components/select/single-select.js +3 -3
- package/dist/components/select/v2/async-select.js +10 -10
- package/dist/components/select/v2/shared.js +2 -2
- package/dist/components/select/v2/single-select.js +24 -23
- package/dist/components/slider/column-config-slider.js +3 -3
- package/dist/components/slider/slider.js +3 -3
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/tabs/tabs.js +46 -26
- package/dist/components/toggle/switch.js +7 -7
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +6 -6
- package/dist/components/tooltip/tooltip.js +18 -24
- package/dist/{context-CDOs-GuR.js → context-D2KUdwNL.js} +1 -1
- package/dist/{default-i18n-CM1-Xvzf.js → default-i18n-CT_oS1Fy.js} +22 -3
- package/dist/icons/icons.js +229 -1629
- package/dist/icons/index.js +2 -3
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/{index-641ee5b8.esm-DbdaYaxR.js → index-641ee5b8.esm-DIuJijyT.js} +31 -31
- package/dist/{index-CcCn9HWX.js → index-BKGQ6jGS.js} +1 -1
- package/dist/{index-BRp93Yfa.js → index-CFozsmNS.js} +4 -1
- package/dist/{multi-select-components-DJfz929p.js → multi-select-components-Sp-JEFEX.js} +4 -4
- package/dist/{react-jsx-parser.min-CVit0rZn.js → react-jsx-parser.min-DZCiis5V.js} +48 -20
- package/dist/{react-select-async.esm-DcVLw9X5.js → react-select-async.esm-Bql4G5iV.js} +3 -3
- package/dist/{react-select.esm-OZ0cmTjg.js → react-select.esm-B_TudhTU.js} +3 -3
- package/dist/{textSelection-BlTDSskG.js → textSelection-0UUS8Yfg.js} +8 -47
- package/dist/{useButton-CmLbE5vg.js → useButton-Cg474OYB.js} +5 -5
- package/dist/{useEvent-cLDJlznQ.js → useEvent-B0b-6KBr.js} +1 -1
- package/dist/useFocusRing-CV5l3lf6.js +107 -0
- package/dist/{useFormReset-NpLM2e3G.js → useFormReset-C5OggHsw.js} +1 -1
- package/dist/{useFormValidation-BWwmZQE2.js → useFormValidation-DhDNSjws.js} +3 -3
- package/dist/{focusSafely-CiqTTjWy.js → useHover-DwDr6ozG.js} +305 -98
- package/dist/{useLabel-C85N3Hzw.js → useLabel-D7HkNEHT.js} +2 -2
- package/dist/{useLabels-C_2wWraB.js → useLabels-D8cxd1Z8.js} +1 -1
- package/dist/{useListState-Z7FB_NzO.js → useListState-DVr6aYd_.js} +28 -13
- package/dist/{useLocalizedStringFormatter-BQ4TF72x.js → useLocalizedStringFormatter-CFP1YZWQ.js} +1 -1
- package/dist/{useNumberField-Bm6_BVl9.js → useNumberField-TwM0Z9D1.js} +10 -10
- package/dist/{useNumberFormatter-DlUVKkO7.js → useNumberFormatter-321rAb4J.js} +1 -1
- package/dist/{usePress-rg_OQIGW.js → usePress-Cucx-xSA.js} +69 -63
- package/dist/{useSingleSelectListState-Cu3xtEJS.js → useSingleSelectListState-CMGsRHHh.js} +2 -2
- package/dist/{useToggle-DzlgBLAJ.js → useToggle-C0I3vs0g.js} +9 -7
- package/dist/{useToggleState-DhSBQxkp.js → useToggleState-CmQX3SoX.js} +1 -1
- package/dist/{utils-39D0mStj.js → utils-DkCSC521.js} +38 -35
- package/package.json +32 -32
- package/dist/useFocusRing-CGp3guTX.js +0 -41
- package/dist/useFocusable-087cO5Ct.js +0 -81
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "./Button-
|
|
2
|
-
import {
|
|
1
|
+
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "./Button-BPLceDeW.js";
|
|
2
|
+
import { l as $df56164dff5785e2$export$4338b53315abf666, d as $3ef42575df84b30b$export$9d1611c77c2fe928, f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, e as $bdb11010cef70236$export$f680877a34711e37, k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, p as $ff5963eb1fccf552$export$e08e3b67e392101e, n as $b5e257d569688ac6$export$535bd6ca7f90a273, j as $bdb11010cef70236$export$b4cc09c592e8fdb8, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, o as $64fa3d84918910a7$export$c62b8e45d58ddad9, m as $5dc95899b306f630$export$c9058316764c140e, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 } from "./utils-DkCSC521.js";
|
|
3
3
|
import { $ as $4e85f108e88277b8$export$d688439359537581 } from "./RSPContexts-2lR5GG9p.js";
|
|
4
|
-
import { g as $dd149f63282afbbf$export$f6211563215e3b37, c as $2a41e45df1593e64$export$d39e1813b3bdd0e1, f as $9daab02d461809db$export$683480f191c0e3ea,
|
|
5
|
-
import {
|
|
6
|
-
import { b as $982254629710d113$export$b95089534ab7c1fd, c as $453cc9f0df89c0a5$export$77d5aafae4e095b2, d as $d2f53cda644affe3$export$65d2a03b8800d6e3, g as $431f98aba6844401$export$6615d83f6de245ce, h as $72a5793c14baf454$export$e0e4026c12a8bdbb } from "./Separator-
|
|
4
|
+
import { g as $dd149f63282afbbf$export$f6211563215e3b37, c as $2a41e45df1593e64$export$d39e1813b3bdd0e1, f as $9daab02d461809db$export$683480f191c0e3ea, $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, b as $d3f049242431219c$export$6d3443f2c48bfc20, d as $44f671af83e7d9e0$export$2de4954e8ae13b9f } from "./OverlayArrow-CYXQSlEU.js";
|
|
5
|
+
import { j as $cc38e7bd3fc7b213$export$2bb74740c4e19def, q as $8a26561d2877236e$export$c24ed0104d07eab9, c as $880e95eb8b93ba9a$export$ecf600387e221c37, $ as $7af3f5b51489e0b5$export$253fe78d46329472, a as $7613b1592d41b092$export$6cd28814d92fa9c9, b as $d496c0a20b6e58ec$export$6c8a5aaad13c9852, d as $e1995378a142960e$export$18af5c7a9e9b3664, r as $e1995378a142960e$export$e953bb1cd0f19726, e as $e1995378a142960e$export$bf788dd355e3a401, f as $e1995378a142960e$export$fb8073518f34e6ec, g as $7135fc7d473fd974$export$4feb769f8ddf26c5, h as $7135fc7d473fd974$export$d40e14dec8b060a8, n as $7135fc7d473fd974$export$90e00781bc59d8f9 } from "./Collection-CZxddMZS.js";
|
|
6
|
+
import { b as $982254629710d113$export$b95089534ab7c1fd, c as $453cc9f0df89c0a5$export$77d5aafae4e095b2, d as $d2f53cda644affe3$export$65d2a03b8800d6e3, g as $431f98aba6844401$export$6615d83f6de245ce, h as $72a5793c14baf454$export$e0e4026c12a8bdbb } from "./Separator-4IIDRlV_.js";
|
|
7
7
|
import React__default, { useRef, useContext, useEffect, useMemo, createContext, useState, useCallback, forwardRef } from "react";
|
|
8
|
-
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "./Text-
|
|
8
|
+
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "./Text-DVSAPY-K.js";
|
|
9
9
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
10
|
-
import { d as $ae1eeba8b9eafd08$export$5165eccb35aaadb5, b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, $ as $f6c31cce2adf654f$export$45712eceda6fad21, a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 } from "./usePress-
|
|
11
|
-
import {
|
|
12
|
-
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-
|
|
13
|
-
import {
|
|
14
|
-
import { $ as $
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { $ as $
|
|
20
|
-
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "./VisuallyHidden-ClTQo25k.js";
|
|
10
|
+
import { d as $ae1eeba8b9eafd08$export$5165eccb35aaadb5, b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, $ as $f6c31cce2adf654f$export$45712eceda6fad21, a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 } from "./usePress-Cucx-xSA.js";
|
|
11
|
+
import { H as $e7801be82b4b2a53$export$4debdb1a3f0fa79e, d as $431fbd86ca7dc216$export$b204af158042fbac, c as $c87311424ea30a05$export$fedb369cb70207f1, y as $7215afc6de606d6b$export$de79e2c695e052f3, $ as $6179b936705e76d3$export$ae780daf29e6d456, m as $507fabe10e71c6fb$export$b9b3dfddab17db27, z as $46d819fcbaf35654$export$8f71654801c2f7cd, o as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, L as $507fabe10e71c6fb$export$98e20ec92f614cfe, t as $3ad3f6e1647bc98d$export$80f3e147d781571c, b as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./useHover-DwDr6ozG.js";
|
|
12
|
+
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-CFP1YZWQ.js";
|
|
13
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-D2KUdwNL.js";
|
|
14
|
+
import { c as $9bf71ea28793e738$export$1258395f99bf9cbf, b as $9bf71ea28793e738$export$20e40289641fbbb6 } from "./FocusScope-Cri5BFRz.js";
|
|
15
|
+
import { $ as $dbSRa$reactdom } from "./index-CFozsmNS.js";
|
|
16
|
+
import { b as $f39a9eba43920ace$export$b5d7cc18bb8d2b59 } from "./Hidden-rE6uR-lr.js";
|
|
17
|
+
import { a as $9ab94262bd0047c7$export$420e68273165f4ec } from "./useFocusRing-CV5l3lf6.js";
|
|
18
|
+
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "./useLabels-D8cxd1Z8.js";
|
|
19
|
+
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "./VisuallyHidden-f9zX67a_.js";
|
|
21
20
|
function $62d8ded9296f3872$export$cfa2225e87938781(node, checkForOverflow) {
|
|
22
21
|
let scrollableNode = node;
|
|
23
22
|
if ($cc38e7bd3fc7b213$export$2bb74740c4e19def(scrollableNode, checkForOverflow)) scrollableNode = scrollableNode.parentElement;
|
|
@@ -123,17 +122,20 @@ function $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {
|
|
|
123
122
|
if (!ownerDocument || !ownerDocument.documentElement.contains(event.target)) return false;
|
|
124
123
|
if (event.target.closest("[data-react-aria-top-layer]")) return false;
|
|
125
124
|
}
|
|
126
|
-
|
|
125
|
+
if (!ref.current) return false;
|
|
126
|
+
return !event.composedPath().includes(ref.current);
|
|
127
127
|
}
|
|
128
128
|
const $a11501f3d1d39e6c$var$visibleOverlays = [];
|
|
129
129
|
function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
130
130
|
let { onClose, shouldCloseOnBlur, isOpen, isDismissable = false, isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside } = props;
|
|
131
131
|
useEffect(() => {
|
|
132
|
-
if (isOpen
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
if (isOpen && !$a11501f3d1d39e6c$var$visibleOverlays.includes(ref)) {
|
|
133
|
+
$a11501f3d1d39e6c$var$visibleOverlays.push(ref);
|
|
134
|
+
return () => {
|
|
135
|
+
let index = $a11501f3d1d39e6c$var$visibleOverlays.indexOf(ref);
|
|
136
|
+
if (index >= 0) $a11501f3d1d39e6c$var$visibleOverlays.splice(index, 1);
|
|
137
|
+
};
|
|
138
|
+
}
|
|
137
139
|
}, [
|
|
138
140
|
isOpen,
|
|
139
141
|
ref
|
|
@@ -595,6 +597,8 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
595
597
|
subtree: true
|
|
596
598
|
});
|
|
597
599
|
let observerWrapper = {
|
|
600
|
+
visibleNodes,
|
|
601
|
+
hiddenNodes,
|
|
598
602
|
observe() {
|
|
599
603
|
observer.observe(root, {
|
|
600
604
|
childList: true,
|
|
@@ -622,35 +626,49 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
622
626
|
} else $5e3802645cc19319$var$observerStack.splice($5e3802645cc19319$var$observerStack.indexOf(observerWrapper), 1);
|
|
623
627
|
};
|
|
624
628
|
}
|
|
629
|
+
function $5e3802645cc19319$export$1020fa7f77e17884(element) {
|
|
630
|
+
let observer = $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1];
|
|
631
|
+
if (observer && !observer.visibleNodes.has(element)) {
|
|
632
|
+
observer.visibleNodes.add(element);
|
|
633
|
+
return () => {
|
|
634
|
+
observer.visibleNodes.delete(element);
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
}
|
|
625
638
|
function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
|
|
626
|
-
let { triggerRef, popoverRef, isNonModal, isKeyboardDismissDisabled, shouldCloseOnInteractOutside, ...otherProps } = props;
|
|
639
|
+
let { triggerRef, popoverRef, groupRef, isNonModal, isKeyboardDismissDisabled, shouldCloseOnInteractOutside, ...otherProps } = props;
|
|
640
|
+
let isSubmenu = otherProps["trigger"] === "SubmenuTrigger";
|
|
627
641
|
let { overlayProps, underlayProps } = $a11501f3d1d39e6c$export$ea8f71083e90600f({
|
|
628
|
-
|
|
629
|
-
isOpen: state.isOpen && !otherProps["data-react-aria-top-layer"],
|
|
642
|
+
isOpen: state.isOpen,
|
|
630
643
|
onClose: state.close,
|
|
631
644
|
shouldCloseOnBlur: true,
|
|
632
|
-
isDismissable: !isNonModal,
|
|
645
|
+
isDismissable: !isNonModal || isSubmenu,
|
|
633
646
|
isKeyboardDismissDisabled,
|
|
634
647
|
shouldCloseOnInteractOutside
|
|
635
|
-
}, popoverRef);
|
|
648
|
+
}, groupRef !== null && groupRef !== void 0 ? groupRef : popoverRef);
|
|
636
649
|
let { overlayProps: positionProps, arrowProps, placement } = $2a41e45df1593e64$export$d39e1813b3bdd0e1({
|
|
637
650
|
...otherProps,
|
|
638
651
|
targetRef: triggerRef,
|
|
639
652
|
overlayRef: popoverRef,
|
|
640
653
|
isOpen: state.isOpen,
|
|
641
|
-
onClose: isNonModal ? state.close : null
|
|
654
|
+
onClose: isNonModal && !isSubmenu ? state.close : null
|
|
642
655
|
});
|
|
643
656
|
$49c51c25361d4cd2$export$ee0f7cc6afcd1c18({
|
|
644
657
|
isDisabled: isNonModal || !state.isOpen
|
|
645
658
|
});
|
|
646
659
|
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
647
|
-
if (state.isOpen &&
|
|
648
|
-
|
|
649
|
-
|
|
660
|
+
if (state.isOpen && popoverRef.current) {
|
|
661
|
+
var _groupRef_current, _groupRef_current1;
|
|
662
|
+
if (isNonModal) return $5e3802645cc19319$export$1020fa7f77e17884((_groupRef_current = groupRef === null || groupRef === void 0 ? void 0 : groupRef.current) !== null && _groupRef_current !== void 0 ? _groupRef_current : popoverRef.current);
|
|
663
|
+
else return $5e3802645cc19319$export$1c3ebcada18427bf([
|
|
664
|
+
(_groupRef_current1 = groupRef === null || groupRef === void 0 ? void 0 : groupRef.current) !== null && _groupRef_current1 !== void 0 ? _groupRef_current1 : popoverRef.current
|
|
665
|
+
]);
|
|
666
|
+
}
|
|
650
667
|
}, [
|
|
651
668
|
isNonModal,
|
|
652
669
|
state.isOpen,
|
|
653
|
-
popoverRef
|
|
670
|
+
popoverRef,
|
|
671
|
+
groupRef
|
|
654
672
|
]);
|
|
655
673
|
return {
|
|
656
674
|
popoverProps: $3ef42575df84b30b$export$9d1611c77c2fe928(overlayProps, positionProps),
|
|
@@ -682,7 +700,7 @@ function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
|
|
|
682
700
|
let contents = props.children;
|
|
683
701
|
if (!props.disableFocusManagement) contents = /* @__PURE__ */ React__default.createElement($9bf71ea28793e738$export$20e40289641fbbb6, {
|
|
684
702
|
restoreFocus: true,
|
|
685
|
-
contain: contain && !isExiting
|
|
703
|
+
contain: (props.shouldContainFocus || contain) && !isExiting
|
|
686
704
|
}, contents);
|
|
687
705
|
contents = /* @__PURE__ */ React__default.createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
|
|
688
706
|
value: contextValue
|
|
@@ -914,9 +932,12 @@ function $168583247155ddda$export$dc9c12ed27dd1b49(props, state, ref) {
|
|
|
914
932
|
}
|
|
915
933
|
});
|
|
916
934
|
let pressProps = {
|
|
935
|
+
preventFocusOnPress: true,
|
|
917
936
|
onPressStart(e) {
|
|
918
|
-
if (e.pointerType !== "touch" && e.pointerType !== "keyboard" && !isDisabled)
|
|
937
|
+
if (e.pointerType !== "touch" && e.pointerType !== "keyboard" && !isDisabled) {
|
|
938
|
+
$7215afc6de606d6b$export$de79e2c695e052f3(e.target);
|
|
919
939
|
state.open(e.pointerType === "virtual" ? "first" : null);
|
|
940
|
+
}
|
|
920
941
|
},
|
|
921
942
|
onPress(e) {
|
|
922
943
|
if (e.pointerType === "touch" && !isDisabled) state.toggle();
|
|
@@ -1070,7 +1091,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
1070
1091
|
let { hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456({
|
|
1071
1092
|
isDisabled,
|
|
1072
1093
|
onHoverStart(e) {
|
|
1073
|
-
if (!$507fabe10e71c6fb$export$b9b3dfddab17db27() && !(isTriggerExpanded && hasPopup
|
|
1094
|
+
if (!$507fabe10e71c6fb$export$b9b3dfddab17db27() && !(isTriggerExpanded && hasPopup)) {
|
|
1074
1095
|
selectionManager.setFocused(true);
|
|
1075
1096
|
selectionManager.setFocusedKey(key);
|
|
1076
1097
|
}
|
|
@@ -1111,12 +1132,25 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
1111
1132
|
return {
|
|
1112
1133
|
menuItemProps: {
|
|
1113
1134
|
...ariaProps,
|
|
1114
|
-
...$3ef42575df84b30b$export$9d1611c77c2fe928(
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1135
|
+
...$3ef42575df84b30b$export$9d1611c77c2fe928(
|
|
1136
|
+
domProps,
|
|
1137
|
+
linkProps,
|
|
1138
|
+
isTrigger ? {
|
|
1139
|
+
onFocus: itemProps.onFocus,
|
|
1140
|
+
"data-collection": itemProps["data-collection"],
|
|
1141
|
+
"data-key": itemProps["data-key"]
|
|
1142
|
+
} : itemProps,
|
|
1143
|
+
pressProps,
|
|
1144
|
+
hoverProps,
|
|
1145
|
+
keyboardProps,
|
|
1146
|
+
focusProps,
|
|
1147
|
+
// Prevent DOM focus from moving on mouse down when using virtual focus or this is a submenu/subdialog trigger.
|
|
1148
|
+
data.shouldUseVirtualFocus || isTrigger ? {
|
|
1149
|
+
onMouseDown: (e) => e.preventDefault()
|
|
1150
|
+
} : void 0
|
|
1151
|
+
),
|
|
1118
1152
|
// If a submenu is expanded, set the tabIndex to -1 so that shift tabbing goes out of the menu instead of the parent menu item.
|
|
1119
|
-
tabIndex: itemProps.tabIndex != null && isTriggerExpanded ? -1 : itemProps.tabIndex
|
|
1153
|
+
tabIndex: itemProps.tabIndex != null && isTriggerExpanded && !data.shouldUseVirtualFocus ? -1 : itemProps.tabIndex
|
|
1120
1154
|
},
|
|
1121
1155
|
labelProps: {
|
|
1122
1156
|
id: labelId
|
|
@@ -1128,6 +1162,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
1128
1162
|
id: keyboardId
|
|
1129
1163
|
},
|
|
1130
1164
|
isFocused,
|
|
1165
|
+
isFocusVisible: isFocused && selectionManager.isFocused && $507fabe10e71c6fb$export$b9b3dfddab17db27() && !isTriggerExpanded,
|
|
1131
1166
|
isSelected,
|
|
1132
1167
|
isPressed,
|
|
1133
1168
|
isDisabled
|
|
@@ -1184,6 +1219,9 @@ function $d275435c250248f8$export$85ec83e04c95f50a(options) {
|
|
|
1184
1219
|
prevPointerPos.current = void 0;
|
|
1185
1220
|
};
|
|
1186
1221
|
let modality = $507fabe10e71c6fb$export$98e20ec92f614cfe();
|
|
1222
|
+
let onPointerDown = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
|
|
1223
|
+
if (preventPointerEvents) e.preventDefault();
|
|
1224
|
+
});
|
|
1187
1225
|
useEffect(() => {
|
|
1188
1226
|
if (preventPointerEvents && menuRef.current) menuRef.current.style.pointerEvents = "none";
|
|
1189
1227
|
else menuRef.current.style.pointerEvents = "";
|
|
@@ -1246,8 +1284,10 @@ function $d275435c250248f8$export$85ec83e04c95f50a(options) {
|
|
|
1246
1284
|
}, $d275435c250248f8$var$TIMEOUT_TIME);
|
|
1247
1285
|
};
|
|
1248
1286
|
window.addEventListener("pointermove", onPointerMove);
|
|
1287
|
+
window.addEventListener("pointerdown", onPointerDown, true);
|
|
1249
1288
|
return () => {
|
|
1250
1289
|
window.removeEventListener("pointermove", onPointerMove);
|
|
1290
|
+
window.removeEventListener("pointerdown", onPointerDown, true);
|
|
1251
1291
|
clearTimeout(timeout.current);
|
|
1252
1292
|
clearTimeout(autoCloseTimeout.current);
|
|
1253
1293
|
movementsTowardsSubmenuCount.current = $d275435c250248f8$var$ALLOWED_INVALID_MOVEMENTS;
|
|
@@ -1258,11 +1298,12 @@ function $d275435c250248f8$export$85ec83e04c95f50a(options) {
|
|
|
1258
1298
|
menuRef,
|
|
1259
1299
|
modality,
|
|
1260
1300
|
setPreventPointerEvents,
|
|
1301
|
+
onPointerDown,
|
|
1261
1302
|
submenuRef
|
|
1262
1303
|
]);
|
|
1263
1304
|
}
|
|
1264
1305
|
function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
|
|
1265
|
-
let { parentMenuRef, submenuRef, type = "menu", isDisabled, delay = 200 } = props;
|
|
1306
|
+
let { parentMenuRef, submenuRef, type = "menu", isDisabled, delay = 200, shouldUseVirtualFocus } = props;
|
|
1266
1307
|
let submenuTriggerId = $bdb11010cef70236$export$f680877a34711e37();
|
|
1267
1308
|
let overlayId = $bdb11010cef70236$export$f680877a34711e37();
|
|
1268
1309
|
let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
@@ -1291,26 +1332,31 @@ function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
|
|
|
1291
1332
|
cancelOpenTimeout
|
|
1292
1333
|
]);
|
|
1293
1334
|
let submenuKeyDown = (e) => {
|
|
1335
|
+
if (!e.currentTarget.contains(document.activeElement)) return;
|
|
1294
1336
|
switch (e.key) {
|
|
1295
1337
|
case "ArrowLeft":
|
|
1296
1338
|
if (direction === "ltr" && e.currentTarget.contains(e.target)) {
|
|
1297
|
-
|
|
1339
|
+
e.preventDefault();
|
|
1298
1340
|
e.stopPropagation();
|
|
1299
1341
|
onSubmenuClose();
|
|
1300
|
-
(
|
|
1342
|
+
if (!shouldUseVirtualFocus && ref.current) $7215afc6de606d6b$export$de79e2c695e052f3(ref.current);
|
|
1301
1343
|
}
|
|
1302
1344
|
break;
|
|
1303
1345
|
case "ArrowRight":
|
|
1304
1346
|
if (direction === "rtl" && e.currentTarget.contains(e.target)) {
|
|
1305
|
-
|
|
1347
|
+
e.preventDefault();
|
|
1306
1348
|
e.stopPropagation();
|
|
1307
1349
|
onSubmenuClose();
|
|
1308
|
-
(
|
|
1350
|
+
if (!shouldUseVirtualFocus && ref.current) $7215afc6de606d6b$export$de79e2c695e052f3(ref.current);
|
|
1309
1351
|
}
|
|
1310
1352
|
break;
|
|
1311
1353
|
case "Escape":
|
|
1312
|
-
|
|
1313
|
-
|
|
1354
|
+
var _submenuRef_current;
|
|
1355
|
+
if ((_submenuRef_current = submenuRef.current) === null || _submenuRef_current === void 0 ? void 0 : _submenuRef_current.contains(e.target)) {
|
|
1356
|
+
e.stopPropagation();
|
|
1357
|
+
onSubmenuClose();
|
|
1358
|
+
if (!shouldUseVirtualFocus && ref.current) $7215afc6de606d6b$export$de79e2c695e052f3(ref.current);
|
|
1359
|
+
}
|
|
1314
1360
|
break;
|
|
1315
1361
|
}
|
|
1316
1362
|
};
|
|
@@ -1330,8 +1376,9 @@ function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
|
|
|
1330
1376
|
case "ArrowRight":
|
|
1331
1377
|
if (!isDisabled) {
|
|
1332
1378
|
if (direction === "ltr") {
|
|
1379
|
+
e.preventDefault();
|
|
1333
1380
|
if (!state.isOpen) onSubmenuOpen("first");
|
|
1334
|
-
if (type === "menu" && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) submenuRef.current
|
|
1381
|
+
if (type === "menu" && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) $7215afc6de606d6b$export$de79e2c695e052f3(submenuRef.current);
|
|
1335
1382
|
} else if (state.isOpen) onSubmenuClose();
|
|
1336
1383
|
else e.continuePropagation();
|
|
1337
1384
|
}
|
|
@@ -1339,15 +1386,13 @@ function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
|
|
|
1339
1386
|
case "ArrowLeft":
|
|
1340
1387
|
if (!isDisabled) {
|
|
1341
1388
|
if (direction === "rtl") {
|
|
1389
|
+
e.preventDefault();
|
|
1342
1390
|
if (!state.isOpen) onSubmenuOpen("first");
|
|
1343
|
-
if (type === "menu" && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) submenuRef.current
|
|
1391
|
+
if (type === "menu" && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) $7215afc6de606d6b$export$de79e2c695e052f3(submenuRef.current);
|
|
1344
1392
|
} else if (state.isOpen) onSubmenuClose();
|
|
1345
1393
|
else e.continuePropagation();
|
|
1346
1394
|
}
|
|
1347
1395
|
break;
|
|
1348
|
-
case "Escape":
|
|
1349
|
-
state.closeAll();
|
|
1350
|
-
break;
|
|
1351
1396
|
default:
|
|
1352
1397
|
e.continuePropagation();
|
|
1353
1398
|
break;
|
|
@@ -1400,7 +1445,6 @@ function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) {
|
|
|
1400
1445
|
submenuProps,
|
|
1401
1446
|
popoverProps: {
|
|
1402
1447
|
isNonModal: true,
|
|
1403
|
-
disableFocusManagement: true,
|
|
1404
1448
|
shouldCloseOnInteractOutside
|
|
1405
1449
|
}
|
|
1406
1450
|
};
|
|
@@ -1412,13 +1456,13 @@ function $40df3f8667284809$export$d55e7ee900f34e93(props, ref) {
|
|
|
1412
1456
|
let isRefocusing = useRef(false);
|
|
1413
1457
|
useEffect(() => {
|
|
1414
1458
|
if (ref.current && !ref.current.contains(document.activeElement)) {
|
|
1415
|
-
$
|
|
1459
|
+
$3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
|
|
1416
1460
|
let timeout = setTimeout(() => {
|
|
1417
1461
|
if (document.activeElement === ref.current) {
|
|
1418
1462
|
isRefocusing.current = true;
|
|
1419
1463
|
if (ref.current) {
|
|
1420
1464
|
ref.current.blur();
|
|
1421
|
-
$
|
|
1465
|
+
$3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
|
|
1422
1466
|
}
|
|
1423
1467
|
isRefocusing.current = false;
|
|
1424
1468
|
}
|
|
@@ -1653,6 +1697,7 @@ function $875d6693e12af071$var$toggleKey(set, key) {
|
|
|
1653
1697
|
return res;
|
|
1654
1698
|
}
|
|
1655
1699
|
const $07b14b47974efb58$export$9b9a0cd73afb7ca4 = /* @__PURE__ */ createContext(null);
|
|
1700
|
+
const $07b14b47974efb58$var$PopoverGroupContext = /* @__PURE__ */ createContext(null);
|
|
1656
1701
|
const $07b14b47974efb58$export$5b6b19405a83ff9d = /* @__PURE__ */ forwardRef(function Popover(props, ref) {
|
|
1657
1702
|
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $07b14b47974efb58$export$9b9a0cd73afb7ca4);
|
|
1658
1703
|
let contextState = useContext($de32f1b87079253c$export$d2f961adcb0afbe);
|
|
@@ -1660,6 +1705,7 @@ const $07b14b47974efb58$export$5b6b19405a83ff9d = /* @__PURE__ */ forwardRef(fun
|
|
|
1660
1705
|
let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;
|
|
1661
1706
|
let isExiting = $d3f049242431219c$export$45fda7c47f93fd48(ref, state.isOpen) || props.isExiting || false;
|
|
1662
1707
|
let isHidden = $f39a9eba43920ace$export$b5d7cc18bb8d2b59();
|
|
1708
|
+
let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
1663
1709
|
if (isHidden) {
|
|
1664
1710
|
let children = props.children;
|
|
1665
1711
|
if (typeof children === "function") children = children({
|
|
@@ -1677,12 +1723,16 @@ const $07b14b47974efb58$export$5b6b19405a83ff9d = /* @__PURE__ */ forwardRef(fun
|
|
|
1677
1723
|
triggerRef: props.triggerRef,
|
|
1678
1724
|
state,
|
|
1679
1725
|
popoverRef: ref,
|
|
1680
|
-
isExiting
|
|
1726
|
+
isExiting,
|
|
1727
|
+
dir: direction
|
|
1681
1728
|
});
|
|
1682
1729
|
});
|
|
1683
1730
|
function $07b14b47974efb58$var$PopoverInner({ state, isExiting, UNSTABLE_portalContainer, ...props }) {
|
|
1684
1731
|
let arrowRef = useRef(null);
|
|
1685
1732
|
let [arrowWidth, setArrowWidth] = useState(0);
|
|
1733
|
+
let containerRef = useRef(null);
|
|
1734
|
+
let groupCtx = useContext($07b14b47974efb58$var$PopoverGroupContext);
|
|
1735
|
+
let isSubPopover = groupCtx && props.trigger === "SubmenuTrigger";
|
|
1686
1736
|
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
1687
1737
|
if (arrowRef.current && state.isOpen) setArrowWidth(arrowRef.current.getBoundingClientRect().width);
|
|
1688
1738
|
}, [
|
|
@@ -1693,7 +1743,10 @@ function $07b14b47974efb58$var$PopoverInner({ state, isExiting, UNSTABLE_portalC
|
|
|
1693
1743
|
let { popoverProps, underlayProps, arrowProps, placement } = $f2f8a6077418541e$export$542a6fd13ac93354({
|
|
1694
1744
|
...props,
|
|
1695
1745
|
offset: (_props_offset = props.offset) !== null && _props_offset !== void 0 ? _props_offset : 8,
|
|
1696
|
-
arrowSize: arrowWidth
|
|
1746
|
+
arrowSize: arrowWidth,
|
|
1747
|
+
// If this is a submenu/subdialog, use the root popover's container
|
|
1748
|
+
// to detect outside interaction and add aria-hidden.
|
|
1749
|
+
groupRef: isSubPopover ? groupCtx : containerRef
|
|
1697
1750
|
}, state);
|
|
1698
1751
|
let ref = props.popoverRef;
|
|
1699
1752
|
let isEntering = $d3f049242431219c$export$6d3443f2c48bfc20(ref, !!placement) || props.isEntering || false;
|
|
@@ -1707,27 +1760,35 @@ function $07b14b47974efb58$var$PopoverInner({ state, isExiting, UNSTABLE_portalC
|
|
|
1707
1760
|
isExiting
|
|
1708
1761
|
}
|
|
1709
1762
|
});
|
|
1763
|
+
let shouldBeDialog = !props.isNonModal || props.trigger === "SubmenuTrigger";
|
|
1764
|
+
let [isDialog, setDialog] = useState(false);
|
|
1765
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
1766
|
+
if (ref.current) setDialog(shouldBeDialog && !ref.current.querySelector("[role=dialog]"));
|
|
1767
|
+
}, [
|
|
1768
|
+
ref,
|
|
1769
|
+
shouldBeDialog
|
|
1770
|
+
]);
|
|
1771
|
+
useEffect(() => {
|
|
1772
|
+
if (isDialog && ref.current && !ref.current.contains(document.activeElement)) $3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
|
|
1773
|
+
}, [
|
|
1774
|
+
isDialog,
|
|
1775
|
+
ref
|
|
1776
|
+
]);
|
|
1710
1777
|
let style = {
|
|
1711
1778
|
...popoverProps.style,
|
|
1712
1779
|
...renderProps.style
|
|
1713
1780
|
};
|
|
1714
|
-
|
|
1715
|
-
...props,
|
|
1716
|
-
isExiting,
|
|
1717
|
-
portalContainer: UNSTABLE_portalContainer
|
|
1718
|
-
}, !props.isNonModal && state.isOpen && /* @__PURE__ */ React__default.createElement("div", {
|
|
1719
|
-
"data-testid": "underlay",
|
|
1720
|
-
...underlayProps,
|
|
1721
|
-
style: {
|
|
1722
|
-
position: "fixed",
|
|
1723
|
-
inset: 0
|
|
1724
|
-
}
|
|
1725
|
-
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
1781
|
+
let overlay = /* @__PURE__ */ React__default.createElement("div", {
|
|
1726
1782
|
...$3ef42575df84b30b$export$9d1611c77c2fe928($65484d02dcb7eb3e$export$457c3d6518dd4c6f(props), popoverProps),
|
|
1727
1783
|
...renderProps,
|
|
1784
|
+
role: isDialog ? "dialog" : void 0,
|
|
1785
|
+
tabIndex: isDialog ? -1 : void 0,
|
|
1786
|
+
"aria-label": props["aria-label"],
|
|
1787
|
+
"aria-labelledby": props["aria-labelledby"],
|
|
1728
1788
|
ref,
|
|
1729
1789
|
slot: props.slot || void 0,
|
|
1730
1790
|
style,
|
|
1791
|
+
dir: props.dir,
|
|
1731
1792
|
"data-trigger": props.trigger,
|
|
1732
1793
|
"data-placement": placement,
|
|
1733
1794
|
"data-entering": isEntering || void 0,
|
|
@@ -1742,7 +1803,34 @@ function $07b14b47974efb58$var$PopoverInner({ state, isExiting, UNSTABLE_portalC
|
|
|
1742
1803
|
}
|
|
1743
1804
|
}, renderProps.children), /* @__PURE__ */ React__default.createElement($86ea4cb521eb2e37$export$2317d149ed6f78c4, {
|
|
1744
1805
|
onDismiss: state.close
|
|
1745
|
-
}))
|
|
1806
|
+
}));
|
|
1807
|
+
if (!isSubPopover) return /* @__PURE__ */ React__default.createElement($337b884510726a0d$export$c6fdb837b070b4ff, {
|
|
1808
|
+
...props,
|
|
1809
|
+
shouldContainFocus: isDialog,
|
|
1810
|
+
isExiting,
|
|
1811
|
+
portalContainer: UNSTABLE_portalContainer
|
|
1812
|
+
}, !props.isNonModal && state.isOpen && /* @__PURE__ */ React__default.createElement("div", {
|
|
1813
|
+
"data-testid": "underlay",
|
|
1814
|
+
...underlayProps,
|
|
1815
|
+
style: {
|
|
1816
|
+
position: "fixed",
|
|
1817
|
+
inset: 0
|
|
1818
|
+
}
|
|
1819
|
+
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
1820
|
+
ref: containerRef,
|
|
1821
|
+
style: {
|
|
1822
|
+
display: "contents"
|
|
1823
|
+
}
|
|
1824
|
+
}, /* @__PURE__ */ React__default.createElement($07b14b47974efb58$var$PopoverGroupContext.Provider, {
|
|
1825
|
+
value: containerRef
|
|
1826
|
+
}, overlay)));
|
|
1827
|
+
var _ref;
|
|
1828
|
+
return /* @__PURE__ */ React__default.createElement($337b884510726a0d$export$c6fdb837b070b4ff, {
|
|
1829
|
+
...props,
|
|
1830
|
+
shouldContainFocus: isDialog,
|
|
1831
|
+
isExiting,
|
|
1832
|
+
portalContainer: (_ref = UNSTABLE_portalContainer !== null && UNSTABLE_portalContainer !== void 0 ? UNSTABLE_portalContainer : groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.current) !== null && _ref !== void 0 ? _ref : void 0
|
|
1833
|
+
}, overlay);
|
|
1746
1834
|
}
|
|
1747
1835
|
const $63df2425e2108aa8$export$744d98a3b8a94e1c = /* @__PURE__ */ createContext({});
|
|
1748
1836
|
const $3674c52c6b3c5bce$export$c7e742effb1c51e2 = /* @__PURE__ */ createContext(null);
|
|
@@ -1793,7 +1881,8 @@ function $3674c52c6b3c5bce$export$27d2ad3c5815583e(props) {
|
|
|
1793
1881
|
placement: "bottom start",
|
|
1794
1882
|
style: {
|
|
1795
1883
|
"--trigger-width": buttonWidth
|
|
1796
|
-
}
|
|
1884
|
+
},
|
|
1885
|
+
"aria-labelledby": menuProps["aria-labelledby"]
|
|
1797
1886
|
}
|
|
1798
1887
|
]
|
|
1799
1888
|
]
|
|
@@ -1813,11 +1902,12 @@ const $3674c52c6b3c5bce$export$ecabc99eeffab7ca = /* @__PURE__ */ $e1995378a1429
|
|
|
1813
1902
|
}, rootMenuTriggerState);
|
|
1814
1903
|
let submenuRef = useRef(null);
|
|
1815
1904
|
let itemRef = $df56164dff5785e2$export$4338b53315abf666(ref);
|
|
1816
|
-
let { parentMenuRef } = useContext($3674c52c6b3c5bce$var$SubmenuTriggerContext);
|
|
1905
|
+
let { parentMenuRef, shouldUseVirtualFocus } = useContext($3674c52c6b3c5bce$var$SubmenuTriggerContext);
|
|
1817
1906
|
let { submenuTriggerProps, submenuProps, popoverProps } = $0065b146e7192841$export$7138b0d059a6e743({
|
|
1818
1907
|
parentMenuRef,
|
|
1819
1908
|
submenuRef,
|
|
1820
|
-
delay: props.delay
|
|
1909
|
+
delay: props.delay,
|
|
1910
|
+
shouldUseVirtualFocus
|
|
1821
1911
|
}, submenuTriggerState, itemRef);
|
|
1822
1912
|
return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
1823
1913
|
values: [
|
|
@@ -1844,9 +1934,7 @@ const $3674c52c6b3c5bce$export$ecabc99eeffab7ca = /* @__PURE__ */ $e1995378a1429
|
|
|
1844
1934
|
trigger: "SubmenuTrigger",
|
|
1845
1935
|
triggerRef: itemRef,
|
|
1846
1936
|
placement: "end top",
|
|
1847
|
-
|
|
1848
|
-
// @ts-ignore
|
|
1849
|
-
"data-react-aria-top-layer": true,
|
|
1937
|
+
"aria-labelledby": submenuProps["aria-labelledby"],
|
|
1850
1938
|
...popoverProps
|
|
1851
1939
|
}
|
|
1852
1940
|
]
|
|
@@ -1860,21 +1948,21 @@ const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /* @__PURE__ */ forwardRef(fun
|
|
|
1860
1948
|
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $3674c52c6b3c5bce$export$c7e742effb1c51e2);
|
|
1861
1949
|
return /* @__PURE__ */ React__default.createElement($e1995378a142960e$export$bf788dd355e3a401, {
|
|
1862
1950
|
content: /* @__PURE__ */ React__default.createElement($e1995378a142960e$export$fb8073518f34e6ec, props)
|
|
1863
|
-
}, (collection) =>
|
|
1951
|
+
}, (collection) => /* @__PURE__ */ React__default.createElement($3674c52c6b3c5bce$var$MenuInner, {
|
|
1864
1952
|
props,
|
|
1865
1953
|
collection,
|
|
1866
1954
|
menuRef: ref
|
|
1867
1955
|
}));
|
|
1868
1956
|
});
|
|
1869
1957
|
function $3674c52c6b3c5bce$var$MenuInner({ props, collection, menuRef: ref }) {
|
|
1870
|
-
let {
|
|
1958
|
+
let { filter, collectionProps: autocompleteMenuProps, collectionRef } = useContext($d2f53cda644affe3$export$65d2a03b8800d6e3) || {};
|
|
1871
1959
|
ref = $df56164dff5785e2$export$4338b53315abf666(useMemo(() => $5dc95899b306f630$export$c9058316764c140e(ref, collectionRef !== void 0 ? collectionRef : null), [
|
|
1872
1960
|
collectionRef,
|
|
1873
1961
|
ref
|
|
1874
1962
|
]));
|
|
1875
|
-
let filteredCollection = useMemo(() =>
|
|
1963
|
+
let filteredCollection = useMemo(() => filter ? collection.UNSTABLE_filter(filter) : collection, [
|
|
1876
1964
|
collection,
|
|
1877
|
-
|
|
1965
|
+
filter
|
|
1878
1966
|
]);
|
|
1879
1967
|
let state = $875d6693e12af071$export$728d6ba534403756({
|
|
1880
1968
|
...props,
|
|
@@ -1893,14 +1981,24 @@ function $3674c52c6b3c5bce$var$MenuInner({ props, collection, menuRef: ref }) {
|
|
|
1893
1981
|
defaultClassName: "react-aria-Menu",
|
|
1894
1982
|
className: props.className,
|
|
1895
1983
|
style: props.style,
|
|
1896
|
-
values: {
|
|
1984
|
+
values: {
|
|
1985
|
+
isEmpty: state.collection.size === 0
|
|
1986
|
+
}
|
|
1897
1987
|
});
|
|
1988
|
+
let emptyState = null;
|
|
1989
|
+
if (state.collection.size === 0 && props.renderEmptyState) emptyState = /* @__PURE__ */ React__default.createElement("div", {
|
|
1990
|
+
role: "menuitem",
|
|
1991
|
+
style: {
|
|
1992
|
+
display: "contents"
|
|
1993
|
+
}
|
|
1994
|
+
}, props.renderEmptyState());
|
|
1898
1995
|
return /* @__PURE__ */ React__default.createElement($9bf71ea28793e738$export$20e40289641fbbb6, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
1899
1996
|
...$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props),
|
|
1900
1997
|
...menuProps,
|
|
1901
1998
|
...renderProps,
|
|
1902
1999
|
ref,
|
|
1903
2000
|
slot: props.slot || void 0,
|
|
2001
|
+
"data-empty": state.collection.size === 0 || void 0,
|
|
1904
2002
|
onScroll: props.onScroll
|
|
1905
2003
|
}, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
1906
2004
|
values: [
|
|
@@ -1924,23 +2022,35 @@ function $3674c52c6b3c5bce$var$MenuInner({ props, collection, menuRef: ref }) {
|
|
|
1924
2022
|
[
|
|
1925
2023
|
$3674c52c6b3c5bce$var$SubmenuTriggerContext,
|
|
1926
2024
|
{
|
|
1927
|
-
parentMenuRef: ref
|
|
2025
|
+
parentMenuRef: ref,
|
|
2026
|
+
shouldUseVirtualFocus: autocompleteMenuProps === null || autocompleteMenuProps === void 0 ? void 0 : autocompleteMenuProps.shouldUseVirtualFocus
|
|
1928
2027
|
}
|
|
1929
2028
|
],
|
|
1930
2029
|
[
|
|
1931
2030
|
$3674c52c6b3c5bce$var$MenuItemContext,
|
|
1932
2031
|
null
|
|
1933
2032
|
],
|
|
2033
|
+
[
|
|
2034
|
+
$d2f53cda644affe3$export$65d2a03b8800d6e3,
|
|
2035
|
+
null
|
|
2036
|
+
],
|
|
1934
2037
|
[
|
|
1935
2038
|
$3674c52c6b3c5bce$var$SelectionManagerContext,
|
|
1936
2039
|
state.selectionManager
|
|
2040
|
+
],
|
|
2041
|
+
/* Ensure root MenuTriggerState is defined, in case Menu is rendered outside a MenuTrigger. */
|
|
2042
|
+
/* We assume the context can never change between defined and undefined. */
|
|
2043
|
+
/* eslint-disable-next-line react-hooks/rules-of-hooks */
|
|
2044
|
+
[
|
|
2045
|
+
$3674c52c6b3c5bce$export$795aec4671cbae19,
|
|
2046
|
+
triggerState !== null && triggerState !== void 0 ? triggerState : $a28c903ee9ad8dc5$export$79fefeb1c2091ac3({})
|
|
1937
2047
|
]
|
|
1938
2048
|
]
|
|
1939
2049
|
}, /* @__PURE__ */ React__default.createElement(CollectionRoot, {
|
|
1940
2050
|
collection: state.collection,
|
|
1941
2051
|
persistedKeys: $7135fc7d473fd974$export$90e00781bc59d8f9(state.selectionManager.focusedKey),
|
|
1942
2052
|
scrollRef: ref
|
|
1943
|
-
}))));
|
|
2053
|
+
})), emptyState));
|
|
1944
2054
|
}
|
|
1945
2055
|
class $3674c52c6b3c5bce$var$GroupSelectionManager extends $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
1946
2056
|
get focusedKey() {
|
|
@@ -2021,7 +2131,6 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /* @__PURE__ */ $e1995378a1429
|
|
|
2021
2131
|
key: item.key,
|
|
2022
2132
|
selectionManager
|
|
2023
2133
|
}, state, ref);
|
|
2024
|
-
let { isFocusVisible, focusProps } = $f7dceffc5ad7768b$export$4e328f61c538687f();
|
|
2025
2134
|
let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456({
|
|
2026
2135
|
isDisabled: states.isDisabled
|
|
2027
2136
|
});
|
|
@@ -2033,7 +2142,7 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /* @__PURE__ */ $e1995378a1429
|
|
|
2033
2142
|
values: {
|
|
2034
2143
|
...states,
|
|
2035
2144
|
isHovered,
|
|
2036
|
-
isFocusVisible,
|
|
2145
|
+
isFocusVisible: states.isFocusVisible,
|
|
2037
2146
|
selectionMode: selectionManager.selectionMode,
|
|
2038
2147
|
selectionBehavior: selectionManager.selectionBehavior,
|
|
2039
2148
|
hasSubmenu: !!props["aria-haspopup"],
|
|
@@ -2042,13 +2151,13 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /* @__PURE__ */ $e1995378a1429
|
|
|
2042
2151
|
});
|
|
2043
2152
|
let ElementType = props.href ? "a" : "div";
|
|
2044
2153
|
return /* @__PURE__ */ React__default.createElement(ElementType, {
|
|
2045
|
-
...$3ef42575df84b30b$export$9d1611c77c2fe928(menuItemProps,
|
|
2154
|
+
...$3ef42575df84b30b$export$9d1611c77c2fe928(menuItemProps, hoverProps),
|
|
2046
2155
|
...renderProps,
|
|
2047
2156
|
ref,
|
|
2048
2157
|
"data-disabled": states.isDisabled || void 0,
|
|
2049
2158
|
"data-hovered": isHovered || void 0,
|
|
2050
2159
|
"data-focused": states.isFocused || void 0,
|
|
2051
|
-
"data-focus-visible": isFocusVisible || void 0,
|
|
2160
|
+
"data-focus-visible": states.isFocusVisible || void 0,
|
|
2052
2161
|
"data-pressed": states.isPressed || void 0,
|
|
2053
2162
|
"data-selected": states.isSelected || void 0,
|
|
2054
2163
|
"data-selection-mode": selectionManager.selectionMode === "none" ? void 0 : selectionManager.selectionMode,
|
|
@@ -2060,6 +2169,7 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /* @__PURE__ */ $e1995378a1429
|
|
|
2060
2169
|
$514c0188e459b4c0$export$9afb8bc826b033ea,
|
|
2061
2170
|
{
|
|
2062
2171
|
slots: {
|
|
2172
|
+
[$64fa3d84918910a7$export$c62b8e45d58ddad9]: labelProps,
|
|
2063
2173
|
label: labelProps,
|
|
2064
2174
|
description: descriptionProps
|
|
2065
2175
|
}
|
|
@@ -2100,7 +2210,8 @@ function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
|
|
|
2100
2210
|
$07b14b47974efb58$export$9b9a0cd73afb7ca4,
|
|
2101
2211
|
{
|
|
2102
2212
|
trigger: "DialogTrigger",
|
|
2103
|
-
triggerRef: buttonRef
|
|
2213
|
+
triggerRef: buttonRef,
|
|
2214
|
+
"aria-labelledby": overlayProps["aria-labelledby"]
|
|
2104
2215
|
}
|
|
2105
2216
|
]
|
|
2106
2217
|
]
|
|
@@ -2172,8 +2283,8 @@ export {
|
|
|
2172
2283
|
$07b14b47974efb58$export$5b6b19405a83ff9d as $,
|
|
2173
2284
|
$3674c52c6b3c5bce$export$27d2ad3c5815583e as a,
|
|
2174
2285
|
$3674c52c6b3c5bce$export$d9b273488cd8ce6f as b,
|
|
2175
|
-
$3674c52c6b3c5bce$export$
|
|
2176
|
-
$3674c52c6b3c5bce$export$
|
|
2286
|
+
$3674c52c6b3c5bce$export$2ce376c2cc3355c8 as c,
|
|
2287
|
+
$3674c52c6b3c5bce$export$4b1545b4f2016d26 as d,
|
|
2177
2288
|
$3674c52c6b3c5bce$export$ecabc99eeffab7ca as e,
|
|
2178
2289
|
$de32f1b87079253c$export$3ddf2d174ce01153 as f,
|
|
2179
2290
|
$de32f1b87079253c$export$2e1e1122cf0cba88 as g,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as $d191a55c9702f145$export$8467354a121f1b9f } from "./useLabel-
|
|
2
|
-
import {
|
|
1
|
+
import { $ as $d191a55c9702f145$export$8467354a121f1b9f } from "./useLabel-D7HkNEHT.js";
|
|
2
|
+
import { j as $bdb11010cef70236$export$b4cc09c592e8fdb8, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-DkCSC521.js";
|
|
3
3
|
import { createContext } from "react";
|
|
4
4
|
function $2baaea4c71418dea$export$294aa081a6c6f55d(props) {
|
|
5
5
|
let { description, errorMessage, isInvalid, validationState } = props;
|