@eightshift/ui-components 0.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/README.md +27 -0
- package/dist/Checkbox-BLcVbhiO.js +178 -0
- package/dist/ColorSwatch-Cmlex_kT.js +66 -0
- package/dist/FieldError-wtMA4667.js +42 -0
- package/dist/FocusScope-1u9yyfIN.js +725 -0
- package/dist/Form-Cq3fu75_.js +5 -0
- package/dist/GridList-BZPXp3_O.js +1256 -0
- package/dist/Group-DyqpTRPe.js +49 -0
- package/dist/Input-jsbb4ugq.js +130 -0
- package/dist/Label-BPzS-sR7.js +17 -0
- package/dist/ListBox-w9gDaJkV.js +4423 -0
- package/dist/LiveAnnouncer-IsokfWQ5.js +73 -0
- package/dist/NumberFormatter-LzoKy975.js +160 -0
- package/dist/RSPContexts-CrNYmadY.js +14 -0
- package/dist/Select-49a62830.esm-C-RFtLiD.js +2541 -0
- package/dist/SelectionManager-mefd0ThJ.js +2155 -0
- package/dist/Separator-DHn0CwdK.js +325 -0
- package/dist/Slider-Pyh2V4bY.js +885 -0
- package/dist/Text-BM136LvS.js +17 -0
- package/dist/VisuallyHidden-BYRI1Lfo.js +51 -0
- package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
- package/dist/ariaHideOutside-ByKBPHmX.js +113 -0
- package/dist/assets/style.css +1 -0
- package/dist/button-BkkdyHfJ.js +307 -0
- package/dist/components/animated-visibility/animated-visibility.js +7165 -0
- package/dist/components/base-control/base-control.js +97 -0
- package/dist/components/breakpoint-preview/breakpoint-preview.js +218 -0
- package/dist/components/button/button.js +10 -0
- package/dist/components/checkbox/checkbox.js +119 -0
- package/dist/components/color-pickers/color-picker.js +242 -0
- package/dist/components/color-pickers/color-swatch.js +62 -0
- package/dist/components/color-pickers/gradient-editor.js +516 -0
- package/dist/components/color-pickers/solid-color-picker.js +1633 -0
- package/dist/components/component-toggle/component-toggle.js +71 -0
- package/dist/components/container-panel/container-panel.js +39 -0
- package/dist/components/expandable/expandable.js +144 -0
- package/dist/components/input-field/input-field.js +224 -0
- package/dist/components/link-input/link-input.js +937 -0
- package/dist/components/list-box/list-box.js +152 -0
- package/dist/components/matrix-align/matrix-align.js +185 -0
- package/dist/components/menu/menu.js +1608 -0
- package/dist/components/notice/notice.js +119 -0
- package/dist/components/number-picker/number-picker.js +277 -0
- package/dist/components/popover/popover.js +9 -0
- package/dist/components/radio/radio.js +552 -0
- package/dist/components/repeater/repeater-item.js +127 -0
- package/dist/components/repeater/repeater.js +248 -0
- package/dist/components/responsive/responsive-legacy.js +326 -0
- package/dist/components/responsive/responsive.js +499 -0
- package/dist/components/responsive-preview/responsive-preview.js +119 -0
- package/dist/components/rich-label/rich-label.js +56 -0
- package/dist/components/select/async-multi-select.js +144 -0
- package/dist/components/select/async-single-select.js +126 -0
- package/dist/components/select/custom-select-default-components.js +38 -0
- package/dist/components/select/multi-select-components.js +8 -0
- package/dist/components/select/multi-select.js +134 -0
- package/dist/components/select/react-select-component-wrappers.js +90 -0
- package/dist/components/select/shared.js +45 -0
- package/dist/components/select/single-select.js +116 -0
- package/dist/components/select/styles.js +55 -0
- package/dist/components/slider/column-config-slider.js +225 -0
- package/dist/components/slider/slider.js +362 -0
- package/dist/components/slider/utils.js +45 -0
- package/dist/components/spacer/spacer.js +93 -0
- package/dist/components/tabs/tabs.js +626 -0
- package/dist/components/toggle/switch.js +140 -0
- package/dist/components/toggle/toggle.js +58 -0
- package/dist/components/toggle-button/toggle-button.js +206 -0
- package/dist/components/tooltip/tooltip.js +10 -0
- package/dist/context-jMy6xdVq.js +98 -0
- package/dist/default-i18n-BhE-OUmt.js +873 -0
- package/dist/filterDOMProps-DG2RfOUr.js +30 -0
- package/dist/focusSafely-C3K8zAKj.js +743 -0
- package/dist/hooks/use-cell-edit-mode.js +35 -0
- package/dist/icons/block-icon.js +42 -0
- package/dist/icons/generic-color-swatch.js +21 -0
- package/dist/icons/icons.js +3636 -0
- package/dist/index-Bfb9bWcb.js +28844 -0
- package/dist/index-a301f526.esm-Bioi4cGX.js +3576 -0
- package/dist/index.js +109 -0
- package/dist/intlStrings-CUhoK9EN.js +2484 -0
- package/dist/isScrollable-PcyglExV.js +10 -0
- package/dist/modifiers.esm-BuJQPI1X.js +31 -0
- package/dist/multi-select-components-CjVpCNko.js +3677 -0
- package/dist/number-rWqELA8W.js +39 -0
- package/dist/popover-Dx3vKXUX.js +1061 -0
- package/dist/react-select-async.esm-TFb_ZX6C.js +111 -0
- package/dist/react-select.esm-BjRWqf0E.js +15 -0
- package/dist/style.js +1 -0
- package/dist/textSelection-BosCCRVE.js +89 -0
- package/dist/tooltip-CkCndvTI.js +1094 -0
- package/dist/useButton-CuG5UzUw.js +74 -0
- package/dist/useEvent-DHv-yhOH.js +24 -0
- package/dist/useFocusRing-Cc-4eouh.js +41 -0
- package/dist/useFocusable-5q1Gek1J.js +81 -0
- package/dist/useFormReset-Buc9YJcv.js +23 -0
- package/dist/useFormValidationState-BAPPNXic.js +238 -0
- package/dist/useHasTabbableChild-D3uUNhJ0.js +37 -0
- package/dist/useLabel-CGlkoFG0.js +28 -0
- package/dist/useLabels-Dg62M_3P.js +25 -0
- package/dist/useListData-BelKu4kx.js +211 -0
- package/dist/useListState-Domq0blV.js +137 -0
- package/dist/useLocalizedStringFormatter-Prmz0h0A.js +130 -0
- package/dist/useNumberFieldState-BLU3uhSR.js +1253 -0
- package/dist/useNumberFormatter-BLc2xjZn.js +13 -0
- package/dist/usePress-BQgVor4T.js +698 -0
- package/dist/useToggle-C9ETOBaZ.js +58 -0
- package/dist/useToggleState-DJ_z5E2S.js +21 -0
- package/dist/utilities/classnames.js +16 -0
- package/dist/utilities/text-helpers.js +79 -0
- package/dist/utils-BsiH7-5Y.js +488 -0
- package/package.json +71 -0
|
@@ -0,0 +1,1061 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { l as $df56164dff5785e2$export$4338b53315abf666, d as $3ef42575df84b30b$export$9d1611c77c2fe928, f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, e as $bdb11010cef70236$export$f680877a34711e37, g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, n as $ff5963eb1fccf552$export$e08e3b67e392101e, o as $b5e257d569688ac6$export$535bd6ca7f90a273, k as $bdb11010cef70236$export$b4cc09c592e8fdb8, a as $64fa3d84918910a7$export$29f1550f4b0d4415, q as $64fa3d84918910a7$export$45fda7c47f93fd48, t as $64fa3d84918910a7$export$94b6d0abf7d33e8c, r as $64fa3d84918910a7$export$6d3443f2c48bfc20, c as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, s as $64fa3d84918910a7$export$c62b8e45d58ddad9 } from "./utils-BsiH7-5Y.js";
|
|
3
|
+
import { d as $4e85f108e88277b8$export$d688439359537581 } from "./RSPContexts-CrNYmadY.js";
|
|
4
|
+
import { b as $dd149f63282afbbf$export$f6211563215e3b37, c as $2a41e45df1593e64$export$d39e1813b3bdd0e1, a as $fc909762b330b746$export$61c6a8c84e605fb6, d as $44f671af83e7d9e0$export$2de4954e8ae13b9f } from "./tooltip-CkCndvTI.js";
|
|
5
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-DG2RfOUr.js";
|
|
6
|
+
import React__default, { useRef, useContext, useEffect, useMemo, createContext, useState, forwardRef } from "react";
|
|
7
|
+
import { $ as $62d8ded9296f3872$export$cfa2225e87938781, a as $5e3802645cc19319$export$1c3ebcada18427bf } from "./ariaHideOutside-ByKBPHmX.js";
|
|
8
|
+
import { c as $9bf71ea28793e738$export$1258395f99bf9cbf, $ as $9bf71ea28793e738$export$20e40289641fbbb6 } from "./FocusScope-1u9yyfIN.js";
|
|
9
|
+
import { l as $e7801be82b4b2a53$export$4debdb1a3f0fa79e, g as $431fbd86ca7dc216$export$b204af158042fbac, d as $9ab94262bd0047c7$export$420e68273165f4ec, j as $c87311424ea30a05$export$fedb369cb70207f1, h as $6a99195332edec8b$export$80f3e147d781571c } from "./focusSafely-C3K8zAKj.js";
|
|
10
|
+
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "./useLabels-Dg62M_3P.js";
|
|
11
|
+
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-Prmz0h0A.js";
|
|
12
|
+
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "./VisuallyHidden-BYRI1Lfo.js";
|
|
13
|
+
import { e as $ae1eeba8b9eafd08$export$5165eccb35aaadb5 } from "./usePress-BQgVor4T.js";
|
|
14
|
+
import { $ as $dbSRa$reactdom } from "./index-Bfb9bWcb.js";
|
|
15
|
+
import { classnames } from "./utilities/classnames.js";
|
|
16
|
+
import { _ as __ } from "./default-i18n-BhE-OUmt.js";
|
|
17
|
+
import { B as Button } from "./button-BkkdyHfJ.js";
|
|
18
|
+
const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /* @__PURE__ */ React__default.forwardRef(({ children, ...props }, ref) => {
|
|
19
|
+
let isRegistered = useRef(false);
|
|
20
|
+
let prevContext = useContext($ae1eeba8b9eafd08$export$5165eccb35aaadb5);
|
|
21
|
+
ref = $df56164dff5785e2$export$4338b53315abf666(ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref));
|
|
22
|
+
let context = $3ef42575df84b30b$export$9d1611c77c2fe928(prevContext || {}, {
|
|
23
|
+
...props,
|
|
24
|
+
ref,
|
|
25
|
+
register() {
|
|
26
|
+
isRegistered.current = true;
|
|
27
|
+
if (prevContext)
|
|
28
|
+
prevContext.register();
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
$e7801be82b4b2a53$export$4debdb1a3f0fa79e(prevContext, ref);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (!isRegistered.current) {
|
|
34
|
+
console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component.");
|
|
35
|
+
isRegistered.current = true;
|
|
36
|
+
}
|
|
37
|
+
}, []);
|
|
38
|
+
return /* @__PURE__ */ React__default.createElement($ae1eeba8b9eafd08$export$5165eccb35aaadb5.Provider, {
|
|
39
|
+
value: context
|
|
40
|
+
}, children);
|
|
41
|
+
});
|
|
42
|
+
function $f1ab8c75478c6f73$export$cf75428e0b9ed1ea({ children }) {
|
|
43
|
+
let context = useMemo(() => ({
|
|
44
|
+
register: () => {
|
|
45
|
+
}
|
|
46
|
+
}), []);
|
|
47
|
+
return /* @__PURE__ */ React__default.createElement($ae1eeba8b9eafd08$export$5165eccb35aaadb5.Provider, {
|
|
48
|
+
value: context
|
|
49
|
+
}, children);
|
|
50
|
+
}
|
|
51
|
+
function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
|
|
52
|
+
let { ref, onInteractOutside, isDisabled, onInteractOutsideStart } = props;
|
|
53
|
+
let stateRef = useRef({
|
|
54
|
+
isPointerDown: false,
|
|
55
|
+
ignoreEmulatedMouseEvents: false
|
|
56
|
+
});
|
|
57
|
+
let onPointerDown = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
|
|
58
|
+
if (onInteractOutside && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) {
|
|
59
|
+
if (onInteractOutsideStart)
|
|
60
|
+
onInteractOutsideStart(e);
|
|
61
|
+
stateRef.current.isPointerDown = true;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
let triggerInteractOutside = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
|
|
65
|
+
if (onInteractOutside)
|
|
66
|
+
onInteractOutside(e);
|
|
67
|
+
});
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
let state = stateRef.current;
|
|
70
|
+
if (isDisabled)
|
|
71
|
+
return;
|
|
72
|
+
const element = ref.current;
|
|
73
|
+
const documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element);
|
|
74
|
+
if (typeof PointerEvent !== "undefined") {
|
|
75
|
+
let onPointerUp = (e) => {
|
|
76
|
+
if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref))
|
|
77
|
+
triggerInteractOutside(e);
|
|
78
|
+
state.isPointerDown = false;
|
|
79
|
+
};
|
|
80
|
+
documentObject.addEventListener("pointerdown", onPointerDown, true);
|
|
81
|
+
documentObject.addEventListener("pointerup", onPointerUp, true);
|
|
82
|
+
return () => {
|
|
83
|
+
documentObject.removeEventListener("pointerdown", onPointerDown, true);
|
|
84
|
+
documentObject.removeEventListener("pointerup", onPointerUp, true);
|
|
85
|
+
};
|
|
86
|
+
} else {
|
|
87
|
+
let onMouseUp = (e) => {
|
|
88
|
+
if (state.ignoreEmulatedMouseEvents)
|
|
89
|
+
state.ignoreEmulatedMouseEvents = false;
|
|
90
|
+
else if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref))
|
|
91
|
+
triggerInteractOutside(e);
|
|
92
|
+
state.isPointerDown = false;
|
|
93
|
+
};
|
|
94
|
+
let onTouchEnd = (e) => {
|
|
95
|
+
state.ignoreEmulatedMouseEvents = true;
|
|
96
|
+
if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref))
|
|
97
|
+
triggerInteractOutside(e);
|
|
98
|
+
state.isPointerDown = false;
|
|
99
|
+
};
|
|
100
|
+
documentObject.addEventListener("mousedown", onPointerDown, true);
|
|
101
|
+
documentObject.addEventListener("mouseup", onMouseUp, true);
|
|
102
|
+
documentObject.addEventListener("touchstart", onPointerDown, true);
|
|
103
|
+
documentObject.addEventListener("touchend", onTouchEnd, true);
|
|
104
|
+
return () => {
|
|
105
|
+
documentObject.removeEventListener("mousedown", onPointerDown, true);
|
|
106
|
+
documentObject.removeEventListener("mouseup", onMouseUp, true);
|
|
107
|
+
documentObject.removeEventListener("touchstart", onPointerDown, true);
|
|
108
|
+
documentObject.removeEventListener("touchend", onTouchEnd, true);
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}, [
|
|
112
|
+
ref,
|
|
113
|
+
isDisabled,
|
|
114
|
+
onPointerDown,
|
|
115
|
+
triggerInteractOutside
|
|
116
|
+
]);
|
|
117
|
+
}
|
|
118
|
+
function $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {
|
|
119
|
+
if (event.button > 0)
|
|
120
|
+
return false;
|
|
121
|
+
if (event.target) {
|
|
122
|
+
const ownerDocument = event.target.ownerDocument;
|
|
123
|
+
if (!ownerDocument || !ownerDocument.documentElement.contains(event.target))
|
|
124
|
+
return false;
|
|
125
|
+
if (event.target.closest("[data-react-aria-top-layer]"))
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
return ref.current && !ref.current.contains(event.target);
|
|
129
|
+
}
|
|
130
|
+
const $a11501f3d1d39e6c$var$visibleOverlays = [];
|
|
131
|
+
function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
132
|
+
let { onClose, shouldCloseOnBlur, isOpen, isDismissable = false, isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside } = props;
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
if (isOpen)
|
|
135
|
+
$a11501f3d1d39e6c$var$visibleOverlays.push(ref);
|
|
136
|
+
return () => {
|
|
137
|
+
let index = $a11501f3d1d39e6c$var$visibleOverlays.indexOf(ref);
|
|
138
|
+
if (index >= 0)
|
|
139
|
+
$a11501f3d1d39e6c$var$visibleOverlays.splice(index, 1);
|
|
140
|
+
};
|
|
141
|
+
}, [
|
|
142
|
+
isOpen,
|
|
143
|
+
ref
|
|
144
|
+
]);
|
|
145
|
+
let onHide = () => {
|
|
146
|
+
if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref && onClose)
|
|
147
|
+
onClose();
|
|
148
|
+
};
|
|
149
|
+
let onInteractOutsideStart = (e) => {
|
|
150
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
|
|
151
|
+
if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
|
|
152
|
+
e.stopPropagation();
|
|
153
|
+
e.preventDefault();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
let onInteractOutside = (e) => {
|
|
158
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
|
|
159
|
+
if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
|
|
160
|
+
e.stopPropagation();
|
|
161
|
+
e.preventDefault();
|
|
162
|
+
}
|
|
163
|
+
onHide();
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
let onKeyDown = (e) => {
|
|
167
|
+
if (e.key === "Escape" && !isKeyboardDismissDisabled && !e.nativeEvent.isComposing) {
|
|
168
|
+
e.stopPropagation();
|
|
169
|
+
e.preventDefault();
|
|
170
|
+
onHide();
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
$e0b6e0b68ec7f50f$export$872b660ac5a1ff98({
|
|
174
|
+
ref,
|
|
175
|
+
onInteractOutside: isDismissable && isOpen ? onInteractOutside : null,
|
|
176
|
+
onInteractOutsideStart
|
|
177
|
+
});
|
|
178
|
+
let { focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
|
|
179
|
+
isDisabled: !shouldCloseOnBlur,
|
|
180
|
+
onBlurWithin: (e) => {
|
|
181
|
+
if (!e.relatedTarget || $9bf71ea28793e738$export$1258395f99bf9cbf(e.relatedTarget))
|
|
182
|
+
return;
|
|
183
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget))
|
|
184
|
+
onClose();
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
let onPointerDownUnderlay = (e) => {
|
|
188
|
+
if (e.target === e.currentTarget)
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
};
|
|
191
|
+
return {
|
|
192
|
+
overlayProps: {
|
|
193
|
+
onKeyDown,
|
|
194
|
+
...focusWithinProps
|
|
195
|
+
},
|
|
196
|
+
underlayProps: {
|
|
197
|
+
onPointerDown: onPointerDownUnderlay
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
|
|
202
|
+
let { type } = props;
|
|
203
|
+
let { isOpen } = state;
|
|
204
|
+
useEffect(() => {
|
|
205
|
+
if (ref && ref.current)
|
|
206
|
+
$dd149f63282afbbf$export$f6211563215e3b37.set(ref.current, state.close);
|
|
207
|
+
});
|
|
208
|
+
let ariaHasPopup = void 0;
|
|
209
|
+
if (type === "menu")
|
|
210
|
+
ariaHasPopup = true;
|
|
211
|
+
else if (type === "listbox")
|
|
212
|
+
ariaHasPopup = "listbox";
|
|
213
|
+
let overlayId = $bdb11010cef70236$export$f680877a34711e37();
|
|
214
|
+
return {
|
|
215
|
+
triggerProps: {
|
|
216
|
+
"aria-haspopup": ariaHasPopup,
|
|
217
|
+
"aria-expanded": isOpen,
|
|
218
|
+
"aria-controls": isOpen ? overlayId : null,
|
|
219
|
+
onPress: state.toggle
|
|
220
|
+
},
|
|
221
|
+
overlayProps: {
|
|
222
|
+
id: overlayId
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
const $49c51c25361d4cd2$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
227
|
+
const $49c51c25361d4cd2$var$nonTextInputTypes = /* @__PURE__ */ new Set([
|
|
228
|
+
"checkbox",
|
|
229
|
+
"radio",
|
|
230
|
+
"range",
|
|
231
|
+
"color",
|
|
232
|
+
"file",
|
|
233
|
+
"image",
|
|
234
|
+
"button",
|
|
235
|
+
"submit",
|
|
236
|
+
"reset"
|
|
237
|
+
]);
|
|
238
|
+
let $49c51c25361d4cd2$var$preventScrollCount = 0;
|
|
239
|
+
let $49c51c25361d4cd2$var$restore;
|
|
240
|
+
function $49c51c25361d4cd2$export$ee0f7cc6afcd1c18(options = {}) {
|
|
241
|
+
let { isDisabled } = options;
|
|
242
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
243
|
+
if (isDisabled)
|
|
244
|
+
return;
|
|
245
|
+
$49c51c25361d4cd2$var$preventScrollCount++;
|
|
246
|
+
if ($49c51c25361d4cd2$var$preventScrollCount === 1) {
|
|
247
|
+
if ($c87311424ea30a05$export$fedb369cb70207f1())
|
|
248
|
+
$49c51c25361d4cd2$var$restore = $49c51c25361d4cd2$var$preventScrollMobileSafari();
|
|
249
|
+
else
|
|
250
|
+
$49c51c25361d4cd2$var$restore = $49c51c25361d4cd2$var$preventScrollStandard();
|
|
251
|
+
}
|
|
252
|
+
return () => {
|
|
253
|
+
$49c51c25361d4cd2$var$preventScrollCount--;
|
|
254
|
+
if ($49c51c25361d4cd2$var$preventScrollCount === 0)
|
|
255
|
+
$49c51c25361d4cd2$var$restore();
|
|
256
|
+
};
|
|
257
|
+
}, [
|
|
258
|
+
isDisabled
|
|
259
|
+
]);
|
|
260
|
+
}
|
|
261
|
+
function $49c51c25361d4cd2$var$preventScrollStandard() {
|
|
262
|
+
return $ff5963eb1fccf552$export$e08e3b67e392101e($49c51c25361d4cd2$var$setStyle(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, "overflow", "hidden"));
|
|
263
|
+
}
|
|
264
|
+
function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
|
|
265
|
+
let scrollable;
|
|
266
|
+
let restoreScrollableStyles;
|
|
267
|
+
let onTouchStart = (e) => {
|
|
268
|
+
scrollable = $62d8ded9296f3872$export$cfa2225e87938781(e.target, true);
|
|
269
|
+
if (scrollable === document.documentElement && scrollable === document.body)
|
|
270
|
+
return;
|
|
271
|
+
if (scrollable instanceof HTMLElement && window.getComputedStyle(scrollable).overscrollBehavior === "auto")
|
|
272
|
+
restoreScrollableStyles = $49c51c25361d4cd2$var$setStyle(scrollable, "overscrollBehavior", "contain");
|
|
273
|
+
};
|
|
274
|
+
let onTouchMove = (e) => {
|
|
275
|
+
if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
|
|
276
|
+
e.preventDefault();
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
if (scrollable.scrollHeight === scrollable.clientHeight && scrollable.scrollWidth === scrollable.clientWidth)
|
|
280
|
+
e.preventDefault();
|
|
281
|
+
};
|
|
282
|
+
let onTouchEnd = (e) => {
|
|
283
|
+
let target = e.target;
|
|
284
|
+
if ($49c51c25361d4cd2$var$willOpenKeyboard(target) && target !== document.activeElement) {
|
|
285
|
+
e.preventDefault();
|
|
286
|
+
setupStyles();
|
|
287
|
+
target.style.transform = "translateY(-2000px)";
|
|
288
|
+
target.focus();
|
|
289
|
+
requestAnimationFrame(() => {
|
|
290
|
+
target.style.transform = "";
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
if (restoreScrollableStyles)
|
|
294
|
+
restoreScrollableStyles();
|
|
295
|
+
};
|
|
296
|
+
let onFocus = (e) => {
|
|
297
|
+
let target = e.target;
|
|
298
|
+
if ($49c51c25361d4cd2$var$willOpenKeyboard(target)) {
|
|
299
|
+
setupStyles();
|
|
300
|
+
target.style.transform = "translateY(-2000px)";
|
|
301
|
+
requestAnimationFrame(() => {
|
|
302
|
+
target.style.transform = "";
|
|
303
|
+
if ($49c51c25361d4cd2$var$visualViewport) {
|
|
304
|
+
if ($49c51c25361d4cd2$var$visualViewport.height < window.innerHeight)
|
|
305
|
+
requestAnimationFrame(() => {
|
|
306
|
+
$49c51c25361d4cd2$var$scrollIntoView(target);
|
|
307
|
+
});
|
|
308
|
+
else
|
|
309
|
+
$49c51c25361d4cd2$var$visualViewport.addEventListener("resize", () => $49c51c25361d4cd2$var$scrollIntoView(target), {
|
|
310
|
+
once: true
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
let restoreStyles = null;
|
|
317
|
+
let setupStyles = () => {
|
|
318
|
+
if (restoreStyles)
|
|
319
|
+
return;
|
|
320
|
+
let onWindowScroll = () => {
|
|
321
|
+
window.scrollTo(0, 0);
|
|
322
|
+
};
|
|
323
|
+
let scrollX = window.pageXOffset;
|
|
324
|
+
let scrollY = window.pageYOffset;
|
|
325
|
+
restoreStyles = $ff5963eb1fccf552$export$e08e3b67e392101e($49c51c25361d4cd2$var$addEvent(window, "scroll", onWindowScroll), $49c51c25361d4cd2$var$setStyle(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, "overflow", "hidden"), $49c51c25361d4cd2$var$setStyle(document.body, "marginTop", `-${scrollY}px`), () => {
|
|
326
|
+
window.scrollTo(scrollX, scrollY);
|
|
327
|
+
});
|
|
328
|
+
window.scrollTo(0, 0);
|
|
329
|
+
};
|
|
330
|
+
let removeEvents = $ff5963eb1fccf552$export$e08e3b67e392101e($49c51c25361d4cd2$var$addEvent(document, "touchstart", onTouchStart, {
|
|
331
|
+
passive: false,
|
|
332
|
+
capture: true
|
|
333
|
+
}), $49c51c25361d4cd2$var$addEvent(document, "touchmove", onTouchMove, {
|
|
334
|
+
passive: false,
|
|
335
|
+
capture: true
|
|
336
|
+
}), $49c51c25361d4cd2$var$addEvent(document, "touchend", onTouchEnd, {
|
|
337
|
+
passive: false,
|
|
338
|
+
capture: true
|
|
339
|
+
}), $49c51c25361d4cd2$var$addEvent(document, "focus", onFocus, true));
|
|
340
|
+
return () => {
|
|
341
|
+
restoreScrollableStyles === null || restoreScrollableStyles === void 0 ? void 0 : restoreScrollableStyles();
|
|
342
|
+
restoreStyles === null || restoreStyles === void 0 ? void 0 : restoreStyles();
|
|
343
|
+
removeEvents();
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
function $49c51c25361d4cd2$var$setStyle(element, style, value) {
|
|
347
|
+
let cur = element.style[style];
|
|
348
|
+
element.style[style] = value;
|
|
349
|
+
return () => {
|
|
350
|
+
element.style[style] = cur;
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
function $49c51c25361d4cd2$var$addEvent(target, event, handler, options) {
|
|
354
|
+
target.addEventListener(event, handler, options);
|
|
355
|
+
return () => {
|
|
356
|
+
target.removeEventListener(event, handler, options);
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
function $49c51c25361d4cd2$var$scrollIntoView(target) {
|
|
360
|
+
let root = document.scrollingElement || document.documentElement;
|
|
361
|
+
while (target && target !== root) {
|
|
362
|
+
let scrollable = $62d8ded9296f3872$export$cfa2225e87938781(target);
|
|
363
|
+
if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== target) {
|
|
364
|
+
let scrollableTop = scrollable.getBoundingClientRect().top;
|
|
365
|
+
let targetTop = target.getBoundingClientRect().top;
|
|
366
|
+
if (targetTop > scrollableTop + target.clientHeight)
|
|
367
|
+
scrollable.scrollTop += targetTop - scrollableTop;
|
|
368
|
+
}
|
|
369
|
+
target = scrollable.parentElement;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
|
|
373
|
+
return target instanceof HTMLInputElement && !$49c51c25361d4cd2$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
374
|
+
}
|
|
375
|
+
var $773d5888b972f1cf$exports = {};
|
|
376
|
+
$773d5888b972f1cf$exports = {
|
|
377
|
+
"dismiss": `تجاهل`
|
|
378
|
+
};
|
|
379
|
+
var $d11f19852b941573$exports = {};
|
|
380
|
+
$d11f19852b941573$exports = {
|
|
381
|
+
"dismiss": `Отхвърляне`
|
|
382
|
+
};
|
|
383
|
+
var $b983974c2ee1efb3$exports = {};
|
|
384
|
+
$b983974c2ee1efb3$exports = {
|
|
385
|
+
"dismiss": `Odstranit`
|
|
386
|
+
};
|
|
387
|
+
var $5809cc9d4e92de73$exports = {};
|
|
388
|
+
$5809cc9d4e92de73$exports = {
|
|
389
|
+
"dismiss": `Luk`
|
|
390
|
+
};
|
|
391
|
+
var $c68c2e4fc74398d1$exports = {};
|
|
392
|
+
$c68c2e4fc74398d1$exports = {
|
|
393
|
+
"dismiss": `Schließen`
|
|
394
|
+
};
|
|
395
|
+
var $0898b4c153db2b77$exports = {};
|
|
396
|
+
$0898b4c153db2b77$exports = {
|
|
397
|
+
"dismiss": `Απόρριψη`
|
|
398
|
+
};
|
|
399
|
+
var $6d74810286a15183$exports = {};
|
|
400
|
+
$6d74810286a15183$exports = {
|
|
401
|
+
"dismiss": `Dismiss`
|
|
402
|
+
};
|
|
403
|
+
var $309d73dc65f78055$exports = {};
|
|
404
|
+
$309d73dc65f78055$exports = {
|
|
405
|
+
"dismiss": `Descartar`
|
|
406
|
+
};
|
|
407
|
+
var $44ad94f7205cf593$exports = {};
|
|
408
|
+
$44ad94f7205cf593$exports = {
|
|
409
|
+
"dismiss": `Lõpeta`
|
|
410
|
+
};
|
|
411
|
+
var $7c28f5687f0779a9$exports = {};
|
|
412
|
+
$7c28f5687f0779a9$exports = {
|
|
413
|
+
"dismiss": `Hylkää`
|
|
414
|
+
};
|
|
415
|
+
var $e6d75df4b68bd73a$exports = {};
|
|
416
|
+
$e6d75df4b68bd73a$exports = {
|
|
417
|
+
"dismiss": `Rejeter`
|
|
418
|
+
};
|
|
419
|
+
var $87505c9dab186d0f$exports = {};
|
|
420
|
+
$87505c9dab186d0f$exports = {
|
|
421
|
+
"dismiss": `התעלם`
|
|
422
|
+
};
|
|
423
|
+
var $553439c3ffb3e492$exports = {};
|
|
424
|
+
$553439c3ffb3e492$exports = {
|
|
425
|
+
"dismiss": `Odbaci`
|
|
426
|
+
};
|
|
427
|
+
var $74cf411061b983a2$exports = {};
|
|
428
|
+
$74cf411061b983a2$exports = {
|
|
429
|
+
"dismiss": `Elutasítás`
|
|
430
|
+
};
|
|
431
|
+
var $e933f298574dc435$exports = {};
|
|
432
|
+
$e933f298574dc435$exports = {
|
|
433
|
+
"dismiss": `Ignora`
|
|
434
|
+
};
|
|
435
|
+
var $ac91fc9fe02f71f6$exports = {};
|
|
436
|
+
$ac91fc9fe02f71f6$exports = {
|
|
437
|
+
"dismiss": `閉じる`
|
|
438
|
+
};
|
|
439
|
+
var $52b96f86422025af$exports = {};
|
|
440
|
+
$52b96f86422025af$exports = {
|
|
441
|
+
"dismiss": `무시`
|
|
442
|
+
};
|
|
443
|
+
var $c0d724c3e51dafa6$exports = {};
|
|
444
|
+
$c0d724c3e51dafa6$exports = {
|
|
445
|
+
"dismiss": `Atmesti`
|
|
446
|
+
};
|
|
447
|
+
var $c92899672a3fe72e$exports = {};
|
|
448
|
+
$c92899672a3fe72e$exports = {
|
|
449
|
+
"dismiss": `Nerādīt`
|
|
450
|
+
};
|
|
451
|
+
var $9f576b39d8e7a9d6$exports = {};
|
|
452
|
+
$9f576b39d8e7a9d6$exports = {
|
|
453
|
+
"dismiss": `Lukk`
|
|
454
|
+
};
|
|
455
|
+
var $9d025808aeec81a7$exports = {};
|
|
456
|
+
$9d025808aeec81a7$exports = {
|
|
457
|
+
"dismiss": `Negeren`
|
|
458
|
+
};
|
|
459
|
+
var $fce709921e2c0fa6$exports = {};
|
|
460
|
+
$fce709921e2c0fa6$exports = {
|
|
461
|
+
"dismiss": `Zignoruj`
|
|
462
|
+
};
|
|
463
|
+
var $2599cf0c4ab37f59$exports = {};
|
|
464
|
+
$2599cf0c4ab37f59$exports = {
|
|
465
|
+
"dismiss": `Descartar`
|
|
466
|
+
};
|
|
467
|
+
var $3c220ae7ef8a35fd$exports = {};
|
|
468
|
+
$3c220ae7ef8a35fd$exports = {
|
|
469
|
+
"dismiss": `Dispensar`
|
|
470
|
+
};
|
|
471
|
+
var $93562b5094072f54$exports = {};
|
|
472
|
+
$93562b5094072f54$exports = {
|
|
473
|
+
"dismiss": `Revocare`
|
|
474
|
+
};
|
|
475
|
+
var $cd9e2abd0d06c7b4$exports = {};
|
|
476
|
+
$cd9e2abd0d06c7b4$exports = {
|
|
477
|
+
"dismiss": `Пропустить`
|
|
478
|
+
};
|
|
479
|
+
var $45375701f409adf1$exports = {};
|
|
480
|
+
$45375701f409adf1$exports = {
|
|
481
|
+
"dismiss": `Zrušiť`
|
|
482
|
+
};
|
|
483
|
+
var $27fab53a576de9dd$exports = {};
|
|
484
|
+
$27fab53a576de9dd$exports = {
|
|
485
|
+
"dismiss": `Opusti`
|
|
486
|
+
};
|
|
487
|
+
var $4438748d9952e7c7$exports = {};
|
|
488
|
+
$4438748d9952e7c7$exports = {
|
|
489
|
+
"dismiss": `Odbaci`
|
|
490
|
+
};
|
|
491
|
+
var $0936d7347ef4da4c$exports = {};
|
|
492
|
+
$0936d7347ef4da4c$exports = {
|
|
493
|
+
"dismiss": `Avvisa`
|
|
494
|
+
};
|
|
495
|
+
var $29700c92185d38f8$exports = {};
|
|
496
|
+
$29700c92185d38f8$exports = {
|
|
497
|
+
"dismiss": `Kapat`
|
|
498
|
+
};
|
|
499
|
+
var $662ccaf2be4c25b3$exports = {};
|
|
500
|
+
$662ccaf2be4c25b3$exports = {
|
|
501
|
+
"dismiss": `Скасувати`
|
|
502
|
+
};
|
|
503
|
+
var $d80a27deda7cdb3c$exports = {};
|
|
504
|
+
$d80a27deda7cdb3c$exports = {
|
|
505
|
+
"dismiss": `取消`
|
|
506
|
+
};
|
|
507
|
+
var $2b2734393847c884$exports = {};
|
|
508
|
+
$2b2734393847c884$exports = {
|
|
509
|
+
"dismiss": `關閉`
|
|
510
|
+
};
|
|
511
|
+
var $a2f21f5f14f60553$exports = {};
|
|
512
|
+
$a2f21f5f14f60553$exports = {
|
|
513
|
+
"ar-AE": $773d5888b972f1cf$exports,
|
|
514
|
+
"bg-BG": $d11f19852b941573$exports,
|
|
515
|
+
"cs-CZ": $b983974c2ee1efb3$exports,
|
|
516
|
+
"da-DK": $5809cc9d4e92de73$exports,
|
|
517
|
+
"de-DE": $c68c2e4fc74398d1$exports,
|
|
518
|
+
"el-GR": $0898b4c153db2b77$exports,
|
|
519
|
+
"en-US": $6d74810286a15183$exports,
|
|
520
|
+
"es-ES": $309d73dc65f78055$exports,
|
|
521
|
+
"et-EE": $44ad94f7205cf593$exports,
|
|
522
|
+
"fi-FI": $7c28f5687f0779a9$exports,
|
|
523
|
+
"fr-FR": $e6d75df4b68bd73a$exports,
|
|
524
|
+
"he-IL": $87505c9dab186d0f$exports,
|
|
525
|
+
"hr-HR": $553439c3ffb3e492$exports,
|
|
526
|
+
"hu-HU": $74cf411061b983a2$exports,
|
|
527
|
+
"it-IT": $e933f298574dc435$exports,
|
|
528
|
+
"ja-JP": $ac91fc9fe02f71f6$exports,
|
|
529
|
+
"ko-KR": $52b96f86422025af$exports,
|
|
530
|
+
"lt-LT": $c0d724c3e51dafa6$exports,
|
|
531
|
+
"lv-LV": $c92899672a3fe72e$exports,
|
|
532
|
+
"nb-NO": $9f576b39d8e7a9d6$exports,
|
|
533
|
+
"nl-NL": $9d025808aeec81a7$exports,
|
|
534
|
+
"pl-PL": $fce709921e2c0fa6$exports,
|
|
535
|
+
"pt-BR": $2599cf0c4ab37f59$exports,
|
|
536
|
+
"pt-PT": $3c220ae7ef8a35fd$exports,
|
|
537
|
+
"ro-RO": $93562b5094072f54$exports,
|
|
538
|
+
"ru-RU": $cd9e2abd0d06c7b4$exports,
|
|
539
|
+
"sk-SK": $45375701f409adf1$exports,
|
|
540
|
+
"sl-SI": $27fab53a576de9dd$exports,
|
|
541
|
+
"sr-SP": $4438748d9952e7c7$exports,
|
|
542
|
+
"sv-SE": $0936d7347ef4da4c$exports,
|
|
543
|
+
"tr-TR": $29700c92185d38f8$exports,
|
|
544
|
+
"uk-UA": $662ccaf2be4c25b3$exports,
|
|
545
|
+
"zh-CN": $d80a27deda7cdb3c$exports,
|
|
546
|
+
"zh-TW": $2b2734393847c884$exports
|
|
547
|
+
};
|
|
548
|
+
function $parcel$interopDefault(a) {
|
|
549
|
+
return a && a.__esModule ? a.default : a;
|
|
550
|
+
}
|
|
551
|
+
function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
|
|
552
|
+
let { onDismiss, ...otherProps } = props;
|
|
553
|
+
let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault($a2f21f5f14f60553$exports), "@react-aria/overlays");
|
|
554
|
+
let labels = $313b98861ee5dd6c$export$d6875122194c7b44(otherProps, stringFormatter.format("dismiss"));
|
|
555
|
+
let onClick = () => {
|
|
556
|
+
if (onDismiss)
|
|
557
|
+
onDismiss();
|
|
558
|
+
};
|
|
559
|
+
return /* @__PURE__ */ React__default.createElement($5c3e21d68f1c4674$export$439d29a4e110a164, null, /* @__PURE__ */ React__default.createElement("button", {
|
|
560
|
+
...labels,
|
|
561
|
+
tabIndex: -1,
|
|
562
|
+
onClick,
|
|
563
|
+
style: {
|
|
564
|
+
width: 1,
|
|
565
|
+
height: 1
|
|
566
|
+
}
|
|
567
|
+
}));
|
|
568
|
+
}
|
|
569
|
+
function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
|
|
570
|
+
let { triggerRef, popoverRef, isNonModal, isKeyboardDismissDisabled, shouldCloseOnInteractOutside, ...otherProps } = props;
|
|
571
|
+
let { overlayProps, underlayProps } = $a11501f3d1d39e6c$export$ea8f71083e90600f({
|
|
572
|
+
isOpen: state.isOpen,
|
|
573
|
+
onClose: state.close,
|
|
574
|
+
shouldCloseOnBlur: true,
|
|
575
|
+
isDismissable: !isNonModal,
|
|
576
|
+
isKeyboardDismissDisabled,
|
|
577
|
+
shouldCloseOnInteractOutside
|
|
578
|
+
}, popoverRef);
|
|
579
|
+
let { overlayProps: positionProps, arrowProps, placement } = $2a41e45df1593e64$export$d39e1813b3bdd0e1({
|
|
580
|
+
...otherProps,
|
|
581
|
+
targetRef: triggerRef,
|
|
582
|
+
overlayRef: popoverRef,
|
|
583
|
+
isOpen: state.isOpen,
|
|
584
|
+
onClose: isNonModal ? state.close : null
|
|
585
|
+
});
|
|
586
|
+
$49c51c25361d4cd2$export$ee0f7cc6afcd1c18({
|
|
587
|
+
isDisabled: isNonModal || !state.isOpen
|
|
588
|
+
});
|
|
589
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
590
|
+
if (state.isOpen && !isNonModal && popoverRef.current)
|
|
591
|
+
return $5e3802645cc19319$export$1c3ebcada18427bf([
|
|
592
|
+
popoverRef.current
|
|
593
|
+
]);
|
|
594
|
+
}, [
|
|
595
|
+
isNonModal,
|
|
596
|
+
state.isOpen,
|
|
597
|
+
popoverRef
|
|
598
|
+
]);
|
|
599
|
+
return {
|
|
600
|
+
popoverProps: $3ef42575df84b30b$export$9d1611c77c2fe928(overlayProps, positionProps),
|
|
601
|
+
arrowProps,
|
|
602
|
+
underlayProps,
|
|
603
|
+
placement
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
const $96b38030c423d352$export$60d741e20e0aa309 = /* @__PURE__ */ createContext({});
|
|
607
|
+
function $96b38030c423d352$export$574e9b0fb070c3b0() {
|
|
608
|
+
var _useContext;
|
|
609
|
+
return (_useContext = useContext($96b38030c423d352$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
|
|
610
|
+
}
|
|
611
|
+
const $337b884510726a0d$export$a2200b96afd16271 = /* @__PURE__ */ React__default.createContext(null);
|
|
612
|
+
function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
|
|
613
|
+
let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273();
|
|
614
|
+
let { portalContainer = isSSR ? null : document.body, isExiting } = props;
|
|
615
|
+
let [contain, setContain] = useState(false);
|
|
616
|
+
let contextValue = useMemo(() => ({
|
|
617
|
+
contain,
|
|
618
|
+
setContain
|
|
619
|
+
}), [
|
|
620
|
+
contain,
|
|
621
|
+
setContain
|
|
622
|
+
]);
|
|
623
|
+
let { getContainer } = $96b38030c423d352$export$574e9b0fb070c3b0();
|
|
624
|
+
if (!props.portalContainer && getContainer)
|
|
625
|
+
portalContainer = getContainer();
|
|
626
|
+
if (!portalContainer)
|
|
627
|
+
return null;
|
|
628
|
+
let contents = props.children;
|
|
629
|
+
if (!props.disableFocusManagement)
|
|
630
|
+
contents = /* @__PURE__ */ React__default.createElement($9bf71ea28793e738$export$20e40289641fbbb6, {
|
|
631
|
+
restoreFocus: true,
|
|
632
|
+
contain: contain && !isExiting
|
|
633
|
+
}, contents);
|
|
634
|
+
contents = /* @__PURE__ */ React__default.createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
|
|
635
|
+
value: contextValue
|
|
636
|
+
}, /* @__PURE__ */ React__default.createElement($f1ab8c75478c6f73$export$cf75428e0b9ed1ea, null, contents));
|
|
637
|
+
return /* @__PURE__ */ $dbSRa$reactdom.createPortal(contents, portalContainer);
|
|
638
|
+
}
|
|
639
|
+
function $337b884510726a0d$export$14c98a7594375490() {
|
|
640
|
+
let ctx = useContext($337b884510726a0d$export$a2200b96afd16271);
|
|
641
|
+
let setContain = ctx === null || ctx === void 0 ? void 0 : ctx.setContain;
|
|
642
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
643
|
+
setContain === null || setContain === void 0 ? void 0 : setContain(true);
|
|
644
|
+
}, [
|
|
645
|
+
setContain
|
|
646
|
+
]);
|
|
647
|
+
}
|
|
648
|
+
function $40df3f8667284809$export$d55e7ee900f34e93(props, ref) {
|
|
649
|
+
let { role = "dialog" } = props;
|
|
650
|
+
let titleId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
|
|
651
|
+
titleId = props["aria-label"] ? void 0 : titleId;
|
|
652
|
+
let isRefocusing = useRef(false);
|
|
653
|
+
useEffect(() => {
|
|
654
|
+
if (ref.current && !ref.current.contains(document.activeElement)) {
|
|
655
|
+
$6a99195332edec8b$export$80f3e147d781571c(ref.current);
|
|
656
|
+
let timeout = setTimeout(() => {
|
|
657
|
+
if (document.activeElement === ref.current) {
|
|
658
|
+
isRefocusing.current = true;
|
|
659
|
+
if (ref.current) {
|
|
660
|
+
ref.current.blur();
|
|
661
|
+
$6a99195332edec8b$export$80f3e147d781571c(ref.current);
|
|
662
|
+
}
|
|
663
|
+
isRefocusing.current = false;
|
|
664
|
+
}
|
|
665
|
+
}, 500);
|
|
666
|
+
return () => {
|
|
667
|
+
clearTimeout(timeout);
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
}, [
|
|
671
|
+
ref
|
|
672
|
+
]);
|
|
673
|
+
$337b884510726a0d$export$14c98a7594375490();
|
|
674
|
+
return {
|
|
675
|
+
dialogProps: {
|
|
676
|
+
...$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
677
|
+
labelable: true
|
|
678
|
+
}),
|
|
679
|
+
role,
|
|
680
|
+
tabIndex: -1,
|
|
681
|
+
"aria-labelledby": props["aria-labelledby"] || titleId,
|
|
682
|
+
// Prevent blur events from reaching useOverlay, which may cause
|
|
683
|
+
// popovers to close. Since focus is contained within the dialog,
|
|
684
|
+
// we don't want this to occur due to the above useEffect.
|
|
685
|
+
onBlur: (e) => {
|
|
686
|
+
if (isRefocusing.current)
|
|
687
|
+
e.stopPropagation();
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
titleProps: {
|
|
691
|
+
id: titleId
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
const $07b14b47974efb58$export$9b9a0cd73afb7ca4 = /* @__PURE__ */ createContext(null);
|
|
696
|
+
function $07b14b47974efb58$var$Popover(props, ref) {
|
|
697
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $07b14b47974efb58$export$9b9a0cd73afb7ca4);
|
|
698
|
+
let contextState = useContext($de32f1b87079253c$export$d2f961adcb0afbe);
|
|
699
|
+
let localState = $fc909762b330b746$export$61c6a8c84e605fb6(props);
|
|
700
|
+
let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;
|
|
701
|
+
let isExiting = $64fa3d84918910a7$export$45fda7c47f93fd48(ref, state.isOpen) || props.isExiting || false;
|
|
702
|
+
let isHidden = useContext($64fa3d84918910a7$export$94b6d0abf7d33e8c);
|
|
703
|
+
if (isHidden) {
|
|
704
|
+
let children = props.children;
|
|
705
|
+
if (typeof children === "function")
|
|
706
|
+
children = children({
|
|
707
|
+
trigger: props.trigger || null,
|
|
708
|
+
placement: "bottom",
|
|
709
|
+
isEntering: false,
|
|
710
|
+
isExiting: false,
|
|
711
|
+
defaultChildren: null
|
|
712
|
+
});
|
|
713
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children);
|
|
714
|
+
}
|
|
715
|
+
if (state && !state.isOpen && !isExiting)
|
|
716
|
+
return null;
|
|
717
|
+
return /* @__PURE__ */ React__default.createElement($07b14b47974efb58$var$PopoverInner, {
|
|
718
|
+
...props,
|
|
719
|
+
triggerRef: props.triggerRef,
|
|
720
|
+
state,
|
|
721
|
+
popoverRef: ref,
|
|
722
|
+
isExiting
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
const $07b14b47974efb58$export$5b6b19405a83ff9d = /* @__PURE__ */ forwardRef($07b14b47974efb58$var$Popover);
|
|
726
|
+
function $07b14b47974efb58$var$PopoverInner({ state, isExiting, UNSTABLE_portalContainer, ...props }) {
|
|
727
|
+
let arrowRef = useRef(null);
|
|
728
|
+
let [arrowWidth, setArrowWidth] = useState(0);
|
|
729
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
730
|
+
if (arrowRef.current && state.isOpen)
|
|
731
|
+
setArrowWidth(arrowRef.current.getBoundingClientRect().width);
|
|
732
|
+
}, [
|
|
733
|
+
state.isOpen,
|
|
734
|
+
arrowRef
|
|
735
|
+
]);
|
|
736
|
+
var _props_offset;
|
|
737
|
+
let { popoverProps, underlayProps, arrowProps, placement } = $f2f8a6077418541e$export$542a6fd13ac93354({
|
|
738
|
+
...props,
|
|
739
|
+
offset: (_props_offset = props.offset) !== null && _props_offset !== void 0 ? _props_offset : 8,
|
|
740
|
+
arrowSize: arrowWidth
|
|
741
|
+
}, state);
|
|
742
|
+
let ref = props.popoverRef;
|
|
743
|
+
let isEntering = $64fa3d84918910a7$export$6d3443f2c48bfc20(ref, !!placement) || props.isEntering || false;
|
|
744
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
745
|
+
...props,
|
|
746
|
+
defaultClassName: "react-aria-Popover",
|
|
747
|
+
values: {
|
|
748
|
+
trigger: props.trigger || null,
|
|
749
|
+
placement,
|
|
750
|
+
isEntering,
|
|
751
|
+
isExiting
|
|
752
|
+
}
|
|
753
|
+
});
|
|
754
|
+
let style = {
|
|
755
|
+
...popoverProps.style,
|
|
756
|
+
...renderProps.style
|
|
757
|
+
};
|
|
758
|
+
return /* @__PURE__ */ React__default.createElement($337b884510726a0d$export$c6fdb837b070b4ff, {
|
|
759
|
+
isExiting,
|
|
760
|
+
portalContainer: UNSTABLE_portalContainer
|
|
761
|
+
}, !props.isNonModal && state.isOpen && /* @__PURE__ */ React__default.createElement("div", {
|
|
762
|
+
"data-testid": "underlay",
|
|
763
|
+
...underlayProps,
|
|
764
|
+
style: {
|
|
765
|
+
position: "fixed",
|
|
766
|
+
inset: 0
|
|
767
|
+
}
|
|
768
|
+
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
769
|
+
...$3ef42575df84b30b$export$9d1611c77c2fe928($65484d02dcb7eb3e$export$457c3d6518dd4c6f(props), popoverProps),
|
|
770
|
+
...renderProps,
|
|
771
|
+
ref,
|
|
772
|
+
slot: props.slot || void 0,
|
|
773
|
+
style,
|
|
774
|
+
"data-trigger": props.trigger,
|
|
775
|
+
"data-placement": placement,
|
|
776
|
+
"data-entering": isEntering || void 0,
|
|
777
|
+
"data-exiting": isExiting || void 0
|
|
778
|
+
}, !props.isNonModal && /* @__PURE__ */ React__default.createElement($86ea4cb521eb2e37$export$2317d149ed6f78c4, {
|
|
779
|
+
onDismiss: state.close
|
|
780
|
+
}), /* @__PURE__ */ React__default.createElement($44f671af83e7d9e0$export$2de4954e8ae13b9f.Provider, {
|
|
781
|
+
value: {
|
|
782
|
+
...arrowProps,
|
|
783
|
+
placement,
|
|
784
|
+
ref: arrowRef
|
|
785
|
+
}
|
|
786
|
+
}, renderProps.children), /* @__PURE__ */ React__default.createElement($86ea4cb521eb2e37$export$2317d149ed6f78c4, {
|
|
787
|
+
onDismiss: state.close
|
|
788
|
+
})));
|
|
789
|
+
}
|
|
790
|
+
const $de32f1b87079253c$export$8b93a07348a7730c = /* @__PURE__ */ createContext(null);
|
|
791
|
+
const $de32f1b87079253c$export$d2f961adcb0afbe = /* @__PURE__ */ createContext(null);
|
|
792
|
+
function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
|
|
793
|
+
let state = $fc909762b330b746$export$61c6a8c84e605fb6(props);
|
|
794
|
+
let buttonRef = useRef(null);
|
|
795
|
+
let { triggerProps, overlayProps } = $628037886ba31236$export$f9d5c8beee7d008d({
|
|
796
|
+
type: "dialog"
|
|
797
|
+
}, state, buttonRef);
|
|
798
|
+
triggerProps.id = $bdb11010cef70236$export$f680877a34711e37();
|
|
799
|
+
overlayProps["aria-labelledby"] = triggerProps.id;
|
|
800
|
+
return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
801
|
+
values: [
|
|
802
|
+
[
|
|
803
|
+
$de32f1b87079253c$export$d2f961adcb0afbe,
|
|
804
|
+
state
|
|
805
|
+
],
|
|
806
|
+
[
|
|
807
|
+
$de32f1b87079253c$export$8b93a07348a7730c,
|
|
808
|
+
overlayProps
|
|
809
|
+
],
|
|
810
|
+
[
|
|
811
|
+
$07b14b47974efb58$export$9b9a0cd73afb7ca4,
|
|
812
|
+
{
|
|
813
|
+
trigger: "DialogTrigger",
|
|
814
|
+
triggerRef: buttonRef
|
|
815
|
+
}
|
|
816
|
+
]
|
|
817
|
+
]
|
|
818
|
+
}, /* @__PURE__ */ React__default.createElement($f1ab8c75478c6f73$export$3351871ee4b288b8, {
|
|
819
|
+
...triggerProps,
|
|
820
|
+
ref: buttonRef,
|
|
821
|
+
isPressed: state.isOpen
|
|
822
|
+
}, props.children));
|
|
823
|
+
}
|
|
824
|
+
function $de32f1b87079253c$var$Dialog(props, ref) {
|
|
825
|
+
let originalAriaLabelledby = props["aria-labelledby"];
|
|
826
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $de32f1b87079253c$export$8b93a07348a7730c);
|
|
827
|
+
let { dialogProps, titleProps } = $40df3f8667284809$export$d55e7ee900f34e93({
|
|
828
|
+
...props,
|
|
829
|
+
// Only pass aria-labelledby from props, not context.
|
|
830
|
+
// Context is used as a fallback below.
|
|
831
|
+
"aria-labelledby": originalAriaLabelledby
|
|
832
|
+
}, ref);
|
|
833
|
+
let state = useContext($de32f1b87079253c$export$d2f961adcb0afbe);
|
|
834
|
+
let children = props.children;
|
|
835
|
+
if (typeof children === "function")
|
|
836
|
+
children = children({
|
|
837
|
+
close: (state === null || state === void 0 ? void 0 : state.close) || (() => {
|
|
838
|
+
})
|
|
839
|
+
});
|
|
840
|
+
if (!dialogProps["aria-label"] && !dialogProps["aria-labelledby"]) {
|
|
841
|
+
if (props["aria-labelledby"])
|
|
842
|
+
dialogProps["aria-labelledby"] = props["aria-labelledby"];
|
|
843
|
+
else
|
|
844
|
+
console.warn('If a Dialog does not contain a <Heading slot="title">, it must have an aria-label or aria-labelledby attribute for accessibility.');
|
|
845
|
+
}
|
|
846
|
+
var _props_className;
|
|
847
|
+
return /* @__PURE__ */ React__default.createElement("section", {
|
|
848
|
+
...$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props),
|
|
849
|
+
...dialogProps,
|
|
850
|
+
ref,
|
|
851
|
+
slot: props.slot || void 0,
|
|
852
|
+
style: props.style,
|
|
853
|
+
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : "react-aria-Dialog"
|
|
854
|
+
}, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
855
|
+
values: [
|
|
856
|
+
[
|
|
857
|
+
$4e85f108e88277b8$export$d688439359537581,
|
|
858
|
+
{
|
|
859
|
+
slots: {
|
|
860
|
+
[$64fa3d84918910a7$export$c62b8e45d58ddad9]: {},
|
|
861
|
+
title: {
|
|
862
|
+
...titleProps,
|
|
863
|
+
level: 2
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
]
|
|
868
|
+
]
|
|
869
|
+
}, children));
|
|
870
|
+
}
|
|
871
|
+
const $de32f1b87079253c$export$3ddf2d174ce01153 = /* @__PURE__ */ forwardRef($de32f1b87079253c$var$Dialog);
|
|
872
|
+
/**
|
|
873
|
+
* A popover component.
|
|
874
|
+
*
|
|
875
|
+
* Two modes of operation are supported:
|
|
876
|
+
* - **controlled mode**: pass `isOpen` and `onOpenChange` to control when the popover is open.
|
|
877
|
+
* - **uncontrolled mode**: pass `openByDefault` to set the initial popover state. The show/hide state will be managed internally, based on the interaction with the trigger button.
|
|
878
|
+
*
|
|
879
|
+
* @component
|
|
880
|
+
* @param {Object} props - Component props.
|
|
881
|
+
* @param {React.Ref} props.triggerRef - Ref of the trigger button. In uncontrolled mode, this element will be used to open the popover. In controlled mode, the popover will be anchored to this element.
|
|
882
|
+
* @param {boolean} [props.openByDefault=false] - (**Controlled mode**) If `true`, the popover is open by default.
|
|
883
|
+
* @param {boolean} props.isOpen - (**Uncontrolled mode**) If `true`, the popover is open.
|
|
884
|
+
* @param {Function} props.onOpenChange - (**Uncontrolled mode**) Function to run when the popover is opened or closed. `(isOpen: boolean) => void`.
|
|
885
|
+
* @param {PopoverPlacement} props.placement - The placement of the popover.
|
|
886
|
+
* @param {string} [props.className] - Classes to pass to the popover contents.
|
|
887
|
+
* @param {string} [props.wrapperClassName] - Classes to pass to the popover wrapper.
|
|
888
|
+
* @param {Object} props.style - Styles to pass to the popover.
|
|
889
|
+
* @param {number} props.offset - Offset from the trigger element, on the same axis as the placement of the popover (e.g. if `placement` is `left`, this controls the horizontal spacing from the element).
|
|
890
|
+
* @param {number} props.crossOffset - Offset from the trigger element, on the opposite axis as the placement of the popover (e.g. if `placement` is `left`, this controls the vertical spacing from the element).
|
|
891
|
+
* @param {number} props.containerPadding - Space that should be left between the popover and the edge of the container (the default container is browser window).
|
|
892
|
+
* @param {boolean} props.shouldFlip - If `true`, the popover should flip when there is not enough space.
|
|
893
|
+
* @param {Function} [props.shouldCloseOnInteractOutside=() => true] - Allows ignoring close events for certain elements. `(element: HTMLElement) => boolean`.
|
|
894
|
+
*
|
|
895
|
+
* @returns {JSX.Element} The Popover component.
|
|
896
|
+
*
|
|
897
|
+
* @typedef {'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' | 'top' | 'top left' | 'top right' | 'top start' | 'top end' | 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' | 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom'} PopoverPlacement
|
|
898
|
+
*
|
|
899
|
+
* @example
|
|
900
|
+
* // Uncontrolled mode.
|
|
901
|
+
* const ref = useRef(null);
|
|
902
|
+
*
|
|
903
|
+
* <Button forwardedRef={ref}>Open popover</Button>
|
|
904
|
+
*
|
|
905
|
+
* <Popover
|
|
906
|
+
* triggerRef={triggerRef}
|
|
907
|
+
* openByDefault={true}
|
|
908
|
+
* >
|
|
909
|
+
* ...
|
|
910
|
+
* </Popover>
|
|
911
|
+
*
|
|
912
|
+
* @example
|
|
913
|
+
* // Controlled mode.
|
|
914
|
+
* const [open, setOpen] = useState(false);
|
|
915
|
+
*
|
|
916
|
+
* <Button onPress={() => setOpen(true)}>Open popover</Button>
|
|
917
|
+
*
|
|
918
|
+
* <Popover
|
|
919
|
+
* onOpenChange={setOpen}
|
|
920
|
+
* isOpen={open}
|
|
921
|
+
* triggerRef={triggerRef}
|
|
922
|
+
* >
|
|
923
|
+
* ...
|
|
924
|
+
* <Button onPress={() => setOpen(false)}>Close popover</Button>
|
|
925
|
+
* </Popover>
|
|
926
|
+
*
|
|
927
|
+
* @preserve
|
|
928
|
+
*/
|
|
929
|
+
const Popover = (props) => {
|
|
930
|
+
const {
|
|
931
|
+
children,
|
|
932
|
+
triggerRef,
|
|
933
|
+
openByDefault,
|
|
934
|
+
isOpen,
|
|
935
|
+
onOpenChange,
|
|
936
|
+
placement,
|
|
937
|
+
className,
|
|
938
|
+
wrapperClassName,
|
|
939
|
+
style,
|
|
940
|
+
offset,
|
|
941
|
+
crossOffset,
|
|
942
|
+
containerPadding,
|
|
943
|
+
shouldFlip,
|
|
944
|
+
shouldCloseOnInteractOutside = () => true,
|
|
945
|
+
...other
|
|
946
|
+
} = props;
|
|
947
|
+
return /* @__PURE__ */ jsx(
|
|
948
|
+
$07b14b47974efb58$export$5b6b19405a83ff9d,
|
|
949
|
+
{
|
|
950
|
+
shouldFlip,
|
|
951
|
+
shouldCloseOnInteractOutside,
|
|
952
|
+
triggerRef,
|
|
953
|
+
isOpen,
|
|
954
|
+
onOpenChange,
|
|
955
|
+
defaultOpen: openByDefault,
|
|
956
|
+
placement,
|
|
957
|
+
offset,
|
|
958
|
+
crossOffset,
|
|
959
|
+
containerPadding,
|
|
960
|
+
className: ({ isEntering, isExiting }) => classnames(
|
|
961
|
+
"es-uic-rounded-md es-uic-border es-uic-border-gray-200 es-uic-bg-white es-uic-shadow-lg es-uic-outline-none",
|
|
962
|
+
isEntering && "es-uic-outline es-uic-animate-in es-uic-fade-in-0 es-uic-slide-in-from-top-2 es-uic-fill-mode-forwards",
|
|
963
|
+
isExiting && "es-uic-outline es-uic-animate-out es-uic-fade-out-0 es-uic-slide-out-to-top-2 es-uic-fill-mode-forwards",
|
|
964
|
+
wrapperClassName
|
|
965
|
+
),
|
|
966
|
+
style,
|
|
967
|
+
children: /* @__PURE__ */ jsx(
|
|
968
|
+
$de32f1b87079253c$export$3ddf2d174ce01153,
|
|
969
|
+
{
|
|
970
|
+
className: classnames("es-uic-p-1 es-uic-text-sm es-uic-outline-none", className),
|
|
971
|
+
...other,
|
|
972
|
+
children
|
|
973
|
+
}
|
|
974
|
+
)
|
|
975
|
+
}
|
|
976
|
+
);
|
|
977
|
+
};
|
|
978
|
+
/**
|
|
979
|
+
* A simple version of the Popover component that includes a trigger button.
|
|
980
|
+
* The control of the popover is handled internally. A custom trigger can be provided.
|
|
981
|
+
*
|
|
982
|
+
* If you need more control over the trigger, use the Popover component directly.
|
|
983
|
+
*
|
|
984
|
+
* @component
|
|
985
|
+
* @param {Object} props - Component props.
|
|
986
|
+
* @param {JSX.Element} props.trigger - Allows using a custom trigger element.
|
|
987
|
+
* @param {JSX.Element} [props.triggerButtonIcon] - The icon for the built-in trigger button.
|
|
988
|
+
* @param {string} props.triggerButtonLabel - The label for the built-in trigger button.
|
|
989
|
+
* @param {Object} props.triggerButtonProps - Props to pass to the built-in trigger button.
|
|
990
|
+
* @param {Function} props.onOpenChange - Function to run when the popover is opened or closed. `(isOpen: boolean) => void`.
|
|
991
|
+
* @param {boolean} props.openByDefault - If `true`, the popover is open by default.
|
|
992
|
+
* @param {PopoverPlacement} props.placement - The placement of the popover.
|
|
993
|
+
* @param {string} props.className - Classes to pass to the popover.
|
|
994
|
+
* @param {Object} props.style - Styles to pass to the popover.
|
|
995
|
+
* @param {number} props.offset - Offset from the trigger element, on the same axis as the placement of the popover (e.g. if `placement` is `left`, this controls the horizontal spacing from the element).
|
|
996
|
+
* @param {number} props.crossOffset - Offset from the trigger element, on the opposite axis as the placement of the popover (e.g. if `placement` is `left`, this controls the vertical spacing from the element).
|
|
997
|
+
* @param {number} props.containerPadding - Space that should be left between the popover and the edge of the container (the default container is browser window).
|
|
998
|
+
*
|
|
999
|
+
* @returns {JSX.Element} The TriggeredPopover component.
|
|
1000
|
+
*
|
|
1001
|
+
* @typedef {'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' | 'top' | 'top left' | 'top right' | 'top start' | 'top end' | 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' | 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom'} PopoverPlacement
|
|
1002
|
+
*
|
|
1003
|
+
* @example
|
|
1004
|
+
* <TriggeredPopover>
|
|
1005
|
+
* ...
|
|
1006
|
+
* </TriggeredPopover>
|
|
1007
|
+
*
|
|
1008
|
+
* @preserve
|
|
1009
|
+
*/
|
|
1010
|
+
const TriggeredPopover = (props) => {
|
|
1011
|
+
const {
|
|
1012
|
+
trigger,
|
|
1013
|
+
triggerButtonIcon,
|
|
1014
|
+
triggerButtonLabel = !triggerButtonIcon && __("Open", "eightshift-ui-components"),
|
|
1015
|
+
triggerButtonProps,
|
|
1016
|
+
children,
|
|
1017
|
+
onOpenChange,
|
|
1018
|
+
openByDefault,
|
|
1019
|
+
placement,
|
|
1020
|
+
style,
|
|
1021
|
+
className,
|
|
1022
|
+
offset,
|
|
1023
|
+
crossOffset,
|
|
1024
|
+
containerPadding,
|
|
1025
|
+
...rest
|
|
1026
|
+
} = props;
|
|
1027
|
+
return /* @__PURE__ */ jsxs($de32f1b87079253c$export$2e1e1122cf0cba88, { onOpenChange, children: [
|
|
1028
|
+
trigger,
|
|
1029
|
+
!trigger && /* @__PURE__ */ jsx(
|
|
1030
|
+
Button,
|
|
1031
|
+
{
|
|
1032
|
+
icon: triggerButtonIcon,
|
|
1033
|
+
...triggerButtonProps,
|
|
1034
|
+
children: triggerButtonLabel
|
|
1035
|
+
}
|
|
1036
|
+
),
|
|
1037
|
+
/* @__PURE__ */ jsx(
|
|
1038
|
+
Popover,
|
|
1039
|
+
{
|
|
1040
|
+
placement,
|
|
1041
|
+
openByDefault,
|
|
1042
|
+
offset,
|
|
1043
|
+
crossOffset,
|
|
1044
|
+
containerPadding,
|
|
1045
|
+
className,
|
|
1046
|
+
style,
|
|
1047
|
+
...rest,
|
|
1048
|
+
children
|
|
1049
|
+
}
|
|
1050
|
+
)
|
|
1051
|
+
] });
|
|
1052
|
+
};
|
|
1053
|
+
export {
|
|
1054
|
+
$628037886ba31236$export$f9d5c8beee7d008d as $,
|
|
1055
|
+
Popover as P,
|
|
1056
|
+
TriggeredPopover as T,
|
|
1057
|
+
$de32f1b87079253c$export$d2f961adcb0afbe as a,
|
|
1058
|
+
$07b14b47974efb58$export$9b9a0cd73afb7ca4 as b,
|
|
1059
|
+
$f1ab8c75478c6f73$export$3351871ee4b288b8 as c,
|
|
1060
|
+
$e0b6e0b68ec7f50f$export$872b660ac5a1ff98 as d
|
|
1061
|
+
};
|