@l3mpire/ui 2.19.1 → 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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +126 -59
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +126 -59
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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,6 +7560,7 @@ 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";
|
|
7563
|
+
import * as TooltipPrimitive3 from "@radix-ui/react-tooltip";
|
|
7568
7564
|
import { Icon as Icon33, faChevronDownOutline as faChevronDownOutline2 } from "@l3mpire/icons";
|
|
7569
7565
|
|
|
7570
7566
|
// src/components/ui/filter/filter-node-actions.tsx
|
|
@@ -7719,22 +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__ */ jsx56(
|
|
7723
|
-
"
|
|
7724
|
-
{
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
}
|
|
7737
|
-
),
|
|
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
|
+
] }) }) }),
|
|
7738
7732
|
/* @__PURE__ */ jsxs50(PopoverPrimitive11.Root, { open: propertyOpen, onOpenChange: setPropertyOpen, children: [
|
|
7739
7733
|
/* @__PURE__ */ jsx56(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs50("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
|
|
7740
7734
|
/* @__PURE__ */ jsx56(Icon33, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-[var(--color-muted-foreground)]" }),
|
|
@@ -7828,14 +7822,19 @@ var AdvancedRow = ({
|
|
|
7828
7822
|
);
|
|
7829
7823
|
}
|
|
7830
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;
|
|
7831
7830
|
return /* @__PURE__ */ jsxs50(PopoverPrimitive11.Root, { open: valueOpen, onOpenChange: setValueOpen, children: [
|
|
7832
7831
|
/* @__PURE__ */ jsx56(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs50(
|
|
7833
7832
|
"button",
|
|
7834
7833
|
{
|
|
7835
7834
|
type: "button",
|
|
7836
|
-
className: cn(selectBtnStyle, "flex-1 min-w-[80px] justify-between"),
|
|
7835
|
+
className: cn(selectBtnStyle, "flex-1 min-w-[80px] justify-between overflow-hidden"),
|
|
7837
7836
|
children: [
|
|
7838
|
-
/* @__PURE__ */ jsx56(
|
|
7837
|
+
multiTags && multiTags.length > 0 ? /* @__PURE__ */ jsx56(ValueTagRow, { tags: multiTags }) : /* @__PURE__ */ jsx56(
|
|
7839
7838
|
"span",
|
|
7840
7839
|
{
|
|
7841
7840
|
className: cn(
|
|
@@ -7846,20 +7845,14 @@ var AdvancedRow = ({
|
|
|
7846
7845
|
children: hasValue ? displayValue : "Select a value"
|
|
7847
7846
|
}
|
|
7848
7847
|
),
|
|
7849
|
-
/* @__PURE__ */
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
icon: faChevronDownOutline2,
|
|
7858
|
-
size: "xs",
|
|
7859
|
-
className: "text-[var(--color-foreground)]"
|
|
7860
|
-
}
|
|
7861
|
-
)
|
|
7862
|
-
] })
|
|
7848
|
+
/* @__PURE__ */ jsx56(
|
|
7849
|
+
Icon33,
|
|
7850
|
+
{
|
|
7851
|
+
icon: faChevronDownOutline2,
|
|
7852
|
+
size: "xs",
|
|
7853
|
+
className: "shrink-0 text-[var(--color-foreground)]"
|
|
7854
|
+
}
|
|
7855
|
+
)
|
|
7863
7856
|
]
|
|
7864
7857
|
}
|
|
7865
7858
|
) }),
|
|
@@ -7905,9 +7898,85 @@ var AdvancedRow = ({
|
|
|
7905
7898
|
] });
|
|
7906
7899
|
};
|
|
7907
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
|
+
}
|
|
7908
7976
|
|
|
7909
7977
|
// src/components/ui/filter/advanced-group.tsx
|
|
7910
7978
|
import * as React50 from "react";
|
|
7979
|
+
import * as TooltipPrimitive4 from "@radix-ui/react-tooltip";
|
|
7911
7980
|
import { Icon as Icon34, faPlusOutline as faPlusOutline2 } from "@l3mpire/icons";
|
|
7912
7981
|
import { jsx as jsx57, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
7913
7982
|
var AdvancedGroup = ({
|
|
@@ -7922,22 +7991,20 @@ var AdvancedGroup = ({
|
|
|
7922
7991
|
}) => {
|
|
7923
7992
|
const [addOpen, setAddOpen] = React50.useState(false);
|
|
7924
7993
|
return /* @__PURE__ */ jsxs51("div", { className: "flex items-start gap-base w-full min-w-0", children: [
|
|
7925
|
-
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(
|
|
7926
|
-
"
|
|
7927
|
-
{
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
}
|
|
7940
|
-
) }),
|
|
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
|
+
] }) }) }),
|
|
7941
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: [
|
|
7942
8009
|
children,
|
|
7943
8010
|
onAddFilter && properties && /* @__PURE__ */ jsx57(
|
|
@@ -8267,7 +8334,7 @@ var DraftRow = ({
|
|
|
8267
8334
|
// src/components/ui/filter/summary-chip.tsx
|
|
8268
8335
|
import * as React52 from "react";
|
|
8269
8336
|
import * as PopoverPrimitive13 from "@radix-ui/react-popover";
|
|
8270
|
-
import * as
|
|
8337
|
+
import * as TooltipPrimitive5 from "@radix-ui/react-tooltip";
|
|
8271
8338
|
import { Icon as Icon36, faFilterOutline as faFilterOutline6, faPlusOutline as faPlusOutline4, faChevronDownOutline as faChevronDownOutline4, faXmarkOutline as faXmarkOutline5 } from "@l3mpire/icons";
|
|
8272
8339
|
import { jsx as jsx59, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
8273
8340
|
var ghostBtn2 = [
|
|
@@ -8449,16 +8516,16 @@ var SummaryChip = ({
|
|
|
8449
8516
|
}
|
|
8450
8517
|
);
|
|
8451
8518
|
const hasTooltip = tooltipContent && !open;
|
|
8452
|
-
return /* @__PURE__ */ jsx59(
|
|
8453
|
-
/* @__PURE__ */ jsx59(
|
|
8454
|
-
hasTooltip && /* @__PURE__ */ jsx59(
|
|
8455
|
-
|
|
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,
|
|
8456
8523
|
{
|
|
8457
8524
|
sideOffset: 4,
|
|
8458
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]",
|
|
8459
8526
|
children: [
|
|
8460
8527
|
tooltipContent,
|
|
8461
|
-
/* @__PURE__ */ jsx59(
|
|
8528
|
+
/* @__PURE__ */ jsx59(TooltipPrimitive5.Arrow, { className: "fill-tooltip-default-bg" })
|
|
8462
8529
|
]
|
|
8463
8530
|
}
|
|
8464
8531
|
) }),
|