<?php
// Register Logo Widget
pxl_add_custom_widget(
    array(
        'name' => 'pxl_list',
        'title' => esc_html__('Case List', 'solarva' ),
        'icon' => 'eicon-editor-list-ul',
        'categories' => array('pxltheme-core'),
        'params' => array(
            'sections' => array(
                array(
                    'name' => 'section_content',
                    'label' => esc_html__('Items', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
                    'controls' => array(
                        array(
                            'name' => 'pxl_icon',
                            'label' => esc_html__('Icon', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::ICONS,
                            'fa4compatibility' => 'icon',
                        ),
                        array(
                            'name' => 'items',
                            'label' => esc_html__('Content', 'solarva'),
                            'type' => \Elementor\Controls_Manager::REPEATER,
                            'controls' => array(
                                array(
                                    'name' => 'text',
                                    'label' => esc_html__('Text', 'solarva' ),
                                    'type' => \Elementor\Controls_Manager::TEXTAREA,
                                    'rows' => 3,
                                ),
                            ),
                            'title_field' => '{{{ text }}}',
                        ),
                    ),
                ),
                array(
                    'name' => 'section_style',
                    'label' => esc_html__('Item', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'controls' => array(
                        array(
                            'name' => 'style',
                            'label' => esc_html__('Style', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'default' => 'pxl-list-default',
                            'options' => [
                                ''                 => esc_html__('Custom', 'solarva'),
                                'pxl-list-default' => esc_html__('Default', 'solarva'),
                                'pxl-list-style1'  => esc_html__('Style 1', 'solarva'),
                                'pxl-list-style2'  => esc_html__('Style 2', 'solarva'),
                                'pxl-list-style3'  => esc_html__('Style 3', 'solarva'),
                            ],
                        ),
                        array(
                            'name' => 'item_color',
                            'label' => esc_html__('Color', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-list .pxl-item--single' => 'color: {{VALUE}};',
                            ],
                        ),
                        array(
                            'name' => 'item_typography',
                            'label' => esc_html__('Typography', 'solarva' ),
                            'type' => \Elementor\Group_Control_Typography::get_type(),
                            'control_type' => 'group', 
                            'selector' => '{{WRAPPER}} .pxl-list .pxl-item--single',
                        ),
                        array(
                            'name' => 'item_align_items_h',
                            'label' => esc_html__('Align Items', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::CHOOSE,
                            'control_type' => 'responsive', 
                            'options' => [
                                'start' =>  [
                                    'title' => esc_html__('Start', 'solarva'),
                                    'icon' => 'eicon-align-start-v',
                                ],
                                'center' =>  [
                                    'title' => esc_html__('Center', 'solarva'),
                                    'icon' => 'eicon-align-center-v',
                                ],
                                'end' =>  [
                                    'title' => esc_html__('End', 'solarva'),
                                    'icon' => 'eicon-align-end-v',
                                ],
                                'stretch' =>  [
                                    'title' => esc_html__('Stretch', 'solarva'),
                                    'icon' => 'eicon-align-stretch-v',
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-list .pxl-item--single' => 'align-items: {{VALUE}};'
                            ],
                        ),
                        array(
                            'name' => 'item_spacing',
                            'label' => esc_html__('Spacing', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'control_type' => 'responsive',
                            'selectors' => [
                                '{{WRAPPER}} .pxl-list .pxl-item--single' => '--y: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'item_gap',
                            'label' => esc_html__('Gap', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'control_type' => 'responsive',
                            'selectors' => [
                                '{{WRAPPER}} .pxl-list .pxl-item--single' => 'gap: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                    ),
                ),
                array(
                    'name' => 'tab_style_icon',
                    'label' => esc_html__('Icon', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'controls' => array(
                        array(
                            'name' => 'icon_color' ,
                            'label' => esc_html__('Color', 'solarva'),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-list .pxl-item--single i' => 'color: {{VALUE}};',
                            ],
                        ),
                        array(
                            'name' => 'icon_size',
                            'label' => esc_html__('Font Size', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-list .pxl-item--single i' => 'font-size: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                    ),
                ),
                solarva_widget_animation_settings(),
            ),
        ),
    ),
    solarva_get_class_widget_path()
);