@codecademy/gamut
73.3.073.3.1-alpha.0e5de6.0
dist/PopoverContainer/types.d.ts~
dist/PopoverContainer/types.d.tsModified+7−7
Index: package/dist/PopoverContainer/types.d.ts
===================================================================
--- package/dist/PopoverContainer/types.d.ts
+++ package/dist/PopoverContainer/types.d.ts
@@ -1,26 +1,26 @@
import { RefObject } from 'react';
import { FocusTrapProps } from '../FocusTrap';
import { WithChildrenProp } from '../utils';
-export type Alignments = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top' | 'bottom' | 'left' | 'right';
+export type PopoverContainerAlignment = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top' | 'bottom' | 'left' | 'right';
export type TargetRef = Pick<HTMLDivElement, 'getBoundingClientRect' | 'contains' | 'offsetHeight' | 'offsetWidth' | 'offsetTop' | 'offsetLeft' | 'offsetParent'> & HTMLElement;
-export interface PositionContext {
+export interface PopoverPositionContext {
width: number;
height: number;
top: number;
left: number;
right: number;
bottom: number;
}
-export interface ContainerState {
- parent: PositionContext;
+export interface PopoverContainerState {
+ parent: PopoverPositionContext;
viewport: DOMRect;
}
export interface PopoverAlignment {
/**
* Which vertical edge of the source component to align against.
*/
- alignment?: Alignments;
+ alignment?: PopoverContainerAlignment;
/** Align to the inside edge of the target div */
invertAxis?: 'x' | 'y';
/** Whether the popover renders inside the current DOM context or escapes with a portal */
inline?: boolean;
@@ -37,10 +37,10 @@
*/
offset?: number;
}
export interface PopoverPositionConfig extends PopoverAlignment {
- container: PositionContext;
- alignment: Alignments;
+ container: PopoverPositionContext;
+ alignment: PopoverContainerAlignment;
}
export interface PopoverContainerProps extends PopoverAlignment, WithChildrenProp, Pick<FocusTrapProps, 'focusOnProps'> {
className?: string;
/**