@l3mpire/ui 2.11.0 → 2.12.0

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.mjs CHANGED
@@ -149,7 +149,7 @@ var buttonVariants = cva2(
149
149
  },
150
150
  size: {
151
151
  sm: [
152
- "h-6 p-xs gap-xs",
152
+ "h-6 py-xs gap-xs",
153
153
  "text-xs",
154
154
  "min-w-16 rounded-base"
155
155
  ],
@@ -244,13 +244,13 @@ var buttonVariants = cva2(
244
244
  appearance: "ghost",
245
245
  intent: "brand",
246
246
  class: [
247
- "bg-btn-ghost-neutral-bg-default",
248
- "text-btn-ghost-neutral-text-default",
249
- "border-btn-ghost-neutral-border-default",
250
- "hover:bg-btn-ghost-neutral-bg-hover",
251
- "hover:text-btn-ghost-neutral-text-hover",
252
- "active:bg-btn-ghost-neutral-bg-pressed",
253
- "active:text-btn-ghost-neutral-text-pressed"
247
+ "bg-btn-ghost-brand-bg-default",
248
+ "text-btn-ghost-brand-text-default",
249
+ "border-btn-ghost-brand-border-default",
250
+ "hover:bg-btn-ghost-brand-bg-hover",
251
+ "hover:text-btn-ghost-brand-text-hover",
252
+ "active:bg-btn-ghost-brand-bg-pressed",
253
+ "active:text-btn-ghost-brand-text-pressed"
254
254
  ]
255
255
  },
256
256
  // ── Ghost + Alert ──────────────────────────────────────────────────
@@ -308,13 +308,17 @@ var Button = React2.forwardRef(
308
308
  const isDisabled = disabled || loading;
309
309
  const isIconOnly = iconOnlyProp ?? !children;
310
310
  const iconSize = iconSizeMap[size ?? "md"];
311
+ const smPadding = size === "sm" && !isIconOnly ? cn(
312
+ leftIcon || loading ? "pl-xs" : "pl-sm",
313
+ rightIcon ? "pr-xs" : "pr-sm"
314
+ ) : "";
311
315
  const variantClasses = buttonVariants({
312
316
  appearance,
313
317
  intent,
314
318
  size,
315
319
  iconOnly: isIconOnly || void 0,
316
320
  fullWidth,
317
- className
321
+ className: cn(smPadding, className)
318
322
  });
319
323
  if (asChild) {
320
324
  return /* @__PURE__ */ jsx2(Slot, { ref, className: cn(variantClasses), ...props, children });
@@ -5354,7 +5358,7 @@ import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
5354
5358
  var SaveViewButton = React40.forwardRef(
5355
5359
  ({ className, label = "Save view", onSave, onDropdown, ...props }, ref) => {
5356
5360
  const sharedStyle = [
5357
- "flex items-center justify-center",
5361
+ "relative flex items-center justify-center",
5358
5362
  "min-h-[32px] max-h-[32px]",
5359
5363
  "bg-gradient-to-t from-[var(--color-btn-solid-brand-bg-default)] from-[10%] to-[var(--color-btn-solid-brand-bg-gradient-to-default)]",
5360
5364
  "border border-[var(--color-btn-solid-brand-border-default)]",
@@ -5504,311 +5508,344 @@ var OperatorList = ({
5504
5508
  };
5505
5509
  OperatorList.displayName = "OperatorList";
5506
5510
 
5507
- // src/components/ui/filter/value-input.tsx
5511
+ // src/components/ui/filter/value-inputs/shared.ts
5512
+ var inputClasses = [
5513
+ "w-full px-base py-sm rounded-base border border-[var(--color-input)]",
5514
+ "bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
5515
+ "placeholder:text-[var(--color-muted-foreground)]",
5516
+ "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)] focus:ring-offset-0"
5517
+ ].join(" ");
5518
+ var halfInputClasses = [
5519
+ "flex-1 px-base py-sm rounded-base border border-[var(--color-input)]",
5520
+ "bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
5521
+ "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
5522
+ ].join(" ");
5523
+ var applyBtnClasses = "self-end px-md py-sm text-sm font-semibold leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity";
5524
+
5525
+ // src/components/ui/filter/value-inputs/text-value-input.tsx
5508
5526
  import { jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
5527
+ var TextValueInput = ({
5528
+ value,
5529
+ onChange,
5530
+ onSubmit,
5531
+ className
5532
+ }) => {
5533
+ const handleKeyDown = (e) => {
5534
+ if (e.key === "Enter") onSubmit?.();
5535
+ };
5536
+ return /* @__PURE__ */ jsxs37("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5537
+ /* @__PURE__ */ jsx42(
5538
+ "input",
5539
+ {
5540
+ type: "text",
5541
+ value: value ?? "",
5542
+ onChange: (e) => onChange(e.target.value),
5543
+ onKeyDown: handleKeyDown,
5544
+ placeholder: "Enter value...",
5545
+ autoFocus: true,
5546
+ className: inputClasses
5547
+ }
5548
+ ),
5549
+ /* @__PURE__ */ jsx42("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
5550
+ ] });
5551
+ };
5552
+ TextValueInput.displayName = "TextValueInput";
5553
+
5554
+ // src/components/ui/filter/value-inputs/number-value-input.tsx
5555
+ import { jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
5556
+ var NumberValueInput = ({
5557
+ value,
5558
+ onChange,
5559
+ onSubmit,
5560
+ className
5561
+ }) => {
5562
+ const handleKeyDown = (e) => {
5563
+ if (e.key === "Enter") onSubmit?.();
5564
+ };
5565
+ return /* @__PURE__ */ jsxs38("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5566
+ /* @__PURE__ */ jsx43(
5567
+ "input",
5568
+ {
5569
+ type: "number",
5570
+ value: value ?? "",
5571
+ onChange: (e) => onChange(e.target.value ? Number(e.target.value) : null),
5572
+ onKeyDown: handleKeyDown,
5573
+ placeholder: "Enter number...",
5574
+ autoFocus: true,
5575
+ className: inputClasses
5576
+ }
5577
+ ),
5578
+ /* @__PURE__ */ jsx43("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
5579
+ ] });
5580
+ };
5581
+ NumberValueInput.displayName = "NumberValueInput";
5582
+ var NumberRangeValueInput = ({
5583
+ value,
5584
+ onChange,
5585
+ onSubmit,
5586
+ className
5587
+ }) => {
5588
+ const rangeVal = value ?? [0, 0];
5589
+ return /* @__PURE__ */ jsxs38("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5590
+ /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-base", children: [
5591
+ /* @__PURE__ */ jsx43(
5592
+ "input",
5593
+ {
5594
+ type: "number",
5595
+ value: rangeVal[0] ?? "",
5596
+ onChange: (e) => onChange([Number(e.target.value), rangeVal[1]]),
5597
+ placeholder: "Min",
5598
+ autoFocus: true,
5599
+ className: halfInputClasses
5600
+ }
5601
+ ),
5602
+ /* @__PURE__ */ jsx43("span", { className: "text-sm text-[var(--color-muted-foreground)]", children: "and" }),
5603
+ /* @__PURE__ */ jsx43(
5604
+ "input",
5605
+ {
5606
+ type: "number",
5607
+ value: rangeVal[1] ?? "",
5608
+ onChange: (e) => onChange([rangeVal[0], Number(e.target.value)]),
5609
+ placeholder: "Max",
5610
+ className: halfInputClasses
5611
+ }
5612
+ )
5613
+ ] }),
5614
+ /* @__PURE__ */ jsx43("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
5615
+ ] });
5616
+ };
5617
+ NumberRangeValueInput.displayName = "NumberRangeValueInput";
5618
+
5619
+ // src/components/ui/filter/value-inputs/date-value-input.tsx
5620
+ import { jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
5509
5621
  var RELATIVE_DATE_PRESETS = [
5510
5622
  { group: "Past", options: ["Today", "Yesterday", "Last 7 days", "Last 14 days", "Last 30 days", "Last 90 days"] },
5511
5623
  { group: "Current", options: ["This week", "This month", "This quarter", "This year"] },
5512
5624
  { group: "Future", options: ["Tomorrow", "Next 7 days", "Next 14 days", "Next 30 days", "Next week", "Next month", "Next quarter"] }
5513
5625
  ];
5514
- var ValueInput = ({
5515
- dataType,
5516
- operator,
5626
+ var DatePickerValueInput = ({
5517
5627
  value,
5518
5628
  onChange,
5519
5629
  onSubmit,
5520
- options = [],
5521
5630
  className
5522
- }) => {
5523
- const inputType = getValueInputType(dataType, operator);
5524
- if (!inputType) return null;
5525
- const handleKeyDown = (e) => {
5526
- if (e.key === "Enter") onSubmit?.();
5527
- };
5528
- switch (inputType) {
5529
- case "TextInput":
5530
- return /* @__PURE__ */ jsxs37("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5531
- /* @__PURE__ */ jsx42(
5532
- "input",
5533
- {
5534
- type: "text",
5535
- value: value ?? "",
5536
- onChange: (e) => onChange(e.target.value),
5537
- onKeyDown: handleKeyDown,
5538
- placeholder: "Enter value...",
5539
- autoFocus: true,
5540
- className: cn(
5541
- "w-full px-base py-sm rounded-base border border-[var(--color-input)]",
5542
- "bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
5543
- "placeholder:text-[var(--color-muted-foreground)]",
5544
- "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)] focus:ring-offset-0"
5545
- )
5546
- }
5547
- ),
5548
- /* @__PURE__ */ jsx42(
5549
- "button",
5550
- {
5551
- type: "button",
5552
- onClick: onSubmit,
5553
- className: "self-end px-md py-sm text-sm font-semibold leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
5554
- children: "Apply"
5555
- }
5556
- )
5557
- ] });
5558
- case "NumberInput":
5559
- return /* @__PURE__ */ jsxs37("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5560
- /* @__PURE__ */ jsx42(
5561
- "input",
5562
- {
5563
- type: "number",
5564
- value: value ?? "",
5565
- onChange: (e) => onChange(e.target.value ? Number(e.target.value) : null),
5566
- onKeyDown: handleKeyDown,
5567
- placeholder: "Enter number...",
5568
- autoFocus: true,
5569
- className: cn(
5570
- "w-full px-base py-sm rounded-base border border-[var(--color-input)]",
5571
- "bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
5572
- "placeholder:text-[var(--color-muted-foreground)]",
5573
- "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)] focus:ring-offset-0"
5574
- )
5575
- }
5576
- ),
5577
- /* @__PURE__ */ jsx42(
5578
- "button",
5579
- {
5580
- type: "button",
5581
- onClick: onSubmit,
5582
- className: "self-end px-md py-sm text-sm font-semibold leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
5583
- children: "Apply"
5584
- }
5585
- )
5586
- ] });
5587
- case "NumberRange": {
5588
- const rangeVal = value ?? [0, 0];
5589
- return /* @__PURE__ */ jsxs37("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5590
- /* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-base", children: [
5591
- /* @__PURE__ */ jsx42(
5592
- "input",
5593
- {
5594
- type: "number",
5595
- value: rangeVal[0] ?? "",
5596
- onChange: (e) => onChange([Number(e.target.value), rangeVal[1]]),
5597
- placeholder: "Min",
5598
- autoFocus: true,
5599
- className: cn(
5600
- "flex-1 px-base py-sm rounded-base border border-[var(--color-input)]",
5601
- "bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
5602
- "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
5603
- )
5604
- }
5605
- ),
5606
- /* @__PURE__ */ jsx42("span", { className: "text-sm text-[var(--color-muted-foreground)]", children: "and" }),
5607
- /* @__PURE__ */ jsx42(
5608
- "input",
5609
- {
5610
- type: "number",
5611
- value: rangeVal[1] ?? "",
5612
- onChange: (e) => onChange([rangeVal[0], Number(e.target.value)]),
5613
- placeholder: "Max",
5614
- className: cn(
5615
- "flex-1 px-base py-sm rounded-base border border-[var(--color-input)]",
5616
- "bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
5617
- "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
5618
- )
5619
- }
5620
- )
5621
- ] }),
5622
- /* @__PURE__ */ jsx42(
5623
- "button",
5624
- {
5625
- type: "button",
5626
- onClick: onSubmit,
5627
- className: "self-end px-md py-sm text-sm font-semibold leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
5628
- children: "Apply"
5629
- }
5630
- )
5631
- ] });
5631
+ }) => /* @__PURE__ */ jsxs39("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5632
+ /* @__PURE__ */ jsx44(
5633
+ "input",
5634
+ {
5635
+ type: "date",
5636
+ value: value instanceof Date ? value.toISOString().split("T")[0] : value ?? "",
5637
+ onChange: (e) => onChange(e.target.value ? new Date(e.target.value) : null),
5638
+ autoFocus: true,
5639
+ className: inputClasses
5632
5640
  }
5633
- case "PresetTags":
5634
- return /* @__PURE__ */ jsx42("div", { className: cn("flex flex-col gap-base p-base max-w-[280px]", className), children: RELATIVE_DATE_PRESETS.map((group) => /* @__PURE__ */ jsxs37("div", { className: "flex flex-col gap-xs", children: [
5635
- /* @__PURE__ */ jsx42("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)] uppercase px-xs", children: group.group }),
5636
- /* @__PURE__ */ jsx42("div", { className: "flex flex-wrap gap-xs", children: group.options.map((preset) => /* @__PURE__ */ jsx42(
5637
- "button",
5638
- {
5639
- type: "button",
5640
- onClick: () => {
5641
- onChange(preset);
5642
- onSubmit?.();
5643
- },
5644
- className: cn(
5645
- "px-base py-2xs rounded-base border cursor-pointer transition-colors text-sm font-regular leading-sm",
5646
- value === preset ? "border-[var(--color-ring)] bg-[var(--color-primary)] text-[var(--color-primary-foreground)]" : "border-[var(--color-input)] bg-[var(--color-background)] text-[var(--color-foreground)] hover:bg-[var(--color-accent)]"
5647
- ),
5648
- children: preset
5641
+ ),
5642
+ /* @__PURE__ */ jsx44("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
5643
+ ] });
5644
+ DatePickerValueInput.displayName = "DatePickerValueInput";
5645
+ function toDateString(d) {
5646
+ if (!d) return "";
5647
+ if (d instanceof Date) return d.toISOString().split("T")[0];
5648
+ return String(d);
5649
+ }
5650
+ var DateRangeValueInput = ({
5651
+ value,
5652
+ onChange,
5653
+ onSubmit,
5654
+ className
5655
+ }) => {
5656
+ const rangeVal = Array.isArray(value) ? value : [null, null];
5657
+ return /* @__PURE__ */ jsxs39("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5658
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-base", children: [
5659
+ /* @__PURE__ */ jsx44(
5660
+ "input",
5661
+ {
5662
+ type: "date",
5663
+ value: toDateString(rangeVal[0]),
5664
+ onChange: (e) => {
5665
+ const from = e.target.value ? new Date(e.target.value) : null;
5666
+ onChange([from, rangeVal[1]]);
5649
5667
  },
5650
- preset
5651
- )) })
5652
- ] }, group.group)) });
5653
- case "SingleSelect":
5654
- return /* @__PURE__ */ jsx42("div", { className: cn("flex flex-col gap-xs p-base max-h-[250px] overflow-y-auto", className), children: options.map((opt) => /* @__PURE__ */ jsx42(
5668
+ autoFocus: true,
5669
+ className: halfInputClasses
5670
+ }
5671
+ ),
5672
+ /* @__PURE__ */ jsx44("span", { className: "text-sm text-[var(--color-muted-foreground)]", children: "to" }),
5673
+ /* @__PURE__ */ jsx44(
5674
+ "input",
5675
+ {
5676
+ type: "date",
5677
+ value: toDateString(rangeVal[1]),
5678
+ onChange: (e) => {
5679
+ const to = e.target.value ? new Date(e.target.value) : null;
5680
+ onChange([rangeVal[0], to]);
5681
+ },
5682
+ className: halfInputClasses
5683
+ }
5684
+ )
5685
+ ] }),
5686
+ /* @__PURE__ */ jsx44("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
5687
+ ] });
5688
+ };
5689
+ DateRangeValueInput.displayName = "DateRangeValueInput";
5690
+ var PresetTagsValueInput = ({
5691
+ value,
5692
+ onChange,
5693
+ onSubmit,
5694
+ className
5695
+ }) => /* @__PURE__ */ jsx44("div", { className: cn("flex flex-col gap-base p-base max-w-[280px]", className), children: RELATIVE_DATE_PRESETS.map((group) => /* @__PURE__ */ jsxs39("div", { className: "flex flex-col gap-xs", children: [
5696
+ /* @__PURE__ */ jsx44("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)] uppercase px-xs", children: group.group }),
5697
+ /* @__PURE__ */ jsx44("div", { className: "flex flex-wrap gap-xs", children: group.options.map((preset) => /* @__PURE__ */ jsx44(
5698
+ "button",
5699
+ {
5700
+ type: "button",
5701
+ onClick: () => {
5702
+ onChange(preset);
5703
+ onSubmit?.();
5704
+ },
5705
+ className: cn(
5706
+ "px-base py-2xs rounded-base border cursor-pointer transition-colors text-sm font-regular leading-sm",
5707
+ value === preset ? "border-[var(--color-ring)] bg-[var(--color-primary)] text-[var(--color-primary-foreground)]" : "border-[var(--color-input)] bg-[var(--color-background)] text-[var(--color-foreground)] hover:bg-[var(--color-accent)]"
5708
+ ),
5709
+ children: preset
5710
+ },
5711
+ preset
5712
+ )) })
5713
+ ] }, group.group)) });
5714
+ PresetTagsValueInput.displayName = "PresetTagsValueInput";
5715
+
5716
+ // src/components/ui/filter/value-inputs/select-value-input.tsx
5717
+ import { jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
5718
+ var SingleSelectValueInput = ({
5719
+ value,
5720
+ onChange,
5721
+ onSubmit,
5722
+ options,
5723
+ className
5724
+ }) => /* @__PURE__ */ jsx45("div", { className: cn("flex flex-col gap-xs p-base max-h-[250px] overflow-y-auto", className), children: options.map((opt) => /* @__PURE__ */ jsx45(
5725
+ "button",
5726
+ {
5727
+ type: "button",
5728
+ onClick: () => {
5729
+ onChange(opt);
5730
+ onSubmit?.();
5731
+ },
5732
+ className: cn(
5733
+ "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
5734
+ "hover:bg-[var(--color-dropdown-item-hover)]",
5735
+ value === opt && "bg-[var(--color-dropdown-item-hover)]"
5736
+ ),
5737
+ children: /* @__PURE__ */ jsx45("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)]", children: opt })
5738
+ },
5739
+ opt
5740
+ )) });
5741
+ SingleSelectValueInput.displayName = "SingleSelectValueInput";
5742
+ var MultiSelectValueInput = ({
5743
+ value,
5744
+ onChange,
5745
+ onSubmit,
5746
+ options,
5747
+ className
5748
+ }) => {
5749
+ const selected = Array.isArray(value) ? value : [];
5750
+ return /* @__PURE__ */ jsxs40("div", { className: cn("flex flex-col gap-xs p-base", className), children: [
5751
+ /* @__PURE__ */ jsx45("div", { className: "flex flex-col max-h-[200px] overflow-y-auto", children: options.map((opt) => {
5752
+ const isSelected = selected.includes(opt);
5753
+ return /* @__PURE__ */ jsxs40(
5655
5754
  "button",
5656
5755
  {
5657
5756
  type: "button",
5658
5757
  onClick: () => {
5659
- onChange(opt);
5660
- onSubmit?.();
5758
+ const next = isSelected ? selected.filter((s) => s !== opt) : [...selected, opt];
5759
+ onChange(next);
5661
5760
  },
5662
5761
  className: cn(
5663
5762
  "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
5664
- "hover:bg-[var(--color-dropdown-item-hover)]",
5665
- value === opt && "bg-[var(--color-dropdown-item-hover)]"
5763
+ "hover:bg-[var(--color-dropdown-item-hover)]"
5666
5764
  ),
5667
- children: /* @__PURE__ */ jsx42("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)]", children: opt })
5765
+ children: [
5766
+ /* @__PURE__ */ jsx45(
5767
+ "span",
5768
+ {
5769
+ className: cn(
5770
+ "flex items-center justify-center size-4 rounded-xs border transition-colors",
5771
+ isSelected ? "bg-[var(--color-primary)] border-[var(--color-primary)]" : "border-[var(--color-input)] bg-[var(--color-background)]"
5772
+ ),
5773
+ children: isSelected && /* @__PURE__ */ jsx45("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ jsx45("path", { d: "M2 5L4 7L8 3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
5774
+ }
5775
+ ),
5776
+ /* @__PURE__ */ jsx45("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)]", children: opt })
5777
+ ]
5668
5778
  },
5669
5779
  opt
5670
- )) });
5671
- case "MultiSelect": {
5672
- const selected = Array.isArray(value) ? value : [];
5673
- return /* @__PURE__ */ jsxs37("div", { className: cn("flex flex-col gap-xs p-base", className), children: [
5674
- /* @__PURE__ */ jsx42("div", { className: "flex flex-col max-h-[200px] overflow-y-auto", children: options.map((opt) => {
5675
- const isSelected = selected.includes(opt);
5676
- return /* @__PURE__ */ jsxs37(
5677
- "button",
5678
- {
5679
- type: "button",
5680
- onClick: () => {
5681
- const next = isSelected ? selected.filter((s) => s !== opt) : [...selected, opt];
5682
- onChange(next);
5683
- },
5684
- className: cn(
5685
- "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
5686
- "hover:bg-[var(--color-dropdown-item-hover)]"
5687
- ),
5688
- children: [
5689
- /* @__PURE__ */ jsx42(
5690
- "span",
5691
- {
5692
- className: cn(
5693
- "flex items-center justify-center size-4 rounded-xs border transition-colors",
5694
- isSelected ? "bg-[var(--color-primary)] border-[var(--color-primary)]" : "border-[var(--color-input)] bg-[var(--color-background)]"
5695
- ),
5696
- children: isSelected && /* @__PURE__ */ jsx42("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ jsx42("path", { d: "M2 5L4 7L8 3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
5697
- }
5698
- ),
5699
- /* @__PURE__ */ jsx42("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)]", children: opt })
5700
- ]
5701
- },
5702
- opt
5703
- );
5704
- }) }),
5705
- /* @__PURE__ */ jsx42(
5706
- "button",
5707
- {
5708
- type: "button",
5709
- onClick: onSubmit,
5710
- className: "self-end px-md py-sm text-sm font-semibold leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
5711
- children: "Apply"
5712
- }
5713
- )
5714
- ] });
5715
- }
5716
- // DatePicker, DateRange, RelationPicker, MultiRelationPicker
5717
- // Stub as text inputs for now — will wire to actual DatePicker/relation components
5780
+ );
5781
+ }) }),
5782
+ /* @__PURE__ */ jsx45("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
5783
+ ] });
5784
+ };
5785
+ MultiSelectValueInput.displayName = "MultiSelectValueInput";
5786
+
5787
+ // src/components/ui/filter/value-inputs/relation-value-input.tsx
5788
+ import { jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
5789
+ var RelationValueInput = ({
5790
+ value,
5791
+ onChange,
5792
+ onSubmit,
5793
+ className
5794
+ }) => {
5795
+ const handleKeyDown = (e) => {
5796
+ if (e.key === "Enter") onSubmit?.();
5797
+ };
5798
+ return /* @__PURE__ */ jsxs41("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5799
+ /* @__PURE__ */ jsx46(
5800
+ "input",
5801
+ {
5802
+ type: "text",
5803
+ value: value ?? "",
5804
+ onChange: (e) => onChange(e.target.value),
5805
+ onKeyDown: handleKeyDown,
5806
+ placeholder: "Search...",
5807
+ autoFocus: true,
5808
+ className: inputClasses
5809
+ }
5810
+ ),
5811
+ /* @__PURE__ */ jsx46("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
5812
+ ] });
5813
+ };
5814
+ RelationValueInput.displayName = "RelationValueInput";
5815
+
5816
+ // src/components/ui/filter/value-input.tsx
5817
+ import { jsx as jsx47 } from "react/jsx-runtime";
5818
+ var ValueInput = ({
5819
+ dataType,
5820
+ operator,
5821
+ value,
5822
+ onChange,
5823
+ onSubmit,
5824
+ options = [],
5825
+ className
5826
+ }) => {
5827
+ const inputType = getValueInputType(dataType, operator);
5828
+ if (!inputType) return null;
5829
+ switch (inputType) {
5830
+ case "TextInput":
5831
+ return /* @__PURE__ */ jsx47(TextValueInput, { value, onChange, onSubmit, className });
5832
+ case "NumberInput":
5833
+ return /* @__PURE__ */ jsx47(NumberValueInput, { value, onChange, onSubmit, className });
5834
+ case "NumberRange":
5835
+ return /* @__PURE__ */ jsx47(NumberRangeValueInput, { value, onChange, onSubmit, className });
5836
+ case "PresetTags":
5837
+ return /* @__PURE__ */ jsx47(PresetTagsValueInput, { value, onChange, onSubmit, className });
5838
+ case "SingleSelect":
5839
+ return /* @__PURE__ */ jsx47(SingleSelectValueInput, { value, onChange, onSubmit, options, className });
5840
+ case "MultiSelect":
5841
+ return /* @__PURE__ */ jsx47(MultiSelectValueInput, { value, onChange, onSubmit, options, className });
5718
5842
  case "DatePicker":
5719
- return /* @__PURE__ */ jsxs37("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5720
- /* @__PURE__ */ jsx42(
5721
- "input",
5722
- {
5723
- type: "date",
5724
- value: value instanceof Date ? value.toISOString().split("T")[0] : value ?? "",
5725
- onChange: (e) => onChange(e.target.value ? new Date(e.target.value) : null),
5726
- autoFocus: true,
5727
- className: cn(
5728
- "w-full px-base py-sm rounded-base border border-[var(--color-input)]",
5729
- "bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
5730
- "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
5731
- )
5732
- }
5733
- ),
5734
- /* @__PURE__ */ jsx42(
5735
- "button",
5736
- {
5737
- type: "button",
5738
- onClick: onSubmit,
5739
- className: "self-end px-md py-sm text-sm font-semibold leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
5740
- children: "Apply"
5741
- }
5742
- )
5743
- ] });
5843
+ return /* @__PURE__ */ jsx47(DatePickerValueInput, { value, onChange, onSubmit, className });
5744
5844
  case "DateRange":
