@lincros-ui/components 0.2.26 → 0.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -5489,13 +5489,16 @@ var FilterBar = ({
5489
5489
  taskTypes,
5490
5490
  businessUnits,
5491
5491
  statusOptions: statusOptionsProp,
5492
- defaultStatus: defaultStatusProp
5492
+ defaultStatus: defaultStatusProp,
5493
+ variant = "default",
5494
+ className
5493
5495
  }) => {
5494
5496
  const [openPopovers, setOpenPopovers] = React37.useState({
5495
5497
  businessUnits: false,
5496
5498
  operators: false,
5497
5499
  taskTypes: false,
5498
- status: false
5500
+ status: false,
5501
+ all: false
5499
5502
  });
5500
5503
  const statusOptions = statusOptionsProp ?? [
5501
5504
  { value: "in-progress", label: "Em Andamento (IA)" },
@@ -5505,8 +5508,7 @@ var FilterBar = ({
5505
5508
  ];
5506
5509
  const defaultStatus = defaultStatusProp ?? ["in-progress", "human-interaction"];
5507
5510
  const updateFilter = (key, value) => {
5508
- const newFilters = { ...filters, [key]: value };
5509
- onFilterChange(newFilters);
5511
+ onFilterChange({ ...filters, [key]: value });
5510
5512
  };
5511
5513
  const clearFilter = (key) => {
5512
5514
  if (key === "vehicleId" || key === "operatorType") {
@@ -5518,7 +5520,7 @@ var FilterBar = ({
5518
5520
  }
5519
5521
  };
5520
5522
  const clearAllFilters = () => {
5521
- const emptyFilters = {
5523
+ onFilterChange({
5522
5524
  vehicleId: "",
5523
5525
  operators: [],
5524
5526
  taskTypes: [],
@@ -5527,15 +5529,15 @@ var FilterBar = ({
5527
5529
  status: defaultStatus,
5528
5530
  startDate: "",
5529
5531
  endDate: ""
5530
- };
5531
- onFilterChange(emptyFilters);
5532
- setOpenPopovers({ businessUnits: false, operators: false, taskTypes: false, status: false });
5532
+ });
5533
+ setOpenPopovers({ businessUnits: false, operators: false, taskTypes: false, status: false, all: false });
5533
5534
  };
5534
5535
  const toggleArrayFilter = (key, value) => {
5535
- const currentArray = filters[key];
5536
- const newArray = currentArray.includes(value) ? currentArray.filter((item) => item !== value) : [...currentArray, value];
5537
- updateFilter(key, newArray);
5536
+ const current = filters[key];
5537
+ const next = current.includes(value) ? current.filter((i) => i !== value) : [...current, value];
5538
+ updateFilter(key, next);
5538
5539
  };
5540
+ const isNonDefaultStatus = JSON.stringify([...filters.status].sort()) !== JSON.stringify([...defaultStatus].sort());
5539
5541
  const activeFiltersCount = [
5540
5542
  filters.operatorType,
5541
5543
  filters.startDate,
@@ -5543,355 +5545,307 @@ var FilterBar = ({
5543
5545
  ...filters.operators,
5544
5546
  ...filters.taskTypes,
5545
5547
  ...filters.businessUnits,
5546
- // Não contar status como filtro ativo se for o padrão
5547
- ...JSON.stringify([...filters.status].sort()) !== JSON.stringify([...defaultStatus].sort()) ? filters.status : []
5548
- ].filter((value) => value !== "").length;
5549
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white border-b border-gray-200 p-4 space-y-4", children: [
5550
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
5551
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
5552
- /* @__PURE__ */ jsxRuntime.jsx(
5553
- Input,
5554
- {
5555
- type: "date",
5556
- placeholder: "Data inicial",
5557
- value: filters.startDate,
5558
- onChange: (e) => updateFilter("startDate", e.target.value),
5559
- className: "w-30 h-10 px-3"
5560
- }
5561
- ),
5562
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: "at\xE9" }),
5563
- /* @__PURE__ */ jsxRuntime.jsx(
5564
- Input,
5565
- {
5566
- type: "date",
5567
- placeholder: "Data final",
5568
- value: filters.endDate,
5569
- onChange: (e) => updateFilter("endDate", e.target.value),
5570
- className: "w-30 h-10 px-3"
5571
- }
5572
- ),
5573
- (filters.startDate || filters.endDate) && /* @__PURE__ */ jsxRuntime.jsx(
5574
- Button,
5575
- {
5576
- variant: "ghost",
5577
- size: "sm",
5578
- onClick: () => {
5579
- clearFilter("startDate");
5580
- clearFilter("endDate");
5581
- },
5582
- className: "h-6 w-6 p-0 hover:bg-gray-100 flex items-center justify-center ml-0",
5583
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5584
- }
5585
- )
5586
- ] }),
5587
- /* @__PURE__ */ jsxRuntime.jsx(Separator5, { orientation: "vertical", className: "h-8" }),
5588
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
5589
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-gray-700", children: "Tipo:" }),
5590
- /* @__PURE__ */ jsxRuntime.jsxs(
5591
- ToggleGroup,
5592
- {
5593
- type: "single",
5594
- value: filters.operatorType,
5595
- onValueChange: (value) => updateFilter("operatorType", value || ""),
5596
- className: "border rounded-md p-0.5 h-10",
5597
- children: [
5598
- /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "ia", className: "flex items-center gap-1 text-xs h-9", children: [
5599
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "w-3 h-3" }),
5600
- "IA"
5601
- ] }),
5602
- /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "humano", className: "flex items-center gap-1 text-xs h-9", children: [
5603
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "w-3 h-3" }),
5604
- "Humano"
5605
- ] })
5606
- ]
5607
- }
5608
- )
5609
- ] }),
5610
- /* @__PURE__ */ jsxRuntime.jsx(Separator5, { orientation: "vertical", className: "h-8" }),
5611
- /* @__PURE__ */ jsxRuntime.jsxs(
5612
- Popover,
5613
- {
5614
- open: openPopovers.status,
5615
- onOpenChange: (open) => setOpenPopovers((prev) => ({ ...prev, status: open })),
5616
- children: [
5617
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "relative h-10", children: [
5618
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "w-4 h-4 mr-2" }),
5619
- "Status",
5620
- filters.status.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "destructive", className: "ml-2 h-5 w-5 p-0 text-xs flex items-center justify-center", children: filters.status.length })
5621
- ] }) }),
5622
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-80 p-4 bg-white border shadow-lg", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
5623
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5624
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800", children: "Status" }),
5625
- /* @__PURE__ */ jsxRuntime.jsx(
5626
- Button,
5627
- {
5628
- variant: "ghost",
5629
- size: "sm",
5630
- onClick: () => clearFilter("status"),
5631
- className: "text-gray-500 hover:text-gray-700",
5632
- children: "Padr\xE3o"
5633
- }
5634
- )
5635
- ] }),
5636
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto space-y-2", children: statusOptions.map((status) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
5637
- /* @__PURE__ */ jsxRuntime.jsx(
5638
- Checkbox,
5639
- {
5640
- id: `status-${status.value}`,
5641
- checked: filters.status.includes(status.value),
5642
- onCheckedChange: () => toggleArrayFilter("status", status.value)
5643
- }
5644
- ),
5645
- /* @__PURE__ */ jsxRuntime.jsx(
5646
- "label",
5647
- {
5648
- htmlFor: `status-${status.value}`,
5649
- className: "text-sm cursor-pointer flex-1",
5650
- children: status.label
5651
- }
5652
- )
5653
- ] }, status.value)) })
5654
- ] }) })
5655
- ]
5656
- }
5657
- ),
5658
- /* @__PURE__ */ jsxRuntime.jsxs(
5659
- Popover,
5660
- {
5661
- open: openPopovers.businessUnits,
5662
- onOpenChange: (open) => setOpenPopovers((prev) => ({ ...prev, businessUnits: open })),
5663
- children: [
5664
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "relative h-10", children: [
5665
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, { className: "w-4 h-4 mr-2" }),
5666
- "Unidades",
5667
- filters.businessUnits.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "destructive", className: "ml-2 h-5 w-5 p-0 text-xs flex items-center justify-center", children: filters.businessUnits.length })
5668
- ] }) }),
5669
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-80 p-4 bg-white border shadow-lg", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
5670
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5671
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800", children: "Unidades de Neg\xF3cio" }),
5672
- filters.businessUnits.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
5673
- Button,
5674
- {
5675
- variant: "ghost",
5676
- size: "sm",
5677
- onClick: () => clearFilter("businessUnits"),
5678
- className: "text-gray-500 hover:text-gray-700",
5679
- children: "Limpar"
5680
- }
5681
- )
5682
- ] }),
5683
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto space-y-2", children: businessUnits.map((unit) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
5684
- /* @__PURE__ */ jsxRuntime.jsx(
5685
- Checkbox,
5686
- {
5687
- id: `unit-${unit.codigo}`,
5688
- checked: filters.businessUnits.includes(unit.codigo),
5689
- onCheckedChange: () => toggleArrayFilter("businessUnits", unit.codigo)
5690
- }
5691
- ),
5692
- /* @__PURE__ */ jsxRuntime.jsx(
5693
- "label",
5694
- {
5695
- htmlFor: `unit-${unit.codigo}`,
5696
- className: "text-sm cursor-pointer flex-1",
5697
- children: unit.descricao
5698
- }
5699
- )
5700
- ] }, unit.codigo)) })
5701
- ] }) })
5702
- ]
5703
- }
5704
- ),
5705
- /* @__PURE__ */ jsxRuntime.jsxs(
5706
- Popover,
5707
- {
5708
- open: openPopovers.operators,
5709
- onOpenChange: (open) => setOpenPopovers((prev) => ({ ...prev, operators: open })),
5710
- children: [
5711
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "relative h-10", children: [
5712
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCheck, { className: "w-4 h-4 mr-2" }),
5713
- "Usu\xE1rios",
5714
- filters.operators.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "destructive", className: "ml-2 h-5 w-5 p-0 text-xs flex items-center justify-center", children: filters.operators.length })
5715
- ] }) }),
5716
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-80 p-4 bg-white border shadow-lg", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
5717
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5718
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800", children: "Usu\xE1rios" }),
5719
- filters.operators.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
5720
- Button,
5721
- {
5722
- variant: "ghost",
5723
- size: "sm",
5724
- onClick: () => clearFilter("operators"),
5725
- className: "text-gray-500 hover:text-gray-700",
5726
- children: "Limpar"
5727
- }
5728
- )
5729
- ] }),
5730
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto space-y-2", children: operators.map((operator) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
5731
- /* @__PURE__ */ jsxRuntime.jsx(
5732
- Checkbox,
5733
- {
5734
- id: `operator-${operator}`,
5735
- checked: filters.operators.includes(operator),
5736
- onCheckedChange: () => toggleArrayFilter("operators", operator)
5737
- }
5738
- ),
5739
- /* @__PURE__ */ jsxRuntime.jsx(
5740
- "label",
5741
- {
5742
- htmlFor: `operator-${operator}`,
5743
- className: "text-sm cursor-pointer flex-1",
5744
- children: operator
5745
- }
5746
- )
5747
- ] }, operator)) })
5748
- ] }) })
5749
- ]
5750
- }
5751
- ),
5752
- /* @__PURE__ */ jsxRuntime.jsxs(
5753
- Popover,
5754
- {
5755
- open: openPopovers.taskTypes,
5756
- onOpenChange: (open) => setOpenPopovers((prev) => ({ ...prev, taskTypes: open })),
5757
- children: [
5758
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "relative h-10", children: [
5759
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClipboardList, { className: "w-4 h-4 mr-2" }),
5760
- "Tipos de Tarefa",
5761
- filters.taskTypes.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "destructive", className: "ml-2 h-5 w-5 p-0 text-xs flex items-center justify-center", children: filters.taskTypes.length })
5762
- ] }) }),
5763
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-80 p-4 bg-white border shadow-lg", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
5764
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5765
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800", children: "Tipos de Tarefa" }),
5766
- filters.taskTypes.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
5767
- Button,
5768
- {
5769
- variant: "ghost",
5770
- size: "sm",
5771
- onClick: () => clearFilter("taskTypes"),
5772
- className: "text-gray-500 hover:text-gray-700",
5773
- children: "Limpar"
5774
- }
5775
- )
5776
- ] }),
5777
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto space-y-2", children: taskTypes.map((taskType) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
5778
- /* @__PURE__ */ jsxRuntime.jsx(
5779
- Checkbox,
5780
- {
5781
- id: `task-${taskType}`,
5782
- checked: filters.taskTypes.includes(taskType),
5783
- onCheckedChange: () => toggleArrayFilter("taskTypes", taskType)
5784
- }
5785
- ),
5786
- /* @__PURE__ */ jsxRuntime.jsx(
5787
- "label",
5788
- {
5789
- htmlFor: `task-${taskType}`,
5790
- className: "text-sm cursor-pointer flex-1",
5791
- children: taskType
5792
- }
5793
- )
5794
- ] }, taskType)) })
5795
- ] }) })
5796
- ]
5797
- }
5798
- ),
5799
- activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5548
+ ...isNonDefaultStatus ? filters.status : []
5549
+ ].filter((v) => v !== "").length;
5550
+ const StatusSection = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: statusOptions.map((s) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
5551
+ /* @__PURE__ */ jsxRuntime.jsx(
5552
+ Checkbox,
5553
+ {
5554
+ id: `status-${s.value}`,
5555
+ checked: filters.status.includes(s.value),
5556
+ onCheckedChange: () => toggleArrayFilter("status", s.value)
5557
+ }
5558
+ ),
5559
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: `status-${s.value}`, className: "text-sm cursor-pointer flex-1", children: s.label })
5560
+ ] }, s.value)) });
5561
+ const UnidadesSection = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: businessUnits.map((u) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
5562
+ /* @__PURE__ */ jsxRuntime.jsx(
5563
+ Checkbox,
5564
+ {
5565
+ id: `unit-${u.codigo}`,
5566
+ checked: filters.businessUnits.includes(u.codigo),
5567
+ onCheckedChange: () => toggleArrayFilter("businessUnits", u.codigo)
5568
+ }
5569
+ ),
5570
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: `unit-${u.codigo}`, className: "text-sm cursor-pointer flex-1", children: u.descricao })
5571
+ ] }, u.codigo)) });
5572
+ const OperatorsSection = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: operators.map((op) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
5573
+ /* @__PURE__ */ jsxRuntime.jsx(
5574
+ Checkbox,
5575
+ {
5576
+ id: `op-${op}`,
5577
+ checked: filters.operators.includes(op),
5578
+ onCheckedChange: () => toggleArrayFilter("operators", op)
5579
+ }
5580
+ ),
5581
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: `op-${op}`, className: "text-sm cursor-pointer flex-1", children: op })
5582
+ ] }, op)) });
5583
+ const TaskTypesSection = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: taskTypes.map((t) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
5584
+ /* @__PURE__ */ jsxRuntime.jsx(
5585
+ Checkbox,
5586
+ {
5587
+ id: `task-${t}`,
5588
+ checked: filters.taskTypes.includes(t),
5589
+ onCheckedChange: () => toggleArrayFilter("taskTypes", t)
5590
+ }
5591
+ ),
5592
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: `task-${t}`, className: "text-sm cursor-pointer flex-1", children: t })
5593
+ ] }, t)) });
5594
+ const ActiveChips = () => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5595
+ filters.operatorType && /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5596
+ "Tipo: ",
5597
+ filters.operatorType === "ia" ? "IA" : "Humano",
5598
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => clearFilter("operatorType"), className: "ml-1 hover:text-red-500", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" }) })
5599
+ ] }),
5600
+ isNonDefaultStatus && filters.status.map((s) => {
5601
+ const label = statusOptions.find((o) => o.value === s)?.label || s;
5602
+ return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5603
+ label,
5604
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => toggleArrayFilter("status", s), className: "ml-1 hover:text-red-500", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" }) })
5605
+ ] }, s);
5606
+ }),
5607
+ filters.businessUnits.map((c) => /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5608
+ businessUnits.find((u) => u.codigo === c)?.descricao ?? c,
5609
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => toggleArrayFilter("businessUnits", c), className: "ml-1 hover:text-red-500", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" }) })
5610
+ ] }, c)),
5611
+ filters.operators.map((op) => /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5612
+ op,
5613
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => toggleArrayFilter("operators", op), className: "ml-1 hover:text-red-500", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" }) })
5614
+ ] }, op)),
5615
+ filters.taskTypes.map((t) => /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5616
+ t,
5617
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => toggleArrayFilter("taskTypes", t), className: "ml-1 hover:text-red-500", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" }) })
5618
+ ] }, t))
5619
+ ] });
5620
+ if (variant === "default") {
5621
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("bg-white border-b border-gray-200 p-4 space-y-4", className), children: [
5622
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
5623
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
5624
+ /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "date", value: filters.startDate, onChange: (e) => updateFilter("startDate", e.target.value), className: "w-30 h-10 px-3" }),
5625
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: "at\xE9" }),
5626
+ /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "date", value: filters.endDate, onChange: (e) => updateFilter("endDate", e.target.value), className: "w-30 h-10 px-3" }),
5627
+ (filters.startDate || filters.endDate) && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", onClick: () => {
5628
+ clearFilter("startDate");
5629
+ clearFilter("endDate");
5630
+ }, className: "h-6 w-6 p-0", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" }) })
5631
+ ] }),
5800
5632
  /* @__PURE__ */ jsxRuntime.jsx(Separator5, { orientation: "vertical", className: "h-8" }),
