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