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

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

/// Rating Theme
///
/// This theme has no automatic token derivation. All tokens are independent.
/// Use symbol-empty-color and symbol-full-color for text-based symbols.
/// Use symbol-empty-filter and symbol-full-filter for image/SVG-based symbols.
///
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
/// @param {Color} $label-color [null] - sets the color for the label.
/// @param {Number} $symbol-size [null] - the size of the symbols.
/// @param {Color} $symbol-empty-color [null] - sets the idle color for the symbol when it is a plane text.
/// @param {Color} $symbol-full-color [null] - sets the color in selected state for the symbol when it is a plane text.
/// @param {Color} $symbol-empty-filter [null] - the filter(s) used for the empty symbol.
/// @param {Color} $symbol-full-filter [null] - the filter(s) used for the filled symbol.
/// @param {Color} $disabled-label-color [null] - sets the color for the label in disabled state.
/// @param {Color} $disabled-empty-symbol-color [null] - sets the idle color for the symbol in disabled state when it is a plane text.
/// @param {Color} $disabled-full-symbol-color [null] - sets the color for the symbol in selected/disabled state when it is a plane text.
/// @requires $light-material-schema
/// @example scss - Change the rating filled symbol color
///   $my-rating-theme: rating-theme($symbol-full-color: red);
///   // Pass the theme to the css-vars() mixin
///   @include css-vars($my-rating-theme);
@function rating-theme($schema: $light-material-schema, $rest...) {
    $selector: 'igc-rating';
    $rating-schema: ();

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

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

    @return extend(
        $theme,
        (
            selector: $selector,
        ),
        meta.keywords($rest)
    );
}
