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