# All files / src/interaction RippleContainer.tsx

64.28% Statements 27/42
100% Branches 0/0
0% Functions 0/1
64.28% Lines 27/42

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
    40
    41
    42
    431x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x

     import { cnb } from "cnbuilder";
    import { type ReactElement } from "react";
    import { Ripple } from "./Ripple.js";
    import { type ProvidedRippleContainerProps } from "./types.js";

    declare module "react" {
      interface CSSProperties {
        "--rmd-ripple-inset"?: string | number;
        "--rmd-ripple-border-radius"?: string | number;
      }
    }

    /** @internal */
    export interface RippleContainerProps extends ProvidedRippleContainerProps {
      className?: string;
    }

    /**
     * **Server Component**
     *
     * This component should generally only be used internally within `react-md`
     * unless you are implementing a custom component interaction with
     * `useElementInteraction`.
     *
     * @see {@link useElementInteraction} for example usage.
     */
    export function RippleContainer(props: RippleContainerProps): ReactElement {
      const { className, ripples, onEntered, onExited } = props;

      return (
        <span className={cnb("rmd-ripple-container", className)}>
          {ripples.map((ripple) => (
            <Ripple
              key={ripple.startTime}
              ripple={ripple}
              onEntered={onEntered}
              onExited={onExited}
            />
          ))}
        </span>
      );
    }