# All files / layout useExpandableLayoutAppBarTransition.ts

0% Statements 0/38
0% Branches 0/1
0% Functions 0/1
0% Lines 0/38

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    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

     import { DEFAULT_SHEET_TIMEOUT } from "../sheet";
    import type {
      CSSTransitionClassNames,
      CSSTransitionHookOptions,
      CSSTransitionHookReturnValue,
      PreconfiguredTransitionOptions,
    } from "../transition";
    import { useCSSTransition } from "../transition";

    const MAIN_LAYOUT_APP_BAR_CLASSNAMES: CSSTransitionClassNames = {
      enter: "rmd-layout-header--enter",
      enterActive: "rmd-layout-header--nav-offset",
      enterDone: "rmd-layout-header--nav-offset",
      exit: "rmd-layout-header--exit",
    };

    export interface ExpandableLayoutAppBarTransitionOptions<E extends HTMLElement>
      extends Omit<Partial<CSSTransitionHookOptions<E>>, "transitionIn"> {
      //
    }

    export function useExpandableLayoutAppBarTransition<
      E extends HTMLElement = HTMLElement
    >(
      options: ExpandableLayoutAppBarTransitionOptions<E> = {}
    ): CSSTransitionHookReturnValue<E> {
      const {
        timeout = DEFAULT_SHEET_TIMEOUT,
        classNames = MAIN_LAYOUT_APP_BAR_CLASSNAMES,
        ...remaining
      } = options;
      return useCSSTransition({
        timeout,
        classNames,
        ...remaining,
        transitionIn: false,
      });
    }