@lincros-ui/components 0.2.25 → 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,407 +5529,323 @@ 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
- filters.vehicleId,
5541
5542
  filters.operatorType,
5542
5543
  filters.startDate,
5543
5544
  filters.endDate,
5544
5545
  ...filters.operators,
5545
5546
  ...filters.taskTypes,
5546
5547
  ...filters.businessUnits,
5547
- // Não contar status como filtro ativo se for o padrão
5548
- ...JSON.stringify([...filters.status].sort()) !== JSON.stringify([...defaultStatus].sort()) ? filters.status : []
5549
- ].filter((value) => value !== "").length;
5550
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white border-b border-gray-200 p-4 space-y-4", children: [
5551
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
5552
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(
5553
- Input,
5554
- {
5555
- placeholder: "Buscar por placa...",
5556
- value: filters.vehicleId,
5557
- onChange: (e) => updateFilter("vehicleId", e.target.value),
5558
- leftIcon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "w-4 h-4" }),
5559
- rightIcon: filters.vehicleId ? /* @__PURE__ */ jsxRuntime.jsx(
5560
- Button,
5561
- {
5562
- variant: "ghost",
5563
- size: "sm",
5564
- onClick: () => clearFilter("vehicleId"),
5565
- className: "h-6 w-6 p-0 hover:bg-gray-100 -mr-2",
5566
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5567
- }
5568
- ) : void 0,
5569
- className: "w-48",
5570
- showValidationIcon: false
5571
- }
5572
- ) }),
5573
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
5574
- /* @__PURE__ */ jsxRuntime.jsx(
5575
- Input,
5576
- {
5577
- type: "date",
5578
- placeholder: "Data inicial",
5579
- value: filters.startDate,
5580
- onChange: (e) => updateFilter("startDate", e.target.value),
5581
- className: "w-30 h-10 px-3"
5582
- }
5583
- ),
5584
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: "at\xE9" }),
5585
- /* @__PURE__ */ jsxRuntime.jsx(
5586
- Input,
5587
- {
5588
- type: "date",
5589
- placeholder: "Data final",
5590
- value: filters.endDate,
5591
- onChange: (e) => updateFilter("endDate", e.target.value),
5592
- className: "w-30 h-10 px-3"
5593
- }
5594
- ),
5595
- (filters.startDate || filters.endDate) && /* @__PURE__ */ jsxRuntime.jsx(
5596
- Button,
5597
- {
5598
- variant: "ghost",
5599
- size: "sm",
5600
- onClick: () => {
5601
- clearFilter("startDate");
5602
- clearFilter("endDate");
5603
- },
5604
- className: "h-6 w-6 p-0 hover:bg-gray-100 flex items-center justify-center ml-0",
5605
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5606
- }
5607
- )
5608
- ] }),
5609
- /* @__PURE__ */ jsxRuntime.jsx(Separator5, { orientation: "vertical", className: "h-8" }),
5610
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
5611
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-gray-700", children: "Tipo:" }),
5612
- /* @__PURE__ */ jsxRuntime.jsxs(
5613
- ToggleGroup,
5614
- {
5615
- type: "single",
5616
- value: filters.operatorType,
5617
- onValueChange: (value) => updateFilter("operatorType", value || ""),
5618
- className: "border rounded-md p-0.5 h-10",
5619
- children: [
5620
- /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "ia", className: "flex items-center gap-1 text-xs h-9", children: [
5621
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "w-3 h-3" }),
5622
- "IA"
5623
- ] }),
5624
- /* @__PURE__ */ jsxRuntime.jsxs(ToggleGroupItem, { value: "humano", className: "flex items-center gap-1 text-xs h-9", children: [
5625
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "w-3 h-3" }),
5626
- "Humano"
5627
- ] })
5628
- ]
5629
- }
5630
- )
5631
- ] }),
5632
- /* @__PURE__ */ jsxRuntime.jsx(Separator5, { orientation: "vertical", className: "h-8" }),
5633
- /* @__PURE__ */ jsxRuntime.jsxs(
5634
- Popover,
5635
- {
5636
- open: openPopovers.status,
5637
- onOpenChange: (open) => setOpenPopovers((prev) => ({ ...prev, status: open })),
5638
- children: [
5639
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "relative h-10", children: [
5640
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "w-4 h-4 mr-2" }),
5641
- "Status",
5642
- 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 })
5643
- ] }) }),
5644
- /* @__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: [
5645
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5646
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800", children: "Status" }),
5647
- /* @__PURE__ */ jsxRuntime.jsx(
5648
- Button,
5649
- {
5650
- variant: "ghost",
5651
- size: "sm",
5652
- onClick: () => clearFilter("status"),
5653
- className: "text-gray-500 hover:text-gray-700",
5654
- children: "Padr\xE3o"
5655
- }
5656
- )
5657
- ] }),
5658
- /* @__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: [
5659
- /* @__PURE__ */ jsxRuntime.jsx(
5660
- Checkbox,
5661
- {
5662
- id: `status-${status.value}`,
5663
- checked: filters.status.includes(status.value),
5664
- onCheckedChange: () => toggleArrayFilter("status", status.value)
5665
- }
5666
- ),
5667
- /* @__PURE__ */ jsxRuntime.jsx(
5668
- "label",
5669
- {
5670
- htmlFor: `status-${status.value}`,
5671
- className: "text-sm cursor-pointer flex-1",
5672
- children: status.label
5673
- }
5674
- )
5675
- ] }, status.value)) })
5676
- ] }) })
5677
- ]
5678
- }
5679
- ),
5680
- /* @__PURE__ */ jsxRuntime.jsxs(
5681
- Popover,
5682
- {
5683
- open: openPopovers.businessUnits,
5684
- onOpenChange: (open) => setOpenPopovers((prev) => ({ ...prev, businessUnits: open })),
5685
- children: [
5686
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "relative h-10", children: [
5687
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, { className: "w-4 h-4 mr-2" }),
5688
- "Unidades",
5689
- 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 })
5690
- ] }) }),
5691
- /* @__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: [
5692
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5693
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800", children: "Unidades de Neg\xF3cio" }),
5694
- filters.businessUnits.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
5695
- Button,
5696
- {
5697
- variant: "ghost",
5698
- size: "sm",
5699
- onClick: () => clearFilter("businessUnits"),
5700
- className: "text-gray-500 hover:text-gray-700",
5701
- children: "Limpar"
5702
- }
5703
- )
5704
- ] }),
5705
- /* @__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: [
5706
- /* @__PURE__ */ jsxRuntime.jsx(
5707
- Checkbox,
5708
- {
5709
- id: `unit-${unit.codigo}`,
5710
- checked: filters.businessUnits.includes(unit.codigo),
5711
- onCheckedChange: () => toggleArrayFilter("businessUnits", unit.codigo)
5712
- }
5713
- ),
5714
- /* @__PURE__ */ jsxRuntime.jsx(
5715
- "label",
5716
- {
5717
- htmlFor: `unit-${unit.codigo}`,
5718
- className: "text-sm cursor-pointer flex-1",
5719
- children: unit.descricao
5720
- }
5721
- )
5722
- ] }, unit.codigo)) })
5723
- ] }) })
5724
- ]
5725
- }
5726
- ),
5727
- /* @__PURE__ */ jsxRuntime.jsxs(
5728
- Popover,
5729
- {
5730
- open: openPopovers.operators,
5731
- onOpenChange: (open) => setOpenPopovers((prev) => ({ ...prev, operators: open })),
5732
- children: [
5733
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "relative h-10", children: [
5734
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCheck, { className: "w-4 h-4 mr-2" }),
5735
- "Usu\xE1rios",
5736
- 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 })
5737
- ] }) }),
5738
- /* @__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: [
5739
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5740
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800", children: "Usu\xE1rios" }),
5741
- filters.operators.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
5742
- Button,
5743
- {
5744
- variant: "ghost",
5745
- size: "sm",
5746
- onClick: () => clearFilter("operators"),
5747
- className: "text-gray-500 hover:text-gray-700",
5748
- children: "Limpar"
5749
- }
5750
- )
5751
- ] }),
5752
- /* @__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: [
5753
- /* @__PURE__ */ jsxRuntime.jsx(
5754
- Checkbox,
5755
- {
5756
- id: `operator-${operator}`,
5757
- checked: filters.operators.includes(operator),
5758
- onCheckedChange: () => toggleArrayFilter("operators", operator)
5759
- }
5760
- ),
5761
- /* @__PURE__ */ jsxRuntime.jsx(
5762
- "label",
5763
- {
5764
- htmlFor: `operator-${operator}`,
5765
- className: "text-sm cursor-pointer flex-1",
5766
- children: operator
5767
- }
5768
- )
5769
- ] }, operator)) })
5770
- ] }) })
5771
- ]
5772
- }
5773
- ),
5774
- /* @__PURE__ */ jsxRuntime.jsxs(
5775
- Popover,
5776
- {
5777
- open: openPopovers.taskTypes,
5778
- onOpenChange: (open) => setOpenPopovers((prev) => ({ ...prev, taskTypes: open })),
5779
- children: [
5780
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "relative h-10", children: [
5781
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClipboardList, { className: "w-4 h-4 mr-2" }),
5782
- "Tipos de Tarefa",
5783
- 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 })
5784
- ] }) }),
5785
- /* @__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: [
5786
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5787
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-800", children: "Tipos de Tarefa" }),
5788
- filters.taskTypes.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
5789
- Button,
5790
- {
5791
- variant: "ghost",
5792
- size: "sm",
5793
- onClick: () => clearFilter("taskTypes"),
5794
- className: "text-gray-500 hover:text-gray-700",
5795
- children: "Limpar"
5796
- }
5797
- )
5798
- ] }),
5799
- /* @__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: [
5800
- /* @__PURE__ */ jsxRuntime.jsx(
5801
- Checkbox,
5802
- {
5803
- id: `task-${taskType}`,
5804
- checked: filters.taskTypes.includes(taskType),
5805
- onCheckedChange: () => toggleArrayFilter("taskTypes", taskType)
5806
- }
5807
- ),
5808
- /* @__PURE__ */ jsxRuntime.jsx(
5809
- "label",
5810
- {
5811
- htmlFor: `task-${taskType}`,
5812
- className: "text-sm cursor-pointer flex-1",
5813
- children: taskType
5814
- }
5815
- )
5816
- ] }, taskType)) })
5817
- ] }) })
5818
- ]
5819
- }
5820
- ),
5821
- 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
+ ] }),
5822
5632
  /* @__PURE__ */ jsxRuntime.jsx(Separator5, { orientation: "vertical", className: "h-8" }),
