/**
 * @mergeTarget
 * @module Src/Components
 */

/**
 * Type to describe a custom choice item
 */
type CustomChoiceItemObject = {
  /**
   * Id of text
   */
  textId: string;
  /**
   * Value of radio ionput
   */
  value: string;
  /**
   * State of radio input
   */
  isChecked: boolean;
  /**
   * Icon datas
   */
  icon?: {
    /**
     * Icon file name
     */
    fileName: string;
    /**
     * Icon name
     */
    iconName: string;
  };
  /**
   * CSS classes of icon
   */
  iconClasses?: string[];
  /**
   * Indicates if text has to be translated
   */
  noTranslate?: boolean;
  /**
   * CSS classes of component
   */
  cssClasses?: string[];
  /**
   * CSS class of label
   */
  cssClassesLabel?: string[];
  /**
   * Indicates if component has text
   */
  noText?: boolean;
  /**
   * Indicates the id of a text in the small label if needed
   */
  specificLabel?: {
    textId: string;
    noTranslate?: boolean;
  };
};

/**
 * Type to describe an infobox
 */
type InfoBoxRenderObject = {
  /**
   * Id of text
   */
  textId: string;
  /**
   * CSS classes of infobox
   */
  cssClassesText?: string[];
};

/**
 * Type to describe an icon
 */
type Icon = {
  /**
   * Svg content
   */
  svg: string;
  /**
   * Width of svg
   */
  width: number;
  /**
   * Height of svg
   */
  height: number;
};

/**
 * Type to describe an set of icons
 */
type IconsObject = {
  [key: string]: Icon;
};

/**
 * Type to describe a navigation tab
 */
type NavButtonSubRenderObject = {
  /**
   * Button id
   */
  buttonId: string;
  /**
   * Icon datas
   */
  icon: {
    /**
     * Icon file name
     */
    fileName: string;
    /**
     * Icon name
     */
    iconName: string;
    /**
     * CSS classes of icon
     */
    cssClasses?: string[];
  };
  /**
   * Screen name to navigate to
   */
  nextScreenName: string;
  /**
   * Position of component
   */
  position: number;
  /**
   * CSS classes of component
   */
  cssClasses?: string[];
  /**
   * Aria attributes
   */
  aria?: {
    /**
     * Aria label
     */
    label?: {
      /**
       * Indicates if aria label has to be translated
       */
      noTranslate?: boolean;
      /**
       * Label text id
       */
      id: string;
    };
    /**
     * Indicates if component is hidden
     */
    hidden?: boolean;
    /**
     * Indicates which component this one controls
     */
    controls?: string;
  };
  /**
   * Role attribute
   */
  role?: "checkbox" | "link" | "spinbutton" | "tab";
  /**
   * Tabindex Attribute
   */
  tabindex?: "-1" | "0";
};

/**
 * Type for all possible tagName of a text
 */
type TextTagNames = "p" | "label" | "h2" | "h3" | "h1" | "span";

export type {
  CustomChoiceItemObject,
  InfoBoxRenderObject,
  Icon,
  IconsObject,
  NavButtonSubRenderObject,
  TextTagNames,
};