5801
- /* @__PURE__ */ jsxRuntime.jsxs(
5802
- Button,
5803
- {
5804
- variant: "ghost",
5805
- size: "sm",
5806
- onClick: clearAllFilters,
5807
- className: "text-gray-500 hover:text-gray-700",
5808
- children: [
5809
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4 mr-1" }),
5810
- "Limpar todos"
5811
- ]
5812
- }
5813
- )
5633
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
5634
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-gray-700", children: "Tipo:" }),
5635
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroup, { type: "single", value: filters.operatorType, onValueChange: (v) => updateFilter("operatorType", v || ""), className: "border rounded-md p-0.5 h-10", children: [
5636
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "ia", className: "flex items-center gap-1 text-xs h-9", children: [
5637
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "w-3 h-3" }),
5638
+ "IA"
5639
+ ] }),
5640
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "humano", className: "flex items-center gap-1 text-xs h-9", children: [
5641
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "w-3 h-3" }),
5642
+ "Humano"
5643
+ ] })
5644
+ ] })
5645
+ ] }),
5646
+ /* @__PURE__ */ jsxRuntime.jsx(Separator5, { orientation: "vertical", className: "h-8" }),
5647
+ [
5648
+ { key: "status", label: "Status", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "w-4 h-4 mr-2" }), count: isNonDefaultStatus ? filters.status.length : 0, section: /* @__PURE__ */ jsxRuntime.jsx(StatusSection, {}) },
5649
+ { key: "businessUnits", label: "Unidades", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, { className: "w-4 h-4 mr-2" }), count: filters.businessUnits.length, section: /* @__PURE__ */ jsxRuntime.jsx(UnidadesSection, {}) },
5650
+ { key: "operators", label: "Usu\xE1rios", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCheck, { className: "w-4 h-4 mr-2" }), count: filters.operators.length, section: /* @__PURE__ */ jsxRuntime.jsx(OperatorsSection, {}) },
5651
+ { key: "taskTypes", label: "Tarefas", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClipboardList, { className: "w-4 h-4 mr-2" }), count: filters.taskTypes.length, section: /* @__PURE__ */ jsxRuntime.jsx(TaskTypesSection, {}) }
5652
+ ].map(({ key, label, icon, count: count2, section }) => /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: openPopovers[key], onOpenChange: (o) => setOpenPopovers((p) => ({ ...p, [key]: o })), children: [
5653
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "relative h-10", children: [
5654
+ icon,
5655
+ label,
5656
+ count2 > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "destructive", className: "ml-2 h-5 w-5 p-0 text-xs flex items-center justify-center", children: count2 })
5657
+ ] }) }),
5658
+ /* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { className: "w-72 p-4 bg-white border shadow-lg", align: "start", children: [
5659
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
5660
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800", children: label }),
5661
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", onClick: () => clearFilter(key), className: "text-gray-500 hover:text-gray-700 text-xs", children: "Limpar" })
5662
+ ] }),
5663
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: section })
5664
+ ] })
5665
+ ] }, key)),
5666
+ activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5667
+ /* @__PURE__ */ jsxRuntime.jsx(Separator5, { orientation: "vertical", className: "h-8" }),
5668
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", onClick: clearAllFilters, className: "text-gray-500 hover:text-gray-700", children: [
5669
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4 mr-1" }),
5670
+ "Limpar todos"
5671
+ ] })
5672
+ ] })
5673
+ ] }),
5674
+ activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
5675
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-600", children: "Filtros ativos:" }),
5676
+ /* @__PURE__ */ jsxRuntime.jsx(ActiveChips, {})
5814
5677
  ] })
