@opencxh/ui-kit 3.177.0 → 3.178.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/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1131 -1124
- package/dist/index.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/utils/useAnchoredPosition.d.ts +8 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -72,4 +72,4 @@ export { type CatTone, catTone } from './utils/catTone';
|
|
|
72
72
|
export { cn, createSizes, createVariants } from './utils/cn';
|
|
73
73
|
export { IDENTITY_TONE_COUNT, type IdentityTone, identityDotClass, identityPlateClass, identityTone, } from './utils/identity';
|
|
74
74
|
export { normalizeText, text } from './utils/text';
|
|
75
|
-
export { type AnchoredPositionOptions, useAnchoredPosition, } from './utils/useAnchoredPosition';
|
|
75
|
+
export { type AnchoredPositionOptions, type AnchorRect, useAnchoredPosition, } from './utils/useAnchoredPosition';
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { CSSProperties, RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Anything that can report where it is. An element is the usual anchor, but a DOM `Range`
|
|
4
|
+
* qualifies too — which is how a panel anchors to the caret instead of to its whole field.
|
|
5
|
+
*/
|
|
6
|
+
export interface AnchorRect {
|
|
7
|
+
getBoundingClientRect(): DOMRect;
|
|
8
|
+
}
|
|
2
9
|
export interface AnchoredPositionOptions {
|
|
3
10
|
/** Gap between the anchor and the panel, in px. */
|
|
4
11
|
gap?: number;
|
|
@@ -19,4 +26,4 @@ export interface AnchoredPositionOptions {
|
|
|
19
26
|
* Recomputes on scroll and resize while open, so the panel tracks its trigger
|
|
20
27
|
* instead of detaching when the page moves under it.
|
|
21
28
|
*/
|
|
22
|
-
export declare function useAnchoredPosition(open: boolean, anchorRef: RefObject<
|
|
29
|
+
export declare function useAnchoredPosition(open: boolean, anchorRef: RefObject<AnchorRect | null>, { gap, matchWidth, placement }?: AnchoredPositionOptions): CSSProperties;
|