<?php
// Register Icon Box Widget
pxl_add_custom_widget(
    array(
        'name' => 'pxl_contact_info',
        'title' => esc_html__('BR Contact Info', 'breeza' ),
        'icon' => 'eicon-icon-box',
        'categories' => array('pxltheme-core'),
        'params' => array(
            'sections' => array(
                array(
                    'name' => 'section_layout',
                    'label' => esc_html__('Layout', 'breeza' ),
                    'tab' => \Elementor\Controls_Manager::TAB_LAYOUT,
                    'controls' => array(
                        array(
                            'name' => 'layout',
                            'label' => esc_html__('Templates', 'breeza' ),
                            'type' => 'layoutcontrol',
                            'default' => '1',
                            'options' => [
                                '1' => [
                                    'label' => esc_html__('Layout 1', 'breeza' ),
                                    'image' => get_template_directory_uri() . '/elements/widgets/img-layout/pxl_contact/layout1.jpg'
                                ], 
                                '2' => [
                                    'label' => esc_html__('Layout 2', 'breeza' ),
                                    'image' => get_template_directory_uri() . '/elements/widgets/img-layout/pxl_contact/layout2.jpg'
                                ],  
                            ],
                        ),
                    ),
                ),
                array(
                    'name' => 'section_content',
                    'label' => esc_html__('Content', 'breeza' ),
                    'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
                    'controls' => array(
                        array(
                            'name' => 'title',
                            'label' => esc_html__('Title', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::TEXT,
                            'label_block' => true,
                        ),
                        array(
                            'name' => 'link',
                            'label' => esc_html__('Link', 'breeza'),
                            'type' => \Elementor\Controls_Manager::REPEATER,
                            'controls' => array(
                                array(
                                    'name' => 'text',
                                    'label' => esc_html__('Text', 'breeza'),
                                    'type' => \Elementor\Controls_Manager::TEXT,
                                    'label_block' => true,
                                ),
                                array(
                                    'name' => 'link',
                                    'label' => esc_html__('Link', 'breeza'),
                                    'type' => \Elementor\Controls_Manager::URL,
                                    'label_block' => true,
                                ),
                            ),
                            'title_field' => '{{{ text }}}',
                        ),
                        array(
                            'name' => 'item_link',
                            'label' => esc_html__('Item Link', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::URL,
                        ),
                        array(
                            'name' => 'icon_type',
                            'label' => esc_html__('Icon Type', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                'icon' => 'Icon',
                                'image' => 'Image',
                            ],
                            'default' => 'icon',
                        ),
                        array(
                            'name' => 'pxl_icon',
                            'label' => esc_html__('Icon', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::ICONS,
                            'fa4compatibility' => 'icon',
                            'condition' => [
                                'icon_type' => 'icon',
                            ],
                        ),
                        array(
                            'name' => 'icon_image',
                            'label' => esc_html__( 'Icon Image', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::MEDIA,
                            'condition' => [
                                'icon_type' => 'image',
                            ],
                        ),
                        array(
                            'name' => 'image',
                            'label' => esc_html__( 'Image', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::MEDIA,
                            'condition' => [
                                'layout' => '1',
                            ],
                        ),
                        array(
                            'name' => 'box_padding',
                            'label' => esc_html__('Padding', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::DIMENSIONS,
                            'size_units' => [ 'px' ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-contact-info .pxl-item--inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                            ],
                            'control_type' => 'responsive',
                        ),
                        array(
                            'name' => 'border_type',
                            'label' => esc_html__( 'Border Type', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                '' => esc_html__( 'None', 'breeza' ),
                                'solid' => esc_html__( 'Solid', 'breeza' ),
                                'double' => esc_html__( 'Double', 'breeza' ),
                                'dotted' => esc_html__( 'Dotted', 'breeza' ),
                                'dashed' => esc_html__( 'Dashed', 'breeza' ),
                                'groove' => esc_html__( 'Groove', 'breeza' ),
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-contact-info .pxl-item--inner' => 'border-style: {{VALUE}} !important;',
                            ],
                        ),
                        array(
                            'name' => 'border_width',
                            'label' => esc_html__( 'Border Width', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::DIMENSIONS,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-contact-info .pxl-item--inner' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
                            ],
                            'condition' => [
                                'border_type!' => '',
                            ],
                            'responsive' => true,
                        ),
                        array(
                            'name' => 'border_color',
                            'label' => esc_html__( 'Border Color', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'default' => '',
                            'selectors' => [
                                '{{WRAPPER}} .pxl-contact-info .pxl-item--inner' => 'border-color: {{VALUE}} !important;',
                            ],
                            'condition' => [
                                'border_type!' => '',
                            ],
                        ),
                        array(
                            'name'         => 'box_shadow',
                            'label' => esc_html__( 'box shadow', 'breeza' ),
                            'type'         => \elementor\group_control_box_shadow::get_type(),
                            'control_type' => 'group',
                            'selector'     => '{{wrapper}} .pxl-contact-info2 .pxl-item--inner',
                        ),
                        array(
                            'name' => 'box_shadow',
                            'label' => esc_html__('Box Shadow None', 'breeza' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                'icon' => 'Icon',
                                'image' => 'Image',
                            ],
                            'default' => 'icon',
                        ),
                    ),
),
array(
    'name' => 'section_style_title',
    'label' => esc_html__('Title', 'breeza'),
    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    'controls' => array(
        array(
            'name' => 'title_tag',
            'label' => esc_html__('HTML Tag', 'breeza' ),
            'type' => \Elementor\Controls_Manager::SELECT,
            'options' => [
                'h1' => 'H1',
                'h2' => 'H2',
                'h3' => 'H3',
                'h4' => 'H4',
                'h5' => 'H5',
                'h6' => 'H6',
                'div' => 'div',
                'span' => 'span',
                'p' => 'p',
            ],
            'default' => 'h5',
        ),
        array(
            'name' => 'title_color',
            'label' => esc_html__('Title Color', 'breeza' ),
            'type' => \Elementor\Controls_Manager::COLOR,
            'selectors' => [
                '{{WRAPPER}} .pxl-contact-info .pxl-item--title' => 'color: {{VALUE}};',
            ],
        ),
        array(
            'name' => 'title_typography',
            'label' => esc_html__('Title Typography', 'breeza' ),
            'type' => \Elementor\Group_Control_Typography::get_type(),
            'control_type' => 'group',
            'selector' => '{{WRAPPER}} .pxl-contact-info .pxl-item--title',
        ),
        array(
            'name' => 'title_spacer',
            'label' => esc_html__('Title Spacer Bottom', 'breeza' ),
            'type' => \Elementor\Controls_Manager::SLIDER,
            'control_type' => 'responsive',            
            'range' => [
                'px' => [
                    'min' => 0,
                    'max' => 1000,
                ],
            ],
            'selectors' => [
                '{{WRAPPER}} .pxl-contact-info .pxl-item--title' => 'margin-bottom:{{SIZE}}px;',
            ],            
        ),
        array(
            'name' => 'title_hidde_lg',
            'label' => esc_html__('Title Hidden Screen < 1600px', 'breeza' ),
            'type' => \Elementor\Controls_Manager::SELECT,
            'options' => [
                '' => 'No',
                'yes' => 'Yes',
            ],
            'default' => '',
        ),
        array(
            'name' => 'link_color',
            'label' => esc_html__('Link Color', 'breeza' ),
            'type' => \Elementor\Controls_Manager::COLOR,
            'selectors' => [
                '{{WRAPPER}} .pxl-contact-info .content' => 'color: {{VALUE}};',
            ],
        ),
        array(
            'name' => 'link_typography',
            'label' => esc_html__('Link Typography', 'breeza' ),
            'type' => \Elementor\Group_Control_Typography::get_type(),
            'control_type' => 'group',
            'selector' => '{{WRAPPER}} .pxl-contact-info .content',
        ),
    ),
),
array(
    'name' => 'section_style_icon',
    'label' => esc_html__('Icon', 'breeza'),
    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    'controls' => array(
        array(
            'name' => 'icon_color',
            'label' => esc_html__('Icon Color', 'breeza' ),
            'type' => \Elementor\Controls_Manager::COLOR,
            'selectors' => [
                '{{WRAPPER}} .pxl-contact-info .pxl-item--icon' => 'color: {{VALUE}};',
            ],
        ),
        array(
            'name' => 'icon_box_color',
            'label' => esc_html__('Icon Box Color', 'breeza' ),
            'type' => \Elementor\Controls_Manager::COLOR,
            'selectors' => [
                '{{WRAPPER}} .pxl-contact-info .pxl-item--icon' => 'background-color: {{VALUE}};',
            ],
        ),
        array(
            'name' => 'border_type_icon',
            'label' => esc_html__( 'Border Type', 'breeza' ),
            'type' => \Elementor\Controls_Manager::SELECT,
            'options' => [
                '' => esc_html__( 'None', 'breeza' ),
                'solid' => esc_html__( 'Solid', 'breeza' ),
                'double' => esc_html__( 'Double', 'breeza' ),
                'dotted' => esc_html__( 'Dotted', 'breeza' ),
                'dashed' => esc_html__( 'Dashed', 'breeza' ),
                'groove' => esc_html__( 'Groove', 'breeza' ),
            ],
            'selectors' => [
                '{{WRAPPER}} .pxl-contact-info .pxl-item--icon' => 'border-style: {{VALUE}} !important;',
            ],
        ),
        array(
            'name' => 'border_width_icon',
            'label' => esc_html__( 'Border Width', 'breeza' ),
            'type' => \Elementor\Controls_Manager::DIMENSIONS,
            'selectors' => [
                '{{WRAPPER}} .pxl-contact-info .pxl-item--icon' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
            ],
            'condition' => [
                'border_type_icon!' => '',
            ],
            'responsive' => true,
        ),
        array(
            'name' => 'border_color_icon',
            'label' => esc_html__( 'Border Color', 'breeza' ),
            'type' => \Elementor\Controls_Manager::COLOR,
            'default' => '',
            'selectors' => [
                '{{WRAPPER}} .pxl-contact-info .pxl-item--icon' => 'border-color: {{VALUE}} !important;',
            ],
            'condition' => [
                'border_type_icon!' => '',
            ],
        ),
        array(
            'name' => 'btn_border_radius_icon',
            'label' => esc_html__('Border Radius', 'breeza' ),
            'type' => \Elementor\Controls_Manager::DIMENSIONS,
            'size_units' => [ 'px' ],
            'selectors' => [
                '{{WRAPPER}} .pxl-contact-info .pxl-item--icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
            ],
        ),
    ),
),
breeza_widget_animation_settings(),
),
),
),
breeza_get_class_widget_path()
);