wpforms.php
1634 lines
| 1 | <?php |
| 2 | use Elementor\Controls_Manager; |
| 3 | use Elementor\Group_Control_Typography; |
| 4 | use Elementor\Group_Control_Background; |
| 5 | use Elementor\Group_Control_Box_Shadow; |
| 6 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 7 | use Elementor\Group_Control_Border; |
| 8 | |
| 9 | function auxin_extend_wpforms_elementor_widget($element, $args) { |
| 10 | if ($element->get_name() !== 'wpforms') { |
| 11 | return; |
| 12 | } |
| 13 | |
| 14 | $element->start_controls_section( |
| 15 | 'aux_core_general_input_section', |
| 16 | [ |
| 17 | 'label' => __('All Inputs', 'auxin-elements' ), |
| 18 | 'tab' => Controls_Manager::TAB_STYLE, |
| 19 | ] |
| 20 | ); |
| 21 | |
| 22 | $element->add_group_control( |
| 23 | Group_Control_Typography::get_type(), |
| 24 | [ |
| 25 | 'name' => 'general_input_typography', |
| 26 | 'label' => __( 'Typography', 'auxin-elements' ), |
| 27 | 'global' => [ |
| 28 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 29 | ], |
| 30 | 'selector' => '{{WRAPPER}} input' |
| 31 | ] |
| 32 | ); |
| 33 | |
| 34 | $element->add_control( |
| 35 | 'general_input_color', |
| 36 | [ |
| 37 | 'label' => __( 'Color', 'auxin-elements' ), |
| 38 | 'type' => Controls_Manager::COLOR, |
| 39 | 'selectors' => [ |
| 40 | '{{WRAPPER}} input,{{WRAPPER}} textarea, {{WRAPPER}} select option, {{WRAPPER}} select' => 'color: {{VALUE}};' |
| 41 | ] |
| 42 | ] |
| 43 | ); |
| 44 | |
| 45 | $element->add_responsive_control( |
| 46 | 'general_input_width', |
| 47 | [ |
| 48 | 'label' => __( 'Width', 'auxin-elements' ), |
| 49 | 'size_units' => [ 'px','em', '%'], |
| 50 | 'type' => Controls_Manager::SLIDER, |
| 51 | 'range' => [ |
| 52 | 'px' => [ |
| 53 | 'min' => 0, |
| 54 | 'max' => 1000, |
| 55 | 'step' => 5, |
| 56 | ], |
| 57 | '%' => [ |
| 58 | 'min' => 0, |
| 59 | 'max' => 100, |
| 60 | ], |
| 61 | 'em' => [ |
| 62 | 'min' => 0, |
| 63 | 'max' => 100, |
| 64 | ], |
| 65 | ], |
| 66 | 'selectors' => [ |
| 67 | '{{WRAPPER}} input' => 'width: {{SIZE}}{{UNIT}};' |
| 68 | ] |
| 69 | ] |
| 70 | ); |
| 71 | |
| 72 | $element->add_responsive_control( |
| 73 | 'general_input_max_width', |
| 74 | [ |
| 75 | 'label' => __( 'Max Width', 'auxin-elements' ), |
| 76 | 'size_units' => [ 'px','em', '%'], |
| 77 | 'type' => Controls_Manager::SLIDER, |
| 78 | 'range' => [ |
| 79 | 'px' => [ |
| 80 | 'min' => 0, |
| 81 | 'max' => 1000, |
| 82 | 'step' => 5 |
| 83 | ], |
| 84 | '%' => [ |
| 85 | 'min' => 0, |
| 86 | 'max' => 100 |
| 87 | ], |
| 88 | 'em' => [ |
| 89 | 'min' => 0, |
| 90 | 'max' => 100 |
| 91 | ] |
| 92 | ], |
| 93 | 'selectors' => [ |
| 94 | '{{WRAPPER}} input' => 'max-width: {{SIZE}}{{UNIT}};' |
| 95 | ] |
| 96 | ] |
| 97 | ); |
| 98 | |
| 99 | $element->add_responsive_control( |
| 100 | 'general_input_height', |
| 101 | [ |
| 102 | 'label' => __( 'Height', 'auxin-elements' ), |
| 103 | 'size_units' => [ 'px', 'em'], |
| 104 | 'type' => Controls_Manager::SLIDER, |
| 105 | 'range' => [ |
| 106 | 'px' => [ |
| 107 | 'min' => 0, |
| 108 | 'max' => 1000, |
| 109 | 'step' => 5 |
| 110 | ], |
| 111 | '%' => [ |
| 112 | 'min' => 0, |
| 113 | 'max' => 100 |
| 114 | ], |
| 115 | 'em' => [ |
| 116 | 'min' => 0, |
| 117 | 'max' => 100 |
| 118 | ] |
| 119 | ], |
| 120 | 'selectors' => [ |
| 121 | '{{WRAPPER}} input' => 'height: {{SIZE}}{{UNIT}};' |
| 122 | ], |
| 123 | 'separator' => 'after' |
| 124 | ] |
| 125 | ); |
| 126 | |
| 127 | |
| 128 | $element->add_responsive_control( |
| 129 | 'general_input_border_radius', |
| 130 | [ |
| 131 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 132 | 'type' => Controls_Manager::DIMENSIONS, |
| 133 | 'size_units' => [ 'px', '%' ], |
| 134 | 'selectors' => [ |
| 135 | '{{WRAPPER}} input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 136 | ], |
| 137 | ] |
| 138 | ); |
| 139 | |
| 140 | $element->add_responsive_control( |
| 141 | 'general_input_padding', |
| 142 | [ |
| 143 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 144 | 'type' => Controls_Manager::DIMENSIONS, |
| 145 | 'size_units' => [ 'px', '%', 'em' ], |
| 146 | 'selectors' => [ |
| 147 | '{{WRAPPER}} input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 148 | ], |
| 149 | 'separator' => 'after' |
| 150 | ] |
| 151 | ); |
| 152 | |
| 153 | $element->add_responsive_control( |
| 154 | 'general_input_margin', |
| 155 | [ |
| 156 | 'label' => __( 'Margin', 'auxin-elements' ), |
| 157 | 'type' => Controls_Manager::DIMENSIONS, |
| 158 | 'size_units' => [ 'px', '%', 'em' ], |
| 159 | 'selectors' => [ |
| 160 | '{{WRAPPER}} input' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 161 | ], |
| 162 | 'separator' => 'after' |
| 163 | ] |
| 164 | ); |
| 165 | |
| 166 | // Background and Box Shadow for input - START |
| 167 | $element->start_controls_tabs( 'general_input_tabs' ); |
| 168 | |
| 169 | $element->start_controls_tab( |
| 170 | 'general_input_tab_normal_state', |
| 171 | [ |
| 172 | 'label' => __( 'Normal', 'auxin-elements' ), |
| 173 | ] |
| 174 | ); |
| 175 | |
| 176 | $element->add_group_control( |
| 177 | Group_Control_Background::get_type(), |
| 178 | [ |
| 179 | 'name' => 'general_input_background', |
| 180 | 'selector' => '{{WRAPPER}} input', |
| 181 | 'types' => [ 'classic', 'gradient'] |
| 182 | ] |
| 183 | ); |
| 184 | |
| 185 | $element->add_group_control( |
| 186 | Group_Control_Box_Shadow::get_type(), |
| 187 | [ |
| 188 | 'name' => 'general_input_box_shadow', |
| 189 | 'selector' => '{{WRAPPER}} input' |
| 190 | ] |
| 191 | ); |
| 192 | |
| 193 | $element->add_group_control( |
| 194 | Group_Control_Border::get_type(), |
| 195 | [ |
| 196 | 'name' => 'general_input_border', |
| 197 | 'selector' => '{{WRAPPER}} input' |
| 198 | ] |
| 199 | ); |
| 200 | |
| 201 | $element->end_controls_tab(); |
| 202 | |
| 203 | $element->start_controls_tab( |
| 204 | 'general_input_tab_hover_state', |
| 205 | [ |
| 206 | 'label' => __( 'Hover', 'auxin-elements' ), |
| 207 | ] |
| 208 | ); |
| 209 | |
| 210 | $element->add_group_control( |
| 211 | Group_Control_Background::get_type(), |
| 212 | [ |
| 213 | 'name' => 'general_input_background_hover', |
| 214 | 'selector' => '{{WRAPPER}} input:hover', |
| 215 | 'types' => [ 'classic', 'gradient'] |
| 216 | ] |
| 217 | ); |
| 218 | |
| 219 | $element->add_group_control( |
| 220 | Group_Control_Box_Shadow::get_type(), |
| 221 | [ |
| 222 | 'name' => 'general_input_box_shadow_hover', |
| 223 | 'selector' => '{{WRAPPER}} input:hover' |
| 224 | ] |
| 225 | ); |
| 226 | |
| 227 | $element->add_group_control( |
| 228 | Group_Control_Border::get_type(), |
| 229 | [ |
| 230 | 'name' => 'general_input_border_hover', |
| 231 | 'selector' => '{{WRAPPER}} input:hover' |
| 232 | ] |
| 233 | ); |
| 234 | |
| 235 | $element->add_control( |
| 236 | 'general_input_transition', |
| 237 | [ |
| 238 | 'label' => __( 'Transition Duration', 'auxin-elements' ), |
| 239 | 'type' => Controls_Manager::SLIDER, |
| 240 | 'default' => [ |
| 241 | 'size' => 0.3, |
| 242 | ], |
| 243 | 'range' => [ |
| 244 | 'px' => [ |
| 245 | 'max' => 3, |
| 246 | 'step' => 0.1, |
| 247 | ], |
| 248 | ], |
| 249 | 'render_type' => 'ui', |
| 250 | 'selectors' => [ |
| 251 | '{{WRAPPER}} input' => "transition:all ease-out {{SIZE}}s;" |
| 252 | ] |
| 253 | ] |
| 254 | ); |
| 255 | |
| 256 | $element->end_controls_tab(); |
| 257 | |
| 258 | $element->start_controls_tab( |
| 259 | 'general_input_tab_focus_state', |
| 260 | [ |
| 261 | 'label' => __( 'Focus', 'auxin-elements' ), |
| 262 | ] |
| 263 | ); |
| 264 | |
| 265 | $element->add_group_control( |
| 266 | Group_Control_Background::get_type(), |
| 267 | [ |
| 268 | 'name' => 'general_input_background_focus', |
| 269 | 'selector' => '{{WRAPPER}} input:focus, {{WRAPPER}} input:focus:invalid', |
| 270 | 'types' => [ 'classic', 'gradient'] |
| 271 | ] |
| 272 | ); |
| 273 | |
| 274 | $element->add_group_control( |
| 275 | Group_Control_Box_Shadow::get_type(), |
| 276 | [ |
| 277 | 'name' => 'general_input_box_shadow_focus', |
| 278 | 'selector' => '{{WRAPPER}} input:focus, {{WRAPPER}} input:focus:invalid' |
| 279 | ] |
| 280 | ); |
| 281 | |
| 282 | $element->add_group_control( |
| 283 | Group_Control_Border::get_type(), |
| 284 | [ |
| 285 | 'name' => 'general_input_border_focus', |
| 286 | 'selector' => '{{WRAPPER}} input:focus, {{WRAPPER}} input:focus:invalid' |
| 287 | ] |
| 288 | ); |
| 289 | |
| 290 | $element->end_controls_tab(); |
| 291 | |
| 292 | $element->end_controls_tabs(); |
| 293 | // Background and Box Shadow for input - END |
| 294 | |
| 295 | $element->end_controls_section(); |
| 296 | |
| 297 | /* -------------------------------------------------------------------------- */ |
| 298 | /* Placeholder Style |
| 299 | /* -------------------------------------------------------------------------- */ |
| 300 | $element->start_controls_section( |
| 301 | 'aux_core_placeholder_section', |
| 302 | [ |
| 303 | 'label' => __('Input Placeholder', 'auxin-elements' ), |
| 304 | 'tab' => Controls_Manager::TAB_STYLE |
| 305 | ] |
| 306 | ); |
| 307 | |
| 308 | $element->add_group_control( |
| 309 | Group_Control_Typography::get_type(), |
| 310 | [ |
| 311 | 'name' => 'placeholder_typography', |
| 312 | 'label' => __( 'Typography', 'auxin-elements' ), |
| 313 | 'global' => [ |
| 314 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 315 | ], |
| 316 | 'selector' => '{{WRAPPER}} input::placeholder' |
| 317 | ] |
| 318 | ); |
| 319 | |
| 320 | $element->add_control( |
| 321 | 'placeholder_color', |
| 322 | [ |
| 323 | 'label' => __( 'Color', 'auxin-elements' ), |
| 324 | 'type' => Controls_Manager::COLOR, |
| 325 | 'selectors' => [ |
| 326 | '{{WRAPPER}} input::placeholder' => 'color: {{VALUE}};' |
| 327 | ] |
| 328 | ] |
| 329 | ); |
| 330 | |
| 331 | $element->end_controls_section(); |
| 332 | |
| 333 | /* -------------------------------------------------------------------------- */ |
| 334 | /* Text Input Style |
| 335 | /* -------------------------------------------------------------------------- */ |
| 336 | |
| 337 | $element->start_controls_section( |
| 338 | 'aux_core_text_input_section', |
| 339 | [ |
| 340 | 'label' => __('Text Inputs', 'auxin-elements' ), |
| 341 | 'tab' => Controls_Manager::TAB_STYLE, |
| 342 | ] |
| 343 | ); |
| 344 | |
| 345 | $element->add_control( |
| 346 | 'text_input_color', |
| 347 | [ |
| 348 | 'label' => __( 'Color', 'auxin-elements' ), |
| 349 | 'type' => Controls_Manager::COLOR, |
| 350 | 'selectors' => [ |
| 351 | '{{WRAPPER}} input[type="text"]' => 'color: {{VALUE}};' |
| 352 | ] |
| 353 | ] |
| 354 | ); |
| 355 | |
| 356 | $element->add_responsive_control( |
| 357 | 'text_input_width', |
| 358 | [ |
| 359 | 'label' => __( 'Width', 'auxin-elements' ), |
| 360 | 'size_units' => [ 'px','em', '%'], |
| 361 | 'type' => Controls_Manager::SLIDER, |
| 362 | 'range' => [ |
| 363 | 'px' => [ |
| 364 | 'min' => 0, |
| 365 | 'max' => 1000, |
| 366 | 'step' => 5, |
| 367 | ], |
| 368 | '%' => [ |
| 369 | 'min' => 0, |
| 370 | 'max' => 100, |
| 371 | ], |
| 372 | 'em' => [ |
| 373 | 'min' => 0, |
| 374 | 'max' => 100, |
| 375 | ], |
| 376 | ], |
| 377 | 'selectors' => [ |
| 378 | '{{WRAPPER}} input[type="text"]' => 'width: {{SIZE}}{{UNIT}};', |
| 379 | ], |
| 380 | ] |
| 381 | ); |
| 382 | |
| 383 | $element->add_responsive_control( |
| 384 | 'text_input_max_width', |
| 385 | [ |
| 386 | 'label' => __( 'Max Width', 'auxin-elements' ), |
| 387 | 'size_units' => [ 'px','em', '%'], |
| 388 | 'type' => Controls_Manager::SLIDER, |
| 389 | 'range' => [ |
| 390 | 'px' => [ |
| 391 | 'min' => 0, |
| 392 | 'max' => 1000, |
| 393 | 'step' => 5 |
| 394 | ], |
| 395 | '%' => [ |
| 396 | 'min' => 0, |
| 397 | 'max' => 100 |
| 398 | ], |
| 399 | 'em' => [ |
| 400 | 'min' => 0, |
| 401 | 'max' => 100 |
| 402 | ] |
| 403 | ], |
| 404 | 'selectors' => [ |
| 405 | '{{WRAPPER}} input[type="text"]' => 'max-width: {{SIZE}}{{UNIT}};', |
| 406 | ] |
| 407 | ] |
| 408 | ); |
| 409 | |
| 410 | $element->add_responsive_control( |
| 411 | 'text_input_height', |
| 412 | [ |
| 413 | 'label' => __( 'Height', 'auxin-elements' ), |
| 414 | 'size_units' => [ 'px', 'em'], |
| 415 | 'type' => Controls_Manager::SLIDER, |
| 416 | 'range' => [ |
| 417 | 'px' => [ |
| 418 | 'min' => 0, |
| 419 | 'max' => 1000, |
| 420 | 'step' => 5 |
| 421 | ], |
| 422 | '%' => [ |
| 423 | 'min' => 0, |
| 424 | 'max' => 100 |
| 425 | ], |
| 426 | 'em' => [ |
| 427 | 'min' => 0, |
| 428 | 'max' => 100 |
| 429 | ] |
| 430 | ], |
| 431 | 'selectors' => [ |
| 432 | '{{WRAPPER}} input[type="text"]' => 'height: {{SIZE}}{{UNIT}};', |
| 433 | ], |
| 434 | 'separator' => 'after' |
| 435 | ] |
| 436 | ); |
| 437 | |
| 438 | |
| 439 | $element->add_group_control( |
| 440 | Group_Control_Border::get_type(), |
| 441 | [ |
| 442 | 'name' => 'text_input_border', |
| 443 | 'selector' => '{{WRAPPER}} input[type="text"]' |
| 444 | ] |
| 445 | ); |
| 446 | |
| 447 | $element->add_responsive_control( |
| 448 | 'text_input_border_radius', |
| 449 | [ |
| 450 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 451 | 'type' => Controls_Manager::DIMENSIONS, |
| 452 | 'size_units' => [ 'px', '%' ], |
| 453 | 'selectors' => [ |
| 454 | '{{WRAPPER}} input[type="text"]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 455 | ], |
| 456 | ] |
| 457 | ); |
| 458 | |
| 459 | $element->add_responsive_control( |
| 460 | 'text_input_padding', |
| 461 | [ |
| 462 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 463 | 'type' => Controls_Manager::DIMENSIONS, |
| 464 | 'size_units' => [ 'px', '%', 'em' ], |
| 465 | 'selectors' => [ |
| 466 | '{{WRAPPER}} input[type="text"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 467 | ], |
| 468 | 'separator' => 'after' |
| 469 | ] |
| 470 | ); |
| 471 | |
| 472 | // Background and Box Shadow for input - START |
| 473 | $element->start_controls_tabs( 'text_input_tabs' ); |
| 474 | |
| 475 | $element->start_controls_tab( |
| 476 | 'text_input_tab_normal_state', |
| 477 | [ |
| 478 | 'label' => __( 'Normal', 'auxin-elements' ), |
| 479 | ] |
| 480 | ); |
| 481 | |
| 482 | $element->add_group_control( |
| 483 | Group_Control_Background::get_type(), |
| 484 | [ |
| 485 | 'name' => 'text_input_background', |
| 486 | 'selector' => '{{WRAPPER}} input[type="text"]', |
| 487 | 'types' => [ 'classic', 'gradient'] |
| 488 | ] |
| 489 | ); |
| 490 | |
| 491 | $element->add_group_control( |
| 492 | Group_Control_Box_Shadow::get_type(), |
| 493 | [ |
| 494 | 'name' => 'text_input_box_shadow', |
| 495 | 'selector' => '{{WRAPPER}} input[type="text"]' |
| 496 | ] |
| 497 | ); |
| 498 | |
| 499 | $element->end_controls_tab(); |
| 500 | |
| 501 | $element->start_controls_tab( |
| 502 | 'text_input_tab_hover_state', |
| 503 | [ |
| 504 | 'label' => __( 'Hover', 'auxin-elements' ), |
| 505 | ] |
| 506 | ); |
| 507 | |
| 508 | $element->add_group_control( |
| 509 | Group_Control_Background::get_type(), |
| 510 | [ |
| 511 | 'name' => 'text_input_background_hover', |
| 512 | 'selector' => '{{WRAPPER}} input[type="text"]:hover', |
| 513 | 'types' => [ 'classic', 'gradient'] |
| 514 | ] |
| 515 | ); |
| 516 | |
| 517 | $element->add_group_control( |
| 518 | Group_Control_Box_Shadow::get_type(), |
| 519 | [ |
| 520 | 'name' => 'text_input_box_shadow_hover', |
| 521 | 'selector' => '{{WRAPPER}} input[type="text"]:hover' |
| 522 | ] |
| 523 | ); |
| 524 | |
| 525 | $element->add_control( |
| 526 | 'text_input_transition', |
| 527 | [ |
| 528 | 'label' => __( 'Transition Duration', 'auxin-elements' ), |
| 529 | 'type' => Controls_Manager::SLIDER, |
| 530 | 'default' => [ |
| 531 | 'size' => 0.3, |
| 532 | ], |
| 533 | 'range' => [ |
| 534 | 'px' => [ |
| 535 | 'max' => 3, |
| 536 | 'step' => 0.1, |
| 537 | ], |
| 538 | ], |
| 539 | 'render_type' => 'ui', |
| 540 | 'selectors' => [ |
| 541 | '{{WRAPPER}} input[type="text"]' => "transition:all ease-out {{SIZE}}s;" |
| 542 | ] |
| 543 | ] |
| 544 | ); |
| 545 | |
| 546 | $element->end_controls_tab(); |
| 547 | |
| 548 | $element->end_controls_tabs(); |
| 549 | // Background and Box Shadow for input - END |
| 550 | |
| 551 | $element->end_controls_section(); |
| 552 | |
| 553 | /* -------------------------------------------------------------------------- */ |
| 554 | /* Email Input Style |
| 555 | /* -------------------------------------------------------------------------- */ |
| 556 | |
| 557 | $element->start_controls_section( |
| 558 | 'aux_core_email_input_section', |
| 559 | [ |
| 560 | 'label' => __('Email Inputs', 'auxin-elements' ), |
| 561 | 'tab' => Controls_Manager::TAB_STYLE |
| 562 | ] |
| 563 | ); |
| 564 | |
| 565 | $element->add_control( |
| 566 | 'email_input_color', |
| 567 | [ |
| 568 | 'label' => __( 'Color', 'auxin-elements' ), |
| 569 | 'type' => Controls_Manager::COLOR, |
| 570 | 'selectors' => [ |
| 571 | '{{WRAPPER}} input[type="email"]' => 'color: {{VALUE}};' |
| 572 | ] |
| 573 | ] |
| 574 | ); |
| 575 | |
| 576 | $element->add_responsive_control( |
| 577 | 'email_input_width', |
| 578 | [ |
| 579 | 'label' => __( 'Width', 'auxin-elements' ), |
| 580 | 'size_units' => [ 'px','em', '%'], |
| 581 | 'type' => Controls_Manager::SLIDER, |
| 582 | 'range' => [ |
| 583 | 'px' => [ |
| 584 | 'min' => 0, |
| 585 | 'max' => 1000, |
| 586 | 'step' => 5, |
| 587 | ], |
| 588 | '%' => [ |
| 589 | 'min' => 0, |
| 590 | 'max' => 100, |
| 591 | ], |
| 592 | 'em' => [ |
| 593 | 'min' => 0, |
| 594 | 'max' => 100, |
| 595 | ], |
| 596 | ], |
| 597 | 'selectors' => [ |
| 598 | '{{WRAPPER}} input[type="email"]' => 'width: {{SIZE}}{{UNIT}};' |
| 599 | ], |
| 600 | ] |
| 601 | ); |
| 602 | |
| 603 | $element->add_responsive_control( |
| 604 | 'email_input_max_width', |
| 605 | [ |
| 606 | 'label' => __( 'Max Width', 'auxin-elements' ), |
| 607 | 'size_units' => [ 'px','em', '%'], |
| 608 | 'type' => Controls_Manager::SLIDER, |
| 609 | 'range' => [ |
| 610 | 'px' => [ |
| 611 | 'min' => 0, |
| 612 | 'max' => 1000, |
| 613 | 'step' => 5 |
| 614 | ], |
| 615 | '%' => [ |
| 616 | 'min' => 0, |
| 617 | 'max' => 100 |
| 618 | ], |
| 619 | 'em' => [ |
| 620 | 'min' => 0, |
| 621 | 'max' => 100 |
| 622 | ] |
| 623 | ], |
| 624 | 'selectors' => [ |
| 625 | '{{WRAPPER}} input[type="email"]' => 'max-width: {{SIZE}}{{UNIT}};' |
| 626 | ] |
| 627 | ] |
| 628 | ); |
| 629 | |
| 630 | $element->add_responsive_control( |
| 631 | 'email_input_height', |
| 632 | [ |
| 633 | 'label' => __( 'Height', 'auxin-elements' ), |
| 634 | 'size_units' => [ 'px', 'em'], |
| 635 | 'type' => Controls_Manager::SLIDER, |
| 636 | 'range' => [ |
| 637 | 'px' => [ |
| 638 | 'min' => 0, |
| 639 | 'max' => 1000, |
| 640 | 'step' => 5 |
| 641 | ], |
| 642 | '%' => [ |
| 643 | 'min' => 0, |
| 644 | 'max' => 100 |
| 645 | ], |
| 646 | 'em' => [ |
| 647 | 'min' => 0, |
| 648 | 'max' => 100 |
| 649 | ] |
| 650 | ], |
| 651 | 'selectors' => [ |
| 652 | '{{WRAPPER}} input[type="email"]' => 'height: {{SIZE}}{{UNIT}};' |
| 653 | ], |
| 654 | 'separator' => 'after' |
| 655 | ] |
| 656 | ); |
| 657 | |
| 658 | |
| 659 | $element->add_group_control( |
| 660 | Group_Control_Border::get_type(), |
| 661 | [ |
| 662 | 'name' => 'email_input_border', |
| 663 | 'selector' => '{{WRAPPER}} input[type="email"]' |
| 664 | ] |
| 665 | ); |
| 666 | |
| 667 | $element->add_responsive_control( |
| 668 | 'email_input_border_radius', |
| 669 | [ |
| 670 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 671 | 'type' => Controls_Manager::DIMENSIONS, |
| 672 | 'size_units' => [ 'px', '%' ], |
| 673 | 'selectors' => [ |
| 674 | '{{WRAPPER}} input[type="email"]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 675 | ], |
| 676 | ] |
| 677 | ); |
| 678 | |
| 679 | $element->add_responsive_control( |
| 680 | 'email_input_padding', |
| 681 | [ |
| 682 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 683 | 'type' => Controls_Manager::DIMENSIONS, |
| 684 | 'size_units' => [ 'px', '%', 'em' ], |
| 685 | 'selectors' => [ |
| 686 | '{{WRAPPER}} input[type="email"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 687 | ], |
| 688 | 'separator' => 'after' |
| 689 | ] |
| 690 | ); |
| 691 | |
| 692 | // Background and Box Shadow for input - START |
| 693 | $element->start_controls_tabs( 'email_input_tabs' ); |
| 694 | |
| 695 | $element->start_controls_tab( |
| 696 | 'email_input_tab_normal_state', |
| 697 | [ |
| 698 | 'label' => __( 'Normal', 'auxin-elements' ), |
| 699 | ] |
| 700 | ); |
| 701 | |
| 702 | $element->add_group_control( |
| 703 | Group_Control_Background::get_type(), |
| 704 | [ |
| 705 | 'name' => 'email_input_background', |
| 706 | 'selector' => '{{WRAPPER}} input[type="email"]', |
| 707 | 'types' => [ 'classic', 'gradient'] |
| 708 | ] |
| 709 | ); |
| 710 | |
| 711 | $element->add_group_control( |
| 712 | Group_Control_Box_Shadow::get_type(), |
| 713 | [ |
| 714 | 'name' => 'email_input_box_shadow', |
| 715 | 'selector' => '{{WRAPPER}} input[type="email"]' |
| 716 | ] |
| 717 | ); |
| 718 | |
| 719 | $element->end_controls_tab(); |
| 720 | |
| 721 | $element->start_controls_tab( |
| 722 | 'email_input_tab_hover_state', |
| 723 | [ |
| 724 | 'label' => __( 'Hover', 'auxin-elements' ), |
| 725 | ] |
| 726 | ); |
| 727 | |
| 728 | $element->add_group_control( |
| 729 | Group_Control_Background::get_type(), |
| 730 | [ |
| 731 | 'name' => 'email_input_background_hover', |
| 732 | 'selector' => '{{WRAPPER}} input[type="email"]:hover', |
| 733 | 'types' => [ 'classic', 'gradient'] |
| 734 | ] |
| 735 | ); |
| 736 | |
| 737 | $element->add_group_control( |
| 738 | Group_Control_Box_Shadow::get_type(), |
| 739 | [ |
| 740 | 'name' => 'email_input_box_shadow_hover', |
| 741 | 'selector' => '{{WRAPPER}} input[type="email"]:hover' |
| 742 | ] |
| 743 | ); |
| 744 | |
| 745 | $element->add_control( |
| 746 | 'email_input_transition', |
| 747 | [ |
| 748 | 'label' => __( 'Transition Duration', 'auxin-elements' ), |
| 749 | 'type' => Controls_Manager::SLIDER, |
| 750 | 'default' => [ |
| 751 | 'size' => 0.3, |
| 752 | ], |
| 753 | 'range' => [ |
| 754 | 'px' => [ |
| 755 | 'max' => 3, |
| 756 | 'step' => 0.1, |
| 757 | ], |
| 758 | ], |
| 759 | 'render_type' => 'ui', |
| 760 | 'selectors' => [ |
| 761 | '{{WRAPPER}} input[type="email"]' => "transition:all ease-out {{SIZE}}s;" |
| 762 | ] |
| 763 | ] |
| 764 | ); |
| 765 | |
| 766 | $element->end_controls_tab(); |
| 767 | |
| 768 | $element->end_controls_tabs(); |
| 769 | |
| 770 | $element->end_controls_section(); |
| 771 | |
| 772 | /* -------------------------------------------------------------------------- */ |
| 773 | /* Dropdown Style |
| 774 | /* -------------------------------------------------------------------------- */ |
| 775 | |
| 776 | $element->start_controls_section( |
| 777 | 'aux_core_dropdown_section', |
| 778 | [ |
| 779 | 'label' => __('Dropdown', 'auxin-elements' ), |
| 780 | 'tab' => Controls_Manager::TAB_STYLE, |
| 781 | ] |
| 782 | ); |
| 783 | |
| 784 | $element->add_group_control( |
| 785 | Group_Control_Typography::get_type(), |
| 786 | [ |
| 787 | 'name' => 'dropdown_typography', |
| 788 | 'label' => __( 'Typography', 'auxin-elements' ), |
| 789 | 'global' => [ |
| 790 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 791 | ], |
| 792 | 'selector' => '{{WRAPPER}} select', |
| 793 | ] |
| 794 | ); |
| 795 | |
| 796 | $element->add_control( |
| 797 | 'dropdown_color', |
| 798 | [ |
| 799 | 'label' => __( 'Color', 'auxin-elements' ), |
| 800 | 'type' => Controls_Manager::COLOR, |
| 801 | 'selectors' => [ |
| 802 | '{{WRAPPER}} select' => 'color: {{VALUE}};', |
| 803 | ] |
| 804 | ] |
| 805 | ); |
| 806 | |
| 807 | $element->add_responsive_control( |
| 808 | 'dropdown_width', |
| 809 | [ |
| 810 | 'label' => __( 'Width', 'auxin-elements' ), |
| 811 | 'size_units' => [ 'px','em', '%'], |
| 812 | 'type' => Controls_Manager::SLIDER, |
| 813 | 'range' => [ |
| 814 | 'px' => [ |
| 815 | 'min' => 0, |
| 816 | 'max' => 1000, |
| 817 | 'step' => 5, |
| 818 | ], |
| 819 | '%' => [ |
| 820 | 'min' => 0, |
| 821 | 'max' => 100, |
| 822 | ], |
| 823 | 'em' => [ |
| 824 | 'min' => 0, |
| 825 | 'max' => 100, |
| 826 | ], |
| 827 | ], |
| 828 | 'selectors' => [ |
| 829 | '{{WRAPPER}} select' => 'width: {{SIZE}}{{UNIT}};', |
| 830 | ], |
| 831 | ] |
| 832 | ); |
| 833 | |
| 834 | $element->add_responsive_control( |
| 835 | 'dropdown_max_width', |
| 836 | [ |
| 837 | 'label' => __( 'Max Width', 'auxin-elements' ), |
| 838 | 'size_units' => [ 'px','em', '%'], |
| 839 | 'type' => Controls_Manager::SLIDER, |
| 840 | 'range' => [ |
| 841 | 'px' => [ |
| 842 | 'min' => 0, |
| 843 | 'max' => 1000, |
| 844 | 'step' => 5 |
| 845 | ], |
| 846 | '%' => [ |
| 847 | 'min' => 0, |
| 848 | 'max' => 100 |
| 849 | ], |
| 850 | 'em' => [ |
| 851 | 'min' => 0, |
| 852 | 'max' => 100 |
| 853 | ] |
| 854 | ], |
| 855 | 'selectors' => [ |
| 856 | '{{WRAPPER}} select' => 'max-width: {{SIZE}}{{UNIT}};', |
| 857 | ] |
| 858 | ] |
| 859 | ); |
| 860 | |
| 861 | $element->add_responsive_control( |
| 862 | 'dropdown_height', |
| 863 | [ |
| 864 | 'label' => __( 'Height', 'auxin-elements' ), |
| 865 | 'size_units' => [ 'px', 'em'], |
| 866 | 'type' => Controls_Manager::SLIDER, |
| 867 | 'range' => [ |
| 868 | 'px' => [ |
| 869 | 'min' => 0, |
| 870 | 'max' => 1000, |
| 871 | 'step' => 5 |
| 872 | ], |
| 873 | '%' => [ |
| 874 | 'min' => 0, |
| 875 | 'max' => 100 |
| 876 | ], |
| 877 | 'em' => [ |
| 878 | 'min' => 0, |
| 879 | 'max' => 100 |
| 880 | ] |
| 881 | ], |
| 882 | 'selectors' => [ |
| 883 | '{{WRAPPER}} select' => 'height: {{SIZE}}{{UNIT}};', |
| 884 | ], |
| 885 | 'separator' => 'after' |
| 886 | ] |
| 887 | ); |
| 888 | |
| 889 | |
| 890 | $element->add_group_control( |
| 891 | Group_Control_Border::get_type(), |
| 892 | [ |
| 893 | 'name' => 'dropdown_border', |
| 894 | 'selector' => '{{WRAPPER}} select' |
| 895 | ] |
| 896 | ); |
| 897 | |
| 898 | $element->add_responsive_control( |
| 899 | 'dropdown_border_radius', |
| 900 | [ |
| 901 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 902 | 'type' => Controls_Manager::DIMENSIONS, |
| 903 | 'size_units' => [ 'px', '%' ], |
| 904 | 'selectors' => [ |
| 905 | '{{WRAPPER}} select' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 906 | ], |
| 907 | ] |
| 908 | ); |
| 909 | |
| 910 | $element->add_responsive_control( |
| 911 | 'dropdown_padding', |
| 912 | [ |
| 913 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 914 | 'type' => Controls_Manager::DIMENSIONS, |
| 915 | 'size_units' => [ 'px', '%', 'em' ], |
| 916 | 'selectors' => [ |
| 917 | '{{WRAPPER}} select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 918 | ], |
| 919 | 'separator' => 'after' |
| 920 | ] |
| 921 | ); |
| 922 | |
| 923 | $element->add_responsive_control( |
| 924 | 'dropdown_margin', |
| 925 | [ |
| 926 | 'label' => __( 'Margin', 'auxin-elements' ), |
| 927 | 'type' => Controls_Manager::DIMENSIONS, |
| 928 | 'size_units' => [ 'px', '%', 'em' ], |
| 929 | 'selectors' => [ |
| 930 | '{{WRAPPER}} select' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 931 | ], |
| 932 | 'separator' => 'after' |
| 933 | ] |
| 934 | ); |
| 935 | |
| 936 | // Background and Box Shadow for input - START |
| 937 | $element->start_controls_tabs( 'dropdown_input_tabs' ); |
| 938 | |
| 939 | $element->start_controls_tab( |
| 940 | 'dropdown_tab_normal_state', |
| 941 | [ |
| 942 | 'label' => __( 'Normal', 'auxin-elements' ), |
| 943 | ] |
| 944 | ); |
| 945 | |
| 946 | $element->add_group_control( |
| 947 | Group_Control_Background::get_type(), |
| 948 | [ |
| 949 | 'name' => 'dropdown_background', |
| 950 | 'selector' => '{{WRAPPER}} select', |
| 951 | 'types' => [ 'classic', 'gradient'] |
| 952 | ] |
| 953 | ); |
| 954 | |
| 955 | $element->add_group_control( |
| 956 | Group_Control_Box_Shadow::get_type(), |
| 957 | [ |
| 958 | 'name' => 'dropdown_box_shadow', |
| 959 | 'selector' => '{{WRAPPER}} select' |
| 960 | ] |
| 961 | ); |
| 962 | |
| 963 | $element->end_controls_tab(); |
| 964 | |
| 965 | $element->start_controls_tab( |
| 966 | 'dropdown_tab_hover_state', |
| 967 | [ |
| 968 | 'label' => __( 'Hover', 'auxin-elements' ), |
| 969 | ] |
| 970 | ); |
| 971 | |
| 972 | $element->add_group_control( |
| 973 | Group_Control_Background::get_type(), |
| 974 | [ |
| 975 | 'name' => 'dropdown_background_hover', |
| 976 | 'selector' => '{{WRAPPER}} select:hover', |
| 977 | 'types' => [ 'classic', 'gradient'] |
| 978 | ] |
| 979 | ); |
| 980 | |
| 981 | $element->add_group_control( |
| 982 | Group_Control_Box_Shadow::get_type(), |
| 983 | [ |
| 984 | 'name' => 'dropdown_box_shadow_hover', |
| 985 | 'selector' => '{{WRAPPER}} select:hover' |
| 986 | ] |
| 987 | ); |
| 988 | |
| 989 | $element->add_control( |
| 990 | 'dropdown_transition', |
| 991 | [ |
| 992 | 'label' => __( 'Transition Duration', 'auxin-elements' ), |
| 993 | 'type' => Controls_Manager::SLIDER, |
| 994 | 'default' => [ |
| 995 | 'size' => 0.3, |
| 996 | ], |
| 997 | 'range' => [ |
| 998 | 'px' => [ |
| 999 | 'max' => 3, |
| 1000 | 'step' => 0.1, |
| 1001 | ], |
| 1002 | ], |
| 1003 | 'render_type' => 'ui', |
| 1004 | 'selectors' => [ |
| 1005 | '{{WRAPPER}} select' => "transition:all ease-out {{SIZE}}s;" |
| 1006 | ] |
| 1007 | ] |
| 1008 | ); |
| 1009 | |
| 1010 | $element->end_controls_tab(); |
| 1011 | |
| 1012 | $element->end_controls_tabs(); |
| 1013 | // Background and Box Shadow for input - END |
| 1014 | |
| 1015 | $element->end_controls_section(); |
| 1016 | |
| 1017 | /* -------------------------------------------------------------------------- */ |
| 1018 | /* Textarea Style |
| 1019 | /* -------------------------------------------------------------------------- */ |
| 1020 | |
| 1021 | $element->start_controls_section( |
| 1022 | 'aux_core_textarea_section', |
| 1023 | [ |
| 1024 | 'label' => __('Textarea', 'auxin-elements' ), |
| 1025 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1026 | ] |
| 1027 | ); |
| 1028 | |
| 1029 | $element->add_group_control( |
| 1030 | Group_Control_Typography::get_type(), |
| 1031 | [ |
| 1032 | 'name' => 'textarea_typography', |
| 1033 | 'label' => __( 'Typography', 'auxin-elements' ), |
| 1034 | 'global' => [ |
| 1035 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1036 | ], |
| 1037 | 'selector' => '{{WRAPPER}} textarea', |
| 1038 | ] |
| 1039 | ); |
| 1040 | |
| 1041 | $element->add_control( |
| 1042 | 'textarea_color', |
| 1043 | [ |
| 1044 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1045 | 'type' => Controls_Manager::COLOR, |
| 1046 | 'selectors' => [ |
| 1047 | '{{WRAPPER}} textarea' => 'color: {{VALUE}};', |
| 1048 | ] |
| 1049 | ] |
| 1050 | ); |
| 1051 | |
| 1052 | $element->add_responsive_control( |
| 1053 | 'textarea_width', |
| 1054 | [ |
| 1055 | 'label' => __( 'Width', 'auxin-elements' ), |
| 1056 | 'size_units' => [ 'px','em', '%'], |
| 1057 | 'type' => Controls_Manager::SLIDER, |
| 1058 | 'range' => [ |
| 1059 | 'px' => [ |
| 1060 | 'min' => 0, |
| 1061 | 'max' => 1000, |
| 1062 | 'step' => 5, |
| 1063 | ], |
| 1064 | '%' => [ |
| 1065 | 'min' => 0, |
| 1066 | 'max' => 100, |
| 1067 | ], |
| 1068 | 'em' => [ |
| 1069 | 'min' => 0, |
| 1070 | 'max' => 100, |
| 1071 | ], |
| 1072 | ], |
| 1073 | 'selectors' => [ |
| 1074 | '{{WRAPPER}} textarea' => 'width: {{SIZE}}{{UNIT}};', |
| 1075 | ], |
| 1076 | ] |
| 1077 | ); |
| 1078 | |
| 1079 | $element->add_responsive_control( |
| 1080 | 'textarea_max_width', |
| 1081 | [ |
| 1082 | 'label' => __( 'Max Width', 'auxin-elements' ), |
| 1083 | 'size_units' => [ 'px','em', '%'], |
| 1084 | 'type' => Controls_Manager::SLIDER, |
| 1085 | 'range' => [ |
| 1086 | 'px' => [ |
| 1087 | 'min' => 0, |
| 1088 | 'max' => 1000, |
| 1089 | 'step' => 5 |
| 1090 | ], |
| 1091 | '%' => [ |
| 1092 | 'min' => 0, |
| 1093 | 'max' => 100 |
| 1094 | ], |
| 1095 | 'em' => [ |
| 1096 | 'min' => 0, |
| 1097 | 'max' => 100 |
| 1098 | ] |
| 1099 | ], |
| 1100 | 'selectors' => [ |
| 1101 | '{{WRAPPER}} textarea' => 'max-width: {{SIZE}}{{UNIT}};', |
| 1102 | ] |
| 1103 | ] |
| 1104 | ); |
| 1105 | |
| 1106 | $element->add_responsive_control( |
| 1107 | 'textarea_height', |
| 1108 | [ |
| 1109 | 'label' => __( 'Height', 'auxin-elements' ), |
| 1110 | 'size_units' => [ 'px', 'em'], |
| 1111 | 'type' => Controls_Manager::SLIDER, |
| 1112 | 'range' => [ |
| 1113 | 'px' => [ |
| 1114 | 'min' => 0, |
| 1115 | 'max' => 1000, |
| 1116 | 'step' => 5 |
| 1117 | ], |
| 1118 | '%' => [ |
| 1119 | 'min' => 0, |
| 1120 | 'max' => 100 |
| 1121 | ], |
| 1122 | 'em' => [ |
| 1123 | 'min' => 0, |
| 1124 | 'max' => 100 |
| 1125 | ] |
| 1126 | ], |
| 1127 | 'selectors' => [ |
| 1128 | '{{WRAPPER}} textarea' => 'height: {{SIZE}}{{UNIT}} !important;', |
| 1129 | ], |
| 1130 | 'separator' => 'after' |
| 1131 | ] |
| 1132 | ); |
| 1133 | |
| 1134 | $element->add_responsive_control( |
| 1135 | 'textarea_border_radius', |
| 1136 | [ |
| 1137 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 1138 | 'type' => Controls_Manager::DIMENSIONS, |
| 1139 | 'size_units' => [ 'px', '%' ], |
| 1140 | 'selectors' => [ |
| 1141 | '{{WRAPPER}} textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1142 | ], |
| 1143 | ] |
| 1144 | ); |
| 1145 | |
| 1146 | $element->add_responsive_control( |
| 1147 | 'textarea_padding', |
| 1148 | [ |
| 1149 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 1150 | 'type' => Controls_Manager::DIMENSIONS, |
| 1151 | 'size_units' => [ 'px', '%', 'em' ], |
| 1152 | 'selectors' => [ |
| 1153 | '{{WRAPPER}} textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1154 | ], |
| 1155 | 'separator' => 'after' |
| 1156 | ] |
| 1157 | ); |
| 1158 | |
| 1159 | $element->add_responsive_control( |
| 1160 | 'textarea_margin', |
| 1161 | [ |
| 1162 | 'label' => __( 'Margin', 'auxin-elements' ), |
| 1163 | 'type' => Controls_Manager::DIMENSIONS, |
| 1164 | 'size_units' => [ 'px', '%', 'em' ], |
| 1165 | 'selectors' => [ |
| 1166 | '{{WRAPPER}} textarea' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1167 | ], |
| 1168 | 'separator' => 'after' |
| 1169 | ] |
| 1170 | ); |
| 1171 | |
| 1172 | // Background and Box Shadow for input - START |
| 1173 | $element->start_controls_tabs( 'textarea_tabs' ); |
| 1174 | |
| 1175 | $element->start_controls_tab( |
| 1176 | 'textarea_tab_normal_state', |
| 1177 | [ |
| 1178 | 'label' => __( 'Normal', 'auxin-elements' ), |
| 1179 | ] |
| 1180 | ); |
| 1181 | |
| 1182 | $element->add_group_control( |
| 1183 | Group_Control_Background::get_type(), |
| 1184 | [ |
| 1185 | 'name' => 'textarea_background', |
| 1186 | 'selector' => '{{WRAPPER}} textarea', |
| 1187 | 'types' => [ 'classic', 'gradient'] |
| 1188 | ] |
| 1189 | ); |
| 1190 | |
| 1191 | $element->add_group_control( |
| 1192 | Group_Control_Box_Shadow::get_type(), |
| 1193 | [ |
| 1194 | 'name' => 'textarea_box_shadow', |
| 1195 | 'selector' => '{{WRAPPER}} textarea' |
| 1196 | ] |
| 1197 | ); |
| 1198 | |
| 1199 | $element->add_group_control( |
| 1200 | Group_Control_Border::get_type(), |
| 1201 | [ |
| 1202 | 'name' => 'textarea_border', |
| 1203 | 'selector' => '{{WRAPPER}} textarea' |
| 1204 | ] |
| 1205 | ); |
| 1206 | |
| 1207 | $element->end_controls_tab(); |
| 1208 | |
| 1209 | $element->start_controls_tab( |
| 1210 | 'textarea_tab_hover_state', |
| 1211 | [ |
| 1212 | 'label' => __( 'Hover', 'auxin-elements' ), |
| 1213 | ] |
| 1214 | ); |
| 1215 | |
| 1216 | $element->add_group_control( |
| 1217 | Group_Control_Background::get_type(), |
| 1218 | [ |
| 1219 | 'name' => 'textarea_background_hover', |
| 1220 | 'selector' => '{{WRAPPER}} textarea:hover', |
| 1221 | 'types' => [ 'classic', 'gradient'] |
| 1222 | ] |
| 1223 | ); |
| 1224 | |
| 1225 | $element->add_group_control( |
| 1226 | Group_Control_Box_Shadow::get_type(), |
| 1227 | [ |
| 1228 | 'name' => 'textarea_box_shadow_hover', |
| 1229 | 'selector' => '{{WRAPPER}} textarea:hover' |
| 1230 | ] |
| 1231 | ); |
| 1232 | |
| 1233 | $element->add_group_control( |
| 1234 | Group_Control_Border::get_type(), |
| 1235 | [ |
| 1236 | 'name' => 'textarea_border_hover', |
| 1237 | 'selector' => '{{WRAPPER}} textarea:hover' |
| 1238 | ] |
| 1239 | ); |
| 1240 | |
| 1241 | $element->add_control( |
| 1242 | 'textarea_transition', |
| 1243 | [ |
| 1244 | 'label' => __( 'Transition Duration', 'auxin-elements' ), |
| 1245 | 'type' => Controls_Manager::SLIDER, |
| 1246 | 'default' => [ |
| 1247 | 'size' => 0.3, |
| 1248 | ], |
| 1249 | 'range' => [ |
| 1250 | 'px' => [ |
| 1251 | 'max' => 3, |
| 1252 | 'step' => 0.1, |
| 1253 | ], |
| 1254 | ], |
| 1255 | 'render_type' => 'ui', |
| 1256 | 'selectors' => [ |
| 1257 | '{{WRAPPER}} textarea' => "transition:all ease-out {{SIZE}}s;" |
| 1258 | ] |
| 1259 | ] |
| 1260 | ); |
| 1261 | |
| 1262 | $element->end_controls_tab(); |
| 1263 | |
| 1264 | $element->start_controls_tab( |
| 1265 | 'textarea_tab_focus_state', |
| 1266 | [ |
| 1267 | 'label' => __( 'Focus', 'auxin-elements' ), |
| 1268 | ] |
| 1269 | ); |
| 1270 | |
| 1271 | $element->add_group_control( |
| 1272 | Group_Control_Background::get_type(), |
| 1273 | [ |
| 1274 | 'name' => 'textarea_background_focus', |
| 1275 | 'selector' => '{{WRAPPER}} textarea:focus', |
| 1276 | 'types' => [ 'classic', 'gradient'] |
| 1277 | ] |
| 1278 | ); |
| 1279 | |
| 1280 | $element->add_group_control( |
| 1281 | Group_Control_Box_Shadow::get_type(), |
| 1282 | [ |
| 1283 | 'name' => 'textarea_box_shadow_focus', |
| 1284 | 'selector' => '{{WRAPPER}} textarea:focus' |
| 1285 | ] |
| 1286 | ); |
| 1287 | |
| 1288 | $element->add_group_control( |
| 1289 | Group_Control_Border::get_type(), |
| 1290 | [ |
| 1291 | 'name' => 'textarea_border_focus', |
| 1292 | 'selector' => '{{WRAPPER}} textarea:focus' |
| 1293 | ] |
| 1294 | ); |
| 1295 | |
| 1296 | $element->end_controls_tab(); |
| 1297 | |
| 1298 | $element->end_controls_tabs(); |
| 1299 | |
| 1300 | $element->end_controls_section(); |
| 1301 | |
| 1302 | /* -------------------------------------------------------------------------- */ |
| 1303 | /* Textarea Placeholder Style |
| 1304 | /* -------------------------------------------------------------------------- */ |
| 1305 | |
| 1306 | $element->start_controls_section( |
| 1307 | 'aux_core_textarea_placeholder_section', |
| 1308 | [ |
| 1309 | 'label' => __('Textarea Placeholder', 'auxin-elements' ), |
| 1310 | 'tab' => Controls_Manager::TAB_STYLE |
| 1311 | ] |
| 1312 | ); |
| 1313 | |
| 1314 | $element->add_group_control( |
| 1315 | Group_Control_Typography::get_type(), |
| 1316 | [ |
| 1317 | 'name' => 'textarea_placeholder_typography', |
| 1318 | 'label' => __( 'Typography', 'auxin-elements' ), |
| 1319 | 'global' => [ |
| 1320 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1321 | ], |
| 1322 | 'selector' => '{{WRAPPER}} textarea::placeholder' |
| 1323 | ] |
| 1324 | ); |
| 1325 | |
| 1326 | $element->add_control( |
| 1327 | 'textarea_placeholder_color', |
| 1328 | [ |
| 1329 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1330 | 'type' => Controls_Manager::COLOR, |
| 1331 | 'selectors' => [ |
| 1332 | '{{WRAPPER}} textarea::placeholder' => 'color: {{VALUE}};', |
| 1333 | ] |
| 1334 | ] |
| 1335 | ); |
| 1336 | |
| 1337 | $element->end_controls_section(); |
| 1338 | |
| 1339 | /* -------------------------------------------------------------------------- */ |
| 1340 | /* Labels */ |
| 1341 | /* -------------------------------------------------------------------------- */ |
| 1342 | |
| 1343 | $element->start_controls_section( |
| 1344 | 'aux_core_labels_section', |
| 1345 | [ |
| 1346 | 'label' => __('Labels', 'auxin-elements' ), |
| 1347 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1348 | ] |
| 1349 | ); |
| 1350 | |
| 1351 | $element->add_group_control( |
| 1352 | Group_Control_Typography::get_type(), |
| 1353 | [ |
| 1354 | 'name' => 'labels_typography', |
| 1355 | 'label' => __( 'Typography', 'auxin-elements' ), |
| 1356 | 'global' => [ |
| 1357 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1358 | ], |
| 1359 | 'selector' => '{{WRAPPER}} label, {{WRAPPER}} legend' |
| 1360 | ] |
| 1361 | ); |
| 1362 | |
| 1363 | $element->add_control( |
| 1364 | 'labels_color', |
| 1365 | [ |
| 1366 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1367 | 'type' => Controls_Manager::COLOR, |
| 1368 | 'selectors' => [ |
| 1369 | '{{WRAPPER}} label, {{WRAPPER}} legend' => 'color: {{VALUE}};' |
| 1370 | ] |
| 1371 | ] |
| 1372 | ); |
| 1373 | |
| 1374 | $element->end_controls_section(); |
| 1375 | |
| 1376 | /* -------------------------------------------------------------------------- */ |
| 1377 | /* Submit Button Style |
| 1378 | /* -------------------------------------------------------------------------- */ |
| 1379 | |
| 1380 | $element->start_controls_section( |
| 1381 | 'aux_core_submit_input_section', |
| 1382 | [ |
| 1383 | 'label' => __('Submit Button', 'auxin-elements' ), |
| 1384 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1385 | ] |
| 1386 | ); |
| 1387 | |
| 1388 | $element->add_group_control( |
| 1389 | Group_Control_Typography::get_type(), |
| 1390 | [ |
| 1391 | 'name' => 'submit_input_typography', |
| 1392 | 'label' => __( 'Typography', 'auxin-elements' ), |
| 1393 | 'global' => [ |
| 1394 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1395 | ], |
| 1396 | 'selector' => '{{WRAPPER}} button[type="submit"]', |
| 1397 | ] |
| 1398 | ); |
| 1399 | |
| 1400 | $element->add_control( |
| 1401 | 'submit_input_color', |
| 1402 | [ |
| 1403 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1404 | 'type' => Controls_Manager::COLOR, |
| 1405 | 'selectors' => [ |
| 1406 | '{{WRAPPER}} button[type="submit"]:not(:hover):not(:active)' => 'color: {{VALUE}} !important;', |
| 1407 | ] |
| 1408 | ] |
| 1409 | ); |
| 1410 | |
| 1411 | $element->add_responsive_control( |
| 1412 | 'submit_input_width', |
| 1413 | [ |
| 1414 | 'label' => __( 'Width', 'auxin-elements' ), |
| 1415 | 'size_units' => [ 'px','em', '%'], |
| 1416 | 'type' => Controls_Manager::SLIDER, |
| 1417 | 'range' => [ |
| 1418 | 'px' => [ |
| 1419 | 'min' => 0, |
| 1420 | 'max' => 1000, |
| 1421 | 'step' => 5, |
| 1422 | ], |
| 1423 | '%' => [ |
| 1424 | 'min' => 0, |
| 1425 | 'max' => 100, |
| 1426 | ], |
| 1427 | 'em' => [ |
| 1428 | 'min' => 0, |
| 1429 | 'max' => 100, |
| 1430 | ], |
| 1431 | ], |
| 1432 | 'selectors' => [ |
| 1433 | '{{WRAPPER}} button[type="submit"]' => 'width: {{SIZE}}{{UNIT}};', |
| 1434 | ], |
| 1435 | ] |
| 1436 | ); |
| 1437 | |
| 1438 | $element->add_responsive_control( |
| 1439 | 'submit_input_max_width', |
| 1440 | [ |
| 1441 | 'label' => __( 'Max Width', 'auxin-elements' ), |
| 1442 | 'size_units' => [ 'px','em', '%'], |
| 1443 | 'type' => Controls_Manager::SLIDER, |
| 1444 | 'range' => [ |
| 1445 | 'px' => [ |
| 1446 | 'min' => 0, |
| 1447 | 'max' => 1000, |
| 1448 | 'step' => 5 |
| 1449 | ], |
| 1450 | '%' => [ |
| 1451 | 'min' => 0, |
| 1452 | 'max' => 100 |
| 1453 | ], |
| 1454 | 'em' => [ |
| 1455 | 'min' => 0, |
| 1456 | 'max' => 100 |
| 1457 | ] |
| 1458 | ], |
| 1459 | 'selectors' => [ |
| 1460 | '{{WRAPPER}} button[type="submit"]' => 'max-width: {{SIZE}}{{UNIT}};', |
| 1461 | ] |
| 1462 | ] |
| 1463 | ); |
| 1464 | |
| 1465 | $element->add_responsive_control( |
| 1466 | 'submit_input_height', |
| 1467 | [ |
| 1468 | 'label' => __( 'Height', 'auxin-elements' ), |
| 1469 | 'size_units' => [ 'px', 'em'], |
| 1470 | 'type' => Controls_Manager::SLIDER, |
| 1471 | 'range' => [ |
| 1472 | 'px' => [ |
| 1473 | 'min' => 0, |
| 1474 | 'max' => 1000, |
| 1475 | 'step' => 5 |
| 1476 | ], |
| 1477 | '%' => [ |
| 1478 | 'min' => 0, |
| 1479 | 'max' => 100 |
| 1480 | ], |
| 1481 | 'em' => [ |
| 1482 | 'min' => 0, |
| 1483 | 'max' => 100 |
| 1484 | ] |
| 1485 | ], |
| 1486 | 'selectors' => [ |
| 1487 | '{{WRAPPER}} button[type="submit"]' => 'height: {{SIZE}}{{UNIT}};', |
| 1488 | ], |
| 1489 | 'separator' => 'after' |
| 1490 | ] |
| 1491 | ); |
| 1492 | |
| 1493 | |
| 1494 | $element->add_group_control( |
| 1495 | Group_Control_Border::get_type(), |
| 1496 | [ |
| 1497 | 'name' => 'submit_input_border', |
| 1498 | 'selector' => '{{WRAPPER}} button[type="submit"]' |
| 1499 | ] |
| 1500 | ); |
| 1501 | |
| 1502 | $element->add_responsive_control( |
| 1503 | 'submit_input_border_radius', |
| 1504 | [ |
| 1505 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 1506 | 'type' => Controls_Manager::DIMENSIONS, |
| 1507 | 'size_units' => [ 'px', '%' ], |
| 1508 | 'selectors' => [ |
| 1509 | '{{WRAPPER}} button[type="submit"]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1510 | ], |
| 1511 | ] |
| 1512 | ); |
| 1513 | |
| 1514 | $element->add_responsive_control( |
| 1515 | 'submit_input_padding', |
| 1516 | [ |
| 1517 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 1518 | 'type' => Controls_Manager::DIMENSIONS, |
| 1519 | 'size_units' => [ 'px', '%', 'em' ], |
| 1520 | 'selectors' => [ |
| 1521 | '{{WRAPPER}} button[type="submit"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 1522 | ], |
| 1523 | 'separator' => 'after' |
| 1524 | ] |
| 1525 | ); |
| 1526 | |
| 1527 | $element->add_responsive_control( |
| 1528 | 'submit_input_margin', |
| 1529 | [ |
| 1530 | 'label' => __( 'Margin', 'auxin-elements' ), |
| 1531 | 'type' => Controls_Manager::DIMENSIONS, |
| 1532 | 'size_units' => [ 'px', '%', 'em' ], |
| 1533 | 'selectors' => [ |
| 1534 | '{{WRAPPER}} button[type="submit"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1535 | ], |
| 1536 | 'separator' => 'after' |
| 1537 | ] |
| 1538 | ); |
| 1539 | |
| 1540 | // Background and Box Shadow for input - START |
| 1541 | $element->start_controls_tabs( 'submit_input_tabs' ); |
| 1542 | |
| 1543 | $element->start_controls_tab( |
| 1544 | 'submit_input_tab_normal_state', |
| 1545 | [ |
| 1546 | 'label' => __( 'Normal', 'auxin-elements' ), |
| 1547 | ] |
| 1548 | ); |
| 1549 | |
| 1550 | $element->add_group_control( |
| 1551 | Group_Control_Background::get_type(), |
| 1552 | [ |
| 1553 | 'name' => 'submit_input_background', |
| 1554 | 'selector' => '{{WRAPPER}} button[type="submit"]:not(:hover):not(:active)', |
| 1555 | 'types' => [ 'classic', 'gradient'] |
| 1556 | ] |
| 1557 | ); |
| 1558 | |
| 1559 | $element->add_group_control( |
| 1560 | Group_Control_Box_Shadow::get_type(), |
| 1561 | [ |
| 1562 | 'name' => 'submit_input_box_shadow', |
| 1563 | 'selector' => '{{WRAPPER}} button[type="submit"]' |
| 1564 | ] |
| 1565 | ); |
| 1566 | |
| 1567 | $element->end_controls_tab(); |
| 1568 | |
| 1569 | $element->start_controls_tab( |
| 1570 | 'submit_input_tab_hover_state', |
| 1571 | [ |
| 1572 | 'label' => __( 'Hover', 'auxin-elements' ), |
| 1573 | ] |
| 1574 | ); |
| 1575 | |
| 1576 | |
| 1577 | $element->add_control( |
| 1578 | 'submit_input_color_hover', |
| 1579 | [ |
| 1580 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1581 | 'type' => Controls_Manager::COLOR, |
| 1582 | 'selectors' => [ |
| 1583 | '{{WRAPPER}} button[type="submit"]:hover' => 'color: {{VALUE}} !important;', |
| 1584 | ] |
| 1585 | ] |
| 1586 | ); |
| 1587 | |
| 1588 | $element->add_group_control( |
| 1589 | Group_Control_Background::get_type(), |
| 1590 | [ |
| 1591 | 'name' => 'submit_input_background_hover', |
| 1592 | 'selector' => '{{WRAPPER}} button[type="submit"]:hover', |
| 1593 | 'types' => [ 'classic', 'gradient'] |
| 1594 | ] |
| 1595 | ); |
| 1596 | |
| 1597 | $element->add_group_control( |
| 1598 | Group_Control_Box_Shadow::get_type(), |
| 1599 | [ |
| 1600 | 'name' => 'submit_input_box_shadow_hover', |
| 1601 | 'selector' => '{{WRAPPER}} button[type="submit"]:hover' |
| 1602 | ] |
| 1603 | ); |
| 1604 | |
| 1605 | $element->add_control( |
| 1606 | 'submit_input_transition', |
| 1607 | [ |
| 1608 | 'label' => __( 'Transition Duration', 'auxin-elements' ), |
| 1609 | 'type' => Controls_Manager::SLIDER, |
| 1610 | 'default' => [ |
| 1611 | 'size' => 0.3, |
| 1612 | ], |
| 1613 | 'range' => [ |
| 1614 | 'px' => [ |
| 1615 | 'max' => 3, |
| 1616 | 'step' => 0.1, |
| 1617 | ], |
| 1618 | ], |
| 1619 | 'render_type' => 'ui', |
| 1620 | 'selectors' => [ |
| 1621 | '{{WRAPPER}} button[type="submit"]' => "transition:all ease-out {{SIZE}}s;" |
| 1622 | ] |
| 1623 | ] |
| 1624 | ); |
| 1625 | |
| 1626 | $element->end_controls_tab(); |
| 1627 | |
| 1628 | $element->end_controls_tabs(); |
| 1629 | // Background and Box Shadow for input - END |
| 1630 | |
| 1631 | $element->end_controls_section(); |
| 1632 | } |
| 1633 | add_action( 'elementor/element/wpforms/themes/after_section_end', 'auxin_extend_wpforms_elementor_widget', 10, 2 ); |
| 1634 |