5745
- return /* @__PURE__ */ jsxs37("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5746
- /* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-base", children: [
5747
- /* @__PURE__ */ jsx42(
5748
- "input",
5749
- {
5750
- type: "date",
5751
- autoFocus: true,
5752
- className: cn(
5753
- "flex-1 px-base py-sm rounded-base border border-[var(--color-input)]",
5754
- "bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
5755
- "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
5756
- )
5757
- }
5758
- ),
5759
- /* @__PURE__ */ jsx42("span", { className: "text-sm text-[var(--color-muted-foreground)]", children: "to" }),
5760
- /* @__PURE__ */ jsx42(
5761
- "input",
5762
- {
5763
- type: "date",
5764
- className: cn(
5765
- "flex-1 px-base py-sm rounded-base border border-[var(--color-input)]",
5766
- "bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
5767
- "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
5768
- )
5769
- }
5770
- )
5771
- ] }),
5772
- /* @__PURE__ */ jsx42(
5773
- "button",
5774
- {
5775
- type: "button",
5776
- onClick: onSubmit,
5777
- className: "self-end px-md py-sm text-sm font-semibold leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
5778
- children: "Apply"
5779
- }
5780
- )
5781
- ] });
5845
+ return /* @__PURE__ */ jsx47(DateRangeValueInput, { value, onChange, onSubmit, className });
5782
5846
  case "RelationPicker":
5783
5847
  case "MultiRelationPicker":
5784
- return /* @__PURE__ */ jsxs37("div", { className: cn("flex flex-col gap-base p-base", className), children: [
5785
- /* @__PURE__ */ jsx42(
5786
- "input",
5787
- {
5788
- type: "text",
5789
- value: value ?? "",
5790
- onChange: (e) => onChange(e.target.value),
5791
- onKeyDown: handleKeyDown,
5792
- placeholder: "Search...",
5793
- autoFocus: true,
5794
- className: cn(
5795
- "w-full px-base py-sm rounded-base border border-[var(--color-input)]",
5796
- "bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
5797
- "placeholder:text-[var(--color-muted-foreground)]",
5798
- "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
5799
- )
5800
- }
5801
- ),
5802
- /* @__PURE__ */ jsx42(
5803
- "button",
5804
- {
5805
- type: "button",
5806
- onClick: onSubmit,
5807
- className: "self-end px-md py-sm text-sm font-semibold leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
5808
- children: "Apply"
5809
- }
5810
- )
5811
- ] });
5848
+ return /* @__PURE__ */ jsx47(RelationValueInput, { value, onChange, onSubmit, className });
5812
5849
  default:
5813
5850
  return null;
5814
5851
  }
@@ -5818,15 +5855,57 @@ ValueInput.displayName = "ValueInput";
5818
5855
  // src/components/ui/filter/property-selector.tsx
5819
5856
  import * as React41 from "react";
5820
5857
  import * as PopoverPrimitive5 from "@radix-ui/react-popover";
