<?php
/**
 * Customizer fields for global 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\Pro\Field\Divider;

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

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

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

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

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

new Radio_Buttonset(
	array(
		'label'     => esc_html__( 'Colors', 'eronex' ),
		'settings'  => 'eronex_button_colors_tab',
		'section'   => 'eronex_general_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_button_color',
		'section'   => 'eronex_general_button',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-btn',
				'property' => 'color',
			),
		),
	)
);

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

new Color(
	array(
		'label'     => esc_html__( 'Border Color', 'eronex' ),
		'settings'  => 'eronex_button_border',
		'section'   => 'eronex_general_button',
		'default'   => 'transparent',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-btn',
				'property' => 'border-color',
			),
		),
	)
);

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

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

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

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

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

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

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

new Dimensions(
	array(
		'label'      => esc_html__( 'Border Radius', 'eronex' ),
		'settings'   => 'eronex_general_button_radius',
		'section'    => 'eronex_general_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-btn',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
		'transport'  => 'auto',
		'responsive' => true,
	)
);

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

new Dimensions(
	array(
		'settings'   => 'eronex_button_padding',
		'label'      => esc_html__( 'Padding', 'eronex' ),
		'section'    => 'eronex_general_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-btn',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
		'transport'  => 'auto',
		'responsive' => true,
	)
);
