<?php

namespace Breakdance\Elements\PresetSections;

use function Breakdance\Elements\c;
use function Breakdance\Elements\controlSection;

add_action('init', function() {
    PresetSectionsController::getInstance()->register(
    "EssentialElements\\tabs_design",
    controlSection("tabs", __("Tabs", 'breakdance'), [
        c(
            "vertical",
            __("Vertical", 'breakdance'),
            [],
            ['type' => 'toggle', 'layout' => 'inline'],
            false,
            false,
            [],
        ),
        c(
            "tabs_width",
            __("Tabs Width", 'breakdance'),
            [],
            ['type' => 'unit', 'layout' => 'inline', 'unitOptions' => ['defaultType' => 'px'], 'condition' => ['path' => '%%CURRENTPATH%%.vertical', 'operand' => 'is set']],
            true,
            false,
            [],
        ),
        c(
            "horizontal_at",
            __("Horizontal At", 'breakdance'),
            [],
            ['type' => 'breakpoint_dropdown', 'layout' => 'inline', 'condition' => ['path' => '%%CURRENTPATH%%.vertical', 'operand' => 'is set'], 'breakpointOptions' => ['enableNever' => false]],
            false,
            false,
            [],
        ), c(
            "style",
            __("Style", 'breakdance'),
            [],
            ['type' => 'button_bar', 'layout' => 'vertical', 'items' => ['0' => ['value' => 'tabs', 'text' => __('Tabs', 'breakdance')], '1' => ['text' => __('Pills', 'breakdance'), 'value' => 'pills'], '2' => ['text' => __('Bar', 'breakdance'), 'value' => 'bar']]],
            false,
            false,
        ),
        c(
            "position_vertical",
            __("Position", 'breakdance'),
            [],
            ['type' => 'button_bar', 'layout' => 'inline', 'condition' => ['path' => '%%CURRENTPATH%%.vertical', 'operand' => 'is set'], 'items' => ['0' => ['value' => 'left', 'text' => __('Left', 'breakdance')], '1' => ['text' => __('Right', 'breakdance'), 'value' => 'right']]],
            false,
            false,
        ),
        c(
            "position",
            __("Position", 'breakdance'),
            [],
            ['type' => 'dropdown', 'layout' => 'inline', 'condition' => ['path' => '%%CURRENTPATH%%.vertical', 'operand' => 'is not set'], 'items' => ['0' => ['value' => 'flex-start', 'text' => __('Left', 'breakdance')], '1' => ['text' => __('Center', 'breakdance'), 'value' => 'center'], '2' => ['text' => __('Right', 'breakdance'), 'value' => 'flex-end'], '3' => ['text' => __('Full Width', 'breakdance'), 'value' => 'inherit']]],
            false,
            false,
        ),
        c(
            "space_between",
            __("Space Between", 'breakdance'),
            [],
            ['type' => 'unit', 'layout' => 'inline', 'unitOptions' => ['defaultType' => 'px'], 'rangeOptions' => ['min' => 0, 'max' => 100, 'step' => 1], 'condition' => ['0' => ['0' => ['path' => '%%CURRENTPATH%%.position', 'operand' => 'not equals', 'value' => 'inherit']], '1' => ['0' => ['path' => '%%CURRENTPATH%%.style', 'operand' => 'not equals', 'value' => 'bar']]]],
            false,
            false,
        ),
        c(
            "space_after",
            __("Space After", 'breakdance'),
            [],
            ['type' => 'unit', 'layout' => 'inline', 'unitOptions' => ['defaultType' => 'px'], 'rangeOptions' => ['min' => 0, 'max' => 100, 'step' => 1], 'condition' => ['path' => '%%CURRENTPATH%%.position', 'operand' => 'not equals', 'value' => 'inherit']],
            true,
            false,
        ),
        c(
            "bar",
            __("Bar", 'breakdance'),
            [c(
                "separator",
                __("Separator", 'breakdance'),
                [],
                ['type' => 'color', 'layout' => 'inline'],
                false,
                false,
            ), c(
                "radius",
                __("Radius", 'breakdance'),
                [],
                ['type' => 'unit', 'layout' => 'inline'],
                false,
                false,
            ), c(
                "shadow",
                __("Shadow", 'breakdance'),
                [],
                ['type' => 'shadow', 'layout' => 'vertical'],
                false,
                false,
            )],
            ['type' => 'section', 'layout' => 'inline', 'sectionOptions' => ['type' => 'popout'], 'condition' => ['path' => '%%CURRENTPATH%%.style', 'operand' => 'equals', 'value' => 'bar']],
            false,
            false,
        ), c(
            "pill_radius",
            __("Pill Radius", 'breakdance'),
            [],
            ['type' => 'unit', 'layout' => 'inline', 'condition' => ['path' => '%%CURRENTPATH%%.style', 'operand' => 'equals', 'value' => 'pills']],
            false,
            false,
        ), c(
            "separator",
            __("Separator", 'breakdance'),
            [c(
                "color",
                __("Color", 'breakdance'),
                [],
                ['type' => 'color', 'layout' => 'inline'],
                false,
                false,
            ), c(
                "width",
                __("Width", 'breakdance'),
                [],
                ['type' => 'unit', 'layout' => 'inline'],
                false,
                false,
            )],
            ['type' => 'section', 'layout' => 'inline', 'sectionOptions' => ['type' => 'popout'], 'condition' => ['path' => '%%CURRENTPATH%%.style', 'operand' => 'equals', 'value' => 'tabs']],
            false,
            false,
        ), c(
            "text",
            __("Text", 'breakdance'),
            [
                getPresetSection("EssentialElements\\typography_with_align", __('Typography', 'breakdance'), 'typography', ['type' => 'popout']),
                c(
                    "hover",
                    __("Hover", 'breakdance'),
                    [],
                    ['type' => 'color', 'layout' => 'inline'],
                    false,
                    false,
                ), c(
                    "active",
                    __("Active", 'breakdance'),
                    [],
                    ['type' => 'color', 'layout' => 'inline'],
                    false,
                    false,
                )],
            ['type' => 'section', 'layout' => 'inline', 'sectionOptions' => ['type' => 'popout']],
            false,
            false,
        ), c(
            "background",
            __("Background", 'breakdance'),
            [c(
                "inactive",
                __("Inactive", 'breakdance'),
                [],
                ['type' => 'color', 'layout' => 'inline'],
                false,
                false,
            ), c(
                "hover",
                __("Hover", 'breakdance'),
                [],
                ['type' => 'color', 'layout' => 'inline'],
                false,
                false,
            ), c(
                "active",
                __("Active", 'breakdance'),
                [],
                ['type' => 'color', 'layout' => 'inline'],
                false,
                false,
            )],
            ['type' => 'section', 'layout' => 'inline', 'sectionOptions' => ['type' => 'popout']],
            false,
            false,
        ), c(
            "underline",
            __("Underline", 'breakdance'),
            [c(
                "hover",
                __("Hover", 'breakdance'),
                [],
                ['type' => 'color', 'layout' => 'inline'],
                false,
                false,
            ), c(
                "active",
                __("Active", 'breakdance'),
                [],
                ['type' => 'color', 'layout' => 'inline'],
                false,
                false,
            ), c(
                "width",
                __("Width", 'breakdance'),
                [],
                ['type' => 'unit', 'layout' => 'inline'],
                false,
                false,
            ), c(
                "radius",
                __("Radius", 'breakdance'),
                [],
                ['type' => 'unit', 'layout' => 'inline'],
                false,
                false,
            )],
            ['type' => 'section', 'layout' => 'inline', 'sectionOptions' => ['type' => 'popout'], 'condition' => ['path' => '%%CURRENTPATH%%.style', 'operand' => 'not equals', 'value' => 'pills']],
            false,
            false,
        ), c(
            "padding",
            __("Padding", 'breakdance'),
            [c(
                "vertical",
                __("Vertical", 'breakdance'),
                [],
                ['type' => 'unit', 'layout' => 'inline'],
                false,
                false,
            ), c(
                "horizontal",
                __("Horizontal", 'breakdance'),
                [],
                ['type' => 'unit', 'layout' => 'inline'],
                false,
                false,
            )],
            ['type' => 'section', 'layout' => 'inline', 'sectionOptions' => ['type' => 'popout']],
            false,
            false,
        ), c(
            "icon",
            __("Icon", 'breakdance'),
            [c(
                "size",
                __("Size", 'breakdance'),
                [],
                ['type' => 'unit', 'layout' => 'inline', 'unitOptions' => ['types' => ['0' => 'px'], 'defaultType' => 'px'], 'rangeOptions' => ['min' => 0, 'max' => 100, 'step' => 1], 'condition' => ['path' => 'design.design.align', 'operand' => 'not equals', 'value' => 'none']],
                false,
                false,
            ), c(
                "nudge",
                __("Nudge", 'breakdance'),
                [c(
                    "nudge_x",
                    __("Nudge X", 'breakdance'),
                    [],
                    ['type' => 'unit', 'layout' => 'inline', 'unitOptions' => ['types' => ['0' => 'px'], 'defaultType' => 'px'], 'rangeOptions' => ['min' => -20, 'max' => 20, 'step' => 1]],
                    false,
                    false,
                ), c(
                    "nudge_y",
                    __("Nudge Y", 'breakdance'),
                    [],
                    ['type' => 'unit', 'layout' => 'inline', 'unitOptions' => ['types' => ['0' => 'px'], 'defaultType' => 'px'], 'rangeOptions' => ['min' => -20, 'max' => 20, 'step' => 1]],
                    false,
                    false,
                )],
                ['type' => 'section', 'layout' => 'inline', 'sectionOptions' => ['type' => 'popout']],
                false,
                false,
            ), c(
                "after_icon",
                __("After Icon", 'breakdance'),
                [],
                ['type' => 'unit', 'layout' => 'inline', 'unitOptions' => ['types' => ['0' => 'px'], 'defaultType' => 'px'], 'rangeOptions' => ['min' => 0, 'max' => 32, 'step' => 1]],
                false,
                false,
            )],
            ['type' => 'section', 'sectionOptions' => ['type' => 'popout']],
            false,
            false,
        ), c(
            "responsive",
            __("Responsive", 'breakdance'),
            [c(
                "show_as_dropdown",
                __("Show as Dropdown", 'breakdance'),
                [],
                ['type' => 'toggle', 'layout' => 'inline'],
                false,
                false,
                [],
            ), c(
                "visible_at",
                __("Visible At", 'breakdance'),
                [],
                ['type' => 'breakpoint_dropdown', 'layout' => 'inline', 'condition' => ['path' => '%%CURRENTPATH%%.show_as_dropdown', 'operand' => 'is set']],
                false,
                false,
                [],
            ), c(
                "dropdown_styles",
                __("Dropdown Styles", 'breakdance'),
                [c(
                    "background",
                    __("Background", 'breakdance'),
                    [],
                    ['type' => 'color', 'layout' => 'inline'],
                    false,
                    false,
                    [],
                ), getPresetSection(
                    "EssentialElements\\borders",
                    __("Borders", 'breakdance'),
                    "borders",
                    ['type' => 'popout']
                ), getPresetSection(
                    "EssentialElements\\spacing_padding_all",
                    __("Padding", 'breakdance'),
                    "padding",
                    ['type' => 'popout']
                ), getPresetSection(
                    "EssentialElements\\typography",
                    __("Typography", 'breakdance'),
                    "typography",
                    ['type' => 'popout']
                )],
                ['type' => 'section', 'layout' => 'inline', 'sectionOptions' => ['type' => 'popout'], 'condition' => ['path' => '%%CURRENTPATH%%.show_as_dropdown', 'operand' => 'is set']],
                false,
                false,
                [],
            ), c(
                "show_affordance",
                __("Show Affordance", 'breakdance'),
                [],
                ['type' => 'toggle', 'layout' => 'inline', 'condition' => ['path' => '%%CURRENTPATH%%.show_as_dropdown', 'operand' => 'is not set']],
                false,
                false,
                [],
            ), c(
                "affordance_color",
                __("Color", 'breakdance'),
                [],
                ['type' => 'color', 'layout' => 'inline', 'colorOptions' => ['type' => 'solidOnly'], 'condition' => ['path' => '%%CURRENTPATH%%.show_affordance', 'operand' => 'is set']],
                false,
                false,
                [],
            )],
            ['type' => 'section', 'sectionOptions' => ['type' => 'popout']],
            false,
            false,
            [],
        ), c(
            "transition_effect",
            __("Transition Effect", 'breakdance'),
            [],
            ['type' => 'unit', 'layout' => 'inline', 'unitOptions' => ['types' => ['0' => 'ms']], 'rangeOptions' => ['min' => 0, 'max' => 1000, 'step' => 1]],
            false,
            false,
        )],
    ),
    true,
    ['responsive.visible_at', 'responsive.stack_vertically_at']
    );
});
