<?php
/**
 * Customizer fields for header button settings.
 *
 * @package Eronex
 * @since   0.0.1
 */

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

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

new HeadlineToggle(
	array(
		'label'    => esc_html__( 'Show Button', 'eronex' ),
		'settings' => 'eronex_header_button_enable',
		'section'  => 'eronex_header_button',
		'default'  => false,
	)
);

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

new Text(
	array(
		'settings' => 'eronex_header_button_text',
		'label'    => esc_html__( 'Text', 'eronex' ),
		'section'  => 'eronex_header_button',
		'default'  => esc_html__( 'Contact', 'eronex' ),
	)
);

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

new Text(
	array(
		'settings' => 'eronex_header_button_icon',
		'label'    => esc_html__( 'Icon', 'eronex' ),
		'section'  => 'eronex_header_button',
		'default'  => '',
		'choices'  => array(
			'placeholder' => 'hi hi-arrow-up-right',
		),
	)
);

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

new Select(
	array(
		'label'    => esc_html__( 'Target', 'eronex' ),
		'settings' => 'eronex_header_button_target',
		'section'  => 'eronex_header_button',
		'default'  => '_self',
		'choices'  => array(
			'_blank' => esc_html__( 'Blank', 'eronex' ),
			'_self'  => esc_html__( 'Self', 'eronex' ),
		),
	)
);

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

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

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

new Dimensions(
	array(
		'label'      => esc_html__( 'Font Size', 'eronex' ),
		'settings'   => 'eronex_header_button_font_size',
		'section'    => 'eronex_header_button',
		'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-header-button',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
		'transport'  => 'auto',
		'responsive' => true,
	)
);

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

new Radio_Buttonset(
	array(
		'label'     => esc_html__( 'Colors', 'eronex' ),
		'settings'  => 'eronex_header_button_colors_tab',
		'section'   => 'eronex_header_button',
		'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_header_button_color',
		'section'   => 'eronex_header_button',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-header-button',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Background Color', 'eronex' ),
		'settings'  => 'eronex_header_button_bg',
		'section'   => 'eronex_header_button',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-header-button',
				'property' => 'background-color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Border Color', 'eronex' ),
		'settings'  => 'eronex_header_button_border_color',
		'section'   => 'eronex_header_button',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-header-button',
				'property' => 'border-color',
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Color', 'eronex' ),
		'settings'        => 'eronex_sticky_header_button_color',
		'section'         => 'eronex_header_button',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-header-button',
				'property' => 'color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Background', 'eronex' ),
		'settings'        => 'eronex_sticky_header_button_bg',
		'section'         => 'eronex_header_button',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-header-button',
				'property' => 'background-color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Border', 'eronex' ),
		'settings'        => 'eronex_sticky_header_button_border_color',
		'section'         => 'eronex_header_button',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-header-button',
				'property' => 'border-color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Text Color', 'eronex' ),
		'settings'  => 'eronex_header_button_hover_color',
		'section'   => 'eronex_header_button',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-header-button:hover,.eronex-header-button:focus',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Background Color', 'eronex' ),
		'settings'  => 'eronex_header_button_hover_bg',
		'section'   => 'eronex_header_button',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-header-button:hover,.eronex-header-button:focus',
				'property' => 'background-color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Border Color', 'eronex' ),
		'settings'  => 'eronex_header_button_hover_border',
		'section'   => 'eronex_header_button',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-header-button:hover,.eronex-header-button:focus',
				'property' => 'border-color',
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Color', 'eronex' ),
		'settings'        => 'eronex_sticky_header_button_hover_color',
		'section'         => 'eronex_header_button',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-header-button:hover,header.eronex-appear .eronex-header-button:focus',
				'property' => 'color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Background', 'eronex' ),
		'settings'        => 'eronex_sticky_header_button_hover_bg',
		'section'         => 'eronex_header_button',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-header-button:hover,header.eronex-appear .eronex-header-button:focus',
				'property' => 'background-color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Border', 'eronex' ),
		'settings'        => 'eronex_sticky_header_button_hover_border',
		'section'         => 'eronex_header_button',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-header-button:hover,header.eronex-appear .eronex-header-button:focus',
				'property' => 'border-color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

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

new Dimensions(
	array(
		'label'      => esc_html__( 'Border', 'eronex' ),
		'settings'   => 'eronex_header_button_border',
		'section'    => 'eronex_header_button',
		'default'    => array(
			'mobile'  => array(
				'border-top-width'    => '',
				'border-right-width'  => '',
				'border-bottom-width' => '',
				'border-left-width'   => '',
			),
			'tablet'  => array(
				'border-top-width'    => '',
				'border-right-width'  => '',
				'border-bottom-width' => '',
				'border-left-width'   => '',
			),
			'desktop' => array(
				'border-top-width'    => '',
				'border-right-width'  => '',
				'border-bottom-width' => '',
				'border-left-width'   => '',

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

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

new Dimensions(
	array(
		'label'      => esc_html__( 'Border Radius', 'eronex' ),
		'settings'   => 'eronex_header_button_radius',
		'section'    => 'eronex_header_button',
		'default'    => array(
			'mobile'  => array(
				'border-top-left-radius'     => '',
				'border-top-right-radius'    => '',
				'border-bottom-left-radius'  => '',
				'border-bottom-right-radius' => '',
			),
			'tablet'  => array(
				'border-top-left-radius'     => '',
				'border-top-right-radius'    => '',
				'border-bottom-left-radius'  => '',
				'border-bottom-right-radius' => '',
			),
			'desktop' => array(
				'border-top-left-radius'     => '',
				'border-top-right-radius'    => '',
				'border-bottom-left-radius'  => '',
				'border-bottom-right-radius' => '',
			),
		),
		'choices'    => array(
			'labels' => array(
				'border-top-left-radius'     => esc_html__( 'Top', 'eronex' ),
				'border-top-right-radius'    => esc_html__( 'Right', 'eronex' ),
				'border-bottom-left-radius'  => esc_html__( 'Bottom', 'eronex' ),
				'border-bottom-right-radius' => esc_html__( 'Left', 'eronex' ),
			),
		),
		'output'     => array(
			array(
				'element'     => '.eronex-header-button',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
		'transport'  => 'auto',
		'responsive' => true,
	)
);

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

new Dimensions(
	array(
		'label'      => esc_html__( 'Padding', 'eronex' ),
		'settings'   => 'eronex_header_button_padding',
		'section'    => 'eronex_header_button',
		'default'    => array(
			'mobile'  => array(
				'padding-top'    => '',
				'padding-right'  => '',
				'padding-bottom' => '',
				'padding-left'   => '',
			),
			'tablet'  => array(
				'padding-top'    => '',
				'padding-right'  => '',
				'padding-bottom' => '',
				'padding-left'   => '',
			),
			'desktop' => array(
				'padding-top'    => '',
				'padding-right'  => '',
				'padding-bottom' => '',
				'padding-left'   => '',

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