@wix/site-ui 1.30.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/1268.js +99 -0
- package/dist/1279.js +7 -0
- package/dist/1457.js +10 -0
- package/dist/1477.js +106 -0
- package/dist/1500.js +111 -0
- package/dist/167.js +6 -0
- package/dist/2274.js +34 -0
- package/dist/2287.js +17 -0
- package/dist/2418.js +31 -0
- package/dist/2801.js +20 -0
- package/dist/285.js +86 -0
- package/dist/2861.js +6 -0
- package/dist/3020.js +7 -0
- package/dist/3021.js +72 -0
- package/dist/3056.js +229 -0
- package/dist/3140.js +4 -0
- package/dist/3248.js +307 -0
- package/dist/3296.js +4 -0
- package/dist/3319.js +400 -0
- package/dist/3395.js +4 -0
- package/dist/3485.js +854 -0
- package/dist/353.js +14 -0
- package/dist/3670.js +418 -0
- package/dist/3829.js +113 -0
- package/dist/4026.js +12 -0
- package/dist/4143.js +46 -0
- package/dist/42.js +32 -0
- package/dist/4281.js +30 -0
- package/dist/4346.js +2 -0
- package/dist/4388.js +418 -0
- package/dist/4490.js +32 -0
- package/dist/4495.js +9 -0
- package/dist/4549.js +24 -0
- package/dist/4586.js +41 -0
- package/dist/4586.js.LICENSE.txt +19 -0
- package/dist/4707.js +19 -0
- package/dist/4723.js +7 -0
- package/dist/4745.js +7 -0
- package/dist/4768.js +35 -0
- package/dist/4922.js +15 -0
- package/dist/5036.js +17 -0
- package/dist/5085.js +20 -0
- package/dist/5299.js +597 -0
- package/dist/5659.js +4 -0
- package/dist/5778.js +10 -0
- package/dist/5864.js +86 -0
- package/dist/5992.js +913 -0
- package/dist/5992.js.LICENSE.txt +19 -0
- package/dist/6003.js +10 -0
- package/dist/6046.js +29 -0
- package/dist/6089.js +2355 -0
- package/dist/6107.js +10 -0
- package/dist/6247.js +20 -0
- package/dist/6270.js +487 -0
- package/dist/6329.js +32 -0
- package/dist/6330.js +30 -0
- package/dist/6499.js +7 -0
- package/dist/6535.js +71 -0
- package/dist/6588.js +382 -0
- package/dist/6706.js +16 -0
- package/dist/6825.js +7 -0
- package/dist/6882.js +1562 -0
- package/dist/6914.js +30 -0
- package/dist/7021.js +13 -0
- package/dist/7366.js +83 -0
- package/dist/7373.js +25 -0
- package/dist/7541.js +25 -0
- package/dist/7564.js +10 -0
- package/dist/7642.js +20 -0
- package/dist/7725.js +10 -0
- package/dist/7871.js +38 -0
- package/dist/8052.js +352 -0
- package/dist/8106.js +238 -0
- package/dist/8171.js +346 -0
- package/dist/8225.js +21 -0
- package/dist/8272.js +333 -0
- package/dist/8527.js +58 -0
- package/dist/8724.js +10 -0
- package/dist/8750.js +1920 -0
- package/dist/8758.js +43 -0
- package/dist/880.js +149 -0
- package/dist/8935.js +8 -0
- package/dist/8960.js +22 -0
- package/dist/8971.js +40 -0
- package/dist/8979.js +10 -0
- package/dist/8996.js +71 -0
- package/dist/904.js +121 -0
- package/dist/9048.js +52 -0
- package/dist/9087.js +256 -0
- package/dist/9189.js +158 -0
- package/dist/9255.js +136 -0
- package/dist/9352.js +148 -0
- package/dist/951.js +22 -0
- package/dist/9635.js +22 -0
- package/dist/9829.js +4 -0
- package/dist/9863.js +8 -0
- package/dist/Accordion/index.d.ts +569 -12
- package/dist/Accordion/index.js +423 -8
- package/dist/AlertDialog/index.d.ts +1417 -18
- package/dist/AlertDialog/index.js +34 -14
- package/dist/Autocomplete/index.d.ts +1861 -38
- package/dist/Autocomplete/index.js +98 -24
- package/dist/Avatar/index.d.ts +129 -7
- package/dist/Avatar/index.js +149 -6
- package/dist/Breadcrumbs/index.d.ts +960 -7
- package/dist/Breadcrumbs/index.js +5 -5
- package/dist/Button/index.d.ts +88 -6
- package/dist/Button/index.js +27 -3
- package/dist/Checkbox/index.d.ts +425 -5
- package/dist/Checkbox/index.js +45 -5
- package/dist/CheckboxGroup/index.d.ts +318 -3
- package/dist/CheckboxGroup/index.js +166 -3
- package/dist/Collapsible/index.d.ts +377 -7
- package/dist/Collapsible/index.js +160 -6
- package/dist/Combobox/index.d.ts +1984 -48
- package/dist/Combobox/index.js +352 -29
- package/dist/ContextMenu/index.d.ts +2340 -36
- package/dist/ContextMenu/index.js +197 -22
- package/dist/Dialog/index.d.ts +1355 -18
- package/dist/Dialog/index.js +16 -14
- package/dist/Drawer/index.d.ts +1653 -18
- package/dist/Drawer/index.js +2797 -20
- package/dist/Field/index.d.ts +655 -15
- package/dist/Field/index.js +677 -10
- package/dist/Fieldset/index.d.ts +94 -5
- package/dist/Fieldset/index.js +68 -5
- package/dist/Form/index.d.ts +331 -2
- package/dist/Form/index.js +106 -3
- package/dist/Input/index.d.ts +692 -3
- package/dist/Input/index.js +10 -3
- package/dist/Menu/index.d.ts +2301 -36
- package/dist/Menu/index.js +365 -26
- package/dist/Menubar/index.d.ts +2301 -3
- package/dist/Menubar/index.js +105 -3
- package/dist/Meter/index.d.ts +175 -11
- package/dist/Meter/index.js +129 -9
- package/dist/NavigationMenu/index.d.ts +978 -28
- package/dist/NavigationMenu/index.js +1034 -17
- package/dist/NumberField/index.d.ts +612 -15
- package/dist/NumberField/index.js +1409 -11
- package/dist/Popover/index.d.ts +1655 -20
- package/dist/Popover/index.js +792 -17
- package/dist/PreviewCard/index.d.ts +1523 -14
- package/dist/PreviewCard/index.js +679 -14
- package/dist/Progress/index.d.ts +183 -11
- package/dist/Progress/index.js +181 -9
- package/dist/Radio/index.d.ts +185 -6
- package/dist/Radio/index.js +253 -6
- package/dist/RadioGroup/index.d.ts +341 -2
- package/dist/RadioGroup/index.js +154 -3
- package/dist/ScrollArea/index.d.ts +265 -13
- package/dist/ScrollArea/index.js +892 -10
- package/dist/Select/index.d.ts +1493 -38
- package/dist/Select/index.js +1824 -23
- package/dist/Separator/index.d.ts +80 -6
- package/dist/Separator/index.js +3 -3
- package/dist/Slider/index.d.ts +678 -16
- package/dist/Slider/index.js +1199 -11
- package/dist/Switch/index.d.ts +393 -5
- package/dist/Switch/index.js +208 -6
- package/dist/Tabs/index.d.ts +523 -12
- package/dist/Tabs/index.js +685 -9
- package/dist/Toggle/index.d.ts +305 -2
- package/dist/Toggle/index.js +76 -3
- package/dist/ToggleGroup/index.d.ts +316 -2
- package/dist/ToggleGroup/index.js +102 -3
- package/dist/Toolbar/index.d.ts +282 -13
- package/dist/Toolbar/index.js +230 -9
- package/dist/Tooltip/index.d.ts +1572 -14
- package/dist/Tooltip/index.js +965 -14
- package/dist/index.d.ts +12749 -652
- package/dist/rslib-runtime.js +18 -0
- package/package.json +3 -3
package/dist/Menu/index.d.ts
CHANGED
|
@@ -1,64 +1,408 @@
|
|
|
1
|
+
import { FloatingRootContext as FloatingRootContext_2 } from '../../floating-ui-react/index.js';
|
|
2
|
+
import { FloatingRootStore as FloatingRootStore_2 } from '../../floating-ui-react/components/FloatingRootStore.js';
|
|
3
|
+
import type { InteractionType } from '@base-ui/utils/useEnhancedClickHandler';
|
|
1
4
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { MenuSubmenuTriggerProps } from '@base-ui/react/menu';
|
|
5
|
+
import { MenuArrowProps as MenuArrowProps_2 } from '@base-ui/react/menu';
|
|
6
|
+
import { MenuBackdropProps as MenuBackdropProps_2 } from '@base-ui/react/menu';
|
|
7
|
+
import { MenuCheckboxItemIndicatorProps as MenuCheckboxItemIndicatorProps_2 } from '@base-ui/react/menu';
|
|
8
|
+
import { MenuCheckboxItemProps as MenuCheckboxItemProps_2 } from '@base-ui/react/menu';
|
|
9
|
+
import { MenuGroupLabelProps as MenuGroupLabelProps_2 } from '@base-ui/react/menu';
|
|
10
|
+
import { MenuGroupProps as MenuGroupProps_2 } from '@base-ui/react/menu';
|
|
11
|
+
import { MenuItemProps as MenuItemProps_2 } from '@base-ui/react/menu';
|
|
12
|
+
import { MenuLinkItemProps as MenuLinkItemProps_2 } from '@base-ui/react/menu';
|
|
13
|
+
import { MenuPopupProps as MenuPopupProps_2 } from '@base-ui/react/menu';
|
|
14
|
+
import { MenuPortalProps as MenuPortalProps_2 } from '@base-ui/react/menu';
|
|
15
|
+
import { MenuPositionerProps as MenuPositionerProps_2 } from '@base-ui/react/menu';
|
|
16
|
+
import { MenuRadioGroupProps as MenuRadioGroupProps_2 } from '@base-ui/react/menu';
|
|
17
|
+
import { MenuRadioItemIndicatorProps as MenuRadioItemIndicatorProps_2 } from '@base-ui/react/menu';
|
|
18
|
+
import { MenuRadioItemProps as MenuRadioItemProps_2 } from '@base-ui/react/menu';
|
|
19
|
+
import { MenuRootChangeEventReason as MenuRootChangeEventReason_2 } from '../index.js';
|
|
20
|
+
import { MenuSubmenuTriggerProps as MenuSubmenuTriggerProps_2 } from '@base-ui/react/menu';
|
|
21
|
+
import { Padding } from '@floating-ui/react-dom';
|
|
18
22
|
import * as React_2 from 'react';
|
|
19
|
-
import {
|
|
23
|
+
import { ReactStore } from '@base-ui/utils/store';
|
|
24
|
+
import { Rect } from '@floating-ui/utils';
|
|
25
|
+
import { SeparatorProps as SeparatorProps_2 } from '@base-ui/react';
|
|
26
|
+
import { TransitionStatus as TransitionStatus_2 } from '../../internals/useTransitionStatus.js';
|
|
27
|
+
import type { UseFloatingReturn } from '@floating-ui/react-dom';
|
|
28
|
+
import { VirtualElement } from '@floating-ui/react-dom';
|
|
29
|
+
|
|
30
|
+
declare type Align = 'start' | 'center' | 'end';
|
|
31
|
+
|
|
32
|
+
declare type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
|
|
33
|
+
/**
|
|
34
|
+
* The reason for the event.
|
|
35
|
+
*/
|
|
36
|
+
reason: Reason;
|
|
37
|
+
/**
|
|
38
|
+
* The native event associated with the custom event.
|
|
39
|
+
*/
|
|
40
|
+
event: ReasonToEvent<Reason>;
|
|
41
|
+
/**
|
|
42
|
+
* Cancels Base UI from handling the event.
|
|
43
|
+
*/
|
|
44
|
+
cancel: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Allows the event to propagate in cases where Base UI will stop the propagation.
|
|
47
|
+
*/
|
|
48
|
+
allowPropagation: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Indicates whether the event has been canceled.
|
|
51
|
+
*/
|
|
52
|
+
isCanceled: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Indicates whether the event is allowed to propagate.
|
|
55
|
+
*/
|
|
56
|
+
isPropagationAllowed: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The element that triggered the event, if applicable.
|
|
59
|
+
*/
|
|
60
|
+
trigger: Element | undefined;
|
|
61
|
+
} & CustomProperties;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Details of custom change events emitted by Base UI components.
|
|
65
|
+
*/
|
|
66
|
+
declare type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Props shared by all Base UI components.
|
|
70
|
+
* Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
|
|
71
|
+
*/
|
|
72
|
+
declare type BaseUIComponentProps<ElementType extends React_2.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React_2.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked' | 'style'> & {
|
|
73
|
+
/**
|
|
74
|
+
* CSS class applied to the element, or a function that
|
|
75
|
+
* returns a class based on the component's state.
|
|
76
|
+
*/
|
|
77
|
+
className?: string | ((state: State) => string | undefined) | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Allows you to replace the component's HTML element
|
|
80
|
+
* with a different tag, or compose it with another component.
|
|
81
|
+
*
|
|
82
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
83
|
+
*/
|
|
84
|
+
render?: React_2.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Style applied to the element, or a function that
|
|
87
|
+
* returns a style object based on the component's state.
|
|
88
|
+
*/
|
|
89
|
+
style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E & {
|
|
93
|
+
preventBaseUIHandler: () => void;
|
|
94
|
+
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
declare type Boundary = 'clipping-ancestors' | Element | Element[] | Rect;
|
|
98
|
+
|
|
99
|
+
declare const cancelOpen: "cancel-open";
|
|
100
|
+
|
|
101
|
+
declare const chipRemovePress: "chip-remove-press";
|
|
102
|
+
|
|
103
|
+
declare const clearPress: "clear-press";
|
|
104
|
+
|
|
105
|
+
declare const closePress: "close-press";
|
|
106
|
+
|
|
107
|
+
declare const closeWatcher: "close-watcher";
|
|
108
|
+
|
|
109
|
+
declare type CollisionAvoidance = SideFlipMode | SideShiftMode;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Shape of the render prop: a function that takes props to be spread on the element and component's state and returns a React element.
|
|
113
|
+
*
|
|
114
|
+
* @template Props Props to be spread on the rendered element.
|
|
115
|
+
* @template State Component's internal state.
|
|
116
|
+
*/
|
|
117
|
+
declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
|
|
118
|
+
|
|
119
|
+
declare type Context = PopupStoreContext<MenuRoot.ChangeEventDetails> & {
|
|
120
|
+
readonly positionerRef: React_2.RefObject<HTMLElement | null>;
|
|
121
|
+
readonly popupRef: React_2.RefObject<HTMLElement | null>;
|
|
122
|
+
readonly typingRef: React_2.RefObject<boolean>;
|
|
123
|
+
readonly itemDomElements: React_2.RefObject<(HTMLElement | null)[]>;
|
|
124
|
+
readonly itemLabels: React_2.RefObject<(string | null)[]>;
|
|
125
|
+
allowMouseUpTriggerRef: React_2.RefObject<boolean>;
|
|
126
|
+
readonly triggerFocusTargetRef: React_2.RefObject<HTMLElement | null>;
|
|
127
|
+
readonly beforeContentFocusGuardRef: React_2.RefObject<HTMLElement | null>;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
declare interface ContextData {
|
|
131
|
+
openEvent?: Event | undefined;
|
|
132
|
+
floatingContext?: FloatingContext | undefined;
|
|
133
|
+
[key: string]: any;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* A component that creates a context menu activated by right clicking or long pressing.
|
|
138
|
+
* Doesn't render its own HTML element.
|
|
139
|
+
*
|
|
140
|
+
* Documentation: [Base UI Context Menu](https://base-ui.com/react/components/context-menu)
|
|
141
|
+
*/
|
|
142
|
+
declare function ContextMenuRoot(props: ContextMenuRoot.Props): JSX_2.Element;
|
|
143
|
+
|
|
144
|
+
declare namespace ContextMenuRoot {
|
|
145
|
+
type State = ContextMenuRootState;
|
|
146
|
+
type Props = ContextMenuRootProps;
|
|
147
|
+
type Actions = ContextMenuRootActions;
|
|
148
|
+
type ChangeEventReason = ContextMenuRootChangeEventReason;
|
|
149
|
+
type ChangeEventDetails = ContextMenuRootChangeEventDetails;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare type ContextMenuRootActions = MenuRoot.Actions;
|
|
153
|
+
|
|
154
|
+
declare type ContextMenuRootChangeEventDetails = BaseUIChangeEventDetails<ContextMenuRoot.ChangeEventReason>;
|
|
155
|
+
|
|
156
|
+
declare type ContextMenuRootChangeEventReason = MenuRoot.ChangeEventReason;
|
|
157
|
+
|
|
158
|
+
declare interface ContextMenuRootContext {
|
|
159
|
+
anchor: {
|
|
160
|
+
getBoundingClientRect: () => DOMRect;
|
|
161
|
+
};
|
|
162
|
+
setAnchor: React_2.Dispatch<React_2.SetStateAction<ContextMenuRootContext['anchor']>>;
|
|
163
|
+
backdropRef: React_2.RefObject<HTMLDivElement | null>;
|
|
164
|
+
internalBackdropRef: React_2.RefObject<HTMLDivElement | null>;
|
|
165
|
+
actionsRef: React_2.RefObject<{
|
|
166
|
+
setOpen: (nextOpen: boolean, eventDetails: ContextMenuRoot.ChangeEventDetails) => void;
|
|
167
|
+
} | null>;
|
|
168
|
+
positionerRef: React_2.RefObject<HTMLElement | null>;
|
|
169
|
+
allowMouseUpTriggerRef: React_2.RefObject<boolean>;
|
|
170
|
+
initialCursorPointRef: React_2.RefObject<{
|
|
171
|
+
x: number;
|
|
172
|
+
y: number;
|
|
173
|
+
} | null>;
|
|
174
|
+
rootId: string | undefined;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
declare const ContextMenuRootContext: React_2.Context<ContextMenuRootContext | undefined>;
|
|
178
|
+
|
|
179
|
+
declare interface ContextMenuRootProps extends Omit<Menu_2.Root.Props, 'modal' | 'openOnHover' | 'delay' | 'closeDelay' | 'onOpenChange'> {
|
|
180
|
+
/**
|
|
181
|
+
* Event handler called when the menu is opened or closed.
|
|
182
|
+
*/
|
|
183
|
+
onOpenChange?: ((open: boolean, eventDetails: ContextMenuRoot.ChangeEventDetails) => void) | undefined;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
declare interface ContextMenuRootState {}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Creates a new handle to connect a Menu.Root with detached Menu.Trigger components.
|
|
190
|
+
*/
|
|
191
|
+
declare function createMenuHandle<Payload>(): MenuHandle<Payload>;
|
|
192
|
+
|
|
193
|
+
declare const decrementPress: "decrement-press";
|
|
194
|
+
|
|
195
|
+
declare const disabled: "disabled";
|
|
196
|
+
|
|
197
|
+
declare const drag: "drag";
|
|
198
|
+
|
|
199
|
+
declare const escapeKey: "escape-key";
|
|
200
|
+
|
|
201
|
+
declare interface ExtendedElements {
|
|
202
|
+
reference: ReferenceType | null;
|
|
203
|
+
floating: HTMLElement | null;
|
|
204
|
+
domReference: NarrowedElement<ReferenceType> | null;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
declare interface ExtendedRefs {
|
|
208
|
+
reference: React_2.RefObject<ReferenceType | null>;
|
|
209
|
+
floating: React_2.RefObject<HTMLElement | null>;
|
|
210
|
+
domReference: React_2.RefObject<NarrowedElement<ReferenceType> | null>;
|
|
211
|
+
setReference(node: ReferenceType | null): void;
|
|
212
|
+
setFloating(node: HTMLElement | null): void;
|
|
213
|
+
setPositionReference(node: ReferenceType | null): void;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
declare type FloatingContext = Omit<UseFloatingReturn<ReferenceType>, 'refs' | 'elements'> & {
|
|
217
|
+
open: boolean;
|
|
218
|
+
onOpenChange(open: boolean, eventDetails: BaseUIChangeEventDetails<string>): void;
|
|
219
|
+
events: FloatingEvents;
|
|
220
|
+
dataRef: React_2.RefObject<ContextData>;
|
|
221
|
+
nodeId: string | undefined;
|
|
222
|
+
floatingId: string | undefined;
|
|
223
|
+
refs: ExtendedRefs;
|
|
224
|
+
elements: ExtendedElements;
|
|
225
|
+
rootStore: FloatingRootContext;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
declare interface FloatingEvents {
|
|
229
|
+
emit<T extends string>(event: T, data?: any): void;
|
|
230
|
+
on(event: string, handler: (data: any) => void): void;
|
|
231
|
+
off(event: string, handler: (data: any) => void): void;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
declare interface FloatingNodeType {
|
|
235
|
+
id: string | undefined;
|
|
236
|
+
parentId: string | null;
|
|
237
|
+
context?: FloatingContext | undefined;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Portals the floating element into a given container element — by default,
|
|
242
|
+
* outside of the app root and into the body.
|
|
243
|
+
* This is necessary to ensure the floating element can appear outside any
|
|
244
|
+
* potential parent containers that cause clipping (such as `overflow: hidden`),
|
|
245
|
+
* while retaining its location in the React tree.
|
|
246
|
+
* @see https://floating-ui.com/docs/FloatingPortal
|
|
247
|
+
* @internal
|
|
248
|
+
*/
|
|
249
|
+
declare const FloatingPortal: React_2.ForwardRefExoticComponent<Omit<FloatingPortal.Props<any> & {
|
|
250
|
+
renderGuards?: boolean | undefined;
|
|
251
|
+
}, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
252
|
+
|
|
253
|
+
declare namespace FloatingPortal {
|
|
254
|
+
type State = FloatingPortalState;
|
|
255
|
+
interface Props<TState> extends BaseUIComponentProps<'div', TState> {
|
|
256
|
+
/**
|
|
257
|
+
* A parent element to render the portal element into.
|
|
258
|
+
*/
|
|
259
|
+
container?: UseFloatingPortalNodeProps['container'] | undefined;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
declare interface FloatingPortalState {}
|
|
264
|
+
|
|
265
|
+
declare type FloatingRootContext = FloatingRootStore;
|
|
266
|
+
|
|
267
|
+
declare interface FloatingRootState {
|
|
268
|
+
open: boolean;
|
|
269
|
+
transitionStatus: TransitionStatus | undefined;
|
|
270
|
+
domReferenceElement: Element | null;
|
|
271
|
+
referenceElement: ReferenceType | null;
|
|
272
|
+
floatingElement: HTMLElement | null;
|
|
273
|
+
positionReference: ReferenceType | null;
|
|
274
|
+
/**
|
|
275
|
+
* The ID of the floating element.
|
|
276
|
+
*/
|
|
277
|
+
floatingId: string | undefined;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
declare class FloatingRootStore extends ReactStore<Readonly<FloatingRootState>, FloatingRootStoreContext, typeof selectors> {
|
|
281
|
+
private readonly syncOnly;
|
|
282
|
+
constructor(options: FloatingRootStoreOptions);
|
|
283
|
+
/**
|
|
284
|
+
* Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
|
|
285
|
+
*/
|
|
286
|
+
syncOpenEvent: (newOpen: boolean, event: Event | undefined) => void;
|
|
287
|
+
/**
|
|
288
|
+
* Runs the root-owned side effects for an open state change.
|
|
289
|
+
*/
|
|
290
|
+
dispatchOpenChange: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
|
|
291
|
+
/**
|
|
292
|
+
* Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
|
|
293
|
+
*
|
|
294
|
+
* @param newOpen The new open state.
|
|
295
|
+
* @param eventDetails Details about the event that triggered the open state change.
|
|
296
|
+
*/
|
|
297
|
+
setOpen: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
declare interface FloatingRootStoreContext {
|
|
301
|
+
onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
|
|
302
|
+
readonly dataRef: React_2.RefObject<ContextData>;
|
|
303
|
+
readonly events: FloatingEvents;
|
|
304
|
+
nested: boolean;
|
|
305
|
+
readonly triggerElements: PopupTriggerMap;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
declare interface FloatingRootStoreOptions {
|
|
309
|
+
open: boolean;
|
|
310
|
+
transitionStatus: TransitionStatus | undefined;
|
|
311
|
+
referenceElement: ReferenceType | null;
|
|
312
|
+
floatingElement: HTMLElement | null;
|
|
313
|
+
triggerElements: PopupTriggerMap;
|
|
314
|
+
floatingId: string | undefined;
|
|
315
|
+
/**
|
|
316
|
+
* When true, `setOpen` only forwards to `onOpenChange`.
|
|
317
|
+
* The popup store owns `dispatchOpenChange(...)` in this mode.
|
|
318
|
+
*/
|
|
319
|
+
syncOnly: boolean;
|
|
320
|
+
nested: boolean;
|
|
321
|
+
onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Stores and manages floating elements in a tree structure.
|
|
326
|
+
* This is a backing store for the `FloatingTree` component.
|
|
327
|
+
*/
|
|
328
|
+
declare class FloatingTreeStore {
|
|
329
|
+
readonly nodesRef: React.RefObject<Array<FloatingNodeType>>;
|
|
330
|
+
readonly events: FloatingEvents;
|
|
331
|
+
addNode(node: FloatingNodeType): void;
|
|
332
|
+
removeNode(node: FloatingNodeType): void;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
declare const focusOut: "focus-out";
|
|
336
|
+
|
|
337
|
+
declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
|
|
338
|
+
ref?: React_2.Ref<T> | undefined;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
declare const imperativeAction: "imperative-action";
|
|
342
|
+
|
|
343
|
+
declare const incrementPress: "increment-press";
|
|
344
|
+
|
|
345
|
+
declare const initial: "initial";
|
|
346
|
+
|
|
347
|
+
declare const inputBlur: "input-blur";
|
|
348
|
+
|
|
349
|
+
declare const inputChange: "input-change";
|
|
350
|
+
|
|
351
|
+
declare const inputClear: "input-clear";
|
|
352
|
+
|
|
353
|
+
declare const inputPaste: "input-paste";
|
|
354
|
+
|
|
355
|
+
declare const inputPress: "input-press";
|
|
356
|
+
|
|
357
|
+
declare const itemPress: "item-press";
|
|
358
|
+
|
|
359
|
+
declare const keyboard: "keyboard";
|
|
360
|
+
|
|
361
|
+
declare const linkPress: "link-press";
|
|
362
|
+
|
|
363
|
+
declare const listNavigation: "list-navigation";
|
|
20
364
|
|
|
21
365
|
export declare const Menu: {
|
|
22
|
-
Arrow: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
366
|
+
Arrow: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuArrowProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
23
367
|
className?: string | undefined;
|
|
24
368
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
25
|
-
Backdrop: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
369
|
+
Backdrop: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuBackdropProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
26
370
|
className?: string | undefined;
|
|
27
371
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
28
|
-
CheckboxItem: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
372
|
+
CheckboxItem: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuCheckboxItemProps_2, "ref"> & React_2.RefAttributes<HTMLElement>, "ref">, "className"> & {
|
|
29
373
|
className?: string | undefined;
|
|
30
374
|
} & React_2.RefAttributes<HTMLElement>>;
|
|
31
|
-
CheckboxItemIndicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
375
|
+
CheckboxItemIndicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuCheckboxItemIndicatorProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
|
|
32
376
|
className?: string | undefined;
|
|
33
377
|
} & React_2.RefAttributes<HTMLSpanElement>>;
|
|
34
|
-
Group: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
378
|
+
Group: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuGroupProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
35
379
|
className?: string | undefined;
|
|
36
380
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
37
|
-
GroupLabel: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
381
|
+
GroupLabel: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuGroupLabelProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
38
382
|
className?: string | undefined;
|
|
39
383
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
40
|
-
Item: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
384
|
+
Item: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuItemProps_2, "ref"> & React_2.RefAttributes<HTMLElement>, "ref">, "className"> & {
|
|
41
385
|
className?: string | undefined;
|
|
42
386
|
} & React_2.RefAttributes<HTMLElement>>;
|
|
43
|
-
LinkItem: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
387
|
+
LinkItem: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuLinkItemProps_2, "ref"> & React_2.RefAttributes<Element>, "ref">, "className"> & {
|
|
44
388
|
className?: string | undefined;
|
|
45
389
|
} & React_2.RefAttributes<Element>>;
|
|
46
|
-
Popup: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
390
|
+
Popup: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuPopupProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
47
391
|
className?: string | undefined;
|
|
48
392
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
49
|
-
Positioner: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
393
|
+
Positioner: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuPositionerProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
50
394
|
className?: string | undefined;
|
|
51
395
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
52
|
-
RadioGroup: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
396
|
+
RadioGroup: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuRadioGroupProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
53
397
|
className?: string | undefined;
|
|
54
398
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
55
|
-
RadioItem: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
399
|
+
RadioItem: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuRadioItemProps_2, "ref"> & React_2.RefAttributes<HTMLElement>, "ref">, "className"> & {
|
|
56
400
|
className?: string | undefined;
|
|
57
401
|
} & React_2.RefAttributes<HTMLElement>>;
|
|
58
|
-
RadioItemIndicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
402
|
+
RadioItemIndicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuRadioItemIndicatorProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
|
|
59
403
|
className?: string | undefined;
|
|
60
404
|
} & React_2.RefAttributes<HTMLSpanElement>>;
|
|
61
|
-
SubmenuTrigger: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
405
|
+
SubmenuTrigger: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<MenuSubmenuTriggerProps_2, "ref"> & React_2.RefAttributes<HTMLElement>, "ref">, "className"> & {
|
|
62
406
|
className?: string | undefined;
|
|
63
407
|
} & React_2.RefAttributes<HTMLElement>>;
|
|
64
408
|
Viewport: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<Menu_2.Viewport.Props, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
@@ -67,19 +411,1940 @@ export declare const Menu: {
|
|
|
67
411
|
Root: <Payload>(props: Menu_2.Root.Props<Payload>) => JSX_2.Element;
|
|
68
412
|
Trigger: typeof Trigger;
|
|
69
413
|
SubmenuRoot: typeof Menu_2.SubmenuRoot;
|
|
70
|
-
Portal: React_2.ForwardRefExoticComponent<Omit<
|
|
71
|
-
Separator: React_2.ForwardRefExoticComponent<Omit<
|
|
414
|
+
Portal: React_2.ForwardRefExoticComponent<Omit<MenuPortalProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
415
|
+
Separator: React_2.ForwardRefExoticComponent<Omit<SeparatorProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
72
416
|
Handle: typeof Menu_2.Handle;
|
|
73
417
|
createHandle: typeof Menu_2.createHandle;
|
|
74
418
|
};
|
|
75
419
|
|
|
420
|
+
export declare namespace Menu_2 {
|
|
421
|
+
export {
|
|
422
|
+
MenuArrow as Arrow,
|
|
423
|
+
MenuBackdrop as Backdrop,
|
|
424
|
+
MenuCheckboxItem as CheckboxItem,
|
|
425
|
+
MenuCheckboxItemIndicator as CheckboxItemIndicator,
|
|
426
|
+
MenuGroup as Group,
|
|
427
|
+
MenuGroupLabel as GroupLabel,
|
|
428
|
+
MenuItem as Item,
|
|
429
|
+
MenuLinkItem as LinkItem,
|
|
430
|
+
MenuPopup as Popup,
|
|
431
|
+
MenuPortal as Portal,
|
|
432
|
+
MenuPositioner as Positioner,
|
|
433
|
+
MenuRadioGroup as RadioGroup,
|
|
434
|
+
MenuRadioItem as RadioItem,
|
|
435
|
+
MenuRadioItemIndicator as RadioItemIndicator,
|
|
436
|
+
MenuRoot as Root,
|
|
437
|
+
MenuSubmenuRoot as SubmenuRoot,
|
|
438
|
+
MenuTrigger as Trigger,
|
|
439
|
+
MenuViewport as Viewport,
|
|
440
|
+
Separator,
|
|
441
|
+
MenuSubmenuTrigger as SubmenuTrigger,
|
|
442
|
+
MenuHandle as Handle,
|
|
443
|
+
createMenuHandle as createHandle
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Displays an element positioned against the menu anchor.
|
|
449
|
+
* Renders a `<div>` element.
|
|
450
|
+
*
|
|
451
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
452
|
+
*/
|
|
453
|
+
export declare const MenuArrow: React_2.ForwardRefExoticComponent<Omit<MenuArrowProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
454
|
+
|
|
455
|
+
export declare namespace MenuArrow {
|
|
456
|
+
export type State = MenuArrowState;
|
|
457
|
+
export type Props = MenuArrowProps;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export declare interface MenuArrowProps extends BaseUIComponentProps<'div', MenuArrowState> {}
|
|
461
|
+
|
|
462
|
+
export declare interface MenuArrowState {
|
|
463
|
+
/**
|
|
464
|
+
* Whether the menu is currently open.
|
|
465
|
+
*/
|
|
466
|
+
open: boolean;
|
|
467
|
+
/**
|
|
468
|
+
* The side of the anchor the component is placed on.
|
|
469
|
+
*/
|
|
470
|
+
side: Side;
|
|
471
|
+
/**
|
|
472
|
+
* The alignment of the component relative to the anchor.
|
|
473
|
+
*/
|
|
474
|
+
align: Align;
|
|
475
|
+
/**
|
|
476
|
+
* Whether the arrow cannot be centered on the anchor.
|
|
477
|
+
*/
|
|
478
|
+
uncentered: boolean;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* An overlay displayed beneath the menu popup.
|
|
483
|
+
* Renders a `<div>` element.
|
|
484
|
+
*
|
|
485
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
486
|
+
*/
|
|
487
|
+
export declare const MenuBackdrop: React_2.ForwardRefExoticComponent<Omit<MenuBackdropProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
488
|
+
|
|
489
|
+
export declare namespace MenuBackdrop {
|
|
490
|
+
export type State = MenuBackdropState;
|
|
491
|
+
export type Props = MenuBackdropProps;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export declare interface MenuBackdropProps extends BaseUIComponentProps<'div', MenuBackdropState> {}
|
|
495
|
+
|
|
496
|
+
export declare interface MenuBackdropState {
|
|
497
|
+
/**
|
|
498
|
+
* Whether the menu is currently open.
|
|
499
|
+
*/
|
|
500
|
+
open: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* The transition status of the component.
|
|
503
|
+
*/
|
|
504
|
+
transitionStatus: TransitionStatus;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
declare interface MenubarContext {
|
|
508
|
+
modal: boolean;
|
|
509
|
+
disabled: boolean;
|
|
510
|
+
contentElement: HTMLElement | null;
|
|
511
|
+
setContentElement: (element: HTMLElement | null) => void;
|
|
512
|
+
hasSubmenuOpen: boolean;
|
|
513
|
+
setHasSubmenuOpen: (open: boolean) => void;
|
|
514
|
+
orientation: MenuRoot.Orientation;
|
|
515
|
+
allowMouseUpTriggerRef: React_2.RefObject<boolean>;
|
|
516
|
+
rootId: string | undefined;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
declare const MenubarContext: React_2.Context<MenubarContext | null>;
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* A menu item that toggles a setting on or off.
|
|
523
|
+
* Renders a `<div>` element.
|
|
524
|
+
*
|
|
525
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
526
|
+
*/
|
|
527
|
+
export declare const MenuCheckboxItem: React_2.ForwardRefExoticComponent<Omit<MenuCheckboxItemProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
|
|
528
|
+
|
|
529
|
+
export declare namespace MenuCheckboxItem {
|
|
530
|
+
export type State = MenuCheckboxItemState;
|
|
531
|
+
export type Props = MenuCheckboxItemProps;
|
|
532
|
+
export type ChangeEventReason = MenuCheckboxItemChangeEventReason;
|
|
533
|
+
export type ChangeEventDetails = MenuCheckboxItemChangeEventDetails;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export declare type MenuCheckboxItemChangeEventDetails = MenuRoot.ChangeEventDetails;
|
|
537
|
+
|
|
538
|
+
export declare type MenuCheckboxItemChangeEventReason = MenuRoot.ChangeEventReason;
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Indicates whether the checkbox item is ticked.
|
|
542
|
+
* Renders a `<span>` element.
|
|
543
|
+
*
|
|
544
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
545
|
+
*/
|
|
546
|
+
export declare const MenuCheckboxItemIndicator: React_2.ForwardRefExoticComponent<Omit<MenuCheckboxItemIndicatorProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
|
|
547
|
+
|
|
548
|
+
export declare namespace MenuCheckboxItemIndicator {
|
|
549
|
+
export type Props = MenuCheckboxItemIndicatorProps;
|
|
550
|
+
export type State = MenuCheckboxItemIndicatorState;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export declare interface MenuCheckboxItemIndicatorProps extends BaseUIComponentProps<'span', MenuCheckboxItemIndicatorState> {
|
|
554
|
+
/**
|
|
555
|
+
* Whether to keep the HTML element in the DOM when the checkbox item is not checked.
|
|
556
|
+
* @default false
|
|
557
|
+
*/
|
|
558
|
+
keepMounted?: boolean | undefined;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
export declare interface MenuCheckboxItemIndicatorState {
|
|
562
|
+
/**
|
|
563
|
+
* Whether the checkbox item is currently ticked.
|
|
564
|
+
*/
|
|
565
|
+
checked: boolean;
|
|
566
|
+
/**
|
|
567
|
+
* Whether the component should ignore user interaction.
|
|
568
|
+
*/
|
|
569
|
+
disabled: boolean;
|
|
570
|
+
/**
|
|
571
|
+
* Whether the item is highlighted.
|
|
572
|
+
*/
|
|
573
|
+
highlighted: boolean;
|
|
574
|
+
/**
|
|
575
|
+
* The transition status of the component.
|
|
576
|
+
*/
|
|
577
|
+
transitionStatus: TransitionStatus;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export declare interface MenuCheckboxItemProps extends NonNativeButtonProps, BaseUIComponentProps<'div', MenuCheckboxItemState> {
|
|
581
|
+
/**
|
|
582
|
+
* Whether the checkbox item is currently ticked.
|
|
583
|
+
*
|
|
584
|
+
* To render an uncontrolled checkbox item, use the `defaultChecked` prop instead.
|
|
585
|
+
*/
|
|
586
|
+
checked?: boolean | undefined;
|
|
587
|
+
/**
|
|
588
|
+
* Whether the checkbox item is initially ticked.
|
|
589
|
+
*
|
|
590
|
+
* To render a controlled checkbox item, use the `checked` prop instead.
|
|
591
|
+
* @default false
|
|
592
|
+
*/
|
|
593
|
+
defaultChecked?: boolean | undefined;
|
|
594
|
+
/**
|
|
595
|
+
* Event handler called when the checkbox item is ticked or unticked.
|
|
596
|
+
*/
|
|
597
|
+
onCheckedChange?: ((checked: boolean, eventDetails: MenuCheckboxItem.ChangeEventDetails) => void) | undefined;
|
|
598
|
+
/**
|
|
599
|
+
* The click handler for the menu item.
|
|
600
|
+
*/
|
|
601
|
+
onClick?: BaseUIComponentProps<'div', MenuCheckboxItemState>['onClick'] | undefined;
|
|
602
|
+
/**
|
|
603
|
+
* Whether the component should ignore user interaction.
|
|
604
|
+
* @default false
|
|
605
|
+
*/
|
|
606
|
+
disabled?: boolean | undefined;
|
|
607
|
+
/**
|
|
608
|
+
* Overrides the text label to use when the item is matched during keyboard text navigation.
|
|
609
|
+
*/
|
|
610
|
+
label?: string | undefined;
|
|
611
|
+
/**
|
|
612
|
+
* @ignore
|
|
613
|
+
*/
|
|
614
|
+
id?: string | undefined;
|
|
615
|
+
/**
|
|
616
|
+
* Whether to close the menu when the item is clicked.
|
|
617
|
+
* @default false
|
|
618
|
+
*/
|
|
619
|
+
closeOnClick?: boolean | undefined;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
export declare interface MenuCheckboxItemState {
|
|
623
|
+
/**
|
|
624
|
+
* Whether the checkbox item should ignore user interaction.
|
|
625
|
+
*/
|
|
626
|
+
disabled: boolean;
|
|
627
|
+
/**
|
|
628
|
+
* Whether the checkbox item is currently highlighted.
|
|
629
|
+
*/
|
|
630
|
+
highlighted: boolean;
|
|
631
|
+
/**
|
|
632
|
+
* Whether the checkbox item is currently ticked.
|
|
633
|
+
*/
|
|
634
|
+
checked: boolean;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Groups related menu items with the corresponding label.
|
|
639
|
+
* Renders a `<div>` element.
|
|
640
|
+
*
|
|
641
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
642
|
+
*/
|
|
643
|
+
export declare const MenuGroup: React_2.ForwardRefExoticComponent<Omit<MenuGroupProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
644
|
+
|
|
645
|
+
export declare namespace MenuGroup {
|
|
646
|
+
export type Props = MenuGroupProps;
|
|
647
|
+
export type State = MenuGroupState;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* An accessible label that is automatically associated with its parent group.
|
|
652
|
+
* Renders a `<div>` element.
|
|
653
|
+
*
|
|
654
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
655
|
+
*/
|
|
656
|
+
export declare const MenuGroupLabel: React_2.ForwardRefExoticComponent<Omit<MenuGroupLabelProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
657
|
+
|
|
658
|
+
export declare namespace MenuGroupLabel {
|
|
659
|
+
export type Props = MenuGroupLabelProps;
|
|
660
|
+
export type State = MenuGroupLabelState;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
export declare interface MenuGroupLabelProps extends BaseUIComponentProps<'div', MenuGroupLabelState> {}
|
|
664
|
+
|
|
665
|
+
export declare interface MenuGroupLabelState {}
|
|
666
|
+
|
|
667
|
+
export declare interface MenuGroupProps extends BaseUIComponentProps<'div', MenuGroupState> {
|
|
668
|
+
/**
|
|
669
|
+
* The content of the component.
|
|
670
|
+
*/
|
|
671
|
+
children?: React_2.ReactNode;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
export declare interface MenuGroupState {}
|
|
675
|
+
|
|
676
|
+
declare class MenuHandle<Payload> {
|
|
677
|
+
/**
|
|
678
|
+
* Internal store holding the menu's state.
|
|
679
|
+
* @internal
|
|
680
|
+
*/
|
|
681
|
+
readonly store: MenuStore<Payload>;
|
|
682
|
+
constructor();
|
|
683
|
+
/**
|
|
684
|
+
* Opens the menu and associates it with the trigger with the given id.
|
|
685
|
+
* The trigger must be a Menu.Trigger component with this handle passed as a prop.
|
|
686
|
+
*
|
|
687
|
+
* @param triggerId ID of the trigger to associate with the menu.
|
|
688
|
+
*/
|
|
689
|
+
open(triggerId: string): void;
|
|
690
|
+
/**
|
|
691
|
+
* Closes the menu.
|
|
692
|
+
*/
|
|
693
|
+
close(): void;
|
|
694
|
+
/**
|
|
695
|
+
* Indicates whether the menu is currently open.
|
|
696
|
+
*/
|
|
697
|
+
get isOpen(): boolean;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* An individual interactive item in the menu.
|
|
702
|
+
* Renders a `<div>` element.
|
|
703
|
+
*
|
|
704
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
705
|
+
*/
|
|
706
|
+
export declare const MenuItem: React_2.ForwardRefExoticComponent<Omit<MenuItemProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
|
|
707
|
+
|
|
708
|
+
export declare namespace MenuItem {
|
|
709
|
+
export type State = MenuItemState;
|
|
710
|
+
export type Props = MenuItemProps;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
export declare interface MenuItemProps extends NonNativeButtonProps, BaseUIComponentProps<'div', MenuItemState> {
|
|
714
|
+
/**
|
|
715
|
+
* The click handler for the menu item.
|
|
716
|
+
*/
|
|
717
|
+
onClick?: BaseUIComponentProps<'div', MenuItemState>['onClick'] | undefined;
|
|
718
|
+
/**
|
|
719
|
+
* Whether the component should ignore user interaction.
|
|
720
|
+
* @default false
|
|
721
|
+
*/
|
|
722
|
+
disabled?: boolean | undefined;
|
|
723
|
+
/**
|
|
724
|
+
* Overrides the text label to use when the item is matched during keyboard text navigation.
|
|
725
|
+
*/
|
|
726
|
+
label?: string | undefined;
|
|
727
|
+
/**
|
|
728
|
+
* @ignore
|
|
729
|
+
*/
|
|
730
|
+
id?: string | undefined;
|
|
731
|
+
/**
|
|
732
|
+
* Whether to close the menu when the item is clicked.
|
|
733
|
+
*
|
|
734
|
+
* @default true
|
|
735
|
+
*/
|
|
736
|
+
closeOnClick?: boolean | undefined;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
export declare interface MenuItemState {
|
|
740
|
+
/**
|
|
741
|
+
* Whether the item should ignore user interaction.
|
|
742
|
+
*/
|
|
743
|
+
disabled: boolean;
|
|
744
|
+
/**
|
|
745
|
+
* Whether the item is highlighted.
|
|
746
|
+
*/
|
|
747
|
+
highlighted: boolean;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* A link in the menu that can be used to navigate to a different page or section.
|
|
752
|
+
* Renders an `<a>` element.
|
|
753
|
+
*
|
|
754
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
755
|
+
*/
|
|
756
|
+
export declare const MenuLinkItem: React_2.ForwardRefExoticComponent<Omit<MenuLinkItemProps, "ref"> & React_2.RefAttributes<Element>>;
|
|
757
|
+
|
|
758
|
+
export declare namespace MenuLinkItem {
|
|
759
|
+
export type State = MenuLinkItemState;
|
|
760
|
+
export type Props = MenuLinkItemProps;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
export declare interface MenuLinkItemProps extends BaseUIComponentProps<'a', MenuLinkItemState> {
|
|
764
|
+
/**
|
|
765
|
+
* Overrides the text label to use when the item is matched during keyboard text navigation.
|
|
766
|
+
*/
|
|
767
|
+
label?: string | undefined;
|
|
768
|
+
/**
|
|
769
|
+
* @ignore
|
|
770
|
+
*/
|
|
771
|
+
id?: string | undefined;
|
|
772
|
+
/**
|
|
773
|
+
* Whether to close the menu when the item is clicked.
|
|
774
|
+
* @default false
|
|
775
|
+
*/
|
|
776
|
+
closeOnClick?: boolean | undefined;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export declare interface MenuLinkItemState {
|
|
780
|
+
/**
|
|
781
|
+
* Whether the item is highlighted.
|
|
782
|
+
*/
|
|
783
|
+
highlighted: boolean;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
export declare type MenuParent = {
|
|
787
|
+
type: 'menu';
|
|
788
|
+
store: MenuStore<unknown>;
|
|
789
|
+
} | {
|
|
790
|
+
type: 'menubar';
|
|
791
|
+
context: MenubarContext;
|
|
792
|
+
} | {
|
|
793
|
+
type: 'context-menu';
|
|
794
|
+
context: ContextMenuRootContext;
|
|
795
|
+
} | {
|
|
796
|
+
type: 'nested-context-menu';
|
|
797
|
+
context: ContextMenuRootContext;
|
|
798
|
+
menuContext: MenuRootContext;
|
|
799
|
+
} | {
|
|
800
|
+
type: undefined;
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* A container for the menu items.
|
|
805
|
+
* Renders a `<div>` element.
|
|
806
|
+
*
|
|
807
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
808
|
+
*/
|
|
809
|
+
export declare const MenuPopup: React_2.ForwardRefExoticComponent<Omit<MenuPopupProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
810
|
+
|
|
811
|
+
export declare namespace MenuPopup {
|
|
812
|
+
export type Props = MenuPopupProps;
|
|
813
|
+
export type State = MenuPopupState;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
export declare interface MenuPopupProps extends BaseUIComponentProps<'div', MenuPopupState> {
|
|
817
|
+
children?: React_2.ReactNode;
|
|
818
|
+
/**
|
|
819
|
+
* @ignore
|
|
820
|
+
*/
|
|
821
|
+
id?: string | undefined;
|
|
822
|
+
/**
|
|
823
|
+
* Determines the element to focus when the menu is closed.
|
|
824
|
+
*
|
|
825
|
+
* - `false`: Do not move focus.
|
|
826
|
+
* - `true`: Move focus based on the default behavior (trigger or previously focused element).
|
|
827
|
+
* - `RefObject`: Move focus to the ref element.
|
|
828
|
+
* - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).
|
|
829
|
+
* Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.
|
|
830
|
+
*/
|
|
831
|
+
finalFocus?: boolean | React_2.RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void) | undefined;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
export declare interface MenuPopupState {
|
|
835
|
+
/**
|
|
836
|
+
* The transition status of the component.
|
|
837
|
+
*/
|
|
838
|
+
transitionStatus: TransitionStatus;
|
|
839
|
+
/**
|
|
840
|
+
* The side of the anchor the component is placed on.
|
|
841
|
+
*/
|
|
842
|
+
side: Side;
|
|
843
|
+
/**
|
|
844
|
+
* The alignment of the component relative to the anchor.
|
|
845
|
+
*/
|
|
846
|
+
align: Align;
|
|
847
|
+
/**
|
|
848
|
+
* Whether the menu is currently open.
|
|
849
|
+
*/
|
|
850
|
+
open: boolean;
|
|
851
|
+
/**
|
|
852
|
+
* Whether the component is nested.
|
|
853
|
+
*/
|
|
854
|
+
nested: boolean;
|
|
855
|
+
/**
|
|
856
|
+
* Whether transitions should be skipped.
|
|
857
|
+
*/
|
|
858
|
+
instant: 'dismiss' | 'click' | 'group' | 'trigger-change' | undefined;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* A portal element that moves the popup to a different part of the DOM.
|
|
863
|
+
* By default, the portal element is appended to `<body>`.
|
|
864
|
+
* Renders a `<div>` element.
|
|
865
|
+
*
|
|
866
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
867
|
+
*/
|
|
868
|
+
export declare const MenuPortal: React_2.ForwardRefExoticComponent<Omit<MenuPortalProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
869
|
+
|
|
870
|
+
export declare namespace MenuPortal {
|
|
871
|
+
export type State = MenuPortalState;
|
|
872
|
+
export type Props = MenuPortalProps;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
export declare interface MenuPortalProps extends FloatingPortal.Props<MenuPortalState> {
|
|
876
|
+
/**
|
|
877
|
+
* Whether to keep the portal mounted in the DOM while the popup is hidden.
|
|
878
|
+
* @default false
|
|
879
|
+
*/
|
|
880
|
+
keepMounted?: boolean | undefined;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
export declare interface MenuPortalState {}
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* Positions the menu popup against the trigger.
|
|
887
|
+
* Renders a `<div>` element.
|
|
888
|
+
*
|
|
889
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
890
|
+
*/
|
|
891
|
+
export declare const MenuPositioner: React_2.ForwardRefExoticComponent<Omit<MenuPositionerProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
892
|
+
|
|
893
|
+
export declare namespace MenuPositioner {
|
|
894
|
+
export type State = MenuPositionerState;
|
|
895
|
+
export type Props = MenuPositionerProps;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
export declare interface MenuPositionerProps extends UseAnchorPositioningSharedParameters, BaseUIComponentProps<'div', MenuPositionerState> {}
|
|
899
|
+
|
|
900
|
+
export declare interface MenuPositionerState {
|
|
901
|
+
/**
|
|
902
|
+
* Whether the menu is currently open.
|
|
903
|
+
*/
|
|
904
|
+
open: boolean;
|
|
905
|
+
/**
|
|
906
|
+
* The side of the anchor the component is placed on.
|
|
907
|
+
*/
|
|
908
|
+
side: Side;
|
|
909
|
+
/**
|
|
910
|
+
* The alignment of the component relative to the anchor.
|
|
911
|
+
*/
|
|
912
|
+
align: Align;
|
|
913
|
+
/**
|
|
914
|
+
* Whether the anchor element is hidden.
|
|
915
|
+
*/
|
|
916
|
+
anchorHidden: boolean;
|
|
917
|
+
/**
|
|
918
|
+
* Whether the component is nested.
|
|
919
|
+
*/
|
|
920
|
+
nested: boolean;
|
|
921
|
+
/**
|
|
922
|
+
* Whether CSS transitions should be disabled.
|
|
923
|
+
*/
|
|
924
|
+
instant: string | undefined;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Groups related radio items.
|
|
929
|
+
* Renders a `<div>` element.
|
|
930
|
+
*
|
|
931
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
932
|
+
*/
|
|
933
|
+
export declare const MenuRadioGroup: React_2.NamedExoticComponent<Omit<MenuRadioGroupProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
934
|
+
|
|
935
|
+
export declare namespace MenuRadioGroup {
|
|
936
|
+
export type Props = MenuRadioGroupProps;
|
|
937
|
+
export type State = MenuRadioGroupState;
|
|
938
|
+
export type ChangeEventReason = MenuRadioGroupChangeEventReason;
|
|
939
|
+
export type ChangeEventDetails = MenuRadioGroupChangeEventDetails;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
export declare type MenuRadioGroupChangeEventDetails = MenuRoot.ChangeEventDetails;
|
|
943
|
+
|
|
944
|
+
export declare type MenuRadioGroupChangeEventReason = MenuRoot.ChangeEventReason;
|
|
945
|
+
|
|
946
|
+
export declare interface MenuRadioGroupProps extends BaseUIComponentProps<'div', MenuRadioGroupState> {
|
|
947
|
+
/**
|
|
948
|
+
* The content of the component.
|
|
949
|
+
*/
|
|
950
|
+
children?: React_2.ReactNode;
|
|
951
|
+
/**
|
|
952
|
+
* The controlled value of the radio item that should be currently selected.
|
|
953
|
+
*
|
|
954
|
+
* To render an uncontrolled radio group, use the `defaultValue` prop instead.
|
|
955
|
+
*/
|
|
956
|
+
value?: any;
|
|
957
|
+
/**
|
|
958
|
+
* The uncontrolled value of the radio item that should be initially selected.
|
|
959
|
+
*
|
|
960
|
+
* To render a controlled radio group, use the `value` prop instead.
|
|
961
|
+
*/
|
|
962
|
+
defaultValue?: any;
|
|
963
|
+
/**
|
|
964
|
+
* Function called when the selected value changes.
|
|
965
|
+
*/
|
|
966
|
+
onValueChange?: ((value: any, eventDetails: MenuRadioGroup.ChangeEventDetails) => void) | undefined;
|
|
967
|
+
/**
|
|
968
|
+
* Whether the component should ignore user interaction.
|
|
969
|
+
*
|
|
970
|
+
* @default false
|
|
971
|
+
*/
|
|
972
|
+
disabled?: boolean | undefined;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
export declare interface MenuRadioGroupState {
|
|
976
|
+
/**
|
|
977
|
+
* Whether the component is disabled.
|
|
978
|
+
*/
|
|
979
|
+
disabled: boolean;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* A menu item that works like a radio button in a given group.
|
|
984
|
+
* Renders a `<div>` element.
|
|
985
|
+
*
|
|
986
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
987
|
+
*/
|
|
988
|
+
export declare const MenuRadioItem: React_2.ForwardRefExoticComponent<Omit<MenuRadioItemProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
|
|
989
|
+
|
|
990
|
+
export declare namespace MenuRadioItem {
|
|
991
|
+
export type State = MenuRadioItemState;
|
|
992
|
+
export type Props = MenuRadioItemProps;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* Indicates whether the radio item is selected.
|
|
997
|
+
* Renders a `<span>` element.
|
|
998
|
+
*
|
|
999
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1000
|
+
*/
|
|
1001
|
+
export declare const MenuRadioItemIndicator: React_2.ForwardRefExoticComponent<Omit<MenuRadioItemIndicatorProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
|
|
1002
|
+
|
|
1003
|
+
export declare namespace MenuRadioItemIndicator {
|
|
1004
|
+
export type Props = MenuRadioItemIndicatorProps;
|
|
1005
|
+
export type State = MenuRadioItemIndicatorState;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
export declare interface MenuRadioItemIndicatorProps extends BaseUIComponentProps<'span', MenuRadioItemIndicatorState> {
|
|
1009
|
+
/**
|
|
1010
|
+
* Whether to keep the HTML element in the DOM when the radio item is inactive.
|
|
1011
|
+
* @default false
|
|
1012
|
+
*/
|
|
1013
|
+
keepMounted?: boolean | undefined;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
export declare interface MenuRadioItemIndicatorState {
|
|
1017
|
+
/**
|
|
1018
|
+
* Whether the radio item is currently selected.
|
|
1019
|
+
*/
|
|
1020
|
+
checked: boolean;
|
|
1021
|
+
/**
|
|
1022
|
+
* Whether the component should ignore user interaction.
|
|
1023
|
+
*/
|
|
1024
|
+
disabled: boolean;
|
|
1025
|
+
/**
|
|
1026
|
+
* Whether the item is highlighted.
|
|
1027
|
+
*/
|
|
1028
|
+
highlighted: boolean;
|
|
1029
|
+
/**
|
|
1030
|
+
* The transition status of the component.
|
|
1031
|
+
*/
|
|
1032
|
+
transitionStatus: TransitionStatus;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
export declare interface MenuRadioItemProps extends NonNativeButtonProps, BaseUIComponentProps<'div', MenuRadioItemState> {
|
|
1036
|
+
/**
|
|
1037
|
+
* Value of the radio item.
|
|
1038
|
+
* This is the value that will be set in the MenuRadioGroup when the item is selected.
|
|
1039
|
+
*/
|
|
1040
|
+
value: any;
|
|
1041
|
+
/**
|
|
1042
|
+
* The click handler for the menu item.
|
|
1043
|
+
*/
|
|
1044
|
+
onClick?: BaseUIComponentProps<'div', MenuRadioItemState>['onClick'] | undefined;
|
|
1045
|
+
/**
|
|
1046
|
+
* Whether the component should ignore user interaction.
|
|
1047
|
+
* @default false
|
|
1048
|
+
*/
|
|
1049
|
+
disabled?: boolean | undefined;
|
|
1050
|
+
/**
|
|
1051
|
+
* Overrides the text label to use when the item is matched during keyboard text navigation.
|
|
1052
|
+
*/
|
|
1053
|
+
label?: string | undefined;
|
|
1054
|
+
/**
|
|
1055
|
+
* @ignore
|
|
1056
|
+
*/
|
|
1057
|
+
id?: string | undefined;
|
|
1058
|
+
/**
|
|
1059
|
+
* Whether to close the menu when the item is clicked.
|
|
1060
|
+
* @default false
|
|
1061
|
+
*/
|
|
1062
|
+
closeOnClick?: boolean | undefined;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
export declare interface MenuRadioItemState {
|
|
1066
|
+
/**
|
|
1067
|
+
* Whether the radio item should ignore user interaction.
|
|
1068
|
+
*/
|
|
1069
|
+
disabled: boolean;
|
|
1070
|
+
/**
|
|
1071
|
+
* Whether the radio item is currently highlighted.
|
|
1072
|
+
*/
|
|
1073
|
+
highlighted: boolean;
|
|
1074
|
+
/**
|
|
1075
|
+
* Whether the radio item is currently selected.
|
|
1076
|
+
*/
|
|
1077
|
+
checked: boolean;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* Groups all parts of the menu.
|
|
1082
|
+
* Doesn't render its own HTML element.
|
|
1083
|
+
*
|
|
1084
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1085
|
+
*/
|
|
1086
|
+
export declare const MenuRoot: <Payload>(props: MenuRoot.Props<Payload>) => JSX_2.Element;
|
|
1087
|
+
|
|
1088
|
+
export declare namespace MenuRoot {
|
|
1089
|
+
export type State = MenuRootState;
|
|
1090
|
+
export type Props<Payload = unknown> = MenuRootProps<Payload>;
|
|
1091
|
+
export type Actions = MenuRootActions;
|
|
1092
|
+
export type ChangeEventReason = MenuRootChangeEventReason;
|
|
1093
|
+
export type ChangeEventDetails = MenuRootChangeEventDetails;
|
|
1094
|
+
export type Orientation = MenuRootOrientation;
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
export declare interface MenuRootActions {
|
|
1098
|
+
unmount: () => void;
|
|
1099
|
+
close: () => void;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
export declare type MenuRootChangeEventDetails = BaseUIChangeEventDetails<MenuRoot.ChangeEventReason> & {
|
|
1103
|
+
preventUnmountOnClose(): void;
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
export declare type MenuRootChangeEventReason = typeof REASONS.triggerHover | typeof REASONS.triggerFocus | typeof REASONS.triggerPress | typeof REASONS.outsidePress | typeof REASONS.focusOut | typeof REASONS.listNavigation | typeof REASONS.escapeKey | typeof REASONS.itemPress | typeof REASONS.closePress | typeof REASONS.siblingOpen | typeof REASONS.cancelOpen | typeof REASONS.imperativeAction | typeof REASONS.none;
|
|
1107
|
+
|
|
1108
|
+
declare interface MenuRootContext<Payload = unknown> {
|
|
1109
|
+
store: MenuStore<Payload>;
|
|
1110
|
+
parent: MenuParent;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
declare const MenuRootContext: React_2.Context<MenuRootContext<unknown> | undefined>;
|
|
1114
|
+
|
|
1115
|
+
export declare type MenuRootOrientation = 'horizontal' | 'vertical';
|
|
1116
|
+
|
|
1117
|
+
export declare interface MenuRootProps<Payload = unknown> {
|
|
1118
|
+
/**
|
|
1119
|
+
* Whether the menu is initially open.
|
|
1120
|
+
*
|
|
1121
|
+
* To render a controlled menu, use the `open` prop instead.
|
|
1122
|
+
* @default false
|
|
1123
|
+
*/
|
|
1124
|
+
defaultOpen?: boolean | undefined;
|
|
1125
|
+
/**
|
|
1126
|
+
* Whether to loop keyboard focus back to the first item
|
|
1127
|
+
* when the end of the list is reached while using the arrow keys.
|
|
1128
|
+
* @default true
|
|
1129
|
+
*/
|
|
1130
|
+
loopFocus?: boolean | undefined;
|
|
1131
|
+
/**
|
|
1132
|
+
* Whether moving the pointer over items should highlight them.
|
|
1133
|
+
* Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state.
|
|
1134
|
+
* @default true
|
|
1135
|
+
*/
|
|
1136
|
+
highlightItemOnHover?: boolean | undefined;
|
|
1137
|
+
/**
|
|
1138
|
+
* Determines if the menu enters a modal state when open.
|
|
1139
|
+
* - `true`: user interaction is limited to the menu: document page scroll is locked and pointer interactions on outside elements are disabled.
|
|
1140
|
+
* - `false`: user interaction with the rest of the document is allowed.
|
|
1141
|
+
* @default true
|
|
1142
|
+
*/
|
|
1143
|
+
modal?: boolean | undefined;
|
|
1144
|
+
/**
|
|
1145
|
+
* Event handler called when the menu is opened or closed.
|
|
1146
|
+
*/
|
|
1147
|
+
onOpenChange?: ((open: boolean, eventDetails: MenuRoot.ChangeEventDetails) => void) | undefined;
|
|
1148
|
+
/**
|
|
1149
|
+
* Event handler called after any animations complete when the menu is closed.
|
|
1150
|
+
*/
|
|
1151
|
+
onOpenChangeComplete?: ((open: boolean) => void) | undefined;
|
|
1152
|
+
/**
|
|
1153
|
+
* Whether the menu is currently open.
|
|
1154
|
+
*/
|
|
1155
|
+
open?: boolean | undefined;
|
|
1156
|
+
/**
|
|
1157
|
+
* The visual orientation of the menu.
|
|
1158
|
+
* Controls whether roving focus uses up/down or left/right arrow keys.
|
|
1159
|
+
* @default 'vertical'
|
|
1160
|
+
*/
|
|
1161
|
+
orientation?: MenuRoot.Orientation | undefined;
|
|
1162
|
+
/**
|
|
1163
|
+
* Whether the component should ignore user interaction.
|
|
1164
|
+
* @default false
|
|
1165
|
+
*/
|
|
1166
|
+
disabled?: boolean | undefined;
|
|
1167
|
+
/**
|
|
1168
|
+
* When in a submenu, determines whether pressing the Escape key
|
|
1169
|
+
* closes the entire menu, or only the current child menu.
|
|
1170
|
+
* @default false
|
|
1171
|
+
*/
|
|
1172
|
+
closeParentOnEsc?: boolean | undefined;
|
|
1173
|
+
/**
|
|
1174
|
+
* A ref to imperative actions.
|
|
1175
|
+
* - `unmount`: When specified, the menu will not be unmounted when closed.
|
|
1176
|
+
* Instead, the `unmount` function must be called to unmount the menu manually.
|
|
1177
|
+
* Useful when the menu's animation is controlled by an external library.
|
|
1178
|
+
* - `close`: When specified, the menu can be closed imperatively.
|
|
1179
|
+
*/
|
|
1180
|
+
actionsRef?: React_2.RefObject<MenuRoot.Actions | null> | undefined;
|
|
1181
|
+
/**
|
|
1182
|
+
* ID of the trigger that the popover is associated with.
|
|
1183
|
+
* This is useful in conjunction with the `open` prop to create a controlled popover.
|
|
1184
|
+
* There's no need to specify this prop when the popover is uncontrolled (that is, when the `open` prop is not set).
|
|
1185
|
+
*/
|
|
1186
|
+
triggerId?: string | null | undefined;
|
|
1187
|
+
/**
|
|
1188
|
+
* ID of the trigger that the popover is associated with.
|
|
1189
|
+
* This is useful in conjunction with the `defaultOpen` prop to create an initially open popover.
|
|
1190
|
+
*/
|
|
1191
|
+
defaultTriggerId?: string | null | undefined;
|
|
1192
|
+
/**
|
|
1193
|
+
* A handle to associate the menu with a trigger.
|
|
1194
|
+
* If specified, allows external triggers to control the menu's open state.
|
|
1195
|
+
*/
|
|
1196
|
+
handle?: MenuHandle<Payload> | undefined;
|
|
1197
|
+
/**
|
|
1198
|
+
* The content of the popover.
|
|
1199
|
+
* This can be a regular React node or a render function that receives the `payload` of the active trigger.
|
|
1200
|
+
*/
|
|
1201
|
+
children?: React_2.ReactNode | PayloadChildRenderFunction<Payload>;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
export declare interface MenuRootState {}
|
|
1205
|
+
|
|
1206
|
+
declare class MenuStore<Payload> extends ReactStore<Readonly<State<Payload>>, Context, typeof selectors_2> {
|
|
1207
|
+
constructor(initialState?: Partial<State<Payload>>);
|
|
1208
|
+
setOpen(open: boolean, eventDetails: Omit<MenuRoot.ChangeEventDetails, 'preventUnmountOnClose'>): void;
|
|
1209
|
+
static useStore<Payload>(externalStore: MenuStore<Payload> | undefined, initialState: Partial<State<Payload>>): MenuStore<Payload>;
|
|
1210
|
+
private unsubscribeParentListener;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Groups all parts of a submenu.
|
|
1215
|
+
* Doesn't render its own HTML element.
|
|
1216
|
+
*
|
|
1217
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1218
|
+
*/
|
|
1219
|
+
export declare function MenuSubmenuRoot(props: MenuSubmenuRoot.Props): JSX_2.Element;
|
|
1220
|
+
|
|
1221
|
+
export declare namespace MenuSubmenuRoot {
|
|
1222
|
+
export type Props = MenuSubmenuRootProps;
|
|
1223
|
+
export type State = MenuSubmenuRootState;
|
|
1224
|
+
export type ChangeEventReason = MenuSubmenuRootChangeEventReason;
|
|
1225
|
+
export type ChangeEventDetails = MenuSubmenuRootChangeEventDetails;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
export declare type MenuSubmenuRootChangeEventDetails = MenuRoot.ChangeEventDetails;
|
|
1229
|
+
|
|
1230
|
+
export declare type MenuSubmenuRootChangeEventReason = MenuRoot.ChangeEventReason;
|
|
1231
|
+
|
|
1232
|
+
declare const MenuSubmenuRootContext: React_2.Context<MenuSubmenuRootContext | undefined>;
|
|
1233
|
+
|
|
1234
|
+
declare interface MenuSubmenuRootContext {
|
|
1235
|
+
parentMenu: MenuStore<unknown>;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
export declare interface MenuSubmenuRootProps extends Omit<MenuRoot.Props, 'modal' | 'openOnHover' | 'onOpenChange'> {
|
|
1239
|
+
/**
|
|
1240
|
+
* Event handler called when the menu is opened or closed.
|
|
1241
|
+
*/
|
|
1242
|
+
onOpenChange?: ((open: boolean, eventDetails: MenuSubmenuRoot.ChangeEventDetails) => void) | undefined;
|
|
1243
|
+
/**
|
|
1244
|
+
* When in a submenu, determines whether pressing the Escape key
|
|
1245
|
+
* closes the entire menu, or only the current child menu.
|
|
1246
|
+
* @default false
|
|
1247
|
+
*/
|
|
1248
|
+
closeParentOnEsc?: boolean | undefined;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
export declare interface MenuSubmenuRootState {}
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* A menu item that opens a submenu.
|
|
1255
|
+
* Renders a `<div>` element.
|
|
1256
|
+
*
|
|
1257
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1258
|
+
*/
|
|
1259
|
+
export declare const MenuSubmenuTrigger: React_2.ForwardRefExoticComponent<Omit<MenuSubmenuTriggerProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
|
|
1260
|
+
|
|
1261
|
+
export declare namespace MenuSubmenuTrigger {
|
|
1262
|
+
export type Props = MenuSubmenuTriggerProps;
|
|
1263
|
+
export type State = MenuSubmenuTriggerState;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
export declare interface MenuSubmenuTriggerProps extends NonNativeButtonProps, BaseUIComponentProps<'div', MenuSubmenuTriggerState> {
|
|
1267
|
+
onClick?: BaseUIComponentProps<'div', MenuSubmenuTriggerState>['onClick'] | undefined;
|
|
1268
|
+
/**
|
|
1269
|
+
* Overrides the text label to use when the item is matched during keyboard text navigation.
|
|
1270
|
+
*/
|
|
1271
|
+
label?: string | undefined;
|
|
1272
|
+
/**
|
|
1273
|
+
* @ignore
|
|
1274
|
+
*/
|
|
1275
|
+
id?: string | undefined;
|
|
1276
|
+
/**
|
|
1277
|
+
* Whether the component should ignore user interaction.
|
|
1278
|
+
* @default false
|
|
1279
|
+
*/
|
|
1280
|
+
disabled?: boolean | undefined;
|
|
1281
|
+
/**
|
|
1282
|
+
* How long to wait before the menu may be opened on hover. Specified in milliseconds.
|
|
1283
|
+
*
|
|
1284
|
+
* Requires the `openOnHover` prop.
|
|
1285
|
+
* @default 100
|
|
1286
|
+
*/
|
|
1287
|
+
delay?: number | undefined;
|
|
1288
|
+
/**
|
|
1289
|
+
* How long to wait before closing the menu that was opened on hover.
|
|
1290
|
+
* Specified in milliseconds.
|
|
1291
|
+
*
|
|
1292
|
+
* Requires the `openOnHover` prop.
|
|
1293
|
+
* @default 0
|
|
1294
|
+
*/
|
|
1295
|
+
closeDelay?: number | undefined;
|
|
1296
|
+
/**
|
|
1297
|
+
* Whether the menu should also open when the trigger is hovered.
|
|
1298
|
+
*/
|
|
1299
|
+
openOnHover?: boolean | undefined;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
export declare interface MenuSubmenuTriggerState {
|
|
1303
|
+
/**
|
|
1304
|
+
* Whether the component should ignore user interaction.
|
|
1305
|
+
*/
|
|
1306
|
+
disabled: boolean;
|
|
1307
|
+
/**
|
|
1308
|
+
* Whether the item is highlighted.
|
|
1309
|
+
*/
|
|
1310
|
+
highlighted: boolean;
|
|
1311
|
+
/**
|
|
1312
|
+
* Whether the menu is currently open.
|
|
1313
|
+
*/
|
|
1314
|
+
open: boolean;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* A button that opens the menu.
|
|
1319
|
+
* Renders a `<button>` element.
|
|
1320
|
+
*
|
|
1321
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1322
|
+
*/
|
|
1323
|
+
export declare const MenuTrigger: MenuTrigger;
|
|
1324
|
+
|
|
1325
|
+
export declare interface MenuTrigger {
|
|
1326
|
+
<Payload>(componentProps: MenuTriggerProps<Payload> & React_2.RefAttributes<HTMLElement>): React_2.JSX.Element;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
export declare namespace MenuTrigger {
|
|
1330
|
+
export type Props<Payload = unknown> = MenuTriggerProps<Payload>;
|
|
1331
|
+
export type State = MenuTriggerState;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
export declare interface MenuTriggerProps<Payload = unknown> extends NativeButtonProps, BaseUIComponentProps<'button', MenuTriggerState> {
|
|
1335
|
+
children?: React_2.ReactNode;
|
|
1336
|
+
/**
|
|
1337
|
+
* Whether the component should ignore user interaction.
|
|
1338
|
+
* @default false
|
|
1339
|
+
*/
|
|
1340
|
+
disabled?: boolean | undefined;
|
|
1341
|
+
/**
|
|
1342
|
+
* A handle to associate the trigger with a menu.
|
|
1343
|
+
*/
|
|
1344
|
+
handle?: MenuHandle<Payload> | undefined;
|
|
1345
|
+
/**
|
|
1346
|
+
* A payload to pass to the menu when it is opened.
|
|
1347
|
+
*/
|
|
1348
|
+
payload?: Payload | undefined;
|
|
1349
|
+
/**
|
|
1350
|
+
* How long to wait before the menu may be opened on hover. Specified in milliseconds.
|
|
1351
|
+
*
|
|
1352
|
+
* Requires the `openOnHover` prop.
|
|
1353
|
+
* @default 100
|
|
1354
|
+
*/
|
|
1355
|
+
delay?: number | undefined;
|
|
1356
|
+
/**
|
|
1357
|
+
* How long to wait before closing the menu that was opened on hover.
|
|
1358
|
+
* Specified in milliseconds.
|
|
1359
|
+
*
|
|
1360
|
+
* Requires the `openOnHover` prop.
|
|
1361
|
+
* @default 0
|
|
1362
|
+
*/
|
|
1363
|
+
closeDelay?: number | undefined;
|
|
1364
|
+
/**
|
|
1365
|
+
* Whether the menu should also open when the trigger is hovered.
|
|
1366
|
+
*/
|
|
1367
|
+
openOnHover?: boolean | undefined;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
export declare interface MenuTriggerState {
|
|
1371
|
+
/**
|
|
1372
|
+
* Whether the menu is currently open.
|
|
1373
|
+
*/
|
|
1374
|
+
open: boolean;
|
|
1375
|
+
/**
|
|
1376
|
+
* Whether the trigger is disabled.
|
|
1377
|
+
*/
|
|
1378
|
+
disabled: boolean;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* A viewport for displaying content transitions.
|
|
1383
|
+
* This component is only required if one popup can be opened by multiple triggers, its content
|
|
1384
|
+
* changes based on the trigger, and switching between them is animated.
|
|
1385
|
+
* Renders a `<div>` element.
|
|
1386
|
+
*
|
|
1387
|
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
1388
|
+
*/
|
|
1389
|
+
export declare const MenuViewport: React_2.ForwardRefExoticComponent<Omit<MenuViewport.Props, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
1390
|
+
|
|
1391
|
+
export declare namespace MenuViewport {
|
|
1392
|
+
export interface Props extends BaseUIComponentProps<'div', State> {
|
|
1393
|
+
/**
|
|
1394
|
+
* The content to render inside the transition container.
|
|
1395
|
+
*/
|
|
1396
|
+
children?: React_2.ReactNode;
|
|
1397
|
+
}
|
|
1398
|
+
export interface State {
|
|
1399
|
+
activationDirection: string | undefined;
|
|
1400
|
+
/**
|
|
1401
|
+
* Whether the viewport is currently transitioning between contents.
|
|
1402
|
+
*/
|
|
1403
|
+
transitioning: boolean;
|
|
1404
|
+
/**
|
|
1405
|
+
* Present if animations should be instant.
|
|
1406
|
+
*/
|
|
1407
|
+
instant: 'dismiss' | 'click' | 'group' | 'trigger-change' | undefined;
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
declare const missing: "missing";
|
|
1412
|
+
|
|
1413
|
+
declare type NarrowedElement<T> = T extends Element ? T : Element;
|
|
1414
|
+
|
|
1415
|
+
declare interface NativeButtonProps {
|
|
1416
|
+
/**
|
|
1417
|
+
* Whether the component renders a native `<button>` element when replacing it
|
|
1418
|
+
* via the `render` prop.
|
|
1419
|
+
* Set to `false` if the rendered element is not a button (for example, `<div>`).
|
|
1420
|
+
* @default true
|
|
1421
|
+
*/
|
|
1422
|
+
nativeButton?: boolean | undefined;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
declare const none: "none";
|
|
1426
|
+
|
|
1427
|
+
declare interface NonNativeButtonProps {
|
|
1428
|
+
/**
|
|
1429
|
+
* Whether the component renders a native `<button>` element when replacing it
|
|
1430
|
+
* via the `render` prop.
|
|
1431
|
+
* Set to `true` if the rendered element is a native button.
|
|
1432
|
+
* @default false
|
|
1433
|
+
*/
|
|
1434
|
+
nativeButton?: boolean | undefined;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
declare type OffsetFunction = (data: {
|
|
1438
|
+
side: Side;
|
|
1439
|
+
align: Align;
|
|
1440
|
+
anchor: {
|
|
1441
|
+
width: number;
|
|
1442
|
+
height: number;
|
|
1443
|
+
};
|
|
1444
|
+
positioner: {
|
|
1445
|
+
width: number;
|
|
1446
|
+
height: number;
|
|
1447
|
+
};
|
|
1448
|
+
}) => number;
|
|
1449
|
+
|
|
1450
|
+
declare type Orientation = 'horizontal' | 'vertical';
|
|
1451
|
+
|
|
1452
|
+
declare const outsidePress: "outside-press";
|
|
1453
|
+
|
|
1454
|
+
declare type PayloadChildRenderFunction<Payload> = (arg: {
|
|
1455
|
+
payload: Payload | undefined;
|
|
1456
|
+
}) => React_2.ReactNode;
|
|
1457
|
+
|
|
1458
|
+
declare const pointer: "pointer";
|
|
1459
|
+
|
|
1460
|
+
declare type PopupStoreContext<ChangeEventDetails> = {
|
|
1461
|
+
/**
|
|
1462
|
+
* Map of registered trigger elements.
|
|
1463
|
+
*/
|
|
1464
|
+
readonly triggerElements: PopupTriggerMap;
|
|
1465
|
+
/**
|
|
1466
|
+
* Reference to the popup element.
|
|
1467
|
+
*/
|
|
1468
|
+
readonly popupRef: React.RefObject<HTMLElement | null>;
|
|
1469
|
+
/**
|
|
1470
|
+
* Callback fired when the open state changes.
|
|
1471
|
+
*/
|
|
1472
|
+
onOpenChange?: ((open: boolean, eventDetails: ChangeEventDetails) => void) | undefined;
|
|
1473
|
+
/**
|
|
1474
|
+
* Callback fired when the open state change animation completes.
|
|
1475
|
+
*/
|
|
1476
|
+
onOpenChangeComplete: ((open: boolean) => void) | undefined;
|
|
1477
|
+
};
|
|
1478
|
+
|
|
1479
|
+
/**
|
|
1480
|
+
* State common to all popup stores.
|
|
1481
|
+
*/
|
|
1482
|
+
declare type PopupStoreState<Payload> = {
|
|
1483
|
+
/**
|
|
1484
|
+
* Whether the popup is open (internal state).
|
|
1485
|
+
*/
|
|
1486
|
+
open: boolean;
|
|
1487
|
+
/**
|
|
1488
|
+
* Whether the popup is open (external prop).
|
|
1489
|
+
*/
|
|
1490
|
+
readonly openProp: boolean | undefined;
|
|
1491
|
+
/**
|
|
1492
|
+
* Whether the popup should be mounted in the DOM.
|
|
1493
|
+
* This usually follows `open` but can be different during exit transitions.
|
|
1494
|
+
*/
|
|
1495
|
+
mounted: boolean;
|
|
1496
|
+
/**
|
|
1497
|
+
* The current enter/exit transition status of the popup.
|
|
1498
|
+
*/
|
|
1499
|
+
transitionStatus: TransitionStatus;
|
|
1500
|
+
floatingRootContext: FloatingRootContext;
|
|
1501
|
+
floatingId: string | undefined;
|
|
1502
|
+
/**
|
|
1503
|
+
* Number of trigger elements currently registered for this popup.
|
|
1504
|
+
*/
|
|
1505
|
+
triggerCount: number;
|
|
1506
|
+
/**
|
|
1507
|
+
* Whether to prevent unmounting the popup when closed.
|
|
1508
|
+
* Useful for interacting with JS animation libraries that control unmounting themselves.
|
|
1509
|
+
*/
|
|
1510
|
+
preventUnmountingOnClose: boolean;
|
|
1511
|
+
/**
|
|
1512
|
+
* Optional payload set by the trigger.
|
|
1513
|
+
*/
|
|
1514
|
+
payload: Payload | undefined;
|
|
1515
|
+
/**
|
|
1516
|
+
* ID of the currently active trigger.
|
|
1517
|
+
*/
|
|
1518
|
+
activeTriggerId: string | null;
|
|
1519
|
+
/**
|
|
1520
|
+
* The currently active trigger DOM element.
|
|
1521
|
+
*/
|
|
1522
|
+
activeTriggerElement: Element | null;
|
|
1523
|
+
/**
|
|
1524
|
+
* ID of the trigger (external prop).
|
|
1525
|
+
*/
|
|
1526
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1527
|
+
/**
|
|
1528
|
+
* The popup DOM element.
|
|
1529
|
+
*/
|
|
1530
|
+
popupElement: HTMLElement | null;
|
|
1531
|
+
/**
|
|
1532
|
+
* The positioner DOM element.
|
|
1533
|
+
*/
|
|
1534
|
+
positionerElement: HTMLElement | null;
|
|
1535
|
+
/**
|
|
1536
|
+
* Props to spread onto the active trigger element.
|
|
1537
|
+
*/
|
|
1538
|
+
activeTriggerProps: HTMLProps;
|
|
1539
|
+
/**
|
|
1540
|
+
* Props to spread onto inactive trigger elements.
|
|
1541
|
+
*/
|
|
1542
|
+
inactiveTriggerProps: HTMLProps;
|
|
1543
|
+
/**
|
|
1544
|
+
* Props to spread onto the popup element.
|
|
1545
|
+
*/
|
|
1546
|
+
popupProps: HTMLProps;
|
|
1547
|
+
};
|
|
1548
|
+
|
|
1549
|
+
/**
|
|
1550
|
+
* Data structure to keep track of popup trigger elements by their IDs.
|
|
1551
|
+
* Uses both a set of Elements and a map of IDs to Elements for efficient lookups.
|
|
1552
|
+
*/
|
|
1553
|
+
declare class PopupTriggerMap {
|
|
1554
|
+
private elementsSet;
|
|
1555
|
+
private idMap;
|
|
1556
|
+
constructor();
|
|
1557
|
+
/**
|
|
1558
|
+
* Adds a trigger element with the given ID.
|
|
1559
|
+
*
|
|
1560
|
+
* Note: The provided element is assumed to not be registered under multiple IDs.
|
|
1561
|
+
*/
|
|
1562
|
+
add(id: string, element: Element): void;
|
|
1563
|
+
/**
|
|
1564
|
+
* Removes the trigger element with the given ID.
|
|
1565
|
+
*/
|
|
1566
|
+
delete(id: string): void;
|
|
1567
|
+
/**
|
|
1568
|
+
* Whether the given element is registered as a trigger.
|
|
1569
|
+
*/
|
|
1570
|
+
hasElement(element: Element): boolean;
|
|
1571
|
+
/**
|
|
1572
|
+
* Whether there is a registered trigger element matching the given predicate.
|
|
1573
|
+
*/
|
|
1574
|
+
hasMatchingElement(predicate: (el: Element) => boolean): boolean;
|
|
1575
|
+
/**
|
|
1576
|
+
* Returns the trigger element associated with the given ID, or undefined if no such element exists.
|
|
1577
|
+
*/
|
|
1578
|
+
getById(id: string): Element | undefined;
|
|
1579
|
+
/**
|
|
1580
|
+
* Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
|
|
1581
|
+
*/
|
|
1582
|
+
entries(): IterableIterator<[string, Element]>;
|
|
1583
|
+
/**
|
|
1584
|
+
* Returns an iterable of all registered trigger elements.
|
|
1585
|
+
*/
|
|
1586
|
+
elements(): IterableIterator<Element>;
|
|
1587
|
+
/**
|
|
1588
|
+
* Returns the number of registered trigger elements.
|
|
1589
|
+
*/
|
|
1590
|
+
get size(): number;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
declare namespace REASONS {
|
|
1594
|
+
export {
|
|
1595
|
+
none,
|
|
1596
|
+
triggerPress,
|
|
1597
|
+
triggerHover,
|
|
1598
|
+
triggerFocus,
|
|
1599
|
+
outsidePress,
|
|
1600
|
+
itemPress,
|
|
1601
|
+
closePress,
|
|
1602
|
+
linkPress,
|
|
1603
|
+
clearPress,
|
|
1604
|
+
chipRemovePress,
|
|
1605
|
+
trackPress,
|
|
1606
|
+
incrementPress,
|
|
1607
|
+
decrementPress,
|
|
1608
|
+
inputChange,
|
|
1609
|
+
inputClear,
|
|
1610
|
+
inputBlur,
|
|
1611
|
+
inputPaste,
|
|
1612
|
+
inputPress,
|
|
1613
|
+
focusOut,
|
|
1614
|
+
escapeKey,
|
|
1615
|
+
closeWatcher,
|
|
1616
|
+
listNavigation,
|
|
1617
|
+
keyboard,
|
|
1618
|
+
pointer,
|
|
1619
|
+
drag,
|
|
1620
|
+
wheel,
|
|
1621
|
+
scrub,
|
|
1622
|
+
cancelOpen,
|
|
1623
|
+
siblingOpen,
|
|
1624
|
+
disabled,
|
|
1625
|
+
missing,
|
|
1626
|
+
initial,
|
|
1627
|
+
imperativeAction,
|
|
1628
|
+
swipe,
|
|
1629
|
+
windowResize
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* Maps a change `reason` string to the corresponding native event type.
|
|
1635
|
+
*/
|
|
1636
|
+
declare type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
|
|
1637
|
+
|
|
1638
|
+
declare interface ReasonToEventMap {
|
|
1639
|
+
[REASONS.none]: Event;
|
|
1640
|
+
[REASONS.triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
1641
|
+
[REASONS.triggerHover]: MouseEvent;
|
|
1642
|
+
[REASONS.triggerFocus]: FocusEvent;
|
|
1643
|
+
[REASONS.outsidePress]: MouseEvent | PointerEvent | TouchEvent;
|
|
1644
|
+
[REASONS.itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
1645
|
+
[REASONS.closePress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
1646
|
+
[REASONS.linkPress]: MouseEvent | PointerEvent;
|
|
1647
|
+
[REASONS.clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
1648
|
+
[REASONS.chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
1649
|
+
[REASONS.trackPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
1650
|
+
[REASONS.incrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
1651
|
+
[REASONS.decrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
1652
|
+
[REASONS.inputChange]: InputEvent | Event;
|
|
1653
|
+
[REASONS.inputClear]: InputEvent | FocusEvent | Event;
|
|
1654
|
+
[REASONS.inputBlur]: FocusEvent;
|
|
1655
|
+
[REASONS.inputPaste]: ClipboardEvent;
|
|
1656
|
+
[REASONS.inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
1657
|
+
[REASONS.focusOut]: FocusEvent | KeyboardEvent;
|
|
1658
|
+
[REASONS.escapeKey]: KeyboardEvent;
|
|
1659
|
+
[REASONS.closeWatcher]: Event;
|
|
1660
|
+
[REASONS.listNavigation]: KeyboardEvent;
|
|
1661
|
+
[REASONS.keyboard]: KeyboardEvent;
|
|
1662
|
+
[REASONS.pointer]: PointerEvent;
|
|
1663
|
+
[REASONS.drag]: PointerEvent | TouchEvent;
|
|
1664
|
+
[REASONS.swipe]: PointerEvent | TouchEvent;
|
|
1665
|
+
[REASONS.wheel]: WheelEvent;
|
|
1666
|
+
[REASONS.scrub]: PointerEvent;
|
|
1667
|
+
[REASONS.cancelOpen]: MouseEvent;
|
|
1668
|
+
[REASONS.siblingOpen]: Event;
|
|
1669
|
+
[REASONS.disabled]: Event;
|
|
1670
|
+
[REASONS.missing]: Event;
|
|
1671
|
+
[REASONS.initial]: Event;
|
|
1672
|
+
[REASONS.imperativeAction]: Event;
|
|
1673
|
+
[REASONS.windowResize]: UIEvent;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
declare type ReferenceType = Element | VirtualElement;
|
|
1677
|
+
|
|
1678
|
+
declare const scrub: "scrub";
|
|
1679
|
+
|
|
1680
|
+
declare const selectors: {
|
|
1681
|
+
open: (state: FloatingRootState) => boolean;
|
|
1682
|
+
transitionStatus: (state: FloatingRootState) => TransitionStatus;
|
|
1683
|
+
domReferenceElement: (state: FloatingRootState) => Element | null;
|
|
1684
|
+
referenceElement: (state: FloatingRootState) => ReferenceType | null;
|
|
1685
|
+
floatingElement: (state: FloatingRootState) => HTMLElement | null;
|
|
1686
|
+
floatingId: (state: FloatingRootState) => string | undefined;
|
|
1687
|
+
};
|
|
1688
|
+
|
|
1689
|
+
declare const selectors_2: {
|
|
1690
|
+
disabled: (state: State<unknown>) => boolean;
|
|
1691
|
+
modal: (state: State<unknown>) => boolean;
|
|
1692
|
+
openMethod: (state: State<unknown>) => InteractionType | null;
|
|
1693
|
+
allowMouseEnter: (state: State<unknown>) => boolean;
|
|
1694
|
+
stickIfOpen: (state: State<unknown>) => boolean;
|
|
1695
|
+
parent: (state: State<unknown>) => MenuParent;
|
|
1696
|
+
rootId: (state: State<unknown>) => string | undefined;
|
|
1697
|
+
activeIndex: (state: State<unknown>) => number | null;
|
|
1698
|
+
isActive: (state: State<unknown>, itemIndex: number) => boolean;
|
|
1699
|
+
hoverEnabled: (state: State<unknown>) => boolean;
|
|
1700
|
+
instantType: (state: State<unknown>) => "group" | "click" | "dismiss" | "trigger-change" | undefined;
|
|
1701
|
+
lastOpenChangeReason: (state: State<unknown>) => MenuRootChangeEventReason_2 | null;
|
|
1702
|
+
floatingTreeRoot: (state: State<unknown>) => FloatingTreeStore;
|
|
1703
|
+
floatingNodeId: (state: State<unknown>) => string | undefined;
|
|
1704
|
+
floatingParentNodeId: (state: State<unknown>) => string | null;
|
|
1705
|
+
itemProps: (state: State<unknown>) => HTMLProps;
|
|
1706
|
+
closeDelay: (state: State<unknown>) => number;
|
|
1707
|
+
hasViewport: (state: State<unknown>) => boolean;
|
|
1708
|
+
keyboardEventRelay: (state: State<unknown>) => React_2.KeyboardEventHandler<any> | undefined;
|
|
1709
|
+
open: (state: {
|
|
1710
|
+
open: boolean;
|
|
1711
|
+
readonly openProp: boolean | undefined;
|
|
1712
|
+
mounted: boolean;
|
|
1713
|
+
transitionStatus: TransitionStatus_2;
|
|
1714
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1715
|
+
floatingId: string | undefined;
|
|
1716
|
+
triggerCount: number;
|
|
1717
|
+
preventUnmountingOnClose: boolean;
|
|
1718
|
+
payload: unknown;
|
|
1719
|
+
activeTriggerId: string | null;
|
|
1720
|
+
activeTriggerElement: Element | null;
|
|
1721
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1722
|
+
popupElement: HTMLElement | null;
|
|
1723
|
+
positionerElement: HTMLElement | null;
|
|
1724
|
+
activeTriggerProps: HTMLProps;
|
|
1725
|
+
inactiveTriggerProps: HTMLProps;
|
|
1726
|
+
popupProps: HTMLProps;
|
|
1727
|
+
}) => boolean;
|
|
1728
|
+
mounted: (state: {
|
|
1729
|
+
open: boolean;
|
|
1730
|
+
readonly openProp: boolean | undefined;
|
|
1731
|
+
mounted: boolean;
|
|
1732
|
+
transitionStatus: TransitionStatus_2;
|
|
1733
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1734
|
+
floatingId: string | undefined;
|
|
1735
|
+
triggerCount: number;
|
|
1736
|
+
preventUnmountingOnClose: boolean;
|
|
1737
|
+
payload: unknown;
|
|
1738
|
+
activeTriggerId: string | null;
|
|
1739
|
+
activeTriggerElement: Element | null;
|
|
1740
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1741
|
+
popupElement: HTMLElement | null;
|
|
1742
|
+
positionerElement: HTMLElement | null;
|
|
1743
|
+
activeTriggerProps: HTMLProps;
|
|
1744
|
+
inactiveTriggerProps: HTMLProps;
|
|
1745
|
+
popupProps: HTMLProps;
|
|
1746
|
+
}) => boolean;
|
|
1747
|
+
transitionStatus: (state: {
|
|
1748
|
+
open: boolean;
|
|
1749
|
+
readonly openProp: boolean | undefined;
|
|
1750
|
+
mounted: boolean;
|
|
1751
|
+
transitionStatus: TransitionStatus_2;
|
|
1752
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1753
|
+
floatingId: string | undefined;
|
|
1754
|
+
triggerCount: number;
|
|
1755
|
+
preventUnmountingOnClose: boolean;
|
|
1756
|
+
payload: unknown;
|
|
1757
|
+
activeTriggerId: string | null;
|
|
1758
|
+
activeTriggerElement: Element | null;
|
|
1759
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1760
|
+
popupElement: HTMLElement | null;
|
|
1761
|
+
positionerElement: HTMLElement | null;
|
|
1762
|
+
activeTriggerProps: HTMLProps;
|
|
1763
|
+
inactiveTriggerProps: HTMLProps;
|
|
1764
|
+
popupProps: HTMLProps;
|
|
1765
|
+
}) => TransitionStatus_2;
|
|
1766
|
+
floatingRootContext: (state: {
|
|
1767
|
+
open: boolean;
|
|
1768
|
+
readonly openProp: boolean | undefined;
|
|
1769
|
+
mounted: boolean;
|
|
1770
|
+
transitionStatus: TransitionStatus_2;
|
|
1771
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1772
|
+
floatingId: string | undefined;
|
|
1773
|
+
triggerCount: number;
|
|
1774
|
+
preventUnmountingOnClose: boolean;
|
|
1775
|
+
payload: unknown;
|
|
1776
|
+
activeTriggerId: string | null;
|
|
1777
|
+
activeTriggerElement: Element | null;
|
|
1778
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1779
|
+
popupElement: HTMLElement | null;
|
|
1780
|
+
positionerElement: HTMLElement | null;
|
|
1781
|
+
activeTriggerProps: HTMLProps;
|
|
1782
|
+
inactiveTriggerProps: HTMLProps;
|
|
1783
|
+
popupProps: HTMLProps;
|
|
1784
|
+
}) => FloatingRootStore_2;
|
|
1785
|
+
triggerCount: (state: {
|
|
1786
|
+
open: boolean;
|
|
1787
|
+
readonly openProp: boolean | undefined;
|
|
1788
|
+
mounted: boolean;
|
|
1789
|
+
transitionStatus: TransitionStatus_2;
|
|
1790
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1791
|
+
floatingId: string | undefined;
|
|
1792
|
+
triggerCount: number;
|
|
1793
|
+
preventUnmountingOnClose: boolean;
|
|
1794
|
+
payload: unknown;
|
|
1795
|
+
activeTriggerId: string | null;
|
|
1796
|
+
activeTriggerElement: Element | null;
|
|
1797
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1798
|
+
popupElement: HTMLElement | null;
|
|
1799
|
+
positionerElement: HTMLElement | null;
|
|
1800
|
+
activeTriggerProps: HTMLProps;
|
|
1801
|
+
inactiveTriggerProps: HTMLProps;
|
|
1802
|
+
popupProps: HTMLProps;
|
|
1803
|
+
}) => number;
|
|
1804
|
+
preventUnmountingOnClose: (state: {
|
|
1805
|
+
open: boolean;
|
|
1806
|
+
readonly openProp: boolean | undefined;
|
|
1807
|
+
mounted: boolean;
|
|
1808
|
+
transitionStatus: TransitionStatus_2;
|
|
1809
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1810
|
+
floatingId: string | undefined;
|
|
1811
|
+
triggerCount: number;
|
|
1812
|
+
preventUnmountingOnClose: boolean;
|
|
1813
|
+
payload: unknown;
|
|
1814
|
+
activeTriggerId: string | null;
|
|
1815
|
+
activeTriggerElement: Element | null;
|
|
1816
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1817
|
+
popupElement: HTMLElement | null;
|
|
1818
|
+
positionerElement: HTMLElement | null;
|
|
1819
|
+
activeTriggerProps: HTMLProps;
|
|
1820
|
+
inactiveTriggerProps: HTMLProps;
|
|
1821
|
+
popupProps: HTMLProps;
|
|
1822
|
+
}) => boolean;
|
|
1823
|
+
payload: (state: {
|
|
1824
|
+
open: boolean;
|
|
1825
|
+
readonly openProp: boolean | undefined;
|
|
1826
|
+
mounted: boolean;
|
|
1827
|
+
transitionStatus: TransitionStatus_2;
|
|
1828
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1829
|
+
floatingId: string | undefined;
|
|
1830
|
+
triggerCount: number;
|
|
1831
|
+
preventUnmountingOnClose: boolean;
|
|
1832
|
+
payload: unknown;
|
|
1833
|
+
activeTriggerId: string | null;
|
|
1834
|
+
activeTriggerElement: Element | null;
|
|
1835
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1836
|
+
popupElement: HTMLElement | null;
|
|
1837
|
+
positionerElement: HTMLElement | null;
|
|
1838
|
+
activeTriggerProps: HTMLProps;
|
|
1839
|
+
inactiveTriggerProps: HTMLProps;
|
|
1840
|
+
popupProps: HTMLProps;
|
|
1841
|
+
}) => unknown;
|
|
1842
|
+
activeTriggerId: (state: {
|
|
1843
|
+
open: boolean;
|
|
1844
|
+
readonly openProp: boolean | undefined;
|
|
1845
|
+
mounted: boolean;
|
|
1846
|
+
transitionStatus: TransitionStatus_2;
|
|
1847
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1848
|
+
floatingId: string | undefined;
|
|
1849
|
+
triggerCount: number;
|
|
1850
|
+
preventUnmountingOnClose: boolean;
|
|
1851
|
+
payload: unknown;
|
|
1852
|
+
activeTriggerId: string | null;
|
|
1853
|
+
activeTriggerElement: Element | null;
|
|
1854
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1855
|
+
popupElement: HTMLElement | null;
|
|
1856
|
+
positionerElement: HTMLElement | null;
|
|
1857
|
+
activeTriggerProps: HTMLProps;
|
|
1858
|
+
inactiveTriggerProps: HTMLProps;
|
|
1859
|
+
popupProps: HTMLProps;
|
|
1860
|
+
}) => string | null;
|
|
1861
|
+
activeTriggerElement: (state: {
|
|
1862
|
+
open: boolean;
|
|
1863
|
+
readonly openProp: boolean | undefined;
|
|
1864
|
+
mounted: boolean;
|
|
1865
|
+
transitionStatus: TransitionStatus_2;
|
|
1866
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1867
|
+
floatingId: string | undefined;
|
|
1868
|
+
triggerCount: number;
|
|
1869
|
+
preventUnmountingOnClose: boolean;
|
|
1870
|
+
payload: unknown;
|
|
1871
|
+
activeTriggerId: string | null;
|
|
1872
|
+
activeTriggerElement: Element | null;
|
|
1873
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1874
|
+
popupElement: HTMLElement | null;
|
|
1875
|
+
positionerElement: HTMLElement | null;
|
|
1876
|
+
activeTriggerProps: HTMLProps;
|
|
1877
|
+
inactiveTriggerProps: HTMLProps;
|
|
1878
|
+
popupProps: HTMLProps;
|
|
1879
|
+
}) => Element | null;
|
|
1880
|
+
popupId: (state: {
|
|
1881
|
+
open: boolean;
|
|
1882
|
+
readonly openProp: boolean | undefined;
|
|
1883
|
+
mounted: boolean;
|
|
1884
|
+
transitionStatus: TransitionStatus_2;
|
|
1885
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1886
|
+
floatingId: string | undefined;
|
|
1887
|
+
triggerCount: number;
|
|
1888
|
+
preventUnmountingOnClose: boolean;
|
|
1889
|
+
payload: unknown;
|
|
1890
|
+
activeTriggerId: string | null;
|
|
1891
|
+
activeTriggerElement: Element | null;
|
|
1892
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1893
|
+
popupElement: HTMLElement | null;
|
|
1894
|
+
positionerElement: HTMLElement | null;
|
|
1895
|
+
activeTriggerProps: HTMLProps;
|
|
1896
|
+
inactiveTriggerProps: HTMLProps;
|
|
1897
|
+
popupProps: HTMLProps;
|
|
1898
|
+
}) => string | undefined;
|
|
1899
|
+
isTriggerActive: (state: {
|
|
1900
|
+
open: boolean;
|
|
1901
|
+
readonly openProp: boolean | undefined;
|
|
1902
|
+
mounted: boolean;
|
|
1903
|
+
transitionStatus: TransitionStatus_2;
|
|
1904
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1905
|
+
floatingId: string | undefined;
|
|
1906
|
+
triggerCount: number;
|
|
1907
|
+
preventUnmountingOnClose: boolean;
|
|
1908
|
+
payload: unknown;
|
|
1909
|
+
activeTriggerId: string | null;
|
|
1910
|
+
activeTriggerElement: Element | null;
|
|
1911
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1912
|
+
popupElement: HTMLElement | null;
|
|
1913
|
+
positionerElement: HTMLElement | null;
|
|
1914
|
+
activeTriggerProps: HTMLProps;
|
|
1915
|
+
inactiveTriggerProps: HTMLProps;
|
|
1916
|
+
popupProps: HTMLProps;
|
|
1917
|
+
}, triggerId: string | undefined) => boolean;
|
|
1918
|
+
isOpenedByTrigger: (state: {
|
|
1919
|
+
open: boolean;
|
|
1920
|
+
readonly openProp: boolean | undefined;
|
|
1921
|
+
mounted: boolean;
|
|
1922
|
+
transitionStatus: TransitionStatus_2;
|
|
1923
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1924
|
+
floatingId: string | undefined;
|
|
1925
|
+
triggerCount: number;
|
|
1926
|
+
preventUnmountingOnClose: boolean;
|
|
1927
|
+
payload: unknown;
|
|
1928
|
+
activeTriggerId: string | null;
|
|
1929
|
+
activeTriggerElement: Element | null;
|
|
1930
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1931
|
+
popupElement: HTMLElement | null;
|
|
1932
|
+
positionerElement: HTMLElement | null;
|
|
1933
|
+
activeTriggerProps: HTMLProps;
|
|
1934
|
+
inactiveTriggerProps: HTMLProps;
|
|
1935
|
+
popupProps: HTMLProps;
|
|
1936
|
+
}, triggerId: string | undefined) => boolean;
|
|
1937
|
+
isMountedByTrigger: (state: {
|
|
1938
|
+
open: boolean;
|
|
1939
|
+
readonly openProp: boolean | undefined;
|
|
1940
|
+
mounted: boolean;
|
|
1941
|
+
transitionStatus: TransitionStatus_2;
|
|
1942
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1943
|
+
floatingId: string | undefined;
|
|
1944
|
+
triggerCount: number;
|
|
1945
|
+
preventUnmountingOnClose: boolean;
|
|
1946
|
+
payload: unknown;
|
|
1947
|
+
activeTriggerId: string | null;
|
|
1948
|
+
activeTriggerElement: Element | null;
|
|
1949
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1950
|
+
popupElement: HTMLElement | null;
|
|
1951
|
+
positionerElement: HTMLElement | null;
|
|
1952
|
+
activeTriggerProps: HTMLProps;
|
|
1953
|
+
inactiveTriggerProps: HTMLProps;
|
|
1954
|
+
popupProps: HTMLProps;
|
|
1955
|
+
}, triggerId: string | undefined) => boolean;
|
|
1956
|
+
triggerProps: (state: {
|
|
1957
|
+
open: boolean;
|
|
1958
|
+
readonly openProp: boolean | undefined;
|
|
1959
|
+
mounted: boolean;
|
|
1960
|
+
transitionStatus: TransitionStatus_2;
|
|
1961
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1962
|
+
floatingId: string | undefined;
|
|
1963
|
+
triggerCount: number;
|
|
1964
|
+
preventUnmountingOnClose: boolean;
|
|
1965
|
+
payload: unknown;
|
|
1966
|
+
activeTriggerId: string | null;
|
|
1967
|
+
activeTriggerElement: Element | null;
|
|
1968
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1969
|
+
popupElement: HTMLElement | null;
|
|
1970
|
+
positionerElement: HTMLElement | null;
|
|
1971
|
+
activeTriggerProps: HTMLProps;
|
|
1972
|
+
inactiveTriggerProps: HTMLProps;
|
|
1973
|
+
popupProps: HTMLProps;
|
|
1974
|
+
}, isActive: boolean) => HTMLProps;
|
|
1975
|
+
triggerPopupId: (state: {
|
|
1976
|
+
open: boolean;
|
|
1977
|
+
readonly openProp: boolean | undefined;
|
|
1978
|
+
mounted: boolean;
|
|
1979
|
+
transitionStatus: TransitionStatus_2;
|
|
1980
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1981
|
+
floatingId: string | undefined;
|
|
1982
|
+
triggerCount: number;
|
|
1983
|
+
preventUnmountingOnClose: boolean;
|
|
1984
|
+
payload: unknown;
|
|
1985
|
+
activeTriggerId: string | null;
|
|
1986
|
+
activeTriggerElement: Element | null;
|
|
1987
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1988
|
+
popupElement: HTMLElement | null;
|
|
1989
|
+
positionerElement: HTMLElement | null;
|
|
1990
|
+
activeTriggerProps: HTMLProps;
|
|
1991
|
+
inactiveTriggerProps: HTMLProps;
|
|
1992
|
+
popupProps: HTMLProps;
|
|
1993
|
+
}, triggerId: string | undefined) => string | undefined;
|
|
1994
|
+
popupProps: (state: {
|
|
1995
|
+
open: boolean;
|
|
1996
|
+
readonly openProp: boolean | undefined;
|
|
1997
|
+
mounted: boolean;
|
|
1998
|
+
transitionStatus: TransitionStatus_2;
|
|
1999
|
+
floatingRootContext: FloatingRootContext_2;
|
|
2000
|
+
floatingId: string | undefined;
|
|
2001
|
+
triggerCount: number;
|
|
2002
|
+
preventUnmountingOnClose: boolean;
|
|
2003
|
+
payload: unknown;
|
|
2004
|
+
activeTriggerId: string | null;
|
|
2005
|
+
activeTriggerElement: Element | null;
|
|
2006
|
+
readonly triggerIdProp: string | null | undefined;
|
|
2007
|
+
popupElement: HTMLElement | null;
|
|
2008
|
+
positionerElement: HTMLElement | null;
|
|
2009
|
+
activeTriggerProps: HTMLProps;
|
|
2010
|
+
inactiveTriggerProps: HTMLProps;
|
|
2011
|
+
popupProps: HTMLProps;
|
|
2012
|
+
}) => HTMLProps;
|
|
2013
|
+
popupElement: (state: {
|
|
2014
|
+
open: boolean;
|
|
2015
|
+
readonly openProp: boolean | undefined;
|
|
2016
|
+
mounted: boolean;
|
|
2017
|
+
transitionStatus: TransitionStatus_2;
|
|
2018
|
+
floatingRootContext: FloatingRootContext_2;
|
|
2019
|
+
floatingId: string | undefined;
|
|
2020
|
+
triggerCount: number;
|
|
2021
|
+
preventUnmountingOnClose: boolean;
|
|
2022
|
+
payload: unknown;
|
|
2023
|
+
activeTriggerId: string | null;
|
|
2024
|
+
activeTriggerElement: Element | null;
|
|
2025
|
+
readonly triggerIdProp: string | null | undefined;
|
|
2026
|
+
popupElement: HTMLElement | null;
|
|
2027
|
+
positionerElement: HTMLElement | null;
|
|
2028
|
+
activeTriggerProps: HTMLProps;
|
|
2029
|
+
inactiveTriggerProps: HTMLProps;
|
|
2030
|
+
popupProps: HTMLProps;
|
|
2031
|
+
}) => HTMLElement | null;
|
|
2032
|
+
positionerElement: (state: {
|
|
2033
|
+
open: boolean;
|
|
2034
|
+
readonly openProp: boolean | undefined;
|
|
2035
|
+
mounted: boolean;
|
|
2036
|
+
transitionStatus: TransitionStatus_2;
|
|
2037
|
+
floatingRootContext: FloatingRootContext_2;
|
|
2038
|
+
floatingId: string | undefined;
|
|
2039
|
+
triggerCount: number;
|
|
2040
|
+
preventUnmountingOnClose: boolean;
|
|
2041
|
+
payload: unknown;
|
|
2042
|
+
activeTriggerId: string | null;
|
|
2043
|
+
activeTriggerElement: Element | null;
|
|
2044
|
+
readonly triggerIdProp: string | null | undefined;
|
|
2045
|
+
popupElement: HTMLElement | null;
|
|
2046
|
+
positionerElement: HTMLElement | null;
|
|
2047
|
+
activeTriggerProps: HTMLProps;
|
|
2048
|
+
inactiveTriggerProps: HTMLProps;
|
|
2049
|
+
popupProps: HTMLProps;
|
|
2050
|
+
}) => HTMLElement | null;
|
|
2051
|
+
};
|
|
2052
|
+
|
|
2053
|
+
/**
|
|
2054
|
+
* A separator element accessible to screen readers.
|
|
2055
|
+
* Renders a `<div>` element.
|
|
2056
|
+
*
|
|
2057
|
+
* Documentation: [Base UI Separator](https://base-ui.com/react/components/separator)
|
|
2058
|
+
*/
|
|
2059
|
+
declare const Separator: React_2.ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
2060
|
+
|
|
2061
|
+
declare namespace Separator {
|
|
2062
|
+
type Props = SeparatorProps;
|
|
2063
|
+
type State = SeparatorState;
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
declare interface SeparatorProps extends BaseUIComponentProps<'div', SeparatorState> {
|
|
2067
|
+
/**
|
|
2068
|
+
* The orientation of the separator.
|
|
2069
|
+
* @default 'horizontal'
|
|
2070
|
+
*/
|
|
2071
|
+
orientation?: Orientation | undefined;
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
declare interface SeparatorState {
|
|
2075
|
+
/**
|
|
2076
|
+
* The orientation of the separator.
|
|
2077
|
+
*/
|
|
2078
|
+
orientation: Orientation;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
declare const siblingOpen: "sibling-open";
|
|
2082
|
+
|
|
2083
|
+
declare type Side = 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start';
|
|
2084
|
+
|
|
2085
|
+
declare interface SideFlipMode {
|
|
2086
|
+
/**
|
|
2087
|
+
* How to avoid collisions on the side axis.
|
|
2088
|
+
* - `'flip'`: If there is not enough space, place the popup on the opposite side.
|
|
2089
|
+
* - `'none'`: Keep the preferred side even if it overflows.
|
|
2090
|
+
*/
|
|
2091
|
+
side?: 'flip' | 'none' | undefined;
|
|
2092
|
+
/**
|
|
2093
|
+
* How to avoid collisions on the align axis.
|
|
2094
|
+
* - `'flip'`: If there is not enough space, swap `'start'` and `'end'` alignment.
|
|
2095
|
+
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
2096
|
+
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
2097
|
+
*/
|
|
2098
|
+
align?: 'flip' | 'shift' | 'none' | undefined;
|
|
2099
|
+
/**
|
|
2100
|
+
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
2101
|
+
* to a side on the perpendicular axis and which logical side to prefer.
|
|
2102
|
+
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
2103
|
+
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
2104
|
+
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
2105
|
+
*/
|
|
2106
|
+
fallbackAxisSide?: 'start' | 'end' | 'none' | undefined;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
declare interface SideShiftMode {
|
|
2110
|
+
/**
|
|
2111
|
+
* How to avoid collisions on the side axis.
|
|
2112
|
+
* - `'shift'`: Keep the preferred side and shift the popup to fit within the boundary.
|
|
2113
|
+
* - `'none'`: Keep the preferred side even if it overflows.
|
|
2114
|
+
*/
|
|
2115
|
+
side?: 'shift' | 'none' | undefined;
|
|
2116
|
+
/**
|
|
2117
|
+
* How to avoid collisions on the align axis.
|
|
2118
|
+
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
2119
|
+
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
2120
|
+
*/
|
|
2121
|
+
align?: 'shift' | 'none' | undefined;
|
|
2122
|
+
/**
|
|
2123
|
+
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
2124
|
+
* to a side on the perpendicular axis and which logical side to prefer.
|
|
2125
|
+
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
2126
|
+
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
2127
|
+
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
2128
|
+
*/
|
|
2129
|
+
fallbackAxisSide?: 'start' | 'end' | 'none' | undefined;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
declare type State<Payload> = PopupStoreState<Payload> & {
|
|
2133
|
+
disabled: boolean;
|
|
2134
|
+
modal: boolean;
|
|
2135
|
+
openMethod: InteractionType | null;
|
|
2136
|
+
allowMouseEnter: boolean;
|
|
2137
|
+
parent: MenuParent;
|
|
2138
|
+
rootId: string | undefined;
|
|
2139
|
+
activeIndex: number | null;
|
|
2140
|
+
hoverEnabled: boolean;
|
|
2141
|
+
stickIfOpen: boolean;
|
|
2142
|
+
instantType: 'dismiss' | 'click' | 'group' | 'trigger-change' | undefined;
|
|
2143
|
+
openChangeReason: MenuRoot.ChangeEventReason | null;
|
|
2144
|
+
floatingTreeRoot: FloatingTreeStore;
|
|
2145
|
+
floatingNodeId: string | undefined;
|
|
2146
|
+
floatingParentNodeId: string | null;
|
|
2147
|
+
itemProps: HTMLProps;
|
|
2148
|
+
closeDelay: number;
|
|
2149
|
+
keyboardEventRelay: ((event: React_2.KeyboardEvent<any>) => void) | undefined;
|
|
2150
|
+
hasViewport: boolean;
|
|
2151
|
+
};
|
|
2152
|
+
|
|
2153
|
+
declare const swipe: "swipe";
|
|
2154
|
+
|
|
2155
|
+
declare const trackPress: "track-press";
|
|
2156
|
+
|
|
2157
|
+
declare type TransitionStatus = 'starting' | 'ending' | 'idle' | undefined;
|
|
2158
|
+
|
|
76
2159
|
declare function Trigger<Payload = unknown>({ className, ...props }: WithStringClassName<Menu_2.Trigger.Props<Payload>> & React_2.RefAttributes<HTMLElement>): JSX_2.Element;
|
|
77
2160
|
|
|
2161
|
+
declare const triggerFocus: "trigger-focus";
|
|
2162
|
+
|
|
2163
|
+
declare const triggerHover: "trigger-hover";
|
|
2164
|
+
|
|
2165
|
+
declare const triggerPress: "trigger-press";
|
|
2166
|
+
|
|
2167
|
+
declare interface UseAnchorPositioningSharedParameters {
|
|
2168
|
+
/**
|
|
2169
|
+
* An element to position the popup against.
|
|
2170
|
+
* By default, the popup will be positioned against the trigger.
|
|
2171
|
+
*/
|
|
2172
|
+
anchor?: Element | null | VirtualElement | React_2.RefObject<Element | null> | (() => Element | VirtualElement | null) | undefined;
|
|
2173
|
+
/**
|
|
2174
|
+
* Determines which CSS `position` property to use.
|
|
2175
|
+
* @default 'absolute'
|
|
2176
|
+
*/
|
|
2177
|
+
positionMethod?: 'absolute' | 'fixed' | undefined;
|
|
2178
|
+
/**
|
|
2179
|
+
* Which side of the anchor element to align the popup against.
|
|
2180
|
+
* May automatically change to avoid collisions.
|
|
2181
|
+
* @default 'bottom'
|
|
2182
|
+
*/
|
|
2183
|
+
side?: Side | undefined;
|
|
2184
|
+
/**
|
|
2185
|
+
* Distance between the anchor and the popup in pixels.
|
|
2186
|
+
* Also accepts a function that returns the distance to read the dimensions of the anchor
|
|
2187
|
+
* and positioner elements, along with its side and alignment.
|
|
2188
|
+
*
|
|
2189
|
+
* The function takes a `data` object parameter with the following properties:
|
|
2190
|
+
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
2191
|
+
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
2192
|
+
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
2193
|
+
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
2194
|
+
*
|
|
2195
|
+
* @example
|
|
2196
|
+
* ```jsx
|
|
2197
|
+
* <Positioner
|
|
2198
|
+
* sideOffset={({ side, align, anchor, positioner }) => {
|
|
2199
|
+
* return side === 'top' || side === 'bottom'
|
|
2200
|
+
* ? anchor.height
|
|
2201
|
+
* : anchor.width;
|
|
2202
|
+
* }}
|
|
2203
|
+
* />
|
|
2204
|
+
* ```
|
|
2205
|
+
*
|
|
2206
|
+
* @default 0
|
|
2207
|
+
*/
|
|
2208
|
+
sideOffset?: number | OffsetFunction | undefined;
|
|
2209
|
+
/**
|
|
2210
|
+
* How to align the popup relative to the specified side.
|
|
2211
|
+
* @default 'center'
|
|
2212
|
+
*/
|
|
2213
|
+
align?: Align | undefined;
|
|
2214
|
+
/**
|
|
2215
|
+
* Additional offset along the alignment axis in pixels.
|
|
2216
|
+
* Also accepts a function that returns the offset to read the dimensions of the anchor
|
|
2217
|
+
* and positioner elements, along with its side and alignment.
|
|
2218
|
+
*
|
|
2219
|
+
* The function takes a `data` object parameter with the following properties:
|
|
2220
|
+
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
2221
|
+
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
2222
|
+
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
2223
|
+
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
2224
|
+
*
|
|
2225
|
+
* @example
|
|
2226
|
+
* ```jsx
|
|
2227
|
+
* <Positioner
|
|
2228
|
+
* alignOffset={({ side, align, anchor, positioner }) => {
|
|
2229
|
+
* return side === 'top' || side === 'bottom'
|
|
2230
|
+
* ? anchor.width
|
|
2231
|
+
* : anchor.height;
|
|
2232
|
+
* }}
|
|
2233
|
+
* />
|
|
2234
|
+
* ```
|
|
2235
|
+
*
|
|
2236
|
+
* @default 0
|
|
2237
|
+
*/
|
|
2238
|
+
alignOffset?: number | OffsetFunction | undefined;
|
|
2239
|
+
/**
|
|
2240
|
+
* An element or a rectangle that delimits the area that the popup is confined to.
|
|
2241
|
+
* @default 'clipping-ancestors'
|
|
2242
|
+
*/
|
|
2243
|
+
collisionBoundary?: Boundary | undefined;
|
|
2244
|
+
/**
|
|
2245
|
+
* Additional space to maintain from the edge of the collision boundary.
|
|
2246
|
+
* @default 5
|
|
2247
|
+
*/
|
|
2248
|
+
collisionPadding?: Padding | undefined;
|
|
2249
|
+
/**
|
|
2250
|
+
* Whether to maintain the popup in the viewport after
|
|
2251
|
+
* the anchor element was scrolled out of view.
|
|
2252
|
+
* @default false
|
|
2253
|
+
*/
|
|
2254
|
+
sticky?: boolean | undefined;
|
|
2255
|
+
/**
|
|
2256
|
+
* Minimum distance to maintain between the arrow and the edges of the popup.
|
|
2257
|
+
*
|
|
2258
|
+
* Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
|
|
2259
|
+
* @default 5
|
|
2260
|
+
*/
|
|
2261
|
+
arrowPadding?: number | undefined;
|
|
2262
|
+
/**
|
|
2263
|
+
* Whether to disable the popup from tracking any layout shift of its positioning anchor.
|
|
2264
|
+
* @default false
|
|
2265
|
+
*/
|
|
2266
|
+
disableAnchorTracking?: boolean | undefined;
|
|
2267
|
+
/**
|
|
2268
|
+
* Determines how to handle collisions when positioning the popup.
|
|
2269
|
+
*
|
|
2270
|
+
* `side` controls overflow on the preferred placement axis (`top`/`bottom` or `left`/`right`):
|
|
2271
|
+
* - `'flip'`: keep the requested side when it fits; otherwise try the opposite side
|
|
2272
|
+
* (`top` and `bottom`, or `left` and `right`).
|
|
2273
|
+
* - `'shift'`: never change side; keep the requested side and move the popup within
|
|
2274
|
+
* the clipping boundary so it stays visible.
|
|
2275
|
+
* - `'none'`: do not correct side-axis overflow.
|
|
2276
|
+
*
|
|
2277
|
+
* `align` controls overflow on the alignment axis (`start`/`center`/`end`):
|
|
2278
|
+
* - `'flip'`: keep side, but swap `start` and `end` when the requested alignment overflows.
|
|
2279
|
+
* - `'shift'`: keep side and requested alignment, then nudge the popup along the
|
|
2280
|
+
* alignment axis to fit.
|
|
2281
|
+
* - `'none'`: do not correct alignment-axis overflow.
|
|
2282
|
+
*
|
|
2283
|
+
* `fallbackAxisSide` controls fallback behavior on the perpendicular axis when the
|
|
2284
|
+
* preferred axis cannot fit:
|
|
2285
|
+
* - `'start'`: allow perpendicular fallback and try the logical start side first
|
|
2286
|
+
* (`top` before `bottom`, or `left` before `right` in LTR).
|
|
2287
|
+
* - `'end'`: allow perpendicular fallback and try the logical end side first
|
|
2288
|
+
* (`bottom` before `top`, or `right` before `left` in LTR).
|
|
2289
|
+
* - `'none'`: do not fallback to the perpendicular axis.
|
|
2290
|
+
*
|
|
2291
|
+
* When `side` is `'shift'`, explicitly setting `align` only supports `'shift'` or `'none'`.
|
|
2292
|
+
* If `align` is omitted, it defaults to `'flip'`.
|
|
2293
|
+
*
|
|
2294
|
+
* @example
|
|
2295
|
+
* ```jsx
|
|
2296
|
+
* <Positioner
|
|
2297
|
+
* collisionAvoidance={{
|
|
2298
|
+
* side: 'shift',
|
|
2299
|
+
* align: 'shift',
|
|
2300
|
+
* fallbackAxisSide: 'none',
|
|
2301
|
+
* }}
|
|
2302
|
+
* />
|
|
2303
|
+
* ```
|
|
2304
|
+
*
|
|
2305
|
+
*/
|
|
2306
|
+
collisionAvoidance?: CollisionAvoidance | undefined;
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
declare interface UseFloatingPortalNodeProps {
|
|
2310
|
+
ref?: React_2.Ref<HTMLDivElement> | undefined;
|
|
2311
|
+
container?: HTMLElement | ShadowRoot | null | React_2.RefObject<HTMLElement | ShadowRoot | null> | undefined;
|
|
2312
|
+
componentProps?: UseRenderElementComponentProps<any> | undefined;
|
|
2313
|
+
elementProps?: React_2.HTMLAttributes<HTMLDivElement> | undefined;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
export declare function useMenuSubmenuRootContext(): MenuSubmenuRootContext | undefined;
|
|
2317
|
+
|
|
2318
|
+
declare interface UseRenderElementComponentProps<State> {
|
|
2319
|
+
/**
|
|
2320
|
+
* The class name to apply to the rendered element.
|
|
2321
|
+
* Can be a string or a function that accepts the state and returns a string.
|
|
2322
|
+
*/
|
|
2323
|
+
className?: string | ((state: State) => string | undefined) | undefined;
|
|
2324
|
+
/**
|
|
2325
|
+
* The render prop or React element to override the default element.
|
|
2326
|
+
*/
|
|
2327
|
+
render?: undefined | React_2.ReactElement | ComponentRenderFn<React_2.HTMLAttributes<any>, State>;
|
|
2328
|
+
/**
|
|
2329
|
+
* The style to apply to the rendered element.
|
|
2330
|
+
* Can be a style object or a function that accepts the state and returns a style object.
|
|
2331
|
+
*/
|
|
2332
|
+
style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
declare const wheel: "wheel";
|
|
2336
|
+
|
|
2337
|
+
declare const windowResize: "window-resize";
|
|
2338
|
+
|
|
2339
|
+
/**
|
|
2340
|
+
* Adds a `preventBaseUIHandler` method to all event handlers.
|
|
2341
|
+
*/
|
|
2342
|
+
declare type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K]> };
|
|
2343
|
+
|
|
2344
|
+
declare type WithPreventBaseUIHandler<T> = T extends ((event: infer E) => any) ? E extends React_2.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
|
|
2345
|
+
|
|
78
2346
|
declare type WithStringClassName<P> = Omit<P, 'className'> & {
|
|
79
2347
|
className?: string;
|
|
80
2348
|
};
|
|
81
2349
|
|
|
82
|
-
|
|
83
|
-
export * from "@base-ui/react/menu";
|
|
84
|
-
|
|
85
2350
|
export { }
|