@l3mpire/ui 2.22.0 → 2.23.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
@@ -5217,7 +5217,7 @@ var FilterChipSegment = React36.forwardRef(
5217
5217
  ),
5218
5218
  ...props,
5219
5219
  children: [
5220
- adornment && segmentType === "value" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "shrink-0 size-5", children: adornment }),
5220
+ adornment && segmentType === "value" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "shrink-0 inline-flex items-center justify-center leading-none", children: adornment }),
5221
5221
  icon && segmentType === "property" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5222
5222
  import_icons23.Icon,
5223
5223
  {
@@ -5322,6 +5322,23 @@ var FilterChip = React37.forwardRef(
5322
5322
  FilterChip.displayName = "FilterChip";
5323
5323
 
5324
5324
  // src/components/ui/filter/utils.ts
5325
+ function resolveEnumOption(opt) {
5326
+ if (typeof opt === "string") return { value: opt, label: opt };
5327
+ return {
5328
+ value: opt.value,
5329
+ label: opt.label ?? opt.value,
5330
+ icon: opt.icon,
5331
+ intent: opt.intent
5332
+ };
5333
+ }
5334
+ function findEnumOption(value, options) {
5335
+ if (!options) return void 0;
5336
+ for (const opt of options) {
5337
+ const r = resolveEnumOption(opt);
5338
+ if (r.value === value) return r;
5339
+ }
5340
+ return void 0;
5341
+ }
5325
5342
  var OPERATORS_BY_TYPE = {
5326
5343
  text: [
5327
5344
  "contains",
@@ -5397,7 +5414,7 @@ function getValueInputType(type, operator) {
5397
5414
  return ["is any of", "is none of"].includes(operator) ? "MultiRelationPicker" : "RelationPicker";
5398
5415
  return null;
5399
5416
  }
5400
- function formatFilterValue(value, dynamicOptions, full) {
5417
+ function formatFilterValue(value, dynamicOptions, full, options) {
5401
5418
  if (value == null) return void 0;
5402
5419
  if (typeof value === "boolean") return value ? "Yes" : "No";
5403
5420
  if (value instanceof Date) {
@@ -5417,18 +5434,19 @@ function formatFilterValue(value, dynamicOptions, full) {
5417
5434
  return `${fmt(value[0])} \u2013 ${value[1] instanceof Date ? fmt(value[1]) : "\u2026"}`;
5418
5435
  }
5419
5436
  if (full) {
5420
- return value.map((v) => resolveDynamic(String(v), dynamicOptions)).join(", ");
5437
+ return value.map((v) => resolveLabel(String(v), dynamicOptions, options)).join(", ");
5421
5438
  }
5422
- const resolved = resolveDynamic(String(value[0]), dynamicOptions);
5423
- return resolved;
5439
+ return resolveLabel(String(value[0]), dynamicOptions, options);
5424
5440
  }
5425
- return resolveDynamic(String(value), dynamicOptions);
5441
+ return resolveLabel(String(value), dynamicOptions, options);
5426
5442
  }
5427
- function resolveDynamic(raw, dynamicOptions) {
5443
+ function resolveLabel(raw, dynamicOptions, options) {
5428
5444
  if (dynamicOptions) {
5429
- const match = dynamicOptions.find((o) => o.value === raw);
5430
- if (match) return match.label;
5445
+ const dyn = dynamicOptions.find((o) => o.value === raw);
5446
+ if (dyn) return dyn.label;
5431
5447
  }
5448
+ const enumOpt = findEnumOption(raw, options);
5449
+ if (enumOpt) return enumOpt.label;
5432
5450
  return raw;
5433
5451
  }
5434
5452
  function getBadgeCount(value) {
@@ -6672,7 +6690,41 @@ var PresetTagsValueInput = ({
6672
6690
  PresetTagsValueInput.displayName = "PresetTagsValueInput";
6673
6691
 
6674
6692
  // src/components/ui/filter/value-inputs/select-value-input.tsx
6693
+ var import_icons29 = require("@l3mpire/icons");
6675
6694
  var import_jsx_runtime47 = require("react/jsx-runtime");
6695
+ var intentDotClass = {
6696
+ primary: "bg-primary",
6697
+ success: "bg-success",
6698
+ warning: "bg-warning",
6699
+ critical: "bg-destructive",
6700
+ neutral: "bg-muted-foreground"
6701
+ };
6702
+ var IntentDot = ({ intent }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
6703
+ "span",
6704
+ {
6705
+ className: cn(
6706
+ "shrink-0 size-2 rounded-full",
6707
+ intentDotClass[intent]
6708
+ ),
6709
+ "aria-hidden": true
6710
+ }
6711
+ );
6712
+ var OptionLeading = ({ option }) => {
6713
+ if (option.icon) {
6714
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
6715
+ import_icons29.Icon,
6716
+ {
6717
+ icon: option.icon,
6718
+ size: "sm",
6719
+ className: "shrink-0 text-dropdown-item-icon"
6720
+ }
6721
+ );
6722
+ }
6723
+ if (option.intent) {
6724
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(IntentDot, { intent: option.intent });
6725
+ }
6726
+ return null;
6727
+ };
6676
6728
  var DynamicOptionRow = ({
6677
6729
  option,
6678
6730
  selected,
@@ -6745,20 +6797,26 @@ var SingleSelectValueInput = ({
6745
6797
  },
6746
6798
  opt.value
6747
6799
  )),
6748
- options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
6749
- "button",
6750
- {
6751
- type: "button",
6752
- onClick: () => pick(opt),
6753
- className: cn(
6754
- "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
6755
- "hover:bg-dropdown-item-hover",
6756
- value === opt && "bg-dropdown-item-hover"
6757
- ),
6758
- children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-sm font-regular leading-sm text-foreground", children: opt })
6759
- },
6760
- opt
6761
- ))
6800
+ options.map((rawOpt) => {
6801
+ const opt = resolveEnumOption(rawOpt);
6802
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
6803
+ "button",
6804
+ {
6805
+ type: "button",
6806
+ onClick: () => pick(opt.value),
6807
+ className: cn(
6808
+ "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
6809
+ "hover:bg-dropdown-item-hover",
6810
+ value === opt.value && "bg-dropdown-item-hover"
6811
+ ),
6812
+ children: [
6813
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(OptionLeading, { option: opt }),
6814
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-sm font-regular leading-sm text-foreground truncate", children: opt.label })
6815
+ ]
6816
+ },
6817
+ opt.value
6818
+ );
6819
+ })
6762
6820
  ]
6763
6821
  }
6764
6822
  );
@@ -6789,13 +6847,14 @@ var MultiSelectValueInput = ({
6789
6847
  },
6790
6848
  opt.value
6791
6849
  )),
6792
- options.map((opt) => {
6793
- const isSelected = selected.includes(opt);
6850
+ options.map((rawOpt) => {
6851
+ const opt = resolveEnumOption(rawOpt);
6852
+ const isSelected = selected.includes(opt.value);
6794
6853
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
6795
6854
  "button",
6796
6855
  {
6797
6856
  type: "button",
6798
- onClick: () => toggle(opt),
6857
+ onClick: () => toggle(opt.value),
6799
6858
  className: cn(
6800
6859
  "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
6801
6860
  "hover:bg-dropdown-item-hover"
@@ -6805,7 +6864,7 @@ var MultiSelectValueInput = ({
6805
6864
  "span",
6806
6865
  {
6807
6866
  className: cn(
6808
- "flex items-center justify-center size-4 rounded-xs border transition-colors",
6867
+ "flex items-center justify-center size-4 rounded-xs border transition-colors shrink-0",
6809
6868
  isSelected ? "bg-primary border-primary" : "border-input bg-background"
6810
6869
  ),
6811
6870
  children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
@@ -6820,10 +6879,11 @@ var MultiSelectValueInput = ({
6820
6879
  ) })
6821
6880
  }
6822
6881
  ),
6823
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-sm font-regular leading-sm text-foreground", children: opt })
6882
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(OptionLeading, { option: opt }),
6883
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-sm font-regular leading-sm text-foreground truncate", children: opt.label })
6824
6884
  ]
6825
6885
  },
6826
- opt
6886
+ opt.value
6827
6887
  );
6828
6888
  })
6829
6889
  ] }),
