@l3mpire/ui 2.16.3 → 2.17.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.js CHANGED
@@ -5360,7 +5360,7 @@ function getValueInputType(type, operator) {
5360
5360
  return ["is any of", "is none of"].includes(operator) ? "MultiRelationPicker" : "RelationPicker";
5361
5361
  return null;
5362
5362
  }
5363
- function formatFilterValue(value) {
5363
+ function formatFilterValue(value, dynamicOptions) {
5364
5364
  if (value == null) return void 0;
5365
5365
  if (typeof value === "boolean") return value ? "Yes" : "No";
5366
5366
  if (value instanceof Date) {
@@ -5379,9 +5379,17 @@ function formatFilterValue(value) {
5379
5379
  const fmt = (d) => d.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
5380
5380
  return `${fmt(value[0])} \u2013 ${value[1] instanceof Date ? fmt(value[1]) : "\u2026"}`;
5381
5381
  }
5382
- return String(value[0]);
5382
+ const resolved = resolveDynamic(String(value[0]), dynamicOptions);
5383
+ return resolved;
5383
5384
  }
5384
- return String(value);
5385
+ return resolveDynamic(String(value), dynamicOptions);
5386
+ }
5387
+ function resolveDynamic(raw, dynamicOptions) {
5388
+ if (dynamicOptions) {
5389
+ const match = dynamicOptions.find((o) => o.value === raw);
5390
+ if (match) return match.label;
5391
+ }
5392
+ return raw;
5385
5393
  }
5386
5394
  function getBadgeCount(value) {
5387
5395
  if (Array.isArray(value) && value.length > 1 && typeof value[0] === "string") {
@@ -5432,6 +5440,23 @@ function updateNodeInTree(nodes, id, updater) {
5432
5440
  return node;
5433
5441
  });
5434
5442
  }
5443
+ function toggleGroupLogicInTree(nodes, id) {
5444
+ const idx = nodes.findIndex((n) => n.id === id);
5445
+ if (idx >= 0) {
5446
+ const current = nodes[idx].logicOperator ?? "and";
5447
+ const next = current === "and" ? "or" : "and";
5448
+ return nodes.map(
5449
+ (n, i) => i === 0 ? n : { ...n, logicOperator: next }
5450
+ );
5451
+ }
5452
+ return nodes.map((node) => {
5453
+ if (isFilterGroup(node)) {
5454
+ const updated = toggleGroupLogicInTree(node.children, id);
5455
+ if (updated !== node.children) return { ...node, children: updated };
5456
+ }
5457
+ return node;
5458
+ });
5459
+ }
5435
5460
  function removeNodeFromTree(nodes, id) {
5436
5461
  const result = [];
5437
5462
  for (const node of nodes) {
@@ -6606,7 +6631,6 @@ var PresetTagsValueInput = ({
6606
6631
  PresetTagsValueInput.displayName = "PresetTagsValueInput";
6607
6632
 
6608
6633
  // src/components/ui/filter/value-inputs/select-value-input.tsx
6609
- var import_icons29 = require("@l3mpire/icons");
6610
6634
  var import_jsx_runtime47 = require("react/jsx-runtime");
6611
6635
  var DynamicOptionRow = ({
6612
6636
  option,
@@ -6643,14 +6667,6 @@ var DynamicOptionRow = ({
6643
6667
  ) })
6644
6668
  }
6645
6669
  ),
6646
- option.icon && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
6647
- import_icons29.Icon,
6648
- {
6649
- icon: option.icon,
6650
- size: "sm",
6651
- className: "shrink-0 mt-[1px] text-[var(--color-interactive-text-primary-dark-default,var(--color-primary))]"
6652
- }
6653
- ),
6654
6670
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "flex-1 flex flex-col gap-2xs min-w-0", children: [
6655
6671
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] truncate", children: option.label }),
6656
6672
  option.description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-xs font-regular leading-xs text-[var(--color-muted-foreground)]", children: option.description })
@@ -6658,7 +6674,6 @@ var DynamicOptionRow = ({
6658
6674
  ]
6659
6675
  }
6660
6676
  );
6661
- var DynamicOptionsDivider = () => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "h-px bg-[var(--color-dropdown-border)] mx-xs my-xs" });
6662
6677
  var SingleSelectValueInput = ({
6663
6678
  value,
6664
6679
  onChange,
@@ -6689,7 +6704,6 @@ var SingleSelectValueInput = ({
6689
6704
  },
6690
6705
  opt.value
6691
6706
  )),
6692
- dynamicOptions && dynamicOptions.length > 0 && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DynamicOptionsDivider, {}),
6693
6707
  options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
