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