@@ -6930,7 +6990,7 @@ ValueInput.displayName = "ValueInput";
6930
6990
  // src/components/ui/filter/property-selector.tsx
6931
6991
  var React44 = __toESM(require("react"));
6932
6992
  var PopoverPrimitive6 = __toESM(require("@radix-ui/react-popover"));
6933
- var import_icons29 = require("@l3mpire/icons");
6993
+ var import_icons30 = require("@l3mpire/icons");
6934
6994
  var import_jsx_runtime50 = require("react/jsx-runtime");
6935
6995
  var AdvancedFilterFooter = ({ onClick, count }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "shrink-0 flex flex-col", children: [
6936
6996
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "h-px bg-dropdown-border mx-xs" }),
@@ -6943,9 +7003,9 @@ var AdvancedFilterFooter = ({ onClick, count }) => /* @__PURE__ */ (0, import_js
6943
7003
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
6944
7004
  children: [
6945
7005
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
6946
- import_icons29.Icon,
7006
+ import_icons30.Icon,
6947
7007
  {
6948
- icon: import_icons29.faFilterOutline,
7008
+ icon: import_icons30.faFilterOutline,
6949
7009
  size: "sm",
6950
7010
  className: "shrink-0 text-dropdown-item-icon"
6951
7011
  }
@@ -7065,9 +7125,9 @@ var PropertySelector = ({
7065
7125
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-xs flex-1 min-h-0", children: [
7066
7126
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "shrink-0 flex items-center gap-base px-md py-base border border-input rounded-md", children: [
7067
7127
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7068
- import_icons29.Icon,
7128
+ import_icons30.Icon,
7069
7129
  {
7070
- icon: import_icons29.faMagnifyingGlassOutline,
7130
+ icon: import_icons30.faMagnifyingGlassOutline,
7071
7131
  size: "sm",
7072
7132
  className: "shrink-0 text-muted-foreground"
7073
7133
  }
@@ -7096,7 +7156,7 @@ var PropertySelector = ({
7096
7156
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
7097
7157
  children: [
7098
7158
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7099
- import_icons29.Icon,
7159
+ import_icons30.Icon,
7100
7160
  {
7101
7161
  icon: prop.icon,
7102
7162
  size: "sm",
@@ -7121,7 +7181,7 @@ var PropertySelector = ({
7121
7181
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
7122
7182
  children: [
7123
7183
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7124
- import_icons29.Icon,
7184
+ import_icons30.Icon,
7125
7185
  {
7126
7186
  icon: prop.icon,
7127
7187
  size: "sm",
@@ -7147,7 +7207,7 @@ var PropertySelector = ({
7147
7207
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
7148
7208
  children: [
7149
7209
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7150
- import_icons29.Icon,
7210
+ import_icons30.Icon,
7151
7211
  {
7152
7212
  icon: g.groupIcon,
7153
7213
  size: "sm",
@@ -7157,9 +7217,9 @@ var PropertySelector = ({
7157
7217
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-dropdown-item-text text-left truncate", children: g.groupLabel }),
7158
7218
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-xs font-medium leading-xs text-muted-foreground", children: g.count }),
7159
7219
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7160
- import_icons29.Icon,
7220
+ import_icons30.Icon,
7161
7221
  {
7162
- icon: import_icons29.faChevronRightOutline,
7222
+ icon: import_icons30.faChevronRightOutline,
7163
7223
  size: "xs",
7164
7224
  className: "shrink-0 text-dropdown-item-icon"
7165
7225
  }
@@ -7186,9 +7246,9 @@ var PropertySelector = ({
7186
7246
  className: "shrink-0 flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
7187
7247
  children: [
7188
7248
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7189
- import_icons29.Icon,
7249
+ import_icons30.Icon,
7190
7250
  {
7191
- icon: import_icons29.faChevronLeftOutline,
7251
+ icon: import_icons30.faChevronLeftOutline,
7192
7252
  size: "sm",
7193
7253
  className: "shrink-0 text-dropdown-item-icon"
7194
7254
  }
@@ -7199,9 +7259,9 @@ var PropertySelector = ({
7199
7259
  ),
7200
7260
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "shrink-0 flex items-center gap-base px-md py-base border border-input rounded-md", children: [
7201
7261
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7202
- import_icons29.Icon,
7262
+ import_icons30.Icon,
7203
7263
  {
7204
- icon: import_icons29.faMagnifyingGlassOutline,
7264
+ icon: import_icons30.faMagnifyingGlassOutline,
7205
7265
  size: "sm",
7206
7266
  className: "shrink-0 text-muted-foreground"
7207
7267
  }
@@ -7230,7 +7290,7 @@ var PropertySelector = ({
7230
7290
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
7231
7291
  children: [
7232
7292
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
7233
- import_icons29.Icon,
7293
+ import_icons30.Icon,
7234
7294
  {
7235
7295
  icon: prop.icon,
7236
7296
  size: "sm",
@@ -7262,7 +7322,7 @@ PropertySelector.displayName = "PropertySelector";
7262
7322
 
7263
7323
  // src/components/ui/filter/kebab-menu.tsx
7264
7324
  var PopoverPrimitive7 = __toESM(require("@radix-ui/react-popover"));
7265
- var import_icons30 = require("@l3mpire/icons");
7325
+ var import_icons31 = require("@l3mpire/icons");
7266
7326
  var import_jsx_runtime51 = require("react/jsx-runtime");
7267
7327
  var KebabMenu = ({
7268
7328
  onConvertToAdvanced,
@@ -7298,9 +7358,9 @@ var KebabMenu = ({
7298
7358
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
7299
7359
  children: [
7300
7360
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
7301
- import_icons30.Icon,
7361
+ import_icons31.Icon,
7302
7362
  {
7303
- icon: import_icons30.faArrowRightOutline,
7363
+ icon: import_icons31.faArrowRightOutline,
7304
7364
  size: "sm",
7305
7365
  className: "shrink-0 text-dropdown-item-icon"
7306
7366
  }
@@ -7321,9 +7381,9 @@ var KebabMenu = ({
7321
7381
  className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
7322
7382
  children: [
7323
7383
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
7324
- import_icons30.Icon,
7384
+ import_icons31.Icon,
7325
7385
  {
7326
- icon: import_icons30.faTrashOutline,
7386
+ icon: import_icons31.faTrashOutline,
7327
7387
  size: "sm",
7328
7388
  className: "shrink-0 text-destructive"
7329
7389
  }
@@ -7341,7 +7401,7 @@ KebabMenu.displayName = "KebabMenu";
7341
7401
  // src/components/ui/filter/filter-editor.tsx
7342
7402
  var React45 = __toESM(require("react"));
7343
7403
  var PopoverPrimitive8 = __toESM(require("@radix-ui/react-popover"));
7344
- var import_icons31 = require("@l3mpire/icons");
7404
+ var import_icons32 = require("@l3mpire/icons");
7345
7405
  var import_jsx_runtime52 = require("react/jsx-runtime");
7346
7406
  var FilterEditor = ({
7347
7407
  propertyDef,
@@ -7405,7 +7465,7 @@ var FilterEditor = ({
7405
7465
  children: [
7406
7466
  /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-base px-base pt-base pb-xs border-b border-border", children: [
7407
7467
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
7408
- import_icons31.Icon,
7468
+ import_icons32.Icon,
7409
7469
  {
7410
7470
  icon: propertyDef.icon,
7411
7471
  size: "sm",
@@ -7455,6 +7515,7 @@ FilterEditor.displayName = "FilterEditor";
7455
7515
  // src/components/ui/filter/interactive-filter-chip.tsx
7456
7516
  var React46 = __toESM(require("react"));
7457
7517
  var PopoverPrimitive9 = __toESM(require("@radix-ui/react-popover"));
7518
+ var import_icons33 = require("@l3mpire/icons");
7458
7519
  var import_jsx_runtime53 = require("react/jsx-runtime");
7459
7520
  var SegmentPopover = ({
7460
7521
  open,
@@ -7533,9 +7594,31 @@ var InteractiveFilterChip = ({
7533
7594
  setValueOpen(false);
7534
7595
  };
7535
7596
  const hasOperator = !!condition.operator;
7536
- const displayValue = formatFilterValue(condition.value, propertyDef.dynamicOptions);
7597
+ const displayValue = formatFilterValue(
7598
+ condition.value,
7599
+ propertyDef.dynamicOptions,
7600
+ false,
7601
+ propertyDef.options
7602
+ );
7537
7603
  const hasValue = hasOperator && displayValue != null;
7538
7604
  const badgeCount = getBadgeCount(condition.value);
7605
+ const valueLeading = React46.useMemo(() => {
7606
+ const v = condition.value;
7607
+ const raw = typeof v === "string" ? v : Array.isArray(v) && typeof v[0] === "string" ? v[0] : null;
7608
+ if (!raw) return null;
7609
+ const opt = findEnumOption(raw, propertyDef.options);
7610
+ if (opt?.icon) {
7611
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
7612
+ import_icons33.Icon,
7613
+ {
7614
+ icon: opt.icon,
7615
+ size: "sm",
7616
+ className: "shrink-0 text-filter-chip-segment-icon"
7617
+ }
7618
+ );
7619
+ }
7620
+ return null;
7621
+ }, [condition.value, propertyDef.options]);
7539
7622
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
7540
7623
  "div",
7541
7624
  {
@@ -7616,6 +7699,7 @@ var InteractiveFilterChip = ({
7616
7699
  hasBorder: true,
7617
7700
  label: hasValue ? displayValue : "Enter value",
7618
7701
  badgeCount,
7702
+ adornment: hasValue ? valueLeading : void 0,
7619
7703
  onClick: () => setValueOpen(true)
7620
7704
  }
7621
7705
  ) }),
@@ -7670,11 +7754,11 @@ InteractiveFilterChip.displayName = "InteractiveFilterChip";
7670
7754
 
7671
7755
  // src/components/ui/filter/filter-system.tsx
7672
7756
  var React54 = __toESM(require("react"));
7673
- var import_icons38 = require("@l3mpire/icons");
7757
+ var import_icons40 = require("@l3mpire/icons");
7674
7758
 
7675
7759
  // src/components/ui/filter/advanced-chip.tsx
7676
7760
  var React47 = __toESM(require("react"));
7677
- var import_icons32 = require("@l3mpire/icons");
7761
+ var import_icons34 = require("@l3mpire/icons");
7678
7762
  var import_jsx_runtime54 = require("react/jsx-runtime");
7679
7763
  var btnBase = [
7680
7764
  "flex items-center justify-center",
@@ -7700,9 +7784,9 @@ var AdvancedChip = React47.forwardRef(
7700
7784
  ...props,
7701
7785
  children: [
7702
7786
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
7703
- import_icons32.Icon,
7787
+ import_icons34.Icon,
7704
7788
  {
7705
- icon: import_icons32.faFilterOutline,
7789
+ icon: import_icons34.faFilterOutline,
7706
7790
  size: "sm",
7707
7791
  className: "shrink-0 text-foreground"
7708
7792
  }
@@ -7726,7 +7810,7 @@ var AdvancedChip = React47.forwardRef(
7726
7810
  "rounded-r-md -ml-px"
7727
7811
  ),
7728
7812
  "aria-label": "Clear all advanced filters",
7729
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons32.Icon, { icon: import_icons32.faXmarkOutline, size: "sm", className: "text-foreground" })
7813
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons34.Icon, { icon: import_icons34.faXmarkOutline, size: "sm", className: "text-foreground" })
7730
7814
  }
7731
7815
  )
7732
7816
  ] })
@@ -7736,18 +7820,18 @@ AdvancedChip.displayName = "AdvancedChip";
7736
7820
  // src/components/ui/filter/advanced-popover.tsx
7737
7821
  var React51 = __toESM(require("react"));
7738
7822
  var PopoverPrimitive12 = __toESM(require("@radix-ui/react-popover"));
7739
- var import_icons36 = require("@l3mpire/icons");
7823
+ var import_icons38 = require("@l3mpire/icons");
7740
7824
 
7741
7825
  // src/components/ui/filter/advanced-row.tsx
7742
7826
  var React49 = __toESM(require("react"));
7743
7827
  var PopoverPrimitive11 = __toESM(require("@radix-ui/react-popover"));
7744
7828
  var TooltipPrimitive4 = __toESM(require("@radix-ui/react-tooltip"));
7745
- var import_icons34 = require("@l3mpire/icons");
7829
+ var import_icons36 = require("@l3mpire/icons");
7746
7830
 
7747
7831
  // src/components/ui/filter/filter-node-actions.tsx
7748
7832
  var React48 = __toESM(require("react"));
7749
7833
  var PopoverPrimitive10 = __toESM(require("@radix-ui/react-popover"));
7750
- var import_icons33 = require("@l3mpire/icons");
7834
+ var import_icons35 = require("@l3mpire/icons");
7751
7835
  var import_jsx_runtime55 = require("react/jsx-runtime");
7752
7836
  var FilterNodeActions = ({
7753
7837
  nodeType,
@@ -7759,17 +7843,17 @@ var FilterNodeActions = ({
7759
7843
  const items = [
7760
7844
  {
7761
7845
  label: "Duplicate",
7762
- icon: import_icons33.faCopyOutline,
7846
+ icon: import_icons35.faCopyOutline,
7763
7847
  action: onDuplicate
7764
7848
  },
7765
7849
  {
7766
7850
  label: nodeType === "condition" ? "Turn into group" : "Turn into filter",
7767
- icon: nodeType === "condition" ? import_icons33.faFolderOutline : import_icons33.faFilterOutline,
7851
+ icon: nodeType === "condition" ? import_icons35.faFolderOutline : import_icons35.faFilterOutline,
7768
7852
  action: onConvert
7769
7853
  },
7770
7854
  {
7771
7855
  label: "Delete",
7772
- icon: import_icons33.faTrashOutline,
7856
+ icon: import_icons35.faTrashOutline,
7773
7857
  action: onDelete,
7774
7858
  destructive: true
7775
7859
  }
@@ -7782,9 +7866,9 @@ var FilterNodeActions = ({
7782
7866
  className: "shrink-0 flex items-center justify-center p-sm rounded-md cursor-pointer transition-colors hover:bg-accent",
7783
7867
  "aria-label": "More actions",
7784
7868
  children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7785
- import_icons33.Icon,
7869
+ import_icons35.Icon,
7786
7870
  {
7787
- icon: import_icons33.faEllipsisOutline,
7871
+ icon: import_icons35.faEllipsisOutline,
7788
7872
  size: "sm",
7789
7873
  className: "text-foreground"
7790
7874
  }
@@ -7818,7 +7902,7 @@ var FilterNodeActions = ({
7818
7902
  ),
7819
7903
  children: [
7820
7904
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7821
- import_icons33.Icon,
7905
+ import_icons35.Icon,
7822
7906
  {
7823
7907
  icon: item.icon,
7824
7908
  size: "sm",
@@ -7898,7 +7982,18 @@ var AdvancedRow = ({
7898
7982
  const handleValueChange = (val) => {
7899
7983
  onUpdate({ ...condition, value: val });
7900
7984
  };
7901
- const displayValue = formatFilterValue(condition.value, propertyDef.dynamicOptions);
7985
+ const displayValue = formatFilterValue(
7986
+ condition.value,
7987
+ propertyDef.dynamicOptions,
7988
+ false,
7989
+ propertyDef.options
7990
+ );
7991
+ const valueLeadingIcon = React49.useMemo(() => {
7992
+ const v = condition.value;
7993
+ const raw = typeof v === "string" ? v : Array.isArray(v) && typeof v[0] === "string" ? v[0] : null;
7994
+ if (!raw) return null;
7995
+ return findEnumOption(raw, propertyDef.options)?.icon ?? null;
7996
+ }, [condition.value, propertyDef.options]);
7902
7997
  const badgeCount = getBadgeCount(condition.value);
7903
7998
  const hasValue = displayValue != null;
7904
7999
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-base w-full min-w-0", children: [
@@ -7918,9 +8013,9 @@ var AdvancedRow = ({
7918
8013
  ] }) }) }),
7919
8014
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(PopoverPrimitive11.Root, { open: propertyOpen, onOpenChange: setPropertyOpen, children: [
7920
8015
  /* @__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: [
7921
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-muted-foreground" }),
8016
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons36.Icon, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-muted-foreground" }),
7922
8017
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-regular leading-sm text-foreground whitespace-nowrap truncate", children: propertyDef.label }),
7923
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: import_icons34.faChevronDownOutline, size: "xs", className: "shrink-0 text-foreground" })
8018
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons36.Icon, { icon: import_icons36.faChevronDownOutline, size: "xs", className: "shrink-0 text-foreground" })
7924
8019
  ] }) }),
7925
8020
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7926
8021
  PopoverPrimitive11.Content,
@@ -7949,7 +8044,7 @@ var AdvancedRow = ({
7949
8044
  p.id === condition.propertyId && "bg-dropdown-item-hover"
7950
8045
  ),
7951
8046
  children: [
7952
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: p.icon, size: "sm", className: "shrink-0 text-dropdown-item-icon" }),
8047
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons36.Icon, { icon: p.icon, size: "sm", className: "shrink-0 text-dropdown-item-icon" }),
7953
8048
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-regular leading-sm text-dropdown-item-text truncate", children: p.label })
7954
8049
  ]
7955
8050
  },
@@ -7969,7 +8064,7 @@ var AdvancedRow = ({
7969
8064
  p.id === condition.propertyId && "bg-dropdown-item-hover"
7970
8065
  ),
7971
8066
  children: [
7972
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: p.icon, size: "sm", className: "shrink-0 text-dropdown-item-icon" }),
8067
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons36.Icon, { icon: p.icon, size: "sm", className: "shrink-0 text-dropdown-item-icon" }),
7973
8068
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-regular leading-sm text-dropdown-item-text truncate", children: p.label }),
7974
8069
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ml-auto text-xs font-regular leading-xs text-muted-foreground", children: p.groupLabel })
7975
8070
  ]
@@ -7983,7 +8078,7 @@ var AdvancedRow = ({
7983
8078
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(PopoverPrimitive11.Root, { open: operatorOpen, onOpenChange: setOperatorOpen, children: [
7984
8079
  /* @__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: [
7985
8080
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-regular leading-sm text-foreground whitespace-nowrap truncate text-left", children: condition.operator ?? "Select" }),
7986
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: import_icons34.faChevronDownOutline, size: "xs", className: "shrink-0 text-foreground" })
8081
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons36.Icon, { icon: import_icons36.faChevronDownOutline, size: "xs", className: "shrink-0 text-foreground" })
7987
8082
  ] }) }),
7988
8083
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7989
8084
  PopoverPrimitive11.Content,
@@ -8044,21 +8139,31 @@ var AdvancedRow = ({
8044
8139
  type: "button",
8045
8140
  className: cn(selectBtnStyle, "flex-1 min-w-[80px] justify-between overflow-hidden"),
8046
8141
  children: [
8047
- multiTags && multiTags.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ValueTagRow, { tags: multiTags }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
8048
- "span",
8049
- {
8050
- className: cn(
8051
- "text-sm font-regular leading-sm whitespace-nowrap truncate text-left",
8052
- hasValue ? "text-foreground" : "text-muted-foreground"
8053
- ),
8054
- title: hasValue ? displayValue : void 0,
8055
- children: hasValue ? displayValue : "Select a value"
8056
- }
8057
- ),
8142
+ multiTags && multiTags.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ValueTagRow, { tags: multiTags }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
8143
+ valueLeadingIcon && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
8144
+ import_icons36.Icon,
8145
+ {
8146
+ icon: valueLeadingIcon,
8147
+ size: "sm",
8148
+ className: "shrink-0 text-foreground"
8149
+ }
8150
+ ),
8151
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
8152
+ "span",
8153
+ {
8154
+ className: cn(
8155
+ "text-sm font-regular leading-sm whitespace-nowrap truncate text-left",
8156
+ hasValue ? "text-foreground" : "text-muted-foreground"
8157
+ ),
8158
+ title: hasValue ? displayValue : void 0,
8159
+ children: hasValue ? displayValue : "Select a value"
8160
+ }
8161
+ )
8162
+ ] }),
8058
8163
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
8059
- import_icons34.Icon,
8164
+ import_icons36.Icon,
8060
8165
  {
8061
- icon: import_icons34.faChevronDownOutline,
8166
+ icon: import_icons36.faChevronDownOutline,
8062
8167
  size: "xs",
8063
8168
  className: "shrink-0 text-foreground"
8064
8169
  }
@@ -8187,7 +8292,7 @@ function ValueTagRow({ tags }) {
8187
8292
  // src/components/ui/filter/advanced-group.tsx
8188
8293
  var React50 = __toESM(require("react"));
8189
8294
  var TooltipPrimitive5 = __toESM(require("@radix-ui/react-tooltip"));
8190
- var import_icons35 = require("@l3mpire/icons");
8295
+ var import_icons37 = require("@l3mpire/icons");
8191
8296
  var import_jsx_runtime57 = require("react/jsx-runtime");
8192
8297
  var AdvancedGroup = ({
8193
8298
  connector,
@@ -8233,7 +8338,7 @@ var AdvancedGroup = ({
8233
8338
  type: "button",
8234
8339
  className: "flex items-center gap-sm px-base py-sm text-sm font-medium leading-sm text-muted-foreground cursor-pointer transition-colors rounded-md hover:bg-accent hover:text-foreground w-fit",
8235
8340
  children: [
8236
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons35.Icon, { icon: import_icons35.faPlusOutline, size: "sm" }),
8341
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons37.Icon, { icon: import_icons37.faPlusOutline, size: "sm" }),
8237
8342
  "Add filter"
8238
8343
  ]
8239
8344
  }
@@ -8450,7 +8555,7 @@ var AdvancedPopover = ({
8450
8555
  open: addSelectorOpen,
8451
8556
  onOpenChange: setAddSelectorOpen,
8452
8557
  children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("button", { type: "button", className: cn(ghostBtn, "text-foreground"), children: [
8453
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons36.Icon, { icon: import_icons36.faPlusOutline, size: "sm", className: "text-foreground" }),
8558
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons38.Icon, { icon: import_icons38.faPlusOutline, size: "sm", className: "text-foreground" }),
8454
8559
  "Add filter"
8455
8560
  ] })
8456
8561
  }
@@ -8462,7 +8567,7 @@ var AdvancedPopover = ({
8462
8567
  onClick: handleAddGroup,
8463
8568
  className: cn(ghostBtn, "text-foreground"),
8464
8569
  children: [
8465
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons36.Icon, { icon: import_icons36.faPlusOutline, size: "sm", className: "text-foreground" }),
8570
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons38.Icon, { icon: import_icons38.faPlusOutline, size: "sm", className: "text-foreground" }),
8466
8571
  "Add filters group"
8467
8572
  ]
8468
8573
  }
@@ -8475,7 +8580,7 @@ var AdvancedPopover = ({
8475
8580
  onClick: handleClearAll,
8476
8581
  className: cn(ghostBtn, "text-destructive"),
8477
8582
  children: [
8478
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons36.Icon, { icon: import_icons36.faXmarkOutline, size: "sm", className: "text-destructive" }),
8583
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons38.Icon, { icon: import_icons38.faXmarkOutline, size: "sm", className: "text-destructive" }),
8479
8584
  "Clear filters"
8480
8585
  ]
8481
8586
  }
@@ -8526,9 +8631,9 @@ var DraftRow = ({
8526
8631
  children: [
8527
8632
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-sm font-regular leading-sm text-muted-foreground whitespace-nowrap", children: "Select property" }),
8528
8633
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
8529
- import_icons36.Icon,
8634
+ import_icons38.Icon,
8530
8635
  {
8531
- icon: import_icons36.faChevronDownOutline,
8636
+ icon: import_icons38.faChevronDownOutline,
8532
8637
  size: "xs",
8533
8638
  className: "shrink-0 text-foreground"
8534
8639
  }
@@ -8545,7 +8650,7 @@ var DraftRow = ({
8545
8650
  var React52 = __toESM(require("react"));
8546
8651
  var PopoverPrimitive13 = __toESM(require("@radix-ui/react-popover"));
8547
8652
  var TooltipPrimitive6 = __toESM(require("@radix-ui/react-tooltip"));
8548
- var import_icons37 = require("@l3mpire/icons");
8653
+ var import_icons39 = require("@l3mpire/icons");
8549
8654
  var import_jsx_runtime59 = require("react/jsx-runtime");
8550
8655
  var ghostBtn2 = [
8551
8656
  "flex items-center gap-sm px-base py-sm",
@@ -8719,7 +8824,7 @@ var SummaryChip = ({
8719
8824
  className
8720
8825
  ),
8721
8826
  children: [
8722
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons37.Icon, { icon: import_icons37.faFilterOutline, size: "sm", className: "shrink-0 text-foreground" }),
8827
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons39.Icon, { icon: import_icons39.faFilterOutline, size: "sm", className: "shrink-0 text-foreground" }),
8723
8828
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-foreground", children: "Filters" }),
8724
8829
  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-medium leading-2xs text-filter-chip-badge-text", children: count }) })
8725
8830
  ]
@@ -8775,13 +8880,13 @@ var SummaryChip = ({
8775
8880
  open: addSelectorOpen,
8776
8881
  onOpenChange: setAddSelectorOpen,
8777
8882
  children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("button", { type: "button", className: cn(ghostBtn2, "text-foreground"), children: [
8778
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons37.Icon, { icon: import_icons37.faPlusOutline, size: "sm", className: "text-foreground" }),
8883
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons39.Icon, { icon: import_icons39.faPlusOutline, size: "sm", className: "text-foreground" }),
8779
8884
  "Add filter"
8780
8885
  ] })
8781
8886
  }
8782
8887
  ),
8783
8888
  /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("button", { type: "button", onClick: handleAddGroup, className: cn(ghostBtn2, "text-foreground"), children: [
8784
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons37.Icon, { icon: import_icons37.faPlusOutline, size: "sm", className: "text-foreground" }),
8889
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons39.Icon, { icon: import_icons39.faPlusOutline, size: "sm", className: "text-foreground" }),
8785
8890
  "Add filters group"
8786
8891
  ] })
8787
8892
  ] }),
@@ -8795,7 +8900,7 @@ var SummaryChip = ({
8795
8900
  },
8796
8901
  className: cn(ghostBtn2, "text-destructive"),
8797
8902
  children: [
8798
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons37.Icon, { icon: import_icons37.faXmarkOutline, size: "sm", className: "text-destructive" }),
8903
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons39.Icon, { icon: import_icons39.faXmarkOutline, size: "sm", className: "text-destructive" }),
8799
8904
  "Clear filters"
8800
8905
  ]
8801
8906
  }
@@ -8832,7 +8937,7 @@ var DraftRow2 = ({ properties, onSelect, open: openProp, onOpenChange }) => {
8832
8937
  ),
8833
8938
  children: [
8834
8939
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-sm font-regular leading-sm text-muted-foreground whitespace-nowrap", children: "Select property" }),
8835
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons37.Icon, { icon: import_icons37.faChevronDownOutline, size: "xs", className: "shrink-0 text-foreground" })
8940
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons39.Icon, { icon: import_icons39.faChevronDownOutline, size: "xs", className: "shrink-0 text-foreground" })
8836
8941
  ]
8837
8942
  }
8838
8943
  ) })
@@ -9060,7 +9165,7 @@ var FilterSystem = ({
9060
9165
  {
9061
9166
  type: "button",
9062
9167
  className: "shrink-0 inline-flex items-center justify-center size-8 rounded-md border border-btn-outlined-neutral-border-default bg-gradient-to-t from-btn-outlined-neutral-bg-default from-[10%] to-btn-outlined-neutral-bg-gradient-to-default shadow-sm cursor-pointer transition-colors hover:from-btn-outlined-neutral-bg-hover hover:to-btn-outlined-neutral-bg-gradient-to-hover",
9063
- children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_icons38.Icon, { icon: import_icons38.faPlusOutline, size: "sm", className: "text-foreground" })
9168
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_icons40.Icon, { icon: import_icons40.faPlusOutline, size: "sm", className: "text-foreground" })
9064
9169
  }
9065
9170
  ) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FilterBarButton, {})
9066
9171
  }