@l3mpire/ui 2.19.0 → 2.20.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
@@ -2627,11 +2627,6 @@ var Select = React20.forwardRef(
2627
2627
  children: hasValue ? value : placeholder
2628
2628
  }
2629
2629
  ),
2630
- !hasTags && multiCount != null && multiCount > 0 && /* @__PURE__ */ jsxs18("span", { className: "shrink-0 text-xs leading-normal text-select-text-multi", children: [
2631
- "+",
2632
- multiCount,
2633
- " others"
2634
- ] }),
2635
2630
  /* @__PURE__ */ jsx20(
2636
2631
  Icon14,
2637
2632
  {
@@ -7565,7 +7560,8 @@ import { Icon as Icon35, faPlusOutline as faPlusOutline3, faChevronDownOutline a
7565
7560
  // src/components/ui/filter/advanced-row.tsx
7566
7561
  import * as React49 from "react";
7567
7562
  import * as PopoverPrimitive11 from "@radix-ui/react-popover";
7568
- import { Icon as Icon33, faRefreshOutline, faChevronDownOutline as faChevronDownOutline2 } from "@l3mpire/icons";
7563
+ import * as TooltipPrimitive3 from "@radix-ui/react-tooltip";
7564
+ import { Icon as Icon33, faChevronDownOutline as faChevronDownOutline2 } from "@l3mpire/icons";
7569
7565
 
7570
7566
  // src/components/ui/filter/filter-node-actions.tsx
7571
7567
  import * as React48 from "react";
@@ -7719,25 +7715,20 @@ var AdvancedRow = ({
7719
7715
  const badgeCount = getBadgeCount(condition.value);
7720
7716
  const hasValue = displayValue != null;
7721
7717
  return /* @__PURE__ */ jsxs50("div", { className: "flex items-center gap-base w-full min-w-0", children: [
7722
- connector === "Where" ? /* @__PURE__ */ jsx56("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ jsx56("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }) : /* @__PURE__ */ jsxs50(
7723
- "button",
7724
- {
7725
- type: "button",
7726
- onClick: onConnectorToggle,
7727
- className: cn(
7728
- "shrink-0 flex items-center justify-center gap-xs",
7729
- "min-w-[64px] min-h-[32px] max-h-[32px] px-base py-sm",
7730
- "bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
7731
- "border border-[var(--color-btn-outlined-neutral-border-default)] rounded-base shadow-sm",
7732
- "cursor-pointer transition-colors text-xs font-semibold leading-xs text-[var(--color-foreground)]",
7733
- "hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
7734
- ),
7735
- children: [
7736
- connector,
7737
- /* @__PURE__ */ jsx56(Icon33, { icon: faRefreshOutline, size: "xs", className: "text-[var(--color-foreground)]" })
7738
- ]
7739
- }
7740
- ),
7718
+ connector === "Where" ? /* @__PURE__ */ jsx56("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ jsx56("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }) : /* @__PURE__ */ jsx56("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ jsx56(TooltipPrimitive3.Provider, { delayDuration: 200, children: /* @__PURE__ */ jsxs50(TooltipPrimitive3.Root, { children: [
7719
+ /* @__PURE__ */ jsx56(TooltipPrimitive3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx56("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)] cursor-default", children: connector }) }),
7720
+ /* @__PURE__ */ jsx56(TooltipPrimitive3.Portal, { children: /* @__PURE__ */ jsxs50(
7721
+ TooltipPrimitive3.Content,
7722
+ {
7723
+ sideOffset: 4,
7724
+ className: "z-50 px-base py-sm rounded-md shadow-lg bg-tooltip-default-bg text-tooltip-default-text text-sm font-regular leading-sm data-[state=delayed-open]:animate-[tooltip-in_150ms_ease-out] data-[state=closed]:animate-[tooltip-out_100ms_ease-in]",
7725
+ children: [
7726
+ '"Or" operator coming soon',
7727
+ /* @__PURE__ */ jsx56(TooltipPrimitive3.Arrow, { className: "fill-tooltip-default-bg" })
7728
+ ]
7729
+ }
7730
+ ) })
7731
+ ] }) }) }),
7741
7732
  /* @__PURE__ */ jsxs50(PopoverPrimitive11.Root, { open: propertyOpen, onOpenChange: setPropertyOpen, children: [
7742
7733
  /* @__PURE__ */ jsx56(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs50("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
7743
7734
  /* @__PURE__ */ jsx56(Icon33, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-[var(--color-muted-foreground)]" }),
@@ -7831,14 +7822,19 @@ var AdvancedRow = ({
7831
7822
  );
7832
7823
  }
7833
7824
  const dateWide = inputType === "DatePicker" || inputType === "DateRange";
7825
+ const isMulti = inputType === "MultiSelect" || inputType === "MultiRelationPicker";
7826
+ const multiTags = isMulti && Array.isArray(condition.value) ? condition.value.map((v) => {
7827
+ const dyn = propertyDef.dynamicOptions?.find((o) => o.value === v);
7828
+ return dyn ? dyn.label : v;
7829
+ }) : null;
7834
7830
  return /* @__PURE__ */ jsxs50(PopoverPrimitive11.Root, { open: valueOpen, onOpenChange: setValueOpen, children: [
7835
7831
  /* @__PURE__ */ jsx56(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs50(
7836
7832
  "button",
7837
7833
  {
7838
7834
  type: "button",
7839
- className: cn(selectBtnStyle, "flex-1 min-w-[80px] justify-between"),
7835
+ className: cn(selectBtnStyle, "flex-1 min-w-[80px] justify-between overflow-hidden"),
7840
7836
  children: [
7841
- /* @__PURE__ */ jsx56(
7837
+ multiTags && multiTags.length > 0 ? /* @__PURE__ */ jsx56(ValueTagRow, { tags: multiTags }) : /* @__PURE__ */ jsx56(
7842
7838
  "span",
7843
7839
  {
7844
7840
  className: cn(
@@ -7849,20 +7845,14 @@ var AdvancedRow = ({
7849
7845
  children: hasValue ? displayValue : "Select a value"
7850
7846
  }
7851
7847
  ),
7852
- /* @__PURE__ */ jsxs50("span", { className: "flex items-center gap-xs shrink-0", children: [
7853
- badgeCount != null && /* @__PURE__ */ jsxs50("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: [
7854
- "+",
7855
- badgeCount - 1
7856
- ] }),
7857
- /* @__PURE__ */ jsx56(
7858
- Icon33,
7859
- {
7860
- icon: faChevronDownOutline2,
7861
- size: "xs",
7862
- className: "text-[var(--color-foreground)]"
7863
- }
7864
- )
7865
- ] })
7848
+ /* @__PURE__ */ jsx56(
7849
+ Icon33,
7850
+ {
7851
+ icon: faChevronDownOutline2,
7852
+ size: "xs",
7853
+ className: "shrink-0 text-[var(--color-foreground)]"
7854
+ }
7855
+ )
7866
7856
  ]
7867
7857
  }
7868
7858
  ) }),
@@ -7908,10 +7898,86 @@ var AdvancedRow = ({
7908
7898
  ] });
7909
7899
  };
7910
7900
  AdvancedRow.displayName = "AdvancedRow";
7901
+ var tagChip = cn(
7902
+ "inline-flex items-center shrink-0 px-sm rounded-base",
7903
+ "bg-tag-neutral-bg text-tag-neutral-text",
7904
+ "text-xs font-semibold leading-xs whitespace-nowrap",
7905
+ "h-5"
7906
+ );
7907
+ function ValueTagRow({ tags }) {
7908
+ const containerRef = React49.useRef(null);
7909
+ const measureRef = React49.useRef(null);
7910
+ const [visibleCount, setVisibleCount] = React49.useState(tags.length);
7911
+ React49.useLayoutEffect(() => {
7912
+ const container = containerRef.current;
7913
+ const measureRow = measureRef.current;
7914
+ if (!container || !measureRow) return;
7915
+ const measure = () => {
7916
+ const containerWidth = container.getBoundingClientRect().width;
7917
+ const chips = Array.from(measureRow.children);
7918
+ const overflowBadgeWidth = 32;
7919
+ let usedWidth = 0;
7920
+ let count = 0;
7921
+ for (const chip of chips) {
7922
+ const chipWidth = chip.getBoundingClientRect().width;
7923
+ const gap = count > 0 ? 4 : 0;
7924
+ const projected = usedWidth + gap + chipWidth;
7925
+ const remaining = tags.length - (count + 1);
7926
+ const total = projected + (remaining > 0 ? 4 + overflowBadgeWidth : 0);
7927
+ if (total <= containerWidth) {
7928
+ usedWidth = projected;
7929
+ count++;
7930
+ } else {
7931
+ break;
7932
+ }
7933
+ }
7934
+ setVisibleCount(Math.max(1, count));
7935
+ };
7936
+ measure();
7937
+ const observer = new ResizeObserver(measure);
7938
+ observer.observe(container);
7939
+ return () => observer.disconnect();
7940
+ }, [tags]);
7941
+ const overflowCount = tags.length - visibleCount;
7942
+ const overflowTags = tags.slice(visibleCount);
7943
+ return /* @__PURE__ */ jsxs50("div", { className: "flex flex-1 items-center gap-xs min-w-0 overflow-hidden relative", children: [
7944
+ /* @__PURE__ */ jsx56(
7945
+ "div",
7946
+ {
7947
+ ref: measureRef,
7948
+ "aria-hidden": true,
7949
+ className: "absolute flex items-center gap-xs pointer-events-none",
7950
+ style: { visibility: "hidden", whiteSpace: "nowrap", top: 0, left: 0 },
7951
+ children: tags.map((t) => /* @__PURE__ */ jsx56("span", { className: tagChip, children: t }, t))
7952
+ }
7953
+ ),
7954
+ /* @__PURE__ */ jsxs50("div", { ref: containerRef, className: "flex flex-1 items-center gap-xs overflow-hidden", children: [
7955
+ tags.slice(0, visibleCount).map((t) => /* @__PURE__ */ jsx56("span", { className: tagChip, children: t }, t)),
7956
+ overflowCount > 0 && /* @__PURE__ */ jsx56(TooltipPrimitive3.Provider, { delayDuration: 200, children: /* @__PURE__ */ jsxs50(TooltipPrimitive3.Root, { children: [
7957
+ /* @__PURE__ */ jsx56(TooltipPrimitive3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs50("span", { className: cn(tagChip, "cursor-default bg-filter-chip-badge-bg text-filter-chip-badge-text"), children: [
7958
+ "+",
7959
+ overflowCount
7960
+ ] }) }),
7961
+ /* @__PURE__ */ jsx56(TooltipPrimitive3.Portal, { children: /* @__PURE__ */ jsxs50(
7962
+ TooltipPrimitive3.Content,
7963
+ {
7964
+ sideOffset: 4,
7965
+ className: "z-50 px-base py-sm rounded-md shadow-lg bg-tooltip-default-bg text-tooltip-default-text text-xs font-regular leading-xs flex flex-col gap-xs data-[state=delayed-open]:animate-[tooltip-in_150ms_ease-out] data-[state=closed]:animate-[tooltip-out_100ms_ease-in]",
7966
+ children: [
7967
+ overflowTags.map((t) => /* @__PURE__ */ jsx56("span", { children: t }, t)),
7968
+ /* @__PURE__ */ jsx56(TooltipPrimitive3.Arrow, { className: "fill-tooltip-default-bg" })
7969
+ ]
7970
+ }
7971
+ ) })
7972
+ ] }) })
7973
+ ] })
7974
+ ] });
7975
+ }
7911
7976
 
7912
7977
  // src/components/ui/filter/advanced-group.tsx
7913
7978
  import * as React50 from "react";
7914
- import { Icon as Icon34, faRefreshOutline as faRefreshOutline2, faPlusOutline as faPlusOutline2 } from "@l3mpire/icons";
7979
+ import * as TooltipPrimitive4 from "@radix-ui/react-tooltip";
7980
+ import { Icon as Icon34, faPlusOutline as faPlusOutline2 } from "@l3mpire/icons";
7915
7981
  import { jsx as jsx57, jsxs as jsxs51 } from "react/jsx-runtime";
7916
7982
  var AdvancedGroup = ({
7917
7983
  connector,
@@ -7925,25 +7991,20 @@ var AdvancedGroup = ({
7925
7991
  }) => {
7926
7992
  const [addOpen, setAddOpen] = React50.useState(false);
7927
7993
  return /* @__PURE__ */ jsxs51("div", { className: "flex items-start gap-base w-full min-w-0", children: [
7928
- connector === "Where" ? /* @__PURE__ */ jsx57("div", { className: "shrink-0 w-[64px] flex items-center justify-end pt-base", children: /* @__PURE__ */ jsx57("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }) : /* @__PURE__ */ jsx57("div", { className: "shrink-0 w-[64px] flex items-center justify-end pt-base", children: /* @__PURE__ */ jsxs51(
7929
- "button",
7930
- {
7931
- type: "button",
7932
- onClick: onConnectorToggle,
7933
- className: cn(
7934
- "flex items-center justify-center gap-xs",
7935
- "min-w-[64px] min-h-[32px] max-h-[32px] px-base py-sm",
7936
- "bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
7937
- "border border-[var(--color-btn-outlined-neutral-border-default)] rounded-base shadow-sm",
7938
- "cursor-pointer transition-colors text-xs font-semibold leading-xs text-[var(--color-foreground)]",
7939
- "hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
7940
- ),
7941
- children: [
7942
- connector,
7943
- /* @__PURE__ */ jsx57(Icon34, { icon: faRefreshOutline2, size: "xs", className: "text-[var(--color-foreground)]" })
7944
- ]
7945
- }
7946
- ) }),
7994
+ connector === "Where" ? /* @__PURE__ */ jsx57("div", { className: "shrink-0 w-[64px] flex items-center justify-end pt-base", children: /* @__PURE__ */ jsx57("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }) : /* @__PURE__ */ jsx57("div", { className: "shrink-0 w-[64px] flex items-center justify-end pt-base", children: /* @__PURE__ */ jsx57(TooltipPrimitive4.Provider, { delayDuration: 200, children: /* @__PURE__ */ jsxs51(TooltipPrimitive4.Root, { children: [
7995
+ /* @__PURE__ */ jsx57(TooltipPrimitive4.Trigger, { asChild: true, children: /* @__PURE__ */ jsx57("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)] cursor-default", children: connector }) }),
7996
+ /* @__PURE__ */ jsx57(TooltipPrimitive4.Portal, { children: /* @__PURE__ */ jsxs51(
7997
+ TooltipPrimitive4.Content,
7998
+ {
7999
+ sideOffset: 4,
8000
+ className: "z-50 px-base py-sm rounded-md shadow-lg bg-tooltip-default-bg text-tooltip-default-text text-sm font-regular leading-sm data-[state=delayed-open]:animate-[tooltip-in_150ms_ease-out] data-[state=closed]:animate-[tooltip-out_100ms_ease-in]",
8001
+ children: [
8002
+ '"Or" operator coming soon',
8003
+ /* @__PURE__ */ jsx57(TooltipPrimitive4.Arrow, { className: "fill-tooltip-default-bg" })
8004
+ ]
8005
+ }
8006
+ ) })
8007
+ ] }) }) }),
7947
8008
  /* @__PURE__ */ jsxs51("div", { className: "flex-1 min-w-0 flex flex-col gap-base p-base border border-[var(--color-border)] rounded-md bg-[var(--color-secondary,var(--color-accent))]", children: [
7948
8009
  children,
7949
8010
  onAddFilter && properties && /* @__PURE__ */ jsx57(
@@ -8273,7 +8334,7 @@ var DraftRow = ({
8273
8334
  // src/components/ui/filter/summary-chip.tsx
8274
8335
  import * as React52 from "react";
8275
8336
  import * as PopoverPrimitive13 from "@radix-ui/react-popover";
8276
- import * as TooltipPrimitive3 from "@radix-ui/react-tooltip";
8337
+ import * as TooltipPrimitive5 from "@radix-ui/react-tooltip";
8277
8338
  import { Icon as Icon36, faFilterOutline as faFilterOutline6, faPlusOutline as faPlusOutline4, faChevronDownOutline as faChevronDownOutline4, faXmarkOutline as faXmarkOutline5 } from "@l3mpire/icons";
8278
8339
  import { jsx as jsx59, jsxs as jsxs53 } from "react/jsx-runtime";
8279
8340
  var ghostBtn2 = [
@@ -8455,16 +8516,16 @@ var SummaryChip = ({
8455
8516
  }
8456
8517
  );
8457
8518
  const hasTooltip = tooltipContent && !open;
8458
- return /* @__PURE__ */ jsx59(TooltipPrimitive3.Provider, { delayDuration: 300, children: /* @__PURE__ */ jsx59(TooltipPrimitive3.Root, { open: hasTooltip ? void 0 : false, children: /* @__PURE__ */ jsxs53(PopoverPrimitive13.Root, { open, onOpenChange: setOpen, children: [
8459
- /* @__PURE__ */ jsx59(TooltipPrimitive3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx59(PopoverPrimitive13.Trigger, { asChild: true, children: trigger }) }),
8460
- hasTooltip && /* @__PURE__ */ jsx59(TooltipPrimitive3.Portal, { children: /* @__PURE__ */ jsxs53(
8461
- TooltipPrimitive3.Content,
8519
+ return /* @__PURE__ */ jsx59(TooltipPrimitive5.Provider, { delayDuration: 300, children: /* @__PURE__ */ jsx59(TooltipPrimitive5.Root, { open: hasTooltip ? void 0 : false, children: /* @__PURE__ */ jsxs53(PopoverPrimitive13.Root, { open, onOpenChange: setOpen, children: [
8520
+ /* @__PURE__ */ jsx59(TooltipPrimitive5.Trigger, { asChild: true, children: /* @__PURE__ */ jsx59(PopoverPrimitive13.Trigger, { asChild: true, children: trigger }) }),
8521
+ hasTooltip && /* @__PURE__ */ jsx59(TooltipPrimitive5.Portal, { children: /* @__PURE__ */ jsxs53(
8522
+ TooltipPrimitive5.Content,
8462
8523
  {
8463
8524
  sideOffset: 4,
8464
8525
  className: "z-50 px-base py-sm rounded-md shadow-lg bg-tooltip-default-bg text-tooltip-default-text text-sm font-regular leading-sm max-w-[320px] data-[state=delayed-open]:animate-[tooltip-in_150ms_ease-out] data-[state=closed]:animate-[tooltip-out_100ms_ease-in]",
8465
8526
  children: [
8466
8527
  tooltipContent,
8467
- /* @__PURE__ */ jsx59(TooltipPrimitive3.Arrow, { className: "fill-tooltip-default-bg" })
8528
+ /* @__PURE__ */ jsx59(TooltipPrimitive5.Arrow, { className: "fill-tooltip-default-bg" })
8468
8529
  ]
8469
8530
  }
8470
8531
  ) }),