/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
@use './core';
@use '../focus-indicator';
@use '../state-layer';
@use '../icon';

.forge-button {
  @include core.tokens;
}

.forge-button {
  @include core.host;
  @include core.base;

  position: relative;
  inline-size: auto;

  &:not(:disabled) {
    &:not(.forge-button--link) {
      @include state-layer.standalone;
    }

    &:focus-visible {
      @include focus-indicator.keyframes;
    }

    @include focus-indicator.standalone;
    @include focus-indicator.provide-theme(
      (
        color: #{core.token(primary-color)}
      )
    );
  }

  &:disabled {
    @include core.host-disabled;
    @include core.disabled;

    pointer-events: initial;
  }

  &--outlined {
    @include core.outlined;

    &:disabled {
      @include core.outlined-disabled;
    }
  }

  &--tonal {
    @include core.tonal;

    &:disabled {
      @include core.tonal-disabled;
    }
  }

  &--filled,
  &--raised {
    @include core.filled;
    @include state-layer.provide-theme(
      (
        color: #{core.token(filled-color)}
      )
    );

    &:disabled {
      @include core.filled-disabled;
    }
  }

  &--raised {
    @include core.raised;

    &:disabled {
      @include core.raised-disabled;
    }
  }

  &--link {
    @include core.link;
  }

  &--pill {
    @include core.pill;

    @include focus-indicator.provide-theme(
      (
        shape: #{core.token(pill-shape)}
      )
    );
  }

  @include icon.provide-theme(
    (
      font-size: #{core.token(icon-size)}
    )
  );

  &--dense {
    @include core.dense;
  }
}
