@mlw-packages/react-components 1.10.3 → 1.10.5
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.css +42 -83
- package/dist/index.d.mts +44 -78
- package/dist/index.d.ts +44 -78
- package/dist/index.js +373 -550
- package/dist/index.mjs +374 -543
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1562,20 +1562,20 @@ var TooltipContentBase = React32__namespace.forwardRef(
|
|
|
1562
1562
|
id: "tooltip-content",
|
|
1563
1563
|
role: "tooltip",
|
|
1564
1564
|
className: cn(
|
|
1565
|
-
"z-50
|
|
1566
|
-
"shadow
|
|
1567
|
-
"animate-in fade-in-0 zoom-in-95 duration-
|
|
1568
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-
|
|
1569
|
-
"data-[side=bottom]:slide-in-from-top-
|
|
1570
|
-
"data-[side=left]:slide-in-from-right-
|
|
1571
|
-
"data-[side=right]:slide-in-from-left-
|
|
1572
|
-
"data-[side=top]:slide-in-from-bottom-
|
|
1565
|
+
"z-50 rounded-lg bg-popover px-3 py-1.5 text-sm leading-snug text-popover-foreground",
|
|
1566
|
+
"[filter:drop-shadow(0_0_0.5px_hsl(var(--border)))_drop-shadow(0_4px_12px_hsl(var(--foreground)/0.08))]",
|
|
1567
|
+
"animate-in fade-in-0 zoom-in-95 duration-150 ease-out",
|
|
1568
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-100",
|
|
1569
|
+
"data-[side=bottom]:slide-in-from-top-1.5",
|
|
1570
|
+
"data-[side=left]:slide-in-from-right-1.5",
|
|
1571
|
+
"data-[side=right]:slide-in-from-left-1.5",
|
|
1572
|
+
"data-[side=top]:slide-in-from-bottom-1.5",
|
|
1573
1573
|
className
|
|
1574
1574
|
),
|
|
1575
1575
|
...props,
|
|
1576
1576
|
children: [
|
|
1577
1577
|
props.children,
|
|
1578
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Arrow, { className: "fill-
|
|
1578
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Arrow, { className: "fill-popover h-2 w-3.5" })
|
|
1579
1579
|
]
|
|
1580
1580
|
}
|
|
1581
1581
|
) });
|
|
@@ -2366,7 +2366,7 @@ function ComboboxBase({
|
|
|
2366
2366
|
"aria-disabled": disabled || void 0,
|
|
2367
2367
|
disabled,
|
|
2368
2368
|
className: cn(
|
|
2369
|
-
`flex items-center gap-2 justify-between [&>div]:line-clamp-1 relative h-9 no-active-animation`,
|
|
2369
|
+
`flex items-center gap-2 justify-between [&>div]:line-clamp-1 relative h-9 no-active-animation font-light`,
|
|
2370
2370
|
error && "border-red-500"
|
|
2371
2371
|
),
|
|
2372
2372
|
"data-testid": testIds.trigger ?? "combobox-trigger",
|
|
@@ -2508,7 +2508,7 @@ function Combobox({
|
|
|
2508
2508
|
className: cn(
|
|
2509
2509
|
"truncate",
|
|
2510
2510
|
disabled && "opacity-60 cursor-not-allowed",
|
|
2511
|
-
!selectedItem && "text-
|
|
2511
|
+
!selectedItem && "text-muted-foreground"
|
|
2512
2512
|
),
|
|
2513
2513
|
children: selectedItem?.label ?? placeholder ?? "Selecione uma op\xE7\xE3o..."
|
|
2514
2514
|
}
|
|
@@ -2718,46 +2718,48 @@ function MultiSelectValueBase({
|
|
|
2718
2718
|
if (valueRef.current == null) return;
|
|
2719
2719
|
const containerElement = valueRef.current;
|
|
2720
2720
|
const overflowElement = overflowRef.current;
|
|
2721
|
-
const
|
|
2721
|
+
const badgeItems = containerElement.querySelectorAll(
|
|
2722
2722
|
"[data-selected-item]"
|
|
2723
2723
|
);
|
|
2724
2724
|
if (overflowElement != null) overflowElement.style.display = "none";
|
|
2725
|
-
|
|
2725
|
+
badgeItems.forEach((child) => child.style.removeProperty("display"));
|
|
2726
|
+
if (shouldWrap) {
|
|
2727
|
+
setOverflowAmount(0);
|
|
2728
|
+
return;
|
|
2729
|
+
}
|
|
2726
2730
|
let amount = 0;
|
|
2727
|
-
for (let i =
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
}
|
|
2732
|
-
amount = items2.length - i;
|
|
2731
|
+
for (let i = badgeItems.length - 1; i >= 0; i--) {
|
|
2732
|
+
if (containerElement.scrollWidth <= containerElement.clientWidth) break;
|
|
2733
|
+
const child = badgeItems[i];
|
|
2734
|
+
amount = badgeItems.length - i;
|
|
2733
2735
|
child.style.display = "none";
|
|
2734
|
-
overflowElement
|
|
2736
|
+
if (overflowElement != null) {
|
|
2737
|
+
overflowElement.style.removeProperty("display");
|
|
2738
|
+
}
|
|
2735
2739
|
}
|
|
2736
2740
|
setOverflowAmount(amount);
|
|
2741
|
+
}, [shouldWrap]);
|
|
2742
|
+
React32.useEffect(() => {
|
|
2743
|
+
if (overflowRef.current) {
|
|
2744
|
+
overflowRef.current.style.display = "none";
|
|
2745
|
+
}
|
|
2737
2746
|
}, []);
|
|
2747
|
+
React32.useEffect(() => {
|
|
2748
|
+
checkOverflow();
|
|
2749
|
+
}, [open, shouldWrap, checkOverflow]);
|
|
2738
2750
|
const handleResize = React32.useCallback(
|
|
2739
2751
|
(node) => {
|
|
2740
2752
|
if (node == null) {
|
|
2741
2753
|
valueRef.current = null;
|
|
2742
|
-
|
|
2743
|
-
resizeObserverRef.current.disconnect();
|
|
2744
|
-
resizeObserverRef.current = null;
|
|
2745
|
-
}
|
|
2746
|
-
if (mutationObserverRef.current) {
|
|
2747
|
-
mutationObserverRef.current.disconnect();
|
|
2748
|
-
mutationObserverRef.current = null;
|
|
2749
|
-
}
|
|
2750
|
-
return;
|
|
2751
|
-
}
|
|
2752
|
-
valueRef.current = node;
|
|
2753
|
-
if (resizeObserverRef.current) {
|
|
2754
|
-
resizeObserverRef.current.disconnect();
|
|
2754
|
+
resizeObserverRef.current?.disconnect();
|
|
2755
2755
|
resizeObserverRef.current = null;
|
|
2756
|
-
|
|
2757
|
-
if (mutationObserverRef.current) {
|
|
2758
|
-
mutationObserverRef.current.disconnect();
|
|
2756
|
+
mutationObserverRef.current?.disconnect();
|
|
2759
2757
|
mutationObserverRef.current = null;
|
|
2758
|
+
return;
|
|
2760
2759
|
}
|
|
2760
|
+
valueRef.current = node;
|
|
2761
|
+
resizeObserverRef.current?.disconnect();
|
|
2762
|
+
mutationObserverRef.current?.disconnect();
|
|
2761
2763
|
const mo = new MutationObserver(checkOverflow);
|
|
2762
2764
|
const ro = new ResizeObserver(debounce(checkOverflow, 100));
|
|
2763
2765
|
mutationObserverRef.current = mo;
|
|
@@ -2772,6 +2774,7 @@ function MultiSelectValueBase({
|
|
|
2772
2774
|
},
|
|
2773
2775
|
[checkOverflow]
|
|
2774
2776
|
);
|
|
2777
|
+
const [overflowHovered, setOverflowHovered] = React32.useState(false);
|
|
2775
2778
|
const visibleSelected = [...selectedValues].filter((value) => items.has(value)).sort((a, b) => {
|
|
2776
2779
|
const aNode = items.get(a);
|
|
2777
2780
|
const bNode = items.get(b);
|
|
@@ -2789,7 +2792,7 @@ function MultiSelectValueBase({
|
|
|
2789
2792
|
...props,
|
|
2790
2793
|
ref: handleResize,
|
|
2791
2794
|
className: cn(
|
|
2792
|
-
"flex w-full gap-1.5 overflow-hidden",
|
|
2795
|
+
"flex flex-1 w-full gap-1.5 overflow-hidden min-w-0",
|
|
2793
2796
|
shouldWrap && "h-full flex-wrap",
|
|
2794
2797
|
className
|
|
2795
2798
|
),
|
|
@@ -2799,7 +2802,7 @@ function MultiSelectValueBase({
|
|
|
2799
2802
|
{
|
|
2800
2803
|
"data-selected-item": true,
|
|
2801
2804
|
size: "sm",
|
|
2802
|
-
className: "group flex items-center gap-1
|
|
2805
|
+
className: "group flex items-center gap-1 border-border shrink-0",
|
|
2803
2806
|
onClick: clickToRemove ? (e) => {
|
|
2804
2807
|
e.stopPropagation();
|
|
2805
2808
|
toggleValue(value);
|
|
@@ -2811,19 +2814,38 @@ function MultiSelectValueBase({
|
|
|
2811
2814
|
},
|
|
2812
2815
|
value
|
|
2813
2816
|
)),
|
|
2814
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
"
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2817
|
+
overflowAmount > 0 && /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { open: overflowHovered, children: [
|
|
2818
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2819
|
+
"div",
|
|
2820
|
+
{
|
|
2821
|
+
ref: overflowRef,
|
|
2822
|
+
className: "inline-flex",
|
|
2823
|
+
onMouseEnter: () => setOverflowHovered(true),
|
|
2824
|
+
onMouseLeave: () => setOverflowHovered(false),
|
|
2825
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(Badge, { size: "sm", className: "shrink-0 cursor-default", children: [
|
|
2826
|
+
"+",
|
|
2827
|
+
overflowAmount
|
|
2828
|
+
] })
|
|
2829
|
+
}
|
|
2830
|
+
) }),
|
|
2831
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TooltipContentBase, { className: "p-2 max-w-xs", children: [
|
|
2832
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs font-medium text-primary-foreground/60 mb-1.5 px-1", children: [
|
|
2833
|
+
overflowAmount,
|
|
2834
|
+
" item",
|
|
2835
|
+
overflowAmount > 1 ? "s" : "",
|
|
2836
|
+
" oculto",
|
|
2837
|
+
overflowAmount > 1 ? "s" : ""
|
|
2838
|
+
] }),
|
|
2839
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: visibleSelected.slice(visibleSelected.length - overflowAmount).map((value) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2840
|
+
"span",
|
|
2841
|
+
{
|
|
2842
|
+
className: "inline-flex items-center rounded-md bg-primary-foreground/15 px-2 py-0.5 text-xs font-medium text-primary-foreground",
|
|
2843
|
+
children: typeof items.get(value) === "string" ? items.get(value) : value
|
|
2844
|
+
},
|
|
2845
|
+
value
|
|
2846
|
+
)) })
|
|
2847
|
+
] })
|
|
2848
|
+
] }) })
|
|
2827
2849
|
]
|
|
2828
2850
|
}
|
|
2829
2851
|
);
|
|
@@ -2885,7 +2907,7 @@ function MultiSelectItemBase({
|
|
|
2885
2907
|
...props
|
|
2886
2908
|
}) {
|
|
2887
2909
|
const { toggleValue, selectedValues, onItemAdded } = useMultiSelectContext();
|
|
2888
|
-
const
|
|
2910
|
+
const [hovered, setHovered] = React32.useState(false);
|
|
2889
2911
|
React32.useEffect(() => {
|
|
2890
2912
|
onItemAdded(value, badgeLabel ?? children);
|
|
2891
2913
|
}, [value, children, onItemAdded, badgeLabel]);
|
|
@@ -2897,17 +2919,35 @@ function MultiSelectItemBase({
|
|
|
2897
2919
|
toggleValue(value);
|
|
2898
2920
|
onSelect?.(value);
|
|
2899
2921
|
},
|
|
2900
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2901
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "
|
|
2902
|
-
|
|
2922
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
2923
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children }),
|
|
2924
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2925
|
+
"div",
|
|
2903
2926
|
{
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2927
|
+
className: "relative flex h-4 w-4 shrink-0 items-center justify-center",
|
|
2928
|
+
onMouseEnter: () => setHovered(true),
|
|
2929
|
+
onMouseLeave: () => setHovered(false),
|
|
2930
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: selectedValues.has(value) && (hovered ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2931
|
+
framerMotion.motion.div,
|
|
2932
|
+
{
|
|
2933
|
+
initial: { scale: 0, rotate: -90, opacity: 0 },
|
|
2934
|
+
animate: { scale: 1, rotate: 0, opacity: 1 },
|
|
2935
|
+
transition: { duration: 0.05, ease: "easeOut" },
|
|
2936
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.XIcon, { className: "size-4 text-destructive" })
|
|
2937
|
+
},
|
|
2938
|
+
"x"
|
|
2939
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2940
|
+
framerMotion.motion.div,
|
|
2941
|
+
{
|
|
2942
|
+
initial: { scale: 0, rotate: 90, opacity: 0 },
|
|
2943
|
+
animate: { scale: 1, rotate: 0, opacity: 1 },
|
|
2944
|
+
transition: { duration: 0.05, ease: "easeOut" },
|
|
2945
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.CheckIcon, { className: "size-4" })
|
|
2946
|
+
},
|
|
2947
|
+
"check"
|
|
2948
|
+
)) })
|
|
2908
2949
|
}
|
|
2909
|
-
)
|
|
2910
|
-
children
|
|
2950
|
+
)
|
|
2911
2951
|
] })
|
|
2912
2952
|
}
|
|
2913
2953
|
);
|
|
@@ -3689,14 +3729,14 @@ var CardFooterBase = React32__namespace.forwardRef(({ className, testid: dataTes
|
|
|
3689
3729
|
}
|
|
3690
3730
|
));
|
|
3691
3731
|
CardFooterBase.displayName = "CardFooter";
|
|
3692
|
-
var
|
|
3693
|
-
Image:
|
|
3694
|
-
Document:
|
|
3695
|
-
Spreadsheet:
|
|
3696
|
-
Presentation:
|
|
3697
|
-
Video:
|
|
3698
|
-
Audio:
|
|
3699
|
-
All:
|
|
3732
|
+
var FileAccept = {
|
|
3733
|
+
Image: "image/*",
|
|
3734
|
+
Document: "pdf,doc,docx,txt,rtf",
|
|
3735
|
+
Spreadsheet: "xls,xlsx,csv",
|
|
3736
|
+
Presentation: "ppt,pptx",
|
|
3737
|
+
Video: "video/*",
|
|
3738
|
+
Audio: "audio/*",
|
|
3739
|
+
All: "*"
|
|
3700
3740
|
};
|
|
3701
3741
|
var formatFileSize = (bytes) => {
|
|
3702
3742
|
if (bytes === 0) return "0 Bytes";
|
|
@@ -3705,66 +3745,62 @@ var formatFileSize = (bytes) => {
|
|
|
3705
3745
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
3706
3746
|
return Math.round(bytes / Math.pow(k, i) * 100) / 100 + " " + sizes[i];
|
|
3707
3747
|
};
|
|
3708
|
-
var getFileExtension = (filename) =>
|
|
3709
|
-
|
|
3748
|
+
var getFileExtension = (filename) => filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2);
|
|
3749
|
+
var parseAcceptTokens = (accept) => accept.split(",").map((t) => t.trim().toLowerCase()).filter(Boolean);
|
|
3750
|
+
var validateFileAgainstAccept = (file, accept) => {
|
|
3751
|
+
if (!accept || accept === "*") return true;
|
|
3752
|
+
const tokens = parseAcceptTokens(accept);
|
|
3753
|
+
const ext = getFileExtension(file.name).toLowerCase();
|
|
3754
|
+
const mime = file.type.toLowerCase();
|
|
3755
|
+
return tokens.some((token) => {
|
|
3756
|
+
if (token.endsWith("/*")) return mime.startsWith(token.replace("/*", ""));
|
|
3757
|
+
const tokenExt = token.startsWith(".") ? token.substring(1) : token;
|
|
3758
|
+
if (!token.includes("/")) return ext === tokenExt;
|
|
3759
|
+
return mime === token;
|
|
3760
|
+
});
|
|
3761
|
+
};
|
|
3762
|
+
var formatAcceptForInput = (accept) => {
|
|
3763
|
+
if (!accept || accept === "*") return void 0;
|
|
3764
|
+
return parseAcceptTokens(accept).map((t) => t.includes("/") || t.startsWith(".") ? t : `.${t}`).join(",");
|
|
3710
3765
|
};
|
|
3711
3766
|
var getFileTypeIcon = (file) => {
|
|
3712
3767
|
const extension = getFileExtension(file.name).toLowerCase();
|
|
3713
3768
|
const mimeType = file.type.toLowerCase();
|
|
3714
|
-
if (extension === "pdf" || mimeType === "application/pdf")
|
|
3769
|
+
if (extension === "pdf" || mimeType === "application/pdf")
|
|
3715
3770
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FilePdfIcon, { size: 20, className: "text-red-500" });
|
|
3716
|
-
|
|
3717
|
-
if (["doc", "docx"].includes(extension) || mimeType.includes("word")) {
|
|
3771
|
+
if (["doc", "docx"].includes(extension) || mimeType.includes("word"))
|
|
3718
3772
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileDocIcon, { size: 20, className: "text-blue-500" });
|
|
3719
|
-
|
|
3720
|
-
if (["xls", "xlsx"].includes(extension) || mimeType.includes("sheet")) {
|
|
3773
|
+
if (["xls", "xlsx"].includes(extension) || mimeType.includes("sheet"))
|
|
3721
3774
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileXlsIcon, { size: 20, className: "text-green-500" });
|
|
3722
|
-
|
|
3723
|
-
if (["ppt", "pptx"].includes(extension) || mimeType.includes("presentation")) {
|
|
3775
|
+
if (["ppt", "pptx"].includes(extension) || mimeType.includes("presentation"))
|
|
3724
3776
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FilePptIcon, { size: 20, className: "text-orange-500" });
|
|
3725
|
-
|
|
3726
|
-
if (extension === "csv" || mimeType === "text/csv") {
|
|
3777
|
+
if (extension === "csv" || mimeType === "text/csv")
|
|
3727
3778
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileCsvIcon, { size: 20, className: "text-green-600" });
|
|
3728
|
-
}
|
|
3729
3779
|
if (["txt", "md", "json", "xml", "js", "ts", "html", "css"].includes(
|
|
3730
3780
|
extension
|
|
3731
|
-
) || mimeType.includes("text"))
|
|
3781
|
+
) || mimeType.includes("text"))
|
|
3732
3782
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileTextIcon, { size: 20, className: "text-gray-500" });
|
|
3733
|
-
|
|
3734
|
-
if (mimeType.startsWith("image/")) {
|
|
3783
|
+
if (mimeType.startsWith("image/"))
|
|
3735
3784
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileImageIcon, { size: 20, className: "text-purple-500" });
|
|
3736
|
-
|
|
3737
|
-
if (mimeType.startsWith("video/")) {
|
|
3785
|
+
if (mimeType.startsWith("video/"))
|
|
3738
3786
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileVideoIcon, { size: 20, className: "text-pink-500" });
|
|
3739
|
-
|
|
3740
|
-
if (mimeType.startsWith("audio/")) {
|
|
3787
|
+
if (mimeType.startsWith("audio/"))
|
|
3741
3788
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileAudioIcon, { size: 20, className: "text-indigo-500" });
|
|
3742
|
-
|
|
3743
|
-
if (["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
|
|
3789
|
+
if (["zip", "rar", "7z", "tar", "gz"].includes(extension))
|
|
3744
3790
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileZipIcon, { size: 20, className: "text-yellow-600" });
|
|
3745
|
-
}
|
|
3746
3791
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileIcon, { size: 20, className: "text-muted-foreground" });
|
|
3747
3792
|
};
|
|
3748
|
-
var createImagePreview = (file) => {
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
reader.onload = (e) => {
|
|
3756
|
-
resolve(e.target?.result);
|
|
3757
|
-
};
|
|
3758
|
-
reader.onerror = () => {
|
|
3759
|
-
resolve(null);
|
|
3760
|
-
};
|
|
3761
|
-
reader.readAsDataURL(file);
|
|
3762
|
-
});
|
|
3763
|
-
};
|
|
3793
|
+
var createImagePreview = (file) => new Promise((resolve) => {
|
|
3794
|
+
if (!file.type.startsWith("image/")) return resolve(null);
|
|
3795
|
+
const reader = new FileReader();
|
|
3796
|
+
reader.onload = (e) => resolve(e.target?.result);
|
|
3797
|
+
reader.onerror = () => resolve(null);
|
|
3798
|
+
reader.readAsDataURL(file);
|
|
3799
|
+
});
|
|
3764
3800
|
var FileUploader = React32__namespace.forwardRef(
|
|
3765
3801
|
({
|
|
3766
3802
|
className,
|
|
3767
|
-
accept =
|
|
3803
|
+
accept = "*",
|
|
3768
3804
|
maxSize = 10,
|
|
3769
3805
|
maxFiles = 1,
|
|
3770
3806
|
disabled = false,
|
|
@@ -3787,72 +3823,49 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3787
3823
|
}, [value]);
|
|
3788
3824
|
React32__namespace.useEffect(() => {
|
|
3789
3825
|
return () => {
|
|
3790
|
-
files.forEach((
|
|
3791
|
-
if (
|
|
3792
|
-
URL.revokeObjectURL(file.preview);
|
|
3793
|
-
}
|
|
3826
|
+
files.forEach((f) => {
|
|
3827
|
+
if (f.preview) URL.revokeObjectURL(f.preview);
|
|
3794
3828
|
});
|
|
3795
3829
|
};
|
|
3796
3830
|
}, [files]);
|
|
3797
3831
|
const validateFile = (file) => {
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
if (accept.length > 0) {
|
|
3803
|
-
const fileExtension = `.${getFileExtension(file.name)}`;
|
|
3804
|
-
const fileType = file.type;
|
|
3805
|
-
const isAccepted = accept.some((acceptItem) => {
|
|
3806
|
-
if (acceptItem.startsWith(".")) {
|
|
3807
|
-
return fileExtension.toLowerCase() === acceptItem.toLowerCase();
|
|
3808
|
-
}
|
|
3809
|
-
if (acceptItem.endsWith("/*")) {
|
|
3810
|
-
return fileType.startsWith(acceptItem.replace("/*", ""));
|
|
3811
|
-
}
|
|
3812
|
-
return fileType === acceptItem;
|
|
3813
|
-
});
|
|
3814
|
-
if (!isAccepted) {
|
|
3815
|
-
return `Tipo de arquivo n\xE3o permitido. Aceitos: ${accept.join(", ")}`;
|
|
3816
|
-
}
|
|
3817
|
-
}
|
|
3832
|
+
if (file.size > maxSize * 1024 * 1024)
|
|
3833
|
+
return `Arquivo muito grande. M\xE1ximo: ${maxSize}MB`;
|
|
3834
|
+
if (!validateFileAgainstAccept(file, accept))
|
|
3835
|
+
return `Tipo n\xE3o permitido. Aceitos: ${accept}`;
|
|
3818
3836
|
return null;
|
|
3819
3837
|
};
|
|
3820
3838
|
const createFileWithPreview = async (file) => {
|
|
3821
|
-
const
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
if (error) {
|
|
3825
|
-
fileWithPreview.error = error;
|
|
3826
|
-
}
|
|
3827
|
-
if (file.type.startsWith("image/")) {
|
|
3839
|
+
const f = file;
|
|
3840
|
+
f.id = `${file.name}-${Date.now()}-${Math.random()}`;
|
|
3841
|
+
f.error = validateFile(file) ?? void 0;
|
|
3842
|
+
if (!f.error && file.type.startsWith("image/")) {
|
|
3828
3843
|
try {
|
|
3829
3844
|
const preview = await createImagePreview(file);
|
|
3830
|
-
if (preview)
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
} catch (error2) {
|
|
3834
|
-
console.warn("Erro ao criar preview da imagem:", error2);
|
|
3845
|
+
if (preview) f.preview = preview;
|
|
3846
|
+
} catch (err) {
|
|
3847
|
+
console.warn("Erro ao criar preview:", err);
|
|
3835
3848
|
}
|
|
3836
3849
|
}
|
|
3837
|
-
return
|
|
3850
|
+
return f;
|
|
3838
3851
|
};
|
|
3839
3852
|
const handleFiles = async (newFiles) => {
|
|
3840
3853
|
if (disabled) return;
|
|
3841
|
-
const
|
|
3842
|
-
const filesToAdd = multiple ? newFiles.slice(0,
|
|
3843
|
-
const
|
|
3844
|
-
filesToAdd.map(
|
|
3854
|
+
const slots = maxFiles - files.length;
|
|
3855
|
+
const filesToAdd = multiple ? newFiles.slice(0, slots) : [newFiles[0]];
|
|
3856
|
+
const processed = await Promise.all(
|
|
3857
|
+
filesToAdd.map(createFileWithPreview)
|
|
3845
3858
|
);
|
|
3846
|
-
const
|
|
3847
|
-
setFiles(
|
|
3848
|
-
onValueChange(
|
|
3859
|
+
const updated = multiple ? [...files, ...processed] : processed;
|
|
3860
|
+
setFiles(updated);
|
|
3861
|
+
onValueChange(updated);
|
|
3849
3862
|
if (onUpload) {
|
|
3850
|
-
const
|
|
3851
|
-
if (
|
|
3863
|
+
const valid = processed.filter((f) => !f.error);
|
|
3864
|
+
if (valid.length > 0) {
|
|
3852
3865
|
try {
|
|
3853
|
-
await onUpload(
|
|
3854
|
-
} catch (
|
|
3855
|
-
console.error("Erro no upload:",
|
|
3866
|
+
await onUpload(valid);
|
|
3867
|
+
} catch (err) {
|
|
3868
|
+
console.error("Erro no upload:", err);
|
|
3856
3869
|
}
|
|
3857
3870
|
}
|
|
3858
3871
|
}
|
|
@@ -3861,17 +3874,12 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3861
3874
|
e.preventDefault();
|
|
3862
3875
|
e.stopPropagation();
|
|
3863
3876
|
dragCounterRef.current++;
|
|
3864
|
-
if (e.dataTransfer.items
|
|
3865
|
-
setIsDragging(true);
|
|
3866
|
-
}
|
|
3877
|
+
if (e.dataTransfer.items?.length > 0) setIsDragging(true);
|
|
3867
3878
|
};
|
|
3868
3879
|
const handleDragLeave = (e) => {
|
|
3869
3880
|
e.preventDefault();
|
|
3870
3881
|
e.stopPropagation();
|
|
3871
|
-
dragCounterRef.current
|
|
3872
|
-
if (dragCounterRef.current === 0) {
|
|
3873
|
-
setIsDragging(false);
|
|
3874
|
-
}
|
|
3882
|
+
if (--dragCounterRef.current === 0) setIsDragging(false);
|
|
3875
3883
|
};
|
|
3876
3884
|
const handleDragOver = (e) => {
|
|
3877
3885
|
e.preventDefault();
|
|
@@ -3882,43 +3890,19 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3882
3890
|
e.stopPropagation();
|
|
3883
3891
|
setIsDragging(false);
|
|
3884
3892
|
dragCounterRef.current = 0;
|
|
3885
|
-
if (disabled)
|
|
3886
|
-
const droppedFiles = Array.from(e.dataTransfer.files);
|
|
3887
|
-
handleFiles(droppedFiles);
|
|
3893
|
+
if (!disabled) handleFiles(Array.from(e.dataTransfer.files));
|
|
3888
3894
|
};
|
|
3889
3895
|
const handleInputChange = (e) => {
|
|
3890
|
-
if (e.target.files)
|
|
3891
|
-
const selectedFiles = Array.from(e.target.files);
|
|
3892
|
-
handleFiles(selectedFiles);
|
|
3893
|
-
}
|
|
3896
|
+
if (e.target.files) handleFiles(Array.from(e.target.files));
|
|
3894
3897
|
};
|
|
3895
3898
|
const handleRemoveFile = (fileId) => {
|
|
3896
|
-
const
|
|
3897
|
-
if (
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
setFiles(updatedFiles);
|
|
3902
|
-
onValueChange(updatedFiles);
|
|
3903
|
-
};
|
|
3904
|
-
const handleClick = () => {
|
|
3905
|
-
if (!disabled) {
|
|
3906
|
-
inputRef.current?.click();
|
|
3907
|
-
}
|
|
3899
|
+
const target = files.find((f) => f.id === fileId);
|
|
3900
|
+
if (target?.preview) URL.revokeObjectURL(target.preview);
|
|
3901
|
+
const updated = files.filter((f) => f.id !== fileId);
|
|
3902
|
+
setFiles(updated);
|
|
3903
|
+
onValueChange(updated);
|
|
3908
3904
|
};
|
|
3909
|
-
const
|
|
3910
|
-
const getFormatText = () => {
|
|
3911
|
-
if (accept === FileTypes.All || accept.length === 0)
|
|
3912
|
-
return "Qualquer formato";
|
|
3913
|
-
if (accept === FileTypes.Image) return "Apenas imagens";
|
|
3914
|
-
if (accept === FileTypes.Document) return "Apenas documentos";
|
|
3915
|
-
if (accept === FileTypes.Video) return "Apenas v\xEDdeos";
|
|
3916
|
-
if (accept === FileTypes.Audio) return "Apenas \xE1udio";
|
|
3917
|
-
if (accept === FileTypes.Spreadsheet) return "Apenas planilhas";
|
|
3918
|
-
if (accept === FileTypes.Presentation) return "Apenas apresenta\xE7\xF5es";
|
|
3919
|
-
return "Formatos espec\xEDficos v\xE1lidos";
|
|
3920
|
-
};
|
|
3921
|
-
const defaultSubtext = dropzoneSubtext || `${getFormatText()} (M\xE1x: ${maxSize}MB)`;
|
|
3905
|
+
const defaultSubtext = dropzoneSubtext ?? `${accept === "*" ? "Qualquer formato" : accept} (M\xE1x: ${maxSize}MB)`;
|
|
3922
3906
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3923
3907
|
framerMotion.motion.div,
|
|
3924
3908
|
{
|
|
@@ -3932,7 +3916,7 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3932
3916
|
onDragOver: handleDragOver,
|
|
3933
3917
|
onDragLeave: handleDragLeave,
|
|
3934
3918
|
onDrop: handleDrop,
|
|
3935
|
-
onClick:
|
|
3919
|
+
onClick: () => !disabled && inputRef.current?.click(),
|
|
3936
3920
|
whileTap: !disabled ? { scale: 0.99 } : void 0,
|
|
3937
3921
|
animate: isDragging ? {
|
|
3938
3922
|
borderColor: `hsl(var(--primary))`,
|
|
@@ -3943,12 +3927,7 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3943
3927
|
backgroundColor: `hsl(var(--background))`,
|
|
3944
3928
|
scale: 1
|
|
3945
3929
|
},
|
|
3946
|
-
transition: {
|
|
3947
|
-
type: "spring",
|
|
3948
|
-
stiffness: 300,
|
|
3949
|
-
damping: 25,
|
|
3950
|
-
duration: 0.3
|
|
3951
|
-
},
|
|
3930
|
+
transition: { type: "spring", stiffness: 300, damping: 25 },
|
|
3952
3931
|
children: [
|
|
3953
3932
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3954
3933
|
"input",
|
|
@@ -3956,7 +3935,7 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3956
3935
|
ref: inputRef,
|
|
3957
3936
|
type: "file",
|
|
3958
3937
|
className: "hidden",
|
|
3959
|
-
accept:
|
|
3938
|
+
accept: formatAcceptForInput(accept),
|
|
3960
3939
|
multiple,
|
|
3961
3940
|
disabled,
|
|
3962
3941
|
onChange: handleInputChange
|
|
@@ -3966,20 +3945,11 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3966
3945
|
framerMotion.motion.div,
|
|
3967
3946
|
{
|
|
3968
3947
|
animate: isDragging ? { scale: 1.2, rotate: 10 } : { scale: 1, rotate: 0 },
|
|
3969
|
-
transition: {
|
|
3970
|
-
type: "spring",
|
|
3971
|
-
stiffness: 300,
|
|
3972
|
-
damping: 20,
|
|
3973
|
-
duration: 0.3
|
|
3974
|
-
},
|
|
3948
|
+
transition: { type: "spring", stiffness: 300, damping: 20 },
|
|
3975
3949
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3976
3950
|
framerMotion.motion.div,
|
|
3977
3951
|
{
|
|
3978
|
-
className:
|
|
3979
|
-
"mb-4 h-16 w-16 text-muted-foreground transition-colors duration-300 drop-shadow-lg flex items-center justify-center",
|
|
3980
|
-
isDragging && "text-primary"
|
|
3981
|
-
),
|
|
3982
|
-
initial: false,
|
|
3952
|
+
className: "mb-4 h-16 w-16 drop-shadow-lg flex items-center justify-center",
|
|
3983
3953
|
animate: {
|
|
3984
3954
|
color: isDragging ? `hsl(var(--primary))` : `hsl(var(--muted-foreground))`
|
|
3985
3955
|
},
|
|
@@ -4009,14 +3979,14 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
4009
3979
|
children: defaultSubtext
|
|
4010
3980
|
}
|
|
4011
3981
|
),
|
|
4012
|
-
showPreview && files.length > 0 && /* @__PURE__ */ jsxRuntime.
|
|
3982
|
+
showPreview && files.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4013
3983
|
framerMotion.motion.div,
|
|
4014
3984
|
{
|
|
4015
3985
|
className: "py-2 w-full",
|
|
4016
3986
|
initial: animate ? { opacity: 0, y: 10 } : false,
|
|
4017
3987
|
animate: { opacity: 1, y: 0 },
|
|
4018
3988
|
transition: { delay: 0.3 },
|
|
4019
|
-
children:
|
|
3989
|
+
children: [
|
|
4020
3990
|
/* @__PURE__ */ jsxRuntime.jsxs("h4", { className: "text-xs font-medium text-muted-foreground pb-0.5", children: [
|
|
4021
3991
|
"Arquivos selecionados (",
|
|
4022
3992
|
files.length,
|
|
@@ -4095,7 +4065,7 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
4095
4065
|
},
|
|
4096
4066
|
file.id
|
|
4097
4067
|
)) }) })
|
|
4098
|
-
]
|
|
4068
|
+
]
|
|
4099
4069
|
}
|
|
4100
4070
|
)
|
|
4101
4071
|
]
|
|
@@ -9949,6 +9919,7 @@ function Select({
|
|
|
9949
9919
|
{
|
|
9950
9920
|
className: cn(
|
|
9951
9921
|
"flex items-center gap-2 justify-between [&>div]:line-clamp-1 [&>span]:line-clamp-1 relative",
|
|
9922
|
+
!selected && "text-muted-foreground",
|
|
9952
9923
|
error && "border-red-500",
|
|
9953
9924
|
className
|
|
9954
9925
|
),
|
|
@@ -14522,6 +14493,7 @@ function MultiSelect({
|
|
|
14522
14493
|
{
|
|
14523
14494
|
className: cn(
|
|
14524
14495
|
"flex items-center gap-2 justify-between hover:bg-muted transition-all duration-150",
|
|
14496
|
+
!selected && "text-muted-foreground",
|
|
14525
14497
|
error && "border-red-500",
|
|
14526
14498
|
className
|
|
14527
14499
|
),
|
|
@@ -16270,11 +16242,12 @@ var SystemTooltip = ({
|
|
|
16270
16242
|
isLoading = false,
|
|
16271
16243
|
onMouseDown,
|
|
16272
16244
|
onClose,
|
|
16273
|
-
onPositionChange
|
|
16245
|
+
onPositionChange,
|
|
16246
|
+
onConnectionClick,
|
|
16247
|
+
onProcessClick
|
|
16274
16248
|
}) => {
|
|
16275
16249
|
const [localPos, setLocalPos] = React32.useState(position);
|
|
16276
16250
|
const [dragging, setDragging] = React32.useState(false);
|
|
16277
|
-
const [expandedId, setExpandedId] = React32.useState(null);
|
|
16278
16251
|
const offsetRef = React32.useRef({ x: 0, y: 0 });
|
|
16279
16252
|
const lastMouse = React32.useRef({ x: 0, y: 0 });
|
|
16280
16253
|
React32.useEffect(() => setLocalPos(position), [position]);
|
|
@@ -16345,6 +16318,19 @@ var SystemTooltip = ({
|
|
|
16345
16318
|
},
|
|
16346
16319
|
[id, onMouseDown]
|
|
16347
16320
|
);
|
|
16321
|
+
const handleConnClick = React32.useCallback(
|
|
16322
|
+
(e, conn) => {
|
|
16323
|
+
e.stopPropagation();
|
|
16324
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
16325
|
+
const pos = { x: rect.right + 8, y: rect.top };
|
|
16326
|
+
if (conn.integration?.Nome) {
|
|
16327
|
+
onProcessClick?.(conn, pos);
|
|
16328
|
+
} else {
|
|
16329
|
+
onConnectionClick?.(conn, pos);
|
|
16330
|
+
}
|
|
16331
|
+
},
|
|
16332
|
+
[onConnectionClick, onProcessClick]
|
|
16333
|
+
);
|
|
16348
16334
|
const entries = React32.useMemo(
|
|
16349
16335
|
() => data.connections.filter((c) => c.type === "entrada"),
|
|
16350
16336
|
[data.connections]
|
|
@@ -16353,6 +16339,28 @@ var SystemTooltip = ({
|
|
|
16353
16339
|
() => data.connections.filter((c) => c.type === "saida"),
|
|
16354
16340
|
[data.connections]
|
|
16355
16341
|
);
|
|
16342
|
+
const renderConnections = (connections, color) => {
|
|
16343
|
+
const isEmerald = color === "emerald";
|
|
16344
|
+
return connections.map((conn) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16345
|
+
"div",
|
|
16346
|
+
{
|
|
16347
|
+
className: `group flex items-center justify-between p-2 rounded-lg cursor-pointer transition-all
|
|
16348
|
+
${isEmerald ? "bg-emerald-500/5 border border-emerald-500/10 hover:border-emerald-500/30" : "bg-blue-500/5 border border-blue-500/10 hover:border-blue-500/30"}`,
|
|
16349
|
+
onClick: (e) => handleConnClick(e, conn),
|
|
16350
|
+
children: [
|
|
16351
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium truncate", children: conn.name }) }),
|
|
16352
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16353
|
+
react.ArrowRightIcon,
|
|
16354
|
+
{
|
|
16355
|
+
size: 14,
|
|
16356
|
+
className: `shrink-0 ${isEmerald ? "text-emerald-500 rotate-180" : "text-blue-500"}`
|
|
16357
|
+
}
|
|
16358
|
+
)
|
|
16359
|
+
]
|
|
16360
|
+
},
|
|
16361
|
+
conn.id
|
|
16362
|
+
));
|
|
16363
|
+
};
|
|
16356
16364
|
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16357
16365
|
framerMotion.motion.div,
|
|
16358
16366
|
{
|
|
@@ -16370,7 +16378,7 @@ var SystemTooltip = ({
|
|
|
16370
16378
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16371
16379
|
"div",
|
|
16372
16380
|
{
|
|
16373
|
-
className: "flex items-center justify-between py-1 border-b border-border/10 bg-muted/30
|
|
16381
|
+
className: "flex items-center justify-between py-1 border-b border-border/10 bg-muted/30",
|
|
16374
16382
|
onMouseDown: handleMouseDownLocal,
|
|
16375
16383
|
onTouchStart: handleTouchStartLocal,
|
|
16376
16384
|
style: {
|
|
@@ -16390,7 +16398,7 @@ var SystemTooltip = ({
|
|
|
16390
16398
|
onClick: () => onClose(id),
|
|
16391
16399
|
className: "text-muted-foreground hover:text-destructive transition-colors hover:bg-destructive/10 mr-1",
|
|
16392
16400
|
style: { cursor: "pointer" },
|
|
16393
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16401
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.XIcon, { size: 16 })
|
|
16394
16402
|
}
|
|
16395
16403
|
)
|
|
16396
16404
|
]
|
|
@@ -16403,7 +16411,7 @@ var SystemTooltip = ({
|
|
|
16403
16411
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-bold text-foreground tracking-tight truncate", children: data.name }),
|
|
16404
16412
|
data.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground tracking-tight truncate", children: data.description })
|
|
16405
16413
|
] }) }),
|
|
16406
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 pb-4 space-y-4 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w- [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/40 transition-colors", children: [
|
|
16414
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 pb-4 space-y-4 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/40 transition-colors", children: [
|
|
16407
16415
|
/* @__PURE__ */ jsxRuntime.jsx(SeparatorBase, { className: "w-full" }),
|
|
16408
16416
|
isLoading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16409
16417
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
@@ -16426,128 +16434,14 @@ var SystemTooltip = ({
|
|
|
16426
16434
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-emerald-500" }),
|
|
16427
16435
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold text-muted-foreground uppercase", children: "Entradas" })
|
|
16428
16436
|
] }),
|
|
16429
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: entries
|
|
16430
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16431
|
-
"div",
|
|
16432
|
-
{
|
|
16433
|
-
className: "group flex items-center justify-between p-2 rounded-lg bg-emerald-500/5 border border-emerald-500/10 hover:border-emerald-500/30 transition-all cursor-pointer",
|
|
16434
|
-
onClick: () => setExpandedId(
|
|
16435
|
-
expandedId === conn.id ? null : conn.id
|
|
16436
|
-
),
|
|
16437
|
-
children: [
|
|
16438
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium truncate", children: conn.name }) }),
|
|
16439
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16440
|
-
react.ArrowRight,
|
|
16441
|
-
{
|
|
16442
|
-
size: 14,
|
|
16443
|
-
className: "text-emerald-500 shrink-0 rotate-180"
|
|
16444
|
-
}
|
|
16445
|
-
)
|
|
16446
|
-
]
|
|
16447
|
-
}
|
|
16448
|
-
),
|
|
16449
|
-
expandedId === conn.id && conn.integration && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-2 p-2 rounded-lg bg-muted/30 border border-border/20 text-xs space-y-1", children: [
|
|
16450
|
-
conn.integration.Nome && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16451
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Nome:" }),
|
|
16452
|
-
" ",
|
|
16453
|
-
conn.integration.Nome
|
|
16454
|
-
] }),
|
|
16455
|
-
(conn.integration.tipo || conn.integration.Tipo) && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16456
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Tipo:" }),
|
|
16457
|
-
" ",
|
|
16458
|
-
conn.integration.tipo || conn.integration.Tipo
|
|
16459
|
-
] }),
|
|
16460
|
-
conn.integration.Protocolos && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16461
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Protocolos:" }),
|
|
16462
|
-
" ",
|
|
16463
|
-
conn.integration.Protocolos
|
|
16464
|
-
] }),
|
|
16465
|
-
conn.integration.Ambiente && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16466
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Ambiente:" }),
|
|
16467
|
-
" ",
|
|
16468
|
-
conn.integration.Ambiente
|
|
16469
|
-
] }),
|
|
16470
|
-
conn.integration.Setor && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16471
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Setor:" }),
|
|
16472
|
-
" ",
|
|
16473
|
-
conn.integration.Setor
|
|
16474
|
-
] }),
|
|
16475
|
-
conn.integration.Contato && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16476
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Contato:" }),
|
|
16477
|
-
" ",
|
|
16478
|
-
conn.integration.Contato
|
|
16479
|
-
] }),
|
|
16480
|
-
conn.integration.Sustentacao && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16481
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Sustenta\xE7\xE3o:" }),
|
|
16482
|
-
" ",
|
|
16483
|
-
conn.integration.Sustentacao
|
|
16484
|
-
] })
|
|
16485
|
-
] })
|
|
16486
|
-
] }, conn.id)) })
|
|
16437
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: renderConnections(entries, "emerald") })
|
|
16487
16438
|
] }),
|
|
16488
16439
|
exits.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
16489
16440
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-1", children: [
|
|
16490
16441
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-blue-500" }),
|
|
16491
16442
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold text-muted-foreground uppercase", children: "Sa\xEDdas" })
|
|
16492
16443
|
] }),
|
|
16493
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: exits
|
|
16494
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16495
|
-
"div",
|
|
16496
|
-
{
|
|
16497
|
-
className: "group flex items-center justify-between p-2 rounded-lg bg-blue-500/5 border border-blue-500/10 hover:border-blue-500/30 transition-all cursor-pointer",
|
|
16498
|
-
onClick: () => setExpandedId(
|
|
16499
|
-
expandedId === conn.id ? null : conn.id
|
|
16500
|
-
),
|
|
16501
|
-
children: [
|
|
16502
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium truncate", children: conn.name }) }),
|
|
16503
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16504
|
-
react.ArrowRight,
|
|
16505
|
-
{
|
|
16506
|
-
size: 14,
|
|
16507
|
-
className: "text-blue-500 shrink-0"
|
|
16508
|
-
}
|
|
16509
|
-
)
|
|
16510
|
-
]
|
|
16511
|
-
}
|
|
16512
|
-
),
|
|
16513
|
-
expandedId === conn.id && conn.integration && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-2 p-2 rounded-lg bg-muted/30 border border-border/20 text-xs space-y-1", children: [
|
|
16514
|
-
conn.integration.Nome && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16515
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Nome:" }),
|
|
16516
|
-
" ",
|
|
16517
|
-
conn.integration.Nome
|
|
16518
|
-
] }),
|
|
16519
|
-
(conn.integration.tipo || conn.integration.Tipo) && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16520
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Tipo:" }),
|
|
16521
|
-
" ",
|
|
16522
|
-
conn.integration.tipo || conn.integration.Tipo
|
|
16523
|
-
] }),
|
|
16524
|
-
conn.integration.Protocolos && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16525
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Protocolos:" }),
|
|
16526
|
-
" ",
|
|
16527
|
-
conn.integration.Protocolos
|
|
16528
|
-
] }),
|
|
16529
|
-
conn.integration.Ambiente && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16530
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Ambiente:" }),
|
|
16531
|
-
" ",
|
|
16532
|
-
conn.integration.Ambiente
|
|
16533
|
-
] }),
|
|
16534
|
-
conn.integration.Setor && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16535
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Setor:" }),
|
|
16536
|
-
" ",
|
|
16537
|
-
conn.integration.Setor
|
|
16538
|
-
] }),
|
|
16539
|
-
conn.integration.Contato && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16540
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Contato:" }),
|
|
16541
|
-
" ",
|
|
16542
|
-
conn.integration.Contato
|
|
16543
|
-
] }),
|
|
16544
|
-
conn.integration.Sustentacao && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16545
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Sustenta\xE7\xE3o:" }),
|
|
16546
|
-
" ",
|
|
16547
|
-
conn.integration.Sustentacao
|
|
16548
|
-
] })
|
|
16549
|
-
] })
|
|
16550
|
-
] }, conn.id)) })
|
|
16444
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: renderConnections(exits, "blue") })
|
|
16551
16445
|
] }),
|
|
16552
16446
|
data.connections.length === 0 && !isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center justify-center p-6 text-center", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Nenhuma conex\xE3o encontrada" }) })
|
|
16553
16447
|
] })
|
|
@@ -16571,6 +16465,78 @@ var useIsTruncated = (ref) => {
|
|
|
16571
16465
|
}, [ref]);
|
|
16572
16466
|
return truncated;
|
|
16573
16467
|
};
|
|
16468
|
+
var CopyData = ({ value }) => {
|
|
16469
|
+
const [copied, setCopied] = React32.useState(false);
|
|
16470
|
+
const handleCopy = React32.useCallback(() => {
|
|
16471
|
+
navigator.clipboard.writeText(value).then(() => {
|
|
16472
|
+
setCopied(true);
|
|
16473
|
+
setTimeout(() => setCopied(false), 1500);
|
|
16474
|
+
});
|
|
16475
|
+
}, [value]);
|
|
16476
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
16477
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16478
|
+
"button",
|
|
16479
|
+
{
|
|
16480
|
+
onClick: handleCopy,
|
|
16481
|
+
className: "shrink-0 p-0.5 rounded transition-colors text-muted-foreground/40 hover:text-foreground hover:bg-muted",
|
|
16482
|
+
style: { cursor: "pointer" },
|
|
16483
|
+
children: copied ? /* @__PURE__ */ jsxRuntime.jsx(react.CheckIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(react.CopyIcon, {})
|
|
16484
|
+
}
|
|
16485
|
+
) }),
|
|
16486
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContentBase, { sideOffset: 6, className: "z-[10001]", children: copied ? "Copiado!" : "Copiar" })
|
|
16487
|
+
] }) });
|
|
16488
|
+
};
|
|
16489
|
+
var propertyLabels = {
|
|
16490
|
+
Nome: "Nome",
|
|
16491
|
+
tipo: "Tipo",
|
|
16492
|
+
Tipo: "Tipo",
|
|
16493
|
+
Protocolos: "Protocolos",
|
|
16494
|
+
Ambiente: "Ambiente",
|
|
16495
|
+
Setor: "Setor",
|
|
16496
|
+
Contato: "Contato",
|
|
16497
|
+
Sustentacao: "Sustenta\xE7\xE3o",
|
|
16498
|
+
Destino: "Destino",
|
|
16499
|
+
Origem: "Origem"
|
|
16500
|
+
};
|
|
16501
|
+
var IntegrationCard = ({ title, details }) => {
|
|
16502
|
+
const titleRef = React32.useRef(null);
|
|
16503
|
+
const isTitleTruncated = useIsTruncated(titleRef);
|
|
16504
|
+
const blackList = ["id", "elementId", "identity"];
|
|
16505
|
+
const entries = details ? Object.entries(details).filter(
|
|
16506
|
+
([key, value]) => value !== void 0 && value !== null && value !== "" && !blackList.includes(key)
|
|
16507
|
+
) : [];
|
|
16508
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-border/40 bg-muted/20 overflow-hidden", children: [
|
|
16509
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-3 py-2 border-b border-border/30", children: [
|
|
16510
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
16511
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16512
|
+
"span",
|
|
16513
|
+
{
|
|
16514
|
+
ref: titleRef,
|
|
16515
|
+
className: "text-sm font-bold text-foreground truncate flex-1 min-w-0 cursor-default",
|
|
16516
|
+
children: title
|
|
16517
|
+
}
|
|
16518
|
+
) }),
|
|
16519
|
+
isTitleTruncated && /* @__PURE__ */ jsxRuntime.jsx(TooltipContentBase, { sideOffset: 6, className: "z-[10001]", children: title })
|
|
16520
|
+
] }) }),
|
|
16521
|
+
entries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16522
|
+
CopyData,
|
|
16523
|
+
{
|
|
16524
|
+
value: entries.map(([k, v]) => `${propertyLabels[k] || k}: ${String(v)}`).join("\n")
|
|
16525
|
+
}
|
|
16526
|
+
)
|
|
16527
|
+
] }),
|
|
16528
|
+
entries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "divide-y divide-border/20 px-0.5", children: entries.map(([key, value]) => {
|
|
16529
|
+
const label = propertyLabels[key] || key;
|
|
16530
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [
|
|
16531
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs font-semibold text-muted-foreground shrink-0 w-[40%] sm:w-[38%]", children: [
|
|
16532
|
+
label,
|
|
16533
|
+
":"
|
|
16534
|
+
] }),
|
|
16535
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-foreground break-all flex-1 min-w-0", children: String(value) })
|
|
16536
|
+
] }, key);
|
|
16537
|
+
}) })
|
|
16538
|
+
] });
|
|
16539
|
+
};
|
|
16574
16540
|
var NameTooltip = ({
|
|
16575
16541
|
name,
|
|
16576
16542
|
description
|
|
@@ -16581,7 +16547,7 @@ var NameTooltip = ({
|
|
|
16581
16547
|
const isDescTruncated = useIsTruncated(descRef);
|
|
16582
16548
|
const showTooltip = isNameTruncated || isDescTruncated;
|
|
16583
16549
|
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
16584
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cursor-default", children: [
|
|
16550
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cursor-default min-w-0", children: [
|
|
16585
16551
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16586
16552
|
"h3",
|
|
16587
16553
|
{
|
|
@@ -16608,7 +16574,7 @@ var NameTooltip = ({
|
|
|
16608
16574
|
var SystemNode = ({ label }) => {
|
|
16609
16575
|
const truncated = label.length > 9 ? label.substring(0, 9) + "\u2026" : label;
|
|
16610
16576
|
const needsTooltip = label.length > 9;
|
|
16611
|
-
const circle = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[76px] h-[76px] rounded-full bg-primary flex items-center justify-center shrink-0 z-10 cursor-default", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold text-primary-foreground text-center px-2 leading-tight select-none", children: truncated }) });
|
|
16577
|
+
const circle = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[76px] h-[76px] rounded-full bg-primary flex items-center justify-center shrink-0 z-10 cursor-default max-w-xs", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold text-primary-foreground text-center px-2 leading-tight select-none", children: truncated }) });
|
|
16612
16578
|
if (!needsTooltip) return circle;
|
|
16613
16579
|
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
16614
16580
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: circle }),
|
|
@@ -16655,14 +16621,13 @@ var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
|
|
|
16655
16621
|
if (leftRef.current) ro.observe(leftRef.current);
|
|
16656
16622
|
if (rightRef.current) ro.observe(rightRef.current);
|
|
16657
16623
|
const mo = new MutationObserver(schedule);
|
|
16658
|
-
|
|
16659
|
-
|
|
16660
|
-
|
|
16661
|
-
|
|
16662
|
-
|
|
16663
|
-
|
|
16664
|
-
|
|
16665
|
-
});
|
|
16624
|
+
if (containerRef.current) {
|
|
16625
|
+
mo.observe(containerRef.current, {
|
|
16626
|
+
attributes: true,
|
|
16627
|
+
attributeFilter: ["class", "style"],
|
|
16628
|
+
subtree: true
|
|
16629
|
+
});
|
|
16630
|
+
}
|
|
16666
16631
|
return () => {
|
|
16667
16632
|
cancelAnimationFrame(rafId);
|
|
16668
16633
|
ro.disconnect();
|
|
@@ -16675,7 +16640,7 @@ var Beam = ({ isInput, containerRef, leftRef, rightRef }) => {
|
|
|
16675
16640
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16676
16641
|
"svg",
|
|
16677
16642
|
{
|
|
16678
|
-
className: "pointer-events-none absolute left-0 top-0",
|
|
16643
|
+
className: "pointer-events-none absolute left-0 top-0 right-0",
|
|
16679
16644
|
width: svgSize.w,
|
|
16680
16645
|
height: svgSize.h,
|
|
16681
16646
|
fill: "none",
|
|
@@ -16740,7 +16705,7 @@ var SystemsDiagram = ({ isInput, currentSystem, externalSystem }) => {
|
|
|
16740
16705
|
"div",
|
|
16741
16706
|
{
|
|
16742
16707
|
ref: containerRef,
|
|
16743
|
-
className: "relative flex items-center justify-between py-1 px-
|
|
16708
|
+
className: "relative flex items-center justify-between py-1 px-6 max-w-xs",
|
|
16744
16709
|
children: [
|
|
16745
16710
|
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: leftRef, children: /* @__PURE__ */ jsxRuntime.jsx(SystemNode, { label: isInput ? externalSystem : currentSystem }) }),
|
|
16746
16711
|
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: rightRef, children: /* @__PURE__ */ jsxRuntime.jsx(SystemNode, { label: isInput ? currentSystem : externalSystem }) }),
|
|
@@ -16757,110 +16722,7 @@ var SystemsDiagram = ({ isInput, currentSystem, externalSystem }) => {
|
|
|
16757
16722
|
}
|
|
16758
16723
|
);
|
|
16759
16724
|
};
|
|
16760
|
-
var
|
|
16761
|
-
const [copied, setCopied] = React32.useState(false);
|
|
16762
|
-
const handleCopy = React32.useCallback(() => {
|
|
16763
|
-
navigator.clipboard.writeText(value).then(() => {
|
|
16764
|
-
setCopied(true);
|
|
16765
|
-
setTimeout(() => setCopied(false), 1500);
|
|
16766
|
-
});
|
|
16767
|
-
}, [value]);
|
|
16768
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
16769
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16770
|
-
"button",
|
|
16771
|
-
{
|
|
16772
|
-
onClick: handleCopy,
|
|
16773
|
-
className: "shrink-0 p-0.5 rounded transition-colors text-muted-foreground/40 hover:text-foreground hover:bg-muted",
|
|
16774
|
-
style: { cursor: "pointer" },
|
|
16775
|
-
children: copied ? /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16776
|
-
"path",
|
|
16777
|
-
{
|
|
16778
|
-
d: "M3 8l3.5 3.5L13 4.5",
|
|
16779
|
-
stroke: "currentColor",
|
|
16780
|
-
strokeWidth: "2",
|
|
16781
|
-
strokeLinecap: "round",
|
|
16782
|
-
strokeLinejoin: "round"
|
|
16783
|
-
}
|
|
16784
|
-
) }) : /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", children: [
|
|
16785
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16786
|
-
"rect",
|
|
16787
|
-
{
|
|
16788
|
-
x: "5",
|
|
16789
|
-
y: "5",
|
|
16790
|
-
width: "8",
|
|
16791
|
-
height: "9",
|
|
16792
|
-
rx: "1.5",
|
|
16793
|
-
stroke: "currentColor",
|
|
16794
|
-
strokeWidth: "1.5"
|
|
16795
|
-
}
|
|
16796
|
-
),
|
|
16797
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16798
|
-
"path",
|
|
16799
|
-
{
|
|
16800
|
-
d: "M3 11V3.5A1.5 1.5 0 0 1 4.5 2H11",
|
|
16801
|
-
stroke: "currentColor",
|
|
16802
|
-
strokeWidth: "1.5",
|
|
16803
|
-
strokeLinecap: "round"
|
|
16804
|
-
}
|
|
16805
|
-
)
|
|
16806
|
-
] })
|
|
16807
|
-
}
|
|
16808
|
-
) }),
|
|
16809
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContentBase, { sideOffset: 6, className: "z-[10001]", children: copied ? "Copiado!" : "Copiar" })
|
|
16810
|
-
] }) });
|
|
16811
|
-
};
|
|
16812
|
-
var propertyLabels = {
|
|
16813
|
-
Nome: "Nome",
|
|
16814
|
-
tipo: "Tipo",
|
|
16815
|
-
Tipo: "Tipo",
|
|
16816
|
-
Protocolos: "Protocolos",
|
|
16817
|
-
Ambiente: "Ambiente",
|
|
16818
|
-
Setor: "Setor",
|
|
16819
|
-
Contato: "Contato",
|
|
16820
|
-
Sustentacao: "Sustenta\xE7\xE3o",
|
|
16821
|
-
Destino: "Destino",
|
|
16822
|
-
Origem: "Origem"
|
|
16823
|
-
};
|
|
16824
|
-
var IntegrationCard = ({ title, details }) => {
|
|
16825
|
-
const titleRef = React32.useRef(null);
|
|
16826
|
-
const isTitleTruncated = useIsTruncated(titleRef);
|
|
16827
|
-
const blackList = ["id", "elementId", "identity"];
|
|
16828
|
-
const entries = details ? Object.entries(details).filter(
|
|
16829
|
-
([key, value]) => value !== void 0 && value !== null && value !== "" && !blackList.includes(key)
|
|
16830
|
-
) : [];
|
|
16831
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-sm border border-border/40 bg-muted/20 overflow-hidden", children: [
|
|
16832
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-3 py-2 border-b border-border/30", children: [
|
|
16833
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipProviderBase, { children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipBase, { children: [
|
|
16834
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16835
|
-
"span",
|
|
16836
|
-
{
|
|
16837
|
-
ref: titleRef,
|
|
16838
|
-
className: "text-sm font-bold text-foreground truncate flex-1 cursor-default",
|
|
16839
|
-
children: title
|
|
16840
|
-
}
|
|
16841
|
-
) }),
|
|
16842
|
-
isTitleTruncated && /* @__PURE__ */ jsxRuntime.jsx(TooltipContentBase, { sideOffset: 6, className: "z-[10001]", children: title })
|
|
16843
|
-
] }) }),
|
|
16844
|
-
entries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16845
|
-
CopyData,
|
|
16846
|
-
{
|
|
16847
|
-
value: entries.map(([k, v]) => `${propertyLabels[k] || k}: ${String(v)}`).join("\n")
|
|
16848
|
-
}
|
|
16849
|
-
)
|
|
16850
|
-
] }),
|
|
16851
|
-
entries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "divide-y divide-border/20", children: entries.map(([key, value]) => {
|
|
16852
|
-
const label = propertyLabels[key] || key;
|
|
16853
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [
|
|
16854
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs font-semibold text-muted-foreground shrink-0 w-[40%] sm:w-[38%]", children: [
|
|
16855
|
-
label,
|
|
16856
|
-
":"
|
|
16857
|
-
] }),
|
|
16858
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-foreground break-all flex-1", children: String(value) })
|
|
16859
|
-
] }, key);
|
|
16860
|
-
}) })
|
|
16861
|
-
] });
|
|
16862
|
-
};
|
|
16863
|
-
var TooltipBodyComponent = ({ data, isLoading, connections, isInput, externalSystem }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-3 space-y-3 overflow-y-auto flex-1 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/40 transition-colors", children: [
|
|
16725
|
+
var TooltipBodyComponent = ({ data, isLoading, connections, isInput, externalSystem }) => /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaBase, { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-3 space-y-3 max-w-xs", children: [
|
|
16864
16726
|
isLoading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
16865
16727
|
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-6 w-3/4" }),
|
|
16866
16728
|
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-3.5 w-1/2" })
|
|
@@ -16883,7 +16745,7 @@ var TooltipBodyComponent = ({ data, isLoading, connections, isInput, externalSys
|
|
|
16883
16745
|
},
|
|
16884
16746
|
i
|
|
16885
16747
|
))
|
|
16886
|
-
] }) : connections.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground text-center
|
|
16748
|
+
] }) : connections.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground text-center", children: "Nenhuma conex\xE3o encontrada" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16887
16749
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16888
16750
|
SystemsDiagram,
|
|
16889
16751
|
{
|
|
@@ -16893,8 +16755,8 @@ var TooltipBodyComponent = ({ data, isLoading, connections, isInput, externalSys
|
|
|
16893
16755
|
}
|
|
16894
16756
|
),
|
|
16895
16757
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/20" }),
|
|
16896
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center
|
|
16897
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
16758
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center ", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold text-muted-foreground uppercase -mb-2", children: isInput ? "Informa\xE7\xF5es de Entrada" : "Informa\xE7\xF5es de Sa\xEDda" }) }),
|
|
16759
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: connections.map((conn) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
16898
16760
|
IntegrationCard,
|
|
16899
16761
|
{
|
|
16900
16762
|
title: conn.name,
|
|
@@ -16903,7 +16765,7 @@ var TooltipBodyComponent = ({ data, isLoading, connections, isInput, externalSys
|
|
|
16903
16765
|
conn.id
|
|
16904
16766
|
)) })
|
|
16905
16767
|
] })
|
|
16906
|
-
] });
|
|
16768
|
+
] }) });
|
|
16907
16769
|
var TooltipBody = React32__namespace.default.memo(TooltipBodyComponent);
|
|
16908
16770
|
var tooltipVariants3 = {
|
|
16909
16771
|
hidden: {
|
|
@@ -16938,7 +16800,12 @@ var IntegrationTooltip = ({
|
|
|
16938
16800
|
const [dragging, setDragging] = React32.useState(false);
|
|
16939
16801
|
const offsetRef = React32.useRef({ x: 0, y: 0 });
|
|
16940
16802
|
const lastMouse = React32.useRef({ x: 0, y: 0 });
|
|
16941
|
-
React32.
|
|
16803
|
+
const tooltipRef = React32.useRef(null);
|
|
16804
|
+
const currentPosRef = React32.useRef(position);
|
|
16805
|
+
React32.useEffect(() => {
|
|
16806
|
+
currentPosRef.current = position;
|
|
16807
|
+
setLocalPos(position);
|
|
16808
|
+
}, [position]);
|
|
16942
16809
|
React32.useEffect(() => {
|
|
16943
16810
|
let rafId = null;
|
|
16944
16811
|
const handleMouseMove = (e) => {
|
|
@@ -16952,13 +16819,18 @@ var IntegrationTooltip = ({
|
|
|
16952
16819
|
top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
|
|
16953
16820
|
left: Math.max(0, Math.min(newLeft, window.innerWidth - 320))
|
|
16954
16821
|
};
|
|
16955
|
-
|
|
16822
|
+
currentPosRef.current = p;
|
|
16823
|
+
if (tooltipRef.current) {
|
|
16824
|
+
tooltipRef.current.style.top = `${p.top}px`;
|
|
16825
|
+
tooltipRef.current.style.left = `${p.left}px`;
|
|
16826
|
+
}
|
|
16956
16827
|
onPositionChange?.(id, p);
|
|
16957
16828
|
});
|
|
16958
16829
|
};
|
|
16959
16830
|
const handleMouseUp = () => {
|
|
16960
16831
|
if (dragging) {
|
|
16961
16832
|
setDragging(false);
|
|
16833
|
+
setLocalPos(currentPosRef.current);
|
|
16962
16834
|
if (rafId) cancelAnimationFrame(rafId);
|
|
16963
16835
|
}
|
|
16964
16836
|
};
|
|
@@ -17020,7 +16892,7 @@ var IntegrationTooltip = ({
|
|
|
17020
16892
|
const header = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17021
16893
|
"div",
|
|
17022
16894
|
{
|
|
17023
|
-
className: "flex items-center justify-between py-1 border-b border-border/10 bg-muted/30 shrink-0",
|
|
16895
|
+
className: "flex items-center justify-between py-1 border-b border-border/10 bg-muted/30 shrink-0 max-w-lg",
|
|
17024
16896
|
onMouseDown: handleMouseDownLocal,
|
|
17025
16897
|
onTouchStart: handleTouchStartLocal,
|
|
17026
16898
|
style: {
|
|
@@ -17063,7 +16935,7 @@ var IntegrationTooltip = ({
|
|
|
17063
16935
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
17064
16936
|
framerMotion.motion.div,
|
|
17065
16937
|
{
|
|
17066
|
-
className: "fixed bottom-0 left-0 right-0 z-[10000] bg-card border-t border-border/50 rounded-t-2xl shadow-2xl flex flex-col",
|
|
16938
|
+
className: "fixed bottom-0 left-0 right-0 z-[10000] bg-card border-t border-border/50 rounded-t-2xl shadow-2xl flex flex-col min-h-0",
|
|
17067
16939
|
style: { maxHeight: "85dvh" },
|
|
17068
16940
|
initial: { y: "100%" },
|
|
17069
16941
|
animate: { y: 0 },
|
|
@@ -17073,7 +16945,7 @@ var IntegrationTooltip = ({
|
|
|
17073
16945
|
children: [
|
|
17074
16946
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center pt-2.5 pb-1 shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-1 rounded-full bg-border" }) }),
|
|
17075
16947
|
header,
|
|
17076
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto flex-1 pb-[env(safe-area-inset-bottom)]", children: /* @__PURE__ */ jsxRuntime.jsx(TooltipBody, { ...bodyProps }) })
|
|
16948
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto flex-1 min-h-0 pb-[env(safe-area-inset-bottom)] max-w-xs", children: /* @__PURE__ */ jsxRuntime.jsx(TooltipBody, { ...bodyProps }) })
|
|
17077
16949
|
]
|
|
17078
16950
|
},
|
|
17079
16951
|
`sheet-${id}`
|
|
@@ -17083,6 +16955,7 @@ var IntegrationTooltip = ({
|
|
|
17083
16955
|
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17084
16956
|
framerMotion.motion.div,
|
|
17085
16957
|
{
|
|
16958
|
+
ref: tooltipRef,
|
|
17086
16959
|
className: "fixed bg-card/95 backdrop-blur-md border border-border/50 rounded-lg shadow-2xl z-[10000] w-[calc(100vw-32px)] max-w-sm sm:w-80 overflow-hidden flex flex-col",
|
|
17087
16960
|
variants: tooltipVariants3,
|
|
17088
16961
|
initial: "hidden",
|
|
@@ -17092,7 +16965,7 @@ var IntegrationTooltip = ({
|
|
|
17092
16965
|
onClick: (e) => e.stopPropagation(),
|
|
17093
16966
|
children: [
|
|
17094
16967
|
header,
|
|
17095
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-[60vh] sm:max-h-[520px] overflow-hidden flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx(TooltipBody, { ...bodyProps }) })
|
|
16968
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-[60vh] sm:max-h-[520px] overflow-hidden flex flex-col min-h-0", children: /* @__PURE__ */ jsxRuntime.jsx(TooltipBody, { ...bodyProps }) })
|
|
17096
16969
|
]
|
|
17097
16970
|
},
|
|
17098
16971
|
id
|
|
@@ -20019,11 +19892,9 @@ var ZoomImage = React32__namespace.forwardRef(
|
|
|
20019
19892
|
const mouseY = framerMotion.useMotionValue(50);
|
|
20020
19893
|
const zoomLevel = framerMotion.useMotionValue(1);
|
|
20021
19894
|
const springConfig = { damping: 20, stiffness: 150, mass: 0.5 };
|
|
20022
|
-
const smoothMouseX = framerMotion.useSpring(mouseX, springConfig);
|
|
20023
|
-
const smoothMouseY = framerMotion.useSpring(mouseY, springConfig);
|
|
20024
19895
|
const smoothZoomLevel = framerMotion.useSpring(zoomLevel, springConfig);
|
|
20025
19896
|
const transformOrigin = framerMotion.useTransform(
|
|
20026
|
-
[
|
|
19897
|
+
[mouseX, mouseY],
|
|
20027
19898
|
([latestX, latestY]) => `${latestX}% ${latestY}%`
|
|
20028
19899
|
);
|
|
20029
19900
|
const touchStartDist = React32__namespace.useRef(0);
|
|
@@ -20125,7 +19996,7 @@ var ZoomImage = React32__namespace.forwardRef(
|
|
|
20125
19996
|
{
|
|
20126
19997
|
src,
|
|
20127
19998
|
alt,
|
|
20128
|
-
className: cn("w-full h-full object-
|
|
19999
|
+
className: cn("w-full h-full object-contain", imageClassName),
|
|
20129
20000
|
style: {
|
|
20130
20001
|
borderRadius: `${borderRadius}px`,
|
|
20131
20002
|
transformOrigin,
|
|
@@ -20294,44 +20165,6 @@ var Lens = ({
|
|
|
20294
20165
|
}
|
|
20295
20166
|
);
|
|
20296
20167
|
};
|
|
20297
|
-
var carouselThemes = {
|
|
20298
|
-
malwee: {
|
|
20299
|
-
foreground: "text-[#222222]",
|
|
20300
|
-
primary: "bg-[#0b5430]",
|
|
20301
|
-
primaryForeground: "text-white",
|
|
20302
|
-
muted: "bg-[#f0eacc]",
|
|
20303
|
-
mutedForeground: "text-[#6b665c]",
|
|
20304
|
-
border: "!border-[#0b5430]",
|
|
20305
|
-
font: "font-[family-name:var(--font-playfair)]"
|
|
20306
|
-
},
|
|
20307
|
-
enfim: {
|
|
20308
|
-
foreground: "text-black",
|
|
20309
|
-
primary: "bg-black",
|
|
20310
|
-
primaryForeground: "text-white",
|
|
20311
|
-
muted: "bg-gray-100",
|
|
20312
|
-
mutedForeground: "text-gray-600",
|
|
20313
|
-
border: "!border-black",
|
|
20314
|
-
font: "font-[family-name:var(--font-libre-caslon)]"
|
|
20315
|
-
},
|
|
20316
|
-
carinhoso: {
|
|
20317
|
-
foreground: "text-[#222222]",
|
|
20318
|
-
primary: "bg-[#d9d0c0]",
|
|
20319
|
-
primaryForeground: "text-[#222222]",
|
|
20320
|
-
muted: "bg-[#e2ddd6]",
|
|
20321
|
-
mutedForeground: "text-[#5e5b56]",
|
|
20322
|
-
border: "!border-[#d9d0c0]",
|
|
20323
|
-
font: "font-[family-name:var(--font-josefin)]"
|
|
20324
|
-
},
|
|
20325
|
-
"malwee-kids": {
|
|
20326
|
-
foreground: "text-[#005bbf]",
|
|
20327
|
-
primary: "bg-[#005bbf]",
|
|
20328
|
-
primaryForeground: "text-white",
|
|
20329
|
-
muted: "bg-[#fcf5c2]",
|
|
20330
|
-
mutedForeground: "text-[#004a9e]",
|
|
20331
|
-
border: "!border-[#005bbf]",
|
|
20332
|
-
font: "font-[family-name:var(--font-poppins)]"
|
|
20333
|
-
}
|
|
20334
|
-
};
|
|
20335
20168
|
function CarouselSkeleton({ className }) {
|
|
20336
20169
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full h-full lg:p-10 sm:p-4 p-2", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3 h-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative overflow-hidden rounded-lg h-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full min-h-[300px] bg-muted rounded-lg overflow-hidden relative", children: [
|
|
20337
20170
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -20412,7 +20245,8 @@ function CarouselBase({
|
|
|
20412
20245
|
zoomEffect = null,
|
|
20413
20246
|
download = false,
|
|
20414
20247
|
isLoading = false,
|
|
20415
|
-
onChange
|
|
20248
|
+
onChange,
|
|
20249
|
+
fernando
|
|
20416
20250
|
}) {
|
|
20417
20251
|
const isMobile = useIsMobile();
|
|
20418
20252
|
const [index, setIndex] = React32.useState(0);
|
|
@@ -20434,9 +20268,6 @@ function CarouselBase({
|
|
|
20434
20268
|
emblaApi.off("reInit", onSelect);
|
|
20435
20269
|
};
|
|
20436
20270
|
}, [emblaApi, onChange]);
|
|
20437
|
-
const currentItem = items[index];
|
|
20438
|
-
const themeKey = currentItem?.theme || "malwee";
|
|
20439
|
-
const currentTheme = carouselThemes[themeKey] || carouselThemes.malwee;
|
|
20440
20271
|
React32.useEffect(() => {
|
|
20441
20272
|
if (!autoPlay || items.length <= 1 || !emblaApi) return;
|
|
20442
20273
|
const interval = setInterval(() => {
|
|
@@ -20448,14 +20279,14 @@ function CarouselBase({
|
|
|
20448
20279
|
if (isDownloading) return;
|
|
20449
20280
|
setIsDownloading(true);
|
|
20450
20281
|
setDownloadSuccess(false);
|
|
20451
|
-
const
|
|
20282
|
+
const currentItem = items[index];
|
|
20452
20283
|
try {
|
|
20453
|
-
const response = await fetch(
|
|
20284
|
+
const response = await fetch(currentItem.url);
|
|
20454
20285
|
const blob = await response.blob();
|
|
20455
20286
|
const url = window.URL.createObjectURL(blob);
|
|
20456
20287
|
const link = document.createElement("a");
|
|
20457
20288
|
link.href = url;
|
|
20458
|
-
link.download =
|
|
20289
|
+
link.download = currentItem.title || "image";
|
|
20459
20290
|
document.body.appendChild(link);
|
|
20460
20291
|
link.click();
|
|
20461
20292
|
document.body.removeChild(link);
|
|
@@ -20491,8 +20322,6 @@ function CarouselBase({
|
|
|
20491
20322
|
transition: { duration: 0.4 },
|
|
20492
20323
|
className: cn(
|
|
20493
20324
|
"w-full lg:p-10 sm:p-4 p-2 transition-colors duration-500",
|
|
20494
|
-
currentTheme.foreground,
|
|
20495
|
-
currentTheme.font,
|
|
20496
20325
|
className
|
|
20497
20326
|
),
|
|
20498
20327
|
style: { width },
|
|
@@ -20518,7 +20347,7 @@ function CarouselBase({
|
|
|
20518
20347
|
src: item.url,
|
|
20519
20348
|
alt: item.title,
|
|
20520
20349
|
className: cn(
|
|
20521
|
-
"w-full h-full object-
|
|
20350
|
+
"w-full h-full object-contain rounded-lg select-none pointer-events-none",
|
|
20522
20351
|
imageClassName
|
|
20523
20352
|
),
|
|
20524
20353
|
draggable: false
|
|
@@ -20529,7 +20358,7 @@ function CarouselBase({
|
|
|
20529
20358
|
src: item.url,
|
|
20530
20359
|
alt: item.title,
|
|
20531
20360
|
className: cn(
|
|
20532
|
-
"w-full h-full object-
|
|
20361
|
+
"w-full h-full object-contain rounded-lg select-none pointer-events-none",
|
|
20533
20362
|
imageClassName
|
|
20534
20363
|
),
|
|
20535
20364
|
draggable: false
|
|
@@ -20632,9 +20461,9 @@ function CarouselBase({
|
|
|
20632
20461
|
className: cn(
|
|
20633
20462
|
"absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full flex items-center justify-center shadow-lg transition-all z-50",
|
|
20634
20463
|
!emblaApi?.canScrollPrev() ? "opacity-40 cursor-not-allowed" : "hover:scale-110 hover:opacity-100 opacity-70",
|
|
20635
|
-
|
|
20636
|
-
currentTheme.primaryForeground
|
|
20464
|
+
"bg-primary text-primary-foreground"
|
|
20637
20465
|
),
|
|
20466
|
+
style: fernando ? { backgroundColor: fernando } : void 0,
|
|
20638
20467
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20639
20468
|
"svg",
|
|
20640
20469
|
{
|
|
@@ -20666,9 +20495,9 @@ function CarouselBase({
|
|
|
20666
20495
|
className: cn(
|
|
20667
20496
|
"absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full flex items-center justify-center shadow-lg transition-all z-50",
|
|
20668
20497
|
!emblaApi?.canScrollNext() ? "opacity-40 cursor-not-allowed" : "hover:scale-110 hover:opacity-100 opacity-70",
|
|
20669
|
-
|
|
20670
|
-
currentTheme.primaryForeground
|
|
20498
|
+
"bg-primary text-primary-foreground"
|
|
20671
20499
|
),
|
|
20500
|
+
style: fernando ? { backgroundColor: fernando } : void 0,
|
|
20672
20501
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20673
20502
|
"svg",
|
|
20674
20503
|
{
|
|
@@ -20699,12 +20528,9 @@ function CarouselBase({
|
|
|
20699
20528
|
onMouseDown: (e) => e.stopPropagation(),
|
|
20700
20529
|
className: cn(
|
|
20701
20530
|
"h-2 rounded-full transition-all duration-300",
|
|
20702
|
-
i === index ? cn("w-8
|
|
20703
|
-
|
|
20704
|
-
|
|
20705
|
-
"opacity-40"
|
|
20706
|
-
)
|
|
20707
|
-
)
|
|
20531
|
+
i === index ? cn("w-8 bg-primary") : cn("w-2 hover:opacity-80 bg-primary opacity-40")
|
|
20532
|
+
),
|
|
20533
|
+
style: fernando ? { backgroundColor: fernando } : void 0
|
|
20708
20534
|
},
|
|
20709
20535
|
i
|
|
20710
20536
|
)) })
|
|
@@ -20893,9 +20719,9 @@ function RadialMenu({
|
|
|
20893
20719
|
}
|
|
20894
20720
|
function ControlledCombobox({
|
|
20895
20721
|
items,
|
|
20896
|
-
|
|
20897
|
-
|
|
20898
|
-
|
|
20722
|
+
value,
|
|
20723
|
+
onChange,
|
|
20724
|
+
placeholder = "Selecione uma op\xE7\xE3o",
|
|
20899
20725
|
disabled = false,
|
|
20900
20726
|
keepOpen = false,
|
|
20901
20727
|
searchPlaceholder,
|
|
@@ -20905,7 +20731,6 @@ function ControlledCombobox({
|
|
|
20905
20731
|
labelClassname,
|
|
20906
20732
|
testIds = {},
|
|
20907
20733
|
onClear,
|
|
20908
|
-
hasSelected = false,
|
|
20909
20734
|
hideClear = false,
|
|
20910
20735
|
onSearchChange,
|
|
20911
20736
|
search,
|
|
@@ -20913,6 +20738,11 @@ function ControlledCombobox({
|
|
|
20913
20738
|
loading = false
|
|
20914
20739
|
}) {
|
|
20915
20740
|
const [open, setOpen] = React32.useState(false);
|
|
20741
|
+
const selectedItem = items.find((item) => item.value === value);
|
|
20742
|
+
const renderSelected = selectedItem?.label ?? placeholder;
|
|
20743
|
+
const hasSelected = Boolean(value);
|
|
20744
|
+
const checkIsSelected = (v) => v === value;
|
|
20745
|
+
const handleSelection = (v) => onChange?.(v);
|
|
20916
20746
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20917
20747
|
"div",
|
|
20918
20748
|
{
|
|
@@ -20942,12 +20772,13 @@ function ControlledCombobox({
|
|
|
20942
20772
|
"aria-disabled": disabled || void 0,
|
|
20943
20773
|
disabled,
|
|
20944
20774
|
className: cn(
|
|
20945
|
-
`flex items-center gap-2 justify-between [&>div]:line-clamp-1 relative h-9 no-active-animation`,
|
|
20946
|
-
error && "border-red-500"
|
|
20775
|
+
`flex items-center gap-2 justify-between [&>div]:line-clamp-1 relative h-9 no-active-animation font-light`,
|
|
20776
|
+
error && "border-red-500",
|
|
20777
|
+
placeholder && !hasSelected && "text-muted-foreground"
|
|
20947
20778
|
),
|
|
20948
20779
|
"data-testid": testIds.trigger ?? "combobox-trigger",
|
|
20949
20780
|
children: [
|
|
20950
|
-
renderSelected,
|
|
20781
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate min-w-0", children: renderSelected }),
|
|
20951
20782
|
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.span, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-0 items-center ", children: [
|
|
20952
20783
|
hasSelected && onClear && !disabled && !hideClear && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20953
20784
|
ClearButton,
|
|
@@ -20985,9 +20816,9 @@ function ControlledCombobox({
|
|
|
20985
20816
|
{
|
|
20986
20817
|
className: "dark:text-white hover:bg-rsecondary focus:ring-0 focus:outline-none",
|
|
20987
20818
|
"data-testid": testIds.command ?? "combobox-command",
|
|
20988
|
-
filter: onSearchChange ? () => 1 : (
|
|
20989
|
-
const
|
|
20990
|
-
if (
|
|
20819
|
+
filter: onSearchChange ? () => 1 : (itemValue, search2) => {
|
|
20820
|
+
const itemLabel = items.find((item) => item.value === itemValue)?.label || itemValue;
|
|
20821
|
+
if (itemLabel.toLowerCase().includes(search2.toLowerCase()))
|
|
20991
20822
|
return 1;
|
|
20992
20823
|
return 0;
|
|
20993
20824
|
},
|
|
@@ -21019,9 +20850,9 @@ function ControlledCombobox({
|
|
|
21019
20850
|
{
|
|
21020
20851
|
keywords: [item.label],
|
|
21021
20852
|
value: item.value,
|
|
21022
|
-
onSelect: (
|
|
20853
|
+
onSelect: () => {
|
|
21023
20854
|
if (disabled) return;
|
|
21024
|
-
handleSelection(value);
|
|
20855
|
+
handleSelection(item.value);
|
|
21025
20856
|
if (!keepOpen) setOpen(false);
|
|
21026
20857
|
},
|
|
21027
20858
|
disabled,
|
|
@@ -21038,7 +20869,7 @@ function ControlledCombobox({
|
|
|
21038
20869
|
stiffness: 500,
|
|
21039
20870
|
damping: 30
|
|
21040
20871
|
},
|
|
21041
|
-
className: "ml-auto
|
|
20872
|
+
className: "ml-auto",
|
|
21042
20873
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
21043
20874
|
react.CheckIcon,
|
|
21044
20875
|
{
|
|
@@ -21096,7 +20927,6 @@ exports.AvatarFallbackBase = AvatarFallbackBase;
|
|
|
21096
20927
|
exports.AvatarImageBase = AvatarImageBase;
|
|
21097
20928
|
exports.BackButton = BackButton;
|
|
21098
20929
|
exports.Badge = Badge;
|
|
21099
|
-
exports.Beam = Beam;
|
|
21100
20930
|
exports.BreadcrumbBase = BreadcrumbBase;
|
|
21101
20931
|
exports.BreadcrumbEllipsisBase = BreadcrumbEllipsisBase;
|
|
21102
20932
|
exports.BreadcrumbItemBase = BreadcrumbItemBase;
|
|
@@ -21160,7 +20990,6 @@ exports.ContextMenuSubTriggerBase = ContextMenuSubTriggerBase;
|
|
|
21160
20990
|
exports.ContextMenuTriggerBase = ContextMenuTriggerBase;
|
|
21161
20991
|
exports.ControlledCombobox = ControlledCombobox;
|
|
21162
20992
|
exports.CopyButton = CopyButton;
|
|
21163
|
-
exports.CopyData = CopyData;
|
|
21164
20993
|
exports.DateTimePicker = DateTimePicker;
|
|
21165
20994
|
exports.DayView = DayView;
|
|
21166
20995
|
exports.DayViewAgenda = DayViewAgenda;
|
|
@@ -21226,7 +21055,7 @@ exports.EventItem = EventItem;
|
|
|
21226
21055
|
exports.EventItemAgenda = EventItemAgenda;
|
|
21227
21056
|
exports.EventsPopup = EventsPopup;
|
|
21228
21057
|
exports.FavoriteButton = FavoriteButton;
|
|
21229
|
-
exports.
|
|
21058
|
+
exports.FileAccept = FileAccept;
|
|
21230
21059
|
exports.FileUploader = FileUploader;
|
|
21231
21060
|
exports.FilterButton = FilterButton;
|
|
21232
21061
|
exports.HideButton = HideButton;
|
|
@@ -21242,7 +21071,6 @@ exports.InputOTPBase = InputOTPBase;
|
|
|
21242
21071
|
exports.InputOTPGroupBase = InputOTPGroupBase;
|
|
21243
21072
|
exports.InputOTPSeparatorBase = InputOTPSeparatorBase;
|
|
21244
21073
|
exports.InputOTPSlotBase = InputOTPSlotBase;
|
|
21245
|
-
exports.IntegrationCard = IntegrationCard;
|
|
21246
21074
|
exports.IntegrationTooltip = IntegrationTooltip_default;
|
|
21247
21075
|
exports.LabelBase = LabelBase_default;
|
|
21248
21076
|
exports.Leaderboard = Leaderboard;
|
|
@@ -21273,7 +21101,6 @@ exports.MultiSelectItemBase = MultiSelectItemBase;
|
|
|
21273
21101
|
exports.MultiSelectSeparatorBase = MultiSelectSeparatorBase;
|
|
21274
21102
|
exports.MultiSelectTriggerBase = MultiSelectTriggerBase;
|
|
21275
21103
|
exports.MultiSelectValueBase = MultiSelectValueBase;
|
|
21276
|
-
exports.NameTooltip = NameTooltip;
|
|
21277
21104
|
exports.NavigationMenuBase = NavigationMenuBase;
|
|
21278
21105
|
exports.NavigationMenuContentBase = NavigationMenuContentBase;
|
|
21279
21106
|
exports.NavigationMenuIndicatorBase = NavigationMenuIndicatorBase;
|
|
@@ -21355,9 +21182,7 @@ exports.StartHour = StartHour;
|
|
|
21355
21182
|
exports.StartHourAgenda = StartHourAgenda;
|
|
21356
21183
|
exports.StatusIndicator = StatusIndicator;
|
|
21357
21184
|
exports.SwitchBase = SwitchBase;
|
|
21358
|
-
exports.SystemNode = SystemNode;
|
|
21359
21185
|
exports.SystemTooltip = SystemTooltip_default;
|
|
21360
|
-
exports.SystemsDiagram = SystemsDiagram;
|
|
21361
21186
|
exports.TableBase = TableBase;
|
|
21362
21187
|
exports.TableBodyBase = TableBodyBase;
|
|
21363
21188
|
exports.TableCaptionBase = TableCaptionBase;
|
|
@@ -21377,7 +21202,6 @@ exports.TimePickerInput = TimePickerInput;
|
|
|
21377
21202
|
exports.TimeSeries = TimeSeries_default;
|
|
21378
21203
|
exports.Toaster = Toaster;
|
|
21379
21204
|
exports.TooltipBase = TooltipBase;
|
|
21380
|
-
exports.TooltipBody = TooltipBody;
|
|
21381
21205
|
exports.TooltipContentBase = TooltipContentBase;
|
|
21382
21206
|
exports.TooltipProviderBase = TooltipProviderBase;
|
|
21383
21207
|
exports.TooltipSimple = TooltipSimple_default;
|
|
@@ -21482,7 +21306,6 @@ exports.useDrag = useDrag;
|
|
|
21482
21306
|
exports.useEventVisibility = useEventVisibility;
|
|
21483
21307
|
exports.useEventVisibilityAgenda = useEventVisibilityAgenda;
|
|
21484
21308
|
exports.useIsMobile = useIsMobile;
|
|
21485
|
-
exports.useIsTruncated = useIsTruncated;
|
|
21486
21309
|
exports.useOpenTooltipForPeriod = useOpenTooltipForPeriod;
|
|
21487
21310
|
exports.useProcessedData = useProcessedData;
|
|
21488
21311
|
exports.useSeriesOpacity = useSeriesOpacity;
|