5821
- import { Icon as Icon26, faChevronLeftOutline as faChevronLeftOutline2, faChevronRightOutline as faChevronRightOutline2, faMagnifyingGlassOutline } from "@l3mpire/icons";
5822
- import { jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
5858
+ import {
5859
+ Icon as Icon26,
5860
+ faChevronLeftOutline as faChevronLeftOutline2,
5861
+ faChevronRightOutline as faChevronRightOutline2,
5862
+ faMagnifyingGlassOutline,
5863
+ faFilterOutline as faFilterOutline2
5864
+ } from "@l3mpire/icons";
5865
+ import { Fragment as Fragment4, jsx as jsx48, jsxs as jsxs42 } from "react/jsx-runtime";
5866
+ var AdvancedFilterFooter = ({ onClick, count }) => /* @__PURE__ */ jsxs42(Fragment4, { children: [
5867
+ /* @__PURE__ */ jsx48("div", { className: "h-px bg-[var(--color-dropdown-border)] mx-xs" }),
5868
+ /* @__PURE__ */ jsxs42(
5869
+ "button",
5870
+ {
5871
+ type: "button",
5872
+ onPointerDown: (e) => e.preventDefault(),
5873
+ onClick,
5874
+ className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
5875
+ children: [
5876
+ /* @__PURE__ */ jsx48(
5877
+ Icon26,
5878
+ {
5879
+ icon: faFilterOutline2,
5880
+ size: "sm",
5881
+ className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
5882
+ }
5883
+ ),
5884
+ /* @__PURE__ */ jsx48("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] text-left truncate", children: "Advanced filter" }),
5885
+ count > 0 && /* @__PURE__ */ jsxs42("span", { className: "text-xs font-regular leading-xs text-[var(--color-muted-foreground)]", children: [
5886
+ count,
5887
+ " ",
5888
+ count === 1 ? "rule" : "rules"
5889
+ ] })
5890
+ ]
5891
+ }
5892
+ )
5893
+ ] });
5823
5894
  var PropertySelector = ({
5824
5895
  properties,
5825
5896
  onSelect,
5826
5897
  open,
5827
5898
  onOpenChange,
5828
- children
5899
+ children,
5900
+ onAdvancedFilter,
5901
+ advancedFilterCount = 0
5829
5902
  }) => {
5903
+ const handleAdvancedClick = (e) => {
5904
+ e.stopPropagation();
5905
+ e.preventDefault();
5906
+ onAdvancedFilter?.();
5907
+ };
5908
+ const showAdvancedFooter = !!onAdvancedFilter;
5830
5909
  const [activeGroup, setActiveGroup] = React41.useState(null);
5831
5910
  const [search, setSearch] = React41.useState("");
5832
5911
  React41.useEffect(() => {
@@ -5852,6 +5931,20 @@ var PropertySelector = ({
5852
5931
  }
5853
5932
  return Array.from(map.values());
5854
5933
  }, [properties]);
5934
+ const globalSearchResults = React41.useMemo(() => {
5935
+ if (!search || activeGroup) return [];
5936
+ const lower = search.toLowerCase();
5937
+ return properties.filter((p) => p.label.toLowerCase().includes(lower));
5938
+ }, [properties, search, activeGroup]);
5939
+ const filteredGroups = React41.useMemo(() => {
5940
+ if (!search || activeGroup) return groups;
5941
+ const lower = search.toLowerCase();
5942
+ return groups.filter(
5943
+ (g) => g.groupLabel.toLowerCase().includes(lower) || properties.some(
5944
+ (p) => p.group === g.group && p.label.toLowerCase().includes(lower)
5945
+ )
5946
+ );
5947
+ }, [groups, properties, search, activeGroup]);
5855
5948
  const filteredProperties = React41.useMemo(() => {
5856
5949
  if (!activeGroup) return [];
5857
5950
  const groupProps = properties.filter((p) => p.group === activeGroup);
@@ -5860,13 +5953,15 @@ var PropertySelector = ({
5860
5953
  return groupProps.filter((p) => p.label.toLowerCase().includes(lower));
5861
5954
  }, [properties, activeGroup, search]);
5862
5955
  const activeGroupInfo = groups.find((g) => g.group === activeGroup);
5863
- return /* @__PURE__ */ jsxs38(PopoverPrimitive5.Root, { open, onOpenChange, children: [
5864
- /* @__PURE__ */ jsx43(PopoverPrimitive5.Trigger, { asChild: true, children }),
5865
- /* @__PURE__ */ jsx43(PopoverPrimitive5.Portal, { children: /* @__PURE__ */ jsx43(
5956
+ const showGlobalResults = search.length > 0 && !activeGroup && globalSearchResults.length > 0;
5957
+ return /* @__PURE__ */ jsxs42(PopoverPrimitive5.Root, { open, onOpenChange, children: [
5958
+ /* @__PURE__ */ jsx48(PopoverPrimitive5.Trigger, { asChild: true, children }),
5959
+ /* @__PURE__ */ jsx48(PopoverPrimitive5.Portal, { children: /* @__PURE__ */ jsxs42(
5866
5960
  PopoverPrimitive5.Content,
5867
5961
  {
5868
5962
  sideOffset: 4,
5869
5963
  align: "start",
5964
+ onCloseAutoFocus: (e) => e.preventDefault(),
5870
5965
  className: cn(
5871
5966
  "z-50 flex flex-col gap-xs overflow-clip p-xs",
5872
5967
  "bg-[var(--color-dropdown-bg)] border border-[var(--color-dropdown-border)] rounded-md shadow-lg",
@@ -5875,111 +5970,178 @@ var PropertySelector = ({
5875
5970
  "data-[side=bottom]:slide-in-from-top-2",
5876
5971
  "min-w-[230px]"
5877
5972
  ),
5878
- children: activeGroup === null ? (
5879
- /* ── Level 1: Categories ─────────────────────────────────── */
5880
- /* @__PURE__ */ jsx43("div", { className: "flex flex-col", children: groups.map((g) => /* @__PURE__ */ jsxs38(
5881
- "button",
5882
- {
5883
- type: "button",
5884
- onClick: () => setActiveGroup(g.group),
5885
- className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
5886
- children: [
5887
- /* @__PURE__ */ jsx43(
5973
+ children: [
5974
+ activeGroup === null ? (
5975
+ /* ── Level 1: Search + Categories ───────────────────────── */
5976
+ /* @__PURE__ */ jsxs42("div", { className: "flex flex-col gap-xs", children: [
5977
+ /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-base px-md py-base border border-[var(--color-input)] rounded-md", children: [
5978
+ /* @__PURE__ */ jsx48(
5888
5979
  Icon26,
5889
5980
  {
5890
- icon: g.groupIcon,
5981
+ icon: faMagnifyingGlassOutline,
5891
5982
  size: "sm",
5892
- className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
5983
+ className: "shrink-0 text-[var(--color-muted-foreground)]"
5893
5984
  }
5894
5985
  ),
5895
- /* @__PURE__ */ jsx43("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] text-left truncate", children: g.groupLabel }),
5896
- /* @__PURE__ */ jsx43("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: g.count }),
5897
- /* @__PURE__ */ jsx43(
5898
- Icon26,
5986
+ /* @__PURE__ */ jsx48(
5987
+ "input",
5899
5988
  {
5900
- icon: faChevronRightOutline2,
5901
- size: "xs",
5902
- className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
5989
+ type: "text",
5990
+ value: search,
5991
+ onChange: (e) => setSearch(e.target.value),
5992
+ placeholder: "Search...",
5993
+ autoFocus: true,
5994
+ className: "flex-1 text-sm font-regular leading-sm text-[var(--color-foreground)] bg-transparent outline-none placeholder:text-[var(--color-muted-foreground)]"
5903
5995
  }
5904
5996
  )
5905
- ]
5906
- },
5907
- g.group
5908
- )) })
5909
- ) : (
5910
- /* ── Level 2: Properties ─────────────────────────────────── */
5911
- /* @__PURE__ */ jsxs38("div", { className: "flex flex-col gap-xs", children: [
5912
- /* @__PURE__ */ jsxs38(
5913
- "button",
5914
- {
5915
- type: "button",
5916
- onClick: () => {
5917
- setActiveGroup(null);
5918
- setSearch("");
5919
- },
5920
- className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
5921
- children: [
5922
- /* @__PURE__ */ jsx43(
5923
- Icon26,
5997
+ ] }),
5998
+ showGlobalResults ? (
5999
+ /* ── Global search results (flat property list) ─────── */
6000
+ /* @__PURE__ */ jsx48("div", { className: "flex flex-col max-h-[300px] overflow-y-auto", children: globalSearchResults.map((prop) => /* @__PURE__ */ jsxs42(
6001
+ "button",
6002
+ {
6003
+ type: "button",
6004
+ onClick: () => {
6005
+ onSelect(prop);
6006
+ onOpenChange?.(false);
6007
+ },
6008
+ className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
6009
+ children: [
6010
+ /* @__PURE__ */ jsx48(
6011
+ Icon26,
6012
+ {
6013
+ icon: prop.icon,
6014
+ size: "sm",
6015
+ className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
6016
+ }
6017
+ ),
6018
+ /* @__PURE__ */ jsx48("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] text-left truncate", children: prop.label }),
6019
+ /* @__PURE__ */ jsx48("span", { className: "text-xs font-regular leading-xs text-[var(--color-muted-foreground)]", children: prop.groupLabel })
6020
+ ]
6021
+ },
6022
+ prop.id
6023
+ )) })
6024
+ ) : (
6025
+ /* ── Group list ─────────────────────────────────────── */
6026
+ /* @__PURE__ */ jsxs42("div", { className: "flex flex-col", children: [
6027
+ filteredGroups.map((g) => /* @__PURE__ */ jsxs42(
6028
+ "button",
5924
6029
  {
5925
- icon: faChevronLeftOutline2,
5926
- size: "sm",
5927
- className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
5928
- }
5929
- ),
5930
- /* @__PURE__ */ jsx43("span", { className: "flex-1 text-xs font-semibold leading-xs text-[var(--color-muted-foreground)] text-left truncate", children: activeGroupInfo?.groupLabel })
5931
- ]
5932
- }
5933
- ),
5934
- /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-base px-md py-base border border-[var(--color-input)] rounded-md", children: [
5935
- /* @__PURE__ */ jsx43(
5936
- Icon26,
5937
- {
5938
- icon: faMagnifyingGlassOutline,
5939
- size: "sm",
5940
- className: "shrink-0 text-[var(--color-muted-foreground)]"
5941
- }
5942
- ),
5943
- /* @__PURE__ */ jsx43(
5944
- "input",
5945
- {
5946
- type: "text",
5947
- value: search,
5948
- onChange: (e) => setSearch(e.target.value),
5949
- placeholder: "Search...",
5950
- autoFocus: true,
5951
- className: "flex-1 text-sm font-regular leading-sm text-[var(--color-foreground)] bg-transparent outline-none placeholder:text-[var(--color-muted-foreground)]"
5952
- }
6030
+ type: "button",
6031
+ onClick: () => {
6032
+ setActiveGroup(g.group);
6033
+ setSearch("");
6034
+ },
6035
+ className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
6036
+ children: [
6037
+ /* @__PURE__ */ jsx48(
6038
+ Icon26,
6039
+ {
6040
+ icon: g.groupIcon,
6041
+ size: "sm",
6042
+ className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
6043
+ }
6044
+ ),
6045
+ /* @__PURE__ */ jsx48("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] text-left truncate", children: g.groupLabel }),
6046
+ /* @__PURE__ */ jsx48("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: g.count }),
6047
+ /* @__PURE__ */ jsx48(
6048
+ Icon26,
6049
+ {
6050
+ icon: faChevronRightOutline2,
6051
+ size: "xs",
6052
+ className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
6053
+ }
6054
+ )
6055
+ ]
6056
+ },
6057
+ g.group
6058
+ )),
6059
+ filteredGroups.length === 0 && /* @__PURE__ */ jsx48("span", { className: "p-base text-sm text-[var(--color-muted-foreground)]", children: "No results" })
6060
+ ] })
5953
6061
  )
5954
- ] }),
5955
- /* @__PURE__ */ jsxs38("div", { className: "flex flex-col max-h-[300px] overflow-y-auto", children: [
5956
- filteredProperties.map((prop) => /* @__PURE__ */ jsxs38(
6062
+ ] })
6063
+ ) : (
6064
+ /* ── Level 2: Properties ─────────────────────────────────── */
6065
+ /* @__PURE__ */ jsxs42("div", { className: "flex flex-col gap-xs", children: [
6066
+ /* @__PURE__ */ jsxs42(
5957
6067
  "button",
5958
6068
  {
5959
6069
  type: "button",
5960
6070
  onClick: () => {
5961
- onSelect(prop);
5962
- onOpenChange?.(false);
6071
+ setActiveGroup(null);
6072
+ setSearch("");
5963
6073
  },
5964
6074
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
5965
6075
  children: [
5966
- /* @__PURE__ */ jsx43(
6076
+ /* @__PURE__ */ jsx48(
5967
6077
  Icon26,
5968
6078
  {
5969
- icon: prop.icon,
6079
+ icon: faChevronLeftOutline2,
5970
6080
  size: "sm",
5971
6081
  className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
5972
6082
  }
5973
6083
  ),
5974
- /* @__PURE__ */ jsx43("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] text-left truncate", children: prop.label })
6084
+ /* @__PURE__ */ jsx48("span", { className: "flex-1 text-xs font-semibold leading-xs text-[var(--color-muted-foreground)] text-left truncate", children: activeGroupInfo?.groupLabel })
5975
6085
  ]
5976
- },
5977
- prop.id
5978
- )),
5979
- filteredProperties.length === 0 && /* @__PURE__ */ jsx43("span", { className: "p-base text-sm text-[var(--color-muted-foreground)]", children: "No results" })
6086
+ }
6087
+ ),
6088
+ /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-base px-md py-base border border-[var(--color-input)] rounded-md", children: [
6089
+ /* @__PURE__ */ jsx48(
6090
+ Icon26,
6091
+ {
6092
+ icon: faMagnifyingGlassOutline,
6093
+ size: "sm",
6094
+ className: "shrink-0 text-[var(--color-muted-foreground)]"
6095
+ }
6096
+ ),
6097
+ /* @__PURE__ */ jsx48(
6098
+ "input",
6099
+ {
6100
+ type: "text",
6101
+ value: search,
6102
+ onChange: (e) => setSearch(e.target.value),
6103
+ placeholder: "Search...",
6104
+ autoFocus: true,
6105
+ className: "flex-1 text-sm font-regular leading-sm text-[var(--color-foreground)] bg-transparent outline-none placeholder:text-[var(--color-muted-foreground)]"
6106
+ }
6107
+ )
6108
+ ] }),
6109
+ /* @__PURE__ */ jsxs42("div", { className: "flex flex-col max-h-[300px] overflow-y-auto", children: [
6110
+ filteredProperties.map((prop) => /* @__PURE__ */ jsxs42(
6111
+ "button",
6112
+ {
6113
+ type: "button",
6114
+ onClick: () => {
6115
+ onSelect(prop);
6116
+ onOpenChange?.(false);
6117
+ },
6118
+ className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
6119
+ children: [
6120
+ /* @__PURE__ */ jsx48(
6121
+ Icon26,
6122
+ {
6123
+ icon: prop.icon,
6124
+ size: "sm",
6125
+ className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
6126
+ }
6127
+ ),
6128
+ /* @__PURE__ */ jsx48("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] text-left truncate", children: prop.label })
6129
+ ]
6130
+ },
6131
+ prop.id
6132
+ )),
6133
+ filteredProperties.length === 0 && /* @__PURE__ */ jsx48("span", { className: "p-base text-sm text-[var(--color-muted-foreground)]", children: "No results" })
6134
+ ] })
5980
6135
  ] })
5981
- ] })
5982
- )
6136
+ ),
6137
+ showAdvancedFooter && /* @__PURE__ */ jsx48(
6138
+ AdvancedFilterFooter,
6139
+ {
6140
+ onClick: handleAdvancedClick,
6141
+ count: advancedFilterCount
6142
+ }
6143
+ )
6144
+ ]
5983
6145
  }
5984
6146
  ) })
5985
6147
  ] });
@@ -5989,16 +6151,16 @@ PropertySelector.displayName = "PropertySelector";
5989
6151
  // src/components/ui/filter/kebab-menu.tsx
5990
6152
  import * as PopoverPrimitive6 from "@radix-ui/react-popover";
5991
6153
  import { Icon as Icon27, faArrowRightOutline, faTrashOutline } from "@l3mpire/icons";
5992
- import { jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
6154
+ import { jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
5993
6155
  var KebabMenu = ({
5994
6156
  onConvertToAdvanced,
5995
6157
  onDelete,
5996
6158
  open,
5997
6159
  onOpenChange,
5998
6160
  children
5999
- }) => /* @__PURE__ */ jsxs39(PopoverPrimitive6.Root, { open, onOpenChange, children: [
6000
- /* @__PURE__ */ jsx44(PopoverPrimitive6.Trigger, { asChild: true, children }),
6001
- /* @__PURE__ */ jsx44(PopoverPrimitive6.Portal, { children: /* @__PURE__ */ jsxs39(
6161
+ }) => /* @__PURE__ */ jsxs43(PopoverPrimitive6.Root, { open, onOpenChange, children: [
6162
+ /* @__PURE__ */ jsx49(PopoverPrimitive6.Trigger, { asChild: true, children }),
6163
+ /* @__PURE__ */ jsx49(PopoverPrimitive6.Portal, { children: /* @__PURE__ */ jsxs43(
6002
6164
  PopoverPrimitive6.Content,
6003
6165
  {
6004
6166
  sideOffset: 4,
@@ -6012,7 +6174,7 @@ var KebabMenu = ({
6012
6174
  "min-w-[210px]"
6013
6175
  ),
6014
6176
  children: [
6015
- onConvertToAdvanced && /* @__PURE__ */ jsxs39(
6177
+ onConvertToAdvanced && /* @__PURE__ */ jsxs43(
6016
6178
  "button",
6017
6179
  {
6018
6180
  type: "button",
@@ -6022,7 +6184,7 @@ var KebabMenu = ({
6022
6184
  },
6023
6185
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
6024
6186
  children: [
6025
- /* @__PURE__ */ jsx44(
6187
+ /* @__PURE__ */ jsx49(
6026
6188
  Icon27,
6027
6189
  {
6028
6190
  icon: faArrowRightOutline,
@@ -6030,12 +6192,12 @@ var KebabMenu = ({
6030
6192
  className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
6031
6193
  }
6032
6194
  ),
6033
- /* @__PURE__ */ jsx44("span", { className: "text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)]", children: "Convert to advanced" })
6195
+ /* @__PURE__ */ jsx49("span", { className: "text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)]", children: "Convert to advanced" })
6034
6196
  ]
6035
6197
  }
6036
6198
  ),
6037
- onConvertToAdvanced && onDelete && /* @__PURE__ */ jsx44("div", { className: "h-px mx-base my-xs bg-[var(--color-border)]" }),
6038
- onDelete && /* @__PURE__ */ jsxs39(
6199
+ onConvertToAdvanced && onDelete && /* @__PURE__ */ jsx49("div", { className: "h-px mx-base my-xs bg-[var(--color-border)]" }),
6200
+ onDelete && /* @__PURE__ */ jsxs43(
6039
6201
  "button",
6040
6202
  {
6041
6203
  type: "button",
@@ -6045,7 +6207,7 @@ var KebabMenu = ({
6045
6207
  },
6046
6208
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
6047
6209
  children: [
6048
- /* @__PURE__ */ jsx44(
6210
+ /* @__PURE__ */ jsx49(
6049
6211
  Icon27,
6050
6212
  {
6051
6213
  icon: faTrashOutline,
@@ -6053,7 +6215,7 @@ var KebabMenu = ({
6053
6215
  className: "shrink-0 text-[var(--color-destructive)]"
6054
6216
  }
6055
6217
  ),
6056
- /* @__PURE__ */ jsx44("span", { className: "text-sm font-regular leading-sm text-[var(--color-destructive)]", children: "Delete filter" })
6218
+ /* @__PURE__ */ jsx49("span", { className: "text-sm font-regular leading-sm text-[var(--color-destructive)]", children: "Delete filter" })
6057
6219
  ]
6058
6220
  }
6059
6221
  )
@@ -6067,7 +6229,7 @@ KebabMenu.displayName = "KebabMenu";
6067
6229
  import * as React42 from "react";
6068
6230
  import * as PopoverPrimitive7 from "@radix-ui/react-popover";
6069
6231
  import { Icon as Icon28 } from "@l3mpire/icons";
6070
- import { jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
6232
+ import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
6071
6233
  var FilterEditor = ({
6072
6234
  propertyDef,
6073
6235
  condition,
@@ -6112,9 +6274,9 @@ var FilterEditor = ({
6112
6274
  onOpenChange?.(false);
6113
6275
  onClose();
6114
6276
  };
6115
- return /* @__PURE__ */ jsxs40(PopoverPrimitive7.Root, { open, onOpenChange, children: [
6116
- /* @__PURE__ */ jsx45(PopoverPrimitive7.Trigger, { asChild: true, children }),
6117
- /* @__PURE__ */ jsx45(PopoverPrimitive7.Portal, { children: /* @__PURE__ */ jsxs40(
6277
+ return /* @__PURE__ */ jsxs44(PopoverPrimitive7.Root, { open, onOpenChange, children: [
6278
+ /* @__PURE__ */ jsx50(PopoverPrimitive7.Trigger, { asChild: true, children }),
6279
+ /* @__PURE__ */ jsx50(PopoverPrimitive7.Portal, { children: /* @__PURE__ */ jsxs44(
6118
6280
  PopoverPrimitive7.Content,
6119
6281
  {
6120
6282
  sideOffset: 4,
@@ -6128,8 +6290,8 @@ var FilterEditor = ({
6128
6290
  "min-w-[240px]"
6129
6291
  ),
6130
6292
  children: [
6131
- /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-base px-base pt-base pb-xs border-b border-[var(--color-border)]", children: [
6132
- /* @__PURE__ */ jsx45(
6293
+ /* @__PURE__ */ jsxs44("div", { className: "flex items-center gap-base px-base pt-base pb-xs border-b border-[var(--color-border)]", children: [
6294
+ /* @__PURE__ */ jsx50(
6133
6295
  Icon28,
6134
6296
  {
6135
6297
  icon: propertyDef.icon,
@@ -6137,8 +6299,8 @@ var FilterEditor = ({
6137
6299
  className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
6138
6300
  }
6139
6301
  ),
6140
- /* @__PURE__ */ jsx45("span", { className: "text-sm font-semibold leading-sm text-[var(--color-foreground)]", children: propertyDef.label }),
6141
- localOperator && view === "value" && /* @__PURE__ */ jsxs40(
6302
+ /* @__PURE__ */ jsx50("span", { className: "text-sm font-semibold leading-sm text-[var(--color-foreground)]", children: propertyDef.label }),
6303
+ localOperator && view === "value" && /* @__PURE__ */ jsxs44(
6142
6304
  "button",
6143
6305
  {
6144
6306
  type: "button",
@@ -6151,14 +6313,14 @@ var FilterEditor = ({
6151
6313
  }
6152
6314
  )
6153
6315
  ] }),
6154
- view === "operator" ? /* @__PURE__ */ jsx45("div", { className: "p-xs", children: /* @__PURE__ */ jsx45(
6316
+ view === "operator" ? /* @__PURE__ */ jsx50("div", { className: "p-xs", children: /* @__PURE__ */ jsx50(
6155
6317
  OperatorList,
6156
6318
  {
6157
6319
  dataType: propertyDef.type,
6158
6320
  activeOperator: localOperator,
6159
6321
  onSelect: handleOperatorSelect
6160
6322
  }
6161
- ) }) : localOperator && /* @__PURE__ */ jsx45(
6323
+ ) }) : localOperator && /* @__PURE__ */ jsx50(
6162
6324
  ValueInput,
6163
6325
  {
6164
6326
  dataType: propertyDef.type,
@@ -6179,7 +6341,7 @@ FilterEditor.displayName = "FilterEditor";
6179
6341
  // src/components/ui/filter/interactive-filter-chip.tsx
6180
6342
  import * as React43 from "react";
6181
6343
  import * as PopoverPrimitive8 from "@radix-ui/react-popover";
6182
- import { jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
6344
+ import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
6183
6345
  function formatFilterValue(value) {
6184
6346
  if (value == null) return void 0;
6185
6347
  if (typeof value === "boolean") return value ? "Yes" : "No";
@@ -6212,9 +6374,9 @@ var SegmentPopover = ({
6212
6374
  children,
6213
6375
  align = "start",
6214
6376
  minWidth = "240px"
6215
- }) => /* @__PURE__ */ jsxs41(PopoverPrimitive8.Root, { open, onOpenChange, children: [
6216
- /* @__PURE__ */ jsx46(PopoverPrimitive8.Trigger, { asChild: true, children: trigger }),
6217
- /* @__PURE__ */ jsx46(PopoverPrimitive8.Portal, { children: /* @__PURE__ */ jsx46(
6377
+ }) => /* @__PURE__ */ jsxs45(PopoverPrimitive8.Root, { open, onOpenChange, children: [
6378
+ /* @__PURE__ */ jsx51(PopoverPrimitive8.Trigger, { asChild: true, children: trigger }),
6379
+ /* @__PURE__ */ jsx51(PopoverPrimitive8.Portal, { children: /* @__PURE__ */ jsx51(
6218
6380
  PopoverPrimitive8.Content,
6219
6381
  {
6220
6382
  sideOffset: 4,
@@ -6247,12 +6409,20 @@ var InteractiveFilterChip = ({
6247
6409
  const [valueOpen, setValueOpen] = React43.useState(false);
6248
6410
  const [propertyOpen, setPropertyOpen] = React43.useState(false);
6249
6411
  const [kebabOpen, setKebabOpen] = React43.useState(false);
6412
+ const [pendingValueOpen, setPendingValueOpen] = React43.useState(false);
6413
+ const autoOpenHandled = React43.useRef(false);
6250
6414
  React43.useEffect(() => {
6251
- if (autoOpen && condition.operator && !isNoValueOperator(condition.operator)) {
6252
- const t = setTimeout(() => setValueOpen(true), 50);
6253
- return () => clearTimeout(t);
6415
+ if (autoOpen && !autoOpenHandled.current && condition.operator && !isNoValueOperator(condition.operator)) {
6416
+ autoOpenHandled.current = true;
6417
+ setValueOpen(true);
6254
6418
  }
6255
- }, []);
6419
+ }, [autoOpen, condition.operator]);
6420
+ React43.useEffect(() => {
6421
+ if (!operatorOpen && pendingValueOpen) {
6422
+ setPendingValueOpen(false);
6423
+ setValueOpen(true);
6424
+ }
6425
+ }, [operatorOpen, pendingValueOpen]);
6256
6426
  const handleOperatorSelect = (op) => {
6257
6427
  if (isNoValueOperator(op)) {
6258
6428
  onUpdate({ ...condition, operator: op, value: null });
@@ -6262,7 +6432,7 @@ var InteractiveFilterChip = ({
6262
6432
  onUpdate({ ...condition, operator: op, value: resetValue });
6263
6433
  setOperatorOpen(false);
6264
6434
  if (resetValue == null) {
6265
- setTimeout(() => setValueOpen(true), 100);
6435
+ setPendingValueOpen(true);
6266
6436
  }
6267
6437
  }
6268
6438
  };
@@ -6276,7 +6446,7 @@ var InteractiveFilterChip = ({
6276
6446
  const displayValue = formatFilterValue(condition.value);
6277
6447
  const hasValue = hasOperator && displayValue != null;
6278
6448
  const badgeCount = getBadgeCount(condition.value);
6279
- return /* @__PURE__ */ jsxs41(
6449
+ return /* @__PURE__ */ jsxs45(
6280
6450
  "div",
6281
6451
  {
6282
6452
  className: cn(
@@ -6285,7 +6455,7 @@ var InteractiveFilterChip = ({
6285
6455
  className
6286
6456
  ),
6287
6457
  children: [
6288
- properties ? /* @__PURE__ */ jsx46(
6458
+ properties ? /* @__PURE__ */ jsx51(
6289
6459
  PropertySelector,
6290
6460
  {
6291
6461
  properties,
@@ -6295,7 +6465,7 @@ var InteractiveFilterChip = ({
6295
6465
  },
6296
6466
  open: propertyOpen,
6297
6467
  onOpenChange: setPropertyOpen,
6298
- children: /* @__PURE__ */ jsx46("div", { children: /* @__PURE__ */ jsx46(
6468
+ children: /* @__PURE__ */ jsx51("div", { children: /* @__PURE__ */ jsx51(
6299
6469
  FilterChipSegment,
6300
6470
  {
6301
6471
  segmentType: "property",
@@ -6306,7 +6476,7 @@ var InteractiveFilterChip = ({
6306
6476
  }
6307
6477
  ) })
6308
6478
  }
6309
- ) : /* @__PURE__ */ jsx46(
6479
+ ) : /* @__PURE__ */ jsx51(
6310
6480
  FilterChipSegment,
6311
6481
  {
6312
6482
  segmentType: "property",
@@ -6315,13 +6485,13 @@ var InteractiveFilterChip = ({
6315
6485
  label: propertyDef.label
6316
6486
  }
6317
6487
  ),
6318
- /* @__PURE__ */ jsx46(
6488
+ /* @__PURE__ */ jsx51(
6319
6489
  SegmentPopover,
6320
6490
  {
6321
6491
  open: operatorOpen,
6322
6492
  onOpenChange: setOperatorOpen,
6323
6493
  minWidth: "180px",
6324
- trigger: /* @__PURE__ */ jsx46("div", { children: /* @__PURE__ */ jsx46(
6494
+ trigger: /* @__PURE__ */ jsx51("div", { children: /* @__PURE__ */ jsx51(
6325
6495
  FilterChipSegment,
6326
6496
  {
6327
6497
  segmentType: hasOperator ? "operator" : "placeholder",
@@ -6330,7 +6500,7 @@ var InteractiveFilterChip = ({
6330
6500
  onClick: () => setOperatorOpen(true)
6331
6501
  }
6332
6502
  ) }),
6333
- children: /* @__PURE__ */ jsx46("div", { className: "p-xs", children: /* @__PURE__ */ jsx46(
6503
+ children: /* @__PURE__ */ jsx51("div", { className: "p-xs", children: /* @__PURE__ */ jsx51(
6334
6504
  OperatorList,
6335
6505
  {
6336
6506
  dataType: propertyDef.type,
@@ -6340,13 +6510,13 @@ var InteractiveFilterChip = ({
6340
6510
  ) })
6341
6511
  }
6342
6512
  ),
6343
- hasOperator && condition.operator && !isNoValueOperator(condition.operator) && /* @__PURE__ */ jsx46(
6513
+ hasOperator && condition.operator && !isNoValueOperator(condition.operator) && /* @__PURE__ */ jsx51(
6344
6514
  SegmentPopover,
6345
6515
  {
6346
6516
  open: valueOpen,
6347
6517
  onOpenChange: setValueOpen,
6348
6518
  minWidth: "240px",
6349
- trigger: /* @__PURE__ */ jsx46("div", { children: /* @__PURE__ */ jsx46(
6519
+ trigger: /* @__PURE__ */ jsx51("div", { children: /* @__PURE__ */ jsx51(
6350
6520
  FilterChipSegment,
6351
6521
  {
6352
6522
  segmentType: hasValue ? "value" : "placeholder",
@@ -6356,7 +6526,7 @@ var InteractiveFilterChip = ({
6356
6526
  onClick: () => setValueOpen(true)
6357
6527
  }
6358
6528
  ) }),
6359
- children: /* @__PURE__ */ jsx46(
6529
+ children: /* @__PURE__ */ jsx51(
6360
6530
  ValueInput,
6361
6531
  {
6362
6532
  dataType: propertyDef.type,
@@ -6369,7 +6539,7 @@ var InteractiveFilterChip = ({
6369
6539
  )
6370
6540
  }
6371
6541
  ),
6372
- hasOperator && condition.operator && isNoValueOperator(condition.operator) && /* @__PURE__ */ jsx46(
6542
+ hasOperator && condition.operator && isNoValueOperator(condition.operator) && /* @__PURE__ */ jsx51(
6373
6543
  FilterChipSegment,
6374
6544
  {
6375
6545
  segmentType: "value",
@@ -6377,14 +6547,14 @@ var InteractiveFilterChip = ({
6377
6547
  label: condition.operator
6378
6548
  }
6379
6549
  ),
6380
- hasOperator && /* @__PURE__ */ jsx46(
6550
+ hasOperator && /* @__PURE__ */ jsx51(
6381
6551
  KebabMenu,
6382
6552
  {
6383
6553
  open: kebabOpen,
6384
6554
  onOpenChange: setKebabOpen,
6385
6555
  onConvertToAdvanced,
6386
6556
  onDelete,
6387
- children: /* @__PURE__ */ jsx46("div", { children: /* @__PURE__ */ jsx46(
6557
+ children: /* @__PURE__ */ jsx51("div", { children: /* @__PURE__ */ jsx51(
6388
6558
  FilterChipSegment,
6389
6559
  {
6390
6560
  segmentType: "button",
@@ -6409,7 +6579,7 @@ import { Icon as Icon33, faXmarkOutline as faXmarkOutline4, faPlusOutline as faP
6409
6579
  // src/components/ui/filter/advanced-chip.tsx
6410
6580
  import * as React44 from "react";
6411
6581
  import { Icon as Icon29, faXmarkOutline as faXmarkOutline2 } from "@l3mpire/icons";
6412
- import { jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
6582
+ import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
6413
6583
  var btnBase = [
6414
6584
  "flex items-center justify-center",
6415
6585
  "min-h-[32px] max-h-[32px]",
@@ -6419,8 +6589,8 @@ var btnBase = [
6419
6589
  "hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
6420
6590
  ];
6421
6591
  var AdvancedChip = React44.forwardRef(
6422
- ({ className, count, onClear, onClick, ...props }, ref) => /* @__PURE__ */ jsxs42("div", { className: cn("inline-flex items-center", className), children: [
6423
- /* @__PURE__ */ jsxs42(
6592
+ ({ className, count, onClear, onClick, ...props }, ref) => /* @__PURE__ */ jsxs46("div", { className: cn("inline-flex items-center", className), children: [
6593
+ /* @__PURE__ */ jsxs46(
6424
6594
  "button",
6425
6595
  {
6426
6596
  ref,
@@ -6433,12 +6603,12 @@ var AdvancedChip = React44.forwardRef(
6433
6603
  ),
6434
6604
  ...props,
6435
6605
  children: [
6436
- /* @__PURE__ */ jsx47("span", { className: "text-sm font-semibold leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: "Advanced filters" }),
6437
- /* @__PURE__ */ jsx47("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ jsx47("span", { className: "text-[10px] font-semibold leading-2xs text-filter-chip-badge-text", children: count }) })
6606
+ /* @__PURE__ */ jsx52("span", { className: "text-sm font-semibold leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: "Advanced filters" }),
6607
+ count > 0 && /* @__PURE__ */ jsx52("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ jsx52("span", { className: "text-[10px] font-semibold leading-2xs text-filter-chip-badge-text", children: count }) })
6438
6608
  ]
6439
6609
  }
6440
6610
  ),
6441
- onClear && /* @__PURE__ */ jsx47(
6611
+ onClear && /* @__PURE__ */ jsx52(
6442
6612
  "button",
6443
6613
  {
6444
6614
  type: "button",
@@ -6452,7 +6622,7 @@ var AdvancedChip = React44.forwardRef(
6452
6622
  "rounded-r-md -ml-px"
6453
6623
  ),
6454
6624
  "aria-label": "Clear all advanced filters",
6455
- children: /* @__PURE__ */ jsx47(Icon29, { icon: faXmarkOutline2, size: "sm", className: "text-[var(--color-foreground)]" })
6625
+ children: /* @__PURE__ */ jsx52(Icon29, { icon: faXmarkOutline2, size: "sm", className: "text-[var(--color-foreground)]" })
6456
6626
  }
6457
6627
  )
6458
6628
  ] })
@@ -6462,13 +6632,13 @@ AdvancedChip.displayName = "AdvancedChip";
6462
6632
  // src/components/ui/filter/advanced-popover.tsx
6463
6633
  import * as React46 from "react";
6464
6634
  import * as PopoverPrimitive10 from "@radix-ui/react-popover";
6465
- import { Icon as Icon31, faPlusOutline as faPlusOutline2 } from "@l3mpire/icons";
6635
+ import { Icon as Icon31, faPlusOutline as faPlusOutline2, faChevronDownOutline as faChevronDownOutline3 } from "@l3mpire/icons";
6466
6636
 
6467
6637
  // src/components/ui/filter/advanced-row.tsx
6468
6638
  import * as React45 from "react";
6469
6639
  import * as PopoverPrimitive9 from "@radix-ui/react-popover";
6470
6640
  import { Icon as Icon30, faXmarkOutline as faXmarkOutline3, faRefreshOutline, faChevronDownOutline as faChevronDownOutline2 } from "@l3mpire/icons";
6471
- import { jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
6641
+ import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
6472
6642
  var selectBtnStyle = [
6473
6643
  "flex items-center gap-base",
6474
6644
  "px-base py-sm",
@@ -6502,8 +6672,8 @@ var AdvancedRow = ({
6502
6672
  onUpdate({ ...condition, value: val });
6503
6673
  };
6504
6674
  const displayValue = condition.value == null ? "" : typeof condition.value === "string" ? condition.value : String(condition.value);
6505
- return /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-base w-full min-w-0", children: [
6506
- connector === "Where" ? /* @__PURE__ */ jsx48("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ jsx48("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }) : /* @__PURE__ */ jsxs43(
6675
+ return /* @__PURE__ */ jsxs47("div", { className: "flex items-center gap-base w-full min-w-0", children: [
6676
+ connector === "Where" ? /* @__PURE__ */ jsx53("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ jsx53("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }) : /* @__PURE__ */ jsxs47(
6507
6677
  "button",
6508
6678
  {
6509
6679
  type: "button",
@@ -6518,21 +6688,21 @@ var AdvancedRow = ({
6518
6688
  ),
6519
6689
  children: [
6520
6690
  connector,
6521
- /* @__PURE__ */ jsx48(Icon30, { icon: faRefreshOutline, size: "xs", className: "text-[var(--color-foreground)]" })
6691
+ /* @__PURE__ */ jsx53(Icon30, { icon: faRefreshOutline, size: "xs", className: "text-[var(--color-foreground)]" })
6522
6692
  ]
6523
6693
  }
6524
6694
  ),
6525
- /* @__PURE__ */ jsxs43(PopoverPrimitive9.Root, { open: propertyOpen, onOpenChange: setPropertyOpen, children: [
6526
- /* @__PURE__ */ jsx48(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs43("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
6527
- /* @__PURE__ */ jsx48(Icon30, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-[var(--color-muted-foreground)]" }),
6528
- /* @__PURE__ */ jsxs43("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap truncate", children: [
6695
+ /* @__PURE__ */ jsxs47(PopoverPrimitive9.Root, { open: propertyOpen, onOpenChange: setPropertyOpen, children: [
6696
+ /* @__PURE__ */ jsx53(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs47("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
6697
+ /* @__PURE__ */ jsx53(Icon30, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-[var(--color-muted-foreground)]" }),
6698
+ /* @__PURE__ */ jsxs47("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap truncate", children: [
6529
6699
  propertyDef.groupLabel,
6530
6700
  " > ",
6531
6701
  propertyDef.label
6532
6702
  ] }),
6533
- /* @__PURE__ */ jsx48(Icon30, { icon: faChevronDownOutline2, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
6703
+ /* @__PURE__ */ jsx53(Icon30, { icon: faChevronDownOutline2, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
6534
6704
  ] }) }),
6535
- /* @__PURE__ */ jsx48(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ jsx48(
6705
+ /* @__PURE__ */ jsx53(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ jsx53(
6536
6706
  PopoverPrimitive9.Content,
6537
6707
  {
6538
6708
  sideOffset: 4,
@@ -6544,7 +6714,7 @@ var AdvancedRow = ({
6544
6714
  "data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
6545
6715
  "min-w-[200px]"
6546
6716
  ),
6547
- children: properties.map((p) => /* @__PURE__ */ jsxs43(
6717
+ children: properties.map((p) => /* @__PURE__ */ jsxs47(
6548
6718
  "button",
6549
6719
  {
6550
6720
  type: "button",
@@ -6558,8 +6728,8 @@ var AdvancedRow = ({
6558
6728
  p.id === condition.propertyId && "bg-[var(--color-dropdown-item-hover)]"
6559
6729
  ),
6560
6730
  children: [
6561
- /* @__PURE__ */ jsx48(Icon30, { icon: p.icon, size: "sm", className: "shrink-0 text-[var(--color-dropdown-item-icon)]" }),
6562
- /* @__PURE__ */ jsx48("span", { className: "text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] truncate", children: p.label })
6731
+ /* @__PURE__ */ jsx53(Icon30, { icon: p.icon, size: "sm", className: "shrink-0 text-[var(--color-dropdown-item-icon)]" }),
6732
+ /* @__PURE__ */ jsx53("span", { className: "text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] truncate", children: p.label })
6563
6733
  ]
6564
6734
  },
6565
6735
  p.id
@@ -6567,12 +6737,12 @@ var AdvancedRow = ({
6567
6737
  }
6568
6738
  ) })
6569
6739
  ] }),
6570
- /* @__PURE__ */ jsxs43(PopoverPrimitive9.Root, { open: operatorOpen, onOpenChange: setOperatorOpen, children: [
6571
- /* @__PURE__ */ jsx48(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs43("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
6572
- /* @__PURE__ */ jsx48("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap truncate text-left", children: condition.operator ?? "Select" }),
6573
- /* @__PURE__ */ jsx48(Icon30, { icon: faChevronDownOutline2, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
6740
+ /* @__PURE__ */ jsxs47(PopoverPrimitive9.Root, { open: operatorOpen, onOpenChange: setOperatorOpen, children: [
6741
+ /* @__PURE__ */ jsx53(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs47("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
6742
+ /* @__PURE__ */ jsx53("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap truncate text-left", children: condition.operator ?? "Select" }),
6743
+ /* @__PURE__ */ jsx53(Icon30, { icon: faChevronDownOutline2, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
6574
6744
  ] }) }),
6575
- /* @__PURE__ */ jsx48(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ jsx48(
6745
+ /* @__PURE__ */ jsx53(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ jsx53(
6576
6746
  PopoverPrimitive9.Content,
6577
6747
  {
6578
6748
  sideOffset: 4,
@@ -6584,7 +6754,7 @@ var AdvancedRow = ({
6584
6754
  "data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
6585
6755
  "min-w-[160px]"
6586
6756
  ),
6587
- children: /* @__PURE__ */ jsx48(
6757
+ children: /* @__PURE__ */ jsx53(
6588
6758
  OperatorList,
6589
6759
  {
6590
6760
  dataType: propertyDef.type,
@@ -6595,7 +6765,7 @@ var AdvancedRow = ({
6595
6765
  }
6596
6766
  ) })
6597
6767
  ] }),
6598
- condition.operator && !isNoValueOperator(condition.operator) && /* @__PURE__ */ jsx48(
6768
+ condition.operator && !isNoValueOperator(condition.operator) && /* @__PURE__ */ jsx53(
6599
6769
  "input",
6600
6770
  {
6601
6771
  type: "text",
@@ -6611,14 +6781,14 @@ var AdvancedRow = ({
6611
6781
  )
6612
6782
  }
6613
6783
  ),
6614
- /* @__PURE__ */ jsx48(
6784
+ /* @__PURE__ */ jsx53(
6615
6785
  "button",
6616
6786
  {
6617
6787
  type: "button",
6618
6788
  onClick: onDelete,
6619
6789
  className: "ml-auto shrink-0 flex items-center justify-center p-sm rounded-md cursor-pointer transition-colors hover:bg-[var(--color-accent)]",
6620
6790
  "aria-label": "Remove filter",
6621
- children: /* @__PURE__ */ jsx48(Icon30, { icon: faXmarkOutline3, size: "sm", className: "text-[var(--color-foreground)]" })
6791
+ children: /* @__PURE__ */ jsx53(Icon30, { icon: faXmarkOutline3, size: "sm", className: "text-[var(--color-foreground)]" })
6622
6792
  }
6623
6793
  )
6624
6794
  ] });
@@ -6626,7 +6796,7 @@ var AdvancedRow = ({
6626
6796
  AdvancedRow.displayName = "AdvancedRow";
6627
6797
 
6628
6798
  // src/components/ui/filter/advanced-popover.tsx
6629
- import { jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
6799
+ import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
6630
6800
  var outlinedBtn = [
6631
6801
  "flex items-center gap-sm px-base py-sm",
6632
6802
  "min-h-[32px] max-h-[32px] min-w-[80px]",
@@ -6644,7 +6814,7 @@ var AdvancedPopover = ({
6644
6814
  children
6645
6815
  }) => {
6646
6816
  const [addSelectorOpen, setAddSelectorOpen] = React46.useState(false);
6647
- const [logicOps, setLogicOps] = React46.useState({});
6817
+ const [draftPickerOpen, setDraftPickerOpen] = React46.useState(false);
6648
6818
  const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
6649
6819
  const handleUpdateFilter = (updated) => {
6650
6820
  onFiltersChange(filters.map((f) => f.id === updated.id ? updated : f));
@@ -6668,19 +6838,21 @@ var AdvancedPopover = ({
6668
6838
  onOpenChange?.(false);
6669
6839
  };
6670
6840
  const toggleLogicOp = (filterId) => {
6671
- setLogicOps((prev) => ({
6672
- ...prev,
6673
- [filterId]: (prev[filterId] ?? "and") === "and" ? "or" : "and"
6674
- }));
6841
+ onFiltersChange(
6842
+ filters.map(
6843
+ (f) => f.id === filterId ? { ...f, logicOperator: (f.logicOperator ?? "and") === "and" ? "or" : "and" } : f
6844
+ )
6845
+ );
6675
6846
  };
6676
- return /* @__PURE__ */ jsxs44(PopoverPrimitive10.Root, { open, onOpenChange, children: [
6677
- /* @__PURE__ */ jsx49(PopoverPrimitive10.Trigger, { asChild: true, children }),
6678
- /* @__PURE__ */ jsx49(PopoverPrimitive10.Portal, { children: /* @__PURE__ */ jsxs44(
6847
+ return /* @__PURE__ */ jsxs48(PopoverPrimitive10.Root, { open, onOpenChange, children: [
6848
+ /* @__PURE__ */ jsx54(PopoverPrimitive10.Trigger, { asChild: true, children }),
6849
+ /* @__PURE__ */ jsx54(PopoverPrimitive10.Portal, { children: /* @__PURE__ */ jsxs48(
6679
6850
  PopoverPrimitive10.Content,
6680
6851
  {
6681
6852
  sideOffset: 4,
6682
6853
  align: "start",
6683
6854
  collisionPadding: 16,
6855
+ onOpenAutoFocus: (e) => e.preventDefault(),
6684
6856
  className: cn(
6685
6857
  "z-50 flex flex-col",
6686
6858
  "bg-[var(--color-background)] rounded-md shadow-lg",
@@ -6690,14 +6862,14 @@ var AdvancedPopover = ({
6690
6862
  "w-[min(520px,calc(100vw-32px))]"
6691
6863
  ),
6692
6864
  children: [
6693
- /* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-base p-base", children: [
6865
+ /* @__PURE__ */ jsxs48("div", { className: "flex flex-col gap-base p-base", children: [
6694
6866
  filters.map((filter, i) => {
6695
6867
  const propDef = getPropertyDef(filter.propertyId);
6696
6868
  if (!propDef) return null;
6697
- return /* @__PURE__ */ jsx49(
6869
+ return /* @__PURE__ */ jsx54(
6698
6870
  AdvancedRow,
6699
6871
  {
6700
- connector: i === 0 ? "Where" : (logicOps[filter.id] ?? "and") === "and" ? "And" : "Or",
6872
+ connector: i === 0 ? "Where" : (filter.logicOperator ?? "and") === "and" ? "And" : "Or",
6701
6873
  onConnectorToggle: i > 0 ? () => toggleLogicOp(filter.id) : void 0,
6702
6874
  propertyDef: propDef,
6703
6875
  condition: filter,
@@ -6709,23 +6881,59 @@ var AdvancedPopover = ({
6709
6881
  filter.id
6710
6882
  );
6711
6883
  }),
6712
- filters.length === 0 && /* @__PURE__ */ jsx49("p", { className: "py-base text-sm text-[var(--color-muted-foreground)]", children: "No advanced filters yet." })
6884
+ filters.length === 0 && /* ── Draft row: inline "Select property" placeholder ──── */
6885
+ /* @__PURE__ */ jsxs48("div", { className: "flex items-center gap-base w-full min-w-0", children: [
6886
+ /* @__PURE__ */ jsx54("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ jsx54("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }),
6887
+ /* @__PURE__ */ jsx54(
6888
+ PropertySelector,
6889
+ {
6890
+ properties,
6891
+ onSelect: handleAddFilter,
6892
+ open: draftPickerOpen,
6893
+ onOpenChange: setDraftPickerOpen,
6894
+ children: /* @__PURE__ */ jsxs48(
6895
+ "button",
6896
+ {
6897
+ type: "button",
6898
+ className: cn(
6899
+ "flex items-center gap-base px-base py-sm min-w-0",
6900
+ "bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
6901
+ "border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
6902
+ "cursor-pointer transition-colors",
6903
+ "hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
6904
+ ),
6905
+ children: [
6906
+ /* @__PURE__ */ jsx54("span", { className: "text-sm font-regular leading-sm text-[var(--color-muted-foreground)] whitespace-nowrap", children: "Select property" }),
6907
+ /* @__PURE__ */ jsx54(
6908
+ Icon31,
6909
+ {
6910
+ icon: faChevronDownOutline3,
6911
+ size: "xs",
6912
+ className: "shrink-0 text-[var(--color-foreground)]"
6913
+ }
6914
+ )
6915
+ ]
6916
+ }
6917
+ )
6918
+ }
6919
+ )
6920
+ ] })
6713
6921
  ] }),
6714
- /* @__PURE__ */ jsxs44("div", { className: "flex items-center justify-between p-base border-t border-[var(--color-border)]", children: [
6715
- /* @__PURE__ */ jsx49(
6922
+ /* @__PURE__ */ jsxs48("div", { className: "flex items-center justify-between p-base border-t border-[var(--color-border)]", children: [
6923
+ /* @__PURE__ */ jsx54(
6716
6924
  PropertySelector,
6717
6925
  {
6718
6926
  properties,
6719
6927
  onSelect: handleAddFilter,
6720
6928
  open: addSelectorOpen,
6721
6929
  onOpenChange: setAddSelectorOpen,
6722
- children: /* @__PURE__ */ jsxs44("button", { type: "button", className: cn(outlinedBtn), children: [
6723
- /* @__PURE__ */ jsx49(Icon31, { icon: faPlusOutline2, size: "sm", className: "text-[var(--color-foreground)]" }),
6930
+ children: /* @__PURE__ */ jsxs48("button", { type: "button", className: cn(outlinedBtn), children: [
6931
+ /* @__PURE__ */ jsx54(Icon31, { icon: faPlusOutline2, size: "sm", className: "text-[var(--color-foreground)]" }),
6724
6932
  "Add filter"
6725
6933
  ] })
6726
6934
  }
6727
6935
  ),
6728
- /* @__PURE__ */ jsx49(
6936
+ /* @__PURE__ */ jsx54(
6729
6937
  "button",
6730
6938
  {
6731
6939
  type: "button",
@@ -6745,8 +6953,8 @@ AdvancedPopover.displayName = "AdvancedPopover";
6745
6953
  // src/components/ui/filter/summary-chip.tsx
6746
6954
  import * as React47 from "react";
6747
6955
  import * as PopoverPrimitive11 from "@radix-ui/react-popover";
6748
- import { Icon as Icon32, faSlidersOutline as faSlidersOutline2, faPlusOutline as faPlusOutline3 } from "@l3mpire/icons";
6749
- import { jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
6956
+ import { Icon as Icon32, faSlidersOutline as faSlidersOutline2, faPlusOutline as faPlusOutline3, faChevronDownOutline as faChevronDownOutline4 } from "@l3mpire/icons";
6957
+ import { jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
6750
6958
  var SummaryChip = ({
6751
6959
  count,
6752
6960
  filters,
@@ -6754,11 +6962,19 @@ var SummaryChip = ({
6754
6962
  onFiltersChange,
6755
6963
  onClearAll,
6756
6964
  children,
6757
- className
6965
+ className,
6966
+ open: openProp,
6967
+ onOpenChange
6758
6968
  }) => {
6759
- const [open, setOpen] = React47.useState(false);
6969
+ const [uncontrolledOpen, setUncontrolledOpen] = React47.useState(false);
6970
+ const isControlled = openProp !== void 0;
6971
+ const open = isControlled ? openProp : uncontrolledOpen;
6972
+ const setOpen = (v) => {
6973
+ if (!isControlled) setUncontrolledOpen(v);
6974
+ onOpenChange?.(v);
6975
+ };
6760
6976
  const [addSelectorOpen, setAddSelectorOpen] = React47.useState(false);
6761
- const [logicOps, setLogicOps] = React47.useState({});
6977
+ const [draftPickerOpen, setDraftPickerOpen] = React47.useState(false);
6762
6978
  const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
6763
6979
  const handleUpdateFilter = (updated) => {
6764
6980
  onFiltersChange(filters.map((f) => f.id === updated.id ? updated : f));
@@ -6779,8 +6995,15 @@ var SummaryChip = ({
6779
6995
  onFiltersChange([...filters, newFilter]);
6780
6996
  setAddSelectorOpen(false);
6781
6997
  };
6782
- return /* @__PURE__ */ jsxs45(PopoverPrimitive11.Root, { open, onOpenChange: setOpen, children: [
6783
- /* @__PURE__ */ jsx50(PopoverPrimitive11.Trigger, { asChild: true, children: children ?? /* @__PURE__ */ jsxs45(
6998
+ const toggleLogicOp = (filterId) => {
6999
+ onFiltersChange(
7000
+ filters.map(
7001
+ (f) => f.id === filterId ? { ...f, logicOperator: (f.logicOperator ?? "and") === "and" ? "or" : "and" } : f
7002
+ )
7003
+ );
7004
+ };
7005
+ return /* @__PURE__ */ jsxs49(PopoverPrimitive11.Root, { open, onOpenChange: setOpen, children: [
7006
+ /* @__PURE__ */ jsx55(PopoverPrimitive11.Trigger, { asChild: true, children: children ?? /* @__PURE__ */ jsxs49(
6784
7007
  "button",
6785
7008
  {
6786
7009
  type: "button",
@@ -6794,7 +7017,7 @@ var SummaryChip = ({
6794
7017
  className
6795
7018
  ),
6796
7019
  children: [
6797
- /* @__PURE__ */ jsx50(
7020
+ /* @__PURE__ */ jsx55(
6798
7021
  Icon32,
6799
7022
  {
6800
7023
  icon: faSlidersOutline2,
@@ -6802,17 +7025,18 @@ var SummaryChip = ({
6802
7025
  className: "shrink-0 text-[var(--color-foreground)]"
6803
7026
  }
6804
7027
  ),
6805
- /* @__PURE__ */ jsx50("span", { className: "text-sm font-semibold leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: "Filters" }),
6806
- count > 0 && /* @__PURE__ */ jsx50("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ jsx50("span", { className: "text-[10px] font-semibold leading-2xs text-filter-chip-badge-text", children: count }) })
7028
+ /* @__PURE__ */ jsx55("span", { className: "text-sm font-semibold leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: "Filters" }),
7029
+ count > 0 && /* @__PURE__ */ jsx55("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ jsx55("span", { className: "text-[10px] font-semibold leading-2xs text-filter-chip-badge-text", children: count }) })
6807
7030
  ]
6808
7031
  }
6809
7032
  ) }),
6810
- /* @__PURE__ */ jsx50(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ jsxs45(
7033
+ /* @__PURE__ */ jsx55(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ jsxs49(
6811
7034
  PopoverPrimitive11.Content,
6812
7035
  {
6813
7036
  sideOffset: 4,
6814
7037
  align: "start",
6815
7038
  collisionPadding: 16,
7039
+ onOpenAutoFocus: (e) => e.preventDefault(),
6816
7040
  className: cn(
6817
7041
  "z-50 flex flex-col overflow-clip",
6818
7042
  "bg-[var(--color-dropdown-bg)] border border-[var(--color-dropdown-border)] rounded-md shadow-lg",
@@ -6822,15 +7046,15 @@ var SummaryChip = ({
6822
7046
  "w-[min(520px,calc(100vw-32px))]"
6823
7047
  ),
6824
7048
  children: [
6825
- /* @__PURE__ */ jsxs45("div", { className: "flex flex-col gap-base p-base", children: [
7049
+ /* @__PURE__ */ jsxs49("div", { className: "flex flex-col gap-base p-base", children: [
6826
7050
  filters.map((filter, i) => {
6827
7051
  const propDef = getPropertyDef(filter.propertyId);
6828
7052
  if (!propDef) return null;
6829
- return /* @__PURE__ */ jsx50(
7053
+ return /* @__PURE__ */ jsx55(
6830
7054
  AdvancedRow,
6831
7055
  {
6832
- connector: i === 0 ? "Where" : (logicOps[filter.id] ?? "and") === "and" ? "And" : "Or",
6833
- onConnectorToggle: i > 0 ? () => setLogicOps((prev) => ({ ...prev, [filter.id]: (prev[filter.id] ?? "and") === "and" ? "or" : "and" })) : void 0,
7056
+ connector: i === 0 ? "Where" : (filter.logicOperator ?? "and") === "and" ? "And" : "Or",
7057
+ onConnectorToggle: i > 0 ? () => toggleLogicOp(filter.id) : void 0,
6834
7058
  propertyDef: propDef,
6835
7059
  condition: filter,
6836
7060
  properties,
@@ -6841,17 +7065,53 @@ var SummaryChip = ({
6841
7065
  filter.id
6842
7066
  );
6843
7067
  }),
6844
- filters.length === 0 && /* @__PURE__ */ jsx50("p", { className: "py-base text-sm text-[var(--color-muted-foreground)]", children: "No active filters." })
7068
+ filters.length === 0 && /* ── Draft row: inline "Select property" placeholder ──── */
7069
+ /* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-base w-full min-w-0", children: [
7070
+ /* @__PURE__ */ jsx55("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ jsx55("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }),
7071
+ /* @__PURE__ */ jsx55(
7072
+ PropertySelector,
7073
+ {
7074
+ properties,
7075
+ onSelect: handleAddFilter,
7076
+ open: draftPickerOpen,
7077
+ onOpenChange: setDraftPickerOpen,
7078
+ children: /* @__PURE__ */ jsxs49(
7079
+ "button",
7080
+ {
7081
+ type: "button",
7082
+ className: cn(
7083
+ "flex items-center gap-base px-base py-sm min-w-0",
7084
+ "bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
7085
+ "border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
7086
+ "cursor-pointer transition-colors",
7087
+ "hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
7088
+ ),
7089
+ children: [
7090
+ /* @__PURE__ */ jsx55("span", { className: "text-sm font-regular leading-sm text-[var(--color-muted-foreground)] whitespace-nowrap", children: "Select property" }),
7091
+ /* @__PURE__ */ jsx55(
7092
+ Icon32,
7093
+ {
7094
+ icon: faChevronDownOutline4,
7095
+ size: "xs",
7096
+ className: "shrink-0 text-[var(--color-foreground)]"
7097
+ }
7098
+ )
7099
+ ]
7100
+ }
7101
+ )
7102
+ }
7103
+ )
7104
+ ] })
6845
7105
  ] }),
6846
- /* @__PURE__ */ jsxs45("div", { className: "flex items-center justify-between p-base border-t border-[var(--color-border)]", children: [
6847
- /* @__PURE__ */ jsx50(
7106
+ /* @__PURE__ */ jsxs49("div", { className: "flex items-center justify-between p-base border-t border-[var(--color-border)]", children: [
7107
+ /* @__PURE__ */ jsx55(
6848
7108
  PropertySelector,
6849
7109
  {
6850
7110
  properties,
6851
7111
  onSelect: handleAddFilter,
6852
7112
  open: addSelectorOpen,
6853
7113
  onOpenChange: setAddSelectorOpen,
6854
- children: /* @__PURE__ */ jsxs45(
7114
+ children: /* @__PURE__ */ jsxs49(
6855
7115
  "button",
6856
7116
  {
6857
7117
  type: "button",
@@ -6864,14 +7124,14 @@ var SummaryChip = ({
6864
7124
  "hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
6865
7125
  ),
6866
7126
  children: [
6867
- /* @__PURE__ */ jsx50(Icon32, { icon: faPlusOutline3, size: "sm", className: "text-[var(--color-foreground)]" }),
7127
+ /* @__PURE__ */ jsx55(Icon32, { icon: faPlusOutline3, size: "sm", className: "text-[var(--color-foreground)]" }),
6868
7128
  "Add filter"
6869
7129
  ]
6870
7130
  }
6871
7131
  )
6872
7132
  }
6873
7133
  ),
6874
- filters.length > 0 && /* @__PURE__ */ jsx50(
7134
+ filters.length > 0 && /* @__PURE__ */ jsx55(
6875
7135
  "button",
6876
7136
  {
6877
7137
  type: "button",
@@ -6893,7 +7153,8 @@ SummaryChip.displayName = "SummaryChip";
6893
7153
 
6894
7154
  // src/components/ui/filter/use-filter-bar-mode.ts
6895
7155
  import * as React48 from "react";
6896
- function useFilterBarMode(ref, override) {
7156
+ var DEFAULT_BREAKPOINT = 600;
7157
+ function useFilterBarMode(ref, override, breakpoint = DEFAULT_BREAKPOINT) {
6897
7158
  const [mode, setMode] = React48.useState("default");
6898
7159
  React48.useEffect(() => {
6899
7160
  if (override) return;
@@ -6901,30 +7162,32 @@ function useFilterBarMode(ref, override) {
6901
7162
  if (!el) return;
6902
7163
  const observer = new ResizeObserver((entries) => {
6903
7164
  const width = entries[0]?.contentRect.width ?? 0;
6904
- setMode(width > 600 ? "default" : "minimal");
7165
+ setMode(width > breakpoint ? "default" : "minimal");
6905
7166
  });
6906
7167
  observer.observe(el);
6907
7168
  return () => observer.disconnect();
6908
- }, [ref, override]);
7169
+ }, [ref, override, breakpoint]);
6909
7170
  return override ?? mode;
6910
7171
  }
6911
7172
 
6912
7173
  // src/components/ui/filter/filter-system.tsx
6913
- import { Fragment as Fragment4, jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
7174
+ import { Fragment as Fragment5, jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
6914
7175
  var FilterSystem = ({
6915
7176
  properties,
6916
7177
  filterState,
6917
7178
  onFilterStateChange,
6918
7179
  sortFields,
6919
7180
  mode: modeOverride,
7181
+ breakpoint,
6920
7182
  children,
6921
7183
  actions,
6922
7184
  className
6923
7185
  }) => {
6924
7186
  const containerRef = React49.useRef(null);
6925
- const mode = useFilterBarMode(containerRef, modeOverride);
7187
+ const mode = useFilterBarMode(containerRef, modeOverride, breakpoint);
6926
7188
  const [propertySelectorOpen, setPropertySelectorOpen] = React49.useState(false);
6927
7189
  const [advancedOpen, setAdvancedOpen] = React49.useState(false);
7190
+ const [summaryOpen, setSummaryOpen] = React49.useState(false);
6928
7191
  const [pendingFilterId, setPendingFilterId] = React49.useState(null);
6929
7192
  const allFilters = [...filterState.basicFilters, ...filterState.advancedFilters];
6930
7193
  const totalCount = allFilters.length;
@@ -7000,10 +7263,23 @@ var FilterSystem = ({
7000
7263
  const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
7001
7264
  const hasAdvanced = filterState.advancedFilters.length > 0;
7002
7265
  const isMinimal = mode === "minimal";
7003
- return /* @__PURE__ */ jsxs46(FilterBar, { ref: containerRef, className, children: [
7004
- /* @__PURE__ */ jsxs46(FilterBarLeft, { className: "flex-nowrap flex-1 min-w-0 overflow-x-auto scrollbar-none outline-none [&>*]:shrink-0", children: [
7266
+ const handleOpenAdvanced = () => {
7267
+ setPropertySelectorOpen(false);
7268
+ requestAnimationFrame(() => {
7269
+ if (isMinimal) {
7270
+ setSummaryOpen(true);
7271
+ } else {
7272
+ setAdvancedOpen(true);
7273
+ }
7274
+ });
7275
+ };
7276
+ const advancedFilterCount = filterState.advancedFilters.length;
7277
+ const showAdvancedChip = hasAdvanced || advancedOpen;
7278
+ const showSummaryChip = totalCount > 0 || summaryOpen;
7279
+ return /* @__PURE__ */ jsxs50(FilterBar, { ref: containerRef, className, children: [
7280
+ /* @__PURE__ */ jsxs50(FilterBarLeft, { className: "flex-nowrap flex-1 min-w-0 overflow-x-auto scrollbar-none outline-none [&>*]:shrink-0", children: [
7005
7281
  children,
7006
- sortFields && filterState.sort && /* @__PURE__ */ jsx51(
7282
+ sortFields && filterState.sort && /* @__PURE__ */ jsx56(
7007
7283
  SortButton,
7008
7284
  {
7009
7285
  fields: sortFields,
@@ -7013,40 +7289,48 @@ var FilterSystem = ({
7013
7289
  iconOnly: isMinimal
7014
7290
  }
7015
7291
  ),
7016
- isMinimal ? totalCount > 0 ? (
7017
- /* Has filters → SummaryChip (interactive popover) */
7018
- /* @__PURE__ */ jsx51(
7019
- SummaryChip,
7292
+ isMinimal ? /* @__PURE__ */ jsxs50(Fragment5, { children: [
7293
+ /* @__PURE__ */ jsx56(
7294
+ "div",
7020
7295
  {
7021
- count: totalCount,
7022
- filters: allFilters,
7023
- properties,
7024
- onFiltersChange: (filters) => {
7025
- onFilterStateChange({
7026
- ...filterState,
7027
- basicFilters: filters,
7028
- advancedFilters: []
7029
- });
7030
- },
7031
- onClearAll: handleClearAll
7296
+ className: showSummaryChip ? "inline-flex" : "inline-flex w-0 overflow-hidden opacity-0 pointer-events-none",
7297
+ "aria-hidden": !showSummaryChip || void 0,
7298
+ children: /* @__PURE__ */ jsx56(
7299
+ SummaryChip,
7300
+ {
7301
+ count: totalCount,
7302
+ filters: allFilters,
7303
+ properties,
7304
+ onFiltersChange: (filters) => {
7305
+ onFilterStateChange({
7306
+ ...filterState,
7307
+ basicFilters: filters,
7308
+ advancedFilters: []
7309
+ });
7310
+ },
7311
+ onClearAll: handleClearAll,
7312
+ open: summaryOpen,
7313
+ onOpenChange: setSummaryOpen
7314
+ }
7315
+ )
7032
7316
  }
7033
- )
7034
- ) : (
7035
- /* No filters → same FilterBarButton as default, icon-only */
7036
- /* @__PURE__ */ jsx51(
7317
+ ),
7318
+ !showSummaryChip && /* @__PURE__ */ jsx56(
7037
7319
  PropertySelector,
7038
7320
  {
7039
7321
  properties,
7040
7322
  onSelect: handleAddFilter,
7041
7323
  open: propertySelectorOpen,
7042
7324
  onOpenChange: setPropertySelectorOpen,
7043
- children: /* @__PURE__ */ jsx51(FilterBarButton, { iconOnly: true })
7325
+ onAdvancedFilter: handleOpenAdvanced,
7326
+ advancedFilterCount,
7327
+ children: /* @__PURE__ */ jsx56(FilterBarButton, { iconOnly: true })
7044
7328
  }
7045
7329
  )
7046
- ) : (
7330
+ ] }) : (
7047
7331
  /* ── DEFAULT MODE ────────────────────────────────────── */
7048
- /* @__PURE__ */ jsxs46(Fragment4, { children: [
7049
- hasAdvanced && /* @__PURE__ */ jsx51(
7332
+ /* @__PURE__ */ jsxs50(Fragment5, { children: [
7333
+ /* @__PURE__ */ jsx56(
7050
7334
  AdvancedPopover,
7051
7335
  {
7052
7336
  filters: filterState.advancedFilters,
@@ -7054,12 +7338,19 @@ var FilterSystem = ({
7054
7338
  onFiltersChange: handleAdvancedFiltersChange,
7055
7339
  open: advancedOpen,
7056
7340
  onOpenChange: setAdvancedOpen,
7057
- children: /* @__PURE__ */ jsx51(
7058
- AdvancedChip,
7341
+ children: /* @__PURE__ */ jsx56(
7342
+ "div",
7059
7343
  {
7060
- count: filterState.advancedFilters.length,
7061
- onClick: () => setAdvancedOpen(true),
7062
- onClear: handleClearAdvanced
7344
+ className: showAdvancedChip ? "inline-flex" : "inline-flex w-0 overflow-hidden opacity-0 pointer-events-none",
7345
+ "aria-hidden": !showAdvancedChip || void 0,
7346
+ children: /* @__PURE__ */ jsx56(
7347
+ AdvancedChip,
7348
+ {
7349
+ count: filterState.advancedFilters.length,
7350
+ onClick: () => setAdvancedOpen(true),
7351
+ onClear: handleClearAdvanced
7352
+ }
7353
+ )
7063
7354
  }
7064
7355
  )
7065
7356
  }
@@ -7067,7 +7358,7 @@ var FilterSystem = ({
7067
7358
  filterState.basicFilters.map((filter) => {
7068
7359
  const propDef = getPropertyDef(filter.propertyId);
7069
7360
  if (!propDef) return null;
7070
- return /* @__PURE__ */ jsx51(
7361
+ return /* @__PURE__ */ jsx56(
7071
7362
  InteractiveFilterChip,
7072
7363
  {
7073
7364
  propertyDef: propDef,
@@ -7083,36 +7374,38 @@ var FilterSystem = ({
7083
7374
  filter.id
7084
7375
  );
7085
7376
  }),
7086
- /* @__PURE__ */ jsx51(
7377
+ /* @__PURE__ */ jsx56(
7087
7378
  PropertySelector,
7088
7379
  {
7089
7380
  properties,
7090
7381
  onSelect: handleAddFilter,
7091
7382
  open: propertySelectorOpen,
7092
7383
  onOpenChange: setPropertySelectorOpen,
7093
- children: totalCount > 0 ? /* @__PURE__ */ jsx51(
7384
+ onAdvancedFilter: handleOpenAdvanced,
7385
+ advancedFilterCount,
7386
+ children: totalCount > 0 ? /* @__PURE__ */ jsx56(
7094
7387
  "button",
7095
7388
  {
7096
7389
  type: "button",
7097
7390
  className: "shrink-0 inline-flex items-center justify-center size-8 rounded-md border border-[var(--color-btn-outlined-neutral-border-default)] bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)] shadow-sm cursor-pointer transition-colors hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]",
7098
- children: /* @__PURE__ */ jsx51(Icon33, { icon: faPlusOutline4, size: "sm", className: "text-[var(--color-foreground)]" })
7391
+ children: /* @__PURE__ */ jsx56(Icon33, { icon: faPlusOutline4, size: "sm", className: "text-[var(--color-foreground)]" })
7099
7392
  }
7100
- ) : /* @__PURE__ */ jsx51(FilterBarButton, {})
7393
+ ) : /* @__PURE__ */ jsx56(FilterBarButton, {})
7101
7394
  }
7102
7395
  )
7103
7396
  ] })
7104
7397
  ),
7105
- totalCount > 0 && /* @__PURE__ */ jsx51(
7398
+ totalCount > 0 && /* @__PURE__ */ jsx56(
7106
7399
  "button",
7107
7400
  {
7108
7401
  type: "button",
7109
7402
  onClick: handleClearAll,
7110
7403
  className: "shrink-0 flex items-center gap-sm px-base py-sm min-h-[32px] max-h-[32px] rounded-md cursor-pointer transition-colors hover:bg-[var(--color-accent)]",
7111
- children: isMinimal ? /* @__PURE__ */ jsx51(Icon33, { icon: faXmarkOutline4, size: "sm", className: "text-[var(--color-foreground)]" }) : /* @__PURE__ */ jsx51("span", { className: "text-sm font-semibold leading-sm text-[var(--color-foreground)]", children: "Clear" })
7404
+ children: isMinimal ? /* @__PURE__ */ jsx56(Icon33, { icon: faXmarkOutline4, size: "sm", className: "text-[var(--color-foreground)]" }) : /* @__PURE__ */ jsx56("span", { className: "text-sm font-semibold leading-sm text-[var(--color-foreground)]", children: "Clear" })
7112
7405
  }
7113
7406
  )
7114
7407
  ] }),
7115
- actions && /* @__PURE__ */ jsx51(FilterBarRight, { className: "shrink-0 -ml-2xl pl-2xl relative z-10 bg-[linear-gradient(to_right,transparent_0px,var(--filter-bar-bg,var(--color-background,#fff))_24px)]", children: actions })
7408
+ actions && /* @__PURE__ */ jsx56(FilterBarRight, { className: "shrink-0 -ml-2xl pl-2xl relative z-10 bg-[linear-gradient(to_right,transparent_0px,var(--filter-bar-bg,var(--color-background,#fff))_24px)]", children: actions })
7116
7409
  ] });
7117
7410
  };
7118
7411
  FilterSystem.displayName = "FilterSystem";
@@ -7127,7 +7420,7 @@ import {
7127
7420
  faArrowRightOutline as faArrowRightOutline2,
7128
7421
  faCalendarOutline
7129
7422
  } from "@l3mpire/icons";
7130
- import { jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
7423
+ import { jsx as jsx57, jsxs as jsxs51 } from "react/jsx-runtime";
7131
7424
  function getDaysInMonth(year, month) {
7132
7425
  return new Date(year, month + 1, 0).getDate();
7133
7426
  }
@@ -7258,7 +7551,7 @@ var DatePicker = React50.forwardRef(
7258
7551
  hoveredDate
7259
7552
  ]
7260
7553
  );
7261
- return /* @__PURE__ */ jsx52(DatePickerContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx52(
7554
+ return /* @__PURE__ */ jsx57(DatePickerContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx57(
7262
7555
  "div",
7263
7556
  {
7264
7557
  ref,
@@ -7285,18 +7578,18 @@ var DatePickerSelects = React50.forwardRef(({ className, formatDate = defaultFor
7285
7578
  const { selected } = useDatePickerContext();
7286
7579
  const fromDate = selected instanceof Date ? selected : selected?.from;
7287
7580
  const toDate = selected instanceof Date ? void 0 : selected?.to;
7288
- return /* @__PURE__ */ jsx52(
7581
+ return /* @__PURE__ */ jsx57(
7289
7582
  "div",
7290
7583
  {
7291
7584
  ref,
7292
7585
  className: cn("flex flex-col items-start pt-lg px-lg", className),
7293
7586
  ...props,
7294
- children: /* @__PURE__ */ jsxs47("div", { className: "flex items-center gap-base w-full", children: [
7295
- /* @__PURE__ */ jsxs47("div", { className: "flex-1 flex items-center gap-base min-w-0 px-base py-sm bg-gradient-to-t from-[var(--color-select-bg-default)] to-[var(--color-select-bg-gradient-to)] border border-[var(--color-select-border-default)] rounded-base shadow-sm", children: [
7296
- /* @__PURE__ */ jsx52("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: fromDate ? formatDate(fromDate) : "Start date" }),
7297
- /* @__PURE__ */ jsx52(Icon34, { icon: faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
7587
+ children: /* @__PURE__ */ jsxs51("div", { className: "flex items-center gap-base w-full", children: [
7588
+ /* @__PURE__ */ jsxs51("div", { className: "flex-1 flex items-center gap-base min-w-0 px-base py-sm bg-gradient-to-t from-[var(--color-select-bg-default)] to-[var(--color-select-bg-gradient-to)] border border-[var(--color-select-border-default)] rounded-base shadow-sm", children: [
7589
+ /* @__PURE__ */ jsx57("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: fromDate ? formatDate(fromDate) : "Start date" }),
7590
+ /* @__PURE__ */ jsx57(Icon34, { icon: faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
7298
7591
  ] }),
7299
- /* @__PURE__ */ jsx52(
7592
+ /* @__PURE__ */ jsx57(
7300
7593
  Icon34,
7301
7594
  {
7302
7595
  icon: faArrowRightOutline2,
@@ -7304,9 +7597,9 @@ var DatePickerSelects = React50.forwardRef(({ className, formatDate = defaultFor
7304
7597
  className: "shrink-0 text-datepicker-header-weekday"
7305
7598
  }
7306
7599
  ),
7307
- /* @__PURE__ */ jsxs47("div", { className: "flex-1 flex items-center gap-base min-w-0 px-base py-sm bg-gradient-to-t from-[var(--color-select-bg-default)] to-[var(--color-select-bg-gradient-to)] border border-[var(--color-select-border-default)] rounded-base shadow-sm", children: [
7308
- /* @__PURE__ */ jsx52("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: toDate ? formatDate(toDate) : "End date" }),
7309
- /* @__PURE__ */ jsx52(Icon34, { icon: faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
7600
+ /* @__PURE__ */ jsxs51("div", { className: "flex-1 flex items-center gap-base min-w-0 px-base py-sm bg-gradient-to-t from-[var(--color-select-bg-default)] to-[var(--color-select-bg-gradient-to)] border border-[var(--color-select-border-default)] rounded-base shadow-sm", children: [
7601
+ /* @__PURE__ */ jsx57("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: toDate ? formatDate(toDate) : "End date" }),
7602
+ /* @__PURE__ */ jsx57(Icon34, { icon: faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
7310
7603
  ] })
7311
7604
  ] })
7312
7605
  }
@@ -7322,7 +7615,7 @@ var DatePickerDay = ({ date, isOutside }) => {
7322
7615
  const inRange = mode === "range" && selected && !(selected instanceof Date) && selected.from && selected.to && !isSelected && isInRange(date, selected.from, selected.to);
7323
7616
  const inPreviewRange = mode === "range" && selected && !(selected instanceof Date) && selected.from && !selected.to && hoveredDate && !isSelected && hoveredDate.getTime() > selected.from.getTime() && isInRange(date, selected.from, hoveredDate);
7324
7617
  const isInRangeOrPreview = inRange || inPreviewRange;
7325
- return /* @__PURE__ */ jsxs47(
7618
+ return /* @__PURE__ */ jsxs51(
7326
7619
  "button",
7327
7620
  {
7328
7621
  type: "button",
@@ -7346,7 +7639,7 @@ var DatePickerDay = ({ date, isOutside }) => {
7346
7639
  ),
7347
7640
  children: [
7348
7641
  date.getDate(),
7349
- isToday && !isOutside && /* @__PURE__ */ jsx52("span", { className: "absolute bottom-0.5 left-1/2 -translate-x-1/2 size-1.5 rounded-full bg-datepicker-day-today" })
7642
+ isToday && !isOutside && /* @__PURE__ */ jsx57("span", { className: "absolute bottom-0.5 left-1/2 -translate-x-1/2 size-1.5 rounded-full bg-datepicker-day-today" })
7350
7643
  ]
7351
7644
  }
7352
7645
  );
@@ -7393,7 +7686,7 @@ var DatePickerCalendar = React50.forwardRef(({ className, header, ...props }, re
7393
7686
  }
7394
7687
  return result;
7395
7688
  }, [month, year]);
7396
- return /* @__PURE__ */ jsxs47(
7689
+ return /* @__PURE__ */ jsxs51(
7397
7690
  "div",
7398
7691
  {
7399
7692
  ref,
@@ -7401,38 +7694,38 @@ var DatePickerCalendar = React50.forwardRef(({ className, header, ...props }, re
7401
7694
  ...props,
7402
7695
  children: [
7403
7696
  header,
7404
- /* @__PURE__ */ jsxs47("div", { className: "flex flex-col gap-lg p-lg", children: [
7405
- /* @__PURE__ */ jsxs47("div", { className: "flex items-center justify-between", children: [
7406
- /* @__PURE__ */ jsxs47("span", { className: "text-base font-semibold leading-base text-datepicker-header-text", children: [
7697
+ /* @__PURE__ */ jsxs51("div", { className: "flex flex-col gap-lg p-lg", children: [
7698
+ /* @__PURE__ */ jsxs51("div", { className: "flex items-center justify-between", children: [
7699
+ /* @__PURE__ */ jsxs51("span", { className: "text-base font-semibold leading-base text-datepicker-header-text", children: [
7407
7700
  MONTH_NAMES[month],
7408
7701
  " ",
7409
7702
  year
7410
7703
  ] }),
7411
- /* @__PURE__ */ jsxs47("div", { className: "flex items-center gap-xs", children: [
7412
- /* @__PURE__ */ jsx52(
7704
+ /* @__PURE__ */ jsxs51("div", { className: "flex items-center gap-xs", children: [
7705
+ /* @__PURE__ */ jsx57(
7413
7706
  "button",
7414
7707
  {
7415
7708
  type: "button",
7416
7709
  onClick: goToPrevMonth,
7417
7710
  className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
7418
7711
  "aria-label": "Previous month",
7419
- children: /* @__PURE__ */ jsx52(Icon34, { icon: faChevronLeftOutline3, size: "xs", className: "text-datepicker-header-nav" })
7712
+ children: /* @__PURE__ */ jsx57(Icon34, { icon: faChevronLeftOutline3, size: "xs", className: "text-datepicker-header-nav" })
7420
7713
  }
7421
7714
  ),
7422
- /* @__PURE__ */ jsx52(
7715
+ /* @__PURE__ */ jsx57(
7423
7716
  "button",
7424
7717
  {
7425
7718
  type: "button",
7426
7719
  onClick: goToNextMonth,
7427
7720
  className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
7428
7721
  "aria-label": "Next month",
7429
- children: /* @__PURE__ */ jsx52(Icon34, { icon: faChevronRightOutline3, size: "xs", className: "text-datepicker-header-nav" })
7722
+ children: /* @__PURE__ */ jsx57(Icon34, { icon: faChevronRightOutline3, size: "xs", className: "text-datepicker-header-nav" })
7430
7723
  }
7431
7724
  )
7432
7725
  ] })
7433
7726
  ] }),
7434
- /* @__PURE__ */ jsxs47("div", { className: "flex flex-col", children: [
7435
- /* @__PURE__ */ jsx52("div", { className: "grid grid-cols-7 gap-base py-sm", children: WEEKDAYS.map((day) => /* @__PURE__ */ jsx52(
7727
+ /* @__PURE__ */ jsxs51("div", { className: "flex flex-col", children: [
7728
+ /* @__PURE__ */ jsx57("div", { className: "grid grid-cols-7 gap-base py-sm", children: WEEKDAYS.map((day) => /* @__PURE__ */ jsx57(
7436
7729
  "span",
7437
7730
  {
7438
7731
  className: "w-9 text-center text-xs font-regular leading-xs text-datepicker-header-weekday",
@@ -7440,7 +7733,7 @@ var DatePickerCalendar = React50.forwardRef(({ className, header, ...props }, re
7440
7733
  },
7441
7734
  day
7442
7735
  )) }),
7443
- /* @__PURE__ */ jsx52("div", { className: "flex flex-col", children: weeks.map((week, wi) => /* @__PURE__ */ jsx52("div", { className: "grid grid-cols-7 gap-base", children: week.map((day, di) => /* @__PURE__ */ jsx52(
7736
+ /* @__PURE__ */ jsx57("div", { className: "flex flex-col", children: weeks.map((week, wi) => /* @__PURE__ */ jsx57("div", { className: "grid grid-cols-7 gap-base", children: week.map((day, di) => /* @__PURE__ */ jsx57(
7444
7737
  DatePickerDay,
7445
7738
  {
7446
7739
  date: day.date,
@@ -7480,7 +7773,7 @@ var DatePickerSuggestions = React50.forwardRef(
7480
7773
  const to = val.to ? formatDate(val.to) : "";
7481
7774
  return to ? `${from} - ${to}` : from;
7482
7775
  };
7483
- return /* @__PURE__ */ jsxs47(
7776
+ return /* @__PURE__ */ jsxs51(
7484
7777
  "div",
7485
7778
  {
7486
7779
  ref,
@@ -7490,16 +7783,16 @@ var DatePickerSuggestions = React50.forwardRef(
7490
7783
  ),
7491
7784
  ...props,
7492
7785
  children: [
7493
- /* @__PURE__ */ jsx52("div", { className: "pt-lg px-base", children: /* @__PURE__ */ jsx52("div", { className: "flex items-center p-base rounded-base", children: /* @__PURE__ */ jsx52("span", { className: "flex-1 text-xs font-semibold leading-xs text-datepicker-suggestion-heading uppercase truncate", children: "Suggestions" }) }) }),
7494
- /* @__PURE__ */ jsx52("div", { className: "flex flex-1 flex-col p-base min-w-[222px]", children: suggestions.map((suggestion, i) => /* @__PURE__ */ jsxs47(
7786
+ /* @__PURE__ */ jsx57("div", { className: "pt-lg px-base", children: /* @__PURE__ */ jsx57("div", { className: "flex items-center p-base rounded-base", children: /* @__PURE__ */ jsx57("span", { className: "flex-1 text-xs font-semibold leading-xs text-datepicker-suggestion-heading uppercase truncate", children: "Suggestions" }) }) }),
7787
+ /* @__PURE__ */ jsx57("div", { className: "flex flex-1 flex-col p-base min-w-[222px]", children: suggestions.map((suggestion, i) => /* @__PURE__ */ jsxs51(
7495
7788
  "button",
7496
7789
  {
7497
7790
  type: "button",
7498
7791
  onClick: () => handleClick(suggestion),
7499
7792
  className: "flex items-center gap-sm p-base rounded-base hover:bg-datepicker-suggestion-hover transition-colors cursor-pointer text-left",
7500
7793
  children: [
7501
- /* @__PURE__ */ jsx52("span", { className: "text-sm font-regular leading-sm text-datepicker-suggestion-text truncate shrink-0", children: suggestion.label }),
7502
- /* @__PURE__ */ jsx52("span", { className: "text-xs font-regular leading-xs text-datepicker-suggestion-date truncate", children: formatSuggestionDate(suggestion) })
7794
+ /* @__PURE__ */ jsx57("span", { className: "text-sm font-regular leading-sm text-datepicker-suggestion-text truncate shrink-0", children: suggestion.label }),
7795
+ /* @__PURE__ */ jsx57("span", { className: "text-xs font-regular leading-xs text-datepicker-suggestion-date truncate", children: formatSuggestionDate(suggestion) })
7503
7796
  ]
7504
7797
  },
7505
7798
  i
@@ -7511,7 +7804,7 @@ var DatePickerSuggestions = React50.forwardRef(
7511
7804
  );
7512
7805
  DatePickerSuggestions.displayName = "DatePickerSuggestions";
7513
7806
  var DatePickerFooter = React50.forwardRef(
7514
- ({ className, children, ...props }, ref) => /* @__PURE__ */ jsx52(
7807
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ jsx57(
7515
7808
  "div",
7516
7809
  {
7517
7810
  ref,
@@ -7528,7 +7821,7 @@ var DatePickerFooter = React50.forwardRef(
7528
7821
  );
7529
7822
  DatePickerFooter.displayName = "DatePickerFooter";
7530
7823
  var DatePickerPanel = React50.forwardRef(
7531
- ({ className, children, ...props }, ref) => /* @__PURE__ */ jsx52(
7824
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ jsx57(
7532
7825
  "div",
7533
7826
  {
7534
7827
  ref,
@@ -7541,7 +7834,7 @@ var DatePickerPanel = React50.forwardRef(
7541
7834
  DatePickerPanel.displayName = "DatePickerPanel";
7542
7835
  var DatePickerRoot = PopoverPrimitive12.Root;
7543
7836
  var DatePickerTrigger = PopoverPrimitive12.Trigger;
7544
- var DatePickerPopover = React50.forwardRef(({ className, sideOffset = 4, align = "start", children, ...props }, ref) => /* @__PURE__ */ jsx52(PopoverPrimitive12.Portal, { children: /* @__PURE__ */ jsx52(
7837
+ var DatePickerPopover = React50.forwardRef(({ className, sideOffset = 4, align = "start", children, ...props }, ref) => /* @__PURE__ */ jsx57(PopoverPrimitive12.Portal, { children: /* @__PURE__ */ jsx57(
7545
7838
  PopoverPrimitive12.Content,
7546
7839
  {
7547
7840
  ref,