6694
6708
  "button",
6695
6709
  {
@@ -6876,7 +6890,7 @@ ValueInput.displayName = "ValueInput";
6876
6890
  // src/components/ui/filter/property-selector.tsx
6877
6891
  var React44 = __toESM(require("react"));
6878
6892
  var PopoverPrimitive6 = __toESM(require("@radix-ui/react-popover"));
6879
- var import_icons30 = require("@l3mpire/icons");
6893
+ var import_icons29 = require("@l3mpire/icons");
6880
6894
  var import_jsx_runtime50 = require("react/jsx-runtime");
6881
6895
  var AdvancedFilterFooter = ({ onClick, count }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
6882
6896
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "h-px bg-[var(--color-dropdown-border)] mx-xs" }),
@@ -6889,9 +6903,9 @@ var AdvancedFilterFooter = ({ onClick, count }) => /* @__PURE__ */ (0, import_js
6889
6903
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
6890
6904
  children: [
6891
6905
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
6892
- import_icons30.Icon,
6906
+ import_icons29.Icon,
6893
6907
  {
6894
- icon: import_icons30.faFilterOutline,
6908
+ icon: import_icons29.faFilterOutline,
6895
6909
  size: "sm",
6896
6910
  className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
6897
6911
  }
@@ -6991,9 +7005,9 @@ var PropertySelector = ({
6991
7005
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-xs", children: [
6992
7006
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-base px-md py-base border border-[var(--color-input)] rounded-md", children: [
6993
7007
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
6994
- import_icons30.Icon,
7008
+ import_icons29.Icon,
6995
7009
  {
6996
- icon: import_icons30.faMagnifyingGlassOutline,
7010
+ icon: import_icons29.faMagnifyingGlassOutline,
6997
7011
  size: "sm",
6998
7012
  className: "shrink-0 text-[var(--color-muted-foreground)]"
6999
7013
  }
@@ -7023,7 +7037,7 @@ var PropertySelector = ({
7023
7037
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
7024
7038
  children: [
7025
7039
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7026
- import_icons30.Icon,
7040
+ import_icons29.Icon,
7027
7041
  {
7028
7042
  icon: prop.icon,
7029
7043
  size: "sm",
@@ -7050,7 +7064,7 @@ var PropertySelector = ({
7050
7064
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
7051
7065
  children: [
7052
7066
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7053
- import_icons30.Icon,
7067
+ import_icons29.Icon,
7054
7068
  {
7055
7069
  icon: g.groupIcon,
7056
7070
  size: "sm",
@@ -7060,9 +7074,9 @@ var PropertySelector = ({
7060
7074
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] text-left truncate", children: g.groupLabel }),
7061
7075
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: g.count }),
7062
7076
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7063
- import_icons30.Icon,
7077
+ import_icons29.Icon,
7064
7078
  {
7065
- icon: import_icons30.faChevronRightOutline,
7079
+ icon: import_icons29.faChevronRightOutline,
7066
7080
  size: "xs",
7067
7081
  className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
7068
7082
  }
@@ -7089,9 +7103,9 @@ var PropertySelector = ({
7089
7103
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
7090
7104
  children: [
7091
7105
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7092
- import_icons30.Icon,
7106
+ import_icons29.Icon,
7093
7107
  {
7094
- icon: import_icons30.faChevronLeftOutline,
7108
+ icon: import_icons29.faChevronLeftOutline,
7095
7109
  size: "sm",
7096
7110
  className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
7097
7111
  }
@@ -7102,9 +7116,9 @@ var PropertySelector = ({
7102
7116
  ),
7103
7117
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-base px-md py-base border border-[var(--color-input)] rounded-md", children: [
7104
7118
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7105
- import_icons30.Icon,
7119
+ import_icons29.Icon,
7106
7120
  {
7107
- icon: import_icons30.faMagnifyingGlassOutline,
7121
+ icon: import_icons29.faMagnifyingGlassOutline,
7108
7122
  size: "sm",
7109
7123
  className: "shrink-0 text-[var(--color-muted-foreground)]"
7110
7124
  }
@@ -7133,7 +7147,7 @@ var PropertySelector = ({
7133
7147
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
7134
7148
  children: [
7135
7149
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7136
- import_icons30.Icon,
7150
+ import_icons29.Icon,
7137
7151
  {
7138
7152
  icon: prop.icon,
7139
7153
  size: "sm",
@@ -7165,7 +7179,7 @@ PropertySelector.displayName = "PropertySelector";
7165
7179
 
7166
7180
  // src/components/ui/filter/kebab-menu.tsx
7167
7181
  var PopoverPrimitive7 = __toESM(require("@radix-ui/react-popover"));
7168
- var import_icons31 = require("@l3mpire/icons");
7182
+ var import_icons30 = require("@l3mpire/icons");
7169
7183
  var import_jsx_runtime51 = require("react/jsx-runtime");
7170
7184
  var KebabMenu = ({
7171
7185
  onConvertToAdvanced,
@@ -7200,9 +7214,9 @@ var KebabMenu = ({
7200
7214
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
7201
7215
  children: [
7202
7216
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
7203
- import_icons31.Icon,
7217
+ import_icons30.Icon,
7204
7218
  {
7205
- icon: import_icons31.faArrowRightOutline,
7219
+ icon: import_icons30.faArrowRightOutline,
7206
7220
  size: "sm",
7207
7221
  className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
7208
7222
  }
@@ -7223,9 +7237,9 @@ var KebabMenu = ({
7223
7237
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
7224
7238
  children: [
7225
7239
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
7226
- import_icons31.Icon,
7240
+ import_icons30.Icon,
7227
7241
  {
7228
- icon: import_icons31.faTrashOutline,
7242
+ icon: import_icons30.faTrashOutline,
7229
7243
  size: "sm",
7230
7244
  className: "shrink-0 text-[var(--color-destructive)]"
7231
7245
  }
@@ -7243,7 +7257,7 @@ KebabMenu.displayName = "KebabMenu";
7243
7257
  // src/components/ui/filter/filter-editor.tsx
7244
7258
  var React45 = __toESM(require("react"));
7245
7259
  var PopoverPrimitive8 = __toESM(require("@radix-ui/react-popover"));
7246
- var import_icons32 = require("@l3mpire/icons");
7260
+ var import_icons31 = require("@l3mpire/icons");
7247
7261
  var import_jsx_runtime52 = require("react/jsx-runtime");
7248
7262
  var FilterEditor = ({
7249
7263
  propertyDef,
@@ -7307,7 +7321,7 @@ var FilterEditor = ({
7307
7321
  children: [
7308
7322
  /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-base px-base pt-base pb-xs border-b border-[var(--color-border)]", children: [
7309
7323
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
7310
- import_icons32.Icon,
7324
+ import_icons31.Icon,
7311
7325
  {
7312
7326
  icon: propertyDef.icon,
7313
7327
  size: "sm",
@@ -7434,7 +7448,7 @@ var InteractiveFilterChip = ({
7434
7448
  setValueOpen(false);
7435
7449
  };
7436
7450
  const hasOperator = !!condition.operator;
7437
- const displayValue = formatFilterValue(condition.value);
7451
+ const displayValue = formatFilterValue(condition.value, propertyDef.dynamicOptions);
7438
7452
  const hasValue = hasOperator && displayValue != null;
7439
7453
  const badgeCount = getBadgeCount(condition.value);
7440
7454
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
@@ -7570,11 +7584,11 @@ InteractiveFilterChip.displayName = "InteractiveFilterChip";
7570
7584
 
7571
7585
  // src/components/ui/filter/filter-system.tsx
7572
7586
  var React54 = __toESM(require("react"));
7573
- var import_icons39 = require("@l3mpire/icons");
7587
+ var import_icons38 = require("@l3mpire/icons");
7574
7588
 
7575
7589
  // src/components/ui/filter/advanced-chip.tsx
7576
7590
  var React47 = __toESM(require("react"));
7577
- var import_icons33 = require("@l3mpire/icons");
7591
+ var import_icons32 = require("@l3mpire/icons");
7578
7592
  var import_jsx_runtime54 = require("react/jsx-runtime");
7579
7593
  var btnBase = [
7580
7594
  "flex items-center justify-center",
@@ -7600,9 +7614,9 @@ var AdvancedChip = React47.forwardRef(
7600
7614
  ...props,
7601
7615
  children: [
7602
7616
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
7603
- import_icons33.Icon,
7617
+ import_icons32.Icon,
7604
7618
  {
7605
- icon: import_icons33.faFilterOutline,
7619
+ icon: import_icons32.faFilterOutline,
7606
7620
  size: "sm",
7607
7621
  className: "shrink-0 text-[var(--color-foreground)]"
7608
7622
  }
@@ -7626,7 +7640,7 @@ var AdvancedChip = React47.forwardRef(
7626
7640
  "rounded-r-md -ml-px"
7627
7641
  ),
7628
7642
  "aria-label": "Clear all advanced filters",
7629
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons33.Icon, { icon: import_icons33.faXmarkOutline, size: "sm", className: "text-[var(--color-foreground)]" })
7643
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons32.Icon, { icon: import_icons32.faXmarkOutline, size: "sm", className: "text-[var(--color-foreground)]" })
7630
7644
  }
7631
7645
  )
7632
7646
  ] })
@@ -7636,17 +7650,17 @@ AdvancedChip.displayName = "AdvancedChip";
7636
7650
  // src/components/ui/filter/advanced-popover.tsx
7637
7651
  var React51 = __toESM(require("react"));
7638
7652
  var PopoverPrimitive12 = __toESM(require("@radix-ui/react-popover"));
7639
- var import_icons37 = require("@l3mpire/icons");
7653
+ var import_icons36 = require("@l3mpire/icons");
7640
7654
 
7641
7655
  // src/components/ui/filter/advanced-row.tsx
7642
7656
  var React49 = __toESM(require("react"));
7643
7657
  var PopoverPrimitive11 = __toESM(require("@radix-ui/react-popover"));
7644
- var import_icons35 = require("@l3mpire/icons");
7658
+ var import_icons34 = require("@l3mpire/icons");
7645
7659
 
7646
7660
  // src/components/ui/filter/filter-node-actions.tsx
7647
7661
  var React48 = __toESM(require("react"));
7648
7662
  var PopoverPrimitive10 = __toESM(require("@radix-ui/react-popover"));
7649
- var import_icons34 = require("@l3mpire/icons");
7663
+ var import_icons33 = require("@l3mpire/icons");
7650
7664
  var import_jsx_runtime55 = require("react/jsx-runtime");
7651
7665
  var FilterNodeActions = ({
7652
7666
  nodeType,
@@ -7658,17 +7672,17 @@ var FilterNodeActions = ({
7658
7672
  const items = [
7659
7673
  {
7660
7674
  label: "Duplicate",
7661
- icon: import_icons34.faCopyOutline,
7675
+ icon: import_icons33.faCopyOutline,
7662
7676
  action: onDuplicate
7663
7677
  },
7664
7678
  {
7665
7679
  label: nodeType === "condition" ? "Turn into group" : "Turn into filter",
7666
- icon: nodeType === "condition" ? import_icons34.faFolderOutline : import_icons34.faFilterOutline,
7680
+ icon: nodeType === "condition" ? import_icons33.faFolderOutline : import_icons33.faFilterOutline,
7667
7681
  action: onConvert
7668
7682
  },
7669
7683
  {
7670
7684
  label: "Delete",
7671
- icon: import_icons34.faTrashOutline,
7685
+ icon: import_icons33.faTrashOutline,
7672
7686
  action: onDelete,
7673
7687
  destructive: true
7674
7688
  }
@@ -7681,9 +7695,9 @@ var FilterNodeActions = ({
7681
7695
  className: "shrink-0 flex items-center justify-center p-sm rounded-md cursor-pointer transition-colors hover:bg-[var(--color-accent)]",
7682
7696
  "aria-label": "More actions",
7683
7697
  children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7684
- import_icons34.Icon,
7698
+ import_icons33.Icon,
7685
7699
  {
7686
- icon: import_icons34.faEllipsisOutline,
7700
+ icon: import_icons33.faEllipsisOutline,
7687
7701
  size: "sm",
7688
7702
  className: "text-[var(--color-foreground)]"
7689
7703
  }
@@ -7717,7 +7731,7 @@ var FilterNodeActions = ({
7717
7731
  ),
7718
7732
  children: [
7719
7733
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7720
- import_icons34.Icon,
7734
+ import_icons33.Icon,
7721
7735
  {
7722
7736
  icon: item.icon,
7723
7737
  size: "sm",
@@ -7784,7 +7798,7 @@ var AdvancedRow = ({
7784
7798
  const handleValueChange = (val) => {
7785
7799
  onUpdate({ ...condition, value: val });
7786
7800
  };
7787
- const displayValue = formatFilterValue(condition.value);
7801
+ const displayValue = formatFilterValue(condition.value, propertyDef.dynamicOptions);
7788
7802
  const badgeCount = getBadgeCount(condition.value);
7789
7803
  const hasValue = displayValue != null;
7790
7804
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-base w-full min-w-0", children: [
@@ -7803,15 +7817,15 @@ var AdvancedRow = ({
7803
7817
  ),
7804
7818
  children: [
7805
7819
  connector,
7806
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons35.Icon, { icon: import_icons35.faRefreshOutline, size: "xs", className: "text-[var(--color-foreground)]" })
7820
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: import_icons34.faRefreshOutline, size: "xs", className: "text-[var(--color-foreground)]" })
7807
7821
  ]
7808
7822
  }
7809
7823
  ),
7810
7824
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(PopoverPrimitive11.Root, { open: propertyOpen, onOpenChange: setPropertyOpen, children: [
7811
7825
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
7812
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons35.Icon, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-[var(--color-muted-foreground)]" }),
7826
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-[var(--color-muted-foreground)]" }),
7813
7827
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap truncate", children: propertyDef.label }),
7814
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons35.Icon, { icon: import_icons35.faChevronDownOutline, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
7828
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: import_icons34.faChevronDownOutline, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
7815
7829
  ] }) }),
7816
7830
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7817
7831
  PopoverPrimitive11.Content,
@@ -7839,7 +7853,7 @@ var AdvancedRow = ({
7839
7853
  p.id === condition.propertyId && "bg-[var(--color-dropdown-item-hover)]"
7840
7854
  ),
7841
7855
  children: [
7842
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons35.Icon, { icon: p.icon, size: "sm", className: "shrink-0 text-[var(--color-dropdown-item-icon)]" }),
7856
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: p.icon, size: "sm", className: "shrink-0 text-[var(--color-dropdown-item-icon)]" }),
7843
7857
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] truncate", children: p.label })
7844
7858
  ]
7845
7859
  },
@@ -7851,7 +7865,7 @@ var AdvancedRow = ({
7851
7865
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(PopoverPrimitive11.Root, { open: operatorOpen, onOpenChange: setOperatorOpen, children: [
7852
7866
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
7853
7867
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap truncate text-left", children: condition.operator ?? "Select" }),
7854
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons35.Icon, { icon: import_icons35.faChevronDownOutline, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
7868
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: import_icons34.faChevronDownOutline, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
7855
7869
  ] }) }),
7856
7870
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7857
7871
  PopoverPrimitive11.Content,
@@ -7902,9 +7916,9 @@ var AdvancedRow = ({
7902
7916
  badgeCount - 1
7903
7917
  ] }),
7904
7918
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7905
- import_icons35.Icon,
7919
+ import_icons34.Icon,
7906
7920
  {
7907
- icon: import_icons35.faChevronDownOutline,
7921
+ icon: import_icons34.faChevronDownOutline,
7908
7922
  size: "xs",
7909
7923
  className: "text-[var(--color-foreground)]"
7910
7924
  }
@@ -7958,7 +7972,7 @@ AdvancedRow.displayName = "AdvancedRow";
7958
7972
 
7959
7973
  // src/components/ui/filter/advanced-group.tsx
7960
7974
  var React50 = __toESM(require("react"));
7961
- var import_icons36 = require("@l3mpire/icons");
7975
+ var import_icons35 = require("@l3mpire/icons");
7962
7976
  var import_jsx_runtime57 = require("react/jsx-runtime");
7963
7977
  var AdvancedGroup = ({
7964
7978
  connector,
@@ -7987,7 +8001,7 @@ var AdvancedGroup = ({
7987
8001
  ),
7988
8002
  children: [
7989
8003
  connector,
7990
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons36.Icon, { icon: import_icons36.faRefreshOutline, size: "xs", className: "text-[var(--color-foreground)]" })
8004
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons35.Icon, { icon: import_icons35.faRefreshOutline, size: "xs", className: "text-[var(--color-foreground)]" })
7991
8005
  ]
7992
8006
  }
7993
8007
  ) }),
@@ -8009,7 +8023,7 @@ var AdvancedGroup = ({
8009
8023
  type: "button",
8010
8024
  className: "flex items-center gap-sm px-base py-sm text-sm font-semibold leading-sm text-[var(--color-muted-foreground)] cursor-pointer transition-colors rounded-md hover:bg-[var(--color-accent)] hover:text-[var(--color-foreground)] w-fit",
8011
8025
  children: [
8012
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons36.Icon, { icon: import_icons36.faPlusOutline, size: "sm" }),
8026
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons35.Icon, { icon: import_icons35.faPlusOutline, size: "sm" }),
8013
8027
  "Add filter"
8014
8028
  ]
8015
8029
  }
@@ -8124,12 +8138,7 @@ var AdvancedPopover = ({
8124
8138
  }
8125
8139
  };
8126
8140
  const toggleLogicOp = (id) => {
8127
- onFiltersChange(
8128
- updateNodeInTree(filters, id, (n) => ({
8129
- ...n,
8130
- logicOperator: (n.logicOperator ?? "and") === "and" ? "or" : "and"
8131
- }))
8132
- );
8141
+ onFiltersChange(toggleGroupLogicInTree(filters, id));
8133
8142
  };
8134
8143
  const handleGroupChildrenChange = (groupId, children2) => {
8135
8144
  onFiltersChange(
@@ -8229,7 +8238,7 @@ var AdvancedPopover = ({
8229
8238
  open: addSelectorOpen,
8230
8239
  onOpenChange: setAddSelectorOpen,
8231
8240
  children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("button", { type: "button", className: cn(ghostBtn, "text-[var(--color-foreground)]"), children: [
8232
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons37.Icon, { icon: import_icons37.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
8241
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons36.Icon, { icon: import_icons36.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
8233
8242
  "Add filter"
8234
8243
  ] })
8235
8244
  }
@@ -8241,7 +8250,7 @@ var AdvancedPopover = ({
8241
8250
  onClick: handleAddGroup,
8242
8251
  className: cn(ghostBtn, "text-[var(--color-foreground)]"),
8243
8252
  children: [
8244
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons37.Icon, { icon: import_icons37.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
8253
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons36.Icon, { icon: import_icons36.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
8245
8254
  "Add filters group"
8246
8255
  ]
8247
8256
  }
@@ -8254,7 +8263,7 @@ var AdvancedPopover = ({
8254
8263
  onClick: handleClearAll,
8255
8264
  className: cn(ghostBtn, "text-[var(--color-destructive,#ef4444)]"),
8256
8265
  children: [
8257
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons37.Icon, { icon: import_icons37.faXmarkOutline, size: "sm", className: "text-[var(--color-destructive,#ef4444)]" }),
8266
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons36.Icon, { icon: import_icons36.faXmarkOutline, size: "sm", className: "text-[var(--color-destructive,#ef4444)]" }),
8258
8267
  "Clear filters"
8259
8268
  ]
8260
8269
  }
@@ -8305,9 +8314,9 @@ var DraftRow = ({
8305
8314
  children: [
8306
8315
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-muted-foreground)] whitespace-nowrap", children: "Select property" }),
8307
8316
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
8308
- import_icons37.Icon,
8317
+ import_icons36.Icon,
8309
8318
  {
8310
- icon: import_icons37.faChevronDownOutline,
8319
+ icon: import_icons36.faChevronDownOutline,
8311
8320
  size: "xs",
8312
8321
  className: "shrink-0 text-[var(--color-foreground)]"
8313
8322
  }
@@ -8323,7 +8332,7 @@ var DraftRow = ({
8323
8332
  // src/components/ui/filter/summary-chip.tsx
8324
8333
  var React52 = __toESM(require("react"));
8325
8334
  var PopoverPrimitive13 = __toESM(require("@radix-ui/react-popover"));
8326
- var import_icons38 = require("@l3mpire/icons");
8335
+ var import_icons37 = require("@l3mpire/icons");
8327
8336
  var import_jsx_runtime59 = require("react/jsx-runtime");
8328
8337
  var ghostBtn2 = [
8329
8338
  "flex items-center gap-sm px-base py-sm",
@@ -8418,12 +8427,7 @@ var SummaryChip = ({
8418
8427
  }
8419
8428
  };
8420
8429
  const toggleLogicOp = (id) => {
8421
- onFiltersChange(
8422
- updateNodeInTree(filters, id, (n) => ({
8423
- ...n,
8424
- logicOperator: (n.logicOperator ?? "and") === "and" ? "or" : "and"
8425
- }))
8426
- );
8430
+ onFiltersChange(toggleGroupLogicInTree(filters, id));
8427
8431
  };
8428
8432
  const handleGroupChildrenChange = (groupId, newChildren) => {
8429
8433
  onFiltersChange(
@@ -8501,7 +8505,7 @@ var SummaryChip = ({
8501
8505
  className
8502
8506
  ),
8503
8507
  children: [
8504
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons38.Icon, { icon: import_icons38.faFilterOutline, size: "sm", className: "shrink-0 text-[var(--color-foreground)]" }),
8508
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons37.Icon, { icon: import_icons37.faFilterOutline, size: "sm", className: "shrink-0 text-[var(--color-foreground)]" }),
8505
8509
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-sm font-semibold leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: "Filters" }),
8506
8510
  count > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-[10px] font-semibold leading-2xs text-filter-chip-badge-text", children: count }) })
8507
8511
  ]
@@ -8542,13 +8546,13 @@ var SummaryChip = ({
8542
8546
  open: addSelectorOpen,
8543
8547
  onOpenChange: setAddSelectorOpen,
8544
8548
  children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("button", { type: "button", className: cn(ghostBtn2, "text-[var(--color-foreground)]"), children: [
8545
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons38.Icon, { icon: import_icons38.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
8549
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons37.Icon, { icon: import_icons37.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
8546
8550
  "Add filter"
8547
8551
  ] })
8548
8552
  }
8549
8553
  ),
8550
8554
  /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("button", { type: "button", onClick: handleAddGroup, className: cn(ghostBtn2, "text-[var(--color-foreground)]"), children: [
8551
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons38.Icon, { icon: import_icons38.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
8555
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons37.Icon, { icon: import_icons37.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
8552
8556
  "Add filters group"
8553
8557
  ] })
8554
8558
  ] }),
@@ -8562,7 +8566,7 @@ var SummaryChip = ({
8562
8566
  },
8563
8567
  className: cn(ghostBtn2, "text-[var(--color-destructive,#ef4444)]"),
8564
8568
  children: [
8565
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons38.Icon, { icon: import_icons38.faXmarkOutline, size: "sm", className: "text-[var(--color-destructive,#ef4444)]" }),
8569
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons37.Icon, { icon: import_icons37.faXmarkOutline, size: "sm", className: "text-[var(--color-destructive,#ef4444)]" }),
8566
8570
  "Clear filters"
8567
8571
  ]
8568
8572
  }
@@ -8599,7 +8603,7 @@ var DraftRow2 = ({ properties, onSelect, open: openProp, onOpenChange }) => {
8599
8603
  ),
8600
8604
  children: [
8601
8605
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-muted-foreground)] whitespace-nowrap", children: "Select property" }),
8602
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons38.Icon, { icon: import_icons38.faChevronDownOutline, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
8606
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons37.Icon, { icon: import_icons37.faChevronDownOutline, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
8603
8607
  ]
8604
8608
  }
8605
8609
  ) })
@@ -8716,7 +8720,8 @@ var FilterSystem = ({
8716
8720
  };
8717
8721
  const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
8718
8722
  const hasAdvanced = filterState.advancedFilters.length > 0;
8719
- const isMinimal = mode === "minimal";
8723
+ const isMinimal = mode === "minimal" || mode === "icon";
8724
+ const isIconOnly = mode === "icon";
8720
8725
  const handleOpenAdvanced = () => {
8721
8726
  setPropertySelectorOpen(false);
8722
8727
  requestAnimationFrame(() => {
@@ -8729,7 +8734,6 @@ var FilterSystem = ({
8729
8734
  };
8730
8735
  const advancedFilterCount = filterState.advancedFilters.length;
8731
8736
  const showAdvancedChip = hasAdvanced || advancedOpen;
8732
- const showSummaryChip = totalCount > 0 || summaryOpen;
8733
8737
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(FilterBar, { ref: containerRef, className, children: [
8734
8738
  /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(FilterBarLeft, { className: "flex-nowrap flex-1 min-w-0 overflow-x-auto scrollbar-none outline-none [&>*]:shrink-0", children: [
8735
8739
  children,
@@ -8743,38 +8747,32 @@ var FilterSystem = ({
8743
8747
  iconOnly: isMinimal
8744
8748
  }
8745
8749
  ),
8746
- isMinimal ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
8747
- showSummaryChip && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8748
- SummaryChip,
8749
- {
8750
- count: totalCount,
8751
- filters: [...filterState.basicFilters, ...filterState.advancedFilters],
8752
- properties,
8753
- onFiltersChange: (nodes) => {
8754
- onFilterStateChange({
8755
- ...filterState,
8756
- basicFilters: [],
8757
- advancedFilters: nodes
8758
- });
8759
- },
8760
- onClearAll: handleClearAll,
8761
- open: summaryOpen,
8762
- onOpenChange: setSummaryOpen
8763
- }
8764
- ),
8765
- !showSummaryChip && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8766
- PropertySelector,
8767
- {
8768
- properties,
8769
- onSelect: handleAddFilter,
8770
- open: propertySelectorOpen,
8771
- onOpenChange: setPropertySelectorOpen,
8772
- onAdvancedFilter: handleOpenAdvanced,
8773
- advancedFilterCount,
8774
- children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FilterBarButton, { iconOnly: true })
8775
- }
8776
- )
8777
- ] }) : (
8750
+ isMinimal ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_jsx_runtime60.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8751
+ SummaryChip,
8752
+ {
8753
+ count: totalCount,
8754
+ filters: [...filterState.basicFilters, ...filterState.advancedFilters],
8755
+ properties,
8756
+ onFiltersChange: (nodes) => {
8757
+ onFilterStateChange({
8758
+ ...filterState,
8759
+ basicFilters: [],
8760
+ advancedFilters: nodes
8761
+ });
8762
+ },
8763
+ onClearAll: handleClearAll,
8764
+ open: summaryOpen,
8765
+ onOpenChange: setSummaryOpen,
8766
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8767
+ FilterBarButton,
8768
+ {
8769
+ iconOnly: isIconOnly,
8770
+ count: totalCount > 0 ? totalCount : void 0,
8771
+ title: buildFilterSummary(filterState.basicFilters, filterState.advancedFilters.length, properties)
8772
+ }
8773
+ )
8774
+ }
8775
+ ) }) : (
8778
8776
  /* ── DEFAULT MODE ────────────────────────────────────── */
8779
8777
  /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
8780
8778
  showAdvancedChip && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
@@ -8828,20 +8826,20 @@ var FilterSystem = ({
8828
8826
  {
8829
8827
  type: "button",
8830
8828
  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)]",
8831
- children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_icons39.Icon, { icon: import_icons39.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" })
8829
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_icons38.Icon, { icon: import_icons38.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" })
8832
8830
  }
8833
8831
  ) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FilterBarButton, {})
8834
8832
  }
8835
8833
  )
8836
8834
  ] })
8837
8835
  ),
8838
- totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8836
+ totalCount > 0 && !isIconOnly && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8839
8837
  "button",
8840
8838
  {
8841
8839
  type: "button",
8842
8840
  onClick: handleClearAll,
8843
- 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)]",
8844
- children: isMinimal ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_icons39.Icon, { icon: import_icons39.faXmarkOutline, size: "sm", className: "text-[var(--color-foreground)]" }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "text-sm font-semibold leading-sm text-[var(--color-foreground)]", children: "Clear" })
8841
+ className: "shrink-0 flex items-center gap-sm px-base py-sm min-h-[32px] max-h-[32px] rounded-md cursor-pointer transition-colors text-btn-ghost-brand-text-default hover:bg-btn-ghost-brand-bg-hover hover:text-btn-ghost-brand-text-hover active:bg-btn-ghost-brand-bg-pressed active:text-btn-ghost-brand-text-pressed",
8842
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "text-sm font-semibold leading-sm", children: "Clear" })
8845
8843
  }
8846
8844
  )
8847
8845
  ] }),
@@ -8849,6 +8847,20 @@ var FilterSystem = ({
8849
8847
  ] });
8850
8848
  };
8851
8849
  FilterSystem.displayName = "FilterSystem";
8850
+ function buildFilterSummary(filters, advancedCount, properties) {
8851
+ if (filters.length === 0 && advancedCount === 0) return void 0;
8852
+ const lines = [];
8853
+ for (const f of filters) {
8854
+ const prop = properties.find((p) => p.id === f.propertyId);
8855
+ if (!prop) continue;
8856
+ const val = formatFilterValue(f.value, prop.dynamicOptions);
8857
+ lines.push(val ? `${prop.label} ${f.operator} ${val}` : `${prop.label} ${f.operator ?? ""}`);
8858
+ }
8859
+ if (advancedCount > 0) {
8860
+ lines.push(`+ ${advancedCount} advanced filter${advancedCount > 1 ? "s" : ""}`);
8861
+ }
8862
+ return lines.join("\n");
8863
+ }
8852
8864
  // Annotate the CommonJS export names for ESM import in node:
8853
8865
  0 && (module.exports = {
8854
8866
  AdvancedChip,