import { isGridColumnsType, isBreakpointsForPrefixType } from '../../../types/type-guard';
import { LogUtility } from '../../../utils/log';
import { ResponsiveClassStringFormatter } from './responsive-class-string-formatter';
import { GridColumns } from '../../../constants/tokens/tailwind.extend';
/**
 * A class for format GridColumnsType with BreakpointsForPrefixType to CSS class string
 *
 * @augments ResponsiveClassStringFormatter
 */
class ResponsiveGridColumnsFormatter extends ResponsiveClassStringFormatter {
  /**
   * It takes a GridColumnsType and a breakpoint and returns a CSS class string.
   *
   * @param {GridColumnsType} input - GridColumnsType input for formatting
   * @param {BreakpointsForPrefixType} [breakpoint] - Breakpoints for prefix of the class
   * @returns {string} string.
   */
  formatToken(input, breakpoint) {
    const prefix = isBreakpointsForPrefixType(breakpoint) ? `${breakpoint}:` : '';
    if (isGridColumnsType(input)) {
      return `${prefix}v-grid-cols-${input}`;
    }
    else {
      LogUtility.warn(`The column value ${input} is invalid, it must be a value of: `, GridColumns);
      return '';
    }
  }
}
export default new ResponsiveGridColumnsFormatter();
