@1771technologies/lytenyte-pro 0.0.39
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/LICENSE +15 -0
- package/dist/DialogPortalContext-C2WZTqJ3.js +47 -0
- package/dist/InternalBackdrop-Dm9czgoC.js +6746 -0
- package/dist/MenuRoot-9n64jNWP.js +724 -0
- package/dist/anchor-context-B9sGQdR5.js +35 -0
- package/dist/arrow-down-icon-B-3ldODD.js +27 -0
- package/dist/arrow-svg-evmXDI_J.js +29 -0
- package/dist/column-manager.js +1241 -0
- package/dist/cross-icon-CEMLAlFX.js +20 -0
- package/dist/dialog.js +506 -0
- package/dist/filter-manager.js +1056 -0
- package/dist/getPseudoElementBounds-BSHt6WYm.js +26 -0
- package/dist/grid-container.js +18 -0
- package/dist/icons.js +512 -0
- package/dist/index.js +3730 -0
- package/dist/lytenyte-pro.css +1948 -0
- package/dist/manage-columns-icon-D4CElo5H.js +146 -0
- package/dist/menu.js +1639 -0
- package/dist/pill-C4Jhdf8E.js +985 -0
- package/dist/pill-manager.js +674 -0
- package/dist/plus-icon-ToqW5CC-.js +15 -0
- package/dist/popover.js +770 -0
- package/dist/row-group-icon-BOOju5Vu.js +205 -0
- package/dist/search-icon-CcG1lqsn.js +86 -0
- package/dist/select-C6xOZZLq.js +2231 -0
- package/dist/sort-manager.js +298 -0
- package/dist/tickmark-icon-CoogRMoO.js +51 -0
- package/dist/types/cell-selection/cell-selection-containers.d.ts +3 -0
- package/dist/types/cell-selection/cell-selection-driver.d.ts +1 -0
- package/dist/types/cell-selection/cell-style-row.d.ts +8 -0
- package/dist/types/column-manager/column-manager-drag-box-controls.d.ts +1 -0
- package/dist/types/column-manager/column-manager-drag-box-expander.d.ts +1 -0
- package/dist/types/column-manager/column-manager-drag-box-label.d.ts +5 -0
- package/dist/types/column-manager/column-manager-drag-box.d.ts +13 -0
- package/dist/types/column-manager/column-manager-drag-placeholder.d.ts +5 -0
- package/dist/types/column-manager/column-manager-drop-zone.d.ts +10 -0
- package/dist/types/column-manager/column-manager-impl.d.ts +36 -0
- package/dist/types/column-manager/column-manager-pill.d.ts +4 -0
- package/dist/types/column-manager/column-manager-pivot-mode-toggle.d.ts +1 -0
- package/dist/types/column-manager/column-manager-search.d.ts +1 -0
- package/dist/types/column-manager/column-manager-state.d.ts +8 -0
- package/dist/types/column-manager/column-manager-tree-item.d.ts +6 -0
- package/dist/types/column-manager/column-manager-tree.d.ts +11 -0
- package/dist/types/column-manager/column-manager-types.d.ts +1 -0
- package/dist/types/column-manager/column-manager.d.ts +1 -0
- package/dist/types/column-manager/column-mananger-context.d.ts +12 -0
- package/dist/types/column-manager/utils/all-leafs.d.ts +3 -0
- package/dist/types/column-manager/utils/can-hide-item.d.ts +3 -0
- package/dist/types/column-manager/utils/handle-item-hide.d.ts +3 -0
- package/dist/types/components-internal/button/button.d.ts +9 -0
- package/dist/types/components-internal/grid-frame/grid-frame.d.ts +11 -0
- package/dist/types/components-internal/radio/radio.d.ts +5 -0
- package/dist/types/components-internal/separator/separator.d.ts +8 -0
- package/dist/types/components-internal/toggle/toggle.d.ts +7 -0
- package/dist/types/dialog/dialog-driver.d.ts +1 -0
- package/dist/types/dialog/dialog-impl.d.ts +6 -0
- package/dist/types/dialog/dialog.d.ts +8 -0
- package/dist/types/dialog/use-dialog-class.d.ts +1 -0
- package/dist/types/external.d.ts +2 -0
- package/dist/types/filter-manager/combined-to-flat.d.ts +3 -0
- package/dist/types/filter-manager/components/apply-filter-button.d.ts +1 -0
- package/dist/types/filter-manager/components/clear-filter-button.d.ts +1 -0
- package/dist/types/filter-manager/components/flatten-tree-items.d.ts +4 -0
- package/dist/types/filter-manager/components/get-child-values.d.ts +2 -0
- package/dist/types/filter-manager/components/in-filter-container.d.ts +1 -0
- package/dist/types/filter-manager/components/in-filter-error.d.ts +5 -0
- package/dist/types/filter-manager/components/in-filter-loading.d.ts +1 -0
- package/dist/types/filter-manager/components/in-filter-root.d.ts +11 -0
- package/dist/types/filter-manager/components/in-filter-tree.d.ts +15 -0
- package/dist/types/filter-manager/components/simple-filter-additional-switch.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-operator/date-operator.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-operator/number-operator.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-operator/simple-filter-operator.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-operator/text-operator.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-root.d.ts +9 -0
- package/dist/types/filter-manager/components/simple-filter-value/date-value.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-value/number-value.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-value/simple-filter-value.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-value/text-value.d.ts +1 -0
- package/dist/types/filter-manager/components/use-date-filter-callbacks.d.ts +9 -0
- package/dist/types/filter-manager/components/use-in-filter-item-loader.d.ts +7 -0
- package/dist/types/filter-manager/components/use-number-filter-callbacks.d.ts +8 -0
- package/dist/types/filter-manager/components/use-text-filter-callbacks.d.ts +8 -0
- package/dist/types/filter-manager/filter-manager-impl.d.ts +27 -0
- package/dist/types/filter-manager/filter-manager.d.ts +1 -0
- package/dist/types/filter-manager/filter-state-context.d.ts +16 -0
- package/dist/types/filter-manager/flat-to-combined.d.ts +3 -0
- package/dist/types/filter-manager/flatten-combined-filter.d.ts +3 -0
- package/dist/types/filter-manager/is-filter-complete.d.ts +2 -0
- package/dist/types/filter-manager/types.d.ts +15 -0
- package/dist/types/filter-manager/use-in-filter.d.ts +5 -0
- package/dist/types/filter-manager/use-simple-filters.d.ts +8 -0
- package/dist/types/grid-container/grid-container-impl.d.ts +6 -0
- package/dist/types/grid-container/grid-container.d.ts +2 -0
- package/dist/types/icons.d.ts +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/license.d.ts +12 -0
- package/dist/types/list-view/list-view-context.d.ts +21 -0
- package/dist/types/list-view/list-view.d.ts +26 -0
- package/dist/types/lytenyte-pro.d.ts +7 -0
- package/dist/types/menu/arrow-svg.d.ts +1 -0
- package/dist/types/menu/column-menu/column-menu-driver.d.ts +4 -0
- package/dist/types/menu/context-menu/context-menu-driver.d.ts +1 -0
- package/dist/types/menu/context-menu/use-context-menu-listener.d.ts +6 -0
- package/dist/types/menu/menu-impl.d.ts +17 -0
- package/dist/types/menu/menu.d.ts +18 -0
- package/dist/types/menu/use-menu-class-name.d.ts +1 -0
- package/dist/types/overlay/load-error-overlay.d.ts +1 -0
- package/dist/types/overlay/loading-overlay.d.ts +1 -0
- package/dist/types/overlay/no-data-overlay.d.ts +1 -0
- package/dist/types/overlay/overlay-driver.d.ts +1 -0
- package/dist/types/pill/pill.d.ts +5 -0
- package/dist/types/pill-manager/pill-manager-agg-menu.d.ts +7 -0
- package/dist/types/pill-manager/pill-manager-controls.d.ts +9 -0
- package/dist/types/pill-manager/pill-manager-drag-placeholder.d.ts +5 -0
- package/dist/types/pill-manager/pill-manager-expander.d.ts +1 -0
- package/dist/types/pill-manager/pill-manager-impl.d.ts +49 -0
- package/dist/types/pill-manager/pill-manager-pill.d.ts +4 -0
- package/dist/types/pill-manager/pill-manager-pills/pill-manager-pills.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/use-aggregation-source.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/use-column-pivot-source.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/use-column-source.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/use-measures-source.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/use-row-groups-source.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/utils.d.ts +3 -0
- package/dist/types/pill-manager/pill-manager-row-label.d.ts +22 -0
- package/dist/types/pill-manager/pill-manager-row.d.ts +12 -0
- package/dist/types/pill-manager/pill-manager-rows.d.ts +1 -0
- package/dist/types/pill-manager/pill-manager-separator.d.ts +1 -0
- package/dist/types/pill-manager/pill-manager-types.d.ts +36 -0
- package/dist/types/pill-manager/pill-manager.d.ts +1 -0
- package/dist/types/popover/anchor-context.d.ts +6 -0
- package/dist/types/popover/popover-driver.d.ts +1 -0
- package/dist/types/popover/popover-impl.d.ts +8 -0
- package/dist/types/popover/popover.d.ts +10 -0
- package/dist/types/popover/use-popover-class.d.ts +1 -0
- package/dist/types/select/select.d.ts +17 -0
- package/dist/types/sort-manager/sort-adder.d.ts +4 -0
- package/dist/types/sort-manager/sort-apply.d.ts +1 -0
- package/dist/types/sort-manager/sort-cancel.d.ts +1 -0
- package/dist/types/sort-manager/sort-clear.d.ts +1 -0
- package/dist/types/sort-manager/sort-column-select.d.ts +5 -0
- package/dist/types/sort-manager/sort-direction-select.d.ts +5 -0
- package/dist/types/sort-manager/sort-items-to-sort-model.d.ts +3 -0
- package/dist/types/sort-manager/sort-manager-container.d.ts +53 -0
- package/dist/types/sort-manager/sort-manager-context.d.ts +4 -0
- package/dist/types/sort-manager/sort-manager-impl.d.ts +30 -0
- package/dist/types/sort-manager/sort-manager.d.ts +1 -0
- package/dist/types/sort-manager/sort-model-to-sort-items.d.ts +4 -0
- package/dist/types/sort-manager/sort-remove.d.ts +4 -0
- package/dist/types/sort-manager/sort-sort-select.d.ts +5 -0
- package/dist/types/sort-manager/use-sort-state.d.ts +8 -0
- package/dist/types/sort-manager/use-sortable-column-items.d.ts +9 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/use-client-data-source.d.ts +6 -0
- package/dist/types/use-edge-scroll.d.ts +7 -0
- package/dist/types/use-grid.d.ts +6 -0
- package/dist/types/use-lytenyte.d.ts +10 -0
- package/dist/types/use-tree-data-source.d.ts +3 -0
- package/dist/types/watermark.d.ts +3 -0
- package/dist/types.js +1 -0
- package/dist/use-grid-DKvzGZWc.js +916 -0
- package/dist/useAnchorPositioning-Cm44rb7y.js +252 -0
- package/dist/useBaseUiId-J66PFGv_.js +48 -0
- package/dist/useButton-Cy7tjZ__.js +183 -0
- package/dist/useCompositeListItem-I14CpQPi.js +51 -0
- package/dist/useScrollLock-D6h5lZYs.js +515 -0
- package/package.json +96 -0
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { F as FloatingPortal, P as PropTypes, H as HTMLElementType, r as refType, p as useFloatingTree, q as useFloatingNodeId, t as useFloatingParentNodeId, k as useForkRef, v as useComponentRenderer, w as popupStateMapping, I as InternalBackdrop, x as FloatingNode, j as useEventCallback, y as useOpenChangeComplete, z as useFloatingRootContext, A as useHover, B as safePolygon, C as useClick, D as useDismiss, E as useRole, G as useListNavigation, J as useTypeahead, K as useInteractions, L as FloatingTree } from "./InternalBackdrop-Dm9czgoC.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { u as useAnchorPositioning, a as useDirection } from "./useAnchorPositioning-Cm44rb7y.js";
|
|
5
|
+
import { C as CompositeList, a as useControlled, b as useTransitionStatus, c as useScrollLock } from "./useScrollLock-D6h5lZYs.js";
|
|
6
|
+
import * as ReactDOM from "react-dom";
|
|
7
|
+
const MenuPositionerContext = /* @__PURE__ */ React.createContext(void 0);
|
|
8
|
+
if (process.env.NODE_ENV !== "production") {
|
|
9
|
+
MenuPositionerContext.displayName = "MenuPositionerContext";
|
|
10
|
+
}
|
|
11
|
+
function useMenuPositionerContext() {
|
|
12
|
+
const context = React.useContext(MenuPositionerContext);
|
|
13
|
+
if (context === void 0) {
|
|
14
|
+
throw new Error("Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.");
|
|
15
|
+
}
|
|
16
|
+
return context;
|
|
17
|
+
}
|
|
18
|
+
const MenuRootContext = /* @__PURE__ */ React.createContext(void 0);
|
|
19
|
+
if (process.env.NODE_ENV !== "production") {
|
|
20
|
+
MenuRootContext.displayName = "MenuRootContext";
|
|
21
|
+
}
|
|
22
|
+
function useMenuRootContext(optional) {
|
|
23
|
+
const context = React.useContext(MenuRootContext);
|
|
24
|
+
if (context === void 0 && !optional) {
|
|
25
|
+
throw new Error("Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.");
|
|
26
|
+
}
|
|
27
|
+
return context;
|
|
28
|
+
}
|
|
29
|
+
const MenuPortalContext = /* @__PURE__ */ React.createContext(void 0);
|
|
30
|
+
function useMenuPortalContext() {
|
|
31
|
+
const value = React.useContext(MenuPortalContext);
|
|
32
|
+
if (value === void 0) {
|
|
33
|
+
throw new Error("Base UI: <Menu.Portal> is missing.");
|
|
34
|
+
}
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
function MenuPortal(props) {
|
|
38
|
+
const {
|
|
39
|
+
children,
|
|
40
|
+
keepMounted = false,
|
|
41
|
+
container
|
|
42
|
+
} = props;
|
|
43
|
+
const {
|
|
44
|
+
mounted
|
|
45
|
+
} = useMenuRootContext();
|
|
46
|
+
const shouldRender = mounted || keepMounted;
|
|
47
|
+
if (!shouldRender) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return /* @__PURE__ */ jsx(MenuPortalContext.Provider, {
|
|
51
|
+
value: keepMounted,
|
|
52
|
+
children: /* @__PURE__ */ jsx(FloatingPortal, {
|
|
53
|
+
root: container,
|
|
54
|
+
children
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
process.env.NODE_ENV !== "production" ? MenuPortal.propTypes = {
|
|
59
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
60
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
61
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
62
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
63
|
+
/**
|
|
64
|
+
* @ignore
|
|
65
|
+
*/
|
|
66
|
+
children: PropTypes.node,
|
|
67
|
+
/**
|
|
68
|
+
* A parent element to render the portal element into.
|
|
69
|
+
*/
|
|
70
|
+
container: PropTypes.oneOfType([HTMLElementType, refType]),
|
|
71
|
+
/**
|
|
72
|
+
* Whether to keep the portal mounted in the DOM while the popup is hidden.
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
keepMounted: PropTypes.bool
|
|
76
|
+
} : void 0;
|
|
77
|
+
function useMenuPositioner(params) {
|
|
78
|
+
const {
|
|
79
|
+
nodeId,
|
|
80
|
+
parentNodeId
|
|
81
|
+
} = params;
|
|
82
|
+
const {
|
|
83
|
+
open,
|
|
84
|
+
setOpen,
|
|
85
|
+
mounted,
|
|
86
|
+
setHoverEnabled
|
|
87
|
+
} = useMenuRootContext();
|
|
88
|
+
const positioning = useAnchorPositioning(params);
|
|
89
|
+
const {
|
|
90
|
+
events: menuEvents
|
|
91
|
+
} = useFloatingTree();
|
|
92
|
+
const positionerProps = React.useMemo(() => {
|
|
93
|
+
const hiddenStyles = {};
|
|
94
|
+
if (!open) {
|
|
95
|
+
hiddenStyles.pointerEvents = "none";
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
role: "presentation",
|
|
99
|
+
hidden: !mounted,
|
|
100
|
+
style: {
|
|
101
|
+
...positioning.positionerStyles,
|
|
102
|
+
...hiddenStyles
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}, [open, mounted, positioning.positionerStyles]);
|
|
106
|
+
React.useEffect(() => {
|
|
107
|
+
function onMenuOpenChange(event) {
|
|
108
|
+
if (event.open) {
|
|
109
|
+
if (event.parentNodeId === nodeId) {
|
|
110
|
+
setHoverEnabled(false);
|
|
111
|
+
}
|
|
112
|
+
if (event.nodeId !== nodeId && event.parentNodeId === parentNodeId) {
|
|
113
|
+
setOpen(false, void 0);
|
|
114
|
+
}
|
|
115
|
+
} else if (event.parentNodeId === nodeId) {
|
|
116
|
+
setHoverEnabled(true);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
menuEvents.on("openchange", onMenuOpenChange);
|
|
120
|
+
return () => {
|
|
121
|
+
menuEvents.off("openchange", onMenuOpenChange);
|
|
122
|
+
};
|
|
123
|
+
}, [menuEvents, nodeId, parentNodeId, setOpen, setHoverEnabled]);
|
|
124
|
+
React.useEffect(() => {
|
|
125
|
+
menuEvents.emit("openchange", {
|
|
126
|
+
open,
|
|
127
|
+
nodeId,
|
|
128
|
+
parentNodeId
|
|
129
|
+
});
|
|
130
|
+
}, [menuEvents, open, nodeId, parentNodeId]);
|
|
131
|
+
return React.useMemo(() => ({
|
|
132
|
+
...positioning,
|
|
133
|
+
positionerProps
|
|
134
|
+
}), [positioning, positionerProps]);
|
|
135
|
+
}
|
|
136
|
+
const MenuPositioner = /* @__PURE__ */ React.forwardRef(function MenuPositioner2(props, forwardedRef) {
|
|
137
|
+
const {
|
|
138
|
+
anchor,
|
|
139
|
+
positionMethod = "absolute",
|
|
140
|
+
className,
|
|
141
|
+
render,
|
|
142
|
+
side,
|
|
143
|
+
align,
|
|
144
|
+
sideOffset = 0,
|
|
145
|
+
alignOffset = 0,
|
|
146
|
+
collisionBoundary = "clipping-ancestors",
|
|
147
|
+
collisionPadding = 5,
|
|
148
|
+
arrowPadding = 5,
|
|
149
|
+
sticky = false,
|
|
150
|
+
trackAnchor = true,
|
|
151
|
+
...otherProps
|
|
152
|
+
} = props;
|
|
153
|
+
const {
|
|
154
|
+
open,
|
|
155
|
+
floatingRootContext,
|
|
156
|
+
setPositionerElement,
|
|
157
|
+
itemDomElements,
|
|
158
|
+
itemLabels,
|
|
159
|
+
mounted,
|
|
160
|
+
nested,
|
|
161
|
+
modal,
|
|
162
|
+
openReason
|
|
163
|
+
} = useMenuRootContext();
|
|
164
|
+
const keepMounted = useMenuPortalContext();
|
|
165
|
+
const nodeId = useFloatingNodeId();
|
|
166
|
+
const parentNodeId = useFloatingParentNodeId();
|
|
167
|
+
let computedSide = side;
|
|
168
|
+
let computedAlign = align;
|
|
169
|
+
if (!side) {
|
|
170
|
+
computedSide = nested ? "inline-end" : "bottom";
|
|
171
|
+
}
|
|
172
|
+
if (!align) {
|
|
173
|
+
computedAlign = nested ? "start" : "center";
|
|
174
|
+
}
|
|
175
|
+
const positioner = useMenuPositioner({
|
|
176
|
+
anchor,
|
|
177
|
+
floatingRootContext,
|
|
178
|
+
positionMethod,
|
|
179
|
+
open,
|
|
180
|
+
mounted,
|
|
181
|
+
side: computedSide,
|
|
182
|
+
sideOffset,
|
|
183
|
+
align: computedAlign,
|
|
184
|
+
alignOffset,
|
|
185
|
+
arrowPadding,
|
|
186
|
+
collisionBoundary,
|
|
187
|
+
collisionPadding,
|
|
188
|
+
sticky,
|
|
189
|
+
nodeId,
|
|
190
|
+
parentNodeId,
|
|
191
|
+
keepMounted,
|
|
192
|
+
trackAnchor
|
|
193
|
+
});
|
|
194
|
+
const state = React.useMemo(() => ({
|
|
195
|
+
open,
|
|
196
|
+
side: positioner.side,
|
|
197
|
+
align: positioner.align,
|
|
198
|
+
anchorHidden: positioner.anchorHidden,
|
|
199
|
+
nested
|
|
200
|
+
}), [open, positioner.side, positioner.align, positioner.anchorHidden, nested]);
|
|
201
|
+
const contextValue = React.useMemo(() => ({
|
|
202
|
+
side: positioner.side,
|
|
203
|
+
align: positioner.align,
|
|
204
|
+
arrowRef: positioner.arrowRef,
|
|
205
|
+
arrowUncentered: positioner.arrowUncentered,
|
|
206
|
+
arrowStyles: positioner.arrowStyles,
|
|
207
|
+
floatingContext: positioner.context
|
|
208
|
+
}), [positioner.side, positioner.align, positioner.arrowRef, positioner.arrowUncentered, positioner.arrowStyles, positioner.context]);
|
|
209
|
+
const mergedRef = useForkRef(forwardedRef, setPositionerElement);
|
|
210
|
+
const {
|
|
211
|
+
renderElement
|
|
212
|
+
} = useComponentRenderer({
|
|
213
|
+
render: render ?? "div",
|
|
214
|
+
className,
|
|
215
|
+
state,
|
|
216
|
+
customStyleHookMapping: popupStateMapping,
|
|
217
|
+
ref: mergedRef,
|
|
218
|
+
extraProps: {
|
|
219
|
+
...positioner.positionerProps,
|
|
220
|
+
...otherProps
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
return /* @__PURE__ */ jsxs(MenuPositionerContext.Provider, {
|
|
224
|
+
value: contextValue,
|
|
225
|
+
children: [mounted && modal && openReason !== "hover" && parentNodeId === null && /* @__PURE__ */ jsx(InternalBackdrop, {
|
|
226
|
+
inert: !open
|
|
227
|
+
}), /* @__PURE__ */ jsx(FloatingNode, {
|
|
228
|
+
id: nodeId,
|
|
229
|
+
children: /* @__PURE__ */ jsx(CompositeList, {
|
|
230
|
+
elementsRef: itemDomElements,
|
|
231
|
+
labelsRef: itemLabels,
|
|
232
|
+
children: renderElement()
|
|
233
|
+
})
|
|
234
|
+
})]
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
process.env.NODE_ENV !== "production" ? MenuPositioner.propTypes = {
|
|
238
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
239
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
240
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
241
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
242
|
+
/**
|
|
243
|
+
* How to align the popup relative to the specified side.
|
|
244
|
+
* @default 'center'
|
|
245
|
+
*/
|
|
246
|
+
align: PropTypes.oneOf(["center", "end", "start"]),
|
|
247
|
+
/**
|
|
248
|
+
* Additional offset along the alignment axis in pixels.
|
|
249
|
+
* Also accepts a function that returns the offset to read the dimensions of the anchor
|
|
250
|
+
* and positioner elements, along with its side and alignment.
|
|
251
|
+
*
|
|
252
|
+
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
253
|
+
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
254
|
+
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
255
|
+
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
256
|
+
* @default 0
|
|
257
|
+
*/
|
|
258
|
+
alignOffset: PropTypes.oneOfType([PropTypes.func, PropTypes.number]),
|
|
259
|
+
/**
|
|
260
|
+
* An element to position the popup against.
|
|
261
|
+
* By default, the popup will be positioned against the trigger.
|
|
262
|
+
*/
|
|
263
|
+
anchor: PropTypes.oneOfType([HTMLElementType, refType, PropTypes.object, PropTypes.func]),
|
|
264
|
+
/**
|
|
265
|
+
* Minimum distance to maintain between the arrow and the edges of the popup.
|
|
266
|
+
*
|
|
267
|
+
* Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
|
|
268
|
+
* @default 5
|
|
269
|
+
*/
|
|
270
|
+
arrowPadding: PropTypes.number,
|
|
271
|
+
/**
|
|
272
|
+
* @ignore
|
|
273
|
+
*/
|
|
274
|
+
children: PropTypes.node,
|
|
275
|
+
/**
|
|
276
|
+
* CSS class applied to the element, or a function that
|
|
277
|
+
* returns a class based on the component’s state.
|
|
278
|
+
*/
|
|
279
|
+
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
280
|
+
/**
|
|
281
|
+
* An element or a rectangle that delimits the area that the popup is confined to.
|
|
282
|
+
* @default 'clipping-ancestors'
|
|
283
|
+
*/
|
|
284
|
+
collisionBoundary: PropTypes.oneOfType([HTMLElementType, PropTypes.arrayOf(HTMLElementType), PropTypes.string, PropTypes.shape({
|
|
285
|
+
height: PropTypes.number,
|
|
286
|
+
width: PropTypes.number,
|
|
287
|
+
x: PropTypes.number,
|
|
288
|
+
y: PropTypes.number
|
|
289
|
+
})]),
|
|
290
|
+
/**
|
|
291
|
+
* Additional space to maintain from the edge of the collision boundary.
|
|
292
|
+
* @default 5
|
|
293
|
+
*/
|
|
294
|
+
collisionPadding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
295
|
+
bottom: PropTypes.number,
|
|
296
|
+
left: PropTypes.number,
|
|
297
|
+
right: PropTypes.number,
|
|
298
|
+
top: PropTypes.number
|
|
299
|
+
})]),
|
|
300
|
+
/**
|
|
301
|
+
* Determines which CSS `position` property to use.
|
|
302
|
+
* @default 'absolute'
|
|
303
|
+
*/
|
|
304
|
+
positionMethod: PropTypes.oneOf(["absolute", "fixed"]),
|
|
305
|
+
/**
|
|
306
|
+
* Allows you to replace the component’s HTML element
|
|
307
|
+
* with a different tag, or compose it with another component.
|
|
308
|
+
*
|
|
309
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
310
|
+
*/
|
|
311
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
312
|
+
/**
|
|
313
|
+
* Which side of the anchor element to align the popup against.
|
|
314
|
+
* May automatically change to avoid collisions.
|
|
315
|
+
* @default 'bottom'
|
|
316
|
+
*/
|
|
317
|
+
side: PropTypes.oneOf(["bottom", "inline-end", "inline-start", "left", "right", "top"]),
|
|
318
|
+
/**
|
|
319
|
+
* Distance between the anchor and the popup in pixels.
|
|
320
|
+
* Also accepts a function that returns the distance to read the dimensions of the anchor
|
|
321
|
+
* and positioner elements, along with its side and alignment.
|
|
322
|
+
*
|
|
323
|
+
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
324
|
+
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
325
|
+
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
326
|
+
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
327
|
+
* @default 0
|
|
328
|
+
*/
|
|
329
|
+
sideOffset: PropTypes.oneOfType([PropTypes.func, PropTypes.number]),
|
|
330
|
+
/**
|
|
331
|
+
* Whether to maintain the popup in the viewport after
|
|
332
|
+
* the anchor element was scrolled out of view.
|
|
333
|
+
* @default false
|
|
334
|
+
*/
|
|
335
|
+
sticky: PropTypes.bool,
|
|
336
|
+
/**
|
|
337
|
+
* Whether the popup tracks any layout shift of its positioning anchor.
|
|
338
|
+
* @default true
|
|
339
|
+
*/
|
|
340
|
+
trackAnchor: PropTypes.bool
|
|
341
|
+
} : void 0;
|
|
342
|
+
const TYPEAHEAD_RESET_MS = 500;
|
|
343
|
+
const PATIENT_CLICK_THRESHOLD = 500;
|
|
344
|
+
function translateOpenChangeReason(nativeReason) {
|
|
345
|
+
if (!nativeReason) {
|
|
346
|
+
return void 0;
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
// Identical mappings
|
|
350
|
+
click: "click",
|
|
351
|
+
hover: "hover",
|
|
352
|
+
focus: "focus",
|
|
353
|
+
"focus-out": "focus-out",
|
|
354
|
+
"escape-key": "escape-key",
|
|
355
|
+
"outside-press": "outside-press",
|
|
356
|
+
// New mappings
|
|
357
|
+
"reference-press": "trigger-press",
|
|
358
|
+
"safe-polygon": "hover",
|
|
359
|
+
"ancestor-scroll": void 0,
|
|
360
|
+
// Not supported
|
|
361
|
+
"list-navigation": void 0
|
|
362
|
+
// Unnecessary to expose currently
|
|
363
|
+
}[nativeReason];
|
|
364
|
+
}
|
|
365
|
+
const EMPTY_ARRAY = [];
|
|
366
|
+
function useMenuRoot(parameters) {
|
|
367
|
+
const {
|
|
368
|
+
open: openParam,
|
|
369
|
+
defaultOpen,
|
|
370
|
+
onOpenChange,
|
|
371
|
+
onOpenChangeComplete,
|
|
372
|
+
orientation,
|
|
373
|
+
direction,
|
|
374
|
+
disabled,
|
|
375
|
+
nested,
|
|
376
|
+
closeParentOnEsc,
|
|
377
|
+
loop,
|
|
378
|
+
delay,
|
|
379
|
+
openOnHover,
|
|
380
|
+
onTypingChange,
|
|
381
|
+
modal
|
|
382
|
+
} = parameters;
|
|
383
|
+
const [triggerElement, setTriggerElement] = React.useState(null);
|
|
384
|
+
const [positionerElement, setPositionerElementUnwrapped] = React.useState(null);
|
|
385
|
+
const [instantType, setInstantType] = React.useState();
|
|
386
|
+
const [hoverEnabled, setHoverEnabled] = React.useState(true);
|
|
387
|
+
const [activeIndex, setActiveIndex] = React.useState(null);
|
|
388
|
+
const [openReason, setOpenReason] = React.useState(null);
|
|
389
|
+
const [stickIfOpen, setStickIfOpen] = React.useState(true);
|
|
390
|
+
const popupRef = React.useRef(null);
|
|
391
|
+
const positionerRef = React.useRef(null);
|
|
392
|
+
const stickIfOpenTimeoutRef = React.useRef(-1);
|
|
393
|
+
const [open, setOpenUnwrapped] = useControlled({
|
|
394
|
+
controlled: openParam,
|
|
395
|
+
default: defaultOpen,
|
|
396
|
+
name: "useMenuRoot",
|
|
397
|
+
state: "open"
|
|
398
|
+
});
|
|
399
|
+
const setPositionerElement = React.useCallback((value) => {
|
|
400
|
+
positionerRef.current = value;
|
|
401
|
+
setPositionerElementUnwrapped(value);
|
|
402
|
+
}, []);
|
|
403
|
+
const allowMouseUpTriggerRef = React.useRef(false);
|
|
404
|
+
const {
|
|
405
|
+
mounted,
|
|
406
|
+
setMounted,
|
|
407
|
+
transitionStatus
|
|
408
|
+
} = useTransitionStatus(open);
|
|
409
|
+
useScrollLock(open && modal && openReason !== "hover", triggerElement);
|
|
410
|
+
const setOpen = useEventCallback((nextOpen, event, reason) => {
|
|
411
|
+
onOpenChange?.(nextOpen, event);
|
|
412
|
+
setOpenUnwrapped(nextOpen);
|
|
413
|
+
if (nextOpen) {
|
|
414
|
+
setOpenReason(reason ?? null);
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
if (!open && !hoverEnabled) {
|
|
418
|
+
setHoverEnabled(true);
|
|
419
|
+
}
|
|
420
|
+
const handleUnmount = useEventCallback(() => {
|
|
421
|
+
setMounted(false);
|
|
422
|
+
setOpenReason(null);
|
|
423
|
+
setStickIfOpen(true);
|
|
424
|
+
onOpenChangeComplete?.(false);
|
|
425
|
+
});
|
|
426
|
+
useOpenChangeComplete({
|
|
427
|
+
enabled: !parameters.actionsRef,
|
|
428
|
+
open,
|
|
429
|
+
ref: popupRef,
|
|
430
|
+
onComplete() {
|
|
431
|
+
if (!open) {
|
|
432
|
+
handleUnmount();
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
React.useImperativeHandle(parameters.actionsRef, () => ({
|
|
437
|
+
unmount: handleUnmount
|
|
438
|
+
}), [handleUnmount]);
|
|
439
|
+
const clearStickIfOpenTimeout = useEventCallback(() => {
|
|
440
|
+
clearTimeout(stickIfOpenTimeoutRef.current);
|
|
441
|
+
});
|
|
442
|
+
React.useEffect(() => {
|
|
443
|
+
if (!open) {
|
|
444
|
+
clearStickIfOpenTimeout();
|
|
445
|
+
}
|
|
446
|
+
}, [clearStickIfOpenTimeout, open]);
|
|
447
|
+
React.useEffect(() => {
|
|
448
|
+
return clearStickIfOpenTimeout;
|
|
449
|
+
}, [clearStickIfOpenTimeout]);
|
|
450
|
+
const floatingRootContext = useFloatingRootContext({
|
|
451
|
+
elements: {
|
|
452
|
+
reference: triggerElement,
|
|
453
|
+
floating: positionerElement
|
|
454
|
+
},
|
|
455
|
+
open,
|
|
456
|
+
onOpenChange(openValue, eventValue, reasonValue) {
|
|
457
|
+
const isHover = reasonValue === "hover" || reasonValue === "safe-polygon";
|
|
458
|
+
const isKeyboardClick = reasonValue === "click" && eventValue.detail === 0;
|
|
459
|
+
const isDismissClose = !openValue && (reasonValue === "escape-key" || reasonValue == null);
|
|
460
|
+
function changeState() {
|
|
461
|
+
setOpen(openValue, eventValue, translateOpenChangeReason(reasonValue));
|
|
462
|
+
}
|
|
463
|
+
if (isHover) {
|
|
464
|
+
clearStickIfOpenTimeout();
|
|
465
|
+
setStickIfOpen(true);
|
|
466
|
+
stickIfOpenTimeoutRef.current = window.setTimeout(() => {
|
|
467
|
+
setStickIfOpen(false);
|
|
468
|
+
}, PATIENT_CLICK_THRESHOLD);
|
|
469
|
+
ReactDOM.flushSync(changeState);
|
|
470
|
+
} else {
|
|
471
|
+
changeState();
|
|
472
|
+
}
|
|
473
|
+
if (isKeyboardClick || isDismissClose) {
|
|
474
|
+
setInstantType(isKeyboardClick ? "click" : "dismiss");
|
|
475
|
+
} else {
|
|
476
|
+
setInstantType(void 0);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
const hover = useHover(floatingRootContext, {
|
|
481
|
+
enabled: hoverEnabled && openOnHover && !disabled && openReason !== "click",
|
|
482
|
+
handleClose: safePolygon({
|
|
483
|
+
blockPointerEvents: true
|
|
484
|
+
}),
|
|
485
|
+
mouseOnly: true,
|
|
486
|
+
move: false,
|
|
487
|
+
delay: {
|
|
488
|
+
open: delay
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
const click = useClick(floatingRootContext, {
|
|
492
|
+
enabled: !disabled,
|
|
493
|
+
event: "mousedown",
|
|
494
|
+
toggle: !openOnHover || !nested,
|
|
495
|
+
ignoreMouse: openOnHover && nested,
|
|
496
|
+
stickIfOpen
|
|
497
|
+
});
|
|
498
|
+
const dismiss = useDismiss(floatingRootContext, {
|
|
499
|
+
bubbles: closeParentOnEsc && nested,
|
|
500
|
+
outsidePressEvent: "mousedown"
|
|
501
|
+
});
|
|
502
|
+
const role = useRole(floatingRootContext, {
|
|
503
|
+
role: "menu"
|
|
504
|
+
});
|
|
505
|
+
const itemDomElements = React.useRef([]);
|
|
506
|
+
const itemLabels = React.useRef([]);
|
|
507
|
+
const listNavigation = useListNavigation(floatingRootContext, {
|
|
508
|
+
enabled: !disabled,
|
|
509
|
+
listRef: itemDomElements,
|
|
510
|
+
activeIndex,
|
|
511
|
+
nested,
|
|
512
|
+
loop,
|
|
513
|
+
orientation,
|
|
514
|
+
rtl: direction === "rtl",
|
|
515
|
+
disabledIndices: EMPTY_ARRAY,
|
|
516
|
+
onNavigate: setActiveIndex
|
|
517
|
+
});
|
|
518
|
+
const typeahead = useTypeahead(floatingRootContext, {
|
|
519
|
+
listRef: itemLabels,
|
|
520
|
+
activeIndex,
|
|
521
|
+
resetMs: TYPEAHEAD_RESET_MS,
|
|
522
|
+
onMatch: (index) => {
|
|
523
|
+
if (open && index !== activeIndex) {
|
|
524
|
+
setActiveIndex(index);
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
onTypingChange
|
|
528
|
+
});
|
|
529
|
+
const {
|
|
530
|
+
getReferenceProps,
|
|
531
|
+
getFloatingProps,
|
|
532
|
+
getItemProps
|
|
533
|
+
} = useInteractions([hover, click, dismiss, role, listNavigation, typeahead]);
|
|
534
|
+
const triggerProps = React.useMemo(() => getReferenceProps({
|
|
535
|
+
onMouseEnter() {
|
|
536
|
+
setHoverEnabled(true);
|
|
537
|
+
}
|
|
538
|
+
}), [getReferenceProps]);
|
|
539
|
+
const popupProps = React.useMemo(() => getFloatingProps({
|
|
540
|
+
onMouseEnter() {
|
|
541
|
+
if (!openOnHover || nested) {
|
|
542
|
+
setHoverEnabled(false);
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
onClick() {
|
|
546
|
+
if (openOnHover) {
|
|
547
|
+
setHoverEnabled(false);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}), [getFloatingProps, openOnHover, nested]);
|
|
551
|
+
const itemProps = React.useMemo(() => getItemProps(), [getItemProps]);
|
|
552
|
+
return React.useMemo(() => ({
|
|
553
|
+
activeIndex,
|
|
554
|
+
allowMouseUpTriggerRef,
|
|
555
|
+
floatingRootContext,
|
|
556
|
+
itemProps,
|
|
557
|
+
popupProps,
|
|
558
|
+
triggerProps,
|
|
559
|
+
itemDomElements,
|
|
560
|
+
itemLabels,
|
|
561
|
+
mounted,
|
|
562
|
+
open,
|
|
563
|
+
popupRef,
|
|
564
|
+
positionerRef,
|
|
565
|
+
setOpen,
|
|
566
|
+
setPositionerElement,
|
|
567
|
+
setTriggerElement,
|
|
568
|
+
transitionStatus,
|
|
569
|
+
openReason,
|
|
570
|
+
instantType,
|
|
571
|
+
onOpenChangeComplete,
|
|
572
|
+
setHoverEnabled
|
|
573
|
+
}), [activeIndex, floatingRootContext, itemProps, popupProps, triggerProps, itemDomElements, itemLabels, mounted, open, positionerRef, setOpen, transitionStatus, setPositionerElement, openReason, instantType, onOpenChangeComplete]);
|
|
574
|
+
}
|
|
575
|
+
const MenuRoot = function MenuRoot2(props) {
|
|
576
|
+
const {
|
|
577
|
+
children,
|
|
578
|
+
defaultOpen = false,
|
|
579
|
+
disabled = false,
|
|
580
|
+
closeParentOnEsc = true,
|
|
581
|
+
loop = true,
|
|
582
|
+
modal = true,
|
|
583
|
+
onOpenChange,
|
|
584
|
+
open,
|
|
585
|
+
orientation = "vertical",
|
|
586
|
+
delay = 100,
|
|
587
|
+
openOnHover: openOnHoverProp,
|
|
588
|
+
actionsRef,
|
|
589
|
+
onOpenChangeComplete
|
|
590
|
+
} = props;
|
|
591
|
+
const direction = useDirection();
|
|
592
|
+
const parentContext = useMenuRootContext(true);
|
|
593
|
+
const nested = parentContext != null;
|
|
594
|
+
const openOnHover = openOnHoverProp ?? nested;
|
|
595
|
+
const typingRef = React.useRef(false);
|
|
596
|
+
const onTypingChange = React.useCallback((nextTyping) => {
|
|
597
|
+
typingRef.current = nextTyping;
|
|
598
|
+
}, []);
|
|
599
|
+
const menuRoot = useMenuRoot({
|
|
600
|
+
direction,
|
|
601
|
+
disabled,
|
|
602
|
+
closeParentOnEsc,
|
|
603
|
+
onOpenChange,
|
|
604
|
+
loop,
|
|
605
|
+
defaultOpen,
|
|
606
|
+
open,
|
|
607
|
+
orientation,
|
|
608
|
+
nested,
|
|
609
|
+
openOnHover,
|
|
610
|
+
delay,
|
|
611
|
+
onTypingChange,
|
|
612
|
+
modal,
|
|
613
|
+
actionsRef,
|
|
614
|
+
onOpenChangeComplete
|
|
615
|
+
});
|
|
616
|
+
const context = React.useMemo(() => ({
|
|
617
|
+
...menuRoot,
|
|
618
|
+
nested,
|
|
619
|
+
parentContext,
|
|
620
|
+
disabled,
|
|
621
|
+
allowMouseUpTriggerRef: parentContext?.allowMouseUpTriggerRef ?? menuRoot.allowMouseUpTriggerRef,
|
|
622
|
+
typingRef,
|
|
623
|
+
modal
|
|
624
|
+
}), [menuRoot, nested, parentContext, disabled, modal]);
|
|
625
|
+
if (!nested) {
|
|
626
|
+
return /* @__PURE__ */ jsx(FloatingTree, {
|
|
627
|
+
children: /* @__PURE__ */ jsx(MenuRootContext.Provider, {
|
|
628
|
+
value: context,
|
|
629
|
+
children
|
|
630
|
+
})
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
return /* @__PURE__ */ jsx(MenuRootContext.Provider, {
|
|
634
|
+
value: context,
|
|
635
|
+
children
|
|
636
|
+
});
|
|
637
|
+
};
|
|
638
|
+
process.env.NODE_ENV !== "production" ? MenuRoot.propTypes = {
|
|
639
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
640
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
641
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
642
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
643
|
+
/**
|
|
644
|
+
* A ref to imperative actions.
|
|
645
|
+
*/
|
|
646
|
+
actionsRef: PropTypes.shape({
|
|
647
|
+
current: PropTypes.shape({
|
|
648
|
+
unmount: PropTypes.func.isRequired
|
|
649
|
+
}).isRequired
|
|
650
|
+
}),
|
|
651
|
+
/**
|
|
652
|
+
* @ignore
|
|
653
|
+
*/
|
|
654
|
+
children: PropTypes.node,
|
|
655
|
+
/**
|
|
656
|
+
* When in a submenu, determines whether pressing the Escape key
|
|
657
|
+
* closes the entire menu, or only the current child menu.
|
|
658
|
+
* @default true
|
|
659
|
+
*/
|
|
660
|
+
closeParentOnEsc: PropTypes.bool,
|
|
661
|
+
/**
|
|
662
|
+
* Whether the menu is initially open.
|
|
663
|
+
*
|
|
664
|
+
* To render a controlled menu, use the `open` prop instead.
|
|
665
|
+
* @default false
|
|
666
|
+
*/
|
|
667
|
+
defaultOpen: PropTypes.bool,
|
|
668
|
+
/**
|
|
669
|
+
* How long to wait before the menu may be opened on hover. Specified in milliseconds.
|
|
670
|
+
*
|
|
671
|
+
* Requires the `openOnHover` prop.
|
|
672
|
+
* @default 100
|
|
673
|
+
*/
|
|
674
|
+
delay: PropTypes.number,
|
|
675
|
+
/**
|
|
676
|
+
* Whether the component should ignore user interaction.
|
|
677
|
+
* @default false
|
|
678
|
+
*/
|
|
679
|
+
disabled: PropTypes.bool,
|
|
680
|
+
/**
|
|
681
|
+
* Whether to loop keyboard focus back to the first item
|
|
682
|
+
* when the end of the list is reached while using the arrow keys.
|
|
683
|
+
* @default true
|
|
684
|
+
*/
|
|
685
|
+
loop: PropTypes.bool,
|
|
686
|
+
/**
|
|
687
|
+
* Whether the menu should prevent outside clicks and lock page scroll when open.
|
|
688
|
+
* @default true
|
|
689
|
+
*/
|
|
690
|
+
modal: PropTypes.bool,
|
|
691
|
+
/**
|
|
692
|
+
* Event handler called when the menu is opened or closed.
|
|
693
|
+
*/
|
|
694
|
+
onOpenChange: PropTypes.func,
|
|
695
|
+
/**
|
|
696
|
+
* Event handler called after any animations complete when the menu is closed.
|
|
697
|
+
*/
|
|
698
|
+
onOpenChangeComplete: PropTypes.func,
|
|
699
|
+
/**
|
|
700
|
+
* Whether the menu is currently open.
|
|
701
|
+
*/
|
|
702
|
+
open: PropTypes.bool,
|
|
703
|
+
/**
|
|
704
|
+
* Whether the menu should also open when the trigger is hovered.
|
|
705
|
+
*
|
|
706
|
+
* Defaults to `true` for nested menus.
|
|
707
|
+
*/
|
|
708
|
+
openOnHover: PropTypes.bool,
|
|
709
|
+
/**
|
|
710
|
+
* The visual orientation of the menu.
|
|
711
|
+
* Controls whether roving focus uses up/down or left/right arrow keys.
|
|
712
|
+
* @default 'vertical'
|
|
713
|
+
*/
|
|
714
|
+
orientation: PropTypes.oneOf(["horizontal", "vertical"])
|
|
715
|
+
} : void 0;
|
|
716
|
+
export {
|
|
717
|
+
MenuRoot as M,
|
|
718
|
+
PATIENT_CLICK_THRESHOLD as P,
|
|
719
|
+
MenuPortal as a,
|
|
720
|
+
MenuPositioner as b,
|
|
721
|
+
useMenuPositionerContext as c,
|
|
722
|
+
translateOpenChangeReason as t,
|
|
723
|
+
useMenuRootContext as u
|
|
724
|
+
};
|