import { isFlexDirectionType, isBreakpointsForPrefixType } from '../../../types/type-guard';
import { LogUtility } from '../../../utils/log';
import { FlexDirections } from '../../../constants/ui';
import { ResponsiveClassStringFormatter } from './responsive-class-string-formatter';
/**
 * A class for format FlexDirectionType with BreakpointsForPrefixType to CSS class string
 *
 * @augments ResponsiveClassStringFormatter
 */
class ResponsiveFlexDirectionFormatter extends ResponsiveClassStringFormatter {
  /**
   * This function takes a FlexDirectionType and a breakpoint and returns CSS class string.
   *
   * @param {FlexDirectionType} input - FlexDirectionType input
   * @param {BreakpointsForPrefixType} [breakpoint] - Breakpoints for prefix of the class
   * @returns {string} - A string.
   */
  formatToken(input, breakpoint) {
    const prefix = isBreakpointsForPrefixType(breakpoint) ? `${breakpoint}:` : '';
    if (isFlexDirectionType(input)) {
      return `${prefix}v-flex-${input}`;
    }
    else {
      LogUtility.warn(`The direction value ${input} is invalid, it must be a value of: `, FlexDirections);
      return '';
    }
  }
}
export default new ResponsiveFlexDirectionFormatter();
