@mlw-packages/react-components 1.10.2 → 1.10.4
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 +19 -12
- package/dist/index.d.mts +20 -9
- package/dist/index.d.ts +20 -9
- package/dist/index.js +252 -272
- package/dist/index.mjs +252 -273
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1575,7 +1575,7 @@ var TooltipContentBase = React32__namespace.forwardRef(
|
|
|
1575
1575
|
...props,
|
|
1576
1576
|
children: [
|
|
1577
1577
|
props.children,
|
|
1578
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Arrow, { className: "fill-primary" })
|
|
1578
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Arrow, { className: "fill-primary h-1.5 w-3" })
|
|
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);
|
|
@@ -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,6 +3729,15 @@ var CardFooterBase = React32__namespace.forwardRef(({ className, testid: dataTes
|
|
|
3689
3729
|
}
|
|
3690
3730
|
));
|
|
3691
3731
|
CardFooterBase.displayName = "CardFooter";
|
|
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: "*"
|
|
3740
|
+
};
|
|
3692
3741
|
var formatFileSize = (bytes) => {
|
|
3693
3742
|
if (bytes === 0) return "0 Bytes";
|
|
3694
3743
|
const k = 1024;
|
|
@@ -3696,67 +3745,63 @@ var formatFileSize = (bytes) => {
|
|
|
3696
3745
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
3697
3746
|
return Math.round(bytes / Math.pow(k, i) * 100) / 100 + " " + sizes[i];
|
|
3698
3747
|
};
|
|
3699
|
-
var getFileExtension = (filename) =>
|
|
3700
|
-
|
|
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(",");
|
|
3701
3765
|
};
|
|
3702
3766
|
var getFileTypeIcon = (file) => {
|
|
3703
3767
|
const extension = getFileExtension(file.name).toLowerCase();
|
|
3704
3768
|
const mimeType = file.type.toLowerCase();
|
|
3705
|
-
if (extension === "pdf" || mimeType === "application/pdf")
|
|
3769
|
+
if (extension === "pdf" || mimeType === "application/pdf")
|
|
3706
3770
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FilePdfIcon, { size: 20, className: "text-red-500" });
|
|
3707
|
-
|
|
3708
|
-
if (["doc", "docx"].includes(extension) || mimeType.includes("word")) {
|
|
3771
|
+
if (["doc", "docx"].includes(extension) || mimeType.includes("word"))
|
|
3709
3772
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileDocIcon, { size: 20, className: "text-blue-500" });
|
|
3710
|
-
|
|
3711
|
-
if (["xls", "xlsx"].includes(extension) || mimeType.includes("sheet")) {
|
|
3773
|
+
if (["xls", "xlsx"].includes(extension) || mimeType.includes("sheet"))
|
|
3712
3774
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileXlsIcon, { size: 20, className: "text-green-500" });
|
|
3713
|
-
|
|
3714
|
-
if (["ppt", "pptx"].includes(extension) || mimeType.includes("presentation")) {
|
|
3775
|
+
if (["ppt", "pptx"].includes(extension) || mimeType.includes("presentation"))
|
|
3715
3776
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FilePptIcon, { size: 20, className: "text-orange-500" });
|
|
3716
|
-
|
|
3717
|
-
if (extension === "csv" || mimeType === "text/csv") {
|
|
3777
|
+
if (extension === "csv" || mimeType === "text/csv")
|
|
3718
3778
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileCsvIcon, { size: 20, className: "text-green-600" });
|
|
3719
|
-
}
|
|
3720
3779
|
if (["txt", "md", "json", "xml", "js", "ts", "html", "css"].includes(
|
|
3721
3780
|
extension
|
|
3722
|
-
) || mimeType.includes("text"))
|
|
3781
|
+
) || mimeType.includes("text"))
|
|
3723
3782
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileTextIcon, { size: 20, className: "text-gray-500" });
|
|
3724
|
-
|
|
3725
|
-
if (mimeType.startsWith("image/")) {
|
|
3783
|
+
if (mimeType.startsWith("image/"))
|
|
3726
3784
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileImageIcon, { size: 20, className: "text-purple-500" });
|
|
3727
|
-
|
|
3728
|
-
if (mimeType.startsWith("video/")) {
|
|
3785
|
+
if (mimeType.startsWith("video/"))
|
|
3729
3786
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileVideoIcon, { size: 20, className: "text-pink-500" });
|
|
3730
|
-
|
|
3731
|
-
if (mimeType.startsWith("audio/")) {
|
|
3787
|
+
if (mimeType.startsWith("audio/"))
|
|
3732
3788
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileAudioIcon, { size: 20, className: "text-indigo-500" });
|
|
3733
|
-
|
|
3734
|
-
if (["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
|
|
3789
|
+
if (["zip", "rar", "7z", "tar", "gz"].includes(extension))
|
|
3735
3790
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileZipIcon, { size: 20, className: "text-yellow-600" });
|
|
3736
|
-
}
|
|
3737
3791
|
return /* @__PURE__ */ jsxRuntime.jsx(react.FileIcon, { size: 20, className: "text-muted-foreground" });
|
|
3738
3792
|
};
|
|
3739
|
-
var createImagePreview = (file) => {
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
reader.onload = (e) => {
|
|
3747
|
-
resolve(e.target?.result);
|
|
3748
|
-
};
|
|
3749
|
-
reader.onerror = () => {
|
|
3750
|
-
resolve(null);
|
|
3751
|
-
};
|
|
3752
|
-
reader.readAsDataURL(file);
|
|
3753
|
-
});
|
|
3754
|
-
};
|
|
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
|
+
});
|
|
3755
3800
|
var FileUploader = React32__namespace.forwardRef(
|
|
3756
3801
|
({
|
|
3757
3802
|
className,
|
|
3758
|
-
accept,
|
|
3759
|
-
maxSize,
|
|
3803
|
+
accept = "*",
|
|
3804
|
+
maxSize = 10,
|
|
3760
3805
|
maxFiles = 1,
|
|
3761
3806
|
disabled = false,
|
|
3762
3807
|
value = [],
|
|
@@ -3778,71 +3823,49 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3778
3823
|
}, [value]);
|
|
3779
3824
|
React32__namespace.useEffect(() => {
|
|
3780
3825
|
return () => {
|
|
3781
|
-
files.forEach((
|
|
3782
|
-
if (
|
|
3783
|
-
URL.revokeObjectURL(file.preview);
|
|
3784
|
-
}
|
|
3826
|
+
files.forEach((f) => {
|
|
3827
|
+
if (f.preview) URL.revokeObjectURL(f.preview);
|
|
3785
3828
|
});
|
|
3786
3829
|
};
|
|
3787
3830
|
}, [files]);
|
|
3788
3831
|
const validateFile = (file) => {
|
|
3789
|
-
if (file.size > maxSize)
|
|
3790
|
-
return `Arquivo muito grande. M\xE1ximo: ${
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
const fileExtension = `.${getFileExtension(file.name)}`;
|
|
3794
|
-
const fileType = file.type;
|
|
3795
|
-
const isAccepted = accept.some((acceptItem) => {
|
|
3796
|
-
if (acceptItem.startsWith(".")) {
|
|
3797
|
-
return fileExtension.toLowerCase() === acceptItem.toLowerCase();
|
|
3798
|
-
}
|
|
3799
|
-
if (acceptItem.endsWith("/*")) {
|
|
3800
|
-
return fileType.startsWith(acceptItem.replace("/*", ""));
|
|
3801
|
-
}
|
|
3802
|
-
return fileType === acceptItem;
|
|
3803
|
-
});
|
|
3804
|
-
if (!isAccepted) {
|
|
3805
|
-
return `Tipo de arquivo n\xE3o permitido. Aceitos: ${accept.join(", ")}`;
|
|
3806
|
-
}
|
|
3807
|
-
}
|
|
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}`;
|
|
3808
3836
|
return null;
|
|
3809
3837
|
};
|
|
3810
3838
|
const createFileWithPreview = async (file) => {
|
|
3811
|
-
const
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
if (error) {
|
|
3815
|
-
fileWithPreview.error = error;
|
|
3816
|
-
}
|
|
3817
|
-
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/")) {
|
|
3818
3843
|
try {
|
|
3819
3844
|
const preview = await createImagePreview(file);
|
|
3820
|
-
if (preview)
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
} catch (error2) {
|
|
3824
|
-
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);
|
|
3825
3848
|
}
|
|
3826
3849
|
}
|
|
3827
|
-
return
|
|
3850
|
+
return f;
|
|
3828
3851
|
};
|
|
3829
3852
|
const handleFiles = async (newFiles) => {
|
|
3830
3853
|
if (disabled) return;
|
|
3831
|
-
const
|
|
3832
|
-
const filesToAdd = multiple ? newFiles.slice(0,
|
|
3833
|
-
const
|
|
3834
|
-
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)
|
|
3835
3858
|
);
|
|
3836
|
-
const
|
|
3837
|
-
setFiles(
|
|
3838
|
-
onValueChange(
|
|
3859
|
+
const updated = multiple ? [...files, ...processed] : processed;
|
|
3860
|
+
setFiles(updated);
|
|
3861
|
+
onValueChange(updated);
|
|
3839
3862
|
if (onUpload) {
|
|
3840
|
-
const
|
|
3841
|
-
if (
|
|
3863
|
+
const valid = processed.filter((f) => !f.error);
|
|
3864
|
+
if (valid.length > 0) {
|
|
3842
3865
|
try {
|
|
3843
|
-
await onUpload(
|
|
3844
|
-
} catch (
|
|
3845
|
-
console.error("Erro no upload:",
|
|
3866
|
+
await onUpload(valid);
|
|
3867
|
+
} catch (err) {
|
|
3868
|
+
console.error("Erro no upload:", err);
|
|
3846
3869
|
}
|
|
3847
3870
|
}
|
|
3848
3871
|
}
|
|
@@ -3851,17 +3874,12 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3851
3874
|
e.preventDefault();
|
|
3852
3875
|
e.stopPropagation();
|
|
3853
3876
|
dragCounterRef.current++;
|
|
3854
|
-
if (e.dataTransfer.items
|
|
3855
|
-
setIsDragging(true);
|
|
3856
|
-
}
|
|
3877
|
+
if (e.dataTransfer.items?.length > 0) setIsDragging(true);
|
|
3857
3878
|
};
|
|
3858
3879
|
const handleDragLeave = (e) => {
|
|
3859
3880
|
e.preventDefault();
|
|
3860
3881
|
e.stopPropagation();
|
|
3861
|
-
dragCounterRef.current
|
|
3862
|
-
if (dragCounterRef.current === 0) {
|
|
3863
|
-
setIsDragging(false);
|
|
3864
|
-
}
|
|
3882
|
+
if (--dragCounterRef.current === 0) setIsDragging(false);
|
|
3865
3883
|
};
|
|
3866
3884
|
const handleDragOver = (e) => {
|
|
3867
3885
|
e.preventDefault();
|
|
@@ -3872,47 +3890,33 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3872
3890
|
e.stopPropagation();
|
|
3873
3891
|
setIsDragging(false);
|
|
3874
3892
|
dragCounterRef.current = 0;
|
|
3875
|
-
if (disabled)
|
|
3876
|
-
const droppedFiles = Array.from(e.dataTransfer.files);
|
|
3877
|
-
handleFiles(droppedFiles);
|
|
3893
|
+
if (!disabled) handleFiles(Array.from(e.dataTransfer.files));
|
|
3878
3894
|
};
|
|
3879
3895
|
const handleInputChange = (e) => {
|
|
3880
|
-
if (e.target.files)
|
|
3881
|
-
const selectedFiles = Array.from(e.target.files);
|
|
3882
|
-
handleFiles(selectedFiles);
|
|
3883
|
-
}
|
|
3896
|
+
if (e.target.files) handleFiles(Array.from(e.target.files));
|
|
3884
3897
|
};
|
|
3885
3898
|
const handleRemoveFile = (fileId) => {
|
|
3886
|
-
const
|
|
3887
|
-
if (
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
setFiles(updatedFiles);
|
|
3892
|
-
onValueChange(updatedFiles);
|
|
3893
|
-
};
|
|
3894
|
-
const handleClick = () => {
|
|
3895
|
-
if (!disabled) {
|
|
3896
|
-
inputRef.current?.click();
|
|
3897
|
-
}
|
|
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);
|
|
3898
3904
|
};
|
|
3899
|
-
const
|
|
3900
|
-
const defaultSubtext = dropzoneSubtext || `Formatos: ${accept.join(", ")}. M\xE1ximo: ${formatFileSize(maxSize)}`;
|
|
3905
|
+
const defaultSubtext = dropzoneSubtext ?? `${accept === "*" ? "Qualquer formato" : accept} (M\xE1x: ${maxSize}MB)`;
|
|
3901
3906
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3902
3907
|
framerMotion.motion.div,
|
|
3903
3908
|
{
|
|
3904
3909
|
className: cn(
|
|
3905
|
-
"relative flex cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed p-
|
|
3910
|
+
"relative flex cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed p-5 transition-all duration-300 dark:shadow-black/20",
|
|
3906
3911
|
isDragging && "border-primary bg-primary/10 scale-[1.02]",
|
|
3907
3912
|
!isDragging && "border-border hover:border-primary/60 hover:bg-muted/50",
|
|
3908
|
-
disabled && "cursor-not-allowed opacity-50
|
|
3913
|
+
disabled && "cursor-not-allowed opacity-50"
|
|
3909
3914
|
),
|
|
3910
3915
|
onDragEnter: handleDragEnter,
|
|
3911
3916
|
onDragOver: handleDragOver,
|
|
3912
3917
|
onDragLeave: handleDragLeave,
|
|
3913
3918
|
onDrop: handleDrop,
|
|
3914
|
-
onClick:
|
|
3915
|
-
whileHover: !disabled ? { scale: 1.01 } : void 0,
|
|
3919
|
+
onClick: () => !disabled && inputRef.current?.click(),
|
|
3916
3920
|
whileTap: !disabled ? { scale: 0.99 } : void 0,
|
|
3917
3921
|
animate: isDragging ? {
|
|
3918
3922
|
borderColor: `hsl(var(--primary))`,
|
|
@@ -3923,12 +3927,7 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3923
3927
|
backgroundColor: `hsl(var(--background))`,
|
|
3924
3928
|
scale: 1
|
|
3925
3929
|
},
|
|
3926
|
-
transition: {
|
|
3927
|
-
type: "spring",
|
|
3928
|
-
stiffness: 300,
|
|
3929
|
-
damping: 25,
|
|
3930
|
-
duration: 0.3
|
|
3931
|
-
},
|
|
3930
|
+
transition: { type: "spring", stiffness: 300, damping: 25 },
|
|
3932
3931
|
children: [
|
|
3933
3932
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3934
3933
|
"input",
|
|
@@ -3936,7 +3935,7 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3936
3935
|
ref: inputRef,
|
|
3937
3936
|
type: "file",
|
|
3938
3937
|
className: "hidden",
|
|
3939
|
-
accept:
|
|
3938
|
+
accept: formatAcceptForInput(accept),
|
|
3940
3939
|
multiple,
|
|
3941
3940
|
disabled,
|
|
3942
3941
|
onChange: handleInputChange
|
|
@@ -3946,20 +3945,11 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3946
3945
|
framerMotion.motion.div,
|
|
3947
3946
|
{
|
|
3948
3947
|
animate: isDragging ? { scale: 1.2, rotate: 10 } : { scale: 1, rotate: 0 },
|
|
3949
|
-
transition: {
|
|
3950
|
-
type: "spring",
|
|
3951
|
-
stiffness: 300,
|
|
3952
|
-
damping: 20,
|
|
3953
|
-
duration: 0.3
|
|
3954
|
-
},
|
|
3948
|
+
transition: { type: "spring", stiffness: 300, damping: 20 },
|
|
3955
3949
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3956
3950
|
framerMotion.motion.div,
|
|
3957
3951
|
{
|
|
3958
|
-
className:
|
|
3959
|
-
"mb-4 h-16 w-16 text-muted-foreground transition-colors duration-300 drop-shadow-lg flex items-center justify-center",
|
|
3960
|
-
isDragging && "text-primary"
|
|
3961
|
-
),
|
|
3962
|
-
initial: false,
|
|
3952
|
+
className: "mb-4 h-16 w-16 drop-shadow-lg flex items-center justify-center",
|
|
3963
3953
|
animate: {
|
|
3964
3954
|
color: isDragging ? `hsl(var(--primary))` : `hsl(var(--muted-foreground))`
|
|
3965
3955
|
},
|
|
@@ -3972,7 +3962,7 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3972
3962
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3973
3963
|
framerMotion.motion.p,
|
|
3974
3964
|
{
|
|
3975
|
-
className: "mb-2 text-
|
|
3965
|
+
className: "mb-2 text-xs font-semibold text-foreground",
|
|
3976
3966
|
initial: animate ? { opacity: 0, y: -10 } : false,
|
|
3977
3967
|
animate: { opacity: 1, y: 0 },
|
|
3978
3968
|
transition: { delay: 0.1 },
|
|
@@ -3982,63 +3972,29 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
3982
3972
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3983
3973
|
framerMotion.motion.p,
|
|
3984
3974
|
{
|
|
3985
|
-
className: "text-
|
|
3975
|
+
className: "text-xs text-muted-foreground",
|
|
3986
3976
|
initial: animate ? { opacity: 0, y: -10 } : false,
|
|
3987
3977
|
animate: { opacity: 1, y: 0 },
|
|
3988
3978
|
transition: { delay: 0.2 },
|
|
3989
3979
|
children: defaultSubtext
|
|
3990
3980
|
}
|
|
3991
3981
|
),
|
|
3992
|
-
|
|
3993
|
-
framerMotion.motion.div,
|
|
3994
|
-
{
|
|
3995
|
-
initial: { opacity: 0, scale: 0.8, y: 10 },
|
|
3996
|
-
animate: {
|
|
3997
|
-
opacity: 1,
|
|
3998
|
-
scale: 1,
|
|
3999
|
-
y: 0,
|
|
4000
|
-
backgroundColor: `hsl(var(--primary) / 0.1)`,
|
|
4001
|
-
borderColor: `hsl(var(--primary) / 0.2)`
|
|
4002
|
-
},
|
|
4003
|
-
exit: { opacity: 0, scale: 0.8, y: 10 },
|
|
4004
|
-
className: cn(
|
|
4005
|
-
"mt-4 flex items-center gap-2 rounded-full border px-4 py-2 backdrop-blur-sm bg-primary/20 border-primary/30 shadow-lg"
|
|
4006
|
-
),
|
|
4007
|
-
transition: { duration: 0.3 },
|
|
4008
|
-
children: [
|
|
4009
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(react.CheckIcon, { size: 16, className: "text-emerald-500" }) }),
|
|
4010
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4011
|
-
framerMotion.motion.span,
|
|
4012
|
-
{
|
|
4013
|
-
className: "text-sm font-semibold text-primary",
|
|
4014
|
-
animate: { color: `hsl(var(--primary))` },
|
|
4015
|
-
transition: { duration: 0.3 },
|
|
4016
|
-
children: [
|
|
4017
|
-
files.length,
|
|
4018
|
-
" ",
|
|
4019
|
-
files.length === 1 ? "arquivo selecionado" : "arquivos selecionados"
|
|
4020
|
-
]
|
|
4021
|
-
}
|
|
4022
|
-
)
|
|
4023
|
-
]
|
|
4024
|
-
}
|
|
4025
|
-
) }),
|
|
4026
|
-
showPreview && files.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3982
|
+
showPreview && files.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4027
3983
|
framerMotion.motion.div,
|
|
4028
3984
|
{
|
|
4029
|
-
className: "
|
|
3985
|
+
className: "py-2 w-full",
|
|
4030
3986
|
initial: animate ? { opacity: 0, y: 10 } : false,
|
|
4031
3987
|
animate: { opacity: 1, y: 0 },
|
|
4032
3988
|
transition: { delay: 0.3 },
|
|
4033
|
-
children:
|
|
4034
|
-
/* @__PURE__ */ jsxRuntime.jsxs("h4", { className: "
|
|
3989
|
+
children: [
|
|
3990
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h4", { className: "text-xs font-medium text-muted-foreground pb-0.5", children: [
|
|
4035
3991
|
"Arquivos selecionados (",
|
|
4036
3992
|
files.length,
|
|
4037
3993
|
"/",
|
|
4038
3994
|
maxFiles,
|
|
4039
3995
|
")"
|
|
4040
3996
|
] }),
|
|
4041
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2 overflow-y-auto max-h-
|
|
3997
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2 overflow-y-auto max-h-36", children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "popLayout", children: files.map((file, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4042
3998
|
framerMotion.motion.div,
|
|
4043
3999
|
{
|
|
4044
4000
|
layout: true,
|
|
@@ -4054,24 +4010,18 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
4054
4010
|
layout: { duration: 0.2 }
|
|
4055
4011
|
},
|
|
4056
4012
|
className: cn(
|
|
4057
|
-
"flex items-center gap-3 rounded-md border p-
|
|
4013
|
+
"group flex items-center gap-3 rounded-md border p-2 transition-all duration-300",
|
|
4058
4014
|
file.error ? "border-destructive/50 bg-destructive/5" : "border-border bg-background/80 hover:bg-muted/50 hover:shadow-md hover:shadow-primary/10 hover:border-primary/30"
|
|
4059
4015
|
),
|
|
4060
4016
|
children: [
|
|
4061
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-muted overflow-hidden", children: file.preview ? (
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
}
|
|
4070
|
-
)
|
|
4071
|
-
) : (
|
|
4072
|
-
// Ícone baseado no tipo de arquivo
|
|
4073
|
-
getFileTypeIcon(file)
|
|
4074
|
-
) }),
|
|
4017
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-muted overflow-hidden", children: file.preview ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4018
|
+
"img",
|
|
4019
|
+
{
|
|
4020
|
+
src: file.preview,
|
|
4021
|
+
alt: file.name,
|
|
4022
|
+
className: "h-full w-full object-cover rounded-md"
|
|
4023
|
+
}
|
|
4024
|
+
) : getFileTypeIcon(file) }),
|
|
4075
4025
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
4076
4026
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4077
4027
|
"p",
|
|
@@ -4101,21 +4051,21 @@ var FileUploader = React32__namespace.forwardRef(
|
|
|
4101
4051
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4102
4052
|
ButtonBase,
|
|
4103
4053
|
{
|
|
4104
|
-
variant: "destructive",
|
|
4105
4054
|
size: "icon",
|
|
4055
|
+
variant: "ghost",
|
|
4106
4056
|
onClick: (e) => {
|
|
4107
4057
|
e?.stopPropagation();
|
|
4108
4058
|
handleRemoveFile(file.id);
|
|
4109
4059
|
},
|
|
4110
|
-
className: "",
|
|
4111
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(react.XIcon, { size: 12 })
|
|
4060
|
+
className: "opacity-0 transition-opacity group-hover:opacity-100",
|
|
4061
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.XIcon, { size: 12, className: "text-red-500" })
|
|
4112
4062
|
}
|
|
4113
4063
|
)
|
|
4114
4064
|
]
|
|
4115
4065
|
},
|
|
4116
4066
|
file.id
|
|
4117
4067
|
)) }) })
|
|
4118
|
-
]
|
|
4068
|
+
]
|
|
4119
4069
|
}
|
|
4120
4070
|
)
|
|
4121
4071
|
]
|
|
@@ -9969,6 +9919,7 @@ function Select({
|
|
|
9969
9919
|
{
|
|
9970
9920
|
className: cn(
|
|
9971
9921
|
"flex items-center gap-2 justify-between [&>div]:line-clamp-1 [&>span]:line-clamp-1 relative",
|
|
9922
|
+
!selected && "text-muted-foreground",
|
|
9972
9923
|
error && "border-red-500",
|
|
9973
9924
|
className
|
|
9974
9925
|
),
|
|
@@ -14542,6 +14493,7 @@ function MultiSelect({
|
|
|
14542
14493
|
{
|
|
14543
14494
|
className: cn(
|
|
14544
14495
|
"flex items-center gap-2 justify-between hover:bg-muted transition-all duration-150",
|
|
14496
|
+
!selected && "text-muted-foreground",
|
|
14545
14497
|
error && "border-red-500",
|
|
14546
14498
|
className
|
|
14547
14499
|
),
|
|
@@ -16880,7 +16832,7 @@ var IntegrationCard = ({ title, details }) => {
|
|
|
16880
16832
|
}) })
|
|
16881
16833
|
] });
|
|
16882
16834
|
};
|
|
16883
|
-
var TooltipBodyComponent = ({ data, isLoading, connections, isInput, externalSystem }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-3 space-y-3
|
|
16835
|
+
var TooltipBodyComponent = ({ data, isLoading, connections, isInput, externalSystem }) => /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaBase, { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-3 space-y-3", children: [
|
|
16884
16836
|
isLoading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
16885
16837
|
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-6 w-3/4" }),
|
|
16886
16838
|
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBase, { className: "h-3.5 w-1/2" })
|
|
@@ -16923,7 +16875,7 @@ var TooltipBodyComponent = ({ data, isLoading, connections, isInput, externalSys
|
|
|
16923
16875
|
conn.id
|
|
16924
16876
|
)) })
|
|
16925
16877
|
] })
|
|
16926
|
-
] });
|
|
16878
|
+
] }) });
|
|
16927
16879
|
var TooltipBody = React32__namespace.default.memo(TooltipBodyComponent);
|
|
16928
16880
|
var tooltipVariants3 = {
|
|
16929
16881
|
hidden: {
|
|
@@ -20393,7 +20345,9 @@ function CarouselBase({
|
|
|
20393
20345
|
autoPlayInterval = 3e3,
|
|
20394
20346
|
zoomEffect = null,
|
|
20395
20347
|
download = false,
|
|
20396
|
-
isLoading = false
|
|
20348
|
+
isLoading = false,
|
|
20349
|
+
onChange,
|
|
20350
|
+
fernando
|
|
20397
20351
|
}) {
|
|
20398
20352
|
const isMobile = useIsMobile();
|
|
20399
20353
|
const [index, setIndex] = React32.useState(0);
|
|
@@ -20404,7 +20358,9 @@ function CarouselBase({
|
|
|
20404
20358
|
React32.useEffect(() => {
|
|
20405
20359
|
if (!emblaApi) return;
|
|
20406
20360
|
const onSelect = () => {
|
|
20407
|
-
|
|
20361
|
+
const newIndex = emblaApi.selectedScrollSnap();
|
|
20362
|
+
setIndex(newIndex);
|
|
20363
|
+
onChange?.(newIndex);
|
|
20408
20364
|
};
|
|
20409
20365
|
emblaApi.on("select", onSelect);
|
|
20410
20366
|
emblaApi.on("reInit", onSelect);
|
|
@@ -20412,7 +20368,7 @@ function CarouselBase({
|
|
|
20412
20368
|
emblaApi.off("select", onSelect);
|
|
20413
20369
|
emblaApi.off("reInit", onSelect);
|
|
20414
20370
|
};
|
|
20415
|
-
}, [emblaApi]);
|
|
20371
|
+
}, [emblaApi, onChange]);
|
|
20416
20372
|
React32.useEffect(() => {
|
|
20417
20373
|
if (!autoPlay || items.length <= 1 || !emblaApi) return;
|
|
20418
20374
|
const interval = setInterval(() => {
|
|
@@ -20465,7 +20421,10 @@ function CarouselBase({
|
|
|
20465
20421
|
initial: { opacity: 0 },
|
|
20466
20422
|
animate: { opacity: 1 },
|
|
20467
20423
|
transition: { duration: 0.4 },
|
|
20468
|
-
className: cn(
|
|
20424
|
+
className: cn(
|
|
20425
|
+
"w-full lg:p-10 sm:p-4 p-2 transition-colors duration-500",
|
|
20426
|
+
className
|
|
20427
|
+
),
|
|
20469
20428
|
style: { width },
|
|
20470
20429
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3 h-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative h-full", containerClassName), children: [
|
|
20471
20430
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -20517,7 +20476,8 @@ function CarouselBase({
|
|
|
20517
20476
|
onMouseDown: (e) => e.stopPropagation(),
|
|
20518
20477
|
className: cn(
|
|
20519
20478
|
"absolute top-4 right-4 z-50 p-2 rounded-full text-white transition-colors border border-white/10",
|
|
20520
|
-
downloadSuccess ? "bg-green-500 hover:bg-green-600" : "bg-black/50 hover:bg-black/70"
|
|
20479
|
+
downloadSuccess ? "bg-green-500 hover:bg-green-600" : "bg-black/50 hover:bg-black/70",
|
|
20480
|
+
className
|
|
20521
20481
|
),
|
|
20522
20482
|
title: "Download image",
|
|
20523
20483
|
initial: false,
|
|
@@ -20600,8 +20560,13 @@ function CarouselBase({
|
|
|
20600
20560
|
onPointerDown: (e) => e.stopPropagation(),
|
|
20601
20561
|
onTouchStart: (e) => e.stopPropagation(),
|
|
20602
20562
|
onMouseDown: (e) => e.stopPropagation(),
|
|
20603
|
-
className:
|
|
20604
|
-
|
|
20563
|
+
className: cn(
|
|
20564
|
+
"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",
|
|
20565
|
+
!emblaApi?.canScrollPrev() ? "opacity-40 cursor-not-allowed" : "hover:scale-110 hover:opacity-100 opacity-70",
|
|
20566
|
+
"bg-primary text-primary-foreground",
|
|
20567
|
+
className
|
|
20568
|
+
),
|
|
20569
|
+
style: fernando ? { backgroundColor: fernando } : void 0,
|
|
20605
20570
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20606
20571
|
"svg",
|
|
20607
20572
|
{
|
|
@@ -20630,8 +20595,13 @@ function CarouselBase({
|
|
|
20630
20595
|
onPointerDown: (e) => e.stopPropagation(),
|
|
20631
20596
|
onTouchStart: (e) => e.stopPropagation(),
|
|
20632
20597
|
onMouseDown: (e) => e.stopPropagation(),
|
|
20633
|
-
className:
|
|
20634
|
-
|
|
20598
|
+
className: cn(
|
|
20599
|
+
"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",
|
|
20600
|
+
!emblaApi?.canScrollNext() ? "opacity-40 cursor-not-allowed" : "hover:scale-110 hover:opacity-100 opacity-70",
|
|
20601
|
+
"bg-primary text-primary-foreground",
|
|
20602
|
+
className
|
|
20603
|
+
),
|
|
20604
|
+
style: fernando ? { backgroundColor: fernando } : void 0,
|
|
20635
20605
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20636
20606
|
"svg",
|
|
20637
20607
|
{
|
|
@@ -20660,7 +20630,12 @@ function CarouselBase({
|
|
|
20660
20630
|
onPointerDown: (e) => e.stopPropagation(),
|
|
20661
20631
|
onTouchStart: (e) => e.stopPropagation(),
|
|
20662
20632
|
onMouseDown: (e) => e.stopPropagation(),
|
|
20663
|
-
className:
|
|
20633
|
+
className: cn(
|
|
20634
|
+
"h-2 rounded-full transition-all duration-300",
|
|
20635
|
+
i === index ? cn("w-8 bg-primary") : cn("w-2 hover:opacity-80 bg-primary opacity-40"),
|
|
20636
|
+
className
|
|
20637
|
+
),
|
|
20638
|
+
style: fernando ? { backgroundColor: fernando } : void 0
|
|
20664
20639
|
},
|
|
20665
20640
|
i
|
|
20666
20641
|
)) })
|
|
@@ -20849,9 +20824,9 @@ function RadialMenu({
|
|
|
20849
20824
|
}
|
|
20850
20825
|
function ControlledCombobox({
|
|
20851
20826
|
items,
|
|
20852
|
-
|
|
20853
|
-
|
|
20854
|
-
|
|
20827
|
+
value,
|
|
20828
|
+
onChange,
|
|
20829
|
+
placeholder = "Selecione uma op\xE7\xE3o",
|
|
20855
20830
|
disabled = false,
|
|
20856
20831
|
keepOpen = false,
|
|
20857
20832
|
searchPlaceholder,
|
|
@@ -20861,7 +20836,6 @@ function ControlledCombobox({
|
|
|
20861
20836
|
labelClassname,
|
|
20862
20837
|
testIds = {},
|
|
20863
20838
|
onClear,
|
|
20864
|
-
hasSelected = false,
|
|
20865
20839
|
hideClear = false,
|
|
20866
20840
|
onSearchChange,
|
|
20867
20841
|
search,
|
|
@@ -20869,6 +20843,11 @@ function ControlledCombobox({
|
|
|
20869
20843
|
loading = false
|
|
20870
20844
|
}) {
|
|
20871
20845
|
const [open, setOpen] = React32.useState(false);
|
|
20846
|
+
const selectedItem = items.find((item) => item.value === value);
|
|
20847
|
+
const renderSelected = selectedItem?.label ?? placeholder;
|
|
20848
|
+
const hasSelected = Boolean(value);
|
|
20849
|
+
const checkIsSelected = (v) => v === value;
|
|
20850
|
+
const handleSelection = (v) => onChange?.(v);
|
|
20872
20851
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20873
20852
|
"div",
|
|
20874
20853
|
{
|
|
@@ -20941,9 +20920,9 @@ function ControlledCombobox({
|
|
|
20941
20920
|
{
|
|
20942
20921
|
className: "dark:text-white hover:bg-rsecondary focus:ring-0 focus:outline-none",
|
|
20943
20922
|
"data-testid": testIds.command ?? "combobox-command",
|
|
20944
|
-
filter: onSearchChange ? () => 1 : (
|
|
20945
|
-
const
|
|
20946
|
-
if (
|
|
20923
|
+
filter: onSearchChange ? () => 1 : (itemValue, search2) => {
|
|
20924
|
+
const itemLabel = items.find((item) => item.value === itemValue)?.label || itemValue;
|
|
20925
|
+
if (itemLabel.toLowerCase().includes(search2.toLowerCase()))
|
|
20947
20926
|
return 1;
|
|
20948
20927
|
return 0;
|
|
20949
20928
|
},
|
|
@@ -20975,9 +20954,9 @@ function ControlledCombobox({
|
|
|
20975
20954
|
{
|
|
20976
20955
|
keywords: [item.label],
|
|
20977
20956
|
value: item.value,
|
|
20978
|
-
onSelect: (
|
|
20957
|
+
onSelect: (v) => {
|
|
20979
20958
|
if (disabled) return;
|
|
20980
|
-
handleSelection(
|
|
20959
|
+
handleSelection(v);
|
|
20981
20960
|
if (!keepOpen) setOpen(false);
|
|
20982
20961
|
},
|
|
20983
20962
|
disabled,
|
|
@@ -20994,7 +20973,7 @@ function ControlledCombobox({
|
|
|
20994
20973
|
stiffness: 500,
|
|
20995
20974
|
damping: 30
|
|
20996
20975
|
},
|
|
20997
|
-
className: "ml-auto
|
|
20976
|
+
className: "ml-auto",
|
|
20998
20977
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20999
20978
|
react.CheckIcon,
|
|
21000
20979
|
{
|
|
@@ -21182,6 +21161,7 @@ exports.EventItem = EventItem;
|
|
|
21182
21161
|
exports.EventItemAgenda = EventItemAgenda;
|
|
21183
21162
|
exports.EventsPopup = EventsPopup;
|
|
21184
21163
|
exports.FavoriteButton = FavoriteButton;
|
|
21164
|
+
exports.FileAccept = FileAccept;
|
|
21185
21165
|
exports.FileUploader = FileUploader;
|
|
21186
21166
|
exports.FilterButton = FilterButton;
|
|
21187
21167
|
exports.HideButton = HideButton;
|