@use 'sass:map';
@use '@angular/material' as mat;
@use '../../token-definition';

// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mtx, alert);

/// Generates custom tokens for the mat-badge.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-badge
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
  $is-dark: map.get($systems, md-sys-type) == dark;

  $tokens: (
    container-shape: map.get($systems, md-sys-shape, corner-small),

    outline-color: map.get($systems, md-sys-color, outline-variant),
    background-color: map.get($systems, md-sys-color, surface-container),
    text-color: map.get($systems, md-sys-color, on-surface),

    info-outline-color: map.get(mat.$azure-palette, if($is-dark, 40, 80)),
    info-background-color: map.get(mat.$azure-palette, if($is-dark, 20, 90)),
    info-text-color: map.get(mat.$azure-palette, if($is-dark, 90, 20)),

    success-outline-color: map.get(mat.$green-palette, if($is-dark, 40, 80)),
    success-background-color: map.get(mat.$green-palette, if($is-dark, 20, 95)),
    success-text-color: map.get(mat.$green-palette, if($is-dark, 95, 20)),

    warning-outline-color: map.get(mat.$yellow-palette, if($is-dark, 40, 80)),
    warning-background-color: map.get(mat.$yellow-palette, if($is-dark, 20, 98)),
    warning-text-color: map.get(mat.$yellow-palette, if($is-dark, 98, 20)),

    danger-outline-color: map.get(mat.$red-palette, if($is-dark, 40, 80)),
    danger-background-color: map.get(mat.$red-palette, if($is-dark, 20, 90)),
    danger-text-color: map.get(mat.$red-palette, if($is-dark, 90, 20)),
  );

  @return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
