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