UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

39 lines (38 loc) 1.44 kB
import type { HTMLProps, RefObject } from 'react'; import type { UseHeightAnimationOptions } from './useHeightAnimation'; import type { DynamicElement, SpacingProps } from '../../shared/types'; export type HeightAnimationProps = { /** * Whether the nested children content should be kept in the DOM or not. * Default: `false` */ keepInDOM?: boolean; /** * Set to `true` to omit the usage of "overflow: hidden;" * Default: `false` */ showOverflow?: boolean; /** * Custom duration of the animation in milliseconds. * Default: `400` */ duration?: number; /** * Custom delay of the animation in milliseconds. * Default: `0` */ delay?: number; /** * Define a custom HTML Element. * Default: `div` */ element?: DynamicElement; /** * Send along a custom React Ref. * Default: `null` */ ref?: RefObject<HTMLElement>; } & UseHeightAnimationOptions; export type HeightAnimationAllProps = HeightAnimationProps & SpacingProps & Omit<HTMLProps<HTMLElement>, 'ref' | 'onAnimationEnd' | 'onAnimationStart'>; declare function HeightAnimation({ open, animate, keepInDOM, showOverflow, element, duration, delay, className, ref, children, compensateForGap, onInit, onOpen, onAnimationStart, onAnimationEnd, ...rest }: HeightAnimationAllProps): import("react/jsx-runtime").JSX.Element; export default HeightAnimation;