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