<?php
/**
 * Customizer fields for banner breadcrumb settings.
 *
 * @package Eronex
 * @since   0.0.1
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use Kirki\Field\Color;
use Kirki\Field\Dimensions;
use Kirki\Field\Radio_Buttonset;
use Kirki\Field\Select;
use Kirki\Pro\Field\Divider;
use Kirki\Pro\Field\HeadlineToggle;

new HeadlineToggle(
	array(
		'label'    => esc_html__( 'Breadcrumb', 'eronex' ),
		'settings' => 'eronex_breadcrumb_enable',
		'section'  => 'eronex_breadcrumb',
		'default'  => true,
	)
);

new Divider(
	array(
		'settings' => 'eronex_breadcrumb_family_separator',
		'section'  => 'eronex_breadcrumb',
		'choices'  => array(
			'color' => $separator_color,
		),
	),
);

new Select(
	array(
		'label'    => esc_html__( 'Font Family', 'eronex' ),
		'settings' => 'eronex_breadcrumb_family',
		'section'  => 'eronex_breadcrumb',
		'default'  => 'primary',
		'choices'  => array(
			'primary'   => esc_html__( 'Primary', 'eronex' ),
			'secondary' => esc_html__( 'Secondary', 'eronex' ),
		),
	)
);

new Divider(
	array(
		'settings' => 'eronex_breadcrumb_size_separator',
		'section'  => 'eronex_breadcrumb',
		'choices'  => array(
			'color' => $separator_color,
		),
	)
);

new Dimensions(
	array(
		'label'      => esc_html__( 'Font Size', 'eronex' ),
		'settings'   => 'eronex_breadcrumb_size',
		'section'    => 'eronex_breadcrumb',
		'default'    => array(
			'mobile'  => array(
				'font-size'   => '',
				'line-height' => '',
			),
			'tablet'  => array(
				'font-size'   => '',
				'line-height' => '',
			),
			'desktop' => array(
				'font-size'   => '',
				'line-height' => '',

			),
		),
		'choices'    => array(
			'labels' => array(
				'font-size'   => esc_html__( 'Font Size', 'eronex' ),
				'line-height' => esc_html__( 'Line Height', 'eronex' ),
			),
		),
		'output'     => array(
			array(
				'element'     => '.eronex-breadcrumb-list',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
		'transport'  => 'auto',
		'responsive' => true,
	)
);

new Divider(
	array(
		'settings' => 'eronex_breadcrumb_colors_tab_separator',
		'section'  => 'eronex_breadcrumb',
		'choices'  => array(
			'color' => $separator_color,
		),
	)
);

new Radio_Buttonset(
	array(
		'label'     => esc_html__( 'Colors', 'eronex' ),
		'settings'  => 'eronex_breadcrumb_colors_tab',
		'section'   => 'eronex_breadcrumb',
		'default'   => 'normal',
		'transport' => 'auto',
		'choices'   => array(
			'normal' => esc_html__( 'Normal', 'eronex' ),
			'hover'  => esc_html__( 'Hover', 'eronex' ),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Text Color', 'eronex' ),
		'settings'        => 'eronex_breadcrumb_text_color',
		'section'         => 'eronex_breadcrumb',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_breadcrumb_colors_tab',
				'operator' => '==',
				'value'    => 'normal',
			),
		),
		'output'          => array(
			array(
				'element'  => '.eronex-breadcrumb-list',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Link Color', 'eronex' ),
		'settings'        => 'eronex_breadcrumb_link_color',
		'section'         => 'eronex_breadcrumb',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_breadcrumb_colors_tab',
				'operator' => '==',
				'value'    => 'normal',
			),
		),
		'output'          => array(
			array(
				'element'  => 'a.eronex-breadcrumb-item',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Link Color', 'eronex' ),
		'settings'        => 'eronex_breadcrumb_link_hover_color',
		'section'         => 'eronex_breadcrumb',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_breadcrumb_colors_tab',
				'operator' => '==',
				'value'    => 'hover',
			),
		),
		'output'          => array(
			array(
				'element'  => 'a.eronex-breadcrumb-item:hover,a.eronex-breadcrumb-item:focus',
				'property' => 'color',
			),
		),
	)
);

new Divider(
	array(
		'settings' => 'eronex_breadcrumb_margin_separator',
		'section'  => 'eronex_breadcrumb',
		'choices'  => array(
			'color' => $separator_color,
		),
	)
);

new Dimensions(
	array(
		'settings'   => 'eronex_breadcrumb_margin',
		'label'      => esc_html__( 'Margin', 'eronex' ),
		'section'    => 'eronex_breadcrumb',
		'default'    => array(
			'mobile'  => array(
				'margin-top'    => '',
				'margin-right'  => '',
				'margin-bottom' => '',
				'margin-left'   => '',
			),
			'tablet'  => array(
				'margin-top'    => '',
				'margin-right'  => '',
				'margin-bottom' => '',
				'margin-left'   => '',
			),
			'desktop' => array(
				'margin-top'    => '',
				'margin-right'  => '',
				'margin-bottom' => '',
				'margin-left'   => '',

			),
		),
		'choices'    => array(
			'labels' => array(
				'margin-top'    => esc_html__( 'Top', 'eronex' ),
				'margin-right'  => esc_html__( 'Right', 'eronex' ),
				'margin-bottom' => esc_html__( 'Bottom', 'eronex' ),
				'margin-left'   => esc_html__( 'Left', 'eronex' ),
			),
		),
		'output'     => array(
			array(
				'element'     => '.eronex-breadcrumb',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
		'transport'  => 'auto',
		'responsive' => true,
	)
);
