@qualtrics/ui-react 2.85.1 → 2.85.4
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/CHANGELOG.md +27 -0
- package/dist/__node_modules/@radix-ui/primitive/dist/index.js +14 -3
- package/dist/__node_modules/@radix-ui/primitive/dist/internal/is-development.false.js +4 -0
- package/dist/__node_modules/@radix-ui/react-arrow/dist/index.js +7 -4
- package/dist/__node_modules/@radix-ui/react-collection/dist/index.js +58 -39
- package/dist/__node_modules/@radix-ui/react-compose-refs/dist/index.js +8 -1
- package/dist/__node_modules/@radix-ui/react-context/dist/index.js +35 -12
- package/dist/__node_modules/@radix-ui/react-direction/dist/index.js +10 -3
- package/dist/__node_modules/@radix-ui/react-dismissable-layer/dist/index.js +172 -41
- package/dist/__node_modules/@radix-ui/react-dropdown-menu/dist/index.js +58 -61
- package/dist/__node_modules/@radix-ui/react-focus-guards/dist/index.js +30 -6
- package/dist/__node_modules/@radix-ui/react-focus-scope/dist/index.js +33 -9
- package/dist/__node_modules/@radix-ui/react-id/dist/index.js +6 -0
- package/dist/__node_modules/@radix-ui/react-menu/dist/index.js +107 -79
- package/dist/__node_modules/@radix-ui/react-popper/dist/index.js +79 -38
- package/dist/__node_modules/@radix-ui/react-portal/dist/index.js +9 -6
- package/dist/__node_modules/@radix-ui/react-presence/dist/index.js +71 -12
- package/dist/__node_modules/@radix-ui/react-primitive/dist/index.js +6 -0
- package/dist/__node_modules/@radix-ui/react-roving-focus/dist/index.js +36 -12
- package/dist/__node_modules/@radix-ui/react-slot/dist/index.js +85 -54
- package/dist/__node_modules/@radix-ui/react-use-callback-ref/dist/index.js +6 -1
- package/dist/__node_modules/@radix-ui/react-use-controllable-state/dist/index.js +14 -4
- package/dist/__node_modules/@radix-ui/react-use-effect-event/dist/index.js +6 -1
- package/dist/__node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +37 -0
- package/dist/__node_modules/@radix-ui/react-use-layout-effect/dist/index.js +1 -1
- package/dist/__node_modules/@radix-ui/react-use-size/dist/index.js +6 -0
- package/dist/__shared/cjs/{index-21aa4d43.js → index-08198ff4.js} +140 -136
- package/dist/__shared/cjs/{index-e3d48e21.js → index-e51bbd75.js} +4 -4
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/ConfigPane/ConfigPane.js +6 -2
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +1 -1
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/design-tokens/less/typography.js +3 -3
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/components/BadgeHandIcon.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/InputField.js +3 -3
- package/dist/next/Indicator/Indicator2.js +3 -3
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/next/Menu/Hooks/useFlyoutNode.js +48 -0
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuButton.js +4 -3
- package/dist/next/Menu/MenuItem.js +3 -2
- package/dist/next/Menu/MenuPane.js +17 -16
- package/dist/next/Menu/PaneChildren.js +15 -10
- package/dist/next/Menu/SubMenu.js +17 -16
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.js +1055 -519
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/icons/package.json +5 -5
- package/next/package.json +6 -6
- package/package.json +15 -15
- package/dist/__node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -23
|
@@ -5,11 +5,14 @@ import { composeEventHandlers } from '../../primitive/dist/index.js';
|
|
|
5
5
|
import { Primitive, dispatchDiscreteCustomEvent } from '../../react-primitive/dist/index.js';
|
|
6
6
|
import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
|
|
7
7
|
import { useCallbackRef } from '../../react-use-callback-ref/dist/index.js';
|
|
8
|
-
import { useEscapeKeydown } from '../../react-use-escape-keydown/dist/index.js';
|
|
9
8
|
|
|
10
9
|
"use client";
|
|
11
|
-
const _excluded = ["disableOutsidePointerEvents", "onEscapeKeyDown", "onPointerDownOutside", "onFocusOutside", "onInteractOutside", "onDismiss"];
|
|
12
|
-
var
|
|
10
|
+
const _excluded = ["disableOutsidePointerEvents", "deferPointerDownOutside", "onEscapeKeyDown", "onPointerDownOutside", "onFocusOutside", "onInteractOutside", "onDismiss"];
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
13
|
+
value,
|
|
14
|
+
configurable: true
|
|
15
|
+
});
|
|
13
16
|
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
14
17
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
15
18
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
@@ -17,12 +20,23 @@ var originalBodyPointerEvents;
|
|
|
17
20
|
var DismissableLayerContext = /*#__PURE__*/React.createContext({
|
|
18
21
|
layers: /* @__PURE__ */new Set(),
|
|
19
22
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */new Set(),
|
|
20
|
-
branches: /* @__PURE__ */new Set()
|
|
23
|
+
branches: /* @__PURE__ */new Set(),
|
|
24
|
+
// Outside elements that belong to a layer's own dismiss affordance (eg, a
|
|
25
|
+
// dialog overlay). Pressing them should dismiss the layer regardless of
|
|
26
|
+
// whether or not they stop propagation.
|
|
27
|
+
//
|
|
28
|
+
// See https://github.com/radix-ui/primitives/issues/3346
|
|
29
|
+
dismissableSurfaces: /* @__PURE__ */new Set()
|
|
21
30
|
});
|
|
22
|
-
var DismissableLayer =
|
|
31
|
+
var DismissableLayer = /* @__PURE__ */React.forwardRef(
|
|
32
|
+
// blank line to reduce diff noise
|
|
33
|
+
/* @__PURE__ */
|
|
34
|
+
__name(function DismissableLayer2(props, forwardedRef) {
|
|
23
35
|
var _node$ownerDocument;
|
|
24
36
|
const _props$disableOutside = props.disableOutsidePointerEvents,
|
|
25
37
|
disableOutsidePointerEvents = _props$disableOutside === void 0 ? false : _props$disableOutside,
|
|
38
|
+
_props$deferPointerDo = props.deferPointerDownOutside,
|
|
39
|
+
deferPointerDownOutside = _props$deferPointerDo === void 0 ? false : _props$deferPointerDo,
|
|
26
40
|
onEscapeKeyDown = props.onEscapeKeyDown,
|
|
27
41
|
onPointerDownOutside = props.onPointerDownOutside,
|
|
28
42
|
onFocusOutside = props.onFocusOutside,
|
|
@@ -38,24 +52,37 @@ var DismissableLayer = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
38
52
|
const _React$useState3 = React.useState({}),
|
|
39
53
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
40
54
|
force = _React$useState4[1];
|
|
41
|
-
const composedRefs = useComposedRefs(forwardedRef,
|
|
55
|
+
const composedRefs = useComposedRefs(forwardedRef, setNode);
|
|
42
56
|
const layers = Array.from(context.layers);
|
|
43
57
|
const _slice = [...context.layersWithOutsidePointerEventsDisabled].slice(-1),
|
|
44
58
|
_slice2 = _slicedToArray(_slice, 1),
|
|
45
59
|
highestLayerWithOutsidePointerEventsDisabled = _slice2[0];
|
|
46
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
60
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = highestLayerWithOutsidePointerEventsDisabled ? layers.indexOf(highestLayerWithOutsidePointerEventsDisabled) : -1;
|
|
47
61
|
const index = node ? layers.indexOf(node) : -1;
|
|
48
62
|
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
49
63
|
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
64
|
+
const isDeferredPointerDownOutsideRef = React.useRef(false);
|
|
50
65
|
const pointerDownOutside = usePointerDownOutside(event => {
|
|
51
|
-
const target = event.target;
|
|
52
|
-
const isPointerDownOnBranch = [...context.branches].some(branch => branch.contains(target));
|
|
53
|
-
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
54
66
|
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
55
67
|
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
56
68
|
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
57
|
-
},
|
|
69
|
+
}, {
|
|
70
|
+
ownerDocument,
|
|
71
|
+
deferPointerDownOutside,
|
|
72
|
+
isDeferredPointerDownOutsideRef,
|
|
73
|
+
dismissableSurfaces: context.dismissableSurfaces,
|
|
74
|
+
shouldHandlePointerDownOutside: React.useCallback(target => {
|
|
75
|
+
if (!(target instanceof Node)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
const isPointerDownOnBranch = [...context.branches].some(branch => branch.contains(target));
|
|
79
|
+
return isPointerEventsEnabled && !isPointerDownOnBranch;
|
|
80
|
+
}, [context.branches, isPointerEventsEnabled])
|
|
81
|
+
});
|
|
58
82
|
const focusOutside = useFocusOutside(event => {
|
|
83
|
+
if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
59
86
|
const target = event.target;
|
|
60
87
|
const isFocusInBranch = [...context.branches].some(branch => branch.contains(target));
|
|
61
88
|
if (isFocusInBranch) return;
|
|
@@ -63,15 +90,28 @@ var DismissableLayer = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
63
90
|
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
64
91
|
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
65
92
|
}, ownerDocument);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (
|
|
93
|
+
const isHighestLayer = node ? index === layers.length - 1 : false;
|
|
94
|
+
const handleKeyDown = useCallbackRef(event => {
|
|
95
|
+
if (event.key !== "Escape") {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
69
98
|
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
70
99
|
if (!event.defaultPrevented && onDismiss) {
|
|
71
100
|
event.preventDefault();
|
|
72
101
|
onDismiss();
|
|
73
102
|
}
|
|
74
|
-
}
|
|
103
|
+
});
|
|
104
|
+
React.useEffect(() => {
|
|
105
|
+
if (!isHighestLayer) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
ownerDocument.addEventListener("keydown", handleKeyDown, {
|
|
109
|
+
capture: true
|
|
110
|
+
});
|
|
111
|
+
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, {
|
|
112
|
+
capture: true
|
|
113
|
+
});
|
|
114
|
+
}, [ownerDocument, isHighestLayer, handleKeyDown]);
|
|
75
115
|
React.useEffect(() => {
|
|
76
116
|
if (!node) return;
|
|
77
117
|
if (disableOutsidePointerEvents) {
|
|
@@ -84,8 +124,11 @@ var DismissableLayer = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
84
124
|
context.layers.add(node);
|
|
85
125
|
dispatchUpdate();
|
|
86
126
|
return () => {
|
|
87
|
-
if (disableOutsidePointerEvents
|
|
88
|
-
|
|
127
|
+
if (disableOutsidePointerEvents) {
|
|
128
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
129
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
130
|
+
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
131
|
+
}
|
|
89
132
|
}
|
|
90
133
|
};
|
|
91
134
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
@@ -98,7 +141,7 @@ var DismissableLayer = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
98
141
|
};
|
|
99
142
|
}, [node, context]);
|
|
100
143
|
React.useEffect(() => {
|
|
101
|
-
const handleUpdate = () => force({});
|
|
144
|
+
const handleUpdate = /* @__PURE__ */__name(() => force({}), "handleUpdate");
|
|
102
145
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
103
146
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
104
147
|
}, []);
|
|
@@ -113,10 +156,8 @@ var DismissableLayer = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
113
156
|
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
114
157
|
onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
115
158
|
});
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
var BRANCH_NAME = "DismissableLayerBranch";
|
|
119
|
-
var DismissableLayerBranch = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
159
|
+
}, "DismissableLayer"));
|
|
160
|
+
var DismissableLayerBranch = /* @__PURE__ */React.forwardRef(/* @__PURE__ */__name(function DismissableLayerBranch2(props, forwardedRef) {
|
|
120
161
|
const context = React.useContext(DismissableLayerContext);
|
|
121
162
|
const ref = React.useRef(null);
|
|
122
163
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
@@ -133,39 +174,121 @@ var DismissableLayerBranch = /*#__PURE__*/React.forwardRef((props, forwardedRef)
|
|
|
133
174
|
...props,
|
|
134
175
|
ref: composedRefs
|
|
135
176
|
});
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
177
|
+
}, "DismissableLayerBranch"));
|
|
178
|
+
function useDismissableLayerSurface() {
|
|
179
|
+
const context = React.useContext(DismissableLayerContext);
|
|
180
|
+
const _React$useState5 = React.useState(null),
|
|
181
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
182
|
+
node = _React$useState6[0],
|
|
183
|
+
setNode = _React$useState6[1];
|
|
184
|
+
React.useEffect(() => {
|
|
185
|
+
if (!node) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
context.dismissableSurfaces.add(node);
|
|
189
|
+
return () => {
|
|
190
|
+
context.dismissableSurfaces.delete(node);
|
|
191
|
+
};
|
|
192
|
+
}, [node, context.dismissableSurfaces]);
|
|
193
|
+
return setNode;
|
|
194
|
+
}
|
|
195
|
+
__name(useDismissableLayerSurface, "useDismissableLayerSurface");
|
|
196
|
+
var IS_TRUE = /* @__PURE__ */__name(() => true, "IS_TRUE");
|
|
197
|
+
function usePointerDownOutside(onPointerDownOutside, args) {
|
|
198
|
+
const _args$ownerDocument = args.ownerDocument,
|
|
199
|
+
ownerDocument = _args$ownerDocument === void 0 ? globalThis === null || globalThis === void 0 ? void 0 : globalThis.document : _args$ownerDocument,
|
|
200
|
+
_args$deferPointerDow = args.deferPointerDownOutside,
|
|
201
|
+
deferPointerDownOutside = _args$deferPointerDow === void 0 ? false : _args$deferPointerDow,
|
|
202
|
+
isDeferredPointerDownOutsideRef = args.isDeferredPointerDownOutsideRef,
|
|
203
|
+
dismissableSurfaces = args.dismissableSurfaces,
|
|
204
|
+
_args$shouldHandlePoi = args.shouldHandlePointerDownOutside,
|
|
205
|
+
shouldHandlePointerDownOutside = _args$shouldHandlePoi === void 0 ? IS_TRUE : _args$shouldHandlePoi;
|
|
140
206
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
141
207
|
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
208
|
+
const isPointerDownOutsideRef = React.useRef(false);
|
|
209
|
+
const interceptedOutsideInteractionEventsRef = React.useRef(/* @__PURE__ */new Map());
|
|
142
210
|
const handleClickRef = React.useRef(() => {});
|
|
143
211
|
React.useEffect(() => {
|
|
144
|
-
|
|
212
|
+
function resetOutsideInteraction() {
|
|
213
|
+
isPointerDownOutsideRef.current = false;
|
|
214
|
+
isDeferredPointerDownOutsideRef.current = false;
|
|
215
|
+
interceptedOutsideInteractionEventsRef.current.clear();
|
|
216
|
+
}
|
|
217
|
+
__name(resetOutsideInteraction, "resetOutsideInteraction");
|
|
218
|
+
function isOutsideInteractionIntercepted() {
|
|
219
|
+
return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);
|
|
220
|
+
}
|
|
221
|
+
__name(isOutsideInteractionIntercepted, "isOutsideInteractionIntercepted");
|
|
222
|
+
function handleInteractionCapture(event) {
|
|
223
|
+
if (!isPointerDownOutsideRef.current) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
const target = event.target;
|
|
227
|
+
const isDismissableSurface = target instanceof Node && [...dismissableSurfaces].some(surface => surface.contains(target));
|
|
228
|
+
if (!isDismissableSurface) {
|
|
229
|
+
interceptedOutsideInteractionEventsRef.current.set(event.type, true);
|
|
230
|
+
}
|
|
231
|
+
if (event.type === "click") {
|
|
232
|
+
window.setTimeout(() => {
|
|
233
|
+
if (isPointerDownOutsideRef.current) {
|
|
234
|
+
handleClickRef.current();
|
|
235
|
+
}
|
|
236
|
+
}, 0);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
__name(handleInteractionCapture, "handleInteractionCapture");
|
|
240
|
+
function handleInteractionBubble(event) {
|
|
241
|
+
if (isPointerDownOutsideRef.current) {
|
|
242
|
+
interceptedOutsideInteractionEventsRef.current.set(event.type, false);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
__name(handleInteractionBubble, "handleInteractionBubble");
|
|
246
|
+
const handlePointerDown = /* @__PURE__ */__name(event => {
|
|
145
247
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
146
248
|
let handleAndDispatchPointerDownOutsideEvent2 = function () {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
249
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
250
|
+
const wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted();
|
|
251
|
+
resetOutsideInteraction();
|
|
252
|
+
if (!wasOutsideInteractionIntercepted) {
|
|
253
|
+
handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
254
|
+
discrete: true
|
|
255
|
+
});
|
|
256
|
+
}
|
|
150
257
|
};
|
|
151
258
|
var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
|
|
259
|
+
__name(handleAndDispatchPointerDownOutsideEvent2, "handleAndDispatchPointerDownOutsideEvent");
|
|
260
|
+
if (!shouldHandlePointerDownOutside(event.target)) {
|
|
261
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
262
|
+
resetOutsideInteraction();
|
|
263
|
+
isPointerInsideReactTreeRef.current = false;
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
152
266
|
const eventDetail = {
|
|
153
267
|
originalEvent: event
|
|
154
268
|
};
|
|
155
|
-
|
|
269
|
+
isPointerDownOutsideRef.current = true;
|
|
270
|
+
isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0;
|
|
271
|
+
interceptedOutsideInteractionEventsRef.current.clear();
|
|
272
|
+
if (!deferPointerDownOutside || event.button !== 0) {
|
|
273
|
+
handleAndDispatchPointerDownOutsideEvent2();
|
|
274
|
+
} else {
|
|
156
275
|
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
157
276
|
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
|
158
277
|
ownerDocument.addEventListener("click", handleClickRef.current, {
|
|
159
278
|
once: true
|
|
160
279
|
});
|
|
161
|
-
} else {
|
|
162
|
-
handleAndDispatchPointerDownOutsideEvent2();
|
|
163
280
|
}
|
|
164
281
|
} else {
|
|
165
282
|
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
283
|
+
resetOutsideInteraction();
|
|
166
284
|
}
|
|
167
285
|
isPointerInsideReactTreeRef.current = false;
|
|
168
|
-
};
|
|
286
|
+
}, "handlePointerDown");
|
|
287
|
+
const outsideInteractionEvents = ["pointerup", "mousedown", "mouseup", "touchstart", "touchend", "click"];
|
|
288
|
+
for (const eventName of outsideInteractionEvents) {
|
|
289
|
+
ownerDocument.addEventListener(eventName, handleInteractionCapture, true);
|
|
290
|
+
ownerDocument.addEventListener(eventName, handleInteractionBubble);
|
|
291
|
+
}
|
|
169
292
|
const timerId = window.setTimeout(() => {
|
|
170
293
|
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
171
294
|
}, 0);
|
|
@@ -173,19 +296,24 @@ function usePointerDownOutside(onPointerDownOutside) {
|
|
|
173
296
|
window.clearTimeout(timerId);
|
|
174
297
|
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
175
298
|
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
299
|
+
for (const eventName of outsideInteractionEvents) {
|
|
300
|
+
ownerDocument.removeEventListener(eventName, handleInteractionCapture, true);
|
|
301
|
+
ownerDocument.removeEventListener(eventName, handleInteractionBubble);
|
|
302
|
+
}
|
|
176
303
|
};
|
|
177
|
-
}, [ownerDocument, handlePointerDownOutside]);
|
|
304
|
+
}, [ownerDocument, handlePointerDownOutside, deferPointerDownOutside, isDeferredPointerDownOutsideRef, dismissableSurfaces, shouldHandlePointerDownOutside]);
|
|
178
305
|
return {
|
|
179
306
|
// ensures we check React component tree (not just DOM tree)
|
|
180
|
-
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
|
307
|
+
onPointerDownCapture: /* @__PURE__ */__name(() => isPointerInsideReactTreeRef.current = true, "onPointerDownCapture")
|
|
181
308
|
};
|
|
182
309
|
}
|
|
310
|
+
__name(usePointerDownOutside, "usePointerDownOutside");
|
|
183
311
|
function useFocusOutside(onFocusOutside) {
|
|
184
312
|
let ownerDocument = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
|
185
313
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
186
314
|
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
187
315
|
React.useEffect(() => {
|
|
188
|
-
const handleFocus = event => {
|
|
316
|
+
const handleFocus = /* @__PURE__ */__name(event => {
|
|
189
317
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
190
318
|
const eventDetail = {
|
|
191
319
|
originalEvent: event
|
|
@@ -194,19 +322,21 @@ function useFocusOutside(onFocusOutside) {
|
|
|
194
322
|
discrete: false
|
|
195
323
|
});
|
|
196
324
|
}
|
|
197
|
-
};
|
|
325
|
+
}, "handleFocus");
|
|
198
326
|
ownerDocument.addEventListener("focusin", handleFocus);
|
|
199
327
|
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
200
328
|
}, [ownerDocument, handleFocusOutside]);
|
|
201
329
|
return {
|
|
202
|
-
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
|
203
|
-
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
|
330
|
+
onFocusCapture: /* @__PURE__ */__name(() => isFocusInsideReactTreeRef.current = true, "onFocusCapture"),
|
|
331
|
+
onBlurCapture: /* @__PURE__ */__name(() => isFocusInsideReactTreeRef.current = false, "onBlurCapture")
|
|
204
332
|
};
|
|
205
333
|
}
|
|
334
|
+
__name(useFocusOutside, "useFocusOutside");
|
|
206
335
|
function dispatchUpdate() {
|
|
207
336
|
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
208
337
|
document.dispatchEvent(event);
|
|
209
338
|
}
|
|
339
|
+
__name(dispatchUpdate, "dispatchUpdate");
|
|
210
340
|
function handleAndDispatchCustomEvent(name, handler, detail, _ref) {
|
|
211
341
|
let discrete = _ref.discrete;
|
|
212
342
|
const target = detail.originalEvent.target;
|
|
@@ -224,7 +354,8 @@ function handleAndDispatchCustomEvent(name, handler, detail, _ref) {
|
|
|
224
354
|
target.dispatchEvent(event);
|
|
225
355
|
}
|
|
226
356
|
}
|
|
357
|
+
__name(handleAndDispatchCustomEvent, "handleAndDispatchCustomEvent");
|
|
227
358
|
var Root = DismissableLayer;
|
|
228
359
|
var Branch = DismissableLayerBranch;
|
|
229
360
|
|
|
230
|
-
export { Branch, DismissableLayer, DismissableLayerBranch, Root };
|
|
361
|
+
export { Branch, DismissableLayer, DismissableLayerBranch, Root, useDismissableLayerSurface };
|
|
@@ -3,7 +3,7 @@ import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
|
3
3
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { composeEventHandlers } from '../../primitive/dist/index.js';
|
|
6
|
-
import {
|
|
6
|
+
import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
|
|
7
7
|
import { createContextScope } from '../../react-context/dist/index.js';
|
|
8
8
|
import { useControllableState } from '../../react-use-controllable-state/dist/index.js';
|
|
9
9
|
import { Primitive } from '../../react-primitive/dist/index.js';
|
|
@@ -25,6 +25,11 @@ const _excluded = ["__scopeDropdownMenu", "disabled"],
|
|
|
25
25
|
_excluded10 = ["__scopeDropdownMenu"],
|
|
26
26
|
_excluded11 = ["__scopeDropdownMenu"],
|
|
27
27
|
_excluded12 = ["__scopeDropdownMenu"];
|
|
28
|
+
var __defProp = Object.defineProperty;
|
|
29
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
30
|
+
value,
|
|
31
|
+
configurable: true
|
|
32
|
+
});
|
|
28
33
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
29
34
|
var _createContextScope = createContextScope(DROPDOWN_MENU_NAME, [createMenuScope]),
|
|
30
35
|
_createContextScope2 = _slicedToArray(_createContextScope, 2),
|
|
@@ -35,7 +40,7 @@ var _createDropdownMenuCo = createDropdownMenuContext(DROPDOWN_MENU_NAME),
|
|
|
35
40
|
_createDropdownMenuCo2 = _slicedToArray(_createDropdownMenuCo, 2),
|
|
36
41
|
DropdownMenuProvider = _createDropdownMenuCo2[0],
|
|
37
42
|
useDropdownMenuContext = _createDropdownMenuCo2[1];
|
|
38
|
-
var DropdownMenu = props => {
|
|
43
|
+
var DropdownMenu = /* @__PURE__ */__name(props => {
|
|
39
44
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
40
45
|
children = props.children,
|
|
41
46
|
dir = props.dir,
|
|
@@ -73,16 +78,19 @@ var DropdownMenu = props => {
|
|
|
73
78
|
children
|
|
74
79
|
})
|
|
75
80
|
});
|
|
76
|
-
};
|
|
77
|
-
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
81
|
+
}, "DropdownMenu");
|
|
78
82
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
79
|
-
var DropdownMenuTrigger =
|
|
83
|
+
var DropdownMenuTrigger = /* @__PURE__ */React.forwardRef(
|
|
84
|
+
// blank line to reduce diff noise
|
|
85
|
+
/* @__PURE__ */
|
|
86
|
+
__name(function DropdownMenuTrigger2(props, forwardedRef) {
|
|
80
87
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
81
88
|
_props$disabled = props.disabled,
|
|
82
89
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
83
90
|
triggerProps = _objectWithoutProperties(props, _excluded);
|
|
84
91
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
85
92
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
93
|
+
const composedRefs = useComposedRefs(forwardedRef, context.triggerRef);
|
|
86
94
|
return /* @__PURE__ */React.createElement(Anchor2, {
|
|
87
95
|
asChild: true,
|
|
88
96
|
...menuScope,
|
|
@@ -96,7 +104,7 @@ var DropdownMenuTrigger = /*#__PURE__*/React.forwardRef((props, forwardedRef) =>
|
|
|
96
104
|
"data-disabled": disabled ? "" : void 0,
|
|
97
105
|
disabled,
|
|
98
106
|
...triggerProps,
|
|
99
|
-
ref:
|
|
107
|
+
ref: composedRefs,
|
|
100
108
|
onPointerDown: composeEventHandlers(props.onPointerDown, event => {
|
|
101
109
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
102
110
|
context.onOpenToggle();
|
|
@@ -112,10 +120,8 @@ var DropdownMenuTrigger = /*#__PURE__*/React.forwardRef((props, forwardedRef) =>
|
|
|
112
120
|
})
|
|
113
121
|
})
|
|
114
122
|
});
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
var PORTAL_NAME = "DropdownMenuPortal";
|
|
118
|
-
var DropdownMenuPortal = props => {
|
|
123
|
+
}, "DropdownMenuTrigger"));
|
|
124
|
+
var DropdownMenuPortal = /* @__PURE__ */__name(props => {
|
|
119
125
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
120
126
|
portalProps = _objectWithoutProperties(props, _excluded2);
|
|
121
127
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -123,10 +129,12 @@ var DropdownMenuPortal = props => {
|
|
|
123
129
|
...menuScope,
|
|
124
130
|
...portalProps
|
|
125
131
|
});
|
|
126
|
-
};
|
|
127
|
-
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
132
|
+
}, "DropdownMenuPortal");
|
|
128
133
|
var CONTENT_NAME = "DropdownMenuContent";
|
|
129
|
-
var DropdownMenuContent =
|
|
134
|
+
var DropdownMenuContent = /* @__PURE__ */React.forwardRef(
|
|
135
|
+
// blank line to reduce diff noise
|
|
136
|
+
/* @__PURE__ */
|
|
137
|
+
__name(function DropdownMenuContent2(props, forwardedRef) {
|
|
130
138
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
131
139
|
contentProps = _objectWithoutProperties(props, _excluded3);
|
|
132
140
|
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
@@ -162,10 +170,11 @@ var DropdownMenuContent = /*#__PURE__*/React.forwardRef((props, forwardedRef) =>
|
|
|
162
170
|
}
|
|
163
171
|
}
|
|
164
172
|
});
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
173
|
+
}, "DropdownMenuContent"));
|
|
174
|
+
var DropdownMenuGroup = /* @__PURE__ */React.forwardRef(
|
|
175
|
+
// blank line to reduce diff noise
|
|
176
|
+
/* @__PURE__ */
|
|
177
|
+
__name(function DropdownMenuGroup2(props, forwardedRef) {
|
|
169
178
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
170
179
|
groupProps = _objectWithoutProperties(props, _excluded4);
|
|
171
180
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -174,10 +183,11 @@ var DropdownMenuGroup = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
174
183
|
...groupProps,
|
|
175
184
|
ref: forwardedRef
|
|
176
185
|
});
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
186
|
+
}, "DropdownMenuGroup"));
|
|
187
|
+
var DropdownMenuLabel = /* @__PURE__ */React.forwardRef(
|
|
188
|
+
// blank line to reduce diff noise
|
|
189
|
+
/* @__PURE__ */
|
|
190
|
+
__name(function DropdownMenuLabel2(props, forwardedRef) {
|
|
181
191
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
182
192
|
labelProps = _objectWithoutProperties(props, _excluded5);
|
|
183
193
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -186,10 +196,11 @@ var DropdownMenuLabel = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
186
196
|
...labelProps,
|
|
187
197
|
ref: forwardedRef
|
|
188
198
|
});
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
199
|
+
}, "DropdownMenuLabel"));
|
|
200
|
+
var DropdownMenuItem = /* @__PURE__ */React.forwardRef(
|
|
201
|
+
// blank line to reduce diff noise
|
|
202
|
+
/* @__PURE__ */
|
|
203
|
+
__name(function DropdownMenuItem2(props, forwardedRef) {
|
|
193
204
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
194
205
|
itemProps = _objectWithoutProperties(props, _excluded6);
|
|
195
206
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -198,10 +209,8 @@ var DropdownMenuItem = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
198
209
|
...itemProps,
|
|
199
210
|
ref: forwardedRef
|
|
200
211
|
});
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
204
|
-
var DropdownMenuCheckboxItem = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
212
|
+
}, "DropdownMenuItem"));
|
|
213
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */React.forwardRef(/* @__PURE__ */__name(function DropdownMenuCheckboxItem2(props, forwardedRef) {
|
|
205
214
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
206
215
|
checkboxItemProps = _objectWithoutProperties(props, _excluded7);
|
|
207
216
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -210,10 +219,8 @@ var DropdownMenuCheckboxItem = /*#__PURE__*/React.forwardRef((props, forwardedRe
|
|
|
210
219
|
...checkboxItemProps,
|
|
211
220
|
ref: forwardedRef
|
|
212
221
|
});
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
216
|
-
var DropdownMenuRadioGroup = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
222
|
+
}, "DropdownMenuCheckboxItem"));
|
|
223
|
+
var DropdownMenuRadioGroup = /* @__PURE__ */React.forwardRef(/* @__PURE__ */__name(function DropdownMenuRadioGroup2(props, forwardedRef) {
|
|
217
224
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
218
225
|
radioGroupProps = _objectWithoutProperties(props, _excluded8);
|
|
219
226
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -222,10 +229,8 @@ var DropdownMenuRadioGroup = /*#__PURE__*/React.forwardRef((props, forwardedRef)
|
|
|
222
229
|
...radioGroupProps,
|
|
223
230
|
ref: forwardedRef
|
|
224
231
|
});
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
228
|
-
var DropdownMenuRadioItem = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
232
|
+
}, "DropdownMenuRadioGroup"));
|
|
233
|
+
var DropdownMenuRadioItem = /* @__PURE__ */React.forwardRef(/* @__PURE__ */__name(function DropdownMenuRadioItem2(props, forwardedRef) {
|
|
229
234
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
230
235
|
radioItemProps = _objectWithoutProperties(props, _excluded9);
|
|
231
236
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -234,10 +239,8 @@ var DropdownMenuRadioItem = /*#__PURE__*/React.forwardRef((props, forwardedRef)
|
|
|
234
239
|
...radioItemProps,
|
|
235
240
|
ref: forwardedRef
|
|
236
241
|
});
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
240
|
-
var DropdownMenuItemIndicator = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
242
|
+
}, "DropdownMenuRadioItem"));
|
|
243
|
+
var DropdownMenuItemIndicator = /* @__PURE__ */React.forwardRef(/* @__PURE__ */__name(function DropdownMenuItemIndicator2(props, forwardedRef) {
|
|
241
244
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
242
245
|
itemIndicatorProps = _objectWithoutProperties(props, _excluded0);
|
|
243
246
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -246,10 +249,8 @@ var DropdownMenuItemIndicator = /*#__PURE__*/React.forwardRef((props, forwardedR
|
|
|
246
249
|
...itemIndicatorProps,
|
|
247
250
|
ref: forwardedRef
|
|
248
251
|
});
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
252
|
-
var DropdownMenuSeparator = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
252
|
+
}, "DropdownMenuItemIndicator"));
|
|
253
|
+
var DropdownMenuSeparator = /* @__PURE__ */React.forwardRef(/* @__PURE__ */__name(function DropdownMenuSeparator2(props, forwardedRef) {
|
|
253
254
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
254
255
|
separatorProps = _objectWithoutProperties(props, _excluded1);
|
|
255
256
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -258,10 +259,11 @@ var DropdownMenuSeparator = /*#__PURE__*/React.forwardRef((props, forwardedRef)
|
|
|
258
259
|
...separatorProps,
|
|
259
260
|
ref: forwardedRef
|
|
260
261
|
});
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
}, "DropdownMenuSeparator"));
|
|
263
|
+
var DropdownMenuArrow = /* @__PURE__ */React.forwardRef(
|
|
264
|
+
// blank line to reduce diff noise
|
|
265
|
+
/* @__PURE__ */
|
|
266
|
+
__name(function DropdownMenuArrow2(props, forwardedRef) {
|
|
265
267
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
266
268
|
arrowProps = _objectWithoutProperties(props, _excluded10);
|
|
267
269
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -270,9 +272,8 @@ var DropdownMenuArrow = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
270
272
|
...arrowProps,
|
|
271
273
|
ref: forwardedRef
|
|
272
274
|
});
|
|
273
|
-
});
|
|
274
|
-
|
|
275
|
-
var DropdownMenuSub = props => {
|
|
275
|
+
}, "DropdownMenuArrow"));
|
|
276
|
+
var DropdownMenuSub = /* @__PURE__ */__name(props => {
|
|
276
277
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
277
278
|
children = props.children,
|
|
278
279
|
openProp = props.open,
|
|
@@ -294,9 +295,8 @@ var DropdownMenuSub = props => {
|
|
|
294
295
|
onOpenChange: setOpen,
|
|
295
296
|
children
|
|
296
297
|
});
|
|
297
|
-
};
|
|
298
|
-
var
|
|
299
|
-
var DropdownMenuSubTrigger = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
298
|
+
}, "DropdownMenuSub");
|
|
299
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */React.forwardRef(/* @__PURE__ */__name(function DropdownMenuSubTrigger2(props, forwardedRef) {
|
|
300
300
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
301
301
|
subTriggerProps = _objectWithoutProperties(props, _excluded11);
|
|
302
302
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -305,10 +305,8 @@ var DropdownMenuSubTrigger = /*#__PURE__*/React.forwardRef((props, forwardedRef)
|
|
|
305
305
|
...subTriggerProps,
|
|
306
306
|
ref: forwardedRef
|
|
307
307
|
});
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
311
|
-
var DropdownMenuSubContent = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
308
|
+
}, "DropdownMenuSubTrigger"));
|
|
309
|
+
var DropdownMenuSubContent = /* @__PURE__ */React.forwardRef(/* @__PURE__ */__name(function DropdownMenuSubContent2(props, forwardedRef) {
|
|
312
310
|
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
313
311
|
subContentProps = _objectWithoutProperties(props, _excluded12);
|
|
314
312
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -328,8 +326,7 @@ var DropdownMenuSubContent = /*#__PURE__*/React.forwardRef((props, forwardedRef)
|
|
|
328
326
|
}
|
|
329
327
|
}
|
|
330
328
|
});
|
|
331
|
-
});
|
|
332
|
-
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
329
|
+
}, "DropdownMenuSubContent"));
|
|
333
330
|
var Root2 = DropdownMenu;
|
|
334
331
|
var Trigger = DropdownMenuTrigger;
|
|
335
332
|
var Portal2 = DropdownMenuPortal;
|