@use 'sass:map';
@use '../../functions' as *;
@use '../../schemas/' as *;
@use '../../../utils/map' as *;
@use '../../../elevations/' as *;

////
/// @group themes
/// @access public
/// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
/// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
////

/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
/// @param {Color} $color [null] - The color of the ripple.
/// @requires $light-material-schema
/// @example scss Change the color
///   $my-ripple-theme: igx-ripple-theme($color: yellow);
///   // Pass the theme to the css-vars() mixin
///   @include css-vars($my-ripple-theme);
@function ripple-theme($schema: $light-material-schema, $color: null) {
    $name: 'igx-ripple';
    $selector: '[igxRipple]';
    $ripple-schema: ();

    @if map.has-key($schema, 'ripple') {
        $ripple-schema: map.get($schema, 'ripple');
    } @else {
        $ripple-schema: $schema;
    }

    $theme: digest-schema($ripple-schema);

    @return extend(
        $theme,
        (
            name: $name,
            selector: $selector,
            color: $color,
        )
    );
}