5815
- ] }),
5816
- activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
5817
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-600", children: "Filtros ativos:" }),
5818
- filters.operatorType && /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5819
- "Tipo: ",
5820
- filters.operatorType === "ia" ? "IA" : "Humano",
5821
- /* @__PURE__ */ jsxRuntime.jsx(
5822
- Button,
5823
- {
5824
- variant: "ghost",
5825
- size: "sm",
5826
- onClick: () => clearFilter("operatorType"),
5827
- className: "icon-size p-0 hover:bg-gray-200 ml-1",
5828
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5829
- }
5830
- )
5678
+ ] });
5679
+ }
5680
+ if (variant === "chips") {
5681
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("border-b border-gray-100 px-4 py-2 space-y-1.5", className), children: [
5682
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
5683
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
5684
+ /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "date", value: filters.startDate, onChange: (e) => updateFilter("startDate", e.target.value), className: "h-7 text-xs px-2 w-28 border-gray-200" }),
5685
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-300 text-xs", children: "\u2013" }),
5686
+ /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "date", value: filters.endDate, onChange: (e) => updateFilter("endDate", e.target.value), className: "h-7 text-xs px-2 w-28 border-gray-200" }),
5687
+ (filters.startDate || filters.endDate) && /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => {
5688
+ clearFilter("startDate");
5689
+ clearFilter("endDate");
5690
+ }, className: "text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" }) })
5691
+ ] }),
5692
+ /* @__PURE__ */ jsxRuntime.jsx(Separator5, { orientation: "vertical", className: "h-5 mx-0.5" }),
5693
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroup, { type: "single", value: filters.operatorType, onValueChange: (v) => updateFilter("operatorType", v || ""), className: "gap-1", children: [
5694
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "ia", className: "h-7 px-2.5 text-xs rounded-full data-[state=on]:bg-blue-100 data-[state=on]:text-blue-700 border-0 bg-gray-100 hover:bg-gray-200", children: [
5695
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "w-3 h-3 mr-1" }),
5696
+ "IA"
5697
+ ] }),
5698
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "humano", className: "h-7 px-2.5 text-xs rounded-full data-[state=on]:bg-emerald-100 data-[state=on]:text-emerald-700 border-0 bg-gray-100 hover:bg-gray-200", children: [
5699
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "w-3 h-3 mr-1" }),
5700
+ "Humano"
5701
+ ] })
5702
+ ] }),
5703
+ /* @__PURE__ */ jsxRuntime.jsx(Separator5, { orientation: "vertical", className: "h-5 mx-0.5" }),
5704
+ [
5705
+ { key: "status", label: "Status", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "w-3 h-3" }), count: isNonDefaultStatus ? filters.status.length : 0, section: /* @__PURE__ */ jsxRuntime.jsx(StatusSection, {}) },
5706
+ { key: "businessUnits", label: "Unidades", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, { className: "w-3 h-3" }), count: filters.businessUnits.length, section: /* @__PURE__ */ jsxRuntime.jsx(UnidadesSection, {}) },
5707
+ { key: "operators", label: "Usu\xE1rios", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCheck, { className: "w-3 h-3" }), count: filters.operators.length, section: /* @__PURE__ */ jsxRuntime.jsx(OperatorsSection, {}) },
5708
+ { key: "taskTypes", label: "Tarefas", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClipboardList, { className: "w-3 h-3" }), count: filters.taskTypes.length, section: /* @__PURE__ */ jsxRuntime.jsx(TaskTypesSection, {}) }
5709
+ ].map(({ key, label, icon, count: count2, section }) => /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: openPopovers[key], onOpenChange: (o) => setOpenPopovers((p) => ({ ...p, [key]: o })), children: [
5710
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("button", { className: `inline-flex items-center gap-1 h-7 px-2.5 rounded-full text-xs font-medium transition-colors ${count2 > 0 ? "bg-blue-100 text-blue-700" : "bg-gray-100 text-gray-600 hover:bg-gray-200"}`, children: [
5711
+ icon,
5712
+ label,
5713
+ count2 > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-0.5 bg-blue-600 text-white rounded-full w-4 h-4 flex items-center justify-center text-[10px]", children: count2 }),
5714
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-3 h-3 opacity-50" })
5715
+ ] }) }),
5716
+ /* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { className: "w-72 p-4 bg-white border shadow-lg", align: "start", children: [
5717
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
5718
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800 text-sm", children: label }),
5719
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => clearFilter(key), className: "text-xs text-gray-400 hover:text-gray-600", children: "Limpar" })
5720
+ ] }),
5721
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: section })
5722
+ ] })
5723
+ ] }, key)),
5724
+ activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("button", { onClick: clearAllFilters, className: "inline-flex items-center gap-1 h-7 px-2.5 rounded-full text-xs text-gray-400 hover:text-red-500 hover:bg-red-50 transition-colors", children: [
5725
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" }),
5726
+ "Limpar"
5727
+ ] })
5831
5728
  ] }),
5832
- filters.status.length > 0 && filters.status.map((status) => {
5833
- const statusLabel = statusOptions.find((s) => s.value === status)?.label || status;
5834
- return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5835
- "Status: ",
5836
- statusLabel,
5837
- /* @__PURE__ */ jsxRuntime.jsx(
5838
- Button,
5839
- {
5840
- variant: "ghost",
5841
- size: "sm",
5842
- onClick: () => toggleArrayFilter("status", status),
5843
- className: "icon-size p-0 hover:bg-gray-200 ml-1",
5844
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5845
- }
5846
- )
5847
- ] }, status);
5848
- }),
5849
- filters.businessUnits.map((unitCodigo) => {
5850
- const unit = businessUnits.find((u) => u.codigo === unitCodigo);
5851
- return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5852
- "Unidade: ",
5853
- unit?.descricao,
5854
- /* @__PURE__ */ jsxRuntime.jsx(
5855
- Button,
5856
- {
5857
- variant: "ghost",
5858
- size: "sm",
5859
- onClick: () => toggleArrayFilter("businessUnits", unitCodigo),
5860
- className: "icon-size p-0 hover:bg-gray-200 ml-1",
5861
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5862
- }
5863
- )
5864
- ] }, unitCodigo);
5865
- }),
5866
- filters.operators.map((operator) => /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5867
- "Operador: ",
5868
- operator,
5869
- /* @__PURE__ */ jsxRuntime.jsx(
5870
- Button,
5871
- {
5872
- variant: "ghost",
5873
- size: "sm",
5874
- onClick: () => toggleArrayFilter("operators", operator),
5875
- className: "icon-size p-0 hover:bg-gray-200 ml-1",
5876
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5877
- }
5878
- )
5879
- ] }, operator)),
5880
- filters.taskTypes.map((taskType) => /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5881
- "Tipo: ",
5882
- taskType,
5883
- /* @__PURE__ */ jsxRuntime.jsx(
5884
- Button,
5885
- {
5886
- variant: "ghost",
5887
- size: "sm",
5888
- onClick: () => toggleArrayFilter("taskTypes", taskType),
5889
- className: "icon-size p-0 hover:bg-gray-200 ml-1",
5890
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5891
- }
5892
- )
5893
- ] }, taskType))
5894
- ] })
5729
+ activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(ActiveChips, {}) })
5730
+ ] });
5731
+ }
5732
+ if (variant === "minimal") {
5733
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("px-6 py-2 space-y-1", className), children: [
5734
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-wrap text-sm text-gray-500", children: [
5735
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
5736
+ /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "date", value: filters.startDate, onChange: (e) => updateFilter("startDate", e.target.value), className: "h-7 text-xs px-2 w-28 border-0 bg-transparent shadow-none focus-visible:ring-0 text-gray-600 p-0" }),
5737
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-300", children: "\u2013" }),
5738
+ /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "date", value: filters.endDate, onChange: (e) => updateFilter("endDate", e.target.value), className: "h-7 text-xs px-2 w-28 border-0 bg-transparent shadow-none focus-visible:ring-0 text-gray-600 p-0" }),
5739
+ (filters.startDate || filters.endDate) && /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => {
5740
+ clearFilter("startDate");
5741
+ clearFilter("endDate");
5742
+ }, className: "text-gray-300 hover:text-gray-500", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" }) })
5743
+ ] }),
5744
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-200", children: "|" }),
5745
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroup, { type: "single", value: filters.operatorType, onValueChange: (v) => updateFilter("operatorType", v || ""), className: "gap-0.5", children: [
5746
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "ia", className: "h-7 px-2 text-xs border-0 bg-transparent text-gray-500 hover:text-gray-800 data-[state=on]:bg-gray-100 data-[state=on]:text-gray-800 rounded", children: [
5747
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "w-3 h-3 mr-1" }),
5748
+ "IA"
5749
+ ] }),
5750
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "humano", className: "h-7 px-2 text-xs border-0 bg-transparent text-gray-500 hover:text-gray-800 data-[state=on]:bg-gray-100 data-[state=on]:text-gray-800 rounded", children: [
5751
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "w-3 h-3 mr-1" }),
5752
+ "Humano"
5753
+ ] })
5754
+ ] }),
5755
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-200", children: "|" }),
5756
+ [
5757
+ { key: "status", label: "Status", count: isNonDefaultStatus ? filters.status.length : 0, section: /* @__PURE__ */ jsxRuntime.jsx(StatusSection, {}) },
5758
+ { key: "businessUnits", label: "Unidades", count: filters.businessUnits.length, section: /* @__PURE__ */ jsxRuntime.jsx(UnidadesSection, {}) },
5759
+ { key: "operators", label: "Usu\xE1rios", count: filters.operators.length, section: /* @__PURE__ */ jsxRuntime.jsx(OperatorsSection, {}) },
5760
+ { key: "taskTypes", label: "Tarefas", count: filters.taskTypes.length, section: /* @__PURE__ */ jsxRuntime.jsx(TaskTypesSection, {}) }
5761
+ ].map(({ key, label, count: count2, section }) => /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: openPopovers[key], onOpenChange: (o) => setOpenPopovers((p) => ({ ...p, [key]: o })), children: [
5762
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("button", { className: `inline-flex items-center gap-1 text-xs hover:text-gray-800 transition-colors ${count2 > 0 ? "text-blue-600 font-medium" : "text-gray-500"}`, children: [
5763
+ label,
5764
+ count2 > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold", children: [
5765
+ "(",
5766
+ count2,
5767
+ ")"
5768
+ ] }),
5769
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-3 h-3 opacity-40" })
5770
+ ] }) }),
5771
+ /* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { className: "w-72 p-4 bg-white border shadow-lg", align: "start", children: [
5772
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
5773
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800 text-sm", children: label }),
5774
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => clearFilter(key), className: "text-xs text-gray-400 hover:text-gray-600", children: "Limpar" })
5775
+ ] }),
5776
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: section })
5777
+ ] })
5778
+ ] }, key)),
5779
+ activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5780
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-200", children: "|" }),
5781
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: clearAllFilters, className: "text-xs text-gray-400 hover:text-red-500 transition-colors", children: "Limpar tudo" })
5782
+ ] })
5783
+ ] }),
5784
+ activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(ActiveChips, {}) })
5785
+ ] });
5786
+ }
5787
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("px-6 py-2 flex items-center gap-2 flex-wrap", className), children: [
5788
+ /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: openPopovers.all, onOpenChange: (o) => setOpenPopovers((p) => ({ ...p, all: o })), children: [
5789
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("button", { className: `inline-flex items-center gap-1.5 h-8 px-3 rounded-md text-sm border transition-colors ${activeFiltersCount > 0 ? "border-blue-300 bg-blue-50 text-blue-700" : "border-gray-200 bg-white text-gray-600 hover:bg-gray-50"}`, children: [
5790
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "w-3.5 h-3.5" }),
5791
+ "Filtros",
5792
+ activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-blue-600 text-white rounded-full w-4 h-4 flex items-center justify-center text-[10px] font-semibold", children: activeFiltersCount }),
5793
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-3 h-3 opacity-40" })
5794
+ ] }) }),
5795
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-80 p-0 bg-white border shadow-lg", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-h-[60vh] overflow-y-auto p-4 space-y-4", children: [
5796
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5797
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800 text-sm", children: "Filtros" }),
5798
+ activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: clearAllFilters, className: "text-xs text-gray-400 hover:text-red-500 transition-colors", children: "Limpar tudo" })
5799
+ ] }),
5800
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5801
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide mb-2", children: "Per\xEDodo" }),
5802
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
5803
+ /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "date", value: filters.startDate, onChange: (e) => updateFilter("startDate", e.target.value), className: "h-8 text-xs px-2 flex-1" }),
5804
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-300 text-xs", children: "\u2013" }),
5805
+ /* @__PURE__ */ jsxRuntime.jsx(Input, { type: "date", value: filters.endDate, onChange: (e) => updateFilter("endDate", e.target.value), className: "h-8 text-xs px-2 flex-1" })
5806
+ ] })
5807
+ ] }),
5808
+ /* @__PURE__ */ jsxRuntime.jsx(Separator5, {}),
5809
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5810
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide mb-2", children: "Tipo de Operador" }),
5811
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroup, { type: "single", value: filters.operatorType, onValueChange: (v) => updateFilter("operatorType", v || ""), className: "gap-1 justify-start", children: [
5812
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "ia", className: "h-7 px-3 text-xs rounded-md border data-[state=on]:bg-blue-100 data-[state=on]:text-blue-700 data-[state=on]:border-blue-300", children: [
5813
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "w-3 h-3 mr-1" }),
5814
+ "IA"
5815
+ ] }),
5816
+ /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "humano", className: "h-7 px-3 text-xs rounded-md border data-[state=on]:bg-emerald-100 data-[state=on]:text-emerald-700 data-[state=on]:border-emerald-300", children: [
5817
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "w-3 h-3 mr-1" }),
5818
+ "Humano"
5819
+ ] })
5820
+ ] })
5821
+ ] }),
5822
+ /* @__PURE__ */ jsxRuntime.jsx(Separator5, {}),
5823
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5824
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide mb-2", children: "Status" }),
5825
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-32 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(StatusSection, {}) })
5826
+ ] }),
5827
+ /* @__PURE__ */ jsxRuntime.jsx(Separator5, {}),
5828
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5829
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide mb-2", children: "Unidades de Neg\xF3cio" }),
5830
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-32 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(UnidadesSection, {}) })
5831
+ ] }),
5832
+ operators.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5833
+ /* @__PURE__ */ jsxRuntime.jsx(Separator5, {}),
5834
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5835
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide mb-2", children: "Usu\xE1rios" }),
5836
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-32 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(OperatorsSection, {}) })
5837
+ ] })
5838
+ ] }),
5839
+ taskTypes.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5840
+ /* @__PURE__ */ jsxRuntime.jsx(Separator5, {}),
5841
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5842
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide mb-2", children: "Tipos de Tarefa" }),
5843
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-32 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(TaskTypesSection, {}) })
5844
+ ] })
5845
+ ] })
5846
+ ] }) })
5847
+ ] }),
5848
+ activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(ActiveChips, {}) })
5895
5849
  ] });
5896
5850
  };
5897
5851
  var FilterBar_default = FilterBar;
@@ -6980,7 +6934,10 @@ var StatusIndicator = ({ status, count: count2, label, onClick }) => {
6980
6934
  );
6981
6935
  };
6982
6936
  var StatusIndicator_default = StatusIndicator;
6983
- var ViewToggle = ({ viewMode, onViewModeChange }) => {
6937
+ var ViewToggle = ({
6938
+ viewMode,
6939
+ onViewModeChange
6940
+ }) => {
6984
6941
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 rounded-lg border p-1", children: [
6985
6942
  /* @__PURE__ */ jsxRuntime.jsxs(
6986
6943
  Button,
@@ -7014,7 +6971,7 @@ var ViewToggle = ({ viewMode, onViewModeChange }) => {
7014
6971
  variant: viewMode === "chat" ? "default" : "ghost",
7015
6972
  size: "sm",
7016
6973
  onClick: () => onViewModeChange("chat"),
7017
- className: "flex items-center gap-2",
6974
+ className: "flex items-center gap-2 hidden",
7018
6975
  children: [
7019
6976
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "icon-size" }),
7020
6977
  "Conversa"