@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/Popover/index.d.ts
CHANGED
|
@@ -1,35 +1,347 @@
|
|
|
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 { HTMLProps as HTMLProps_2 } from '../../index.js';
|
|
4
|
+
import { InteractionType } from '@base-ui/utils/useEnhancedClickHandler';
|
|
1
5
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import { PopoverArrowProps } from '@base-ui/react/popover';
|
|
4
|
-
import { PopoverBackdropProps } from '@base-ui/react/popover';
|
|
5
|
-
import { PopoverCloseProps } from '@base-ui/react/popover';
|
|
6
|
-
import { PopoverDescriptionProps } from '@base-ui/react/popover';
|
|
7
|
-
import { PopoverPopupProps } from '@base-ui/react/popover';
|
|
8
|
-
import { PopoverPortalProps } from '@base-ui/react/popover';
|
|
9
|
-
import { PopoverPositionerProps } from '@base-ui/react/popover';
|
|
10
|
-
import {
|
|
6
|
+
import { Padding } from '@floating-ui/react-dom';
|
|
7
|
+
import { PopoverArrowProps as PopoverArrowProps_2 } from '@base-ui/react/popover';
|
|
8
|
+
import { PopoverBackdropProps as PopoverBackdropProps_2 } from '@base-ui/react/popover';
|
|
9
|
+
import { PopoverCloseProps as PopoverCloseProps_2 } from '@base-ui/react/popover';
|
|
10
|
+
import { PopoverDescriptionProps as PopoverDescriptionProps_2 } from '@base-ui/react/popover';
|
|
11
|
+
import { PopoverPopupProps as PopoverPopupProps_2 } from '@base-ui/react/popover';
|
|
12
|
+
import { PopoverPortalProps as PopoverPortalProps_2 } from '@base-ui/react/popover';
|
|
13
|
+
import { PopoverPositionerProps as PopoverPositionerProps_2 } from '@base-ui/react/popover';
|
|
14
|
+
import { PopoverRootChangeEventReason as PopoverRootChangeEventReason_2 } from '../index.js';
|
|
15
|
+
import { PopoverTitleProps as PopoverTitleProps_2 } from '@base-ui/react/popover';
|
|
11
16
|
import * as React_2 from 'react';
|
|
17
|
+
import { ReactStore } from '@base-ui/utils/store';
|
|
18
|
+
import { Rect } from '@floating-ui/utils';
|
|
19
|
+
import { Timeout } from '@base-ui/utils/useTimeout';
|
|
20
|
+
import { TransitionStatus as TransitionStatus_2 } from '../../internals/useTransitionStatus.js';
|
|
21
|
+
import type { UseFloatingReturn } from '@floating-ui/react-dom';
|
|
22
|
+
import { VirtualElement } from '@floating-ui/react-dom';
|
|
23
|
+
|
|
24
|
+
declare type Align = 'start' | 'center' | 'end';
|
|
25
|
+
|
|
26
|
+
declare type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
|
|
27
|
+
/**
|
|
28
|
+
* The reason for the event.
|
|
29
|
+
*/
|
|
30
|
+
reason: Reason;
|
|
31
|
+
/**
|
|
32
|
+
* The native event associated with the custom event.
|
|
33
|
+
*/
|
|
34
|
+
event: ReasonToEvent<Reason>;
|
|
35
|
+
/**
|
|
36
|
+
* Cancels Base UI from handling the event.
|
|
37
|
+
*/
|
|
38
|
+
cancel: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* Allows the event to propagate in cases where Base UI will stop the propagation.
|
|
41
|
+
*/
|
|
42
|
+
allowPropagation: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* Indicates whether the event has been canceled.
|
|
45
|
+
*/
|
|
46
|
+
isCanceled: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Indicates whether the event is allowed to propagate.
|
|
49
|
+
*/
|
|
50
|
+
isPropagationAllowed: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The element that triggered the event, if applicable.
|
|
53
|
+
*/
|
|
54
|
+
trigger: Element | undefined;
|
|
55
|
+
} & CustomProperties;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Details of custom change events emitted by Base UI components.
|
|
59
|
+
*/
|
|
60
|
+
declare type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Props shared by all Base UI components.
|
|
64
|
+
* Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
|
|
65
|
+
*/
|
|
66
|
+
declare type BaseUIComponentProps<ElementType extends React_2.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React_2.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked' | 'style'> & {
|
|
67
|
+
/**
|
|
68
|
+
* CSS class applied to the element, or a function that
|
|
69
|
+
* returns a class based on the component's state.
|
|
70
|
+
*/
|
|
71
|
+
className?: string | ((state: State) => string | undefined) | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Allows you to replace the component's HTML element
|
|
74
|
+
* with a different tag, or compose it with another component.
|
|
75
|
+
*
|
|
76
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
77
|
+
*/
|
|
78
|
+
render?: React_2.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Style applied to the element, or a function that
|
|
81
|
+
* returns a style object based on the component's state.
|
|
82
|
+
*/
|
|
83
|
+
style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E & {
|
|
87
|
+
preventBaseUIHandler: () => void;
|
|
88
|
+
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
declare type Boundary = 'clipping-ancestors' | Element | Element[] | Rect;
|
|
92
|
+
|
|
93
|
+
declare const cancelOpen: "cancel-open";
|
|
94
|
+
|
|
95
|
+
declare const chipRemovePress: "chip-remove-press";
|
|
96
|
+
|
|
97
|
+
declare const clearPress: "clear-press";
|
|
98
|
+
|
|
99
|
+
declare const closePress: "close-press";
|
|
100
|
+
|
|
101
|
+
declare const closeWatcher: "close-watcher";
|
|
102
|
+
|
|
103
|
+
declare type CollisionAvoidance = SideFlipMode | SideShiftMode;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 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.
|
|
107
|
+
*
|
|
108
|
+
* @template Props Props to be spread on the rendered element.
|
|
109
|
+
* @template State Component's internal state.
|
|
110
|
+
*/
|
|
111
|
+
declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
|
|
112
|
+
|
|
113
|
+
declare type Context = PopupStoreContext<PopoverRoot.ChangeEventDetails> & {
|
|
114
|
+
readonly popupRef: React_2.RefObject<HTMLElement | null>;
|
|
115
|
+
readonly backdropRef: React_2.RefObject<HTMLDivElement | null>;
|
|
116
|
+
readonly internalBackdropRef: React_2.RefObject<HTMLDivElement | null>;
|
|
117
|
+
readonly triggerFocusTargetRef: React_2.RefObject<HTMLElement | null>;
|
|
118
|
+
readonly beforeContentFocusGuardRef: React_2.RefObject<HTMLElement | null>;
|
|
119
|
+
readonly stickIfOpenTimeout: Timeout;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
declare interface ContextData {
|
|
123
|
+
openEvent?: Event | undefined;
|
|
124
|
+
floatingContext?: FloatingContext | undefined;
|
|
125
|
+
[key: string]: any;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Creates a new handle to connect a Popover.Root with detached Popover.Trigger components.
|
|
130
|
+
*/
|
|
131
|
+
declare function createPopoverHandle<Payload>(): PopoverHandle<Payload>;
|
|
132
|
+
|
|
133
|
+
declare const decrementPress: "decrement-press";
|
|
134
|
+
|
|
135
|
+
declare const disabled: "disabled";
|
|
136
|
+
|
|
137
|
+
declare const drag: "drag";
|
|
138
|
+
|
|
139
|
+
declare const escapeKey: "escape-key";
|
|
140
|
+
|
|
141
|
+
declare interface ExtendedElements {
|
|
142
|
+
reference: ReferenceType | null;
|
|
143
|
+
floating: HTMLElement | null;
|
|
144
|
+
domReference: NarrowedElement<ReferenceType> | null;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
declare interface ExtendedRefs {
|
|
148
|
+
reference: React_2.RefObject<ReferenceType | null>;
|
|
149
|
+
floating: React_2.RefObject<HTMLElement | null>;
|
|
150
|
+
domReference: React_2.RefObject<NarrowedElement<ReferenceType> | null>;
|
|
151
|
+
setReference(node: ReferenceType | null): void;
|
|
152
|
+
setFloating(node: HTMLElement | null): void;
|
|
153
|
+
setPositionReference(node: ReferenceType | null): void;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
declare type FloatingContext = Omit<UseFloatingReturn<ReferenceType>, 'refs' | 'elements'> & {
|
|
157
|
+
open: boolean;
|
|
158
|
+
onOpenChange(open: boolean, eventDetails: BaseUIChangeEventDetails<string>): void;
|
|
159
|
+
events: FloatingEvents;
|
|
160
|
+
dataRef: React_2.RefObject<ContextData>;
|
|
161
|
+
nodeId: string | undefined;
|
|
162
|
+
floatingId: string | undefined;
|
|
163
|
+
refs: ExtendedRefs;
|
|
164
|
+
elements: ExtendedElements;
|
|
165
|
+
rootStore: FloatingRootContext;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
declare interface FloatingEvents {
|
|
169
|
+
emit<T extends string>(event: T, data?: any): void;
|
|
170
|
+
on(event: string, handler: (data: any) => void): void;
|
|
171
|
+
off(event: string, handler: (data: any) => void): void;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Portals the floating element into a given container element — by default,
|
|
176
|
+
* outside of the app root and into the body.
|
|
177
|
+
* This is necessary to ensure the floating element can appear outside any
|
|
178
|
+
* potential parent containers that cause clipping (such as `overflow: hidden`),
|
|
179
|
+
* while retaining its location in the React tree.
|
|
180
|
+
* @see https://floating-ui.com/docs/FloatingPortal
|
|
181
|
+
* @internal
|
|
182
|
+
*/
|
|
183
|
+
declare const FloatingPortal: React_2.ForwardRefExoticComponent<Omit<FloatingPortal.Props<any> & {
|
|
184
|
+
renderGuards?: boolean | undefined;
|
|
185
|
+
}, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
186
|
+
|
|
187
|
+
declare namespace FloatingPortal {
|
|
188
|
+
type State = FloatingPortalState;
|
|
189
|
+
interface Props<TState> extends BaseUIComponentProps<'div', TState> {
|
|
190
|
+
/**
|
|
191
|
+
* A parent element to render the portal element into.
|
|
192
|
+
*/
|
|
193
|
+
container?: UseFloatingPortalNodeProps['container'] | undefined;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
declare interface FloatingPortalState {}
|
|
198
|
+
|
|
199
|
+
declare type FloatingRootContext = FloatingRootStore;
|
|
200
|
+
|
|
201
|
+
declare interface FloatingRootState {
|
|
202
|
+
open: boolean;
|
|
203
|
+
transitionStatus: TransitionStatus | undefined;
|
|
204
|
+
domReferenceElement: Element | null;
|
|
205
|
+
referenceElement: ReferenceType | null;
|
|
206
|
+
floatingElement: HTMLElement | null;
|
|
207
|
+
positionReference: ReferenceType | null;
|
|
208
|
+
/**
|
|
209
|
+
* The ID of the floating element.
|
|
210
|
+
*/
|
|
211
|
+
floatingId: string | undefined;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
declare class FloatingRootStore extends ReactStore<Readonly<FloatingRootState>, FloatingRootStoreContext, typeof selectors> {
|
|
215
|
+
private readonly syncOnly;
|
|
216
|
+
constructor(options: FloatingRootStoreOptions);
|
|
217
|
+
/**
|
|
218
|
+
* Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
|
|
219
|
+
*/
|
|
220
|
+
syncOpenEvent: (newOpen: boolean, event: Event | undefined) => void;
|
|
221
|
+
/**
|
|
222
|
+
* Runs the root-owned side effects for an open state change.
|
|
223
|
+
*/
|
|
224
|
+
dispatchOpenChange: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
|
|
225
|
+
/**
|
|
226
|
+
* Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
|
|
227
|
+
*
|
|
228
|
+
* @param newOpen The new open state.
|
|
229
|
+
* @param eventDetails Details about the event that triggered the open state change.
|
|
230
|
+
*/
|
|
231
|
+
setOpen: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
declare interface FloatingRootStoreContext {
|
|
235
|
+
onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
|
|
236
|
+
readonly dataRef: React_2.RefObject<ContextData>;
|
|
237
|
+
readonly events: FloatingEvents;
|
|
238
|
+
nested: boolean;
|
|
239
|
+
readonly triggerElements: PopupTriggerMap;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
declare interface FloatingRootStoreOptions {
|
|
243
|
+
open: boolean;
|
|
244
|
+
transitionStatus: TransitionStatus | undefined;
|
|
245
|
+
referenceElement: ReferenceType | null;
|
|
246
|
+
floatingElement: HTMLElement | null;
|
|
247
|
+
triggerElements: PopupTriggerMap;
|
|
248
|
+
floatingId: string | undefined;
|
|
249
|
+
/**
|
|
250
|
+
* When true, `setOpen` only forwards to `onOpenChange`.
|
|
251
|
+
* The popup store owns `dispatchOpenChange(...)` in this mode.
|
|
252
|
+
*/
|
|
253
|
+
syncOnly: boolean;
|
|
254
|
+
nested: boolean;
|
|
255
|
+
onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
declare const focusOut: "focus-out";
|
|
259
|
+
|
|
260
|
+
declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
|
|
261
|
+
ref?: React_2.Ref<T> | undefined;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
declare const imperativeAction: "imperative-action";
|
|
265
|
+
|
|
266
|
+
declare const incrementPress: "increment-press";
|
|
267
|
+
|
|
268
|
+
declare const initial: "initial";
|
|
269
|
+
|
|
270
|
+
declare const inputBlur: "input-blur";
|
|
271
|
+
|
|
272
|
+
declare const inputChange: "input-change";
|
|
273
|
+
|
|
274
|
+
declare const inputClear: "input-clear";
|
|
275
|
+
|
|
276
|
+
declare const inputPaste: "input-paste";
|
|
277
|
+
|
|
278
|
+
declare const inputPress: "input-press";
|
|
279
|
+
|
|
280
|
+
declare const itemPress: "item-press";
|
|
281
|
+
|
|
282
|
+
declare const keyboard: "keyboard";
|
|
283
|
+
|
|
284
|
+
declare const linkPress: "link-press";
|
|
285
|
+
|
|
286
|
+
declare const listNavigation: "list-navigation";
|
|
287
|
+
|
|
288
|
+
declare const missing: "missing";
|
|
289
|
+
|
|
290
|
+
declare type NarrowedElement<T> = T extends Element ? T : Element;
|
|
291
|
+
|
|
292
|
+
declare interface NativeButtonProps {
|
|
293
|
+
/**
|
|
294
|
+
* Whether the component renders a native `<button>` element when replacing it
|
|
295
|
+
* via the `render` prop.
|
|
296
|
+
* Set to `false` if the rendered element is not a button (for example, `<div>`).
|
|
297
|
+
* @default true
|
|
298
|
+
*/
|
|
299
|
+
nativeButton?: boolean | undefined;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare const none: "none";
|
|
303
|
+
|
|
304
|
+
declare type OffsetFunction = (data: {
|
|
305
|
+
side: Side;
|
|
306
|
+
align: Align;
|
|
307
|
+
anchor: {
|
|
308
|
+
width: number;
|
|
309
|
+
height: number;
|
|
310
|
+
};
|
|
311
|
+
positioner: {
|
|
312
|
+
width: number;
|
|
313
|
+
height: number;
|
|
314
|
+
};
|
|
315
|
+
}) => number;
|
|
316
|
+
|
|
317
|
+
declare const outsidePress: "outside-press";
|
|
318
|
+
|
|
319
|
+
declare type PayloadChildRenderFunction<Payload> = (arg: {
|
|
320
|
+
payload: Payload | undefined;
|
|
321
|
+
}) => React_2.ReactNode;
|
|
322
|
+
|
|
323
|
+
declare const pointer: "pointer";
|
|
12
324
|
|
|
13
325
|
export declare const Popover: {
|
|
14
|
-
Positioner: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
326
|
+
Positioner: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<PopoverPositionerProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
15
327
|
className?: string | undefined;
|
|
16
328
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
Popup: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
329
|
+
Popup: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<PopoverPopupProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
18
330
|
className?: string | undefined;
|
|
19
331
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
20
|
-
Arrow: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
332
|
+
Arrow: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<PopoverArrowProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
21
333
|
className?: string | undefined;
|
|
22
334
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
23
|
-
Backdrop: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
335
|
+
Backdrop: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<PopoverBackdropProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
24
336
|
className?: string | undefined;
|
|
25
337
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
26
|
-
Title: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
338
|
+
Title: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<PopoverTitleProps_2, "ref"> & React_2.RefAttributes<HTMLHeadingElement>, "ref">, "className"> & {
|
|
27
339
|
className?: string | undefined;
|
|
28
340
|
} & React_2.RefAttributes<HTMLHeadingElement>>;
|
|
29
|
-
Description: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
341
|
+
Description: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<PopoverDescriptionProps_2, "ref"> & React_2.RefAttributes<HTMLParagraphElement>, "ref">, "className"> & {
|
|
30
342
|
className?: string | undefined;
|
|
31
343
|
} & React_2.RefAttributes<HTMLParagraphElement>>;
|
|
32
|
-
Close: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
344
|
+
Close: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<PopoverCloseProps_2, "ref"> & React_2.RefAttributes<HTMLButtonElement>, "ref">, "className"> & {
|
|
33
345
|
className?: string | undefined;
|
|
34
346
|
} & React_2.RefAttributes<HTMLButtonElement>>;
|
|
35
347
|
Viewport: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<Popover_2.Viewport.Props, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
@@ -37,18 +349,1341 @@ export declare const Popover: {
|
|
|
37
349
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
38
350
|
Root: typeof Popover_2.Root;
|
|
39
351
|
Trigger: typeof Trigger;
|
|
40
|
-
Portal: React_2.ForwardRefExoticComponent<Omit<
|
|
352
|
+
Portal: React_2.ForwardRefExoticComponent<Omit<PopoverPortalProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
41
353
|
Handle: typeof Popover_2.Handle;
|
|
42
354
|
createHandle: typeof Popover_2.createHandle;
|
|
43
355
|
};
|
|
44
356
|
|
|
357
|
+
export declare namespace Popover_2 {
|
|
358
|
+
export {
|
|
359
|
+
PopoverRoot as Root,
|
|
360
|
+
PopoverTrigger as Trigger,
|
|
361
|
+
PopoverPortal as Portal,
|
|
362
|
+
PopoverPositioner as Positioner,
|
|
363
|
+
PopoverPopup as Popup,
|
|
364
|
+
PopoverArrow as Arrow,
|
|
365
|
+
PopoverBackdrop as Backdrop,
|
|
366
|
+
PopoverTitle as Title,
|
|
367
|
+
PopoverDescription as Description,
|
|
368
|
+
PopoverClose as Close,
|
|
369
|
+
PopoverViewport as Viewport,
|
|
370
|
+
createPopoverHandle as createHandle,
|
|
371
|
+
PopoverHandle as Handle
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Displays an element positioned against the popover anchor.
|
|
377
|
+
* Renders a `<div>` element.
|
|
378
|
+
*
|
|
379
|
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
|
380
|
+
*/
|
|
381
|
+
export declare const PopoverArrow: React_2.ForwardRefExoticComponent<Omit<PopoverArrowProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
382
|
+
|
|
383
|
+
export declare namespace PopoverArrow {
|
|
384
|
+
export type State = PopoverArrowState;
|
|
385
|
+
export type Props = PopoverArrowProps;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export declare interface PopoverArrowProps extends BaseUIComponentProps<'div', PopoverArrowState> {}
|
|
389
|
+
|
|
390
|
+
export declare interface PopoverArrowState {
|
|
391
|
+
/**
|
|
392
|
+
* Whether the popover is currently open.
|
|
393
|
+
*/
|
|
394
|
+
open: boolean;
|
|
395
|
+
/**
|
|
396
|
+
* The side of the anchor the component is placed on.
|
|
397
|
+
*/
|
|
398
|
+
side: Side;
|
|
399
|
+
/**
|
|
400
|
+
* The alignment of the component relative to the anchor.
|
|
401
|
+
*/
|
|
402
|
+
align: Align;
|
|
403
|
+
/**
|
|
404
|
+
* Whether the arrow cannot be centered on the anchor.
|
|
405
|
+
*/
|
|
406
|
+
uncentered: boolean;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* An overlay displayed beneath the popover.
|
|
411
|
+
* Renders a `<div>` element.
|
|
412
|
+
*
|
|
413
|
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
|
414
|
+
*/
|
|
415
|
+
export declare const PopoverBackdrop: React_2.ForwardRefExoticComponent<Omit<PopoverBackdropProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
416
|
+
|
|
417
|
+
export declare namespace PopoverBackdrop {
|
|
418
|
+
export type State = PopoverBackdropState;
|
|
419
|
+
export type Props = PopoverBackdropProps;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export declare interface PopoverBackdropProps extends BaseUIComponentProps<'div', PopoverBackdropState> {}
|
|
423
|
+
|
|
424
|
+
export declare interface PopoverBackdropState {
|
|
425
|
+
/**
|
|
426
|
+
* Whether the popover is currently open.
|
|
427
|
+
*/
|
|
428
|
+
open: boolean;
|
|
429
|
+
/**
|
|
430
|
+
* The transition status of the component.
|
|
431
|
+
*/
|
|
432
|
+
transitionStatus: TransitionStatus;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* A button that closes the popover.
|
|
437
|
+
* Renders a `<button>` element.
|
|
438
|
+
*
|
|
439
|
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
|
440
|
+
*/
|
|
441
|
+
export declare const PopoverClose: React_2.ForwardRefExoticComponent<Omit<PopoverCloseProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
442
|
+
|
|
443
|
+
export declare namespace PopoverClose {
|
|
444
|
+
export type State = PopoverCloseState;
|
|
445
|
+
export type Props = PopoverCloseProps;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export declare interface PopoverCloseProps extends NativeButtonProps, BaseUIComponentProps<'button', PopoverCloseState> {}
|
|
449
|
+
|
|
450
|
+
export declare interface PopoverCloseState {}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* A paragraph with additional information about the popover.
|
|
454
|
+
* Renders a `<p>` element.
|
|
455
|
+
*
|
|
456
|
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
|
457
|
+
*/
|
|
458
|
+
export declare const PopoverDescription: React_2.ForwardRefExoticComponent<Omit<PopoverDescriptionProps, "ref"> & React_2.RefAttributes<HTMLParagraphElement>>;
|
|
459
|
+
|
|
460
|
+
export declare namespace PopoverDescription {
|
|
461
|
+
export type State = PopoverDescriptionState;
|
|
462
|
+
export type Props = PopoverDescriptionProps;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
export declare interface PopoverDescriptionProps extends BaseUIComponentProps<'p', PopoverDescriptionState> {}
|
|
466
|
+
|
|
467
|
+
export declare interface PopoverDescriptionState {}
|
|
468
|
+
|
|
469
|
+
declare class PopoverHandle<Payload> {
|
|
470
|
+
/**
|
|
471
|
+
* Internal store holding the popover's state.
|
|
472
|
+
* @internal
|
|
473
|
+
*/
|
|
474
|
+
readonly store: PopoverStore<Payload>;
|
|
475
|
+
constructor();
|
|
476
|
+
/**
|
|
477
|
+
* Opens the popover and associates it with the trigger with the given id.
|
|
478
|
+
* The trigger must be a Popover.Trigger component with this handle passed as a prop.
|
|
479
|
+
*
|
|
480
|
+
* @param triggerId ID of the trigger to associate with the popover.
|
|
481
|
+
*/
|
|
482
|
+
open(triggerId: string): void;
|
|
483
|
+
/**
|
|
484
|
+
* Closes the popover.
|
|
485
|
+
*/
|
|
486
|
+
close(): void;
|
|
487
|
+
/**
|
|
488
|
+
* Indicates whether the popover is currently open.
|
|
489
|
+
*/
|
|
490
|
+
get isOpen(): boolean;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* A container for the popover contents.
|
|
495
|
+
* Renders a `<div>` element.
|
|
496
|
+
*
|
|
497
|
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
|
498
|
+
*/
|
|
499
|
+
export declare const PopoverPopup: React_2.ForwardRefExoticComponent<Omit<PopoverPopupProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
500
|
+
|
|
501
|
+
export declare namespace PopoverPopup {
|
|
502
|
+
export type State = PopoverPopupState;
|
|
503
|
+
export type Props = PopoverPopupProps;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
export declare interface PopoverPopupProps extends BaseUIComponentProps<'div', PopoverPopupState> {
|
|
507
|
+
/**
|
|
508
|
+
* Determines the element to focus when the popover is opened.
|
|
509
|
+
*
|
|
510
|
+
* - `false`: Do not move focus.
|
|
511
|
+
* - `true`: Move focus based on the default behavior (first tabbable element or popup).
|
|
512
|
+
* - `RefObject`: Move focus to the ref element.
|
|
513
|
+
* - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).
|
|
514
|
+
* Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.
|
|
515
|
+
*/
|
|
516
|
+
initialFocus?: boolean | React_2.RefObject<HTMLElement | null> | ((openType: InteractionType) => void | boolean | HTMLElement | null) | undefined;
|
|
517
|
+
/**
|
|
518
|
+
* Determines the element to focus when the popover is closed.
|
|
519
|
+
*
|
|
520
|
+
* - `false`: Do not move focus.
|
|
521
|
+
* - `true`: Move focus based on the default behavior (trigger or previously focused element).
|
|
522
|
+
* - `RefObject`: Move focus to the ref element.
|
|
523
|
+
* - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).
|
|
524
|
+
* Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.
|
|
525
|
+
*/
|
|
526
|
+
finalFocus?: boolean | React_2.RefObject<HTMLElement | null> | ((closeType: InteractionType) => void | boolean | HTMLElement | null) | undefined;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export declare interface PopoverPopupState {
|
|
530
|
+
/**
|
|
531
|
+
* Whether the popover is currently open.
|
|
532
|
+
*/
|
|
533
|
+
open: boolean;
|
|
534
|
+
/**
|
|
535
|
+
* The side of the anchor the component is placed on.
|
|
536
|
+
*/
|
|
537
|
+
side: Side;
|
|
538
|
+
/**
|
|
539
|
+
* The alignment of the component relative to the anchor.
|
|
540
|
+
*/
|
|
541
|
+
align: Align;
|
|
542
|
+
/**
|
|
543
|
+
* The transition status of the component.
|
|
544
|
+
*/
|
|
545
|
+
transitionStatus: TransitionStatus;
|
|
546
|
+
/**
|
|
547
|
+
* Whether transitions should be skipped.
|
|
548
|
+
*/
|
|
549
|
+
instant: 'dismiss' | 'click' | 'focus' | 'trigger-change' | undefined;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* A portal element that moves the popup to a different part of the DOM.
|
|
554
|
+
* By default, the portal element is appended to `<body>`.
|
|
555
|
+
* Renders a `<div>` element.
|
|
556
|
+
*
|
|
557
|
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
|
558
|
+
*/
|
|
559
|
+
export declare const PopoverPortal: React_2.ForwardRefExoticComponent<Omit<PopoverPortalProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
560
|
+
|
|
561
|
+
export declare namespace PopoverPortal {
|
|
562
|
+
export type State = PopoverPortalState;
|
|
563
|
+
export type Props = PopoverPortalProps;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export declare interface PopoverPortalProps extends FloatingPortal.Props<PopoverPortalState> {
|
|
567
|
+
/**
|
|
568
|
+
* Whether to keep the portal mounted in the DOM while the popup is hidden.
|
|
569
|
+
* @default false
|
|
570
|
+
*/
|
|
571
|
+
keepMounted?: boolean | undefined;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export declare interface PopoverPortalState {}
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Positions the popover against the trigger.
|
|
578
|
+
* Renders a `<div>` element.
|
|
579
|
+
*
|
|
580
|
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
|
581
|
+
*/
|
|
582
|
+
export declare const PopoverPositioner: React_2.ForwardRefExoticComponent<Omit<PopoverPositionerProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
583
|
+
|
|
584
|
+
export declare namespace PopoverPositioner {
|
|
585
|
+
export type State = PopoverPositionerState;
|
|
586
|
+
export type Props = PopoverPositionerProps;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
export declare interface PopoverPositionerProps extends UseAnchorPositioningSharedParameters, BaseUIComponentProps<'div', PopoverPositionerState> {}
|
|
590
|
+
|
|
591
|
+
export declare interface PopoverPositionerState {
|
|
592
|
+
/**
|
|
593
|
+
* Whether the popover is currently open.
|
|
594
|
+
*/
|
|
595
|
+
open: boolean;
|
|
596
|
+
/**
|
|
597
|
+
* The side of the anchor the component is placed on.
|
|
598
|
+
*/
|
|
599
|
+
side: Side;
|
|
600
|
+
/**
|
|
601
|
+
* The alignment of the component relative to the anchor.
|
|
602
|
+
*/
|
|
603
|
+
align: Align;
|
|
604
|
+
/**
|
|
605
|
+
* Whether the anchor element is hidden.
|
|
606
|
+
*/
|
|
607
|
+
anchorHidden: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Whether CSS transitions should be disabled.
|
|
610
|
+
*/
|
|
611
|
+
instant: string | undefined;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Groups all parts of the popover.
|
|
616
|
+
* Doesn't render its own HTML element.
|
|
617
|
+
*
|
|
618
|
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
|
619
|
+
*/
|
|
620
|
+
export declare function PopoverRoot<Payload = unknown>(props: PopoverRoot.Props<Payload>): JSX_2.Element;
|
|
621
|
+
|
|
622
|
+
export declare namespace PopoverRoot {
|
|
623
|
+
export type State = PopoverRootState;
|
|
624
|
+
export type Props<Payload = unknown> = PopoverRootProps<Payload>;
|
|
625
|
+
export type Actions = PopoverRootActions;
|
|
626
|
+
export type ChangeEventReason = PopoverRootChangeEventReason;
|
|
627
|
+
export type ChangeEventDetails = PopoverRootChangeEventDetails;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
export declare interface PopoverRootActions {
|
|
631
|
+
unmount: () => void;
|
|
632
|
+
close: () => void;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
export declare type PopoverRootChangeEventDetails = BaseUIChangeEventDetails<PopoverRoot.ChangeEventReason> & {
|
|
636
|
+
preventUnmountOnClose(): void;
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
export declare type PopoverRootChangeEventReason = typeof REASONS.triggerHover | typeof REASONS.triggerFocus | typeof REASONS.triggerPress | typeof REASONS.outsidePress | typeof REASONS.escapeKey | typeof REASONS.closePress | typeof REASONS.focusOut | typeof REASONS.imperativeAction | typeof REASONS.none;
|
|
640
|
+
|
|
641
|
+
export declare interface PopoverRootProps<Payload = unknown> {
|
|
642
|
+
/**
|
|
643
|
+
* Whether the popover is initially open.
|
|
644
|
+
*
|
|
645
|
+
* To render a controlled popover, use the `open` prop instead.
|
|
646
|
+
* @default false
|
|
647
|
+
*/
|
|
648
|
+
defaultOpen?: boolean | undefined;
|
|
649
|
+
/**
|
|
650
|
+
* Whether the popover is currently open.
|
|
651
|
+
*/
|
|
652
|
+
open?: boolean | undefined;
|
|
653
|
+
/**
|
|
654
|
+
* Event handler called when the popover is opened or closed.
|
|
655
|
+
*/
|
|
656
|
+
onOpenChange?: ((open: boolean, eventDetails: PopoverRoot.ChangeEventDetails) => void) | undefined;
|
|
657
|
+
/**
|
|
658
|
+
* Event handler called after any animations complete when the popover is opened or closed.
|
|
659
|
+
*/
|
|
660
|
+
onOpenChangeComplete?: ((open: boolean) => void) | undefined;
|
|
661
|
+
/**
|
|
662
|
+
* A ref to imperative actions.
|
|
663
|
+
* - `unmount`: When specified, the popover will not be unmounted when closed.
|
|
664
|
+
* Instead, the `unmount` function must be called to unmount the popover manually.
|
|
665
|
+
* Useful when the popover's animation is controlled by an external library.
|
|
666
|
+
* - `close`: Closes the popover imperatively when called.
|
|
667
|
+
*/
|
|
668
|
+
actionsRef?: React_2.RefObject<PopoverRoot.Actions | null> | undefined;
|
|
669
|
+
/**
|
|
670
|
+
* Determines if the popover enters a modal state when open.
|
|
671
|
+
* - `true`: user interaction is limited to the popover: document page scroll is locked, and pointer interactions on outside elements are disabled.
|
|
672
|
+
* - `false`: user interaction with the rest of the document is allowed.
|
|
673
|
+
* - `'trap-focus'`: focus is trapped inside the popover, but document page scroll is not locked and pointer interactions outside of it remain enabled.
|
|
674
|
+
*
|
|
675
|
+
* When `modal` is `true`, focus trapping is enabled only if `<Popover.Close>` is rendered
|
|
676
|
+
* inside `<Popover.Popup>`. It can be visually hidden with your own CSS if needed, such as
|
|
677
|
+
* Tailwind's `sr-only` utility.
|
|
678
|
+
*
|
|
679
|
+
* When `modal` is `'trap-focus'`, render `<Popover.Close>` inside `<Popover.Popup>` so touch
|
|
680
|
+
* screen readers can escape the popup.
|
|
681
|
+
* @default false
|
|
682
|
+
*/
|
|
683
|
+
modal?: boolean | 'trap-focus' | undefined;
|
|
684
|
+
/**
|
|
685
|
+
* ID of the trigger that the popover is associated with.
|
|
686
|
+
* This is useful in conjunction with the `open` prop to create a controlled popover.
|
|
687
|
+
* There's no need to specify this prop when the popover is uncontrolled (that is, when the `open` prop is not set).
|
|
688
|
+
*/
|
|
689
|
+
triggerId?: string | null | undefined;
|
|
690
|
+
/**
|
|
691
|
+
* ID of the trigger that the popover is associated with.
|
|
692
|
+
* This is useful in conjunction with the `defaultOpen` prop to create an initially open popover.
|
|
693
|
+
*/
|
|
694
|
+
defaultTriggerId?: string | null | undefined;
|
|
695
|
+
/**
|
|
696
|
+
* A handle to associate the popover with a trigger.
|
|
697
|
+
* If specified, allows external triggers to control the popover's open state.
|
|
698
|
+
*/
|
|
699
|
+
handle?: PopoverHandle<Payload> | undefined;
|
|
700
|
+
/**
|
|
701
|
+
* The content of the popover.
|
|
702
|
+
* This can be a regular React node or a render function that receives the `payload` of the active trigger.
|
|
703
|
+
*/
|
|
704
|
+
children?: React_2.ReactNode | PayloadChildRenderFunction<Payload>;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export declare interface PopoverRootState {}
|
|
708
|
+
|
|
709
|
+
declare class PopoverStore<Payload> extends ReactStore<Readonly<State<Payload>>, Context, Selectors> {
|
|
710
|
+
constructor(initialState?: Partial<State<Payload>>, floatingId?: string | undefined, nested?: boolean);
|
|
711
|
+
setOpen: (nextOpen: boolean, eventDetails: Omit<PopoverRoot.ChangeEventDetails, "preventUnmountOnClose">) => void;
|
|
712
|
+
static useStore<Payload>(externalStore: PopoverStore<Payload> | undefined, initialState: Partial<State<Payload>>): PopoverStore<Payload>;
|
|
713
|
+
private disposeEffect;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* A heading that labels the popover.
|
|
718
|
+
* Renders an `<h2>` element.
|
|
719
|
+
*
|
|
720
|
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
|
721
|
+
*/
|
|
722
|
+
export declare const PopoverTitle: React_2.ForwardRefExoticComponent<Omit<PopoverTitleProps, "ref"> & React_2.RefAttributes<HTMLHeadingElement>>;
|
|
723
|
+
|
|
724
|
+
export declare namespace PopoverTitle {
|
|
725
|
+
export type State = PopoverTitleState;
|
|
726
|
+
export type Props = PopoverTitleProps;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
export declare interface PopoverTitleProps extends BaseUIComponentProps<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6', PopoverTitleState> {}
|
|
730
|
+
|
|
731
|
+
export declare interface PopoverTitleState {}
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* A button that opens the popover.
|
|
735
|
+
* Renders a `<button>` element.
|
|
736
|
+
*
|
|
737
|
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
|
738
|
+
*/
|
|
739
|
+
export declare const PopoverTrigger: PopoverTrigger;
|
|
740
|
+
|
|
741
|
+
export declare interface PopoverTrigger {
|
|
742
|
+
<Payload>(componentProps: PopoverTriggerProps<Payload> & React_2.RefAttributes<HTMLElement>): React_2.JSX.Element;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
export declare namespace PopoverTrigger {
|
|
746
|
+
export type State = PopoverTriggerState;
|
|
747
|
+
export type Props<Payload = unknown> = PopoverTriggerProps<Payload>;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
export declare type PopoverTriggerProps<Payload = unknown> = NativeButtonProps & BaseUIComponentProps<'button', PopoverTriggerState> & {
|
|
751
|
+
/**
|
|
752
|
+
* Whether the component renders a native `<button>` element when replacing it
|
|
753
|
+
* via the `render` prop.
|
|
754
|
+
* Set to `false` if the rendered element is not a button (e.g. `<div>`).
|
|
755
|
+
* @default true
|
|
756
|
+
*/
|
|
757
|
+
nativeButton?: boolean | undefined;
|
|
758
|
+
/**
|
|
759
|
+
* A handle to associate the trigger with a popover.
|
|
760
|
+
*/
|
|
761
|
+
handle?: PopoverHandle<Payload> | undefined;
|
|
762
|
+
/**
|
|
763
|
+
* A payload to pass to the popover when it is opened.
|
|
764
|
+
*/
|
|
765
|
+
payload?: Payload | undefined;
|
|
766
|
+
/**
|
|
767
|
+
* ID of the trigger. In addition to being forwarded to the rendered element,
|
|
768
|
+
* it is also used to specify the active trigger for the popover in controlled mode (with the PopoverRoot `triggerId` prop).
|
|
769
|
+
*/
|
|
770
|
+
id?: string | undefined;
|
|
771
|
+
/**
|
|
772
|
+
* Whether the popover should also open when the trigger is hovered.
|
|
773
|
+
* @default false
|
|
774
|
+
*/
|
|
775
|
+
openOnHover?: boolean | undefined;
|
|
776
|
+
/**
|
|
777
|
+
* How long to wait before the popover may be opened on hover. Specified in milliseconds.
|
|
778
|
+
*
|
|
779
|
+
* Requires the `openOnHover` prop.
|
|
780
|
+
* @default 300
|
|
781
|
+
*/
|
|
782
|
+
delay?: number | undefined;
|
|
783
|
+
/**
|
|
784
|
+
* How long to wait before closing the popover that was opened on hover.
|
|
785
|
+
* Specified in milliseconds.
|
|
786
|
+
*
|
|
787
|
+
* Requires the `openOnHover` prop.
|
|
788
|
+
* @default 0
|
|
789
|
+
*/
|
|
790
|
+
closeDelay?: number | undefined;
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
export declare interface PopoverTriggerState {
|
|
794
|
+
/**
|
|
795
|
+
* Whether the popover is currently disabled.
|
|
796
|
+
*/
|
|
797
|
+
disabled: boolean;
|
|
798
|
+
/**
|
|
799
|
+
* Whether the popover is currently open.
|
|
800
|
+
*/
|
|
801
|
+
open: boolean;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* A viewport for displaying content transitions.
|
|
806
|
+
* This component is only required if one popup can be opened by multiple triggers, its content
|
|
807
|
+
* changes based on the trigger, and switching between them is animated.
|
|
808
|
+
* Renders a `<div>` element.
|
|
809
|
+
*
|
|
810
|
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
|
811
|
+
*/
|
|
812
|
+
export declare const PopoverViewport: React_2.ForwardRefExoticComponent<Omit<PopoverViewport.Props, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
813
|
+
|
|
814
|
+
export declare namespace PopoverViewport {
|
|
815
|
+
export interface Props extends BaseUIComponentProps<'div', PopoverViewportState> {
|
|
816
|
+
/**
|
|
817
|
+
* The content to render inside the transition container.
|
|
818
|
+
*/
|
|
819
|
+
children?: React_2.ReactNode;
|
|
820
|
+
}
|
|
821
|
+
export type State = PopoverViewportState;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
export declare interface PopoverViewportState {
|
|
825
|
+
/**
|
|
826
|
+
* The activation direction of the transitioned content.
|
|
827
|
+
*/
|
|
828
|
+
activationDirection: string | undefined;
|
|
829
|
+
/**
|
|
830
|
+
* Whether the viewport is currently transitioning between contents.
|
|
831
|
+
*/
|
|
832
|
+
transitioning: boolean;
|
|
833
|
+
/**
|
|
834
|
+
* Present if animations should be instant.
|
|
835
|
+
*/
|
|
836
|
+
instant: 'dismiss' | 'click' | 'focus' | 'trigger-change' | undefined;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
declare type PopupStoreContext<ChangeEventDetails> = {
|
|
840
|
+
/**
|
|
841
|
+
* Map of registered trigger elements.
|
|
842
|
+
*/
|
|
843
|
+
readonly triggerElements: PopupTriggerMap;
|
|
844
|
+
/**
|
|
845
|
+
* Reference to the popup element.
|
|
846
|
+
*/
|
|
847
|
+
readonly popupRef: React.RefObject<HTMLElement | null>;
|
|
848
|
+
/**
|
|
849
|
+
* Callback fired when the open state changes.
|
|
850
|
+
*/
|
|
851
|
+
onOpenChange?: ((open: boolean, eventDetails: ChangeEventDetails) => void) | undefined;
|
|
852
|
+
/**
|
|
853
|
+
* Callback fired when the open state change animation completes.
|
|
854
|
+
*/
|
|
855
|
+
onOpenChangeComplete: ((open: boolean) => void) | undefined;
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* State common to all popup stores.
|
|
860
|
+
*/
|
|
861
|
+
declare type PopupStoreState<Payload> = {
|
|
862
|
+
/**
|
|
863
|
+
* Whether the popup is open (internal state).
|
|
864
|
+
*/
|
|
865
|
+
open: boolean;
|
|
866
|
+
/**
|
|
867
|
+
* Whether the popup is open (external prop).
|
|
868
|
+
*/
|
|
869
|
+
readonly openProp: boolean | undefined;
|
|
870
|
+
/**
|
|
871
|
+
* Whether the popup should be mounted in the DOM.
|
|
872
|
+
* This usually follows `open` but can be different during exit transitions.
|
|
873
|
+
*/
|
|
874
|
+
mounted: boolean;
|
|
875
|
+
/**
|
|
876
|
+
* The current enter/exit transition status of the popup.
|
|
877
|
+
*/
|
|
878
|
+
transitionStatus: TransitionStatus;
|
|
879
|
+
floatingRootContext: FloatingRootContext;
|
|
880
|
+
floatingId: string | undefined;
|
|
881
|
+
/**
|
|
882
|
+
* Number of trigger elements currently registered for this popup.
|
|
883
|
+
*/
|
|
884
|
+
triggerCount: number;
|
|
885
|
+
/**
|
|
886
|
+
* Whether to prevent unmounting the popup when closed.
|
|
887
|
+
* Useful for interacting with JS animation libraries that control unmounting themselves.
|
|
888
|
+
*/
|
|
889
|
+
preventUnmountingOnClose: boolean;
|
|
890
|
+
/**
|
|
891
|
+
* Optional payload set by the trigger.
|
|
892
|
+
*/
|
|
893
|
+
payload: Payload | undefined;
|
|
894
|
+
/**
|
|
895
|
+
* ID of the currently active trigger.
|
|
896
|
+
*/
|
|
897
|
+
activeTriggerId: string | null;
|
|
898
|
+
/**
|
|
899
|
+
* The currently active trigger DOM element.
|
|
900
|
+
*/
|
|
901
|
+
activeTriggerElement: Element | null;
|
|
902
|
+
/**
|
|
903
|
+
* ID of the trigger (external prop).
|
|
904
|
+
*/
|
|
905
|
+
readonly triggerIdProp: string | null | undefined;
|
|
906
|
+
/**
|
|
907
|
+
* The popup DOM element.
|
|
908
|
+
*/
|
|
909
|
+
popupElement: HTMLElement | null;
|
|
910
|
+
/**
|
|
911
|
+
* The positioner DOM element.
|
|
912
|
+
*/
|
|
913
|
+
positionerElement: HTMLElement | null;
|
|
914
|
+
/**
|
|
915
|
+
* Props to spread onto the active trigger element.
|
|
916
|
+
*/
|
|
917
|
+
activeTriggerProps: HTMLProps;
|
|
918
|
+
/**
|
|
919
|
+
* Props to spread onto inactive trigger elements.
|
|
920
|
+
*/
|
|
921
|
+
inactiveTriggerProps: HTMLProps;
|
|
922
|
+
/**
|
|
923
|
+
* Props to spread onto the popup element.
|
|
924
|
+
*/
|
|
925
|
+
popupProps: HTMLProps;
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* Data structure to keep track of popup trigger elements by their IDs.
|
|
930
|
+
* Uses both a set of Elements and a map of IDs to Elements for efficient lookups.
|
|
931
|
+
*/
|
|
932
|
+
declare class PopupTriggerMap {
|
|
933
|
+
private elementsSet;
|
|
934
|
+
private idMap;
|
|
935
|
+
constructor();
|
|
936
|
+
/**
|
|
937
|
+
* Adds a trigger element with the given ID.
|
|
938
|
+
*
|
|
939
|
+
* Note: The provided element is assumed to not be registered under multiple IDs.
|
|
940
|
+
*/
|
|
941
|
+
add(id: string, element: Element): void;
|
|
942
|
+
/**
|
|
943
|
+
* Removes the trigger element with the given ID.
|
|
944
|
+
*/
|
|
945
|
+
delete(id: string): void;
|
|
946
|
+
/**
|
|
947
|
+
* Whether the given element is registered as a trigger.
|
|
948
|
+
*/
|
|
949
|
+
hasElement(element: Element): boolean;
|
|
950
|
+
/**
|
|
951
|
+
* Whether there is a registered trigger element matching the given predicate.
|
|
952
|
+
*/
|
|
953
|
+
hasMatchingElement(predicate: (el: Element) => boolean): boolean;
|
|
954
|
+
/**
|
|
955
|
+
* Returns the trigger element associated with the given ID, or undefined if no such element exists.
|
|
956
|
+
*/
|
|
957
|
+
getById(id: string): Element | undefined;
|
|
958
|
+
/**
|
|
959
|
+
* Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
|
|
960
|
+
*/
|
|
961
|
+
entries(): IterableIterator<[string, Element]>;
|
|
962
|
+
/**
|
|
963
|
+
* Returns an iterable of all registered trigger elements.
|
|
964
|
+
*/
|
|
965
|
+
elements(): IterableIterator<Element>;
|
|
966
|
+
/**
|
|
967
|
+
* Returns the number of registered trigger elements.
|
|
968
|
+
*/
|
|
969
|
+
get size(): number;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
declare namespace REASONS {
|
|
973
|
+
export {
|
|
974
|
+
none,
|
|
975
|
+
triggerPress,
|
|
976
|
+
triggerHover,
|
|
977
|
+
triggerFocus,
|
|
978
|
+
outsidePress,
|
|
979
|
+
itemPress,
|
|
980
|
+
closePress,
|
|
981
|
+
linkPress,
|
|
982
|
+
clearPress,
|
|
983
|
+
chipRemovePress,
|
|
984
|
+
trackPress,
|
|
985
|
+
incrementPress,
|
|
986
|
+
decrementPress,
|
|
987
|
+
inputChange,
|
|
988
|
+
inputClear,
|
|
989
|
+
inputBlur,
|
|
990
|
+
inputPaste,
|
|
991
|
+
inputPress,
|
|
992
|
+
focusOut,
|
|
993
|
+
escapeKey,
|
|
994
|
+
closeWatcher,
|
|
995
|
+
listNavigation,
|
|
996
|
+
keyboard,
|
|
997
|
+
pointer,
|
|
998
|
+
drag,
|
|
999
|
+
wheel,
|
|
1000
|
+
scrub,
|
|
1001
|
+
cancelOpen,
|
|
1002
|
+
siblingOpen,
|
|
1003
|
+
disabled,
|
|
1004
|
+
missing,
|
|
1005
|
+
initial,
|
|
1006
|
+
imperativeAction,
|
|
1007
|
+
swipe,
|
|
1008
|
+
windowResize
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* Maps a change `reason` string to the corresponding native event type.
|
|
1014
|
+
*/
|
|
1015
|
+
declare type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
|
|
1016
|
+
|
|
1017
|
+
declare interface ReasonToEventMap {
|
|
1018
|
+
[REASONS.none]: Event;
|
|
1019
|
+
[REASONS.triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
1020
|
+
[REASONS.triggerHover]: MouseEvent;
|
|
1021
|
+
[REASONS.triggerFocus]: FocusEvent;
|
|
1022
|
+
[REASONS.outsidePress]: MouseEvent | PointerEvent | TouchEvent;
|
|
1023
|
+
[REASONS.itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
1024
|
+
[REASONS.closePress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
1025
|
+
[REASONS.linkPress]: MouseEvent | PointerEvent;
|
|
1026
|
+
[REASONS.clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
1027
|
+
[REASONS.chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
1028
|
+
[REASONS.trackPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
1029
|
+
[REASONS.incrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
1030
|
+
[REASONS.decrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
1031
|
+
[REASONS.inputChange]: InputEvent | Event;
|
|
1032
|
+
[REASONS.inputClear]: InputEvent | FocusEvent | Event;
|
|
1033
|
+
[REASONS.inputBlur]: FocusEvent;
|
|
1034
|
+
[REASONS.inputPaste]: ClipboardEvent;
|
|
1035
|
+
[REASONS.inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
1036
|
+
[REASONS.focusOut]: FocusEvent | KeyboardEvent;
|
|
1037
|
+
[REASONS.escapeKey]: KeyboardEvent;
|
|
1038
|
+
[REASONS.closeWatcher]: Event;
|
|
1039
|
+
[REASONS.listNavigation]: KeyboardEvent;
|
|
1040
|
+
[REASONS.keyboard]: KeyboardEvent;
|
|
1041
|
+
[REASONS.pointer]: PointerEvent;
|
|
1042
|
+
[REASONS.drag]: PointerEvent | TouchEvent;
|
|
1043
|
+
[REASONS.swipe]: PointerEvent | TouchEvent;
|
|
1044
|
+
[REASONS.wheel]: WheelEvent;
|
|
1045
|
+
[REASONS.scrub]: PointerEvent;
|
|
1046
|
+
[REASONS.cancelOpen]: MouseEvent;
|
|
1047
|
+
[REASONS.siblingOpen]: Event;
|
|
1048
|
+
[REASONS.disabled]: Event;
|
|
1049
|
+
[REASONS.missing]: Event;
|
|
1050
|
+
[REASONS.initial]: Event;
|
|
1051
|
+
[REASONS.imperativeAction]: Event;
|
|
1052
|
+
[REASONS.windowResize]: UIEvent;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
declare type ReferenceType = Element | VirtualElement;
|
|
1056
|
+
|
|
1057
|
+
declare const scrub: "scrub";
|
|
1058
|
+
|
|
1059
|
+
declare type Selectors = typeof selectors_2;
|
|
1060
|
+
|
|
1061
|
+
declare const selectors: {
|
|
1062
|
+
open: (state: FloatingRootState) => boolean;
|
|
1063
|
+
transitionStatus: (state: FloatingRootState) => TransitionStatus;
|
|
1064
|
+
domReferenceElement: (state: FloatingRootState) => Element | null;
|
|
1065
|
+
referenceElement: (state: FloatingRootState) => ReferenceType | null;
|
|
1066
|
+
floatingElement: (state: FloatingRootState) => HTMLElement | null;
|
|
1067
|
+
floatingId: (state: FloatingRootState) => string | undefined;
|
|
1068
|
+
};
|
|
1069
|
+
|
|
1070
|
+
declare const selectors_2: {
|
|
1071
|
+
disabled: (state: State<unknown>) => boolean;
|
|
1072
|
+
instantType: (state: State<unknown>) => "click" | "focus" | "dismiss" | "trigger-change" | undefined;
|
|
1073
|
+
openMethod: (state: State<unknown>) => InteractionType | null;
|
|
1074
|
+
openChangeReason: (state: State<unknown>) => PopoverRootChangeEventReason_2 | null;
|
|
1075
|
+
modal: (state: State<unknown>) => boolean | "trap-focus";
|
|
1076
|
+
focusManagerModal: (state: State<unknown>) => boolean;
|
|
1077
|
+
stickIfOpen: (state: State<unknown>) => boolean;
|
|
1078
|
+
titleElementId: (state: State<unknown>) => string | undefined;
|
|
1079
|
+
descriptionElementId: (state: State<unknown>) => string | undefined;
|
|
1080
|
+
openOnHover: (state: State<unknown>) => boolean;
|
|
1081
|
+
closeDelay: (state: State<unknown>) => number;
|
|
1082
|
+
hasViewport: (state: State<unknown>) => boolean;
|
|
1083
|
+
open: (state: {
|
|
1084
|
+
open: boolean;
|
|
1085
|
+
readonly openProp: boolean | undefined;
|
|
1086
|
+
mounted: boolean;
|
|
1087
|
+
transitionStatus: TransitionStatus_2;
|
|
1088
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1089
|
+
floatingId: string | undefined;
|
|
1090
|
+
triggerCount: number;
|
|
1091
|
+
preventUnmountingOnClose: boolean;
|
|
1092
|
+
payload: unknown;
|
|
1093
|
+
activeTriggerId: string | null;
|
|
1094
|
+
activeTriggerElement: Element | null;
|
|
1095
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1096
|
+
popupElement: HTMLElement | null;
|
|
1097
|
+
positionerElement: HTMLElement | null;
|
|
1098
|
+
activeTriggerProps: HTMLProps_2;
|
|
1099
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1100
|
+
popupProps: HTMLProps_2;
|
|
1101
|
+
}) => boolean;
|
|
1102
|
+
mounted: (state: {
|
|
1103
|
+
open: boolean;
|
|
1104
|
+
readonly openProp: boolean | undefined;
|
|
1105
|
+
mounted: boolean;
|
|
1106
|
+
transitionStatus: TransitionStatus_2;
|
|
1107
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1108
|
+
floatingId: string | undefined;
|
|
1109
|
+
triggerCount: number;
|
|
1110
|
+
preventUnmountingOnClose: boolean;
|
|
1111
|
+
payload: unknown;
|
|
1112
|
+
activeTriggerId: string | null;
|
|
1113
|
+
activeTriggerElement: Element | null;
|
|
1114
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1115
|
+
popupElement: HTMLElement | null;
|
|
1116
|
+
positionerElement: HTMLElement | null;
|
|
1117
|
+
activeTriggerProps: HTMLProps_2;
|
|
1118
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1119
|
+
popupProps: HTMLProps_2;
|
|
1120
|
+
}) => boolean;
|
|
1121
|
+
transitionStatus: (state: {
|
|
1122
|
+
open: boolean;
|
|
1123
|
+
readonly openProp: boolean | undefined;
|
|
1124
|
+
mounted: boolean;
|
|
1125
|
+
transitionStatus: TransitionStatus_2;
|
|
1126
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1127
|
+
floatingId: string | undefined;
|
|
1128
|
+
triggerCount: number;
|
|
1129
|
+
preventUnmountingOnClose: boolean;
|
|
1130
|
+
payload: unknown;
|
|
1131
|
+
activeTriggerId: string | null;
|
|
1132
|
+
activeTriggerElement: Element | null;
|
|
1133
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1134
|
+
popupElement: HTMLElement | null;
|
|
1135
|
+
positionerElement: HTMLElement | null;
|
|
1136
|
+
activeTriggerProps: HTMLProps_2;
|
|
1137
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1138
|
+
popupProps: HTMLProps_2;
|
|
1139
|
+
}) => TransitionStatus_2;
|
|
1140
|
+
floatingRootContext: (state: {
|
|
1141
|
+
open: boolean;
|
|
1142
|
+
readonly openProp: boolean | undefined;
|
|
1143
|
+
mounted: boolean;
|
|
1144
|
+
transitionStatus: TransitionStatus_2;
|
|
1145
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1146
|
+
floatingId: string | undefined;
|
|
1147
|
+
triggerCount: number;
|
|
1148
|
+
preventUnmountingOnClose: boolean;
|
|
1149
|
+
payload: unknown;
|
|
1150
|
+
activeTriggerId: string | null;
|
|
1151
|
+
activeTriggerElement: Element | null;
|
|
1152
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1153
|
+
popupElement: HTMLElement | null;
|
|
1154
|
+
positionerElement: HTMLElement | null;
|
|
1155
|
+
activeTriggerProps: HTMLProps_2;
|
|
1156
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1157
|
+
popupProps: HTMLProps_2;
|
|
1158
|
+
}) => FloatingRootStore_2;
|
|
1159
|
+
triggerCount: (state: {
|
|
1160
|
+
open: boolean;
|
|
1161
|
+
readonly openProp: boolean | undefined;
|
|
1162
|
+
mounted: boolean;
|
|
1163
|
+
transitionStatus: TransitionStatus_2;
|
|
1164
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1165
|
+
floatingId: string | undefined;
|
|
1166
|
+
triggerCount: number;
|
|
1167
|
+
preventUnmountingOnClose: boolean;
|
|
1168
|
+
payload: unknown;
|
|
1169
|
+
activeTriggerId: string | null;
|
|
1170
|
+
activeTriggerElement: Element | null;
|
|
1171
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1172
|
+
popupElement: HTMLElement | null;
|
|
1173
|
+
positionerElement: HTMLElement | null;
|
|
1174
|
+
activeTriggerProps: HTMLProps_2;
|
|
1175
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1176
|
+
popupProps: HTMLProps_2;
|
|
1177
|
+
}) => number;
|
|
1178
|
+
preventUnmountingOnClose: (state: {
|
|
1179
|
+
open: boolean;
|
|
1180
|
+
readonly openProp: boolean | undefined;
|
|
1181
|
+
mounted: boolean;
|
|
1182
|
+
transitionStatus: TransitionStatus_2;
|
|
1183
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1184
|
+
floatingId: string | undefined;
|
|
1185
|
+
triggerCount: number;
|
|
1186
|
+
preventUnmountingOnClose: boolean;
|
|
1187
|
+
payload: unknown;
|
|
1188
|
+
activeTriggerId: string | null;
|
|
1189
|
+
activeTriggerElement: Element | null;
|
|
1190
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1191
|
+
popupElement: HTMLElement | null;
|
|
1192
|
+
positionerElement: HTMLElement | null;
|
|
1193
|
+
activeTriggerProps: HTMLProps_2;
|
|
1194
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1195
|
+
popupProps: HTMLProps_2;
|
|
1196
|
+
}) => boolean;
|
|
1197
|
+
payload: (state: {
|
|
1198
|
+
open: boolean;
|
|
1199
|
+
readonly openProp: boolean | undefined;
|
|
1200
|
+
mounted: boolean;
|
|
1201
|
+
transitionStatus: TransitionStatus_2;
|
|
1202
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1203
|
+
floatingId: string | undefined;
|
|
1204
|
+
triggerCount: number;
|
|
1205
|
+
preventUnmountingOnClose: boolean;
|
|
1206
|
+
payload: unknown;
|
|
1207
|
+
activeTriggerId: string | null;
|
|
1208
|
+
activeTriggerElement: Element | null;
|
|
1209
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1210
|
+
popupElement: HTMLElement | null;
|
|
1211
|
+
positionerElement: HTMLElement | null;
|
|
1212
|
+
activeTriggerProps: HTMLProps_2;
|
|
1213
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1214
|
+
popupProps: HTMLProps_2;
|
|
1215
|
+
}) => unknown;
|
|
1216
|
+
activeTriggerId: (state: {
|
|
1217
|
+
open: boolean;
|
|
1218
|
+
readonly openProp: boolean | undefined;
|
|
1219
|
+
mounted: boolean;
|
|
1220
|
+
transitionStatus: TransitionStatus_2;
|
|
1221
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1222
|
+
floatingId: string | undefined;
|
|
1223
|
+
triggerCount: number;
|
|
1224
|
+
preventUnmountingOnClose: boolean;
|
|
1225
|
+
payload: unknown;
|
|
1226
|
+
activeTriggerId: string | null;
|
|
1227
|
+
activeTriggerElement: Element | null;
|
|
1228
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1229
|
+
popupElement: HTMLElement | null;
|
|
1230
|
+
positionerElement: HTMLElement | null;
|
|
1231
|
+
activeTriggerProps: HTMLProps_2;
|
|
1232
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1233
|
+
popupProps: HTMLProps_2;
|
|
1234
|
+
}) => string | null;
|
|
1235
|
+
activeTriggerElement: (state: {
|
|
1236
|
+
open: boolean;
|
|
1237
|
+
readonly openProp: boolean | undefined;
|
|
1238
|
+
mounted: boolean;
|
|
1239
|
+
transitionStatus: TransitionStatus_2;
|
|
1240
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1241
|
+
floatingId: string | undefined;
|
|
1242
|
+
triggerCount: number;
|
|
1243
|
+
preventUnmountingOnClose: boolean;
|
|
1244
|
+
payload: unknown;
|
|
1245
|
+
activeTriggerId: string | null;
|
|
1246
|
+
activeTriggerElement: Element | null;
|
|
1247
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1248
|
+
popupElement: HTMLElement | null;
|
|
1249
|
+
positionerElement: HTMLElement | null;
|
|
1250
|
+
activeTriggerProps: HTMLProps_2;
|
|
1251
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1252
|
+
popupProps: HTMLProps_2;
|
|
1253
|
+
}) => Element | null;
|
|
1254
|
+
popupId: (state: {
|
|
1255
|
+
open: boolean;
|
|
1256
|
+
readonly openProp: boolean | undefined;
|
|
1257
|
+
mounted: boolean;
|
|
1258
|
+
transitionStatus: TransitionStatus_2;
|
|
1259
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1260
|
+
floatingId: string | undefined;
|
|
1261
|
+
triggerCount: number;
|
|
1262
|
+
preventUnmountingOnClose: boolean;
|
|
1263
|
+
payload: unknown;
|
|
1264
|
+
activeTriggerId: string | null;
|
|
1265
|
+
activeTriggerElement: Element | null;
|
|
1266
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1267
|
+
popupElement: HTMLElement | null;
|
|
1268
|
+
positionerElement: HTMLElement | null;
|
|
1269
|
+
activeTriggerProps: HTMLProps_2;
|
|
1270
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1271
|
+
popupProps: HTMLProps_2;
|
|
1272
|
+
}) => string | undefined;
|
|
1273
|
+
isTriggerActive: (state: {
|
|
1274
|
+
open: boolean;
|
|
1275
|
+
readonly openProp: boolean | undefined;
|
|
1276
|
+
mounted: boolean;
|
|
1277
|
+
transitionStatus: TransitionStatus_2;
|
|
1278
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1279
|
+
floatingId: string | undefined;
|
|
1280
|
+
triggerCount: number;
|
|
1281
|
+
preventUnmountingOnClose: boolean;
|
|
1282
|
+
payload: unknown;
|
|
1283
|
+
activeTriggerId: string | null;
|
|
1284
|
+
activeTriggerElement: Element | null;
|
|
1285
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1286
|
+
popupElement: HTMLElement | null;
|
|
1287
|
+
positionerElement: HTMLElement | null;
|
|
1288
|
+
activeTriggerProps: HTMLProps_2;
|
|
1289
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1290
|
+
popupProps: HTMLProps_2;
|
|
1291
|
+
}, triggerId: string | undefined) => boolean;
|
|
1292
|
+
isOpenedByTrigger: (state: {
|
|
1293
|
+
open: boolean;
|
|
1294
|
+
readonly openProp: boolean | undefined;
|
|
1295
|
+
mounted: boolean;
|
|
1296
|
+
transitionStatus: TransitionStatus_2;
|
|
1297
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1298
|
+
floatingId: string | undefined;
|
|
1299
|
+
triggerCount: number;
|
|
1300
|
+
preventUnmountingOnClose: boolean;
|
|
1301
|
+
payload: unknown;
|
|
1302
|
+
activeTriggerId: string | null;
|
|
1303
|
+
activeTriggerElement: Element | null;
|
|
1304
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1305
|
+
popupElement: HTMLElement | null;
|
|
1306
|
+
positionerElement: HTMLElement | null;
|
|
1307
|
+
activeTriggerProps: HTMLProps_2;
|
|
1308
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1309
|
+
popupProps: HTMLProps_2;
|
|
1310
|
+
}, triggerId: string | undefined) => boolean;
|
|
1311
|
+
isMountedByTrigger: (state: {
|
|
1312
|
+
open: boolean;
|
|
1313
|
+
readonly openProp: boolean | undefined;
|
|
1314
|
+
mounted: boolean;
|
|
1315
|
+
transitionStatus: TransitionStatus_2;
|
|
1316
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1317
|
+
floatingId: string | undefined;
|
|
1318
|
+
triggerCount: number;
|
|
1319
|
+
preventUnmountingOnClose: boolean;
|
|
1320
|
+
payload: unknown;
|
|
1321
|
+
activeTriggerId: string | null;
|
|
1322
|
+
activeTriggerElement: Element | null;
|
|
1323
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1324
|
+
popupElement: HTMLElement | null;
|
|
1325
|
+
positionerElement: HTMLElement | null;
|
|
1326
|
+
activeTriggerProps: HTMLProps_2;
|
|
1327
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1328
|
+
popupProps: HTMLProps_2;
|
|
1329
|
+
}, triggerId: string | undefined) => boolean;
|
|
1330
|
+
triggerProps: (state: {
|
|
1331
|
+
open: boolean;
|
|
1332
|
+
readonly openProp: boolean | undefined;
|
|
1333
|
+
mounted: boolean;
|
|
1334
|
+
transitionStatus: TransitionStatus_2;
|
|
1335
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1336
|
+
floatingId: string | undefined;
|
|
1337
|
+
triggerCount: number;
|
|
1338
|
+
preventUnmountingOnClose: boolean;
|
|
1339
|
+
payload: unknown;
|
|
1340
|
+
activeTriggerId: string | null;
|
|
1341
|
+
activeTriggerElement: Element | null;
|
|
1342
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1343
|
+
popupElement: HTMLElement | null;
|
|
1344
|
+
positionerElement: HTMLElement | null;
|
|
1345
|
+
activeTriggerProps: HTMLProps_2;
|
|
1346
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1347
|
+
popupProps: HTMLProps_2;
|
|
1348
|
+
}, isActive: boolean) => HTMLProps_2;
|
|
1349
|
+
triggerPopupId: (state: {
|
|
1350
|
+
open: boolean;
|
|
1351
|
+
readonly openProp: boolean | undefined;
|
|
1352
|
+
mounted: boolean;
|
|
1353
|
+
transitionStatus: TransitionStatus_2;
|
|
1354
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1355
|
+
floatingId: string | undefined;
|
|
1356
|
+
triggerCount: number;
|
|
1357
|
+
preventUnmountingOnClose: boolean;
|
|
1358
|
+
payload: unknown;
|
|
1359
|
+
activeTriggerId: string | null;
|
|
1360
|
+
activeTriggerElement: Element | null;
|
|
1361
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1362
|
+
popupElement: HTMLElement | null;
|
|
1363
|
+
positionerElement: HTMLElement | null;
|
|
1364
|
+
activeTriggerProps: HTMLProps_2;
|
|
1365
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1366
|
+
popupProps: HTMLProps_2;
|
|
1367
|
+
}, triggerId: string | undefined) => string | undefined;
|
|
1368
|
+
popupProps: (state: {
|
|
1369
|
+
open: boolean;
|
|
1370
|
+
readonly openProp: boolean | undefined;
|
|
1371
|
+
mounted: boolean;
|
|
1372
|
+
transitionStatus: TransitionStatus_2;
|
|
1373
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1374
|
+
floatingId: string | undefined;
|
|
1375
|
+
triggerCount: number;
|
|
1376
|
+
preventUnmountingOnClose: boolean;
|
|
1377
|
+
payload: unknown;
|
|
1378
|
+
activeTriggerId: string | null;
|
|
1379
|
+
activeTriggerElement: Element | null;
|
|
1380
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1381
|
+
popupElement: HTMLElement | null;
|
|
1382
|
+
positionerElement: HTMLElement | null;
|
|
1383
|
+
activeTriggerProps: HTMLProps_2;
|
|
1384
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1385
|
+
popupProps: HTMLProps_2;
|
|
1386
|
+
}) => HTMLProps_2;
|
|
1387
|
+
popupElement: (state: {
|
|
1388
|
+
open: boolean;
|
|
1389
|
+
readonly openProp: boolean | undefined;
|
|
1390
|
+
mounted: boolean;
|
|
1391
|
+
transitionStatus: TransitionStatus_2;
|
|
1392
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1393
|
+
floatingId: string | undefined;
|
|
1394
|
+
triggerCount: number;
|
|
1395
|
+
preventUnmountingOnClose: boolean;
|
|
1396
|
+
payload: unknown;
|
|
1397
|
+
activeTriggerId: string | null;
|
|
1398
|
+
activeTriggerElement: Element | null;
|
|
1399
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1400
|
+
popupElement: HTMLElement | null;
|
|
1401
|
+
positionerElement: HTMLElement | null;
|
|
1402
|
+
activeTriggerProps: HTMLProps_2;
|
|
1403
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1404
|
+
popupProps: HTMLProps_2;
|
|
1405
|
+
}) => HTMLElement | null;
|
|
1406
|
+
positionerElement: (state: {
|
|
1407
|
+
open: boolean;
|
|
1408
|
+
readonly openProp: boolean | undefined;
|
|
1409
|
+
mounted: boolean;
|
|
1410
|
+
transitionStatus: TransitionStatus_2;
|
|
1411
|
+
floatingRootContext: FloatingRootContext_2;
|
|
1412
|
+
floatingId: string | undefined;
|
|
1413
|
+
triggerCount: number;
|
|
1414
|
+
preventUnmountingOnClose: boolean;
|
|
1415
|
+
payload: unknown;
|
|
1416
|
+
activeTriggerId: string | null;
|
|
1417
|
+
activeTriggerElement: Element | null;
|
|
1418
|
+
readonly triggerIdProp: string | null | undefined;
|
|
1419
|
+
popupElement: HTMLElement | null;
|
|
1420
|
+
positionerElement: HTMLElement | null;
|
|
1421
|
+
activeTriggerProps: HTMLProps_2;
|
|
1422
|
+
inactiveTriggerProps: HTMLProps_2;
|
|
1423
|
+
popupProps: HTMLProps_2;
|
|
1424
|
+
}) => HTMLElement | null;
|
|
1425
|
+
};
|
|
1426
|
+
|
|
1427
|
+
declare const siblingOpen: "sibling-open";
|
|
1428
|
+
|
|
1429
|
+
declare type Side = 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start';
|
|
1430
|
+
|
|
1431
|
+
declare interface SideFlipMode {
|
|
1432
|
+
/**
|
|
1433
|
+
* How to avoid collisions on the side axis.
|
|
1434
|
+
* - `'flip'`: If there is not enough space, place the popup on the opposite side.
|
|
1435
|
+
* - `'none'`: Keep the preferred side even if it overflows.
|
|
1436
|
+
*/
|
|
1437
|
+
side?: 'flip' | 'none' | undefined;
|
|
1438
|
+
/**
|
|
1439
|
+
* How to avoid collisions on the align axis.
|
|
1440
|
+
* - `'flip'`: If there is not enough space, swap `'start'` and `'end'` alignment.
|
|
1441
|
+
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
1442
|
+
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
1443
|
+
*/
|
|
1444
|
+
align?: 'flip' | 'shift' | 'none' | undefined;
|
|
1445
|
+
/**
|
|
1446
|
+
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
1447
|
+
* to a side on the perpendicular axis and which logical side to prefer.
|
|
1448
|
+
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
1449
|
+
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
1450
|
+
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
1451
|
+
*/
|
|
1452
|
+
fallbackAxisSide?: 'start' | 'end' | 'none' | undefined;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
declare interface SideShiftMode {
|
|
1456
|
+
/**
|
|
1457
|
+
* How to avoid collisions on the side axis.
|
|
1458
|
+
* - `'shift'`: Keep the preferred side and shift the popup to fit within the boundary.
|
|
1459
|
+
* - `'none'`: Keep the preferred side even if it overflows.
|
|
1460
|
+
*/
|
|
1461
|
+
side?: 'shift' | 'none' | undefined;
|
|
1462
|
+
/**
|
|
1463
|
+
* How to avoid collisions on the align axis.
|
|
1464
|
+
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
1465
|
+
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
1466
|
+
*/
|
|
1467
|
+
align?: 'shift' | 'none' | undefined;
|
|
1468
|
+
/**
|
|
1469
|
+
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
1470
|
+
* to a side on the perpendicular axis and which logical side to prefer.
|
|
1471
|
+
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
1472
|
+
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
1473
|
+
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
1474
|
+
*/
|
|
1475
|
+
fallbackAxisSide?: 'start' | 'end' | 'none' | undefined;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
declare type State<Payload> = PopupStoreState<Payload> & {
|
|
1479
|
+
disabled: boolean;
|
|
1480
|
+
instantType: 'dismiss' | 'click' | 'focus' | 'trigger-change' | undefined;
|
|
1481
|
+
modal: boolean | 'trap-focus';
|
|
1482
|
+
focusManagerModal: boolean;
|
|
1483
|
+
openMethod: InteractionType | null;
|
|
1484
|
+
openChangeReason: PopoverRoot.ChangeEventReason | null;
|
|
1485
|
+
stickIfOpen: boolean;
|
|
1486
|
+
nested: boolean;
|
|
1487
|
+
titleElementId: string | undefined;
|
|
1488
|
+
descriptionElementId: string | undefined;
|
|
1489
|
+
openOnHover: boolean;
|
|
1490
|
+
closeDelay: number;
|
|
1491
|
+
hasViewport: boolean;
|
|
1492
|
+
};
|
|
1493
|
+
|
|
1494
|
+
declare const swipe: "swipe";
|
|
1495
|
+
|
|
1496
|
+
declare const trackPress: "track-press";
|
|
1497
|
+
|
|
1498
|
+
declare type TransitionStatus = 'starting' | 'ending' | 'idle' | undefined;
|
|
1499
|
+
|
|
45
1500
|
declare function Trigger<Payload = unknown>({ className, ...props }: WithStringClassName<Popover_2.Trigger.Props<Payload>> & React_2.RefAttributes<HTMLElement>): JSX_2.Element;
|
|
46
1501
|
|
|
1502
|
+
declare const triggerFocus: "trigger-focus";
|
|
1503
|
+
|
|
1504
|
+
declare const triggerHover: "trigger-hover";
|
|
1505
|
+
|
|
1506
|
+
declare const triggerPress: "trigger-press";
|
|
1507
|
+
|
|
1508
|
+
declare interface UseAnchorPositioningSharedParameters {
|
|
1509
|
+
/**
|
|
1510
|
+
* An element to position the popup against.
|
|
1511
|
+
* By default, the popup will be positioned against the trigger.
|
|
1512
|
+
*/
|
|
1513
|
+
anchor?: Element | null | VirtualElement | React_2.RefObject<Element | null> | (() => Element | VirtualElement | null) | undefined;
|
|
1514
|
+
/**
|
|
1515
|
+
* Determines which CSS `position` property to use.
|
|
1516
|
+
* @default 'absolute'
|
|
1517
|
+
*/
|
|
1518
|
+
positionMethod?: 'absolute' | 'fixed' | undefined;
|
|
1519
|
+
/**
|
|
1520
|
+
* Which side of the anchor element to align the popup against.
|
|
1521
|
+
* May automatically change to avoid collisions.
|
|
1522
|
+
* @default 'bottom'
|
|
1523
|
+
*/
|
|
1524
|
+
side?: Side | undefined;
|
|
1525
|
+
/**
|
|
1526
|
+
* Distance between the anchor and the popup in pixels.
|
|
1527
|
+
* Also accepts a function that returns the distance to read the dimensions of the anchor
|
|
1528
|
+
* and positioner elements, along with its side and alignment.
|
|
1529
|
+
*
|
|
1530
|
+
* The function takes a `data` object parameter with the following properties:
|
|
1531
|
+
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
1532
|
+
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
1533
|
+
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
1534
|
+
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
1535
|
+
*
|
|
1536
|
+
* @example
|
|
1537
|
+
* ```jsx
|
|
1538
|
+
* <Positioner
|
|
1539
|
+
* sideOffset={({ side, align, anchor, positioner }) => {
|
|
1540
|
+
* return side === 'top' || side === 'bottom'
|
|
1541
|
+
* ? anchor.height
|
|
1542
|
+
* : anchor.width;
|
|
1543
|
+
* }}
|
|
1544
|
+
* />
|
|
1545
|
+
* ```
|
|
1546
|
+
*
|
|
1547
|
+
* @default 0
|
|
1548
|
+
*/
|
|
1549
|
+
sideOffset?: number | OffsetFunction | undefined;
|
|
1550
|
+
/**
|
|
1551
|
+
* How to align the popup relative to the specified side.
|
|
1552
|
+
* @default 'center'
|
|
1553
|
+
*/
|
|
1554
|
+
align?: Align | undefined;
|
|
1555
|
+
/**
|
|
1556
|
+
* Additional offset along the alignment axis in pixels.
|
|
1557
|
+
* Also accepts a function that returns the offset to read the dimensions of the anchor
|
|
1558
|
+
* and positioner elements, along with its side and alignment.
|
|
1559
|
+
*
|
|
1560
|
+
* The function takes a `data` object parameter with the following properties:
|
|
1561
|
+
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
1562
|
+
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
1563
|
+
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
1564
|
+
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
1565
|
+
*
|
|
1566
|
+
* @example
|
|
1567
|
+
* ```jsx
|
|
1568
|
+
* <Positioner
|
|
1569
|
+
* alignOffset={({ side, align, anchor, positioner }) => {
|
|
1570
|
+
* return side === 'top' || side === 'bottom'
|
|
1571
|
+
* ? anchor.width
|
|
1572
|
+
* : anchor.height;
|
|
1573
|
+
* }}
|
|
1574
|
+
* />
|
|
1575
|
+
* ```
|
|
1576
|
+
*
|
|
1577
|
+
* @default 0
|
|
1578
|
+
*/
|
|
1579
|
+
alignOffset?: number | OffsetFunction | undefined;
|
|
1580
|
+
/**
|
|
1581
|
+
* An element or a rectangle that delimits the area that the popup is confined to.
|
|
1582
|
+
* @default 'clipping-ancestors'
|
|
1583
|
+
*/
|
|
1584
|
+
collisionBoundary?: Boundary | undefined;
|
|
1585
|
+
/**
|
|
1586
|
+
* Additional space to maintain from the edge of the collision boundary.
|
|
1587
|
+
* @default 5
|
|
1588
|
+
*/
|
|
1589
|
+
collisionPadding?: Padding | undefined;
|
|
1590
|
+
/**
|
|
1591
|
+
* Whether to maintain the popup in the viewport after
|
|
1592
|
+
* the anchor element was scrolled out of view.
|
|
1593
|
+
* @default false
|
|
1594
|
+
*/
|
|
1595
|
+
sticky?: boolean | undefined;
|
|
1596
|
+
/**
|
|
1597
|
+
* Minimum distance to maintain between the arrow and the edges of the popup.
|
|
1598
|
+
*
|
|
1599
|
+
* Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
|
|
1600
|
+
* @default 5
|
|
1601
|
+
*/
|
|
1602
|
+
arrowPadding?: number | undefined;
|
|
1603
|
+
/**
|
|
1604
|
+
* Whether to disable the popup from tracking any layout shift of its positioning anchor.
|
|
1605
|
+
* @default false
|
|
1606
|
+
*/
|
|
1607
|
+
disableAnchorTracking?: boolean | undefined;
|
|
1608
|
+
/**
|
|
1609
|
+
* Determines how to handle collisions when positioning the popup.
|
|
1610
|
+
*
|
|
1611
|
+
* `side` controls overflow on the preferred placement axis (`top`/`bottom` or `left`/`right`):
|
|
1612
|
+
* - `'flip'`: keep the requested side when it fits; otherwise try the opposite side
|
|
1613
|
+
* (`top` and `bottom`, or `left` and `right`).
|
|
1614
|
+
* - `'shift'`: never change side; keep the requested side and move the popup within
|
|
1615
|
+
* the clipping boundary so it stays visible.
|
|
1616
|
+
* - `'none'`: do not correct side-axis overflow.
|
|
1617
|
+
*
|
|
1618
|
+
* `align` controls overflow on the alignment axis (`start`/`center`/`end`):
|
|
1619
|
+
* - `'flip'`: keep side, but swap `start` and `end` when the requested alignment overflows.
|
|
1620
|
+
* - `'shift'`: keep side and requested alignment, then nudge the popup along the
|
|
1621
|
+
* alignment axis to fit.
|
|
1622
|
+
* - `'none'`: do not correct alignment-axis overflow.
|
|
1623
|
+
*
|
|
1624
|
+
* `fallbackAxisSide` controls fallback behavior on the perpendicular axis when the
|
|
1625
|
+
* preferred axis cannot fit:
|
|
1626
|
+
* - `'start'`: allow perpendicular fallback and try the logical start side first
|
|
1627
|
+
* (`top` before `bottom`, or `left` before `right` in LTR).
|
|
1628
|
+
* - `'end'`: allow perpendicular fallback and try the logical end side first
|
|
1629
|
+
* (`bottom` before `top`, or `right` before `left` in LTR).
|
|
1630
|
+
* - `'none'`: do not fallback to the perpendicular axis.
|
|
1631
|
+
*
|
|
1632
|
+
* When `side` is `'shift'`, explicitly setting `align` only supports `'shift'` or `'none'`.
|
|
1633
|
+
* If `align` is omitted, it defaults to `'flip'`.
|
|
1634
|
+
*
|
|
1635
|
+
* @example
|
|
1636
|
+
* ```jsx
|
|
1637
|
+
* <Positioner
|
|
1638
|
+
* collisionAvoidance={{
|
|
1639
|
+
* side: 'shift',
|
|
1640
|
+
* align: 'shift',
|
|
1641
|
+
* fallbackAxisSide: 'none',
|
|
1642
|
+
* }}
|
|
1643
|
+
* />
|
|
1644
|
+
* ```
|
|
1645
|
+
*
|
|
1646
|
+
*/
|
|
1647
|
+
collisionAvoidance?: CollisionAvoidance | undefined;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
declare interface UseFloatingPortalNodeProps {
|
|
1651
|
+
ref?: React_2.Ref<HTMLDivElement> | undefined;
|
|
1652
|
+
container?: HTMLElement | ShadowRoot | null | React_2.RefObject<HTMLElement | ShadowRoot | null> | undefined;
|
|
1653
|
+
componentProps?: UseRenderElementComponentProps<any> | undefined;
|
|
1654
|
+
elementProps?: React_2.HTMLAttributes<HTMLDivElement> | undefined;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
declare interface UseRenderElementComponentProps<State> {
|
|
1658
|
+
/**
|
|
1659
|
+
* The class name to apply to the rendered element.
|
|
1660
|
+
* Can be a string or a function that accepts the state and returns a string.
|
|
1661
|
+
*/
|
|
1662
|
+
className?: string | ((state: State) => string | undefined) | undefined;
|
|
1663
|
+
/**
|
|
1664
|
+
* The render prop or React element to override the default element.
|
|
1665
|
+
*/
|
|
1666
|
+
render?: undefined | React_2.ReactElement | ComponentRenderFn<React_2.HTMLAttributes<any>, State>;
|
|
1667
|
+
/**
|
|
1668
|
+
* The style to apply to the rendered element.
|
|
1669
|
+
* Can be a style object or a function that accepts the state and returns a style object.
|
|
1670
|
+
*/
|
|
1671
|
+
style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
declare const wheel: "wheel";
|
|
1675
|
+
|
|
1676
|
+
declare const windowResize: "window-resize";
|
|
1677
|
+
|
|
1678
|
+
/**
|
|
1679
|
+
* Adds a `preventBaseUIHandler` method to all event handlers.
|
|
1680
|
+
*/
|
|
1681
|
+
declare type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K]> };
|
|
1682
|
+
|
|
1683
|
+
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;
|
|
1684
|
+
|
|
47
1685
|
declare type WithStringClassName<P> = Omit<P, 'className'> & {
|
|
48
1686
|
className?: string;
|
|
49
1687
|
};
|
|
50
1688
|
|
|
51
|
-
|
|
52
|
-
export * from "@base-ui/react/popover";
|
|
53
|
-
|
|
54
1689
|
export { }
|