@use '../../../mdc-helpers/mdc-helpers';
@use '../../token-utils';
@use '../../../typography/typography-utils';

@use 'sass:map';

// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, extended-fab);

@function get-unthemable-tokens() {
  @return (
    container-color: null,
    container-elevation: null,
    container-height: null,
    container-shadow-color: null,
    container-shape: null,
    container-surface-tint-layer-color: null,
    focus-container-elevation: null,
    focus-icon-color: null,
    focus-label-text-color: null,
    focus-outline-color: null,
    focus-outline-width: null,
    focus-state-layer-color: null,
    focus-state-layer-opacity: null,
    hover-container-elevation: null,
    hover-icon-color: null,
    hover-label-text-color: null,
    hover-state-layer-color: null,
    hover-state-layer-opacity: null,
    icon-color: null,
    icon-size: null,
    label-text-color: null,
    lowered-container-elevation: null,
    lowered-focus-container-elevation: null,
    lowered-hover-container-elevation: null,
    lowered-pressed-container-elevation: null,
    pressed-container-elevation: null,
    pressed-icon-color: null,
    pressed-label-text-color: null,
    pressed-ripple-color: null,
    pressed-ripple-opacity: null,
    pressed-state-layer-color: null,
    pressed-state-layer-opacity: null
  );
}

// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($config) {
  @return ();
}

// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($config) {
  // TODO(wagnermaciel): The earlier implementation of the snack bar used MDC's APIs to create the
  // typography tokens. As a result, we unintentionally allowed `null` typography configs to be
  // passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
  // fallback.
  @if ($config == null) {
    $config: mdc-helpers.private-fallback-typography-from-mdc();
  }
  @return (
    label-text-font: typography-utils.font-family($config, button) or
      typography-utils.font-family($config),
    label-text-size: typography-utils.font-size($config, button),
    label-text-tracking: typography-utils.letter-spacing($config, button),
    label-text-weight: typography-utils.font-weight($config, button)
  );
}

// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($config) {
  @return ();
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
  @return map.merge(
    get-unthemable-tokens(),
    map.merge(
      get-color-tokens(token-utils.$placeholder-color-config),
      map.merge(
        get-typography-tokens(token-utils.$placeholder-typography-config),
        get-density-tokens(token-utils.$placeholder-density-config)
      )
    )
  );
}