5823
- /* @__PURE__ */ jsxRuntime.jsxs(
5824
- Button,
5825
- {
5826
- variant: "ghost",
5827
- size: "sm",
5828
- onClick: clearAllFilters,
5829
- className: "text-gray-500 hover:text-gray-700",
5830
- children: [
5831
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4 mr-1" }),
5832
- "Limpar todos"
5833
- ]
5834
- }
5835
- )
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, {})
5836
5677
  ] })
5837
- ] }),
5838
- activeFiltersCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
5839
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-600", children: "Filtros ativos:" }),
5840
- filters.vehicleId && /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5841
- "Placa: ",
5842
- filters.vehicleId,
5843
- /* @__PURE__ */ jsxRuntime.jsx(
5844
- Button,
5845
- {
5846
- variant: "ghost",
5847
- size: "sm",
5848
- onClick: () => clearFilter("vehicleId"),
5849
- className: "icon-size p-0 hover:bg-gray-200 ml-1",
5850
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5851
- }
5852
- )
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
+ ] })
5853
5728
  ] }),
5854
- filters.operatorType && /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5855
- "Tipo: ",
5856
- filters.operatorType === "ia" ? "IA" : "Humano",
5857
- /* @__PURE__ */ jsxRuntime.jsx(
5858
- Button,
5859
- {
5860
- variant: "ghost",
5861
- size: "sm",
5862
- onClick: () => clearFilter("operatorType"),
5863
- className: "icon-size p-0 hover:bg-gray-200 ml-1",
5864
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5865
- }
5866
- )
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
+ ] })
5867
5783
  ] }),
