import { isBorderTokenType } from '../../../types/type-guard';
import { LogUtility } from '../../../utils/log';
import { StateVariantFormatter } from './state-variant-formatter';
import { BorderMap, Borders } from '../../../constants/tokens/borders';
/**
 * The `StateBorderFormatter` class in TypeScript formats border token values into CSS border properties
 * and provides state information.
 */
class StateBorderFormatter extends StateVariantFormatter {
  constructor() {
    super(...arguments);
    this.states = ['default', 'focus-visible', 'hover', 'active'];
  }
  /**
   * The `formatToken` function in TypeScript formats a border token value into a CSS border property
   * string or logs a warning if the input is invalid.
   *
   * @param {BordersTokenType} input - The `formatToken` function takes a `BordersTokenType` as input
   * and returns a formatted string representing a CSS border property based on the input token value.
   * If the input is a valid border token type, it retrieves the corresponding CSS value from the
   * `BorderMap` and returns it in a `border
   * @returns {string} The `formatToken` function returns a string that represents a CSS border property based on
   * the input `BordersTokenType`. If the input is a valid border token type, it retrieves the
   * corresponding value from the `BorderMap` and returns a CSS `border` property string. If the input
   * is not a valid border token type, it logs a warning message using `LogUtility.warn` and returns an
   * empty
   */
  formatToken(input) {
    if (isBorderTokenType(input)) {
      const tokenValue = BorderMap[input];
      return `border: ${tokenValue};`;
    }
    else {
      LogUtility.warn(`The border value ${input} is invalid, it must be a value of: `, Borders);
      return '';
    }
  }
  /**
   * The function `getStates` returns an array of `CssStatesType` objects.
   *
   * @returns {CssStatesType[] } An array of objects of type CssStatesType, which represents the states.
   */
  getStates() {
    return this.states;
  }
}
export default new StateBorderFormatter();
