PluginProbe
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder / 51.1.84
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder v51.1.84
51.1.86 51.1.84 51.1.85 51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 All 40 releases
king-addons / includes / helpers / Faceted / Style_Controls.php

Style_Controls.php in King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder 51.1.84, at includes/helpers/Faceted/Style_Controls.php

882 lines 28.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Shared Elementor style controls for Shop Filter widgets.
4 *
5 * @package King_Addons
6 */
7
8 namespace King_Addons;
9
10 use Elementor\Controls_Manager;
11 use Elementor\Group_Control_Border;
12 use Elementor\Group_Control_Typography;
13 use Elementor\Widget_Base;
14
15 if (!defined('ABSPATH')) {
16 exit;
17 }
18
19 /**
20 * Style tabs for taxonomy lists, fields, price ranges, reset, and chips.
21 */
22 class Facet_Style_Controls
23 {
24 /**
25 * Taxonomy checkbox / swatch list.
26 *
27 * @param Widget_Base $widget Widget instance.
28 * @return void
29 */
30 public static function list(Widget_Base $widget): void
31 {
32 $widget->start_controls_section(
33 'ka_facet_list_style',
34 [
35 'label' => esc_html__('List', 'king-addons'),
36 'tab' => Controls_Manager::TAB_STYLE,
37 ]
38 );
39
40 $widget->add_group_control(
41 Group_Control_Typography::get_type(),
42 [
43 'name' => 'ka_facet_list_typography',
44 'selector' => '{{WRAPPER}} .king-addons-facet__text',
45 ]
46 );
47
48 $widget->add_control(
49 'ka_facet_list_color',
50 [
51 'label' => esc_html__('Text Color', 'king-addons'),
52 'type' => Controls_Manager::COLOR,
53 'selectors' => [
54 '{{WRAPPER}} .king-addons-facet__text' => 'color: {{VALUE}};',
55 ],
56 ]
57 );
58
59 $widget->add_control(
60 'ka_facet_count_color',
61 [
62 'label' => esc_html__('Count Color', 'king-addons'),
63 'type' => Controls_Manager::COLOR,
64 'selectors' => [
65 '{{WRAPPER}} .king-addons-facet__count' => 'color: {{VALUE}};',
66 ],
67 ]
68 );
69
70 $widget->add_responsive_control(
71 'ka_facet_item_gap',
72 [
73 'label' => esc_html__('Space Between Rows', 'king-addons'),
74 'type' => Controls_Manager::SLIDER,
75 'size_units' => ['px'],
76 'range' => [
77 'px' => ['min' => 0, 'max' => 24],
78 ],
79 'selectors' => [
80 '{{WRAPPER}} .king-addons-facet__list' => 'gap: {{SIZE}}{{UNIT}};',
81 ],
82 ]
83 );
84
85 $widget->add_responsive_control(
86 'ka_facet_label_gap',
87 [
88 'label' => esc_html__('Checkbox Gap', 'king-addons'),
89 'type' => Controls_Manager::SLIDER,
90 'size_units' => ['px'],
91 'range' => [
92 'px' => ['min' => 0, 'max' => 24],
93 ],
94 'selectors' => [
95 '{{WRAPPER}} .king-addons-facet__label' => 'gap: {{SIZE}}{{UNIT}};',
96 ],
97 ]
98 );
99
100 $widget->add_responsive_control(
101 'ka_facet_row_padding',
102 [
103 'label' => esc_html__('Row Padding', 'king-addons'),
104 'type' => Controls_Manager::DIMENSIONS,
105 'size_units' => ['px', 'em'],
106 'selectors' => [
107 '{{WRAPPER}} .king-addons-facet__label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
108 ],
109 ]
110 );
111
112 $widget->add_control(
113 'ka_facet_hover_bg',
114 [
115 'label' => esc_html__('Hover Background', 'king-addons'),
116 'type' => Controls_Manager::COLOR,
117 'selectors' => [
118 '{{WRAPPER}} .king-addons-facet__label:hover' => 'background-color: {{VALUE}};',
119 ],
120 ]
121 );
122
123 $widget->add_control(
124 'ka_facet_active_bg',
125 [
126 'label' => esc_html__('Selected Background', 'king-addons'),
127 'type' => Controls_Manager::COLOR,
128 'selectors' => [
129 '{{WRAPPER}} .king-addons-facet__label:has(.king-addons-facet__input:checked)' => 'background-color: {{VALUE}};',
130 ],
131 ]
132 );
133
134 $widget->add_control(
135 'ka_facet_active_color',
136 [
137 'label' => esc_html__('Selected Text Color', 'king-addons'),
138 'type' => Controls_Manager::COLOR,
139 'selectors' => [
140 '{{WRAPPER}} .king-addons-facet__label:has(.king-addons-facet__input:checked) .king-addons-facet__text' => 'color: {{VALUE}};',
141 ],
142 ]
143 );
144
145 $widget->add_control(
146 'ka_facet_checkbox_heading',
147 [
148 'label' => esc_html__('Checkbox', 'king-addons'),
149 'type' => Controls_Manager::HEADING,
150 'separator' => 'before',
151 ]
152 );
153
154 $widget->add_responsive_control(
155 'ka_facet_checkbox_size',
156 [
157 'label' => esc_html__('Size', 'king-addons'),
158 'type' => Controls_Manager::SLIDER,
159 'size_units' => ['px'],
160 'range' => [
161 'px' => ['min' => 12, 'max' => 28],
162 ],
163 'selectors' => [
164 '{{WRAPPER}} .king-addons-facet__box' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
165 ],
166 ]
167 );
168
169 $widget->add_responsive_control(
170 'ka_facet_checkbox_radius',
171 [
172 'label' => esc_html__('Radius', 'king-addons'),
173 'type' => Controls_Manager::SLIDER,
174 'size_units' => ['px'],
175 'range' => [
176 'px' => ['min' => 0, 'max' => 14],
177 ],
178 'selectors' => [
179 '{{WRAPPER}} .king-addons-facet__box' => 'border-radius: {{SIZE}}{{UNIT}};',
180 ],
181 ]
182 );
183
184 $widget->add_control(
185 'ka_facet_checkbox_border',
186 [
187 'label' => esc_html__('Border Color', 'king-addons'),
188 'type' => Controls_Manager::COLOR,
189 'selectors' => [
190 '{{WRAPPER}} .king-addons-facet__box' => 'border-color: {{VALUE}};',
191 ],
192 ]
193 );
194
195 $widget->add_control(
196 'ka_facet_checkbox_bg',
197 [
198 'label' => esc_html__('Background', 'king-addons'),
199 'type' => Controls_Manager::COLOR,
200 'selectors' => [
201 '{{WRAPPER}} .king-addons-facet__box' => 'background-color: {{VALUE}};',
202 ],
203 ]
204 );
205
206 $widget->add_control(
207 'ka_facet_accent',
208 [
209 'label' => esc_html__('Checked Color', 'king-addons'),
210 'type' => Controls_Manager::COLOR,
211 'selectors' => [
212 '{{WRAPPER}} .king-addons-facet__input:checked + .king-addons-facet__box' => 'background-color: {{VALUE}}; border-color: {{VALUE}};',
213 ],
214 ]
215 );
216
217 $widget->add_control(
218 'ka_facet_check_color',
219 [
220 'label' => esc_html__('Check Color', 'king-addons'),
221 'type' => Controls_Manager::COLOR,
222 'selectors' => [
223 '{{WRAPPER}} .king-addons-facet__input:checked + .king-addons-facet__box::after' => 'border-color: {{VALUE}};',
224 ],
225 ]
226 );
227
228 $widget->add_control(
229 'ka_facet_swatch_heading',
230 [
231 'label' => esc_html__('Swatch', 'king-addons'),
232 'type' => Controls_Manager::HEADING,
233 'separator' => 'before',
234 ]
235 );
236
237 $widget->add_responsive_control(
238 'ka_facet_swatch_size',
239 [
240 'label' => esc_html__('Size', 'king-addons'),
241 'type' => Controls_Manager::SLIDER,
242 'size_units' => ['px'],
243 'range' => [
244 'px' => ['min' => 12, 'max' => 40],
245 ],
246 'selectors' => [
247 '{{WRAPPER}} .king-addons-facet__swatch' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
248 ],
249 ]
250 );
251
252 $widget->add_responsive_control(
253 'ka_facet_swatch_radius',
254 [
255 'label' => esc_html__('Radius', 'king-addons'),
256 'type' => Controls_Manager::SLIDER,
257 'size_units' => ['px', '%'],
258 'range' => [
259 'px' => ['min' => 0, 'max' => 40],
260 '%' => ['min' => 0, 'max' => 50],
261 ],
262 'selectors' => [
263 '{{WRAPPER}} .king-addons-facet__swatch' => 'border-radius: {{SIZE}}{{UNIT}};',
264 ],
265 ]
266 );
267
268 $widget->add_control(
269 'ka_facet_swatch_border',
270 [
271 'label' => esc_html__('Border Color', 'king-addons'),
272 'type' => Controls_Manager::COLOR,
273 'selectors' => [
274 '{{WRAPPER}} .king-addons-facet__swatch' => 'border-color: {{VALUE}};',
275 ],
276 ]
277 );
278
279 $widget->add_control(
280 'ka_facet_swatch_ring',
281 [
282 'label' => esc_html__('Selected Ring', 'king-addons'),
283 'type' => Controls_Manager::COLOR,
284 'selectors' => [
285 '{{WRAPPER}} .king-addons-facet__input:checked + .king-addons-facet__swatch' => 'box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px {{VALUE}};',
286 ],
287 ]
288 );
289
290 $widget->end_controls_section();
291 }
292
293 /**
294 * Text, number, and select fields.
295 *
296 * @param Widget_Base $widget Widget instance.
297 * @param string $selector CSS selector for the fields.
298 * @return void
299 */
300 public static function fields(Widget_Base $widget, string $selector): void
301 {
302 $widget->start_controls_section(
303 'ka_facet_field_style',
304 [
305 'label' => esc_html__('Fields', 'king-addons'),
306 'tab' => Controls_Manager::TAB_STYLE,
307 ]
308 );
309
310 $widget->add_group_control(
311 Group_Control_Typography::get_type(),
312 [
313 'name' => 'ka_facet_field_typography',
314 'selector' => $selector,
315 ]
316 );
317
318 $widget->add_control(
319 'ka_facet_field_color',
320 [
321 'label' => esc_html__('Text Color', 'king-addons'),
322 'type' => Controls_Manager::COLOR,
323 'selectors' => [
324 $selector => 'color: {{VALUE}};',
325 ],
326 ]
327 );
328
329 $widget->add_control(
330 'ka_facet_field_placeholder',
331 [
332 'label' => esc_html__('Placeholder Color', 'king-addons'),
333 'type' => Controls_Manager::COLOR,
334 'selectors' => [
335 $selector . '::placeholder' => 'color: {{VALUE}};',
336 ],
337 ]
338 );
339
340 $widget->add_control(
341 'ka_facet_field_bg',
342 [
343 'label' => esc_html__('Background', 'king-addons'),
344 'type' => Controls_Manager::COLOR,
345 'selectors' => [
346 $selector => 'background-color: {{VALUE}};',
347 ],
348 ]
349 );
350
351 $widget->add_responsive_control(
352 'ka_facet_field_height',
353 [
354 'label' => esc_html__('Height', 'king-addons'),
355 'type' => Controls_Manager::SLIDER,
356 'size_units' => ['px'],
357 'range' => [
358 'px' => ['min' => 32, 'max' => 64],
359 ],
360 'selectors' => [
361 $selector => 'height: {{SIZE}}{{UNIT}};',
362 ],
363 ]
364 );
365
366 $widget->add_group_control(
367 Group_Control_Border::get_type(),
368 [
369 'name' => 'ka_facet_field_border',
370 'selector' => $selector,
371 ]
372 );
373
374 $widget->add_control(
375 'ka_facet_field_focus',
376 [
377 'label' => esc_html__('Focus Border', 'king-addons'),
378 'type' => Controls_Manager::COLOR,
379 'selectors' => [
380 $selector . ':focus' => 'border-color: {{VALUE}};',
381 ],
382 ]
383 );
384
385 $widget->add_responsive_control(
386 'ka_facet_field_radius',
387 [
388 'label' => esc_html__('Border Radius', 'king-addons'),
389 'type' => Controls_Manager::DIMENSIONS,
390 'size_units' => ['px', '%'],
391 'selectors' => [
392 $selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
393 ],
394 ]
395 );
396
397 $widget->add_responsive_control(
398 'ka_facet_field_padding',
399 [
400 'label' => esc_html__('Padding', 'king-addons'),
401 'type' => Controls_Manager::DIMENSIONS,
402 'size_units' => ['px', 'em'],
403 'selectors' => [
404 $selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
405 ],
406 ]
407 );
408
409 $widget->end_controls_section();
410 }
411
412 /**
413 * Price range buttons.
414 *
415 * @param Widget_Base $widget Widget instance.
416 * @return void
417 */
418 public static function buckets(Widget_Base $widget): void
419 {
420 $widget->start_controls_section(
421 'ka_facet_bucket_style',
422 [
423 'label' => esc_html__('Price Ranges', 'king-addons'),
424 'tab' => Controls_Manager::TAB_STYLE,
425 ]
426 );
427
428 $widget->add_group_control(
429 Group_Control_Typography::get_type(),
430 [
431 'name' => 'ka_facet_bucket_typography',
432 'selector' => '{{WRAPPER}} .king-addons-facet__bucket-btn',
433 ]
434 );
435
436 $widget->start_controls_tabs('ka_facet_bucket_tabs');
437
438 $widget->start_controls_tab(
439 'ka_facet_bucket_normal',
440 ['label' => esc_html__('Normal', 'king-addons')]
441 );
442
443 $widget->add_control(
444 'ka_facet_bucket_color',
445 [
446 'label' => esc_html__('Text Color', 'king-addons'),
447 'type' => Controls_Manager::COLOR,
448 'selectors' => [
449 '{{WRAPPER}} .king-addons-facet__bucket-btn' => 'color: {{VALUE}};',
450 ],
451 ]
452 );
453
454 $widget->add_control(
455 'ka_facet_bucket_bg',
456 [
457 'label' => esc_html__('Background', 'king-addons'),
458 'type' => Controls_Manager::COLOR,
459 'selectors' => [
460 '{{WRAPPER}} .king-addons-facet__bucket-btn' => 'background-color: {{VALUE}};',
461 ],
462 ]
463 );
464
465 $widget->add_control(
466 'ka_facet_bucket_border',
467 [
468 'label' => esc_html__('Border Color', 'king-addons'),
469 'type' => Controls_Manager::COLOR,
470 'selectors' => [
471 '{{WRAPPER}} .king-addons-facet__bucket-btn' => 'border-color: {{VALUE}};',
472 ],
473 ]
474 );
475
476 $widget->end_controls_tab();
477
478 $widget->start_controls_tab(
479 'ka_facet_bucket_active',
480 ['label' => esc_html__('Active', 'king-addons')]
481 );
482
483 $widget->add_control(
484 'ka_facet_bucket_color_active',
485 [
486 'label' => esc_html__('Text Color', 'king-addons'),
487 'type' => Controls_Manager::COLOR,
488 'selectors' => [
489 '{{WRAPPER}} .king-addons-facet__bucket-btn.is-active' => 'color: {{VALUE}};',
490 ],
491 ]
492 );
493
494 $widget->add_control(
495 'ka_facet_bucket_bg_active',
496 [
497 'label' => esc_html__('Background', 'king-addons'),
498 'type' => Controls_Manager::COLOR,
499 'selectors' => [
500 '{{WRAPPER}} .king-addons-facet__bucket-btn.is-active' => 'background-color: {{VALUE}};',
501 ],
502 ]
503 );
504
505 $widget->add_control(
506 'ka_facet_bucket_border_active',
507 [
508 'label' => esc_html__('Border Color', 'king-addons'),
509 'type' => Controls_Manager::COLOR,
510 'selectors' => [
511 '{{WRAPPER}} .king-addons-facet__bucket-btn.is-active' => 'border-color: {{VALUE}};',
512 ],
513 ]
514 );
515
516 $widget->end_controls_tab();
517 $widget->end_controls_tabs();
518
519 $widget->add_control(
520 'ka_facet_bucket_count',
521 [
522 'label' => esc_html__('Count Color', 'king-addons'),
523 'type' => Controls_Manager::COLOR,
524 'separator' => 'before',
525 'selectors' => [
526 '{{WRAPPER}} .king-addons-facet__bucket-count' => 'color: {{VALUE}};',
527 ],
528 ]
529 );
530
531 $widget->add_responsive_control(
532 'ka_facet_bucket_radius',
533 [
534 'label' => esc_html__('Border Radius', 'king-addons'),
535 'type' => Controls_Manager::SLIDER,
536 'size_units' => ['px'],
537 'range' => [
538 'px' => ['min' => 0, 'max' => 24],
539 ],
540 'selectors' => [
541 '{{WRAPPER}} .king-addons-facet__bucket-btn' => 'border-radius: {{SIZE}}{{UNIT}};',
542 ],
543 ]
544 );
545
546 $widget->add_responsive_control(
547 'ka_facet_bucket_padding',
548 [
549 'label' => esc_html__('Padding', 'king-addons'),
550 'type' => Controls_Manager::DIMENSIONS,
551 'size_units' => ['px', 'em'],
552 'selectors' => [
553 '{{WRAPPER}} .king-addons-facet__bucket-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
554 ],
555 ]
556 );
557
558 $widget->add_responsive_control(
559 'ka_facet_bucket_gap',
560 [
561 'label' => esc_html__('Space Between', 'king-addons'),
562 'type' => Controls_Manager::SLIDER,
563 'size_units' => ['px'],
564 'range' => [
565 'px' => ['min' => 0, 'max' => 24],
566 ],
567 'selectors' => [
568 '{{WRAPPER}} .king-addons-facet__buckets' => 'gap: {{SIZE}}{{UNIT}};',
569 ],
570 ]
571 );
572
573 $widget->end_controls_section();
574 }
575
576 /**
577 * Reset button.
578 *
579 * @param Widget_Base $widget Widget instance.
580 * @return void
581 */
582 public static function button(Widget_Base $widget): void
583 {
584 $widget->start_controls_section(
585 'ka_facet_button_style',
586 [
587 'label' => esc_html__('Button', 'king-addons'),
588 'tab' => Controls_Manager::TAB_STYLE,
589 ]
590 );
591
592 $widget->add_group_control(
593 Group_Control_Typography::get_type(),
594 [
595 'name' => 'ka_facet_button_typography',
596 'selector' => '{{WRAPPER}} .king-addons-facet__button',
597 ]
598 );
599
600 $widget->start_controls_tabs('ka_facet_button_tabs');
601
602 $widget->start_controls_tab(
603 'ka_facet_button_normal',
604 ['label' => esc_html__('Normal', 'king-addons')]
605 );
606
607 $widget->add_control(
608 'ka_facet_button_color',
609 [
610 'label' => esc_html__('Text Color', 'king-addons'),
611 'type' => Controls_Manager::COLOR,
612 'selectors' => [
613 '{{WRAPPER}} .king-addons-facet__button' => 'color: {{VALUE}};',
614 ],
615 ]
616 );
617
618 $widget->add_control(
619 'ka_facet_button_bg',
620 [
621 'label' => esc_html__('Background', 'king-addons'),
622 'type' => Controls_Manager::COLOR,
623 'selectors' => [
624 '{{WRAPPER}} .king-addons-facet__button' => 'background-color: {{VALUE}};',
625 ],
626 ]
627 );
628
629 $widget->add_control(
630 'ka_facet_button_border_color',
631 [
632 'label' => esc_html__('Border Color', 'king-addons'),
633 'type' => Controls_Manager::COLOR,
634 'selectors' => [
635 '{{WRAPPER}} .king-addons-facet__button' => 'border-color: {{VALUE}};',
636 ],
637 ]
638 );
639
640 $widget->end_controls_tab();
641
642 $widget->start_controls_tab(
643 'ka_facet_button_hover',
644 ['label' => esc_html__('Hover', 'king-addons')]
645 );
646
647 $widget->add_control(
648 'ka_facet_button_color_hover',
649 [
650 'label' => esc_html__('Text Color', 'king-addons'),
651 'type' => Controls_Manager::COLOR,
652 'selectors' => [
653 '{{WRAPPER}} .king-addons-facet__button:hover' => 'color: {{VALUE}};',
654 ],
655 ]
656 );
657
658 $widget->add_control(
659 'ka_facet_button_bg_hover',
660 [
661 'label' => esc_html__('Background', 'king-addons'),
662 'type' => Controls_Manager::COLOR,
663 'selectors' => [
664 '{{WRAPPER}} .king-addons-facet__button:hover' => 'background-color: {{VALUE}};',
665 ],
666 ]
667 );
668
669 $widget->add_control(
670 'ka_facet_button_border_hover',
671 [
672 'label' => esc_html__('Border Color', 'king-addons'),
673 'type' => Controls_Manager::COLOR,
674 'selectors' => [
675 '{{WRAPPER}} .king-addons-facet__button:hover' => 'border-color: {{VALUE}};',
676 ],
677 ]
678 );
679
680 $widget->end_controls_tab();
681 $widget->end_controls_tabs();
682
683 $widget->add_responsive_control(
684 'ka_facet_button_radius',
685 [
686 'label' => esc_html__('Border Radius', 'king-addons'),
687 'type' => Controls_Manager::DIMENSIONS,
688 'size_units' => ['px', '%'],
689 'separator' => 'before',
690 'selectors' => [
691 '{{WRAPPER}} .king-addons-facet__button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
692 ],
693 ]
694 );
695
696 $widget->add_responsive_control(
697 'ka_facet_button_padding',
698 [
699 'label' => esc_html__('Padding', 'king-addons'),
700 'type' => Controls_Manager::DIMENSIONS,
701 'size_units' => ['px', 'em'],
702 'selectors' => [
703 '{{WRAPPER}} .king-addons-facet__button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
704 ],
705 ]
706 );
707
708 $widget->end_controls_section();
709 }
710
711 /**
712 * Active filter chips.
713 *
714 * @param Widget_Base $widget Widget instance.
715 * @return void
716 */
717 public static function chips(Widget_Base $widget): void
718 {
719 $widget->start_controls_section(
720 'ka_facet_chip_style',
721 [
722 'label' => esc_html__('Chips', 'king-addons'),
723 'tab' => Controls_Manager::TAB_STYLE,
724 ]
725 );
726
727 $widget->add_group_control(
728 Group_Control_Typography::get_type(),
729 [
730 'name' => 'ka_facet_chip_title_typography',
731 'label' => esc_html__('Title Typography', 'king-addons'),
732 'selector' => '{{WRAPPER}} .king-addons-active-filters__title',
733 ]
734 );
735
736 $widget->add_control(
737 'ka_facet_chip_title_color',
738 [
739 'label' => esc_html__('Title Color', 'king-addons'),
740 'type' => Controls_Manager::COLOR,
741 'selectors' => [
742 '{{WRAPPER}} .king-addons-active-filters__title' => 'color: {{VALUE}};',
743 ],
744 ]
745 );
746
747 $widget->add_control(
748 'ka_facet_chip_heading',
749 [
750 'label' => esc_html__('Chip', 'king-addons'),
751 'type' => Controls_Manager::HEADING,
752 'separator' => 'before',
753 ]
754 );
755
756 $widget->add_group_control(
757 Group_Control_Typography::get_type(),
758 [
759 'name' => 'ka_facet_chip_typography',
760 'selector' => '{{WRAPPER}} .king-addons-active-filters__item',
761 ]
762 );
763
764 $widget->start_controls_tabs('ka_facet_chip_tabs');
765
766 $widget->start_controls_tab(
767 'ka_facet_chip_normal',
768 ['label' => esc_html__('Normal', 'king-addons')]
769 );
770
771 $widget->add_control(
772 'ka_facet_chip_color',
773 [
774 'label' => esc_html__('Text Color', 'king-addons'),
775 'type' => Controls_Manager::COLOR,
776 'selectors' => [
777 '{{WRAPPER}} .king-addons-active-filters__item' => 'color: {{VALUE}};',
778 ],
779 ]
780 );
781
782 $widget->add_control(
783 'ka_facet_chip_bg',
784 [
785 'label' => esc_html__('Background', 'king-addons'),
786 'type' => Controls_Manager::COLOR,
787 'selectors' => [
788 '{{WRAPPER}} .king-addons-active-filters__item' => 'background-color: {{VALUE}};',
789 ],
790 ]
791 );
792
793 $widget->add_control(
794 'ka_facet_chip_border',
795 [
796 'label' => esc_html__('Border Color', 'king-addons'),
797 'type' => Controls_Manager::COLOR,
798 'selectors' => [
799 '{{WRAPPER}} .king-addons-active-filters__item' => 'border-color: {{VALUE}};',
800 ],
801 ]
802 );
803
804 $widget->end_controls_tab();
805
806 $widget->start_controls_tab(
807 'ka_facet_chip_hover',
808 ['label' => esc_html__('Hover', 'king-addons')]
809 );
810
811 $widget->add_control(
812 'ka_facet_chip_color_hover',
813 [
814 'label' => esc_html__('Text Color', 'king-addons'),
815 'type' => Controls_Manager::COLOR,
816 'selectors' => [
817 '{{WRAPPER}} .king-addons-active-filters__item:hover' => 'color: {{VALUE}};',
818 ],
819 ]
820 );
821
822 $widget->add_control(
823 'ka_facet_chip_bg_hover',
824 [
825 'label' => esc_html__('Background', 'king-addons'),
826 'type' => Controls_Manager::COLOR,
827 'selectors' => [
828 '{{WRAPPER}} .king-addons-active-filters__item:hover' => 'background-color: {{VALUE}};',
829 ],
830 ]
831 );
832
833 $widget->end_controls_tab();
834 $widget->end_controls_tabs();
835
836 $widget->add_responsive_control(
837 'ka_facet_chip_radius',
838 [
839 'label' => esc_html__('Border Radius', 'king-addons'),
840 'type' => Controls_Manager::SLIDER,
841 'size_units' => ['px'],
842 'range' => [
843 'px' => ['min' => 0, 'max' => 40],
844 ],
845 'separator' => 'before',
846 'selectors' => [
847 '{{WRAPPER}} .king-addons-active-filters__item' => 'border-radius: {{SIZE}}{{UNIT}};',
848 ],
849 ]
850 );
851
852 $widget->add_responsive_control(
853 'ka_facet_chip_padding',
854 [
855 'label' => esc_html__('Padding', 'king-addons'),
856 'type' => Controls_Manager::DIMENSIONS,
857 'size_units' => ['px', 'em'],
858 'selectors' => [
859 '{{WRAPPER}} .king-addons-active-filters__item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
860 ],
861 ]
862 );
863
864 $widget->add_responsive_control(
865 'ka_facet_chip_gap',
866 [
867 'label' => esc_html__('Gap', 'king-addons'),
868 'type' => Controls_Manager::SLIDER,
869 'size_units' => ['px'],
870 'range' => [
871 'px' => ['min' => 0, 'max' => 24],
872 ],
873 'selectors' => [
874 '{{WRAPPER}} .king-addons-active-filters__list' => 'gap: {{SIZE}}{{UNIT}};',
875 ],
876 ]
877 );
878
879 $widget->end_controls_section();
880 }
881 }
882