5868
- filters.status.length > 0 && filters.status.map((status) => {
5869
- const statusLabel = statusOptions.find((s) => s.value === status)?.label || status;
5870
- return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5871
- "Status: ",
5872
- statusLabel,
5873
- /* @__PURE__ */ jsxRuntime.jsx(
5874
- Button,
5875
- {
5876
- variant: "ghost",
5877
- size: "sm",
5878
- onClick: () => toggleArrayFilter("status", status),
5879
- className: "icon-size p-0 hover:bg-gray-200 ml-1",
5880
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5881
- }
5882
- )
5883
- ] }, status);
5884
- }),
5885
- filters.businessUnits.map((unitCodigo) => {
5886
- const unit = businessUnits.find((u) => u.codigo === unitCodigo);
5887
- return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5888
- "Unidade: ",
5889
- unit?.descricao,
5890
- /* @__PURE__ */ jsxRuntime.jsx(
5891
- Button,
5892
- {
5893
- variant: "ghost",
5894
- size: "sm",
5895
- onClick: () => toggleArrayFilter("businessUnits", unitCodigo),
5896
- className: "icon-size p-0 hover:bg-gray-200 ml-1",
5897
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5898
- }
5899
- )
5900
- ] }, unitCodigo);
5901
- }),
5902
- filters.operators.map((operator) => /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5903
- "Operador: ",
5904
- operator,
5905
- /* @__PURE__ */ jsxRuntime.jsx(
5906
- Button,
5907
- {
5908
- variant: "ghost",
5909
- size: "sm",
5910
- onClick: () => toggleArrayFilter("operators", operator),
5911
- className: "icon-size p-0 hover:bg-gray-200 ml-1",
5912
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5913
- }
5914
- )
5915
- ] }, operator)),
5916
- filters.taskTypes.map((taskType) => /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [
5917
- "Tipo: ",
5918
- taskType,
5919
- /* @__PURE__ */ jsxRuntime.jsx(
5920
- Button,
5921
- {
5922
- variant: "ghost",
5923
- size: "sm",
5924
- onClick: () => toggleArrayFilter("taskTypes", taskType),
5925
- className: "icon-size p-0 hover:bg-gray-200 ml-1",
5926
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
5927
- }
5928
- )
5929
- ] }, taskType))
5930
- ] })
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, {}) })
5931
5849
  ] });
5932
5850
  };
5933
5851
  var FilterBar_default = FilterBar;
@@ -7016,7 +6934,10 @@ var StatusIndicator = ({ status, count: count2, label, onClick }) => {
7016
6934
  );
7017
6935
  };
7018
6936
  var StatusIndicator_default = StatusIndicator;
7019
- var ViewToggle = ({ viewMode, onViewModeChange }) => {
6937
+ var ViewToggle = ({
6938
+ viewMode,
6939
+ onViewModeChange
6940
+ }) => {
7020
6941
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 rounded-lg border p-1", children: [
7021
6942
  /* @__PURE__ */ jsxRuntime.jsxs(
7022
6943
  Button,
@@ -7050,7 +6971,7 @@ var ViewToggle = ({ viewMode, onViewModeChange }) => {
7050
6971
  variant: viewMode === "chat" ? "default" : "ghost",
7051
6972
  size: "sm",
7052
6973
  onClick: () => onViewModeChange("chat"),
7053
- className: "flex items-center gap-2",
6974
+ className: "flex items-center gap-2 hidden",
7054
6975
  children: [
7055
6976
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "icon-size" }),
7056
6977
  "Conversa"