File size: 9,929 Bytes
0a0b223 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | import { AlignedPlacement } from '@floating-ui/dom';
import { Alignment } from '@floating-ui/dom';
import { AutoPlacementOptions } from '@floating-ui/dom';
import { autoUpdate } from '@floating-ui/dom';
import { AutoUpdateOptions } from '@floating-ui/dom';
import { Axis } from '@floating-ui/dom';
import { Boundary } from '@floating-ui/dom';
import { ClientRectObject } from '@floating-ui/dom';
import { computePosition } from '@floating-ui/dom';
import { ComputePositionConfig } from '@floating-ui/dom';
import { ComputePositionReturn } from '@floating-ui/dom';
import { Coords } from '@floating-ui/dom';
import { Derivable } from '@floating-ui/dom';
import { detectOverflow } from '@floating-ui/dom';
import { DetectOverflowOptions } from '@floating-ui/dom';
import { Dimensions } from '@floating-ui/dom';
import { ElementContext } from '@floating-ui/dom';
import { ElementRects } from '@floating-ui/dom';
import { Elements } from '@floating-ui/dom';
import { FlipOptions } from '@floating-ui/dom';
import { FloatingElement } from '@floating-ui/dom';
import { getOverflowAncestors } from '@floating-ui/dom';
import { HideOptions } from '@floating-ui/dom';
import { InlineOptions } from '@floating-ui/dom';
import { Length } from '@floating-ui/dom';
import { LimitShiftOptions } from '@floating-ui/dom';
import { Middleware } from '@floating-ui/dom';
import { MiddlewareArguments } from '@floating-ui/dom';
import { MiddlewareData } from '@floating-ui/dom';
import { MiddlewareReturn } from '@floating-ui/dom';
import { MiddlewareState } from '@floating-ui/dom';
import { NodeScroll } from '@floating-ui/dom';
import { OffsetOptions } from '@floating-ui/dom';
import { Padding } from '@floating-ui/dom';
import { Placement } from '@floating-ui/dom';
import { Platform } from '@floating-ui/dom';
import { platform } from '@floating-ui/dom';
import type * as React from 'react';
import { Rect } from '@floating-ui/dom';
import { ReferenceElement } from '@floating-ui/dom';
import { RootBoundary } from '@floating-ui/dom';
import { ShiftOptions } from '@floating-ui/dom';
import { Side } from '@floating-ui/dom';
import { SideObject } from '@floating-ui/dom';
import { SizeOptions } from '@floating-ui/dom';
import { Strategy } from '@floating-ui/dom';
import { VirtualElement } from '@floating-ui/dom';
export { AlignedPlacement }
export { Alignment }
/**
* Provides data to position an inner element of the floating element so that it
* appears centered to the reference element.
* This wraps the core `arrow` middleware to allow React refs as the element.
* @see https://floating-ui.com/docs/arrow
*/
export declare const arrow: (options: ArrowOptions | Derivable<ArrowOptions>, deps?: React.DependencyList) => Middleware;
export declare interface ArrowOptions {
/**
* The arrow element to be positioned.
* @default undefined
*/
element: React.MutableRefObject<Element | null> | Element | null;
/**
* The padding between the arrow element and the floating element edges.
* Useful when the floating element has rounded corners.
* @default 0
*/
padding?: Padding;
}
/**
* Optimizes the visibility of the floating element by choosing the placement
* that has the most space available automatically, without needing to specify a
* preferred placement. Alternative to `flip`.
* @see https://floating-ui.com/docs/autoPlacement
*/
export declare const autoPlacement: (options?: AutoPlacementOptions | Derivable<AutoPlacementOptions>, deps?: React.DependencyList) => Middleware;
export { AutoPlacementOptions }
export { autoUpdate }
export { AutoUpdateOptions }
export { Axis }
export { Boundary }
export { ClientRectObject }
export { computePosition }
export { ComputePositionConfig }
export { ComputePositionReturn }
export { Coords }
export { Derivable }
export { detectOverflow }
export { DetectOverflowOptions }
export { Dimensions }
export { ElementContext }
export { ElementRects }
export { Elements }
/**
* Optimizes the visibility of the floating element by flipping the `placement`
* in order to keep it in view when the preferred placement(s) will overflow the
* clipping boundary. Alternative to `autoPlacement`.
* @see https://floating-ui.com/docs/flip
*/
export declare const flip: (options?: FlipOptions | Derivable<FlipOptions>, deps?: React.DependencyList) => Middleware;
export { FlipOptions }
export { FloatingElement }
export { getOverflowAncestors }
/**
* Provides data to hide the floating element in applicable situations, such as
* when it is not in the same clipping context as the reference element.
* @see https://floating-ui.com/docs/hide
*/
export declare const hide: (options?: HideOptions | Derivable<HideOptions>, deps?: React.DependencyList) => Middleware;
export { HideOptions }
/**
* Provides improved positioning for inline reference elements that can span
* over multiple lines, such as hyperlinks or range selections.
* @see https://floating-ui.com/docs/inline
*/
export declare const inline: (options?: InlineOptions | Derivable<InlineOptions>, deps?: React.DependencyList) => Middleware;
export { InlineOptions }
export { Length }
/**
* Built-in `limiter` that will stop `shift()` at a certain point.
*/
export declare const limitShift: (options?: LimitShiftOptions | Derivable<LimitShiftOptions>, deps?: React.DependencyList) => {
fn: (state: MiddlewareState) => Coords;
options: any;
};
export { Middleware }
export { MiddlewareArguments }
export { MiddlewareData }
export { MiddlewareReturn }
export { MiddlewareState }
export { NodeScroll }
/**
* Modifies the placement by translating the floating element along the
* specified axes.
* A number (shorthand for `mainAxis` or distance), or an axes configuration
* object may be passed.
* @see https://floating-ui.com/docs/offset
*/
export declare const offset: (options?: OffsetOptions, deps?: React.DependencyList) => Middleware;
export { OffsetOptions }
export { Padding }
export { Placement }
export { Platform }
export { platform }
declare type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
export { Rect }
export { ReferenceElement }
export declare type ReferenceType = Element | VirtualElement;
export { RootBoundary }
/**
* Optimizes the visibility of the floating element by shifting it in order to
* keep it in view when it will overflow the clipping boundary.
* @see https://floating-ui.com/docs/shift
*/
export declare const shift: (options?: ShiftOptions | Derivable<ShiftOptions>, deps?: React.DependencyList) => Middleware;
export { ShiftOptions }
export { Side }
export { SideObject }
/**
* Provides data that allows you to change the size of the floating element —
* for instance, prevent it from overflowing the clipping boundary or match the
* width of the reference element.
* @see https://floating-ui.com/docs/size
*/
export declare const size: (options?: SizeOptions | Derivable<SizeOptions>, deps?: React.DependencyList) => Middleware;
export { SizeOptions }
export { Strategy }
/**
* Provides data to position a floating element.
* @see https://floating-ui.com/docs/useFloating
*/
export declare function useFloating<RT extends ReferenceType = ReferenceType>(options?: UseFloatingOptions): UseFloatingReturn<RT>;
export declare type UseFloatingData = Prettify<ComputePositionReturn & {
isPositioned: boolean;
}>;
export declare type UseFloatingOptions<RT extends ReferenceType = ReferenceType> = Prettify<Partial<ComputePositionConfig> & {
/**
* A callback invoked when both the reference and floating elements are
* mounted, and cleaned up when either is unmounted. This is useful for
* setting up event listeners (e.g. pass `autoUpdate`).
*/
whileElementsMounted?: (reference: RT, floating: HTMLElement, update: () => void) => () => void;
/**
* Object containing the reference and floating elements.
*/
elements?: {
reference?: RT | null;
floating?: HTMLElement | null;
};
/**
* The `open` state of the floating element to synchronize with the
* `isPositioned` value.
* @default false
*/
open?: boolean;
/**
* Whether to use `transform` for positioning instead of `top` and `left`
* (layout) in the `floatingStyles` object.
* @default false
*/
transform?: boolean;
}>;
export declare type UseFloatingReturn<RT extends ReferenceType = ReferenceType> = Prettify<UseFloatingData & {
/**
* Update the position of the floating element, re-rendering the component
* if required.
*/
update: () => void;
/**
* Pre-configured positioning styles to apply to the floating element.
*/
floatingStyles: React.CSSProperties;
/**
* Object containing the reference and floating refs and reactive setters.
*/
refs: {
/**
* A React ref to the reference element.
*/
reference: React.MutableRefObject<RT | null>;
/**
* A React ref to the floating element.
*/
floating: React.MutableRefObject<HTMLElement | null>;
/**
* A callback to set the reference element (reactive).
*/
setReference: (node: RT | null) => void;
/**
* A callback to set the floating element (reactive).
*/
setFloating: (node: HTMLElement | null) => void;
};
/**
* Object containing the reference and floating elements.
*/
elements: {
reference: RT | null;
floating: HTMLElement | null;
};
}>;
export { VirtualElement }
export { }
|