import { type ReactElement } from "react"; import { type CSSTransitionComponentImplementation } from "./types.js"; import { type ScaleTransitionHookOptions } from "./useScaleTransition.js"; /** * @typeParam E - The HTMLElement type used or the ref required for the * transition. * @since 2.0.0 * @since 4.0.0 The typeParam was added * @since 6.0.0 Removed portal props */ export interface ScaleTransitionProps extends CSSTransitionComponentImplementation, ScaleTransitionHookOptions { } /** * **Client Component** * * A component implementation of the {@link useScaleTransition} hook that just * has some reasonable defaults and supports portalling the children. Since this * component uses the `React.cloneElement` to inject the `ref` and `className` * into the `children`, it is recommended to use the hook instead. * * @example Dropdown Menu Example * ```tsx * import { ReactElement, useRef, useState } from "react"; * import { Button } from "@react-md/core/button/Button"; * import { useFixedPositioning } from "@react-md/core/positioning/useFixedPositioning"; * import { useScaleTransition } from "@react-md/core/transition/useScaleTransition"; * * function Example(): ReactElement { * const buttonRef = useRef(null); * const [transitionIn, setTransitionIn] = useState(false); * const { style, transitionOptions } = useFixedPositioning({ * fixedTo: buttonRef, * }); * * return ( * <> * * *
* Some content within a menu *
*
* * ); * } * ``` * * @see {@link https://react-md.dev/components/scale-transition | ScaleTransition Demos} * @typeParam E - The HTMLElement type used or the ref required for the * transition. * @since 2.0.0 * @since 4.0.0 The typeParam was added and the API was updated. * @since 6.0.0 Removed the built-in support for portalling. */ export declare function ScaleTransition(props: ScaleTransitionProps): ReactElement;