@underverse-ui/underverse 0.2.119 → 0.2.120
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.cjs +1382 -832
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +152 -1
- package/dist/index.d.ts +152 -1
- package/dist/index.js +1262 -697
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12794,10 +12794,526 @@ function ImageUpload({
|
|
|
12794
12794
|
] });
|
|
12795
12795
|
}
|
|
12796
12796
|
|
|
12797
|
+
// ../../components/ui/FileUpload.tsx
|
|
12798
|
+
import { useState as useState32, useRef as useRef15, useCallback as useCallback13, useMemo as useMemo15 } from "react";
|
|
12799
|
+
import {
|
|
12800
|
+
Upload as Upload2,
|
|
12801
|
+
File,
|
|
12802
|
+
FileText,
|
|
12803
|
+
FileImage,
|
|
12804
|
+
FileVideo,
|
|
12805
|
+
FileAudio,
|
|
12806
|
+
FileArchive,
|
|
12807
|
+
FileCode,
|
|
12808
|
+
FileSpreadsheet,
|
|
12809
|
+
Loader2 as Loader26,
|
|
12810
|
+
Check as Check8,
|
|
12811
|
+
AlertCircle as AlertCircle3,
|
|
12812
|
+
Trash2,
|
|
12813
|
+
Eye as Eye2,
|
|
12814
|
+
Download
|
|
12815
|
+
} from "lucide-react";
|
|
12816
|
+
import { Fragment as Fragment17, jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
12817
|
+
var formatFileSize = (bytes) => {
|
|
12818
|
+
if (bytes === 0) return "0 Bytes";
|
|
12819
|
+
const k = 1024;
|
|
12820
|
+
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
12821
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
12822
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
|
12823
|
+
};
|
|
12824
|
+
var getFileIcon = (mimeType, fileName) => {
|
|
12825
|
+
if (mimeType.startsWith("image/")) return FileImage;
|
|
12826
|
+
if (mimeType.startsWith("video/")) return FileVideo;
|
|
12827
|
+
if (mimeType.startsWith("audio/")) return FileAudio;
|
|
12828
|
+
if (mimeType.includes("zip") || mimeType.includes("rar") || mimeType.includes("7z") || mimeType.includes("tar")) return FileArchive;
|
|
12829
|
+
if (mimeType.includes("pdf") || mimeType.includes("word") || mimeType.includes("document")) return FileText;
|
|
12830
|
+
if (mimeType.includes("sheet") || mimeType.includes("excel") || mimeType.includes("csv")) return FileSpreadsheet;
|
|
12831
|
+
if (mimeType.includes("javascript") || mimeType.includes("json") || mimeType.includes("html") || mimeType.includes("css") || mimeType.includes("xml"))
|
|
12832
|
+
return FileCode;
|
|
12833
|
+
const ext = fileName.split(".").pop()?.toLowerCase();
|
|
12834
|
+
switch (ext) {
|
|
12835
|
+
case "jpg":
|
|
12836
|
+
case "jpeg":
|
|
12837
|
+
case "png":
|
|
12838
|
+
case "gif":
|
|
12839
|
+
case "webp":
|
|
12840
|
+
case "svg":
|
|
12841
|
+
case "bmp":
|
|
12842
|
+
return FileImage;
|
|
12843
|
+
case "mp4":
|
|
12844
|
+
case "avi":
|
|
12845
|
+
case "mov":
|
|
12846
|
+
case "mkv":
|
|
12847
|
+
case "webm":
|
|
12848
|
+
return FileVideo;
|
|
12849
|
+
case "mp3":
|
|
12850
|
+
case "wav":
|
|
12851
|
+
case "ogg":
|
|
12852
|
+
case "flac":
|
|
12853
|
+
return FileAudio;
|
|
12854
|
+
case "zip":
|
|
12855
|
+
case "rar":
|
|
12856
|
+
case "7z":
|
|
12857
|
+
case "tar":
|
|
12858
|
+
case "gz":
|
|
12859
|
+
return FileArchive;
|
|
12860
|
+
case "pdf":
|
|
12861
|
+
case "doc":
|
|
12862
|
+
case "docx":
|
|
12863
|
+
case "txt":
|
|
12864
|
+
case "rtf":
|
|
12865
|
+
return FileText;
|
|
12866
|
+
case "xls":
|
|
12867
|
+
case "xlsx":
|
|
12868
|
+
case "csv":
|
|
12869
|
+
return FileSpreadsheet;
|
|
12870
|
+
case "js":
|
|
12871
|
+
case "ts":
|
|
12872
|
+
case "jsx":
|
|
12873
|
+
case "tsx":
|
|
12874
|
+
case "html":
|
|
12875
|
+
case "css":
|
|
12876
|
+
case "json":
|
|
12877
|
+
case "py":
|
|
12878
|
+
case "java":
|
|
12879
|
+
case "cpp":
|
|
12880
|
+
case "c":
|
|
12881
|
+
return FileCode;
|
|
12882
|
+
default:
|
|
12883
|
+
return File;
|
|
12884
|
+
}
|
|
12885
|
+
};
|
|
12886
|
+
var getFileTypeColor = (mimeType) => {
|
|
12887
|
+
if (mimeType.startsWith("image/")) return "text-pink-500";
|
|
12888
|
+
if (mimeType.startsWith("video/")) return "text-purple-500";
|
|
12889
|
+
if (mimeType.startsWith("audio/")) return "text-orange-500";
|
|
12890
|
+
if (mimeType.includes("zip") || mimeType.includes("rar")) return "text-amber-500";
|
|
12891
|
+
if (mimeType.includes("pdf")) return "text-red-500";
|
|
12892
|
+
if (mimeType.includes("word") || mimeType.includes("document")) return "text-blue-500";
|
|
12893
|
+
if (mimeType.includes("sheet") || mimeType.includes("excel")) return "text-green-500";
|
|
12894
|
+
if (mimeType.includes("javascript") || mimeType.includes("json")) return "text-yellow-500";
|
|
12895
|
+
return "text-muted-foreground";
|
|
12896
|
+
};
|
|
12897
|
+
var generateFileId = () => {
|
|
12898
|
+
return `file_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
12899
|
+
};
|
|
12900
|
+
function FileUpload({
|
|
12901
|
+
onUpload,
|
|
12902
|
+
onRemove,
|
|
12903
|
+
onChange,
|
|
12904
|
+
uploadHandler,
|
|
12905
|
+
maxSize = 50,
|
|
12906
|
+
// Default 50MB
|
|
12907
|
+
maxFiles = 10,
|
|
12908
|
+
accept,
|
|
12909
|
+
multiple = true,
|
|
12910
|
+
disabled = false,
|
|
12911
|
+
className,
|
|
12912
|
+
showFileList = true,
|
|
12913
|
+
variant = "default",
|
|
12914
|
+
size = "md",
|
|
12915
|
+
dragDropText,
|
|
12916
|
+
browseText,
|
|
12917
|
+
supportedFormatsText,
|
|
12918
|
+
showTypeIcons = true,
|
|
12919
|
+
allowPreview = true,
|
|
12920
|
+
initialFiles = []
|
|
12921
|
+
}) {
|
|
12922
|
+
const [isDragging, setIsDragging] = useState32(false);
|
|
12923
|
+
const [files, setFiles] = useState32(initialFiles);
|
|
12924
|
+
const fileInputRef = useRef15(null);
|
|
12925
|
+
const { addToast } = useToast();
|
|
12926
|
+
const t = useTranslations("FileUpload");
|
|
12927
|
+
const sizeConfig = useMemo15(
|
|
12928
|
+
() => ({
|
|
12929
|
+
sm: {
|
|
12930
|
+
padding: "p-4",
|
|
12931
|
+
iconSize: "w-8 h-8",
|
|
12932
|
+
uploadIconSize: "w-10 h-10",
|
|
12933
|
+
text: "text-xs",
|
|
12934
|
+
gap: "gap-2",
|
|
12935
|
+
listItemPadding: "p-2",
|
|
12936
|
+
fileIconSize: "w-8 h-8"
|
|
12937
|
+
},
|
|
12938
|
+
md: {
|
|
12939
|
+
padding: "p-6",
|
|
12940
|
+
iconSize: "w-10 h-10",
|
|
12941
|
+
uploadIconSize: "w-12 h-12",
|
|
12942
|
+
text: "text-sm",
|
|
12943
|
+
gap: "gap-3",
|
|
12944
|
+
listItemPadding: "p-3",
|
|
12945
|
+
fileIconSize: "w-10 h-10"
|
|
12946
|
+
},
|
|
12947
|
+
lg: {
|
|
12948
|
+
padding: "p-8",
|
|
12949
|
+
iconSize: "w-12 h-12",
|
|
12950
|
+
uploadIconSize: "w-14 h-14",
|
|
12951
|
+
text: "text-base",
|
|
12952
|
+
gap: "gap-4",
|
|
12953
|
+
listItemPadding: "p-4",
|
|
12954
|
+
fileIconSize: "w-12 h-12"
|
|
12955
|
+
}
|
|
12956
|
+
}),
|
|
12957
|
+
[]
|
|
12958
|
+
);
|
|
12959
|
+
const currentSize = sizeConfig[size];
|
|
12960
|
+
const handleDragOver = useCallback13(
|
|
12961
|
+
(e) => {
|
|
12962
|
+
e.preventDefault();
|
|
12963
|
+
e.stopPropagation();
|
|
12964
|
+
if (!disabled) {
|
|
12965
|
+
setIsDragging(true);
|
|
12966
|
+
}
|
|
12967
|
+
},
|
|
12968
|
+
[disabled]
|
|
12969
|
+
);
|
|
12970
|
+
const handleDragLeave = useCallback13((e) => {
|
|
12971
|
+
e.preventDefault();
|
|
12972
|
+
e.stopPropagation();
|
|
12973
|
+
setIsDragging(false);
|
|
12974
|
+
}, []);
|
|
12975
|
+
const processFiles = useCallback13(
|
|
12976
|
+
async (fileList) => {
|
|
12977
|
+
if (fileList.length === 0) return;
|
|
12978
|
+
const remainingSlots = maxFiles - files.length;
|
|
12979
|
+
if (remainingSlots <= 0) {
|
|
12980
|
+
addToast({
|
|
12981
|
+
type: "warning",
|
|
12982
|
+
message: t("maxFilesReached") || `Maximum ${maxFiles} files allowed`
|
|
12983
|
+
});
|
|
12984
|
+
return;
|
|
12985
|
+
}
|
|
12986
|
+
const filesToProcess = fileList.slice(0, remainingSlots);
|
|
12987
|
+
const validFiles = [];
|
|
12988
|
+
for (const file of filesToProcess) {
|
|
12989
|
+
if (file.size > maxSize * 1024 * 1024) {
|
|
12990
|
+
addToast({
|
|
12991
|
+
type: "error",
|
|
12992
|
+
message: `"${file.name}" ${t("fileTooLarge") || "exceeds size limit"} (${maxSize}MB)`
|
|
12993
|
+
});
|
|
12994
|
+
continue;
|
|
12995
|
+
}
|
|
12996
|
+
const fileEntry = {
|
|
12997
|
+
id: generateFileId(),
|
|
12998
|
+
file,
|
|
12999
|
+
name: file.name,
|
|
13000
|
+
size: file.size,
|
|
13001
|
+
type: file.type,
|
|
13002
|
+
url: file.type.startsWith("image/") ? URL.createObjectURL(file) : void 0,
|
|
13003
|
+
progress: 0,
|
|
13004
|
+
status: uploadHandler ? "pending" : "success",
|
|
13005
|
+
formattedSize: formatFileSize(file.size)
|
|
13006
|
+
};
|
|
13007
|
+
validFiles.push(fileEntry);
|
|
13008
|
+
}
|
|
13009
|
+
if (validFiles.length === 0) return;
|
|
13010
|
+
const newFiles = [...files, ...validFiles];
|
|
13011
|
+
setFiles(newFiles);
|
|
13012
|
+
onChange?.(newFiles);
|
|
13013
|
+
if (uploadHandler) {
|
|
13014
|
+
for (const fileEntry of validFiles) {
|
|
13015
|
+
setFiles((prev) => prev.map((f) => f.id === fileEntry.id ? { ...f, status: "uploading", progress: 10 } : f));
|
|
13016
|
+
try {
|
|
13017
|
+
const progressInterval = setInterval(() => {
|
|
13018
|
+
setFiles(
|
|
13019
|
+
(prev) => prev.map((f) => f.id === fileEntry.id && f.status === "uploading" ? { ...f, progress: Math.min((f.progress || 0) + 15, 90) } : f)
|
|
13020
|
+
);
|
|
13021
|
+
}, 200);
|
|
13022
|
+
const result = await uploadHandler(fileEntry.file);
|
|
13023
|
+
clearInterval(progressInterval);
|
|
13024
|
+
setFiles(
|
|
13025
|
+
(prev) => prev.map((f) => f.id === fileEntry.id ? { ...f, ...result, status: "success", progress: 100, id: result.id || f.id } : f)
|
|
13026
|
+
);
|
|
13027
|
+
onUpload?.(result);
|
|
13028
|
+
addToast({
|
|
13029
|
+
type: "success",
|
|
13030
|
+
message: `"${fileEntry.name}" ${t("uploadSuccess") || "uploaded successfully"}`
|
|
13031
|
+
});
|
|
13032
|
+
} catch (error) {
|
|
13033
|
+
setFiles((prev) => prev.map((f) => f.id === fileEntry.id ? { ...f, status: "error", error: error.message || "Upload failed" } : f));
|
|
13034
|
+
addToast({
|
|
13035
|
+
type: "error",
|
|
13036
|
+
message: `"${fileEntry.name}" ${t("uploadFailed") || "upload failed"}`
|
|
13037
|
+
});
|
|
13038
|
+
}
|
|
13039
|
+
}
|
|
13040
|
+
} else {
|
|
13041
|
+
for (const fileEntry of validFiles) {
|
|
13042
|
+
onUpload?.(fileEntry);
|
|
13043
|
+
}
|
|
13044
|
+
}
|
|
13045
|
+
},
|
|
13046
|
+
[files, maxFiles, maxSize, uploadHandler, onUpload, onChange, addToast, t]
|
|
13047
|
+
);
|
|
13048
|
+
const handleDrop = useCallback13(
|
|
13049
|
+
(e) => {
|
|
13050
|
+
e.preventDefault();
|
|
13051
|
+
e.stopPropagation();
|
|
13052
|
+
setIsDragging(false);
|
|
13053
|
+
if (disabled) return;
|
|
13054
|
+
const droppedFiles = Array.from(e.dataTransfer.files);
|
|
13055
|
+
processFiles(droppedFiles);
|
|
13056
|
+
},
|
|
13057
|
+
[disabled, processFiles]
|
|
13058
|
+
);
|
|
13059
|
+
const handleFileSelect = useCallback13(
|
|
13060
|
+
(e) => {
|
|
13061
|
+
const selectedFiles = Array.from(e.target.files || []);
|
|
13062
|
+
processFiles(selectedFiles);
|
|
13063
|
+
if (fileInputRef.current) {
|
|
13064
|
+
fileInputRef.current.value = "";
|
|
13065
|
+
}
|
|
13066
|
+
},
|
|
13067
|
+
[processFiles]
|
|
13068
|
+
);
|
|
13069
|
+
const handleRemove = useCallback13(
|
|
13070
|
+
(fileId) => {
|
|
13071
|
+
setFiles((prev) => {
|
|
13072
|
+
const fileToRemove = prev.find((f) => f.id === fileId);
|
|
13073
|
+
if (fileToRemove?.url?.startsWith("blob:")) {
|
|
13074
|
+
URL.revokeObjectURL(fileToRemove.url);
|
|
13075
|
+
}
|
|
13076
|
+
const newFiles = prev.filter((f) => f.id !== fileId);
|
|
13077
|
+
onChange?.(newFiles);
|
|
13078
|
+
return newFiles;
|
|
13079
|
+
});
|
|
13080
|
+
onRemove?.(fileId);
|
|
13081
|
+
},
|
|
13082
|
+
[onChange, onRemove]
|
|
13083
|
+
);
|
|
13084
|
+
const handleBrowseClick = () => {
|
|
13085
|
+
fileInputRef.current?.click();
|
|
13086
|
+
};
|
|
13087
|
+
const handleRetry = useCallback13(
|
|
13088
|
+
(fileEntry) => {
|
|
13089
|
+
if (!uploadHandler || !fileEntry.file) return;
|
|
13090
|
+
processFiles([fileEntry.file]);
|
|
13091
|
+
handleRemove(fileEntry.id);
|
|
13092
|
+
},
|
|
13093
|
+
[uploadHandler, processFiles, handleRemove]
|
|
13094
|
+
);
|
|
13095
|
+
const renderFileItem = (file) => {
|
|
13096
|
+
const IconComponent = showTypeIcons ? getFileIcon(file.type, file.name) : File;
|
|
13097
|
+
const iconColor = getFileTypeColor(file.type);
|
|
13098
|
+
const isImage = file.type.startsWith("image/") && file.url;
|
|
13099
|
+
return /* @__PURE__ */ jsxs40(
|
|
13100
|
+
"div",
|
|
13101
|
+
{
|
|
13102
|
+
className: cn(
|
|
13103
|
+
"group relative flex items-center gap-3 bg-card/50 backdrop-blur-sm border border-border rounded-xl",
|
|
13104
|
+
"transition-all duration-200 hover:bg-card hover:shadow-md hover:border-primary/20",
|
|
13105
|
+
file.status === "error" && "border-destructive/50 bg-destructive/5",
|
|
13106
|
+
file.status === "uploading" && "border-primary/30",
|
|
13107
|
+
currentSize.listItemPadding
|
|
13108
|
+
),
|
|
13109
|
+
children: [
|
|
13110
|
+
/* @__PURE__ */ jsx45(
|
|
13111
|
+
"div",
|
|
13112
|
+
{
|
|
13113
|
+
className: cn(
|
|
13114
|
+
"shrink-0 rounded-lg overflow-hidden flex items-center justify-center",
|
|
13115
|
+
"bg-linear-to-br from-muted/50 to-muted",
|
|
13116
|
+
currentSize.fileIconSize
|
|
13117
|
+
),
|
|
13118
|
+
children: isImage && allowPreview ? (
|
|
13119
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
13120
|
+
/* @__PURE__ */ jsx45("img", { src: file.url, alt: file.name, className: "w-full h-full object-cover" })
|
|
13121
|
+
) : /* @__PURE__ */ jsx45(IconComponent, { className: cn("w-1/2 h-1/2", iconColor) })
|
|
13122
|
+
}
|
|
13123
|
+
),
|
|
13124
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex-1 min-w-0", children: [
|
|
13125
|
+
/* @__PURE__ */ jsx45("p", { className: cn("font-medium truncate", currentSize.text), title: file.name, children: file.name }),
|
|
13126
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
|
|
13127
|
+
/* @__PURE__ */ jsx45("span", { className: cn("text-muted-foreground", size === "lg" ? "text-sm" : "text-xs"), children: file.formattedSize }),
|
|
13128
|
+
file.status === "uploading" && /* @__PURE__ */ jsxs40("span", { className: "flex items-center gap-1 text-primary text-xs", children: [
|
|
13129
|
+
/* @__PURE__ */ jsx45(Loader26, { className: "w-3 h-3 animate-spin" }),
|
|
13130
|
+
file.progress,
|
|
13131
|
+
"%"
|
|
13132
|
+
] }),
|
|
13133
|
+
file.status === "success" && /* @__PURE__ */ jsx45("span", { className: "flex items-center gap-1 text-success text-xs", children: /* @__PURE__ */ jsx45(Check8, { className: "w-3 h-3" }) }),
|
|
13134
|
+
file.status === "error" && /* @__PURE__ */ jsxs40("span", { className: "flex items-center gap-1 text-destructive text-xs", children: [
|
|
13135
|
+
/* @__PURE__ */ jsx45(AlertCircle3, { className: "w-3 h-3" }),
|
|
13136
|
+
file.error
|
|
13137
|
+
] })
|
|
13138
|
+
] }),
|
|
13139
|
+
file.status === "uploading" && /* @__PURE__ */ jsx45("div", { className: "mt-2 h-1 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsx45(
|
|
13140
|
+
"div",
|
|
13141
|
+
{
|
|
13142
|
+
className: "h-full bg-linear-to-r from-primary to-primary/70 rounded-full transition-all duration-300",
|
|
13143
|
+
style: { width: `${file.progress || 0}%` }
|
|
13144
|
+
}
|
|
13145
|
+
) })
|
|
13146
|
+
] }),
|
|
13147
|
+
/* @__PURE__ */ jsxs40("div", { className: "shrink-0 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", children: [
|
|
13148
|
+
isImage && allowPreview && /* @__PURE__ */ jsx45(Button_default, { variant: "ghost", size: "icon", className: "w-7 h-7", onClick: () => window.open(file.url, "_blank"), title: "Preview", children: /* @__PURE__ */ jsx45(Eye2, { className: "w-4 h-4" }) }),
|
|
13149
|
+
file.url && file.status === "success" && /* @__PURE__ */ jsx45(
|
|
13150
|
+
Button_default,
|
|
13151
|
+
{
|
|
13152
|
+
variant: "ghost",
|
|
13153
|
+
size: "icon",
|
|
13154
|
+
className: "w-7 h-7",
|
|
13155
|
+
onClick: () => {
|
|
13156
|
+
const link = document.createElement("a");
|
|
13157
|
+
link.href = file.url;
|
|
13158
|
+
link.download = file.name;
|
|
13159
|
+
link.click();
|
|
13160
|
+
},
|
|
13161
|
+
title: "Download",
|
|
13162
|
+
children: /* @__PURE__ */ jsx45(Download, { className: "w-4 h-4" })
|
|
13163
|
+
}
|
|
13164
|
+
),
|
|
13165
|
+
file.status === "error" && uploadHandler && /* @__PURE__ */ jsx45(Button_default, { variant: "ghost", size: "icon", className: "w-7 h-7 text-primary", onClick: () => handleRetry(file), title: "Retry", children: /* @__PURE__ */ jsx45(Upload2, { className: "w-4 h-4" }) }),
|
|
13166
|
+
/* @__PURE__ */ jsx45(
|
|
13167
|
+
Button_default,
|
|
13168
|
+
{
|
|
13169
|
+
variant: "ghost",
|
|
13170
|
+
size: "icon",
|
|
13171
|
+
className: "w-7 h-7 text-destructive hover:text-destructive hover:bg-destructive/10",
|
|
13172
|
+
onClick: () => handleRemove(file.id),
|
|
13173
|
+
disabled: file.status === "uploading",
|
|
13174
|
+
title: "Remove",
|
|
13175
|
+
children: /* @__PURE__ */ jsx45(Trash2, { className: "w-4 h-4" })
|
|
13176
|
+
}
|
|
13177
|
+
)
|
|
13178
|
+
] })
|
|
13179
|
+
]
|
|
13180
|
+
},
|
|
13181
|
+
file.id
|
|
13182
|
+
);
|
|
13183
|
+
};
|
|
13184
|
+
const variantStyles6 = {
|
|
13185
|
+
default: cn(
|
|
13186
|
+
"border-2 border-dashed rounded-2xl",
|
|
13187
|
+
currentSize.padding,
|
|
13188
|
+
"text-center transition-all duration-300",
|
|
13189
|
+
isDragging && !disabled ? "border-primary bg-primary/5 scale-[1.01] shadow-lg shadow-primary/10" : "border-border hover:border-primary/50 hover:bg-muted/30",
|
|
13190
|
+
disabled && "opacity-50 cursor-not-allowed"
|
|
13191
|
+
),
|
|
13192
|
+
compact: cn(
|
|
13193
|
+
"border border-dashed rounded-xl p-4",
|
|
13194
|
+
"flex items-center gap-4 transition-all duration-200",
|
|
13195
|
+
isDragging && !disabled ? "border-primary bg-primary/5" : "border-border hover:border-primary/50",
|
|
13196
|
+
disabled && "opacity-50 cursor-not-allowed"
|
|
13197
|
+
),
|
|
13198
|
+
minimal: cn(
|
|
13199
|
+
"rounded-lg p-3 transition-all duration-200",
|
|
13200
|
+
isDragging && !disabled ? "bg-primary/10" : "hover:bg-muted/50",
|
|
13201
|
+
disabled && "opacity-50 cursor-not-allowed"
|
|
13202
|
+
)
|
|
13203
|
+
};
|
|
13204
|
+
return /* @__PURE__ */ jsxs40("div", { className: cn("space-y-4", className), children: [
|
|
13205
|
+
/* @__PURE__ */ jsxs40(
|
|
13206
|
+
"div",
|
|
13207
|
+
{
|
|
13208
|
+
className: variantStyles6[variant],
|
|
13209
|
+
onDragOver: handleDragOver,
|
|
13210
|
+
onDragLeave: handleDragLeave,
|
|
13211
|
+
onDrop: handleDrop,
|
|
13212
|
+
onClick: variant === "minimal" ? handleBrowseClick : void 0,
|
|
13213
|
+
role: variant === "minimal" ? "button" : void 0,
|
|
13214
|
+
tabIndex: variant === "minimal" ? 0 : void 0,
|
|
13215
|
+
children: [
|
|
13216
|
+
variant === "default" && /* @__PURE__ */ jsxs40("div", { className: cn("space-y-4", currentSize.gap), children: [
|
|
13217
|
+
/* @__PURE__ */ jsx45(
|
|
13218
|
+
"div",
|
|
13219
|
+
{
|
|
13220
|
+
className: cn(
|
|
13221
|
+
"mx-auto rounded-full flex items-center justify-center",
|
|
13222
|
+
"bg-linear-to-br from-primary/20 to-primary/5",
|
|
13223
|
+
"ring-4 ring-primary/10",
|
|
13224
|
+
currentSize.uploadIconSize
|
|
13225
|
+
),
|
|
13226
|
+
children: /* @__PURE__ */ jsx45(Upload2, { className: cn("text-primary transition-transform duration-300", isDragging && "scale-110", currentSize.iconSize) })
|
|
13227
|
+
}
|
|
13228
|
+
),
|
|
13229
|
+
/* @__PURE__ */ jsxs40("div", { className: "space-y-2", children: [
|
|
13230
|
+
/* @__PURE__ */ jsx45("p", { className: cn("text-muted-foreground font-medium", currentSize.text), children: dragDropText || t("dragDropText") || "Drag & drop files here" }),
|
|
13231
|
+
/* @__PURE__ */ jsxs40(
|
|
13232
|
+
Button_default,
|
|
13233
|
+
{
|
|
13234
|
+
type: "button",
|
|
13235
|
+
variant: "outline",
|
|
13236
|
+
size: size === "lg" ? "md" : "sm",
|
|
13237
|
+
onClick: handleBrowseClick,
|
|
13238
|
+
disabled,
|
|
13239
|
+
className: "relative overflow-hidden group/btn",
|
|
13240
|
+
children: [
|
|
13241
|
+
/* @__PURE__ */ jsx45("span", { className: "relative z-10", children: browseText || t("browseFiles") || "Browse files" }),
|
|
13242
|
+
/* @__PURE__ */ jsx45("div", { className: "absolute inset-0 bg-linear-to-r from-primary/10 to-transparent opacity-0 group-hover/btn:opacity-100 transition-opacity" })
|
|
13243
|
+
]
|
|
13244
|
+
}
|
|
13245
|
+
)
|
|
13246
|
+
] }),
|
|
13247
|
+
/* @__PURE__ */ jsx45("p", { className: cn("text-muted-foreground", size === "lg" ? "text-sm" : "text-xs"), children: supportedFormatsText || t("supportedFormats") || `Max ${maxSize}MB per file \u2022 Up to ${maxFiles} files` })
|
|
13248
|
+
] }),
|
|
13249
|
+
variant === "compact" && /* @__PURE__ */ jsxs40(Fragment17, { children: [
|
|
13250
|
+
/* @__PURE__ */ jsx45("div", { className: cn("shrink-0 rounded-lg flex items-center justify-center", "bg-primary/10", currentSize.iconSize), children: /* @__PURE__ */ jsx45(Upload2, { className: cn("text-primary", size === "sm" ? "w-4 h-4" : "w-5 h-5") }) }),
|
|
13251
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex-1 min-w-0", children: [
|
|
13252
|
+
/* @__PURE__ */ jsx45("p", { className: cn("font-medium truncate", currentSize.text), children: dragDropText || t("dragDropText") || "Drop files here or" }),
|
|
13253
|
+
/* @__PURE__ */ jsx45("p", { className: cn("text-muted-foreground", size === "lg" ? "text-sm" : "text-xs"), children: supportedFormatsText || `Max ${maxSize}MB \u2022 ${maxFiles} files` })
|
|
13254
|
+
] }),
|
|
13255
|
+
/* @__PURE__ */ jsx45(Button_default, { type: "button", variant: "primary", size: size === "lg" ? "md" : "sm", onClick: handleBrowseClick, disabled, children: browseText || t("browseFiles") || "Browse" })
|
|
13256
|
+
] }),
|
|
13257
|
+
variant === "minimal" && /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
13258
|
+
/* @__PURE__ */ jsx45(Upload2, { className: cn("text-primary", size === "sm" ? "w-4 h-4" : "w-5 h-5") }),
|
|
13259
|
+
/* @__PURE__ */ jsx45("span", { className: cn("text-primary font-medium", currentSize.text), children: browseText || t("uploadFiles") || "Upload files" })
|
|
13260
|
+
] }),
|
|
13261
|
+
/* @__PURE__ */ jsx45(
|
|
13262
|
+
"input",
|
|
13263
|
+
{
|
|
13264
|
+
ref: fileInputRef,
|
|
13265
|
+
type: "file",
|
|
13266
|
+
accept,
|
|
13267
|
+
multiple,
|
|
13268
|
+
onChange: handleFileSelect,
|
|
13269
|
+
className: "hidden",
|
|
13270
|
+
disabled
|
|
13271
|
+
}
|
|
13272
|
+
)
|
|
13273
|
+
]
|
|
13274
|
+
}
|
|
13275
|
+
),
|
|
13276
|
+
showFileList && files.length > 0 && /* @__PURE__ */ jsxs40("div", { className: "space-y-2", children: [
|
|
13277
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between", children: [
|
|
13278
|
+
/* @__PURE__ */ jsxs40("h4", { className: cn("font-medium text-foreground", currentSize.text), children: [
|
|
13279
|
+
t("uploadedFiles") || "Uploaded files",
|
|
13280
|
+
" (",
|
|
13281
|
+
files.length,
|
|
13282
|
+
"/",
|
|
13283
|
+
maxFiles,
|
|
13284
|
+
")"
|
|
13285
|
+
] }),
|
|
13286
|
+
files.length > 0 && /* @__PURE__ */ jsxs40(
|
|
13287
|
+
Button_default,
|
|
13288
|
+
{
|
|
13289
|
+
variant: "ghost",
|
|
13290
|
+
size: "sm",
|
|
13291
|
+
className: "text-muted-foreground hover:text-destructive",
|
|
13292
|
+
onClick: () => {
|
|
13293
|
+
files.forEach((f) => {
|
|
13294
|
+
if (f.url?.startsWith("blob:")) {
|
|
13295
|
+
URL.revokeObjectURL(f.url);
|
|
13296
|
+
}
|
|
13297
|
+
});
|
|
13298
|
+
setFiles([]);
|
|
13299
|
+
onChange?.([]);
|
|
13300
|
+
},
|
|
13301
|
+
children: [
|
|
13302
|
+
/* @__PURE__ */ jsx45(Trash2, { className: "w-4 h-4 mr-1" }),
|
|
13303
|
+
t("clearAll") || "Clear all"
|
|
13304
|
+
]
|
|
13305
|
+
}
|
|
13306
|
+
)
|
|
13307
|
+
] }),
|
|
13308
|
+
/* @__PURE__ */ jsx45("div", { className: "space-y-2", children: files.map(renderFileItem) })
|
|
13309
|
+
] })
|
|
13310
|
+
] });
|
|
13311
|
+
}
|
|
13312
|
+
|
|
12797
13313
|
// ../../components/ui/Carousel.tsx
|
|
12798
13314
|
import * as React38 from "react";
|
|
12799
13315
|
import { ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight7 } from "lucide-react";
|
|
12800
|
-
import { Fragment as
|
|
13316
|
+
import { Fragment as Fragment18, jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
12801
13317
|
function Carousel({
|
|
12802
13318
|
children,
|
|
12803
13319
|
autoScroll = true,
|
|
@@ -12955,7 +13471,7 @@ function Carousel({
|
|
|
12955
13471
|
};
|
|
12956
13472
|
};
|
|
12957
13473
|
const slideWidth = 100 / slidesToShow;
|
|
12958
|
-
return /* @__PURE__ */
|
|
13474
|
+
return /* @__PURE__ */ jsxs41(
|
|
12959
13475
|
"div",
|
|
12960
13476
|
{
|
|
12961
13477
|
ref: carouselRef,
|
|
@@ -12970,8 +13486,8 @@ function Carousel({
|
|
|
12970
13486
|
"aria-roledescription": "carousel",
|
|
12971
13487
|
tabIndex: 0,
|
|
12972
13488
|
children: [
|
|
12973
|
-
showProgress && autoScroll && /* @__PURE__ */
|
|
12974
|
-
/* @__PURE__ */
|
|
13489
|
+
showProgress && autoScroll && /* @__PURE__ */ jsx46("div", { className: "absolute top-0 left-0 right-0 h-1 bg-muted z-20", children: /* @__PURE__ */ jsx46("div", { ref: progressElRef, className: "h-full bg-primary", style: { width: "0%" } }) }),
|
|
13490
|
+
/* @__PURE__ */ jsx46(
|
|
12975
13491
|
"div",
|
|
12976
13492
|
{
|
|
12977
13493
|
className: cn("flex", isHorizontal ? "flex-row" : "flex-col", containerClassName),
|
|
@@ -12986,7 +13502,7 @@ function Carousel({
|
|
|
12986
13502
|
role: "group",
|
|
12987
13503
|
"aria-atomic": "false",
|
|
12988
13504
|
"aria-live": autoScroll ? "off" : "polite",
|
|
12989
|
-
children: React38.Children.map(children, (child, idx) => /* @__PURE__ */
|
|
13505
|
+
children: React38.Children.map(children, (child, idx) => /* @__PURE__ */ jsx46(
|
|
12990
13506
|
"div",
|
|
12991
13507
|
{
|
|
12992
13508
|
className: cn(
|
|
@@ -13009,8 +13525,8 @@ function Carousel({
|
|
|
13009
13525
|
))
|
|
13010
13526
|
}
|
|
13011
13527
|
),
|
|
13012
|
-
showArrows && totalSlides > slidesToShow && /* @__PURE__ */
|
|
13013
|
-
/* @__PURE__ */
|
|
13528
|
+
showArrows && totalSlides > slidesToShow && /* @__PURE__ */ jsxs41(Fragment18, { children: [
|
|
13529
|
+
/* @__PURE__ */ jsx46(
|
|
13014
13530
|
Button_default,
|
|
13015
13531
|
{
|
|
13016
13532
|
onClick: scrollPrev,
|
|
@@ -13026,7 +13542,7 @@ function Carousel({
|
|
|
13026
13542
|
"aria-label": "Previous slide"
|
|
13027
13543
|
}
|
|
13028
13544
|
),
|
|
13029
|
-
/* @__PURE__ */
|
|
13545
|
+
/* @__PURE__ */ jsx46(
|
|
13030
13546
|
Button_default,
|
|
13031
13547
|
{
|
|
13032
13548
|
onClick: scrollNext,
|
|
@@ -13043,7 +13559,7 @@ function Carousel({
|
|
|
13043
13559
|
}
|
|
13044
13560
|
)
|
|
13045
13561
|
] }),
|
|
13046
|
-
showDots && totalSlides > slidesToShow && /* @__PURE__ */
|
|
13562
|
+
showDots && totalSlides > slidesToShow && /* @__PURE__ */ jsx46(
|
|
13047
13563
|
"div",
|
|
13048
13564
|
{
|
|
13049
13565
|
className: cn(
|
|
@@ -13052,7 +13568,7 @@ function Carousel({
|
|
|
13052
13568
|
),
|
|
13053
13569
|
role: "tablist",
|
|
13054
13570
|
"aria-label": "Carousel pagination",
|
|
13055
|
-
children: Array.from({ length: maxIndex + 1 }, (_, idx) => /* @__PURE__ */
|
|
13571
|
+
children: Array.from({ length: maxIndex + 1 }, (_, idx) => /* @__PURE__ */ jsx46(
|
|
13056
13572
|
"button",
|
|
13057
13573
|
{
|
|
13058
13574
|
onClick: () => scrollTo(idx),
|
|
@@ -13069,14 +13585,14 @@ function Carousel({
|
|
|
13069
13585
|
))
|
|
13070
13586
|
}
|
|
13071
13587
|
),
|
|
13072
|
-
showThumbnails && totalSlides > slidesToShow && /* @__PURE__ */
|
|
13588
|
+
showThumbnails && totalSlides > slidesToShow && /* @__PURE__ */ jsx46(
|
|
13073
13589
|
"div",
|
|
13074
13590
|
{
|
|
13075
13591
|
className: cn(
|
|
13076
13592
|
"absolute bottom-0 left-0 right-0 flex gap-2 p-4 bg-linear-to-t from-black/50 to-transparent overflow-x-auto",
|
|
13077
13593
|
isHorizontal ? "flex-row" : "flex-col"
|
|
13078
13594
|
),
|
|
13079
|
-
children: React38.Children.map(children, (child, idx) => /* @__PURE__ */
|
|
13595
|
+
children: React38.Children.map(children, (child, idx) => /* @__PURE__ */ jsx46(
|
|
13080
13596
|
"button",
|
|
13081
13597
|
{
|
|
13082
13598
|
onClick: () => scrollTo(idx),
|
|
@@ -13098,7 +13614,7 @@ function Carousel({
|
|
|
13098
13614
|
|
|
13099
13615
|
// ../../components/ui/FallingIcons.tsx
|
|
13100
13616
|
import React39 from "react";
|
|
13101
|
-
import { jsx as
|
|
13617
|
+
import { jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
13102
13618
|
var DEFAULT_COUNT = 24;
|
|
13103
13619
|
var DEFAULT_SPEED_RANGE = [6, 14];
|
|
13104
13620
|
var DEFAULT_SIZE_RANGE = [14, 28];
|
|
@@ -13194,18 +13710,18 @@ function FallingIcons({
|
|
|
13194
13710
|
};
|
|
13195
13711
|
}, [glow, glowColor, glowIntensity]);
|
|
13196
13712
|
const FallbackIcon = React39.useMemo(
|
|
13197
|
-
() => (props) => /* @__PURE__ */
|
|
13713
|
+
() => (props) => /* @__PURE__ */ jsx47("svg", { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx47("circle", { cx: "12", cy: "12", r: "10" }) }),
|
|
13198
13714
|
[]
|
|
13199
13715
|
);
|
|
13200
|
-
const TheIcon = imageUrl ? ({ className: imgClassName }) => /* @__PURE__ */
|
|
13201
|
-
return /* @__PURE__ */
|
|
13716
|
+
const TheIcon = imageUrl ? ({ className: imgClassName }) => /* @__PURE__ */ jsx47("img", { src: imageUrl, alt: "", className: cn("w-full h-full object-cover rounded-lg", imgClassName), draggable: false }) : Icon || FallbackIcon;
|
|
13717
|
+
return /* @__PURE__ */ jsxs42(
|
|
13202
13718
|
"div",
|
|
13203
13719
|
{
|
|
13204
13720
|
ref: containerRef,
|
|
13205
13721
|
className: cn(fullScreen ? "fixed inset-0 overflow-hidden pointer-events-none" : "relative w-full h-full overflow-hidden", areaClassName),
|
|
13206
13722
|
style: { zIndex },
|
|
13207
13723
|
children: [
|
|
13208
|
-
/* @__PURE__ */
|
|
13724
|
+
/* @__PURE__ */ jsx47("style", { children: `
|
|
13209
13725
|
@keyframes ${FallName} {
|
|
13210
13726
|
0% { transform: translate3d(0, -10vh, 0); opacity: 0; }
|
|
13211
13727
|
10% { opacity: 1; }
|
|
@@ -13238,7 +13754,7 @@ function FallingIcons({
|
|
|
13238
13754
|
}
|
|
13239
13755
|
}
|
|
13240
13756
|
` }),
|
|
13241
|
-
/* @__PURE__ */
|
|
13757
|
+
/* @__PURE__ */ jsx47("div", { className: cn("absolute inset-0 pointer-events-none", className), "aria-hidden": true, children: particles.map((p, i) => {
|
|
13242
13758
|
const swayDuration = p.fallDur * (0.8 + i % 5 * 0.05);
|
|
13243
13759
|
const spinDuration = Math.max(1, p.spinDur);
|
|
13244
13760
|
const handlePop = () => {
|
|
@@ -13251,12 +13767,12 @@ function FallingIcons({
|
|
|
13251
13767
|
});
|
|
13252
13768
|
};
|
|
13253
13769
|
const trailParticles = trail ? Array.from({ length: Math.min(5, Math.max(1, trailLength)) }) : [];
|
|
13254
|
-
return /* @__PURE__ */
|
|
13770
|
+
return /* @__PURE__ */ jsxs42(React39.Fragment, { children: [
|
|
13255
13771
|
trail && trailParticles.map((_, trailIndex) => {
|
|
13256
13772
|
const trailDelay = p.delay - (trailIndex + 1) * 0.15;
|
|
13257
13773
|
const trailOpacity = 1 - (trailIndex + 1) * (1 / (trailParticles.length + 1));
|
|
13258
13774
|
const trailScale = 1 - (trailIndex + 1) * 0.15;
|
|
13259
|
-
return /* @__PURE__ */
|
|
13775
|
+
return /* @__PURE__ */ jsx47(
|
|
13260
13776
|
"span",
|
|
13261
13777
|
{
|
|
13262
13778
|
className: cn("absolute top-0 will-change-transform pointer-events-none uv-falling-particle", colorClassName),
|
|
@@ -13270,7 +13786,7 @@ function FallingIcons({
|
|
|
13270
13786
|
opacity: trailOpacity * 0.4,
|
|
13271
13787
|
["--fall"]: `${fallDist ?? (typeof window !== "undefined" ? window.innerHeight + 200 : 1200)}px`
|
|
13272
13788
|
},
|
|
13273
|
-
children: /* @__PURE__ */
|
|
13789
|
+
children: /* @__PURE__ */ jsx47(
|
|
13274
13790
|
"span",
|
|
13275
13791
|
{
|
|
13276
13792
|
className: "inline-block uv-sway",
|
|
@@ -13282,7 +13798,7 @@ function FallingIcons({
|
|
|
13282
13798
|
animationIterationCount: "infinite",
|
|
13283
13799
|
["--amp"]: `${Math.round(p.driftAmp)}px`
|
|
13284
13800
|
},
|
|
13285
|
-
children: /* @__PURE__ */
|
|
13801
|
+
children: /* @__PURE__ */ jsx47(
|
|
13286
13802
|
"span",
|
|
13287
13803
|
{
|
|
13288
13804
|
className: "block",
|
|
@@ -13291,7 +13807,7 @@ function FallingIcons({
|
|
|
13291
13807
|
height: p.size,
|
|
13292
13808
|
...glowStyles
|
|
13293
13809
|
},
|
|
13294
|
-
children: /* @__PURE__ */
|
|
13810
|
+
children: /* @__PURE__ */ jsx47(TheIcon, { className: cn("w-full h-full text-primary/70", colorClassName) })
|
|
13295
13811
|
}
|
|
13296
13812
|
)
|
|
13297
13813
|
}
|
|
@@ -13300,7 +13816,7 @@ function FallingIcons({
|
|
|
13300
13816
|
`${p.key}-trail-${trailIndex}`
|
|
13301
13817
|
);
|
|
13302
13818
|
}),
|
|
13303
|
-
/* @__PURE__ */
|
|
13819
|
+
/* @__PURE__ */ jsx47(
|
|
13304
13820
|
"span",
|
|
13305
13821
|
{
|
|
13306
13822
|
className: cn("absolute top-0 will-change-transform pointer-events-auto uv-falling-particle", colorClassName),
|
|
@@ -13326,7 +13842,7 @@ function FallingIcons({
|
|
|
13326
13842
|
return next;
|
|
13327
13843
|
});
|
|
13328
13844
|
},
|
|
13329
|
-
children: /* @__PURE__ */
|
|
13845
|
+
children: /* @__PURE__ */ jsx47(
|
|
13330
13846
|
"span",
|
|
13331
13847
|
{
|
|
13332
13848
|
className: "inline-block uv-sway",
|
|
@@ -13338,7 +13854,7 @@ function FallingIcons({
|
|
|
13338
13854
|
animationIterationCount: "infinite",
|
|
13339
13855
|
["--amp"]: `${Math.round(p.driftAmp)}px`
|
|
13340
13856
|
},
|
|
13341
|
-
children: /* @__PURE__ */
|
|
13857
|
+
children: /* @__PURE__ */ jsx47(
|
|
13342
13858
|
"span",
|
|
13343
13859
|
{
|
|
13344
13860
|
className: cn(
|
|
@@ -13354,7 +13870,7 @@ function FallingIcons({
|
|
|
13354
13870
|
["--popName"]: PopName,
|
|
13355
13871
|
...glowStyles
|
|
13356
13872
|
},
|
|
13357
|
-
children: /* @__PURE__ */
|
|
13873
|
+
children: /* @__PURE__ */ jsx47(TheIcon, { className: cn("w-full h-full text-primary/70", colorClassName) })
|
|
13358
13874
|
}
|
|
13359
13875
|
)
|
|
13360
13876
|
}
|
|
@@ -13371,7 +13887,7 @@ function FallingIcons({
|
|
|
13371
13887
|
// ../../components/ui/List.tsx
|
|
13372
13888
|
import * as React40 from "react";
|
|
13373
13889
|
import { ChevronRight as ChevronRight8 } from "lucide-react";
|
|
13374
|
-
import { Fragment as
|
|
13890
|
+
import { Fragment as Fragment19, jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
13375
13891
|
var SIZE_STYLES2 = {
|
|
13376
13892
|
xs: { label: "text-xs", desc: "text-[11px]", icon: "h-3.5 w-3.5", avatar: "h-6 w-6" },
|
|
13377
13893
|
sm: { label: "text-[13px]", desc: "text-[12px]", icon: "h-4 w-4", avatar: "h-8 w-8" },
|
|
@@ -13387,11 +13903,11 @@ var BADGE_VARIANTS = {
|
|
|
13387
13903
|
};
|
|
13388
13904
|
var ListItemSkeleton = ({ size }) => {
|
|
13389
13905
|
const sz = SIZE_STYLES2[size];
|
|
13390
|
-
return /* @__PURE__ */
|
|
13391
|
-
/* @__PURE__ */
|
|
13392
|
-
/* @__PURE__ */
|
|
13393
|
-
/* @__PURE__ */
|
|
13394
|
-
/* @__PURE__ */
|
|
13906
|
+
return /* @__PURE__ */ jsxs43("div", { className: cn("flex items-center gap-3 animate-pulse p-2"), children: [
|
|
13907
|
+
/* @__PURE__ */ jsx48("div", { className: cn("rounded-full bg-muted shrink-0", sz.avatar) }),
|
|
13908
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex-1 space-y-2", children: [
|
|
13909
|
+
/* @__PURE__ */ jsx48("div", { className: "h-4 bg-muted rounded-md w-3/4" }),
|
|
13910
|
+
/* @__PURE__ */ jsx48("div", { className: "h-3 bg-muted rounded-md w-1/2" })
|
|
13395
13911
|
] })
|
|
13396
13912
|
] });
|
|
13397
13913
|
};
|
|
@@ -13427,20 +13943,20 @@ var ListRoot = React40.forwardRef(
|
|
|
13427
13943
|
striped: "rounded-2xl md:rounded-3xl border border-border overflow-hidden"
|
|
13428
13944
|
};
|
|
13429
13945
|
if (loading2) {
|
|
13430
|
-
return /* @__PURE__ */
|
|
13946
|
+
return /* @__PURE__ */ jsx48(
|
|
13431
13947
|
Comp,
|
|
13432
13948
|
{
|
|
13433
13949
|
ref,
|
|
13434
13950
|
className: cn("group/list", variantClasses2[variant], inset && "p-1.5 md:p-2", divided && "divide-y divide-border/60", className),
|
|
13435
13951
|
...rest,
|
|
13436
|
-
children: Array.from({ length: loadingCount }).map((_, i) => /* @__PURE__ */
|
|
13952
|
+
children: Array.from({ length: loadingCount }).map((_, i) => /* @__PURE__ */ jsx48(ListItemSkeleton, { size }, i))
|
|
13437
13953
|
}
|
|
13438
13954
|
);
|
|
13439
13955
|
}
|
|
13440
13956
|
if (!hasChildren && emptyText) {
|
|
13441
|
-
return /* @__PURE__ */
|
|
13957
|
+
return /* @__PURE__ */ jsx48(Comp, { ref, className: cn("group/list", variantClasses2[variant], inset && "p-1.5 md:p-2", className), ...rest, children: /* @__PURE__ */ jsx48("div", { className: "text-center py-8 text-muted-foreground text-sm", children: emptyText }) });
|
|
13442
13958
|
}
|
|
13443
|
-
return /* @__PURE__ */
|
|
13959
|
+
return /* @__PURE__ */ jsx48(
|
|
13444
13960
|
Comp,
|
|
13445
13961
|
{
|
|
13446
13962
|
ref,
|
|
@@ -13523,42 +14039,42 @@ var ListItem = React40.forwardRef(
|
|
|
13523
14039
|
}
|
|
13524
14040
|
}
|
|
13525
14041
|
} : {};
|
|
13526
|
-
const inner = /* @__PURE__ */
|
|
13527
|
-
/* @__PURE__ */
|
|
13528
|
-
avatar && /* @__PURE__ */
|
|
13529
|
-
Left && !avatar && /* @__PURE__ */
|
|
13530
|
-
/* @__PURE__ */
|
|
13531
|
-
/* @__PURE__ */
|
|
13532
|
-
label && /* @__PURE__ */
|
|
13533
|
-
badge && /* @__PURE__ */
|
|
14042
|
+
const inner = /* @__PURE__ */ jsxs43(Fragment19, { children: [
|
|
14043
|
+
/* @__PURE__ */ jsxs43("div", { className: cn("flex items-center gap-3", contentClassName, "group/item relative"), ...headerProps, children: [
|
|
14044
|
+
avatar && /* @__PURE__ */ jsx48("div", { className: cn("shrink-0", sz.avatar), children: typeof avatar === "string" ? /* @__PURE__ */ jsx48("img", { src: avatar, alt: "", className: cn("rounded-full object-cover", sz.avatar) }) : avatar }),
|
|
14045
|
+
Left && !avatar && /* @__PURE__ */ jsx48("span", { className: cn("text-muted-foreground shrink-0", sz.icon), children: /* @__PURE__ */ jsx48(Left, { className: cn(sz.icon) }) }),
|
|
14046
|
+
/* @__PURE__ */ jsxs43("div", { className: "min-w-0 flex-1", children: [
|
|
14047
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-2", children: [
|
|
14048
|
+
label && /* @__PURE__ */ jsx48("div", { className: cn(sz.label, "text-foreground font-medium truncate"), children: label }),
|
|
14049
|
+
badge && /* @__PURE__ */ jsx48("span", { className: cn("px-2 py-0.5 rounded-full text-[11px] font-medium shrink-0", BADGE_VARIANTS[badgeVariant]), children: badge })
|
|
13534
14050
|
] }),
|
|
13535
|
-
description && /* @__PURE__ */
|
|
13536
|
-
children && /* @__PURE__ */
|
|
14051
|
+
description && /* @__PURE__ */ jsx48("div", { className: cn(sz.desc, "text-muted-foreground truncate mt-0.5"), children: description }),
|
|
14052
|
+
children && /* @__PURE__ */ jsx48("div", { className: "mt-1", children })
|
|
13537
14053
|
] }),
|
|
13538
|
-
action && /* @__PURE__ */
|
|
13539
|
-
collapsible ? /* @__PURE__ */
|
|
14054
|
+
action && /* @__PURE__ */ jsx48("div", { className: "opacity-0 group-hover/item:opacity-100 transition-opacity shrink-0", children: action }),
|
|
14055
|
+
collapsible ? /* @__PURE__ */ jsx48(
|
|
13540
14056
|
"span",
|
|
13541
14057
|
{
|
|
13542
14058
|
className: cn("text-muted-foreground shrink-0 transition-transform cursor-pointer select-none", sz.icon, isExpanded && "rotate-90"),
|
|
13543
|
-
children: /* @__PURE__ */
|
|
14059
|
+
children: /* @__PURE__ */ jsx48(ChevronRight8, { className: cn(sz.icon) })
|
|
13544
14060
|
}
|
|
13545
|
-
) : Right && /* @__PURE__ */
|
|
14061
|
+
) : Right && /* @__PURE__ */ jsx48("span", { className: cn("text-muted-foreground shrink-0", sz.icon), children: /* @__PURE__ */ jsx48(Right, { className: cn(sz.icon) }) })
|
|
13546
14062
|
] }),
|
|
13547
|
-
collapsible && isExpanded && expandContent && /* @__PURE__ */
|
|
14063
|
+
collapsible && isExpanded && expandContent && /* @__PURE__ */ jsx48("div", { className: cn("border-t border-border/50 bg-muted/20", contentClassName, "pt-3"), children: expandContent })
|
|
13548
14064
|
] });
|
|
13549
14065
|
const baseCls = cn("relative w-full", selected && "bg-primary/10 ring-1 ring-primary/30", disabled && "opacity-60 cursor-not-allowed", className);
|
|
13550
14066
|
if (href) {
|
|
13551
14067
|
const A = as === "a" ? "a" : "a";
|
|
13552
|
-
return /* @__PURE__ */
|
|
14068
|
+
return /* @__PURE__ */ jsx48(A, { ref, href, className: cn(baseCls, "block"), ...rest, children: inner });
|
|
13553
14069
|
}
|
|
13554
14070
|
if (as === "button" && !collapsible) {
|
|
13555
|
-
return /* @__PURE__ */
|
|
14071
|
+
return /* @__PURE__ */ jsx48("button", { ref, type: "button", className: cn(baseCls, "text-left block w-full"), ...rest, children: inner });
|
|
13556
14072
|
}
|
|
13557
14073
|
if (collapsible) {
|
|
13558
|
-
return /* @__PURE__ */
|
|
14074
|
+
return /* @__PURE__ */ jsx48("div", { ref, className: cn(baseCls, "text-left block w-full"), ...rest, children: inner });
|
|
13559
14075
|
}
|
|
13560
14076
|
const Comp = as;
|
|
13561
|
-
return /* @__PURE__ */
|
|
14077
|
+
return /* @__PURE__ */ jsx48(Comp, { ref, className: baseCls, ...rest, children: inner });
|
|
13562
14078
|
}
|
|
13563
14079
|
);
|
|
13564
14080
|
ListItem.displayName = "List.Item";
|
|
@@ -13568,7 +14084,7 @@ var List_default = List;
|
|
|
13568
14084
|
// ../../components/ui/Watermark.tsx
|
|
13569
14085
|
import * as React41 from "react";
|
|
13570
14086
|
import { createPortal as createPortal5 } from "react-dom";
|
|
13571
|
-
import { Fragment as
|
|
14087
|
+
import { Fragment as Fragment20, jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
13572
14088
|
var PRESETS2 = {
|
|
13573
14089
|
confidential: { text: "CONFIDENTIAL", color: "rgba(220, 38, 38, 0.15)", rotate: -22, fontSize: 16, fontWeight: "bold" },
|
|
13574
14090
|
draft: { text: "DRAFT", color: "rgba(59, 130, 246, 0.15)", rotate: -22, fontSize: 18, fontWeight: "bold" },
|
|
@@ -13823,7 +14339,7 @@ var Watermark = ({
|
|
|
13823
14339
|
if (dataURL) overlayStyle.backgroundImage = `url(${dataURL})`;
|
|
13824
14340
|
const animationClass = animate ? getAnimationClass(animationVariant, visible) : "";
|
|
13825
14341
|
const blurClass = blur ? `backdrop-blur-[${blurAmount}px]` : "";
|
|
13826
|
-
const overlay = /* @__PURE__ */
|
|
14342
|
+
const overlay = /* @__PURE__ */ jsx49(
|
|
13827
14343
|
"div",
|
|
13828
14344
|
{
|
|
13829
14345
|
role: interactive ? "button" : void 0,
|
|
@@ -13847,12 +14363,12 @@ var Watermark = ({
|
|
|
13847
14363
|
}
|
|
13848
14364
|
);
|
|
13849
14365
|
if (fullPage) {
|
|
13850
|
-
return /* @__PURE__ */
|
|
14366
|
+
return /* @__PURE__ */ jsxs44(Fragment20, { children: [
|
|
13851
14367
|
children,
|
|
13852
14368
|
typeof window !== "undefined" ? createPortal5(overlay, document.body) : null
|
|
13853
14369
|
] });
|
|
13854
14370
|
}
|
|
13855
|
-
return /* @__PURE__ */
|
|
14371
|
+
return /* @__PURE__ */ jsxs44("div", { className: cn("relative", className), style, ...rest, children: [
|
|
13856
14372
|
children,
|
|
13857
14373
|
overlay
|
|
13858
14374
|
] });
|
|
@@ -13862,7 +14378,7 @@ var Watermark_default = Watermark;
|
|
|
13862
14378
|
// ../../components/ui/Timeline.tsx
|
|
13863
14379
|
import * as React42 from "react";
|
|
13864
14380
|
import { ChevronDown as ChevronDown5 } from "lucide-react";
|
|
13865
|
-
import { jsx as
|
|
14381
|
+
import { jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
13866
14382
|
var SIZE_STYLE = {
|
|
13867
14383
|
sm: {
|
|
13868
14384
|
dot: "h-2.5 w-2.5",
|
|
@@ -13923,22 +14439,22 @@ var Marker = ({ index, last, size, color, status = "default", lineColor, lineSty
|
|
|
13923
14439
|
const sz = SIZE_STYLE[size];
|
|
13924
14440
|
const dotColor = color ? `background:${color}` : void 0;
|
|
13925
14441
|
const cls = color ? void 0 : STATUS_COLOR[status];
|
|
13926
|
-
return /* @__PURE__ */
|
|
13927
|
-
dot ? /* @__PURE__ */
|
|
14442
|
+
return /* @__PURE__ */ jsxs45("div", { className: "flex flex-col items-center", children: [
|
|
14443
|
+
dot ? /* @__PURE__ */ jsx50("div", { className: "flex items-center justify-center", children: dot }) : Icon ? /* @__PURE__ */ jsx50(
|
|
13928
14444
|
"div",
|
|
13929
14445
|
{
|
|
13930
14446
|
className: cn("rounded-full ring-2 ring-background flex items-center justify-center", sz.iconDot, cls, active && "ring-primary/40 ring-4"),
|
|
13931
14447
|
style: dotColor ? { background: color } : void 0,
|
|
13932
|
-
children: /* @__PURE__ */
|
|
14448
|
+
children: /* @__PURE__ */ jsx50(Icon, { className: cn("text-white", sz.icon) })
|
|
13933
14449
|
}
|
|
13934
|
-
) : /* @__PURE__ */
|
|
14450
|
+
) : /* @__PURE__ */ jsx50(
|
|
13935
14451
|
"div",
|
|
13936
14452
|
{
|
|
13937
14453
|
className: cn("rounded-full ring-2 ring-background", sz.dot, cls, active && "ring-primary/40 ring-4 scale-125"),
|
|
13938
14454
|
style: dotColor ? { background: color } : void 0
|
|
13939
14455
|
}
|
|
13940
14456
|
),
|
|
13941
|
-
!last && showLine && /* @__PURE__ */
|
|
14457
|
+
!last && showLine && /* @__PURE__ */ jsx50("div", { className: cn("flex-1 border-l-2", LINE_STYLE_MAP[lineStyle]), style: { borderColor: lineColor || "hsl(var(--border))" } })
|
|
13942
14458
|
] });
|
|
13943
14459
|
};
|
|
13944
14460
|
var TimelineRoot = React42.forwardRef(
|
|
@@ -13958,14 +14474,14 @@ var TimelineRoot = React42.forwardRef(
|
|
|
13958
14474
|
children,
|
|
13959
14475
|
...rest
|
|
13960
14476
|
}, ref) => {
|
|
13961
|
-
const content = items ? items.map((it, i) => /* @__PURE__ */
|
|
13962
|
-
return /* @__PURE__ */
|
|
14477
|
+
const content = items ? items.map((it, i) => /* @__PURE__ */ jsx50(TimelineItem, { ...it, className: cn(itemClassName, it.className), "data-index": i, "data-last": i === (items?.length ?? 0) - 1 }, i)) : children;
|
|
14478
|
+
return /* @__PURE__ */ jsx50(TimelineContext.Provider, { value: { align, variant, size, mode, lineColor, lineStyle, itemClassName, animate, dense, showLine }, children: /* @__PURE__ */ jsx50(
|
|
13963
14479
|
"div",
|
|
13964
14480
|
{
|
|
13965
14481
|
ref,
|
|
13966
14482
|
className: cn("relative", mode === "horizontal" && "flex gap-4 overflow-x-auto", mode === "vertical" && "space-y-0", className),
|
|
13967
14483
|
...rest,
|
|
13968
|
-
children: mode === "vertical" ? /* @__PURE__ */
|
|
14484
|
+
children: mode === "vertical" ? /* @__PURE__ */ jsx50("div", { className: "space-y-0", children: content }) : content
|
|
13969
14485
|
}
|
|
13970
14486
|
) });
|
|
13971
14487
|
}
|
|
@@ -14013,37 +14529,37 @@ var TimelineItem = React42.forwardRef(
|
|
|
14013
14529
|
modern: "rounded-xl bg-linear-to-r from-card to-muted/20 border border-border/50 px-5 py-4 backdrop-blur-sm",
|
|
14014
14530
|
gradient: "rounded-2xl bg-linear-to-br from-primary/10 via-card to-accent/10 border border-primary/20 px-5 py-4 shadow-lg"
|
|
14015
14531
|
};
|
|
14016
|
-
const contentBox = /* @__PURE__ */
|
|
14017
|
-
/* @__PURE__ */
|
|
14018
|
-
/* @__PURE__ */
|
|
14019
|
-
title && /* @__PURE__ */
|
|
14020
|
-
/* @__PURE__ */
|
|
14021
|
-
badge && /* @__PURE__ */
|
|
14532
|
+
const contentBox = /* @__PURE__ */ jsxs45("div", { className: cn("min-w-0 flex-1", variantClasses2[ctx.variant]), children: [
|
|
14533
|
+
/* @__PURE__ */ jsxs45("div", { className: "flex items-start justify-between gap-2", children: [
|
|
14534
|
+
/* @__PURE__ */ jsxs45("div", { className: "flex-1 min-w-0", children: [
|
|
14535
|
+
title && /* @__PURE__ */ jsxs45("div", { className: "flex items-center gap-2", children: [
|
|
14536
|
+
/* @__PURE__ */ jsx50("div", { className: cn("font-semibold text-foreground", sz.title), children: title }),
|
|
14537
|
+
badge && /* @__PURE__ */ jsx50("span", { className: "px-2 py-0.5 rounded-full text-[10px] font-medium bg-primary/10 text-primary", children: badge })
|
|
14022
14538
|
] }),
|
|
14023
|
-
description && /* @__PURE__ */
|
|
14024
|
-
children && /* @__PURE__ */
|
|
14539
|
+
description && /* @__PURE__ */ jsx50("div", { className: cn("text-muted-foreground mt-1", sz.desc), children: description }),
|
|
14540
|
+
children && /* @__PURE__ */ jsx50("div", { className: "mt-2", children })
|
|
14025
14541
|
] }),
|
|
14026
|
-
collapsible && /* @__PURE__ */
|
|
14542
|
+
collapsible && /* @__PURE__ */ jsx50(
|
|
14027
14543
|
"button",
|
|
14028
14544
|
{
|
|
14029
14545
|
type: "button",
|
|
14030
14546
|
onClick: toggleExpanded,
|
|
14031
14547
|
className: cn("text-muted-foreground hover:text-foreground transition-transform p-1", isExpanded && "rotate-180"),
|
|
14032
|
-
children: /* @__PURE__ */
|
|
14548
|
+
children: /* @__PURE__ */ jsx50(ChevronDown5, { className: "h-4 w-4" })
|
|
14033
14549
|
}
|
|
14034
14550
|
)
|
|
14035
14551
|
] }),
|
|
14036
|
-
time && /* @__PURE__ */
|
|
14037
|
-
collapsible && isExpanded && expandContent && /* @__PURE__ */
|
|
14552
|
+
time && /* @__PURE__ */ jsx50("div", { className: cn("mt-2 text-muted-foreground flex items-center gap-1", sz.time), children: time }),
|
|
14553
|
+
collapsible && isExpanded && expandContent && /* @__PURE__ */ jsx50("div", { className: "mt-3 pt-3 border-t border-border/50 text-sm", children: expandContent })
|
|
14038
14554
|
] });
|
|
14039
14555
|
const markerWidth = Icon || dot ? "w-auto" : "w-6";
|
|
14040
|
-
const leftSide = /* @__PURE__ */
|
|
14556
|
+
const leftSide = /* @__PURE__ */ jsxs45(
|
|
14041
14557
|
"div",
|
|
14042
14558
|
{
|
|
14043
14559
|
className: cn("flex items-stretch gap-4", padding, ctx.animate && "animate-in slide-in-from-left duration-500"),
|
|
14044
14560
|
style: { animationDelay: ctx.animate ? `${(idx ?? 0) * 100}ms` : void 0 },
|
|
14045
14561
|
children: [
|
|
14046
|
-
/* @__PURE__ */
|
|
14562
|
+
/* @__PURE__ */ jsx50("div", { className: cn("shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ jsx50(
|
|
14047
14563
|
Marker,
|
|
14048
14564
|
{
|
|
14049
14565
|
index: idx ?? 0,
|
|
@@ -14059,18 +14575,18 @@ var TimelineItem = React42.forwardRef(
|
|
|
14059
14575
|
showLine: ctx.showLine
|
|
14060
14576
|
}
|
|
14061
14577
|
) }),
|
|
14062
|
-
/* @__PURE__ */
|
|
14578
|
+
/* @__PURE__ */ jsx50("div", { className: "flex-1", children: contentBox })
|
|
14063
14579
|
]
|
|
14064
14580
|
}
|
|
14065
14581
|
);
|
|
14066
|
-
const rightSide = /* @__PURE__ */
|
|
14582
|
+
const rightSide = /* @__PURE__ */ jsxs45(
|
|
14067
14583
|
"div",
|
|
14068
14584
|
{
|
|
14069
14585
|
className: cn("flex items-stretch gap-4", padding, ctx.animate && "animate-in slide-in-from-right duration-500"),
|
|
14070
14586
|
style: { animationDelay: ctx.animate ? `${(idx ?? 0) * 100}ms` : void 0 },
|
|
14071
14587
|
children: [
|
|
14072
|
-
/* @__PURE__ */
|
|
14073
|
-
/* @__PURE__ */
|
|
14588
|
+
/* @__PURE__ */ jsx50("div", { className: "flex-1 flex justify-end", children: contentBox }),
|
|
14589
|
+
/* @__PURE__ */ jsx50("div", { className: cn("shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ jsx50(
|
|
14074
14590
|
Marker,
|
|
14075
14591
|
{
|
|
14076
14592
|
index: idx ?? 0,
|
|
@@ -14089,13 +14605,13 @@ var TimelineItem = React42.forwardRef(
|
|
|
14089
14605
|
]
|
|
14090
14606
|
}
|
|
14091
14607
|
);
|
|
14092
|
-
const horizontalItem = /* @__PURE__ */
|
|
14608
|
+
const horizontalItem = /* @__PURE__ */ jsxs45(
|
|
14093
14609
|
"div",
|
|
14094
14610
|
{
|
|
14095
14611
|
className: cn("flex flex-col items-center gap-2 min-w-50", ctx.animate && "animate-in fade-in-50 zoom-in-95 duration-500"),
|
|
14096
14612
|
style: { animationDelay: ctx.animate ? `${(idx ?? 0) * 100}ms` : void 0 },
|
|
14097
14613
|
children: [
|
|
14098
|
-
/* @__PURE__ */
|
|
14614
|
+
/* @__PURE__ */ jsx50(
|
|
14099
14615
|
Marker,
|
|
14100
14616
|
{
|
|
14101
14617
|
index: idx ?? 0,
|
|
@@ -14111,7 +14627,7 @@ var TimelineItem = React42.forwardRef(
|
|
|
14111
14627
|
showLine: false
|
|
14112
14628
|
}
|
|
14113
14629
|
),
|
|
14114
|
-
!isLast && ctx.showLine && /* @__PURE__ */
|
|
14630
|
+
!isLast && ctx.showLine && /* @__PURE__ */ jsx50(
|
|
14115
14631
|
"div",
|
|
14116
14632
|
{
|
|
14117
14633
|
className: cn("h-px w-full border-t-2", LINE_STYLE_MAP[ctx.lineStyle]),
|
|
@@ -14123,12 +14639,12 @@ var TimelineItem = React42.forwardRef(
|
|
|
14123
14639
|
}
|
|
14124
14640
|
);
|
|
14125
14641
|
if (ctx.mode === "horizontal") {
|
|
14126
|
-
return /* @__PURE__ */
|
|
14642
|
+
return /* @__PURE__ */ jsx50("div", { ref, className: cn("relative", className), ...rest, children: horizontalItem });
|
|
14127
14643
|
}
|
|
14128
14644
|
let row = leftSide;
|
|
14129
14645
|
if (ctx.align === "right") row = rightSide;
|
|
14130
14646
|
if (ctx.align === "alternate") row = (idx ?? 0) % 2 === 0 ? leftSide : rightSide;
|
|
14131
|
-
return /* @__PURE__ */
|
|
14647
|
+
return /* @__PURE__ */ jsx50("div", { ref, className: cn("relative", className), ...rest, children: row });
|
|
14132
14648
|
}
|
|
14133
14649
|
);
|
|
14134
14650
|
TimelineItem.displayName = "Timeline.Item";
|
|
@@ -14137,8 +14653,8 @@ var Timeline_default = Timeline;
|
|
|
14137
14653
|
|
|
14138
14654
|
// ../../components/ui/ColorPicker.tsx
|
|
14139
14655
|
import * as React43 from "react";
|
|
14140
|
-
import { Pipette, X as
|
|
14141
|
-
import { jsx as
|
|
14656
|
+
import { Pipette, X as X14, Copy, Check as Check9, Palette, History } from "lucide-react";
|
|
14657
|
+
import { jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
14142
14658
|
var clamp6 = (n, min, max) => Math.max(min, Math.min(max, n));
|
|
14143
14659
|
function hexToRgb(hex) {
|
|
14144
14660
|
const str = hex.replace(/^#/, "").trim();
|
|
@@ -14297,7 +14813,7 @@ var Swatch = ({
|
|
|
14297
14813
|
md: "h-6 w-6",
|
|
14298
14814
|
lg: "h-8 w-8"
|
|
14299
14815
|
};
|
|
14300
|
-
return /* @__PURE__ */
|
|
14816
|
+
return /* @__PURE__ */ jsx51(
|
|
14301
14817
|
"button",
|
|
14302
14818
|
{
|
|
14303
14819
|
type: "button",
|
|
@@ -14417,7 +14933,7 @@ function ColorPicker({
|
|
|
14417
14933
|
lg: "h-12 text-base"
|
|
14418
14934
|
};
|
|
14419
14935
|
const swatchSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "md";
|
|
14420
|
-
const trigger = /* @__PURE__ */
|
|
14936
|
+
const trigger = /* @__PURE__ */ jsxs46(
|
|
14421
14937
|
"button",
|
|
14422
14938
|
{
|
|
14423
14939
|
type: "button",
|
|
@@ -14431,17 +14947,17 @@ function ColorPicker({
|
|
|
14431
14947
|
),
|
|
14432
14948
|
"aria-label": "Open color picker",
|
|
14433
14949
|
children: [
|
|
14434
|
-
/* @__PURE__ */
|
|
14435
|
-
/* @__PURE__ */
|
|
14950
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
|
|
14951
|
+
/* @__PURE__ */ jsx51(
|
|
14436
14952
|
"span",
|
|
14437
14953
|
{
|
|
14438
14954
|
className: cn("rounded-md border border-border shadow-sm", size === "sm" ? "h-4 w-4" : size === "lg" ? "h-6 w-6" : "h-5 w-5"),
|
|
14439
14955
|
style: { backgroundColor: withAlpha ? `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})` : hexForInput }
|
|
14440
14956
|
}
|
|
14441
14957
|
),
|
|
14442
|
-
/* @__PURE__ */
|
|
14958
|
+
/* @__PURE__ */ jsx51("span", { className: "font-mono text-muted-foreground", children: text })
|
|
14443
14959
|
] }),
|
|
14444
|
-
/* @__PURE__ */
|
|
14960
|
+
/* @__PURE__ */ jsx51(Pipette, { className: cn(size === "sm" ? "w-3.5 h-3.5" : size === "lg" ? "w-5 h-5" : "w-4 h-4", "text-muted-foreground") })
|
|
14445
14961
|
]
|
|
14446
14962
|
}
|
|
14447
14963
|
);
|
|
@@ -14451,7 +14967,7 @@ function ColorPicker({
|
|
|
14451
14967
|
default: 320,
|
|
14452
14968
|
full: 360
|
|
14453
14969
|
};
|
|
14454
|
-
return /* @__PURE__ */
|
|
14970
|
+
return /* @__PURE__ */ jsx51("div", { className: cn("inline-block w-full", className), ...rest, children: /* @__PURE__ */ jsx51(
|
|
14455
14971
|
Popover,
|
|
14456
14972
|
{
|
|
14457
14973
|
trigger,
|
|
@@ -14461,9 +14977,9 @@ function ColorPicker({
|
|
|
14461
14977
|
matchTriggerWidth: variant === "minimal",
|
|
14462
14978
|
contentWidth: contentWidthByVariant[variant],
|
|
14463
14979
|
contentClassName: cn("p-3 rounded-2xl md:rounded-3xl border border-border bg-card shadow-lg", contentClassName),
|
|
14464
|
-
children: /* @__PURE__ */
|
|
14465
|
-
variant !== "minimal" && /* @__PURE__ */
|
|
14466
|
-
/* @__PURE__ */
|
|
14980
|
+
children: /* @__PURE__ */ jsxs46("div", { className: "space-y-3", children: [
|
|
14981
|
+
variant !== "minimal" && /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
|
|
14982
|
+
/* @__PURE__ */ jsx51(
|
|
14467
14983
|
"input",
|
|
14468
14984
|
{
|
|
14469
14985
|
type: "color",
|
|
@@ -14472,19 +14988,19 @@ function ColorPicker({
|
|
|
14472
14988
|
className: "h-9 w-9 rounded-lg cursor-pointer border border-border"
|
|
14473
14989
|
}
|
|
14474
14990
|
),
|
|
14475
|
-
/* @__PURE__ */
|
|
14991
|
+
/* @__PURE__ */ jsxs46(
|
|
14476
14992
|
"button",
|
|
14477
14993
|
{
|
|
14478
14994
|
type: "button",
|
|
14479
14995
|
onClick: tryEyedropper,
|
|
14480
14996
|
className: cn("h-9 px-3 rounded-lg border border-border text-xs hover:bg-accent/10 transition-colors flex items-center gap-1.5"),
|
|
14481
14997
|
children: [
|
|
14482
|
-
/* @__PURE__ */
|
|
14998
|
+
/* @__PURE__ */ jsx51(Pipette, { className: "w-3.5 h-3.5" }),
|
|
14483
14999
|
variant === "full" && "Pick"
|
|
14484
15000
|
]
|
|
14485
15001
|
}
|
|
14486
15002
|
),
|
|
14487
|
-
copyable && /* @__PURE__ */
|
|
15003
|
+
copyable && /* @__PURE__ */ jsxs46(
|
|
14488
15004
|
"button",
|
|
14489
15005
|
{
|
|
14490
15006
|
type: "button",
|
|
@@ -14494,26 +15010,26 @@ function ColorPicker({
|
|
|
14494
15010
|
copied && "bg-success/10 border-success/30"
|
|
14495
15011
|
),
|
|
14496
15012
|
children: [
|
|
14497
|
-
copied ? /* @__PURE__ */
|
|
15013
|
+
copied ? /* @__PURE__ */ jsx51(Check9, { className: "w-3.5 h-3.5 text-success" }) : /* @__PURE__ */ jsx51(Copy, { className: "w-3.5 h-3.5" }),
|
|
14498
15014
|
variant === "full" && (copied ? "Copied!" : "Copy")
|
|
14499
15015
|
]
|
|
14500
15016
|
}
|
|
14501
15017
|
),
|
|
14502
|
-
clearable && /* @__PURE__ */
|
|
15018
|
+
clearable && /* @__PURE__ */ jsxs46(
|
|
14503
15019
|
"button",
|
|
14504
15020
|
{
|
|
14505
15021
|
type: "button",
|
|
14506
15022
|
onClick: clear,
|
|
14507
15023
|
className: "ml-auto h-9 px-2 rounded-lg border border-border text-xs hover:bg-destructive/10 transition-colors flex items-center gap-1",
|
|
14508
15024
|
children: [
|
|
14509
|
-
/* @__PURE__ */
|
|
15025
|
+
/* @__PURE__ */ jsx51(X14, { className: "w-3.5 h-3.5" }),
|
|
14510
15026
|
variant === "full" && "Clear"
|
|
14511
15027
|
]
|
|
14512
15028
|
}
|
|
14513
15029
|
)
|
|
14514
15030
|
] }),
|
|
14515
|
-
/* @__PURE__ */
|
|
14516
|
-
/* @__PURE__ */
|
|
15031
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
|
|
15032
|
+
/* @__PURE__ */ jsx51(
|
|
14517
15033
|
Input_default,
|
|
14518
15034
|
{
|
|
14519
15035
|
value: text,
|
|
@@ -14524,7 +15040,7 @@ function ColorPicker({
|
|
|
14524
15040
|
className: "flex-1"
|
|
14525
15041
|
}
|
|
14526
15042
|
),
|
|
14527
|
-
variant === "minimal" && copyable && /* @__PURE__ */
|
|
15043
|
+
variant === "minimal" && copyable && /* @__PURE__ */ jsx51(
|
|
14528
15044
|
"button",
|
|
14529
15045
|
{
|
|
14530
15046
|
type: "button",
|
|
@@ -14533,11 +15049,11 @@ function ColorPicker({
|
|
|
14533
15049
|
"h-9 w-9 rounded-lg border border-border hover:bg-accent/10 transition-colors flex items-center justify-center",
|
|
14534
15050
|
copied && "bg-success/10 border-success/30"
|
|
14535
15051
|
),
|
|
14536
|
-
children: copied ? /* @__PURE__ */
|
|
15052
|
+
children: copied ? /* @__PURE__ */ jsx51(Check9, { className: "w-3.5 h-3.5 text-success" }) : /* @__PURE__ */ jsx51(Copy, { className: "w-3.5 h-3.5" })
|
|
14537
15053
|
}
|
|
14538
15054
|
)
|
|
14539
15055
|
] }),
|
|
14540
|
-
withAlpha && /* @__PURE__ */
|
|
15056
|
+
withAlpha && /* @__PURE__ */ jsx51("div", { className: "pt-1", children: /* @__PURE__ */ jsx51(
|
|
14541
15057
|
Slider,
|
|
14542
15058
|
{
|
|
14543
15059
|
min: 0,
|
|
@@ -14551,12 +15067,12 @@ function ColorPicker({
|
|
|
14551
15067
|
size: "sm"
|
|
14552
15068
|
}
|
|
14553
15069
|
) }),
|
|
14554
|
-
variant !== "minimal" && /* @__PURE__ */
|
|
14555
|
-
/* @__PURE__ */
|
|
14556
|
-
/* @__PURE__ */
|
|
15070
|
+
variant !== "minimal" && /* @__PURE__ */ jsxs46("div", { children: [
|
|
15071
|
+
/* @__PURE__ */ jsxs46("div", { className: "text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1.5", children: [
|
|
15072
|
+
/* @__PURE__ */ jsx51(Palette, { className: "w-3.5 h-3.5" }),
|
|
14557
15073
|
" Presets"
|
|
14558
15074
|
] }),
|
|
14559
|
-
/* @__PURE__ */
|
|
15075
|
+
/* @__PURE__ */ jsx51("div", { className: "grid grid-cols-8 gap-2", children: swatches.map((c) => /* @__PURE__ */ jsx51(
|
|
14560
15076
|
Swatch,
|
|
14561
15077
|
{
|
|
14562
15078
|
color: c,
|
|
@@ -14572,12 +15088,12 @@ function ColorPicker({
|
|
|
14572
15088
|
c
|
|
14573
15089
|
)) })
|
|
14574
15090
|
] }),
|
|
14575
|
-
showRecent && recentColors.length > 0 && /* @__PURE__ */
|
|
14576
|
-
/* @__PURE__ */
|
|
14577
|
-
/* @__PURE__ */
|
|
15091
|
+
showRecent && recentColors.length > 0 && /* @__PURE__ */ jsxs46("div", { children: [
|
|
15092
|
+
/* @__PURE__ */ jsxs46("div", { className: "text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1.5", children: [
|
|
15093
|
+
/* @__PURE__ */ jsx51(History, { className: "w-3.5 h-3.5" }),
|
|
14578
15094
|
" Recent"
|
|
14579
15095
|
] }),
|
|
14580
|
-
/* @__PURE__ */
|
|
15096
|
+
/* @__PURE__ */ jsx51("div", { className: "flex gap-2 flex-wrap", children: recentColors.map((c, i) => /* @__PURE__ */ jsx51(
|
|
14581
15097
|
Swatch,
|
|
14582
15098
|
{
|
|
14583
15099
|
color: c,
|
|
@@ -14593,12 +15109,12 @@ function ColorPicker({
|
|
|
14593
15109
|
`${c}-${i}`
|
|
14594
15110
|
)) })
|
|
14595
15111
|
] }),
|
|
14596
|
-
showHarmony && harmony && variant !== "minimal" && /* @__PURE__ */
|
|
14597
|
-
/* @__PURE__ */
|
|
14598
|
-
/* @__PURE__ */
|
|
14599
|
-
/* @__PURE__ */
|
|
14600
|
-
/* @__PURE__ */
|
|
14601
|
-
/* @__PURE__ */
|
|
15112
|
+
showHarmony && harmony && variant !== "minimal" && /* @__PURE__ */ jsxs46("div", { children: [
|
|
15113
|
+
/* @__PURE__ */ jsx51("div", { className: "text-xs font-medium text-muted-foreground mb-2", children: "Harmony" }),
|
|
15114
|
+
/* @__PURE__ */ jsxs46("div", { className: "space-y-2", children: [
|
|
15115
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
|
|
15116
|
+
/* @__PURE__ */ jsx51("span", { className: "text-xs text-muted-foreground w-24", children: "Complementary" }),
|
|
15117
|
+
/* @__PURE__ */ jsx51(
|
|
14602
15118
|
Swatch,
|
|
14603
15119
|
{
|
|
14604
15120
|
color: harmony.complementary,
|
|
@@ -14612,11 +15128,11 @@ function ColorPicker({
|
|
|
14612
15128
|
}
|
|
14613
15129
|
}
|
|
14614
15130
|
),
|
|
14615
|
-
/* @__PURE__ */
|
|
15131
|
+
/* @__PURE__ */ jsx51("span", { className: "text-xs font-mono text-muted-foreground", children: harmony.complementary })
|
|
14616
15132
|
] }),
|
|
14617
|
-
/* @__PURE__ */
|
|
14618
|
-
/* @__PURE__ */
|
|
14619
|
-
/* @__PURE__ */
|
|
15133
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
|
|
15134
|
+
/* @__PURE__ */ jsx51("span", { className: "text-xs text-muted-foreground w-24", children: "Triadic" }),
|
|
15135
|
+
/* @__PURE__ */ jsx51("div", { className: "flex gap-2", children: harmony.triadic.map((c) => /* @__PURE__ */ jsx51(
|
|
14620
15136
|
Swatch,
|
|
14621
15137
|
{
|
|
14622
15138
|
color: c,
|
|
@@ -14632,9 +15148,9 @@ function ColorPicker({
|
|
|
14632
15148
|
c
|
|
14633
15149
|
)) })
|
|
14634
15150
|
] }),
|
|
14635
|
-
/* @__PURE__ */
|
|
14636
|
-
/* @__PURE__ */
|
|
14637
|
-
/* @__PURE__ */
|
|
15151
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
|
|
15152
|
+
/* @__PURE__ */ jsx51("span", { className: "text-xs text-muted-foreground w-24", children: "Analogous" }),
|
|
15153
|
+
/* @__PURE__ */ jsx51("div", { className: "flex gap-2", children: harmony.analogous.map((c) => /* @__PURE__ */ jsx51(
|
|
14638
15154
|
Swatch,
|
|
14639
15155
|
{
|
|
14640
15156
|
color: c,
|
|
@@ -14659,7 +15175,7 @@ function ColorPicker({
|
|
|
14659
15175
|
|
|
14660
15176
|
// ../../components/ui/Grid.tsx
|
|
14661
15177
|
import React44, { useId as useId7 } from "react";
|
|
14662
|
-
import { Fragment as
|
|
15178
|
+
import { Fragment as Fragment21, jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
14663
15179
|
var BP_MIN = {
|
|
14664
15180
|
sm: 640,
|
|
14665
15181
|
md: 768,
|
|
@@ -14766,7 +15282,7 @@ var GridRoot = React44.forwardRef(
|
|
|
14766
15282
|
css += `}}`;
|
|
14767
15283
|
});
|
|
14768
15284
|
}
|
|
14769
|
-
return /* @__PURE__ */
|
|
15285
|
+
return /* @__PURE__ */ jsxs47(
|
|
14770
15286
|
"div",
|
|
14771
15287
|
{
|
|
14772
15288
|
ref,
|
|
@@ -14774,7 +15290,7 @@ var GridRoot = React44.forwardRef(
|
|
|
14774
15290
|
style,
|
|
14775
15291
|
...rest,
|
|
14776
15292
|
children: [
|
|
14777
|
-
/* @__PURE__ */
|
|
15293
|
+
/* @__PURE__ */ jsx52("style", { dangerouslySetInnerHTML: { __html: css } }),
|
|
14778
15294
|
children
|
|
14779
15295
|
]
|
|
14780
15296
|
}
|
|
@@ -14816,8 +15332,8 @@ var GridItem = React44.forwardRef(
|
|
|
14816
15332
|
st.opacity = 0;
|
|
14817
15333
|
st.animation = `uvGridItemFadeIn 0.5s ease-out forwards`;
|
|
14818
15334
|
}
|
|
14819
|
-
return /* @__PURE__ */
|
|
14820
|
-
animationDelay != null && /* @__PURE__ */
|
|
15335
|
+
return /* @__PURE__ */ jsxs47(Fragment21, { children: [
|
|
15336
|
+
animationDelay != null && /* @__PURE__ */ jsx52(
|
|
14821
15337
|
"style",
|
|
14822
15338
|
{
|
|
14823
15339
|
dangerouslySetInnerHTML: {
|
|
@@ -14825,7 +15341,7 @@ var GridItem = React44.forwardRef(
|
|
|
14825
15341
|
}
|
|
14826
15342
|
}
|
|
14827
15343
|
),
|
|
14828
|
-
/* @__PURE__ */
|
|
15344
|
+
/* @__PURE__ */ jsx52(
|
|
14829
15345
|
"div",
|
|
14830
15346
|
{
|
|
14831
15347
|
ref,
|
|
@@ -14846,15 +15362,15 @@ var Grid = Object.assign(GridRoot, { Item: GridItem });
|
|
|
14846
15362
|
var Grid_default = Grid;
|
|
14847
15363
|
|
|
14848
15364
|
// ../../components/ui/LineChart.tsx
|
|
14849
|
-
import { useMemo as
|
|
15365
|
+
import { useMemo as useMemo16, useState as useState39, useRef as useRef17 } from "react";
|
|
14850
15366
|
|
|
14851
15367
|
// ../../components/ui/ChartTooltip.tsx
|
|
14852
|
-
import { useEffect as useEffect24, useState as
|
|
15368
|
+
import { useEffect as useEffect24, useState as useState38 } from "react";
|
|
14853
15369
|
import { createPortal as createPortal6 } from "react-dom";
|
|
14854
|
-
import { Fragment as
|
|
15370
|
+
import { Fragment as Fragment22, jsx as jsx53, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
14855
15371
|
function ChartTooltip({ x, y, visible, label, value, color, secondaryLabel, secondaryValue, items, containerRef }) {
|
|
14856
|
-
const [isMounted, setIsMounted] =
|
|
14857
|
-
const [position, setPosition] =
|
|
15372
|
+
const [isMounted, setIsMounted] = useState38(false);
|
|
15373
|
+
const [position, setPosition] = useState38(null);
|
|
14858
15374
|
useEffect24(() => {
|
|
14859
15375
|
setIsMounted(true);
|
|
14860
15376
|
}, []);
|
|
@@ -14868,7 +15384,7 @@ function ChartTooltip({ x, y, visible, label, value, color, secondaryLabel, seco
|
|
|
14868
15384
|
}
|
|
14869
15385
|
}, [visible, x, y, containerRef]);
|
|
14870
15386
|
if (!visible || !isMounted || !position) return null;
|
|
14871
|
-
const tooltipContent = /* @__PURE__ */
|
|
15387
|
+
const tooltipContent = /* @__PURE__ */ jsxs48(
|
|
14872
15388
|
"div",
|
|
14873
15389
|
{
|
|
14874
15390
|
style: {
|
|
@@ -14880,7 +15396,7 @@ function ChartTooltip({ x, y, visible, label, value, color, secondaryLabel, seco
|
|
|
14880
15396
|
animation: "chartTooltipFadeIn 0.15s ease-out"
|
|
14881
15397
|
},
|
|
14882
15398
|
children: [
|
|
14883
|
-
/* @__PURE__ */
|
|
15399
|
+
/* @__PURE__ */ jsxs48(
|
|
14884
15400
|
"div",
|
|
14885
15401
|
{
|
|
14886
15402
|
className: cn("bg-popover text-popover-foreground border border-border", "rounded-2xl shadow-xl px-3 py-2 text-sm", "backdrop-blur-sm"),
|
|
@@ -14890,20 +15406,20 @@ function ChartTooltip({ x, y, visible, label, value, color, secondaryLabel, seco
|
|
|
14890
15406
|
boxShadow: "0 10px 25px -3px rgba(0, 0, 0, 0.5), 0 4px 10px -2px rgba(0, 0, 0, 0.3)"
|
|
14891
15407
|
},
|
|
14892
15408
|
children: [
|
|
14893
|
-
label && /* @__PURE__ */
|
|
14894
|
-
items && items.length > 0 ? /* @__PURE__ */
|
|
14895
|
-
item.color && /* @__PURE__ */
|
|
14896
|
-
/* @__PURE__ */
|
|
15409
|
+
label && /* @__PURE__ */ jsx53("div", { className: "text-muted-foreground text-xs mb-1", children: label }),
|
|
15410
|
+
items && items.length > 0 ? /* @__PURE__ */ jsx53("div", { className: "flex flex-col gap-1", children: items.map((item, i) => /* @__PURE__ */ jsxs48("div", { className: "flex items-center gap-2", children: [
|
|
15411
|
+
item.color && /* @__PURE__ */ jsx53("div", { className: "w-2 h-2 rounded-full shrink-0", style: { backgroundColor: item.color } }),
|
|
15412
|
+
/* @__PURE__ */ jsxs48("span", { className: "text-muted-foreground", children: [
|
|
14897
15413
|
item.label,
|
|
14898
15414
|
":"
|
|
14899
15415
|
] }),
|
|
14900
|
-
/* @__PURE__ */
|
|
14901
|
-
] }, i)) }) : /* @__PURE__ */
|
|
14902
|
-
/* @__PURE__ */
|
|
14903
|
-
color && /* @__PURE__ */
|
|
14904
|
-
/* @__PURE__ */
|
|
15416
|
+
/* @__PURE__ */ jsx53("span", { className: "font-semibold ml-auto", children: item.value })
|
|
15417
|
+
] }, i)) }) : /* @__PURE__ */ jsxs48(Fragment22, { children: [
|
|
15418
|
+
/* @__PURE__ */ jsxs48("div", { className: "flex items-center gap-2", children: [
|
|
15419
|
+
color && /* @__PURE__ */ jsx53("div", { className: "w-2 h-2 rounded-full shrink-0", style: { backgroundColor: color } }),
|
|
15420
|
+
/* @__PURE__ */ jsx53("span", { className: "font-semibold", children: value })
|
|
14905
15421
|
] }),
|
|
14906
|
-
secondaryLabel && /* @__PURE__ */
|
|
15422
|
+
secondaryLabel && /* @__PURE__ */ jsxs48("div", { className: "text-muted-foreground text-xs mt-1", children: [
|
|
14907
15423
|
secondaryLabel,
|
|
14908
15424
|
": ",
|
|
14909
15425
|
secondaryValue
|
|
@@ -14912,7 +15428,7 @@ function ChartTooltip({ x, y, visible, label, value, color, secondaryLabel, seco
|
|
|
14912
15428
|
]
|
|
14913
15429
|
}
|
|
14914
15430
|
),
|
|
14915
|
-
/* @__PURE__ */
|
|
15431
|
+
/* @__PURE__ */ jsx53("style", { children: `
|
|
14916
15432
|
@keyframes chartTooltipFadeIn {
|
|
14917
15433
|
from { opacity: 0; transform: translateX(-5px); }
|
|
14918
15434
|
to { opacity: 1; transform: translateX(0); }
|
|
@@ -14925,7 +15441,7 @@ function ChartTooltip({ x, y, visible, label, value, color, secondaryLabel, seco
|
|
|
14925
15441
|
}
|
|
14926
15442
|
|
|
14927
15443
|
// ../../components/ui/LineChart.tsx
|
|
14928
|
-
import { Fragment as
|
|
15444
|
+
import { Fragment as Fragment23, jsx as jsx54, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
14929
15445
|
function LineChart({
|
|
14930
15446
|
data,
|
|
14931
15447
|
width = 400,
|
|
@@ -14940,12 +15456,12 @@ function LineChart({
|
|
|
14940
15456
|
curved = true,
|
|
14941
15457
|
className = ""
|
|
14942
15458
|
}) {
|
|
14943
|
-
const svgRef =
|
|
15459
|
+
const svgRef = useRef17(null);
|
|
14944
15460
|
const padding = { top: 20, right: 20, bottom: 40, left: 40 };
|
|
14945
15461
|
const chartWidth = width - padding.left - padding.right;
|
|
14946
15462
|
const chartHeight = height - padding.top - padding.bottom;
|
|
14947
|
-
const [hoveredPoint, setHoveredPoint] =
|
|
14948
|
-
const { minValue, maxValue, points, linePath, areaPath } =
|
|
15463
|
+
const [hoveredPoint, setHoveredPoint] = useState39(null);
|
|
15464
|
+
const { minValue, maxValue, points, linePath, areaPath } = useMemo16(() => {
|
|
14949
15465
|
if (!data.length) return { minValue: 0, maxValue: 0, points: [], linePath: "", areaPath: "" };
|
|
14950
15466
|
const values = data.map((d) => d.value);
|
|
14951
15467
|
const min = Math.min(...values);
|
|
@@ -14980,7 +15496,7 @@ function LineChart({
|
|
|
14980
15496
|
}
|
|
14981
15497
|
return { minValue: min, maxValue: max, points: pts, linePath: path, areaPath: area };
|
|
14982
15498
|
}, [data, chartWidth, chartHeight, curved, padding.left, padding.top]);
|
|
14983
|
-
const gridLines =
|
|
15499
|
+
const gridLines = useMemo16(() => {
|
|
14984
15500
|
const lines = [];
|
|
14985
15501
|
const steps = 5;
|
|
14986
15502
|
for (let i = 0; i <= steps; i++) {
|
|
@@ -14990,14 +15506,14 @@ function LineChart({
|
|
|
14990
15506
|
}
|
|
14991
15507
|
return lines;
|
|
14992
15508
|
}, [minValue, maxValue, chartHeight, padding.top]);
|
|
14993
|
-
return /* @__PURE__ */
|
|
14994
|
-
/* @__PURE__ */
|
|
14995
|
-
showGrid && /* @__PURE__ */
|
|
14996
|
-
/* @__PURE__ */
|
|
14997
|
-
/* @__PURE__ */
|
|
15509
|
+
return /* @__PURE__ */ jsxs49(Fragment23, { children: [
|
|
15510
|
+
/* @__PURE__ */ jsxs49("svg", { ref: svgRef, width, height, className: `overflow-visible ${className}`, style: { fontFamily: "inherit" }, children: [
|
|
15511
|
+
showGrid && /* @__PURE__ */ jsx54("g", { className: "text-muted-foreground/20", children: gridLines.map((line, i) => /* @__PURE__ */ jsxs49("g", { children: [
|
|
15512
|
+
/* @__PURE__ */ jsx54("line", { x1: padding.left, y1: line.y, x2: width - padding.right, y2: line.y, stroke: "currentColor", strokeDasharray: "4 4" }),
|
|
15513
|
+
/* @__PURE__ */ jsx54("text", { x: padding.left - 8, y: line.y + 4, textAnchor: "end", fontSize: "10", fill: "currentColor", className: "text-muted-foreground", children: line.value.toFixed(0) })
|
|
14998
15514
|
] }, i)) }),
|
|
14999
|
-
fillColor && areaPath && /* @__PURE__ */
|
|
15000
|
-
linePath && /* @__PURE__ */
|
|
15515
|
+
fillColor && areaPath && /* @__PURE__ */ jsx54("path", { d: areaPath, fill: fillColor, opacity: 0.2, className: animated ? "animate-[fadeIn_0.6s_ease-out]" : "" }),
|
|
15516
|
+
linePath && /* @__PURE__ */ jsx54(
|
|
15001
15517
|
"path",
|
|
15002
15518
|
{
|
|
15003
15519
|
d: linePath,
|
|
@@ -15014,14 +15530,14 @@ function LineChart({
|
|
|
15014
15530
|
} : void 0
|
|
15015
15531
|
}
|
|
15016
15532
|
),
|
|
15017
|
-
showDots && points.map((point, i) => /* @__PURE__ */
|
|
15533
|
+
showDots && points.map((point, i) => /* @__PURE__ */ jsxs49(
|
|
15018
15534
|
"g",
|
|
15019
15535
|
{
|
|
15020
15536
|
onMouseEnter: () => setHoveredPoint({ x: point.x, y: point.y, label: point.label, value: point.value }),
|
|
15021
15537
|
onMouseLeave: () => setHoveredPoint(null),
|
|
15022
15538
|
className: "cursor-pointer",
|
|
15023
15539
|
children: [
|
|
15024
|
-
/* @__PURE__ */
|
|
15540
|
+
/* @__PURE__ */ jsx54(
|
|
15025
15541
|
"circle",
|
|
15026
15542
|
{
|
|
15027
15543
|
cx: point.x,
|
|
@@ -15032,14 +15548,14 @@ function LineChart({
|
|
|
15032
15548
|
style: animated ? { animationDelay: `${i * 0.05}s`, animationFillMode: "both" } : void 0
|
|
15033
15549
|
}
|
|
15034
15550
|
),
|
|
15035
|
-
/* @__PURE__ */
|
|
15036
|
-
showValues && /* @__PURE__ */
|
|
15551
|
+
/* @__PURE__ */ jsx54("circle", { cx: point.x, cy: point.y, r: 16, fill: "transparent" }),
|
|
15552
|
+
showValues && /* @__PURE__ */ jsx54("text", { x: point.x, y: point.y - 12, textAnchor: "middle", fontSize: "10", fontWeight: "500", className: "text-foreground", fill: "currentColor", children: point.value })
|
|
15037
15553
|
]
|
|
15038
15554
|
},
|
|
15039
15555
|
i
|
|
15040
15556
|
)),
|
|
15041
|
-
hoveredPoint && /* @__PURE__ */
|
|
15042
|
-
/* @__PURE__ */
|
|
15557
|
+
hoveredPoint && /* @__PURE__ */ jsxs49("g", { className: "pointer-events-none", children: [
|
|
15558
|
+
/* @__PURE__ */ jsx54(
|
|
15043
15559
|
"line",
|
|
15044
15560
|
{
|
|
15045
15561
|
x1: hoveredPoint.x,
|
|
@@ -15052,7 +15568,7 @@ function LineChart({
|
|
|
15052
15568
|
opacity: 0.5
|
|
15053
15569
|
}
|
|
15054
15570
|
),
|
|
15055
|
-
/* @__PURE__ */
|
|
15571
|
+
/* @__PURE__ */ jsx54(
|
|
15056
15572
|
"line",
|
|
15057
15573
|
{
|
|
15058
15574
|
x1: padding.left,
|
|
@@ -15066,8 +15582,8 @@ function LineChart({
|
|
|
15066
15582
|
}
|
|
15067
15583
|
)
|
|
15068
15584
|
] }),
|
|
15069
|
-
showLabels && points.map((point, i) => /* @__PURE__ */
|
|
15070
|
-
/* @__PURE__ */
|
|
15585
|
+
showLabels && points.map((point, i) => /* @__PURE__ */ jsx54("text", { x: point.x, y: height - 10, textAnchor: "middle", fontSize: "10", className: "text-muted-foreground", fill: "currentColor", children: point.label }, i)),
|
|
15586
|
+
/* @__PURE__ */ jsx54("style", { children: `
|
|
15071
15587
|
@keyframes drawLine {
|
|
15072
15588
|
from { stroke-dashoffset: 1000; }
|
|
15073
15589
|
to { stroke-dashoffset: 0; }
|
|
@@ -15082,7 +15598,7 @@ function LineChart({
|
|
|
15082
15598
|
}
|
|
15083
15599
|
` })
|
|
15084
15600
|
] }),
|
|
15085
|
-
/* @__PURE__ */
|
|
15601
|
+
/* @__PURE__ */ jsx54(
|
|
15086
15602
|
ChartTooltip,
|
|
15087
15603
|
{
|
|
15088
15604
|
x: hoveredPoint?.x ?? 0,
|
|
@@ -15098,8 +15614,8 @@ function LineChart({
|
|
|
15098
15614
|
}
|
|
15099
15615
|
|
|
15100
15616
|
// ../../components/ui/BarChart.tsx
|
|
15101
|
-
import { useMemo as
|
|
15102
|
-
import { Fragment as
|
|
15617
|
+
import { useMemo as useMemo17, useState as useState40, useRef as useRef18 } from "react";
|
|
15618
|
+
import { Fragment as Fragment24, jsx as jsx55, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
15103
15619
|
function BarChart({
|
|
15104
15620
|
data,
|
|
15105
15621
|
width = 400,
|
|
@@ -15114,12 +15630,12 @@ function BarChart({
|
|
|
15114
15630
|
barGap = 0.3,
|
|
15115
15631
|
className = ""
|
|
15116
15632
|
}) {
|
|
15117
|
-
const svgRef =
|
|
15633
|
+
const svgRef = useRef18(null);
|
|
15118
15634
|
const padding = horizontal ? { top: 20, right: 40, bottom: 20, left: 80 } : { top: 20, right: 20, bottom: 40, left: 40 };
|
|
15119
15635
|
const chartWidth = width - padding.left - padding.right;
|
|
15120
15636
|
const chartHeight = height - padding.top - padding.bottom;
|
|
15121
|
-
const [hoveredBar, setHoveredBar] =
|
|
15122
|
-
const { maxValue, bars, gridLines } =
|
|
15637
|
+
const [hoveredBar, setHoveredBar] = useState40(null);
|
|
15638
|
+
const { maxValue, bars, gridLines } = useMemo17(() => {
|
|
15123
15639
|
if (!data.length) return { maxValue: 0, bars: [], gridLines: [] };
|
|
15124
15640
|
const max = Math.max(...data.map((d) => d.value));
|
|
15125
15641
|
const barCount = data.length;
|
|
@@ -15168,16 +15684,16 @@ function BarChart({
|
|
|
15168
15684
|
}
|
|
15169
15685
|
return { maxValue: max, bars: barsData, gridLines: lines };
|
|
15170
15686
|
}, [data, chartWidth, chartHeight, horizontal, barGap, padding, width, height]);
|
|
15171
|
-
return /* @__PURE__ */
|
|
15172
|
-
/* @__PURE__ */
|
|
15173
|
-
showGrid && /* @__PURE__ */
|
|
15174
|
-
/* @__PURE__ */
|
|
15175
|
-
/* @__PURE__ */
|
|
15176
|
-
] }) : /* @__PURE__ */
|
|
15177
|
-
/* @__PURE__ */
|
|
15178
|
-
/* @__PURE__ */
|
|
15687
|
+
return /* @__PURE__ */ jsxs50(Fragment24, { children: [
|
|
15688
|
+
/* @__PURE__ */ jsxs50("svg", { ref: svgRef, width, height, className: `overflow-visible ${className}`, style: { fontFamily: "inherit" }, children: [
|
|
15689
|
+
showGrid && /* @__PURE__ */ jsx55("g", { className: "text-muted-foreground/20", children: gridLines.map((line, i) => /* @__PURE__ */ jsx55("g", { children: horizontal ? /* @__PURE__ */ jsxs50(Fragment24, { children: [
|
|
15690
|
+
/* @__PURE__ */ jsx55("line", { x1: line.x, y1: line.y1, x2: line.x, y2: line.y2, stroke: "currentColor", strokeDasharray: "4 4" }),
|
|
15691
|
+
/* @__PURE__ */ jsx55("text", { x: line.x, y: height - 8, textAnchor: "middle", fontSize: "10", className: "text-muted-foreground", fill: "currentColor", children: line.value.toFixed(0) })
|
|
15692
|
+
] }) : /* @__PURE__ */ jsxs50(Fragment24, { children: [
|
|
15693
|
+
/* @__PURE__ */ jsx55("line", { x1: line.x1, y1: line.y, x2: line.x2, y2: line.y, stroke: "currentColor", strokeDasharray: "4 4" }),
|
|
15694
|
+
/* @__PURE__ */ jsx55("text", { x: padding.left - 8, y: line.y + 4, textAnchor: "end", fontSize: "10", className: "text-muted-foreground", fill: "currentColor", children: line.value.toFixed(0) })
|
|
15179
15695
|
] }) }, i)) }),
|
|
15180
|
-
bars.map((bar, i) => /* @__PURE__ */
|
|
15696
|
+
bars.map((bar, i) => /* @__PURE__ */ jsxs50(
|
|
15181
15697
|
"g",
|
|
15182
15698
|
{
|
|
15183
15699
|
onMouseEnter: () => setHoveredBar({
|
|
@@ -15190,7 +15706,7 @@ function BarChart({
|
|
|
15190
15706
|
onMouseLeave: () => setHoveredBar(null),
|
|
15191
15707
|
className: "cursor-pointer",
|
|
15192
15708
|
children: [
|
|
15193
|
-
/* @__PURE__ */
|
|
15709
|
+
/* @__PURE__ */ jsxs50(
|
|
15194
15710
|
"rect",
|
|
15195
15711
|
{
|
|
15196
15712
|
x: bar.x,
|
|
@@ -15206,7 +15722,7 @@ function BarChart({
|
|
|
15206
15722
|
...horizontal ? { width: 0 } : { height: 0, y: padding.top + chartHeight }
|
|
15207
15723
|
} : void 0,
|
|
15208
15724
|
children: [
|
|
15209
|
-
/* @__PURE__ */
|
|
15725
|
+
/* @__PURE__ */ jsx55(
|
|
15210
15726
|
"animate",
|
|
15211
15727
|
{
|
|
15212
15728
|
attributeName: horizontal ? "width" : "height",
|
|
@@ -15217,11 +15733,11 @@ function BarChart({
|
|
|
15217
15733
|
fill: "freeze"
|
|
15218
15734
|
}
|
|
15219
15735
|
),
|
|
15220
|
-
!horizontal && /* @__PURE__ */
|
|
15736
|
+
!horizontal && /* @__PURE__ */ jsx55("animate", { attributeName: "y", from: padding.top + chartHeight, to: bar.y, dur: "0.5s", begin: `${i * 0.1}s`, fill: "freeze" })
|
|
15221
15737
|
]
|
|
15222
15738
|
}
|
|
15223
15739
|
),
|
|
15224
|
-
showValues && /* @__PURE__ */
|
|
15740
|
+
showValues && /* @__PURE__ */ jsx55(
|
|
15225
15741
|
"text",
|
|
15226
15742
|
{
|
|
15227
15743
|
x: horizontal ? bar.x + bar.width + 8 : bar.x + bar.width / 2,
|
|
@@ -15235,7 +15751,7 @@ function BarChart({
|
|
|
15235
15751
|
children: bar.value
|
|
15236
15752
|
}
|
|
15237
15753
|
),
|
|
15238
|
-
showLabels && /* @__PURE__ */
|
|
15754
|
+
showLabels && /* @__PURE__ */ jsx55(
|
|
15239
15755
|
"text",
|
|
15240
15756
|
{
|
|
15241
15757
|
x: horizontal ? padding.left - 8 : bar.x + bar.width / 2,
|
|
@@ -15251,7 +15767,7 @@ function BarChart({
|
|
|
15251
15767
|
},
|
|
15252
15768
|
i
|
|
15253
15769
|
)),
|
|
15254
|
-
/* @__PURE__ */
|
|
15770
|
+
/* @__PURE__ */ jsx55("style", { children: `
|
|
15255
15771
|
@keyframes growHeight {
|
|
15256
15772
|
from { height: 0; }
|
|
15257
15773
|
}
|
|
@@ -15264,7 +15780,7 @@ function BarChart({
|
|
|
15264
15780
|
}
|
|
15265
15781
|
` })
|
|
15266
15782
|
] }),
|
|
15267
|
-
/* @__PURE__ */
|
|
15783
|
+
/* @__PURE__ */ jsx55(
|
|
15268
15784
|
ChartTooltip,
|
|
15269
15785
|
{
|
|
15270
15786
|
x: hoveredBar?.x ?? 0,
|
|
@@ -15280,8 +15796,8 @@ function BarChart({
|
|
|
15280
15796
|
}
|
|
15281
15797
|
|
|
15282
15798
|
// ../../components/ui/PieChart.tsx
|
|
15283
|
-
import { useMemo as
|
|
15284
|
-
import { jsx as
|
|
15799
|
+
import { useMemo as useMemo18, useState as useState41, useRef as useRef19 } from "react";
|
|
15800
|
+
import { jsx as jsx56, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
15285
15801
|
function PieChart({
|
|
15286
15802
|
data,
|
|
15287
15803
|
size = 200,
|
|
@@ -15294,11 +15810,11 @@ function PieChart({
|
|
|
15294
15810
|
startAngle = -90,
|
|
15295
15811
|
className = ""
|
|
15296
15812
|
}) {
|
|
15297
|
-
const containerRef =
|
|
15813
|
+
const containerRef = useRef19(null);
|
|
15298
15814
|
const center = size / 2;
|
|
15299
15815
|
const radius = size / 2 - 10;
|
|
15300
15816
|
const innerRadius = donut ? radius - donutWidth : 0;
|
|
15301
|
-
const { segments, total } =
|
|
15817
|
+
const { segments, total } = useMemo18(() => {
|
|
15302
15818
|
if (!data.length) return { segments: [], total: 0 };
|
|
15303
15819
|
const sum = data.reduce((acc, d) => acc + d.value, 0);
|
|
15304
15820
|
let currentAngle = startAngle;
|
|
@@ -15344,11 +15860,11 @@ function PieChart({
|
|
|
15344
15860
|
});
|
|
15345
15861
|
return { segments: segs, total: sum };
|
|
15346
15862
|
}, [data, center, radius, innerRadius, donut, startAngle]);
|
|
15347
|
-
const [hoveredSegment, setHoveredSegment] =
|
|
15348
|
-
return /* @__PURE__ */
|
|
15349
|
-
/* @__PURE__ */
|
|
15350
|
-
/* @__PURE__ */
|
|
15351
|
-
segments.map((seg, i) => /* @__PURE__ */
|
|
15863
|
+
const [hoveredSegment, setHoveredSegment] = useState41(null);
|
|
15864
|
+
return /* @__PURE__ */ jsxs51("div", { ref: containerRef, className: `relative flex items-center gap-6 ${className}`, children: [
|
|
15865
|
+
/* @__PURE__ */ jsxs51("svg", { width: size + 40, height: size + 40, className: "overflow-visible", style: { fontFamily: "inherit" }, children: [
|
|
15866
|
+
/* @__PURE__ */ jsxs51("g", { transform: `translate(20, 20)`, children: [
|
|
15867
|
+
segments.map((seg, i) => /* @__PURE__ */ jsxs51(
|
|
15352
15868
|
"g",
|
|
15353
15869
|
{
|
|
15354
15870
|
onMouseEnter: () => setHoveredSegment({
|
|
@@ -15361,7 +15877,7 @@ function PieChart({
|
|
|
15361
15877
|
}),
|
|
15362
15878
|
onMouseLeave: () => setHoveredSegment(null),
|
|
15363
15879
|
children: [
|
|
15364
|
-
/* @__PURE__ */
|
|
15880
|
+
/* @__PURE__ */ jsx56(
|
|
15365
15881
|
"path",
|
|
15366
15882
|
{
|
|
15367
15883
|
d: seg.path,
|
|
@@ -15377,7 +15893,7 @@ function PieChart({
|
|
|
15377
15893
|
}
|
|
15378
15894
|
}
|
|
15379
15895
|
),
|
|
15380
|
-
showLabels && /* @__PURE__ */
|
|
15896
|
+
showLabels && /* @__PURE__ */ jsx56(
|
|
15381
15897
|
"text",
|
|
15382
15898
|
{
|
|
15383
15899
|
x: seg.labelX,
|
|
@@ -15394,12 +15910,12 @@ function PieChart({
|
|
|
15394
15910
|
},
|
|
15395
15911
|
i
|
|
15396
15912
|
)),
|
|
15397
|
-
donut && /* @__PURE__ */
|
|
15398
|
-
/* @__PURE__ */
|
|
15399
|
-
/* @__PURE__ */
|
|
15913
|
+
donut && /* @__PURE__ */ jsxs51("g", { children: [
|
|
15914
|
+
/* @__PURE__ */ jsx56("text", { x: center, y: center - 5, textAnchor: "middle", fontSize: "12", className: "text-muted-foreground", fill: "currentColor", children: "Total" }),
|
|
15915
|
+
/* @__PURE__ */ jsx56("text", { x: center, y: center + 15, textAnchor: "middle", fontSize: "18", fontWeight: "600", className: "text-foreground", fill: "currentColor", children: total })
|
|
15400
15916
|
] })
|
|
15401
15917
|
] }),
|
|
15402
|
-
/* @__PURE__ */
|
|
15918
|
+
/* @__PURE__ */ jsx56("style", { children: `
|
|
15403
15919
|
@keyframes pieSlice {
|
|
15404
15920
|
from {
|
|
15405
15921
|
opacity: 0;
|
|
@@ -15416,20 +15932,20 @@ function PieChart({
|
|
|
15416
15932
|
}
|
|
15417
15933
|
` })
|
|
15418
15934
|
] }),
|
|
15419
|
-
showLegend && /* @__PURE__ */
|
|
15935
|
+
showLegend && /* @__PURE__ */ jsx56("div", { className: "flex flex-col gap-2", children: segments.map((seg, i) => /* @__PURE__ */ jsxs51(
|
|
15420
15936
|
"div",
|
|
15421
15937
|
{
|
|
15422
15938
|
className: "flex items-center gap-2 text-sm",
|
|
15423
15939
|
style: animated ? { opacity: 0, animation: `fadeIn 0.3s ease-out ${i * 0.1 + 0.3}s forwards` } : void 0,
|
|
15424
15940
|
children: [
|
|
15425
|
-
/* @__PURE__ */
|
|
15426
|
-
/* @__PURE__ */
|
|
15427
|
-
/* @__PURE__ */
|
|
15941
|
+
/* @__PURE__ */ jsx56("div", { className: "w-3 h-3 rounded-md shrink-0", style: { backgroundColor: seg.color } }),
|
|
15942
|
+
/* @__PURE__ */ jsx56("span", { className: "text-muted-foreground", children: seg.label }),
|
|
15943
|
+
/* @__PURE__ */ jsx56("span", { className: "text-foreground font-medium ml-auto", children: showPercentage ? `${(seg.percentage * 100).toFixed(0)}%` : seg.value })
|
|
15428
15944
|
]
|
|
15429
15945
|
},
|
|
15430
15946
|
i
|
|
15431
15947
|
)) }),
|
|
15432
|
-
/* @__PURE__ */
|
|
15948
|
+
/* @__PURE__ */ jsx56(
|
|
15433
15949
|
ChartTooltip,
|
|
15434
15950
|
{
|
|
15435
15951
|
x: hoveredSegment?.x ?? center,
|
|
@@ -15445,8 +15961,8 @@ function PieChart({
|
|
|
15445
15961
|
}
|
|
15446
15962
|
|
|
15447
15963
|
// ../../components/ui/AreaChart.tsx
|
|
15448
|
-
import { useMemo as
|
|
15449
|
-
import { jsx as
|
|
15964
|
+
import { useMemo as useMemo19, useState as useState42, useRef as useRef20 } from "react";
|
|
15965
|
+
import { jsx as jsx57, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
15450
15966
|
function getCatmullRomSpline(points) {
|
|
15451
15967
|
if (points.length < 2) return "";
|
|
15452
15968
|
if (points.length === 2) {
|
|
@@ -15480,12 +15996,12 @@ function AreaChart({
|
|
|
15480
15996
|
curved = true,
|
|
15481
15997
|
className = ""
|
|
15482
15998
|
}) {
|
|
15483
|
-
const containerRef =
|
|
15999
|
+
const containerRef = useRef20(null);
|
|
15484
16000
|
const padding = { top: 20, right: 20, bottom: 40, left: 50 };
|
|
15485
16001
|
const chartWidth = width - padding.left - padding.right;
|
|
15486
16002
|
const chartHeight = height - padding.top - padding.bottom;
|
|
15487
|
-
const [hoveredPoint, setHoveredPoint] =
|
|
15488
|
-
const { processedSeries, gridLines, maxValue, labels } =
|
|
16003
|
+
const [hoveredPoint, setHoveredPoint] = useState42(null);
|
|
16004
|
+
const { processedSeries, gridLines, maxValue, labels } = useMemo19(() => {
|
|
15489
16005
|
if (!series.length || !series[0]?.data?.length) {
|
|
15490
16006
|
return { processedSeries: [], gridLines: [], maxValue: 0, labels: [] };
|
|
15491
16007
|
}
|
|
@@ -15553,13 +16069,13 @@ function AreaChart({
|
|
|
15553
16069
|
}
|
|
15554
16070
|
return { processedSeries: processed, gridLines: lines, maxValue: max, labels: allLabels };
|
|
15555
16071
|
}, [series, chartWidth, chartHeight, padding, stacked, curved]);
|
|
15556
|
-
return /* @__PURE__ */
|
|
15557
|
-
/* @__PURE__ */
|
|
15558
|
-
showGrid && /* @__PURE__ */
|
|
15559
|
-
/* @__PURE__ */
|
|
15560
|
-
/* @__PURE__ */
|
|
16072
|
+
return /* @__PURE__ */ jsxs52("div", { ref: containerRef, className: `relative flex flex-col gap-4 ${className}`, children: [
|
|
16073
|
+
/* @__PURE__ */ jsxs52("svg", { width, height, className: "overflow-visible", style: { fontFamily: "inherit" }, children: [
|
|
16074
|
+
showGrid && /* @__PURE__ */ jsx57("g", { className: "text-muted-foreground/20", children: gridLines.map((line, i) => /* @__PURE__ */ jsxs52("g", { children: [
|
|
16075
|
+
/* @__PURE__ */ jsx57("line", { x1: padding.left, y1: line.y, x2: width - padding.right, y2: line.y, stroke: "currentColor", strokeDasharray: "4 4" }),
|
|
16076
|
+
/* @__PURE__ */ jsx57("text", { x: padding.left - 8, y: line.y + 4, textAnchor: "end", fontSize: "10", className: "text-muted-foreground", fill: "currentColor", children: line.value.toFixed(0) })
|
|
15561
16077
|
] }, i)) }),
|
|
15562
|
-
[...processedSeries].reverse().map((s, i) => /* @__PURE__ */
|
|
16078
|
+
[...processedSeries].reverse().map((s, i) => /* @__PURE__ */ jsx57(
|
|
15563
16079
|
"path",
|
|
15564
16080
|
{
|
|
15565
16081
|
d: s.areaPath,
|
|
@@ -15573,7 +16089,7 @@ function AreaChart({
|
|
|
15573
16089
|
},
|
|
15574
16090
|
`area-${i}`
|
|
15575
16091
|
)),
|
|
15576
|
-
processedSeries.map((s, i) => /* @__PURE__ */
|
|
16092
|
+
processedSeries.map((s, i) => /* @__PURE__ */ jsx57(
|
|
15577
16093
|
"path",
|
|
15578
16094
|
{
|
|
15579
16095
|
d: s.linePath,
|
|
@@ -15591,7 +16107,7 @@ function AreaChart({
|
|
|
15591
16107
|
`line-${i}`
|
|
15592
16108
|
)),
|
|
15593
16109
|
showDots && processedSeries.map(
|
|
15594
|
-
(s, seriesIdx) => s.points.map((point, i) => /* @__PURE__ */
|
|
16110
|
+
(s, seriesIdx) => s.points.map((point, i) => /* @__PURE__ */ jsxs52(
|
|
15595
16111
|
"g",
|
|
15596
16112
|
{
|
|
15597
16113
|
onMouseEnter: () => {
|
|
@@ -15610,7 +16126,7 @@ function AreaChart({
|
|
|
15610
16126
|
onMouseLeave: () => setHoveredPoint(null),
|
|
15611
16127
|
className: "cursor-pointer",
|
|
15612
16128
|
children: [
|
|
15613
|
-
/* @__PURE__ */
|
|
16129
|
+
/* @__PURE__ */ jsx57(
|
|
15614
16130
|
"circle",
|
|
15615
16131
|
{
|
|
15616
16132
|
cx: point.x,
|
|
@@ -15626,17 +16142,17 @@ function AreaChart({
|
|
|
15626
16142
|
} : void 0
|
|
15627
16143
|
}
|
|
15628
16144
|
),
|
|
15629
|
-
/* @__PURE__ */
|
|
16145
|
+
/* @__PURE__ */ jsx57("circle", { cx: point.x, cy: point.y, r: 12, fill: "transparent" })
|
|
15630
16146
|
]
|
|
15631
16147
|
},
|
|
15632
16148
|
`dot-${seriesIdx}-${i}`
|
|
15633
16149
|
))
|
|
15634
16150
|
),
|
|
15635
|
-
showLabels && /* @__PURE__ */
|
|
16151
|
+
showLabels && /* @__PURE__ */ jsx57("g", { className: "text-muted-foreground", children: labels.map((label, i) => {
|
|
15636
16152
|
const x = padding.left + i / (labels.length - 1) * chartWidth;
|
|
15637
|
-
return /* @__PURE__ */
|
|
16153
|
+
return /* @__PURE__ */ jsx57("text", { x, y: height - 10, textAnchor: "middle", fontSize: "10", fill: "currentColor", children: label }, i);
|
|
15638
16154
|
}) }),
|
|
15639
|
-
hoveredPoint && /* @__PURE__ */
|
|
16155
|
+
hoveredPoint && /* @__PURE__ */ jsx57("g", { className: "pointer-events-none", children: /* @__PURE__ */ jsx57(
|
|
15640
16156
|
"line",
|
|
15641
16157
|
{
|
|
15642
16158
|
x1: hoveredPoint.x,
|
|
@@ -15650,7 +16166,7 @@ function AreaChart({
|
|
|
15650
16166
|
className: "text-foreground"
|
|
15651
16167
|
}
|
|
15652
16168
|
) }),
|
|
15653
|
-
/* @__PURE__ */
|
|
16169
|
+
/* @__PURE__ */ jsx57("style", { children: `
|
|
15654
16170
|
@keyframes drawLine {
|
|
15655
16171
|
to {
|
|
15656
16172
|
stroke-dashoffset: 0;
|
|
@@ -15672,19 +16188,19 @@ function AreaChart({
|
|
|
15672
16188
|
}
|
|
15673
16189
|
` })
|
|
15674
16190
|
] }),
|
|
15675
|
-
showLegend && /* @__PURE__ */
|
|
16191
|
+
showLegend && /* @__PURE__ */ jsx57("div", { className: "flex items-center justify-center gap-6", children: series.map((s, i) => /* @__PURE__ */ jsxs52(
|
|
15676
16192
|
"div",
|
|
15677
16193
|
{
|
|
15678
16194
|
className: "flex items-center gap-2 text-sm",
|
|
15679
16195
|
style: animated ? { opacity: 0, animation: `fadeIn 0.3s ease-out ${i * 0.1 + 0.5}s forwards` } : void 0,
|
|
15680
16196
|
children: [
|
|
15681
|
-
/* @__PURE__ */
|
|
15682
|
-
/* @__PURE__ */
|
|
16197
|
+
/* @__PURE__ */ jsx57("div", { className: "w-3 h-3 rounded-md", style: { backgroundColor: s.color } }),
|
|
16198
|
+
/* @__PURE__ */ jsx57("span", { className: "text-muted-foreground", children: s.name })
|
|
15683
16199
|
]
|
|
15684
16200
|
},
|
|
15685
16201
|
i
|
|
15686
16202
|
)) }),
|
|
15687
|
-
/* @__PURE__ */
|
|
16203
|
+
/* @__PURE__ */ jsx57(
|
|
15688
16204
|
ChartTooltip,
|
|
15689
16205
|
{
|
|
15690
16206
|
x: hoveredPoint?.x ?? 0,
|
|
@@ -15699,8 +16215,8 @@ function AreaChart({
|
|
|
15699
16215
|
}
|
|
15700
16216
|
|
|
15701
16217
|
// ../../components/ui/Sparkline.tsx
|
|
15702
|
-
import { useMemo as
|
|
15703
|
-
import { jsx as
|
|
16218
|
+
import { useMemo as useMemo20 } from "react";
|
|
16219
|
+
import { jsx as jsx58, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
15704
16220
|
function getCatmullRomSpline2(points) {
|
|
15705
16221
|
if (points.length < 2) return "";
|
|
15706
16222
|
if (points.length === 2) {
|
|
@@ -15738,7 +16254,7 @@ function Sparkline({
|
|
|
15738
16254
|
const padding = 4;
|
|
15739
16255
|
const chartWidth = width - padding * 2;
|
|
15740
16256
|
const chartHeight = height - padding * 2;
|
|
15741
|
-
const { points, linePath, areaPath, lineLength, trend } =
|
|
16257
|
+
const { points, linePath, areaPath, lineLength, trend } = useMemo20(() => {
|
|
15742
16258
|
const normalizedData = data.map((d) => typeof d === "number" ? d : d.value);
|
|
15743
16259
|
if (!normalizedData.length) {
|
|
15744
16260
|
return { points: [], linePath: "", areaPath: "", lineLength: 0, trend: 0 };
|
|
@@ -15762,8 +16278,8 @@ function Sparkline({
|
|
|
15762
16278
|
return { points: pts, linePath: line, areaPath: area, lineLength: length, trend: trendValue };
|
|
15763
16279
|
}, [data, chartWidth, chartHeight, padding, curved]);
|
|
15764
16280
|
const effectiveFillColor = fillColor || color;
|
|
15765
|
-
return /* @__PURE__ */
|
|
15766
|
-
showFill && /* @__PURE__ */
|
|
16281
|
+
return /* @__PURE__ */ jsxs53("svg", { width, height, className: `overflow-visible ${className}`, style: { fontFamily: "inherit" }, children: [
|
|
16282
|
+
showFill && /* @__PURE__ */ jsx58(
|
|
15767
16283
|
"path",
|
|
15768
16284
|
{
|
|
15769
16285
|
d: areaPath,
|
|
@@ -15772,7 +16288,7 @@ function Sparkline({
|
|
|
15772
16288
|
style: animated ? { opacity: 0, animation: "fadeIn 0.5s ease-out 0.3s forwards" } : void 0
|
|
15773
16289
|
}
|
|
15774
16290
|
),
|
|
15775
|
-
/* @__PURE__ */
|
|
16291
|
+
/* @__PURE__ */ jsx58(
|
|
15776
16292
|
"path",
|
|
15777
16293
|
{
|
|
15778
16294
|
d: linePath,
|
|
@@ -15788,7 +16304,7 @@ function Sparkline({
|
|
|
15788
16304
|
} : void 0
|
|
15789
16305
|
}
|
|
15790
16306
|
),
|
|
15791
|
-
showDots && points.map((point, i) => /* @__PURE__ */
|
|
16307
|
+
showDots && points.map((point, i) => /* @__PURE__ */ jsx58(
|
|
15792
16308
|
"circle",
|
|
15793
16309
|
{
|
|
15794
16310
|
cx: point.x,
|
|
@@ -15802,7 +16318,7 @@ function Sparkline({
|
|
|
15802
16318
|
},
|
|
15803
16319
|
i
|
|
15804
16320
|
)),
|
|
15805
|
-
showEndDot && !showDots && points.length > 0 && /* @__PURE__ */
|
|
16321
|
+
showEndDot && !showDots && points.length > 0 && /* @__PURE__ */ jsx58(
|
|
15806
16322
|
"circle",
|
|
15807
16323
|
{
|
|
15808
16324
|
cx: points[points.length - 1].x,
|
|
@@ -15817,7 +16333,7 @@ function Sparkline({
|
|
|
15817
16333
|
} : void 0
|
|
15818
16334
|
}
|
|
15819
16335
|
),
|
|
15820
|
-
/* @__PURE__ */
|
|
16336
|
+
/* @__PURE__ */ jsx58("style", { children: `
|
|
15821
16337
|
@keyframes drawLine {
|
|
15822
16338
|
to {
|
|
15823
16339
|
stroke-dashoffset: 0;
|
|
@@ -15842,8 +16358,8 @@ function Sparkline({
|
|
|
15842
16358
|
}
|
|
15843
16359
|
|
|
15844
16360
|
// ../../components/ui/RadarChart.tsx
|
|
15845
|
-
import { useMemo as
|
|
15846
|
-
import { jsx as
|
|
16361
|
+
import { useMemo as useMemo21, useState as useState43, useRef as useRef21 } from "react";
|
|
16362
|
+
import { jsx as jsx59, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
15847
16363
|
function RadarChart({
|
|
15848
16364
|
series,
|
|
15849
16365
|
size = 300,
|
|
@@ -15854,11 +16370,11 @@ function RadarChart({
|
|
|
15854
16370
|
animated = true,
|
|
15855
16371
|
className = ""
|
|
15856
16372
|
}) {
|
|
15857
|
-
const containerRef =
|
|
16373
|
+
const containerRef = useRef21(null);
|
|
15858
16374
|
const center = size / 2;
|
|
15859
16375
|
const radius = size / 2 - 40;
|
|
15860
|
-
const [hoveredPoint, setHoveredPoint] =
|
|
15861
|
-
const { axes, processedSeries, levelPaths } =
|
|
16376
|
+
const [hoveredPoint, setHoveredPoint] = useState43(null);
|
|
16377
|
+
const { axes, processedSeries, levelPaths } = useMemo21(() => {
|
|
15862
16378
|
if (!series.length || !series[0]?.data?.length) {
|
|
15863
16379
|
return { axes: [], processedSeries: [], levelPaths: [] };
|
|
15864
16380
|
}
|
|
@@ -15908,12 +16424,12 @@ function RadarChart({
|
|
|
15908
16424
|
});
|
|
15909
16425
|
return { axes: axesData, processedSeries: processed, levelPaths: levelsData };
|
|
15910
16426
|
}, [series, center, radius, levels]);
|
|
15911
|
-
return /* @__PURE__ */
|
|
15912
|
-
/* @__PURE__ */
|
|
15913
|
-
/* @__PURE__ */
|
|
15914
|
-
/* @__PURE__ */
|
|
15915
|
-
processedSeries.map((s, i) => /* @__PURE__ */
|
|
15916
|
-
/* @__PURE__ */
|
|
16427
|
+
return /* @__PURE__ */ jsxs54("div", { ref: containerRef, className: `relative flex flex-col gap-4 ${className}`, children: [
|
|
16428
|
+
/* @__PURE__ */ jsxs54("svg", { width: size, height: size, className: "overflow-visible", style: { fontFamily: "inherit" }, children: [
|
|
16429
|
+
/* @__PURE__ */ jsx59("g", { className: "text-muted-foreground/20", children: levelPaths.map((level, i) => /* @__PURE__ */ jsx59("path", { d: level.path, fill: "none", stroke: "currentColor", strokeWidth: 1 }, i)) }),
|
|
16430
|
+
/* @__PURE__ */ jsx59("g", { className: "text-muted-foreground/30", children: axes.map((axis, i) => /* @__PURE__ */ jsx59("line", { x1: center, y1: center, x2: axis.x, y2: axis.y, stroke: "currentColor", strokeWidth: 1 }, i)) }),
|
|
16431
|
+
processedSeries.map((s, i) => /* @__PURE__ */ jsxs54("g", { children: [
|
|
16432
|
+
/* @__PURE__ */ jsx59(
|
|
15917
16433
|
"path",
|
|
15918
16434
|
{
|
|
15919
16435
|
d: s.path,
|
|
@@ -15931,7 +16447,7 @@ function RadarChart({
|
|
|
15931
16447
|
} : void 0
|
|
15932
16448
|
}
|
|
15933
16449
|
),
|
|
15934
|
-
s.points.map((point, j) => /* @__PURE__ */
|
|
16450
|
+
s.points.map((point, j) => /* @__PURE__ */ jsxs54(
|
|
15935
16451
|
"g",
|
|
15936
16452
|
{
|
|
15937
16453
|
onMouseEnter: () => {
|
|
@@ -15950,7 +16466,7 @@ function RadarChart({
|
|
|
15950
16466
|
onMouseLeave: () => setHoveredPoint(null),
|
|
15951
16467
|
className: "cursor-pointer",
|
|
15952
16468
|
children: [
|
|
15953
|
-
/* @__PURE__ */
|
|
16469
|
+
/* @__PURE__ */ jsx59(
|
|
15954
16470
|
"circle",
|
|
15955
16471
|
{
|
|
15956
16472
|
cx: point.x,
|
|
@@ -15966,12 +16482,12 @@ function RadarChart({
|
|
|
15966
16482
|
} : void 0
|
|
15967
16483
|
}
|
|
15968
16484
|
),
|
|
15969
|
-
/* @__PURE__ */
|
|
16485
|
+
/* @__PURE__ */ jsx59("circle", { cx: point.x, cy: point.y, r: 12, fill: "transparent" })
|
|
15970
16486
|
]
|
|
15971
16487
|
},
|
|
15972
16488
|
j
|
|
15973
16489
|
)),
|
|
15974
|
-
showValues && s.points.map((point, j) => /* @__PURE__ */
|
|
16490
|
+
showValues && s.points.map((point, j) => /* @__PURE__ */ jsx59(
|
|
15975
16491
|
"text",
|
|
15976
16492
|
{
|
|
15977
16493
|
x: point.x,
|
|
@@ -15987,8 +16503,8 @@ function RadarChart({
|
|
|
15987
16503
|
`val-${j}`
|
|
15988
16504
|
))
|
|
15989
16505
|
] }, i)),
|
|
15990
|
-
showLabels && /* @__PURE__ */
|
|
15991
|
-
/* @__PURE__ */
|
|
16506
|
+
showLabels && /* @__PURE__ */ jsx59("g", { className: "text-muted-foreground", children: axes.map((axis, i) => /* @__PURE__ */ jsx59("text", { x: axis.labelX, y: axis.labelY, textAnchor: "middle", dominantBaseline: "middle", fontSize: "11", fill: "currentColor", children: axis.label }, i)) }),
|
|
16507
|
+
/* @__PURE__ */ jsx59("style", { children: `
|
|
15992
16508
|
@keyframes radarPop {
|
|
15993
16509
|
from {
|
|
15994
16510
|
opacity: 0;
|
|
@@ -16015,19 +16531,19 @@ function RadarChart({
|
|
|
16015
16531
|
}
|
|
16016
16532
|
` })
|
|
16017
16533
|
] }),
|
|
16018
|
-
showLegend && /* @__PURE__ */
|
|
16534
|
+
showLegend && /* @__PURE__ */ jsx59("div", { className: "flex items-center justify-center gap-6", children: series.map((s, i) => /* @__PURE__ */ jsxs54(
|
|
16019
16535
|
"div",
|
|
16020
16536
|
{
|
|
16021
16537
|
className: "flex items-center gap-2 text-sm",
|
|
16022
16538
|
style: animated ? { opacity: 0, animation: `fadeIn 0.3s ease-out ${i * 0.1 + 0.5}s forwards` } : void 0,
|
|
16023
16539
|
children: [
|
|
16024
|
-
/* @__PURE__ */
|
|
16025
|
-
/* @__PURE__ */
|
|
16540
|
+
/* @__PURE__ */ jsx59("div", { className: "w-3 h-3 rounded-md", style: { backgroundColor: s.color } }),
|
|
16541
|
+
/* @__PURE__ */ jsx59("span", { className: "text-muted-foreground", children: s.name })
|
|
16026
16542
|
]
|
|
16027
16543
|
},
|
|
16028
16544
|
i
|
|
16029
16545
|
)) }),
|
|
16030
|
-
/* @__PURE__ */
|
|
16546
|
+
/* @__PURE__ */ jsx59(
|
|
16031
16547
|
ChartTooltip,
|
|
16032
16548
|
{
|
|
16033
16549
|
x: hoveredPoint?.x ?? 0,
|
|
@@ -16042,8 +16558,8 @@ function RadarChart({
|
|
|
16042
16558
|
}
|
|
16043
16559
|
|
|
16044
16560
|
// ../../components/ui/GaugeChart.tsx
|
|
16045
|
-
import { useMemo as
|
|
16046
|
-
import { jsx as
|
|
16561
|
+
import { useMemo as useMemo22 } from "react";
|
|
16562
|
+
import { jsx as jsx60, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
16047
16563
|
function GaugeChart({
|
|
16048
16564
|
value,
|
|
16049
16565
|
min = 0,
|
|
@@ -16062,7 +16578,7 @@ function GaugeChart({
|
|
|
16062
16578
|
}) {
|
|
16063
16579
|
const center = size / 2;
|
|
16064
16580
|
const radius = center - thickness / 2 - 10;
|
|
16065
|
-
const { backgroundPath, valuePath, percentage, needleAngle } =
|
|
16581
|
+
const { backgroundPath, valuePath, percentage, needleAngle } = useMemo22(() => {
|
|
16066
16582
|
const normalizedValue = Math.min(Math.max(value, min), max);
|
|
16067
16583
|
const pct = (normalizedValue - min) / (max - min);
|
|
16068
16584
|
const totalAngle = endAngle - startAngle;
|
|
@@ -16091,8 +16607,8 @@ function GaugeChart({
|
|
|
16091
16607
|
const needleAngleRad = needleAngle * Math.PI / 180;
|
|
16092
16608
|
const needleX = center + needleLength * Math.cos(needleAngleRad);
|
|
16093
16609
|
const needleY = center + needleLength * Math.sin(needleAngleRad);
|
|
16094
|
-
return /* @__PURE__ */
|
|
16095
|
-
/* @__PURE__ */
|
|
16610
|
+
return /* @__PURE__ */ jsxs55("svg", { width: size, height: size * 0.7, className: `overflow-visible ${className}`, style: { fontFamily: "inherit" }, children: [
|
|
16611
|
+
/* @__PURE__ */ jsx60(
|
|
16096
16612
|
"path",
|
|
16097
16613
|
{
|
|
16098
16614
|
d: backgroundPath,
|
|
@@ -16103,7 +16619,7 @@ function GaugeChart({
|
|
|
16103
16619
|
className: !backgroundColor ? "text-muted-foreground/20" : ""
|
|
16104
16620
|
}
|
|
16105
16621
|
),
|
|
16106
|
-
/* @__PURE__ */
|
|
16622
|
+
/* @__PURE__ */ jsx60(
|
|
16107
16623
|
"path",
|
|
16108
16624
|
{
|
|
16109
16625
|
d: valuePath,
|
|
@@ -16118,7 +16634,7 @@ function GaugeChart({
|
|
|
16118
16634
|
} : void 0
|
|
16119
16635
|
}
|
|
16120
16636
|
),
|
|
16121
|
-
/* @__PURE__ */
|
|
16637
|
+
/* @__PURE__ */ jsxs55(
|
|
16122
16638
|
"g",
|
|
16123
16639
|
{
|
|
16124
16640
|
style: animated ? {
|
|
@@ -16131,14 +16647,14 @@ function GaugeChart({
|
|
|
16131
16647
|
transformOrigin: `${center}px ${center}px`
|
|
16132
16648
|
},
|
|
16133
16649
|
children: [
|
|
16134
|
-
/* @__PURE__ */
|
|
16135
|
-
/* @__PURE__ */
|
|
16136
|
-
/* @__PURE__ */
|
|
16650
|
+
/* @__PURE__ */ jsx60("line", { x1: center, y1: center, x2: center + needleLength, y2: center, stroke: color, strokeWidth: 3, strokeLinecap: "round" }),
|
|
16651
|
+
/* @__PURE__ */ jsx60("circle", { cx: center, cy: center, r: 8, fill: color }),
|
|
16652
|
+
/* @__PURE__ */ jsx60("circle", { cx: center, cy: center, r: 4, className: "text-background", fill: "currentColor" })
|
|
16137
16653
|
]
|
|
16138
16654
|
}
|
|
16139
16655
|
),
|
|
16140
|
-
showMinMax && /* @__PURE__ */
|
|
16141
|
-
/* @__PURE__ */
|
|
16656
|
+
showMinMax && /* @__PURE__ */ jsxs55("g", { className: "text-muted-foreground", children: [
|
|
16657
|
+
/* @__PURE__ */ jsx60(
|
|
16142
16658
|
"text",
|
|
16143
16659
|
{
|
|
16144
16660
|
x: center + (radius + 20) * Math.cos(startAngle * Math.PI / 180),
|
|
@@ -16149,7 +16665,7 @@ function GaugeChart({
|
|
|
16149
16665
|
children: min
|
|
16150
16666
|
}
|
|
16151
16667
|
),
|
|
16152
|
-
/* @__PURE__ */
|
|
16668
|
+
/* @__PURE__ */ jsx60(
|
|
16153
16669
|
"text",
|
|
16154
16670
|
{
|
|
16155
16671
|
x: center + (radius + 20) * Math.cos(endAngle * Math.PI / 180),
|
|
@@ -16161,8 +16677,8 @@ function GaugeChart({
|
|
|
16161
16677
|
}
|
|
16162
16678
|
)
|
|
16163
16679
|
] }),
|
|
16164
|
-
showValue && /* @__PURE__ */
|
|
16165
|
-
/* @__PURE__ */
|
|
16680
|
+
showValue && /* @__PURE__ */ jsxs55("g", { children: [
|
|
16681
|
+
/* @__PURE__ */ jsx60(
|
|
16166
16682
|
"text",
|
|
16167
16683
|
{
|
|
16168
16684
|
x: center,
|
|
@@ -16176,7 +16692,7 @@ function GaugeChart({
|
|
|
16176
16692
|
children: value
|
|
16177
16693
|
}
|
|
16178
16694
|
),
|
|
16179
|
-
label && /* @__PURE__ */
|
|
16695
|
+
label && /* @__PURE__ */ jsx60(
|
|
16180
16696
|
"text",
|
|
16181
16697
|
{
|
|
16182
16698
|
x: center,
|
|
@@ -16190,7 +16706,7 @@ function GaugeChart({
|
|
|
16190
16706
|
}
|
|
16191
16707
|
)
|
|
16192
16708
|
] }),
|
|
16193
|
-
/* @__PURE__ */
|
|
16709
|
+
/* @__PURE__ */ jsx60("style", { children: `
|
|
16194
16710
|
@keyframes drawArc {
|
|
16195
16711
|
to {
|
|
16196
16712
|
stroke-dashoffset: 0;
|
|
@@ -16210,22 +16726,22 @@ function GaugeChart({
|
|
|
16210
16726
|
}
|
|
16211
16727
|
|
|
16212
16728
|
// ../../components/ui/ClientOnly.tsx
|
|
16213
|
-
import { useEffect as useEffect25, useState as
|
|
16214
|
-
import { Fragment as
|
|
16729
|
+
import { useEffect as useEffect25, useState as useState44 } from "react";
|
|
16730
|
+
import { Fragment as Fragment25, jsx as jsx61 } from "react/jsx-runtime";
|
|
16215
16731
|
function ClientOnly({ children, fallback = null }) {
|
|
16216
|
-
const [hasMounted, setHasMounted] =
|
|
16732
|
+
const [hasMounted, setHasMounted] = useState44(false);
|
|
16217
16733
|
useEffect25(() => {
|
|
16218
16734
|
setHasMounted(true);
|
|
16219
16735
|
}, []);
|
|
16220
16736
|
if (!hasMounted) {
|
|
16221
|
-
return /* @__PURE__ */
|
|
16737
|
+
return /* @__PURE__ */ jsx61(Fragment25, { children: fallback });
|
|
16222
16738
|
}
|
|
16223
|
-
return /* @__PURE__ */
|
|
16739
|
+
return /* @__PURE__ */ jsx61(Fragment25, { children });
|
|
16224
16740
|
}
|
|
16225
16741
|
|
|
16226
16742
|
// ../../components/ui/Loading.tsx
|
|
16227
16743
|
import { Activity as Activity3 } from "lucide-react";
|
|
16228
|
-
import { jsx as
|
|
16744
|
+
import { jsx as jsx62, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
16229
16745
|
var LoadingSpinner = ({
|
|
16230
16746
|
size = "md",
|
|
16231
16747
|
className,
|
|
@@ -16241,7 +16757,7 @@ var LoadingSpinner = ({
|
|
|
16241
16757
|
foreground: "text-foreground",
|
|
16242
16758
|
muted: "text-muted-foreground"
|
|
16243
16759
|
};
|
|
16244
|
-
return /* @__PURE__ */
|
|
16760
|
+
return /* @__PURE__ */ jsx62(
|
|
16245
16761
|
Activity3,
|
|
16246
16762
|
{
|
|
16247
16763
|
className: cn(
|
|
@@ -16262,7 +16778,7 @@ var LoadingDots = ({
|
|
|
16262
16778
|
foreground: "bg-foreground",
|
|
16263
16779
|
muted: "bg-muted-foreground"
|
|
16264
16780
|
};
|
|
16265
|
-
return /* @__PURE__ */
|
|
16781
|
+
return /* @__PURE__ */ jsx62("div", { className: cn("flex items-center space-x-1", className), children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx62(
|
|
16266
16782
|
"div",
|
|
16267
16783
|
{
|
|
16268
16784
|
className: cn(
|
|
@@ -16284,7 +16800,7 @@ var LoadingBar = ({
|
|
|
16284
16800
|
label
|
|
16285
16801
|
}) => {
|
|
16286
16802
|
const pct = progress ? Math.min(Math.max(progress, 0), 100) : void 0;
|
|
16287
|
-
return /* @__PURE__ */
|
|
16803
|
+
return /* @__PURE__ */ jsx62(
|
|
16288
16804
|
"div",
|
|
16289
16805
|
{
|
|
16290
16806
|
className: cn("w-full bg-muted rounded-full h-2", className),
|
|
@@ -16293,7 +16809,7 @@ var LoadingBar = ({
|
|
|
16293
16809
|
"aria-valuemax": pct === void 0 ? void 0 : 100,
|
|
16294
16810
|
"aria-valuenow": pct === void 0 ? void 0 : Math.round(pct),
|
|
16295
16811
|
"aria-label": label || "Loading",
|
|
16296
|
-
children: /* @__PURE__ */
|
|
16812
|
+
children: /* @__PURE__ */ jsx62(
|
|
16297
16813
|
"div",
|
|
16298
16814
|
{
|
|
16299
16815
|
className: cn(
|
|
@@ -16311,8 +16827,8 @@ var LoadingBar = ({
|
|
|
16311
16827
|
|
|
16312
16828
|
// ../../components/ui/Table.tsx
|
|
16313
16829
|
import React53 from "react";
|
|
16314
|
-
import { jsx as
|
|
16315
|
-
var Table = React53.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */
|
|
16830
|
+
import { jsx as jsx63, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
16831
|
+
var Table = React53.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx63(
|
|
16316
16832
|
"div",
|
|
16317
16833
|
{
|
|
16318
16834
|
className: cn(
|
|
@@ -16322,20 +16838,20 @@ var Table = React53.forwardRef(({ className, containerClassName, ...props }, ref
|
|
|
16322
16838
|
"backdrop-blur-sm transition-all duration-300",
|
|
16323
16839
|
containerClassName
|
|
16324
16840
|
),
|
|
16325
|
-
children: /* @__PURE__ */
|
|
16841
|
+
children: /* @__PURE__ */ jsx63("table", { ref, className: cn("w-full caption-bottom text-sm", className), ...props })
|
|
16326
16842
|
}
|
|
16327
16843
|
));
|
|
16328
16844
|
Table.displayName = "Table";
|
|
16329
|
-
var TableHeader = React53.forwardRef(({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */
|
|
16845
|
+
var TableHeader = React53.forwardRef(({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ jsxs57("thead", { ref, className: cn("[&_tr]:border-b [&_tr]:border-border", "bg-muted", className), ...props, children: [
|
|
16330
16846
|
children,
|
|
16331
16847
|
filterRow
|
|
16332
16848
|
] }));
|
|
16333
16849
|
TableHeader.displayName = "TableHeader";
|
|
16334
|
-
var TableBody = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
16850
|
+
var TableBody = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
16335
16851
|
TableBody.displayName = "TableBody";
|
|
16336
|
-
var TableFooter = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
16852
|
+
var TableFooter = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63("tfoot", { ref, className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props }));
|
|
16337
16853
|
TableFooter.displayName = "TableFooter";
|
|
16338
|
-
var TableRow = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
16854
|
+
var TableRow = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63(
|
|
16339
16855
|
"tr",
|
|
16340
16856
|
{
|
|
16341
16857
|
ref,
|
|
@@ -16349,7 +16865,7 @@ var TableRow = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
16349
16865
|
}
|
|
16350
16866
|
));
|
|
16351
16867
|
TableRow.displayName = "TableRow";
|
|
16352
|
-
var TableHead = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
16868
|
+
var TableHead = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63(
|
|
16353
16869
|
"th",
|
|
16354
16870
|
{
|
|
16355
16871
|
ref,
|
|
@@ -16358,9 +16874,9 @@ var TableHead = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
16358
16874
|
}
|
|
16359
16875
|
));
|
|
16360
16876
|
TableHead.displayName = "TableHead";
|
|
16361
|
-
var TableCell = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
16877
|
+
var TableCell = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63("td", { ref, className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className), ...props }));
|
|
16362
16878
|
TableCell.displayName = "TableCell";
|
|
16363
|
-
var TableCaption = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
16879
|
+
var TableCaption = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
|
|
16364
16880
|
TableCaption.displayName = "TableCaption";
|
|
16365
16881
|
|
|
16366
16882
|
// ../../components/ui/DataTable/DataTable.tsx
|
|
@@ -16368,7 +16884,7 @@ import { Filter as FilterIcon } from "lucide-react";
|
|
|
16368
16884
|
import React57 from "react";
|
|
16369
16885
|
|
|
16370
16886
|
// ../../components/ui/DataTable/components/Pagination.tsx
|
|
16371
|
-
import { jsx as
|
|
16887
|
+
import { jsx as jsx64, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
16372
16888
|
function DataTablePagination({
|
|
16373
16889
|
totalItems,
|
|
16374
16890
|
curPage,
|
|
@@ -16379,16 +16895,16 @@ function DataTablePagination({
|
|
|
16379
16895
|
}) {
|
|
16380
16896
|
const totalPages = Math.ceil(totalItems / curPageSize);
|
|
16381
16897
|
if (!(totalItems > 0 && totalPages > 1)) return null;
|
|
16382
|
-
return /* @__PURE__ */
|
|
16383
|
-
/* @__PURE__ */
|
|
16898
|
+
return /* @__PURE__ */ jsxs58("div", { className: "flex items-center justify-between gap-2 px-1 pt-3 text-xs text-muted-foreground", children: [
|
|
16899
|
+
/* @__PURE__ */ jsxs58("div", { className: "tabular-nums", children: [
|
|
16384
16900
|
(curPage - 1) * curPageSize + 1,
|
|
16385
16901
|
"-",
|
|
16386
16902
|
Math.min(curPage * curPageSize, totalItems),
|
|
16387
16903
|
"/",
|
|
16388
16904
|
totalItems
|
|
16389
16905
|
] }),
|
|
16390
|
-
/* @__PURE__ */
|
|
16391
|
-
/* @__PURE__ */
|
|
16906
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex items-center gap-0.5", children: [
|
|
16907
|
+
/* @__PURE__ */ jsx64(
|
|
16392
16908
|
Button_default,
|
|
16393
16909
|
{
|
|
16394
16910
|
variant: "ghost",
|
|
@@ -16396,7 +16912,7 @@ function DataTablePagination({
|
|
|
16396
16912
|
className: "h-7 w-7 p-0 rounded-full",
|
|
16397
16913
|
onClick: () => setCurPage(Math.max(1, curPage - 1)),
|
|
16398
16914
|
disabled: curPage === 1,
|
|
16399
|
-
children: /* @__PURE__ */
|
|
16915
|
+
children: /* @__PURE__ */ jsx64("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx64("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
|
|
16400
16916
|
}
|
|
16401
16917
|
),
|
|
16402
16918
|
(() => {
|
|
@@ -16413,7 +16929,7 @@ function DataTablePagination({
|
|
|
16413
16929
|
pages.push(totalPages);
|
|
16414
16930
|
}
|
|
16415
16931
|
return pages.map(
|
|
16416
|
-
(p, i) => p === "..." ? /* @__PURE__ */
|
|
16932
|
+
(p, i) => p === "..." ? /* @__PURE__ */ jsx64("span", { className: "px-1 text-muted-foreground/60", children: "\u2026" }, `dots-${i}`) : /* @__PURE__ */ jsx64(
|
|
16417
16933
|
"button",
|
|
16418
16934
|
{
|
|
16419
16935
|
onClick: () => setCurPage(p),
|
|
@@ -16427,7 +16943,7 @@ function DataTablePagination({
|
|
|
16427
16943
|
)
|
|
16428
16944
|
);
|
|
16429
16945
|
})(),
|
|
16430
|
-
/* @__PURE__ */
|
|
16946
|
+
/* @__PURE__ */ jsx64(
|
|
16431
16947
|
Button_default,
|
|
16432
16948
|
{
|
|
16433
16949
|
variant: "ghost",
|
|
@@ -16435,11 +16951,11 @@ function DataTablePagination({
|
|
|
16435
16951
|
className: "h-7 w-7 p-0 rounded-full",
|
|
16436
16952
|
onClick: () => setCurPage(Math.min(totalPages, curPage + 1)),
|
|
16437
16953
|
disabled: curPage === totalPages,
|
|
16438
|
-
children: /* @__PURE__ */
|
|
16954
|
+
children: /* @__PURE__ */ jsx64("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx64("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })
|
|
16439
16955
|
}
|
|
16440
16956
|
)
|
|
16441
16957
|
] }),
|
|
16442
|
-
pageSizeOptions && /* @__PURE__ */
|
|
16958
|
+
pageSizeOptions && /* @__PURE__ */ jsx64(
|
|
16443
16959
|
Combobox,
|
|
16444
16960
|
{
|
|
16445
16961
|
options: pageSizeOptions.map(String),
|
|
@@ -16553,7 +17069,7 @@ function getLeafColumnsWithFixedInheritance(columns, inheritedFixed) {
|
|
|
16553
17069
|
}
|
|
16554
17070
|
|
|
16555
17071
|
// ../../components/ui/DataTable/components/Toolbar.tsx
|
|
16556
|
-
import { jsx as
|
|
17072
|
+
import { jsx as jsx65, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
16557
17073
|
function DataTableToolbar({
|
|
16558
17074
|
caption,
|
|
16559
17075
|
toolbar,
|
|
@@ -16569,14 +17085,14 @@ function DataTableToolbar({
|
|
|
16569
17085
|
labels,
|
|
16570
17086
|
t
|
|
16571
17087
|
}) {
|
|
16572
|
-
return /* @__PURE__ */
|
|
16573
|
-
/* @__PURE__ */
|
|
16574
|
-
/* @__PURE__ */
|
|
16575
|
-
enableDensityToggle && /* @__PURE__ */
|
|
17088
|
+
return /* @__PURE__ */ jsxs59("div", { className: "flex items-center justify-between gap-4 mb-1", children: [
|
|
17089
|
+
/* @__PURE__ */ jsx65("div", { className: "text-sm text-muted-foreground", children: caption }),
|
|
17090
|
+
/* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2", children: [
|
|
17091
|
+
enableDensityToggle && /* @__PURE__ */ jsx65(
|
|
16576
17092
|
DropdownMenu_default,
|
|
16577
17093
|
{
|
|
16578
|
-
trigger: /* @__PURE__ */
|
|
16579
|
-
/* @__PURE__ */
|
|
17094
|
+
trigger: /* @__PURE__ */ jsxs59(Button_default, { variant: "ghost", size: "sm", className: "h-8 px-2", children: [
|
|
17095
|
+
/* @__PURE__ */ jsx65("svg", { className: "w-4 h-4 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx65("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }),
|
|
16580
17096
|
labels?.density || t("density")
|
|
16581
17097
|
] }),
|
|
16582
17098
|
items: [
|
|
@@ -16588,11 +17104,11 @@ function DataTableToolbar({
|
|
|
16588
17104
|
),
|
|
16589
17105
|
enableColumnVisibilityToggle && (() => {
|
|
16590
17106
|
const leafCols = getLeafColumns(columns);
|
|
16591
|
-
return /* @__PURE__ */
|
|
17107
|
+
return /* @__PURE__ */ jsx65(
|
|
16592
17108
|
DropdownMenu_default,
|
|
16593
17109
|
{
|
|
16594
|
-
trigger: /* @__PURE__ */
|
|
16595
|
-
/* @__PURE__ */
|
|
17110
|
+
trigger: /* @__PURE__ */ jsxs59(Button_default, { variant: "ghost", size: "sm", className: "h-8 px-2", children: [
|
|
17111
|
+
/* @__PURE__ */ jsx65("svg", { className: "w-4 h-4 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx65(
|
|
16596
17112
|
"path",
|
|
16597
17113
|
{
|
|
16598
17114
|
strokeLinecap: "round",
|
|
@@ -16603,15 +17119,15 @@ function DataTableToolbar({
|
|
|
16603
17119
|
) }),
|
|
16604
17120
|
labels?.columns || t("columns")
|
|
16605
17121
|
] }),
|
|
16606
|
-
children: leafCols.map((c) => /* @__PURE__ */
|
|
17122
|
+
children: leafCols.map((c) => /* @__PURE__ */ jsxs59(
|
|
16607
17123
|
DropdownMenuItem,
|
|
16608
17124
|
{
|
|
16609
17125
|
onClick: () => {
|
|
16610
17126
|
setVisibleCols((prev) => prev.includes(c.key) ? prev.filter((k) => k !== c.key) : [...prev, c.key]);
|
|
16611
17127
|
},
|
|
16612
17128
|
children: [
|
|
16613
|
-
/* @__PURE__ */
|
|
16614
|
-
/* @__PURE__ */
|
|
17129
|
+
/* @__PURE__ */ jsx65("input", { type: "checkbox", className: "mr-2 rounded-md border-border", readOnly: true, checked: visibleCols.includes(c.key) }),
|
|
17130
|
+
/* @__PURE__ */ jsx65("span", { className: "truncate", children: c.title })
|
|
16615
17131
|
]
|
|
16616
17132
|
},
|
|
16617
17133
|
c.key
|
|
@@ -16619,11 +17135,11 @@ function DataTableToolbar({
|
|
|
16619
17135
|
}
|
|
16620
17136
|
);
|
|
16621
17137
|
})(),
|
|
16622
|
-
enableHeaderAlignToggle && /* @__PURE__ */
|
|
17138
|
+
enableHeaderAlignToggle && /* @__PURE__ */ jsx65(
|
|
16623
17139
|
DropdownMenu_default,
|
|
16624
17140
|
{
|
|
16625
|
-
trigger: /* @__PURE__ */
|
|
16626
|
-
/* @__PURE__ */
|
|
17141
|
+
trigger: /* @__PURE__ */ jsxs59(Button_default, { variant: "ghost", size: "sm", className: "h-8 px-2", children: [
|
|
17142
|
+
/* @__PURE__ */ jsx65("svg", { className: "w-4 h-4 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx65("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h10M4 18h16" }) }),
|
|
16627
17143
|
labels?.headerAlign || t("headerAlign")
|
|
16628
17144
|
] }),
|
|
16629
17145
|
items: [
|
|
@@ -16862,7 +17378,7 @@ function validateColumns(columns) {
|
|
|
16862
17378
|
}
|
|
16863
17379
|
|
|
16864
17380
|
// ../../components/ui/DataTable/DataTable.tsx
|
|
16865
|
-
import { Fragment as
|
|
17381
|
+
import { Fragment as Fragment26, jsx as jsx66, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
16866
17382
|
function DataTable({
|
|
16867
17383
|
columns,
|
|
16868
17384
|
data,
|
|
@@ -16947,7 +17463,7 @@ function DataTable({
|
|
|
16947
17463
|
const k = col.key;
|
|
16948
17464
|
const commonProps = { className: "h-8 w-full text-sm" };
|
|
16949
17465
|
if (col.filter.type === "text") {
|
|
16950
|
-
return /* @__PURE__ */
|
|
17466
|
+
return /* @__PURE__ */ jsx66(
|
|
16951
17467
|
Input_default,
|
|
16952
17468
|
{
|
|
16953
17469
|
...commonProps,
|
|
@@ -16962,7 +17478,7 @@ function DataTable({
|
|
|
16962
17478
|
}
|
|
16963
17479
|
if (col.filter.type === "select") {
|
|
16964
17480
|
const options = col.filter.options || [];
|
|
16965
|
-
return /* @__PURE__ */
|
|
17481
|
+
return /* @__PURE__ */ jsx66(
|
|
16966
17482
|
Combobox,
|
|
16967
17483
|
{
|
|
16968
17484
|
options: ["", ...options],
|
|
@@ -16978,7 +17494,7 @@ function DataTable({
|
|
|
16978
17494
|
);
|
|
16979
17495
|
}
|
|
16980
17496
|
if (col.filter.type === "date") {
|
|
16981
|
-
return /* @__PURE__ */
|
|
17497
|
+
return /* @__PURE__ */ jsx66(
|
|
16982
17498
|
DatePicker,
|
|
16983
17499
|
{
|
|
16984
17500
|
placeholder: col.filter.placeholder || `Select ${String(col.title)}`,
|
|
@@ -16995,7 +17511,7 @@ function DataTable({
|
|
|
16995
17511
|
const headerRows = React57.useMemo(() => buildHeaderRows(visibleColumns), [visibleColumns]);
|
|
16996
17512
|
const renderHeaderContent = (col, isLeaf) => {
|
|
16997
17513
|
if (!isLeaf) {
|
|
16998
|
-
return /* @__PURE__ */
|
|
17514
|
+
return /* @__PURE__ */ jsx66(
|
|
16999
17515
|
"div",
|
|
17000
17516
|
{
|
|
17001
17517
|
className: cn(
|
|
@@ -17004,15 +17520,15 @@ function DataTable({
|
|
|
17004
17520
|
col.align === "center" && "justify-center",
|
|
17005
17521
|
!col.align && "justify-start"
|
|
17006
17522
|
),
|
|
17007
|
-
children: /* @__PURE__ */
|
|
17523
|
+
children: /* @__PURE__ */ jsx66("span", { className: "font-medium text-sm whitespace-nowrap", children: col.title })
|
|
17008
17524
|
}
|
|
17009
17525
|
);
|
|
17010
17526
|
}
|
|
17011
17527
|
const isRightAlign = col.align === "right" || !col.align && headerAlign === "right";
|
|
17012
17528
|
const isCenterAlign = col.align === "center" || !col.align && headerAlign === "center";
|
|
17013
|
-
const titleContent = /* @__PURE__ */
|
|
17014
|
-
/* @__PURE__ */
|
|
17015
|
-
col.sortable && /* @__PURE__ */
|
|
17529
|
+
const titleContent = /* @__PURE__ */ jsxs60("div", { className: "flex items-center gap-1", children: [
|
|
17530
|
+
/* @__PURE__ */ jsx66("span", { className: "font-medium text-sm whitespace-nowrap", children: col.title }),
|
|
17531
|
+
col.sortable && /* @__PURE__ */ jsx66(
|
|
17016
17532
|
"button",
|
|
17017
17533
|
{
|
|
17018
17534
|
className: cn(
|
|
@@ -17029,8 +17545,8 @@ function DataTable({
|
|
|
17029
17545
|
},
|
|
17030
17546
|
"aria-label": "Sort",
|
|
17031
17547
|
title: `Sort by ${String(col.title)}`,
|
|
17032
|
-
children: /* @__PURE__ */
|
|
17033
|
-
/* @__PURE__ */
|
|
17548
|
+
children: /* @__PURE__ */ jsxs60("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "none", className: "inline-block", children: [
|
|
17549
|
+
/* @__PURE__ */ jsx66(
|
|
17034
17550
|
"path",
|
|
17035
17551
|
{
|
|
17036
17552
|
d: "M7 8l3-3 3 3",
|
|
@@ -17041,7 +17557,7 @@ function DataTable({
|
|
|
17041
17557
|
opacity: sort?.key === col.key && sort.order === "asc" ? 1 : 0.4
|
|
17042
17558
|
}
|
|
17043
17559
|
),
|
|
17044
|
-
/* @__PURE__ */
|
|
17560
|
+
/* @__PURE__ */ jsx66(
|
|
17045
17561
|
"path",
|
|
17046
17562
|
{
|
|
17047
17563
|
d: "M7 12l3 3 3-3",
|
|
@@ -17056,11 +17572,11 @@ function DataTable({
|
|
|
17056
17572
|
}
|
|
17057
17573
|
)
|
|
17058
17574
|
] });
|
|
17059
|
-
const filterContent = col.filter ? /* @__PURE__ */
|
|
17575
|
+
const filterContent = col.filter ? /* @__PURE__ */ jsx66(
|
|
17060
17576
|
Popover,
|
|
17061
17577
|
{
|
|
17062
17578
|
placement: "bottom-start",
|
|
17063
|
-
trigger: /* @__PURE__ */
|
|
17579
|
+
trigger: /* @__PURE__ */ jsx66(
|
|
17064
17580
|
"button",
|
|
17065
17581
|
{
|
|
17066
17582
|
className: cn(
|
|
@@ -17069,13 +17585,13 @@ function DataTable({
|
|
|
17069
17585
|
),
|
|
17070
17586
|
"aria-label": "Filter",
|
|
17071
17587
|
title: `Filter by ${String(col.title)}`,
|
|
17072
|
-
children: /* @__PURE__ */
|
|
17588
|
+
children: /* @__PURE__ */ jsx66(FilterIcon, { className: "w-4 h-4" })
|
|
17073
17589
|
}
|
|
17074
17590
|
),
|
|
17075
|
-
children: /* @__PURE__ */
|
|
17076
|
-
/* @__PURE__ */
|
|
17077
|
-
/* @__PURE__ */
|
|
17078
|
-
filters[col.key] !== void 0 && filters[col.key] !== null && filters[col.key] !== "" && /* @__PURE__ */
|
|
17591
|
+
children: /* @__PURE__ */ jsxs60("div", { className: "p-3 w-64 space-y-3", children: [
|
|
17592
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex items-center justify-between", children: [
|
|
17593
|
+
/* @__PURE__ */ jsx66("div", { className: "text-sm font-medium", children: col.title }),
|
|
17594
|
+
filters[col.key] !== void 0 && filters[col.key] !== null && filters[col.key] !== "" && /* @__PURE__ */ jsx66(
|
|
17079
17595
|
"button",
|
|
17080
17596
|
{
|
|
17081
17597
|
onClick: () => {
|
|
@@ -17091,7 +17607,7 @@ function DataTable({
|
|
|
17091
17607
|
] })
|
|
17092
17608
|
}
|
|
17093
17609
|
) : null;
|
|
17094
|
-
return /* @__PURE__ */
|
|
17610
|
+
return /* @__PURE__ */ jsx66(
|
|
17095
17611
|
"div",
|
|
17096
17612
|
{
|
|
17097
17613
|
className: cn(
|
|
@@ -17100,23 +17616,23 @@ function DataTable({
|
|
|
17100
17616
|
isCenterAlign && "justify-center",
|
|
17101
17617
|
!isRightAlign && !isCenterAlign && "justify-start"
|
|
17102
17618
|
),
|
|
17103
|
-
children: isRightAlign ? /* @__PURE__ */
|
|
17619
|
+
children: isRightAlign ? /* @__PURE__ */ jsxs60(Fragment26, { children: [
|
|
17104
17620
|
filterContent,
|
|
17105
17621
|
titleContent
|
|
17106
|
-
] }) : /* @__PURE__ */
|
|
17622
|
+
] }) : /* @__PURE__ */ jsxs60(Fragment26, { children: [
|
|
17107
17623
|
titleContent,
|
|
17108
17624
|
filterContent
|
|
17109
17625
|
] })
|
|
17110
17626
|
}
|
|
17111
17627
|
);
|
|
17112
17628
|
};
|
|
17113
|
-
const renderHeader = /* @__PURE__ */
|
|
17629
|
+
const renderHeader = /* @__PURE__ */ jsx66(Fragment26, { children: headerRows.map((row, rowIndex) => /* @__PURE__ */ jsx66(TableRow, { children: row.map((headerCell, cellIndex) => {
|
|
17114
17630
|
const { column: col, colSpan, rowSpan, isLeaf } = headerCell;
|
|
17115
17631
|
const prevCell = cellIndex > 0 ? row[cellIndex - 1] : null;
|
|
17116
17632
|
const prevCol = prevCell?.column;
|
|
17117
17633
|
const isAfterFixedLeft = prevCol?.fixed === "left";
|
|
17118
17634
|
const showBorderLeft = columnDividers && cellIndex > 0 && !isAfterFixedLeft && !col.fixed;
|
|
17119
|
-
return /* @__PURE__ */
|
|
17635
|
+
return /* @__PURE__ */ jsx66(
|
|
17120
17636
|
TableHead,
|
|
17121
17637
|
{
|
|
17122
17638
|
colSpan,
|
|
@@ -17172,8 +17688,8 @@ function DataTable({
|
|
|
17172
17688
|
const start = (curPage - 1) * curPageSize;
|
|
17173
17689
|
return processedData.slice(start, start + curPageSize);
|
|
17174
17690
|
}, [processedData, curPage, curPageSize]);
|
|
17175
|
-
return /* @__PURE__ */
|
|
17176
|
-
/* @__PURE__ */
|
|
17691
|
+
return /* @__PURE__ */ jsxs60("div", { className: cn("space-y-2", className), children: [
|
|
17692
|
+
/* @__PURE__ */ jsx66(
|
|
17177
17693
|
DataTableToolbar,
|
|
17178
17694
|
{
|
|
17179
17695
|
caption,
|
|
@@ -17191,7 +17707,7 @@ function DataTable({
|
|
|
17191
17707
|
t
|
|
17192
17708
|
}
|
|
17193
17709
|
),
|
|
17194
|
-
/* @__PURE__ */
|
|
17710
|
+
/* @__PURE__ */ jsx66(
|
|
17195
17711
|
"div",
|
|
17196
17712
|
{
|
|
17197
17713
|
className: cn("relative rounded-2xl md:rounded-3xl border border-border/50", loading2 && "opacity-60 pointer-events-none"),
|
|
@@ -17200,7 +17716,7 @@ function DataTable({
|
|
|
17200
17716
|
overflowY: "auto",
|
|
17201
17717
|
overflowX: "auto"
|
|
17202
17718
|
} : { overflowX: "auto" },
|
|
17203
|
-
children: /* @__PURE__ */
|
|
17719
|
+
children: /* @__PURE__ */ jsxs60(
|
|
17204
17720
|
Table,
|
|
17205
17721
|
{
|
|
17206
17722
|
containerClassName: cn("border-0 md:border-0 rounded-none md:rounded-none shadow-none bg-transparent", "overflow-visible"),
|
|
@@ -17210,11 +17726,11 @@ function DataTable({
|
|
|
17210
17726
|
),
|
|
17211
17727
|
style: { minWidth: totalColumnsWidth > 0 ? `${totalColumnsWidth}px` : void 0 },
|
|
17212
17728
|
children: [
|
|
17213
|
-
/* @__PURE__ */
|
|
17214
|
-
/* @__PURE__ */
|
|
17215
|
-
/* @__PURE__ */
|
|
17216
|
-
/* @__PURE__ */
|
|
17217
|
-
/* @__PURE__ */
|
|
17729
|
+
/* @__PURE__ */ jsx66(TableHeader, { children: renderHeader }),
|
|
17730
|
+
/* @__PURE__ */ jsx66(TableBody, { children: loading2 ? /* @__PURE__ */ jsx66(TableRow, { children: /* @__PURE__ */ jsx66(TableCell, { colSpan: leafColumns.length, className: "text-center py-8", children: /* @__PURE__ */ jsxs60("div", { className: "flex items-center justify-center gap-2 text-muted-foreground", children: [
|
|
17731
|
+
/* @__PURE__ */ jsxs60("svg", { className: "animate-spin h-4 w-4", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
17732
|
+
/* @__PURE__ */ jsx66("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
17733
|
+
/* @__PURE__ */ jsx66(
|
|
17218
17734
|
"path",
|
|
17219
17735
|
{
|
|
17220
17736
|
className: "opacity-75",
|
|
@@ -17223,13 +17739,13 @@ function DataTable({
|
|
|
17223
17739
|
}
|
|
17224
17740
|
)
|
|
17225
17741
|
] }),
|
|
17226
|
-
/* @__PURE__ */
|
|
17742
|
+
/* @__PURE__ */ jsxs60("span", { className: "text-sm", children: [
|
|
17227
17743
|
t("loading"),
|
|
17228
17744
|
"\u2026"
|
|
17229
17745
|
] })
|
|
17230
|
-
] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */
|
|
17746
|
+
] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */ jsx66(TableRow, { children: /* @__PURE__ */ jsx66(TableCell, { colSpan: leafColumns.length, className: "text-center py-6 text-muted-foreground", children: t("noData") }) }) : displayedData.map((row, idx) => {
|
|
17231
17747
|
const isLastRow = idx === displayedData.length - 1;
|
|
17232
|
-
return /* @__PURE__ */
|
|
17748
|
+
return /* @__PURE__ */ jsx66(
|
|
17233
17749
|
TableRow,
|
|
17234
17750
|
{
|
|
17235
17751
|
className: cn(densityRowClass),
|
|
@@ -17243,7 +17759,7 @@ function DataTable({
|
|
|
17243
17759
|
const prevCol = colIdx > 0 ? leafColumns[colIdx - 1] : null;
|
|
17244
17760
|
const isAfterFixedLeft = prevCol?.fixed === "left";
|
|
17245
17761
|
const showBorderLeft = columnDividers && colIdx > 0 && !isAfterFixedLeft && !col.fixed;
|
|
17246
|
-
return /* @__PURE__ */
|
|
17762
|
+
return /* @__PURE__ */ jsx66(
|
|
17247
17763
|
TableCell,
|
|
17248
17764
|
{
|
|
17249
17765
|
style: getStickyColumnStyle(col),
|
|
@@ -17271,7 +17787,7 @@ function DataTable({
|
|
|
17271
17787
|
)
|
|
17272
17788
|
}
|
|
17273
17789
|
),
|
|
17274
|
-
/* @__PURE__ */
|
|
17790
|
+
/* @__PURE__ */ jsx66(
|
|
17275
17791
|
DataTablePagination,
|
|
17276
17792
|
{
|
|
17277
17793
|
totalItems,
|
|
@@ -17289,7 +17805,7 @@ var DataTable_default = DataTable;
|
|
|
17289
17805
|
// ../../components/ui/Form.tsx
|
|
17290
17806
|
import * as React58 from "react";
|
|
17291
17807
|
import { Controller, FormProvider, useFormContext, useForm } from "react-hook-form";
|
|
17292
|
-
import { jsx as
|
|
17808
|
+
import { jsx as jsx67, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
17293
17809
|
var FormConfigContext = React58.createContext({ size: "md" });
|
|
17294
17810
|
var FormWrapper = ({
|
|
17295
17811
|
children,
|
|
@@ -17309,14 +17825,14 @@ var FormWrapper = ({
|
|
|
17309
17825
|
}
|
|
17310
17826
|
}, [JSON.stringify(initialValues)]);
|
|
17311
17827
|
const { validationSchema: _, ...formProps } = props;
|
|
17312
|
-
return /* @__PURE__ */
|
|
17828
|
+
return /* @__PURE__ */ jsx67(FormProvider, { ...methods, children: /* @__PURE__ */ jsx67(FormConfigContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx67("form", { onSubmit: methods.handleSubmit(onSubmit), className, ...formProps, children }) }) });
|
|
17313
17829
|
};
|
|
17314
17830
|
var Form = FormWrapper;
|
|
17315
17831
|
var FormFieldContext = React58.createContext({});
|
|
17316
17832
|
var FormField = ({
|
|
17317
17833
|
...props
|
|
17318
17834
|
}) => {
|
|
17319
|
-
return /* @__PURE__ */
|
|
17835
|
+
return /* @__PURE__ */ jsx67(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx67(Controller, { ...props }) });
|
|
17320
17836
|
};
|
|
17321
17837
|
var useFormField = () => {
|
|
17322
17838
|
const fieldContext = React58.useContext(FormFieldContext);
|
|
@@ -17344,7 +17860,7 @@ var useFormField = () => {
|
|
|
17344
17860
|
var FormItemContext = React58.createContext({});
|
|
17345
17861
|
var FormItem = React58.forwardRef(({ className, ...props }, ref) => {
|
|
17346
17862
|
const id = React58.useId();
|
|
17347
|
-
return /* @__PURE__ */
|
|
17863
|
+
return /* @__PURE__ */ jsx67(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx67("div", { ref, className: cn("space-y-2", className), ...props }) });
|
|
17348
17864
|
});
|
|
17349
17865
|
FormItem.displayName = "FormItem";
|
|
17350
17866
|
var FormLabel = React58.forwardRef(
|
|
@@ -17352,16 +17868,16 @@ var FormLabel = React58.forwardRef(
|
|
|
17352
17868
|
const { error, formItemId } = useFormField();
|
|
17353
17869
|
const config = React58.useContext(FormConfigContext);
|
|
17354
17870
|
const sizeClass = config.size === "sm" ? "text-xs" : config.size === "lg" ? "text-base" : "text-sm";
|
|
17355
|
-
return /* @__PURE__ */
|
|
17871
|
+
return /* @__PURE__ */ jsxs61(Label, { ref, className: cn(sizeClass, error && "text-destructive", className), htmlFor: formItemId, ...props, children: [
|
|
17356
17872
|
children,
|
|
17357
|
-
required && /* @__PURE__ */
|
|
17873
|
+
required && /* @__PURE__ */ jsx67("span", { className: "text-destructive ml-1", children: "*" })
|
|
17358
17874
|
] });
|
|
17359
17875
|
}
|
|
17360
17876
|
);
|
|
17361
17877
|
FormLabel.displayName = "FormLabel";
|
|
17362
17878
|
var FormControl = React58.forwardRef(({ ...props }, ref) => {
|
|
17363
17879
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
17364
|
-
return /* @__PURE__ */
|
|
17880
|
+
return /* @__PURE__ */ jsx67(
|
|
17365
17881
|
"div",
|
|
17366
17882
|
{
|
|
17367
17883
|
ref,
|
|
@@ -17375,7 +17891,7 @@ var FormControl = React58.forwardRef(({ ...props }, ref) => {
|
|
|
17375
17891
|
FormControl.displayName = "FormControl";
|
|
17376
17892
|
var FormDescription = React58.forwardRef(({ className, ...props }, ref) => {
|
|
17377
17893
|
const { formDescriptionId } = useFormField();
|
|
17378
|
-
return /* @__PURE__ */
|
|
17894
|
+
return /* @__PURE__ */ jsx67("p", { ref, id: formDescriptionId, className: cn("text-sm text-muted-foreground", className), ...props });
|
|
17379
17895
|
});
|
|
17380
17896
|
FormDescription.displayName = "FormDescription";
|
|
17381
17897
|
var FormMessage = React58.forwardRef(({ className, children, ...props }, ref) => {
|
|
@@ -17384,26 +17900,26 @@ var FormMessage = React58.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
17384
17900
|
if (!body) {
|
|
17385
17901
|
return null;
|
|
17386
17902
|
}
|
|
17387
|
-
return /* @__PURE__ */
|
|
17903
|
+
return /* @__PURE__ */ jsx67("p", { ref, id: formMessageId, className: cn("text-sm font-medium text-destructive", className), ...props, children: body });
|
|
17388
17904
|
});
|
|
17389
17905
|
FormMessage.displayName = "FormMessage";
|
|
17390
|
-
var FormInput = React58.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */
|
|
17906
|
+
var FormInput = React58.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ jsx67(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx67(
|
|
17391
17907
|
FormField,
|
|
17392
17908
|
{
|
|
17393
17909
|
name,
|
|
17394
|
-
render: ({ field }) => /* @__PURE__ */
|
|
17395
|
-
/* @__PURE__ */
|
|
17396
|
-
/* @__PURE__ */
|
|
17910
|
+
render: ({ field }) => /* @__PURE__ */ jsxs61(FormItem, { children: [
|
|
17911
|
+
/* @__PURE__ */ jsx67(FormControl, { children: /* @__PURE__ */ jsx67(Input_default, { size: props.size ?? size, ...field, ...props }) }),
|
|
17912
|
+
/* @__PURE__ */ jsx67(FormMessage, {})
|
|
17397
17913
|
] })
|
|
17398
17914
|
}
|
|
17399
17915
|
) }));
|
|
17400
17916
|
FormInput.displayName = "FormInput";
|
|
17401
|
-
var FormCheckbox = React58.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */
|
|
17917
|
+
var FormCheckbox = React58.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ jsx67(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx67(
|
|
17402
17918
|
FormField,
|
|
17403
17919
|
{
|
|
17404
17920
|
name,
|
|
17405
|
-
render: ({ field }) => /* @__PURE__ */
|
|
17406
|
-
/* @__PURE__ */
|
|
17921
|
+
render: ({ field }) => /* @__PURE__ */ jsxs61(FormItem, { children: [
|
|
17922
|
+
/* @__PURE__ */ jsx67(FormControl, { children: /* @__PURE__ */ jsx67(
|
|
17407
17923
|
Checkbox,
|
|
17408
17924
|
{
|
|
17409
17925
|
ref,
|
|
@@ -17417,21 +17933,21 @@ var FormCheckbox = React58.forwardRef(({ name, ...props }, ref) => /* @__PURE__
|
|
|
17417
17933
|
...props
|
|
17418
17934
|
}
|
|
17419
17935
|
) }),
|
|
17420
|
-
/* @__PURE__ */
|
|
17936
|
+
/* @__PURE__ */ jsx67(FormMessage, {})
|
|
17421
17937
|
] })
|
|
17422
17938
|
}
|
|
17423
17939
|
) }));
|
|
17424
17940
|
FormCheckbox.displayName = "FormCheckbox";
|
|
17425
|
-
var FormActions = React58.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
17941
|
+
var FormActions = React58.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx67("div", { ref, className: cn("flex gap-2 justify-end", className), ...props }));
|
|
17426
17942
|
FormActions.displayName = "FormActions";
|
|
17427
17943
|
var FormSubmitButton = React58.forwardRef(
|
|
17428
|
-
({ children, loading: loading2, ...props }, ref) => /* @__PURE__ */
|
|
17944
|
+
({ children, loading: loading2, ...props }, ref) => /* @__PURE__ */ jsx67(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx67(Button_default, { ref, type: "submit", size: props.size ?? size, disabled: loading2, ...props, children }) })
|
|
17429
17945
|
);
|
|
17430
17946
|
FormSubmitButton.displayName = "FormSubmitButton";
|
|
17431
17947
|
|
|
17432
17948
|
// ../../components/ui/NotificationModal.tsx
|
|
17433
17949
|
import { ExternalLink } from "lucide-react";
|
|
17434
|
-
import { jsx as
|
|
17950
|
+
import { jsx as jsx68, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
17435
17951
|
function NotificationModal({ isOpen, onClose, notification, titleText, openLinkText, closeText }) {
|
|
17436
17952
|
const t = useTranslations("Common");
|
|
17437
17953
|
if (!notification) return null;
|
|
@@ -17452,20 +17968,20 @@ function NotificationModal({ isOpen, onClose, notification, titleText, openLinkT
|
|
|
17452
17968
|
onClose();
|
|
17453
17969
|
}
|
|
17454
17970
|
};
|
|
17455
|
-
return /* @__PURE__ */
|
|
17456
|
-
/* @__PURE__ */
|
|
17457
|
-
/* @__PURE__ */
|
|
17458
|
-
/* @__PURE__ */
|
|
17971
|
+
return /* @__PURE__ */ jsx68(Modal_default, { isOpen, onClose, title: titleText || t("notifications"), size: "md", children: /* @__PURE__ */ jsxs62("div", { className: "space-y-4", children: [
|
|
17972
|
+
/* @__PURE__ */ jsxs62("div", { className: "flex items-center gap-2 pb-2 border-b border-border", children: [
|
|
17973
|
+
/* @__PURE__ */ jsx68("div", { className: cn("w-2 h-2 rounded-full", !notification.is_read ? "bg-primary" : "bg-border") }),
|
|
17974
|
+
/* @__PURE__ */ jsx68("span", { className: "text-xs text-muted-foreground", children: !notification.is_read ? t("newNotification") : t("readStatus") })
|
|
17459
17975
|
] }),
|
|
17460
|
-
notification.title && /* @__PURE__ */
|
|
17461
|
-
notification.body && /* @__PURE__ */
|
|
17462
|
-
/* @__PURE__ */
|
|
17463
|
-
/* @__PURE__ */
|
|
17464
|
-
hasLink && /* @__PURE__ */
|
|
17465
|
-
/* @__PURE__ */
|
|
17976
|
+
notification.title && /* @__PURE__ */ jsx68("h3", { className: "text-lg font-semibold text-foreground", children: notification.title }),
|
|
17977
|
+
notification.body && /* @__PURE__ */ jsx68("div", { className: "text-sm text-muted-foreground whitespace-pre-wrap leading-relaxed", children: notification.body }),
|
|
17978
|
+
/* @__PURE__ */ jsx68("div", { className: "text-xs text-muted-foreground border-t border-border pt-2", children: formatTime3(notification.created_at) }),
|
|
17979
|
+
/* @__PURE__ */ jsxs62("div", { className: "flex gap-2 justify-end pt-2", children: [
|
|
17980
|
+
hasLink && /* @__PURE__ */ jsxs62(Button_default, { variant: "primary", size: "sm", onClick: handleLinkClick, className: "gap-2", children: [
|
|
17981
|
+
/* @__PURE__ */ jsx68(ExternalLink, { className: "w-4 h-4" }),
|
|
17466
17982
|
openLinkText || t("openLink")
|
|
17467
17983
|
] }),
|
|
17468
|
-
/* @__PURE__ */
|
|
17984
|
+
/* @__PURE__ */ jsx68(Button_default, { variant: "ghost", size: "sm", onClick: onClose, children: closeText || t("close") })
|
|
17469
17985
|
] })
|
|
17470
17986
|
] }) });
|
|
17471
17987
|
}
|
|
@@ -17475,9 +17991,9 @@ var NotificationModal_default = NotificationModal;
|
|
|
17475
17991
|
import Link2 from "next/link";
|
|
17476
17992
|
import { usePathname } from "next/navigation";
|
|
17477
17993
|
import { Phone } from "lucide-react";
|
|
17478
|
-
import { jsx as
|
|
17994
|
+
import { jsx as jsx69, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
17479
17995
|
function MessengerIcon(props) {
|
|
17480
|
-
return /* @__PURE__ */
|
|
17996
|
+
return /* @__PURE__ */ jsx69("svg", { viewBox: "0 0 24 24", width: 24, height: 24, "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx69(
|
|
17481
17997
|
"path",
|
|
17482
17998
|
{
|
|
17483
17999
|
d: "M12 2C6.477 2 2 6.145 2 11.235c0 2.93 1.35 5.542 3.464 7.25v3.515l3.344-1.836c.894.247 1.843.375 2.192.375 5.523 0 10-4.145 10-9.235S17.523 2 12 2zm.994 12.444l-2.563-2.73-5.004 2.73 5.507-5.84 2.626 2.729 4.942-2.729-5.508 5.84z",
|
|
@@ -17486,7 +18002,7 @@ function MessengerIcon(props) {
|
|
|
17486
18002
|
) });
|
|
17487
18003
|
}
|
|
17488
18004
|
function ZaloIcon(props) {
|
|
17489
|
-
return /* @__PURE__ */
|
|
18005
|
+
return /* @__PURE__ */ jsx69("svg", { viewBox: "0 0 48 48", width: 20, height: 20, "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx69(
|
|
17490
18006
|
"path",
|
|
17491
18007
|
{
|
|
17492
18008
|
fill: "white",
|
|
@@ -17495,7 +18011,7 @@ function ZaloIcon(props) {
|
|
|
17495
18011
|
) });
|
|
17496
18012
|
}
|
|
17497
18013
|
function InstagramIcon(props) {
|
|
17498
|
-
return /* @__PURE__ */
|
|
18014
|
+
return /* @__PURE__ */ jsx69("svg", { viewBox: "0 0 24 24", width: 20, height: 20, "aria-hidden": "true", fill: "white", ...props, children: /* @__PURE__ */ jsx69("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z" }) });
|
|
17499
18015
|
}
|
|
17500
18016
|
function FloatingContacts({ className }) {
|
|
17501
18017
|
const pathname = usePathname();
|
|
@@ -17530,8 +18046,8 @@ function FloatingContacts({ className }) {
|
|
|
17530
18046
|
external: true
|
|
17531
18047
|
}
|
|
17532
18048
|
];
|
|
17533
|
-
return /* @__PURE__ */
|
|
17534
|
-
/* @__PURE__ */
|
|
18049
|
+
return /* @__PURE__ */ jsxs63("div", { className: cn("fixed bottom-6 right-4 z-100000", "flex flex-col items-end gap-3", className), "aria-label": "Quick contacts", children: [
|
|
18050
|
+
/* @__PURE__ */ jsx69(
|
|
17535
18051
|
Link2,
|
|
17536
18052
|
{
|
|
17537
18053
|
href: `tel:${hotline.replace(/\D/g, "")}`,
|
|
@@ -17542,10 +18058,10 @@ function FloatingContacts({ className }) {
|
|
|
17542
18058
|
"hover:scale-105 active:scale-95 transition-transform",
|
|
17543
18059
|
"bg-[#22c55e]"
|
|
17544
18060
|
),
|
|
17545
|
-
children: /* @__PURE__ */
|
|
18061
|
+
children: /* @__PURE__ */ jsx69(Phone, { className: "w-6 h-6" })
|
|
17546
18062
|
}
|
|
17547
18063
|
),
|
|
17548
|
-
moreItems.map(({ key, href, label, bg, Icon, external }) => /* @__PURE__ */
|
|
18064
|
+
moreItems.map(({ key, href, label, bg, Icon, external }) => /* @__PURE__ */ jsx69(
|
|
17549
18065
|
Link2,
|
|
17550
18066
|
{
|
|
17551
18067
|
href,
|
|
@@ -17557,7 +18073,7 @@ function FloatingContacts({ className }) {
|
|
|
17557
18073
|
"hover:scale-105 active:scale-95 transition-transform",
|
|
17558
18074
|
bg
|
|
17559
18075
|
),
|
|
17560
|
-
children: /* @__PURE__ */
|
|
18076
|
+
children: /* @__PURE__ */ jsx69(Icon, { className: "w-6 h-6" })
|
|
17561
18077
|
},
|
|
17562
18078
|
key
|
|
17563
18079
|
))
|
|
@@ -17566,7 +18082,7 @@ function FloatingContacts({ className }) {
|
|
|
17566
18082
|
|
|
17567
18083
|
// ../../components/ui/AccessDenied.tsx
|
|
17568
18084
|
import { Ban, Lock, ShieldAlert } from "lucide-react";
|
|
17569
|
-
import { jsx as
|
|
18085
|
+
import { jsx as jsx70, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
17570
18086
|
var VARIANT_STYLES = {
|
|
17571
18087
|
destructive: { bg: "bg-destructive/5", border: "border-destructive/20", text: "text-destructive" },
|
|
17572
18088
|
warning: { bg: "bg-warning/5", border: "border-warning/20", text: "text-warning" },
|
|
@@ -17587,31 +18103,31 @@ function AccessDenied({
|
|
|
17587
18103
|
}) {
|
|
17588
18104
|
const styles = VARIANT_STYLES[variant];
|
|
17589
18105
|
const UsedIcon = Icon || DEFAULT_ICONS[variant];
|
|
17590
|
-
return /* @__PURE__ */
|
|
17591
|
-
/* @__PURE__ */
|
|
17592
|
-
/* @__PURE__ */
|
|
17593
|
-
/* @__PURE__ */
|
|
17594
|
-
/* @__PURE__ */
|
|
18106
|
+
return /* @__PURE__ */ jsx70(Card_default, { className: cn("p-8 text-center shadow-sm", styles.bg, styles.border, className), children: /* @__PURE__ */ jsxs64("div", { className: "flex flex-col items-center gap-4", children: [
|
|
18107
|
+
/* @__PURE__ */ jsx70("div", { className: cn("p-3 rounded-lg", styles.bg.replace("/5", "/10")), children: /* @__PURE__ */ jsx70(UsedIcon, { className: cn("w-8 h-8", styles.text) }) }),
|
|
18108
|
+
/* @__PURE__ */ jsxs64("div", { children: [
|
|
18109
|
+
/* @__PURE__ */ jsx70("h3", { className: cn("font-semibold mb-2", styles.text), children: title }),
|
|
18110
|
+
/* @__PURE__ */ jsx70("p", { className: cn(styles.text.replace("text-", "text-") + "/80", "text-sm"), children: description })
|
|
17595
18111
|
] }),
|
|
17596
|
-
children && /* @__PURE__ */
|
|
18112
|
+
children && /* @__PURE__ */ jsx70("div", { className: "mt-2 flex flex-wrap gap-2 justify-center", children })
|
|
17597
18113
|
] }) });
|
|
17598
18114
|
}
|
|
17599
18115
|
|
|
17600
18116
|
// ../../components/ui/ThemeToggleHeadless.tsx
|
|
17601
18117
|
import { Moon as Moon2, Sun as Sun2, Monitor } from "lucide-react";
|
|
17602
|
-
import { useEffect as useEffect27, useRef as
|
|
18118
|
+
import { useEffect as useEffect27, useRef as useRef22, useState as useState45 } from "react";
|
|
17603
18119
|
import { createPortal as createPortal7 } from "react-dom";
|
|
17604
|
-
import { Fragment as
|
|
18120
|
+
import { Fragment as Fragment27, jsx as jsx71, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
17605
18121
|
function ThemeToggleHeadless({
|
|
17606
18122
|
theme,
|
|
17607
18123
|
onChange,
|
|
17608
18124
|
labels,
|
|
17609
18125
|
className
|
|
17610
18126
|
}) {
|
|
17611
|
-
const [isOpen, setIsOpen] =
|
|
17612
|
-
const [mounted, setMounted] =
|
|
17613
|
-
const triggerRef =
|
|
17614
|
-
const [dropdownPosition, setDropdownPosition] =
|
|
18127
|
+
const [isOpen, setIsOpen] = useState45(false);
|
|
18128
|
+
const [mounted, setMounted] = useState45(false);
|
|
18129
|
+
const triggerRef = useRef22(null);
|
|
18130
|
+
const [dropdownPosition, setDropdownPosition] = useState45(null);
|
|
17615
18131
|
useEffect27(() => setMounted(true), []);
|
|
17616
18132
|
const themes = [
|
|
17617
18133
|
{ value: "light", label: labels?.light ?? "Light", icon: Sun2 },
|
|
@@ -17630,8 +18146,8 @@ function ThemeToggleHeadless({
|
|
|
17630
18146
|
const top = rect.bottom + scrollTop + 8;
|
|
17631
18147
|
return { top, left, width };
|
|
17632
18148
|
};
|
|
17633
|
-
return /* @__PURE__ */
|
|
17634
|
-
/* @__PURE__ */
|
|
18149
|
+
return /* @__PURE__ */ jsxs65("div", { className: cn("relative", className), children: [
|
|
18150
|
+
/* @__PURE__ */ jsx71(
|
|
17635
18151
|
Button_default,
|
|
17636
18152
|
{
|
|
17637
18153
|
variant: "ghost",
|
|
@@ -17649,25 +18165,25 @@ function ThemeToggleHeadless({
|
|
|
17649
18165
|
"aria-haspopup": "menu",
|
|
17650
18166
|
"aria-expanded": isOpen,
|
|
17651
18167
|
"aria-label": labels?.heading ?? "Theme",
|
|
17652
|
-
children: /* @__PURE__ */
|
|
18168
|
+
children: /* @__PURE__ */ jsx71(CurrentIcon, { className: "h-5 w-5" })
|
|
17653
18169
|
}
|
|
17654
18170
|
),
|
|
17655
|
-
isOpen && /* @__PURE__ */
|
|
17656
|
-
typeof window !== "undefined" && createPortal7(/* @__PURE__ */
|
|
18171
|
+
isOpen && /* @__PURE__ */ jsxs65(Fragment27, { children: [
|
|
18172
|
+
typeof window !== "undefined" && createPortal7(/* @__PURE__ */ jsx71("div", { className: "fixed inset-0 z-9998", onClick: () => setIsOpen(false) }), document.body),
|
|
17657
18173
|
typeof window !== "undefined" && dropdownPosition && createPortal7(
|
|
17658
|
-
/* @__PURE__ */
|
|
18174
|
+
/* @__PURE__ */ jsx71(
|
|
17659
18175
|
"div",
|
|
17660
18176
|
{
|
|
17661
18177
|
className: "z-9999 bg-card border border-border rounded-lg shadow-lg overflow-hidden",
|
|
17662
18178
|
style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width },
|
|
17663
18179
|
onMouseDown: (e) => e.stopPropagation(),
|
|
17664
18180
|
role: "menu",
|
|
17665
|
-
children: /* @__PURE__ */
|
|
17666
|
-
/* @__PURE__ */
|
|
18181
|
+
children: /* @__PURE__ */ jsxs65("div", { className: "p-2", children: [
|
|
18182
|
+
/* @__PURE__ */ jsx71("div", { className: "px-3 py-2 text-sm font-medium text-muted-foreground border-b border-border mb-2", children: labels?.heading ?? "Theme" }),
|
|
17667
18183
|
themes.map((opt) => {
|
|
17668
18184
|
const Icon = opt.icon;
|
|
17669
18185
|
const active = theme === opt.value;
|
|
17670
|
-
return /* @__PURE__ */
|
|
18186
|
+
return /* @__PURE__ */ jsxs65(
|
|
17671
18187
|
Button_default,
|
|
17672
18188
|
{
|
|
17673
18189
|
variant: "ghost",
|
|
@@ -17683,9 +18199,9 @@ function ThemeToggleHeadless({
|
|
|
17683
18199
|
role: "menuitemradio",
|
|
17684
18200
|
"aria-checked": active,
|
|
17685
18201
|
children: [
|
|
17686
|
-
/* @__PURE__ */
|
|
17687
|
-
/* @__PURE__ */
|
|
17688
|
-
active && /* @__PURE__ */
|
|
18202
|
+
/* @__PURE__ */ jsx71(Icon, { className: "h-4 w-4" }),
|
|
18203
|
+
/* @__PURE__ */ jsx71("span", { className: "flex-1 text-left", children: opt.label }),
|
|
18204
|
+
active && /* @__PURE__ */ jsx71("div", { className: "w-2 h-2 rounded-full bg-primary" })
|
|
17689
18205
|
]
|
|
17690
18206
|
},
|
|
17691
18207
|
opt.value
|
|
@@ -17701,10 +18217,10 @@ function ThemeToggleHeadless({
|
|
|
17701
18217
|
}
|
|
17702
18218
|
|
|
17703
18219
|
// ../../components/ui/LanguageSwitcherHeadless.tsx
|
|
17704
|
-
import { useRef as
|
|
18220
|
+
import { useRef as useRef23, useState as useState46 } from "react";
|
|
17705
18221
|
import { createPortal as createPortal8 } from "react-dom";
|
|
17706
18222
|
import { Globe } from "lucide-react";
|
|
17707
|
-
import { Fragment as
|
|
18223
|
+
import { Fragment as Fragment28, jsx as jsx72, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
17708
18224
|
function LanguageSwitcherHeadless({
|
|
17709
18225
|
locales,
|
|
17710
18226
|
currentLocale,
|
|
@@ -17712,9 +18228,9 @@ function LanguageSwitcherHeadless({
|
|
|
17712
18228
|
labels,
|
|
17713
18229
|
className
|
|
17714
18230
|
}) {
|
|
17715
|
-
const [isOpen, setIsOpen] =
|
|
17716
|
-
const [dropdownPosition, setDropdownPosition] =
|
|
17717
|
-
const triggerButtonRef =
|
|
18231
|
+
const [isOpen, setIsOpen] = useState46(false);
|
|
18232
|
+
const [dropdownPosition, setDropdownPosition] = useState46(null);
|
|
18233
|
+
const triggerButtonRef = useRef23(null);
|
|
17718
18234
|
const currentLanguage = locales.find((l) => l.code === currentLocale) || locales[0];
|
|
17719
18235
|
const calculatePosition = () => {
|
|
17720
18236
|
const rect = triggerButtonRef.current?.getBoundingClientRect();
|
|
@@ -17726,8 +18242,8 @@ function LanguageSwitcherHeadless({
|
|
|
17726
18242
|
const top = rect.bottom + scrollTop + 8;
|
|
17727
18243
|
return { top, left, width };
|
|
17728
18244
|
};
|
|
17729
|
-
return /* @__PURE__ */
|
|
17730
|
-
/* @__PURE__ */
|
|
18245
|
+
return /* @__PURE__ */ jsxs66("div", { className: cn("relative", className), children: [
|
|
18246
|
+
/* @__PURE__ */ jsx72(
|
|
17731
18247
|
Button_default,
|
|
17732
18248
|
{
|
|
17733
18249
|
variant: "ghost",
|
|
@@ -17746,22 +18262,22 @@ function LanguageSwitcherHeadless({
|
|
|
17746
18262
|
"aria-expanded": isOpen,
|
|
17747
18263
|
"aria-label": labels?.heading ?? "Language",
|
|
17748
18264
|
title: labels?.heading ?? "Language",
|
|
17749
|
-
children: /* @__PURE__ */
|
|
18265
|
+
children: /* @__PURE__ */ jsx72(Globe, { className: "h-5 w-5" })
|
|
17750
18266
|
}
|
|
17751
18267
|
),
|
|
17752
|
-
isOpen && /* @__PURE__ */
|
|
17753
|
-
typeof window !== "undefined" && createPortal8(/* @__PURE__ */
|
|
18268
|
+
isOpen && /* @__PURE__ */ jsxs66(Fragment28, { children: [
|
|
18269
|
+
typeof window !== "undefined" && createPortal8(/* @__PURE__ */ jsx72("div", { className: "fixed inset-0 z-9998", onClick: () => setIsOpen(false) }), document.body),
|
|
17754
18270
|
typeof window !== "undefined" && dropdownPosition && createPortal8(
|
|
17755
|
-
/* @__PURE__ */
|
|
18271
|
+
/* @__PURE__ */ jsx72(
|
|
17756
18272
|
"div",
|
|
17757
18273
|
{
|
|
17758
18274
|
className: "z-9999 bg-card border border-border rounded-lg shadow-lg overflow-hidden",
|
|
17759
18275
|
style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width },
|
|
17760
18276
|
onMouseDown: (e) => e.stopPropagation(),
|
|
17761
18277
|
role: "menu",
|
|
17762
|
-
children: /* @__PURE__ */
|
|
17763
|
-
/* @__PURE__ */
|
|
17764
|
-
locales.map((language) => /* @__PURE__ */
|
|
18278
|
+
children: /* @__PURE__ */ jsxs66("div", { className: "p-2", children: [
|
|
18279
|
+
/* @__PURE__ */ jsx72("div", { className: "px-3 py-2 text-sm font-medium text-muted-foreground border-b border-border mb-2", children: labels?.heading ?? "Language" }),
|
|
18280
|
+
locales.map((language) => /* @__PURE__ */ jsxs66(
|
|
17765
18281
|
Button_default,
|
|
17766
18282
|
{
|
|
17767
18283
|
variant: "ghost",
|
|
@@ -17774,9 +18290,9 @@ function LanguageSwitcherHeadless({
|
|
|
17774
18290
|
role: "menuitemradio",
|
|
17775
18291
|
"aria-checked": currentLocale === language.code,
|
|
17776
18292
|
children: [
|
|
17777
|
-
language.flag && /* @__PURE__ */
|
|
17778
|
-
/* @__PURE__ */
|
|
17779
|
-
currentLocale === language.code && /* @__PURE__ */
|
|
18293
|
+
language.flag && /* @__PURE__ */ jsx72("span", { className: "text-lg", children: language.flag }),
|
|
18294
|
+
/* @__PURE__ */ jsx72("span", { className: "flex-1 text-left", children: language.name }),
|
|
18295
|
+
currentLocale === language.code && /* @__PURE__ */ jsx72("div", { className: "w-2 h-2 rounded-full bg-primary" })
|
|
17780
18296
|
]
|
|
17781
18297
|
},
|
|
17782
18298
|
language.code
|
|
@@ -18292,6 +18808,18 @@ var en_default = {
|
|
|
18292
18808
|
browseFiles: "Browse files",
|
|
18293
18809
|
supportedFormats: "Supported formats: images"
|
|
18294
18810
|
}
|
|
18811
|
+
},
|
|
18812
|
+
FileUpload: {
|
|
18813
|
+
dragDropText: "Drag & drop files here",
|
|
18814
|
+
browseFiles: "Browse files",
|
|
18815
|
+
uploadFiles: "Upload files",
|
|
18816
|
+
supportedFormats: "All file types supported",
|
|
18817
|
+
uploadedFiles: "Uploaded files",
|
|
18818
|
+
clearAll: "Clear all",
|
|
18819
|
+
fileTooLarge: "exceeds size limit",
|
|
18820
|
+
maxFilesReached: "Maximum file limit reached",
|
|
18821
|
+
uploadSuccess: "uploaded successfully",
|
|
18822
|
+
uploadFailed: "upload failed"
|
|
18295
18823
|
}
|
|
18296
18824
|
};
|
|
18297
18825
|
|
|
@@ -18379,6 +18907,18 @@ var vi_default = {
|
|
|
18379
18907
|
browseFiles: "Ch\u1ECDn t\u1EC7p",
|
|
18380
18908
|
supportedFormats: "H\u1ED7 tr\u1EE3 c\xE1c \u0111\u1ECBnh d\u1EA1ng \u1EA3nh"
|
|
18381
18909
|
}
|
|
18910
|
+
},
|
|
18911
|
+
FileUpload: {
|
|
18912
|
+
dragDropText: "K\xE9o & th\u1EA3 t\u1EC7p v\xE0o \u0111\xE2y",
|
|
18913
|
+
browseFiles: "Ch\u1ECDn t\u1EC7p",
|
|
18914
|
+
uploadFiles: "T\u1EA3i t\u1EC7p l\xEAn",
|
|
18915
|
+
supportedFormats: "H\u1ED7 tr\u1EE3 m\u1ECDi \u0111\u1ECBnh d\u1EA1ng t\u1EC7p",
|
|
18916
|
+
uploadedFiles: "T\u1EC7p \u0111\xE3 t\u1EA3i l\xEAn",
|
|
18917
|
+
clearAll: "X\xF3a t\u1EA5t c\u1EA3",
|
|
18918
|
+
fileTooLarge: "v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n k\xEDch th\u01B0\u1EDBc",
|
|
18919
|
+
maxFilesReached: "\u0110\xE3 \u0111\u1EA1t gi\u1EDBi h\u1EA1n s\u1ED1 t\u1EC7p",
|
|
18920
|
+
uploadSuccess: "\u0111\xE3 t\u1EA3i l\xEAn th\xE0nh c\xF4ng",
|
|
18921
|
+
uploadFailed: "t\u1EA3i l\xEAn th\u1EA5t b\u1EA1i"
|
|
18382
18922
|
}
|
|
18383
18923
|
};
|
|
18384
18924
|
|
|
@@ -18466,6 +19006,18 @@ var ko_default = {
|
|
|
18466
19006
|
browseFiles: "\uD30C\uC77C \uCC3E\uC544\uBCF4\uAE30",
|
|
18467
19007
|
supportedFormats: "\uC9C0\uC6D0 \uD615\uC2DD: \uC774\uBBF8\uC9C0"
|
|
18468
19008
|
}
|
|
19009
|
+
},
|
|
19010
|
+
FileUpload: {
|
|
19011
|
+
dragDropText: "\uC5EC\uAE30\uC5D0 \uD30C\uC77C\uC744 \uB4DC\uB798\uADF8 \uC564 \uB4DC\uB86D\uD558\uC138\uC694",
|
|
19012
|
+
browseFiles: "\uD30C\uC77C \uC120\uD0DD",
|
|
19013
|
+
uploadFiles: "\uD30C\uC77C \uC5C5\uB85C\uB4DC",
|
|
19014
|
+
supportedFormats: "\uBAA8\uB4E0 \uD30C\uC77C \uD615\uC2DD \uC9C0\uC6D0",
|
|
19015
|
+
uploadedFiles: "\uC5C5\uB85C\uB4DC\uB41C \uD30C\uC77C",
|
|
19016
|
+
clearAll: "\uBAA8\uB450 \uC9C0\uC6B0\uAE30",
|
|
19017
|
+
fileTooLarge: "\uD06C\uAE30 \uC81C\uD55C \uCD08\uACFC",
|
|
19018
|
+
maxFilesReached: "\uCD5C\uB300 \uD30C\uC77C \uC218 \uB3C4\uB2EC",
|
|
19019
|
+
uploadSuccess: "\uC5C5\uB85C\uB4DC \uC131\uACF5",
|
|
19020
|
+
uploadFailed: "\uC5C5\uB85C\uB4DC \uC2E4\uD328"
|
|
18469
19021
|
}
|
|
18470
19022
|
};
|
|
18471
19023
|
|
|
@@ -18553,11 +19105,23 @@ var ja_default = {
|
|
|
18553
19105
|
browseFiles: "\u30D5\u30A1\u30A4\u30EB\u3092\u53C2\u7167",
|
|
18554
19106
|
supportedFormats: "\u5BFE\u5FDC\u5F62\u5F0F\uFF1A\u753B\u50CF"
|
|
18555
19107
|
}
|
|
19108
|
+
},
|
|
19109
|
+
FileUpload: {
|
|
19110
|
+
dragDropText: "\u3053\u3053\u306B\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30E9\u30C3\u30B0\uFF06\u30C9\u30ED\u30C3\u30D7",
|
|
19111
|
+
browseFiles: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E",
|
|
19112
|
+
uploadFiles: "\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
|
|
19113
|
+
supportedFormats: "\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u306B\u5BFE\u5FDC",
|
|
19114
|
+
uploadedFiles: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB",
|
|
19115
|
+
clearAll: "\u3059\u3079\u3066\u30AF\u30EA\u30A2",
|
|
19116
|
+
fileTooLarge: "\u30B5\u30A4\u30BA\u5236\u9650\u3092\u8D85\u3048\u3066\u3044\u307E\u3059",
|
|
19117
|
+
maxFilesReached: "\u6700\u5927\u30D5\u30A1\u30A4\u30EB\u6570\u306B\u9054\u3057\u307E\u3057\u305F",
|
|
19118
|
+
uploadSuccess: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u6210\u529F",
|
|
19119
|
+
uploadFailed: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5931\u6557"
|
|
18556
19120
|
}
|
|
18557
19121
|
};
|
|
18558
19122
|
|
|
18559
19123
|
// src/contexts/TranslationContext.tsx
|
|
18560
|
-
import { jsx as
|
|
19124
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
18561
19125
|
var defaultTranslations2 = {
|
|
18562
19126
|
en: en_default,
|
|
18563
19127
|
vi: vi_default,
|
|
@@ -18591,7 +19155,7 @@ var TranslationProvider = ({ children, locale = "en", translations }) => {
|
|
|
18591
19155
|
},
|
|
18592
19156
|
[locale, translations]
|
|
18593
19157
|
);
|
|
18594
|
-
return /* @__PURE__ */
|
|
19158
|
+
return /* @__PURE__ */ jsx73(TranslationContext2.Provider, { value: { locale, t }, children });
|
|
18595
19159
|
};
|
|
18596
19160
|
var useUnderverseTranslations = (namespace) => {
|
|
18597
19161
|
const context = React60.useContext(TranslationContext2);
|
|
@@ -18622,7 +19186,7 @@ var useUnderverseLocale = () => {
|
|
|
18622
19186
|
|
|
18623
19187
|
// src/hooks/useSmartTranslations.tsx
|
|
18624
19188
|
import * as React61 from "react";
|
|
18625
|
-
import { jsx as
|
|
19189
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
18626
19190
|
var nextIntlHooks = null;
|
|
18627
19191
|
try {
|
|
18628
19192
|
const nextIntl = __require("next-intl");
|
|
@@ -18635,7 +19199,7 @@ try {
|
|
|
18635
19199
|
}
|
|
18636
19200
|
var ForceInternalContext = React61.createContext(false);
|
|
18637
19201
|
var ForceInternalTranslationsProvider = ({ children }) => {
|
|
18638
|
-
return /* @__PURE__ */
|
|
19202
|
+
return /* @__PURE__ */ jsx74(ForceInternalContext.Provider, { value: true, children });
|
|
18639
19203
|
};
|
|
18640
19204
|
function useSmartTranslations(namespace) {
|
|
18641
19205
|
const forceInternal = React61.useContext(ForceInternalContext);
|
|
@@ -18665,7 +19229,7 @@ function useSmartLocale() {
|
|
|
18665
19229
|
}
|
|
18666
19230
|
|
|
18667
19231
|
// ../../components/ui/UEditor/UEditor.tsx
|
|
18668
|
-
import { useEffect as useEffect32, useMemo as
|
|
19232
|
+
import { useEffect as useEffect32, useMemo as useMemo25 } from "react";
|
|
18669
19233
|
import { useTranslations as useTranslations7 } from "next-intl";
|
|
18670
19234
|
import { useEditor, EditorContent } from "@tiptap/react";
|
|
18671
19235
|
|
|
@@ -18708,9 +19272,9 @@ import { common, createLowlight } from "lowlight";
|
|
|
18708
19272
|
import { Extension } from "@tiptap/core";
|
|
18709
19273
|
import Suggestion from "@tiptap/suggestion";
|
|
18710
19274
|
import { ReactRenderer } from "@tiptap/react";
|
|
18711
|
-
import { forwardRef as forwardRef13, useEffect as useEffect28, useImperativeHandle, useRef as
|
|
19275
|
+
import { forwardRef as forwardRef13, useEffect as useEffect28, useImperativeHandle, useRef as useRef24, useState as useState47 } from "react";
|
|
18712
19276
|
import {
|
|
18713
|
-
FileCode,
|
|
19277
|
+
FileCode as FileCode2,
|
|
18714
19278
|
Heading1,
|
|
18715
19279
|
Heading2,
|
|
18716
19280
|
Heading3,
|
|
@@ -18723,10 +19287,10 @@ import {
|
|
|
18723
19287
|
Type
|
|
18724
19288
|
} from "lucide-react";
|
|
18725
19289
|
import tippy from "tippy.js";
|
|
18726
|
-
import { jsx as
|
|
19290
|
+
import { jsx as jsx75, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
18727
19291
|
var CommandList = forwardRef13((props, ref) => {
|
|
18728
|
-
const [selectedIndex, setSelectedIndex] =
|
|
18729
|
-
const listRef =
|
|
19292
|
+
const [selectedIndex, setSelectedIndex] = useState47(0);
|
|
19293
|
+
const listRef = useRef24(null);
|
|
18730
19294
|
useEffect28(() => {
|
|
18731
19295
|
setSelectedIndex(0);
|
|
18732
19296
|
}, [props.items]);
|
|
@@ -18755,11 +19319,11 @@ var CommandList = forwardRef13((props, ref) => {
|
|
|
18755
19319
|
}
|
|
18756
19320
|
}));
|
|
18757
19321
|
if (props.items.length === 0) {
|
|
18758
|
-
return /* @__PURE__ */
|
|
19322
|
+
return /* @__PURE__ */ jsx75("div", { className: "w-72 p-4 text-center text-sm text-muted-foreground", children: "No results" });
|
|
18759
19323
|
}
|
|
18760
|
-
return /* @__PURE__ */
|
|
18761
|
-
/* @__PURE__ */
|
|
18762
|
-
/* @__PURE__ */
|
|
19324
|
+
return /* @__PURE__ */ jsxs67("div", { ref: listRef, className: "w-72 max-h-80 overflow-y-auto bg-card border border-border rounded-2xl shadow-lg", children: [
|
|
19325
|
+
/* @__PURE__ */ jsx75("div", { className: "px-3 py-2 border-b", children: /* @__PURE__ */ jsx75("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: "Basic Blocks" }) }),
|
|
19326
|
+
/* @__PURE__ */ jsx75("div", { className: "p-1", children: props.items.map((item, index) => /* @__PURE__ */ jsxs67(
|
|
18763
19327
|
"button",
|
|
18764
19328
|
{
|
|
18765
19329
|
type: "button",
|
|
@@ -18770,19 +19334,19 @@ var CommandList = forwardRef13((props, ref) => {
|
|
|
18770
19334
|
selectedIndex === index ? "bg-accent" : "hover:bg-accent/50"
|
|
18771
19335
|
),
|
|
18772
19336
|
children: [
|
|
18773
|
-
/* @__PURE__ */
|
|
19337
|
+
/* @__PURE__ */ jsx75(
|
|
18774
19338
|
"div",
|
|
18775
19339
|
{
|
|
18776
19340
|
className: cn(
|
|
18777
19341
|
"flex items-center justify-center w-10 h-10 rounded-lg mr-3 transition-colors",
|
|
18778
19342
|
selectedIndex === index ? "bg-primary/10" : "bg-muted/50 group-hover:bg-muted"
|
|
18779
19343
|
),
|
|
18780
|
-
children: /* @__PURE__ */
|
|
19344
|
+
children: /* @__PURE__ */ jsx75(item.icon, { className: cn("w-5 h-5", selectedIndex === index ? "text-primary" : "text-muted-foreground") })
|
|
18781
19345
|
}
|
|
18782
19346
|
),
|
|
18783
|
-
/* @__PURE__ */
|
|
18784
|
-
/* @__PURE__ */
|
|
18785
|
-
/* @__PURE__ */
|
|
19347
|
+
/* @__PURE__ */ jsxs67("div", { className: "text-left", children: [
|
|
19348
|
+
/* @__PURE__ */ jsx75("div", { className: cn("text-sm font-medium", selectedIndex === index && "text-primary"), children: item.title }),
|
|
19349
|
+
/* @__PURE__ */ jsx75("div", { className: "text-xs text-muted-foreground", children: item.description })
|
|
18786
19350
|
] })
|
|
18787
19351
|
]
|
|
18788
19352
|
},
|
|
@@ -18858,7 +19422,7 @@ var getSuggestionItems = ({ query }) => {
|
|
|
18858
19422
|
}
|
|
18859
19423
|
},
|
|
18860
19424
|
{
|
|
18861
|
-
icon:
|
|
19425
|
+
icon: FileCode2,
|
|
18862
19426
|
title: "Code Block",
|
|
18863
19427
|
description: "Display code with syntax highlighting",
|
|
18864
19428
|
command: ({ editor, range }) => {
|
|
@@ -19039,11 +19603,11 @@ var ClipboardImages = Extension2.create({
|
|
|
19039
19603
|
});
|
|
19040
19604
|
|
|
19041
19605
|
// ../../components/ui/UEditor/resizable-image.tsx
|
|
19042
|
-
import { useEffect as useEffect29, useRef as
|
|
19606
|
+
import { useEffect as useEffect29, useRef as useRef25, useState as useState48 } from "react";
|
|
19043
19607
|
import Image3 from "@tiptap/extension-image";
|
|
19044
19608
|
import { mergeAttributes } from "@tiptap/core";
|
|
19045
19609
|
import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
|
|
19046
|
-
import { jsx as
|
|
19610
|
+
import { jsx as jsx76, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
19047
19611
|
var MIN_IMAGE_SIZE_PX = 40;
|
|
19048
19612
|
var AXIS_LOCK_THRESHOLD_PX = 4;
|
|
19049
19613
|
function toNullableNumber(value) {
|
|
@@ -19059,14 +19623,14 @@ function clamp7(value, min, max) {
|
|
|
19059
19623
|
}
|
|
19060
19624
|
function ResizableImageNodeView(props) {
|
|
19061
19625
|
const { node, selected, updateAttributes, editor, getPos } = props;
|
|
19062
|
-
const wrapperRef =
|
|
19063
|
-
const imgRef =
|
|
19064
|
-
const [isHovered, setIsHovered] =
|
|
19065
|
-
const [isResizing, setIsResizing] =
|
|
19626
|
+
const wrapperRef = useRef25(null);
|
|
19627
|
+
const imgRef = useRef25(null);
|
|
19628
|
+
const [isHovered, setIsHovered] = useState48(false);
|
|
19629
|
+
const [isResizing, setIsResizing] = useState48(false);
|
|
19066
19630
|
const widthAttr = toNullableNumber(node.attrs["width"]);
|
|
19067
19631
|
const heightAttr = toNullableNumber(node.attrs["height"]);
|
|
19068
19632
|
const textAlign = String(node.attrs["textAlign"] ?? "");
|
|
19069
|
-
const dragStateRef =
|
|
19633
|
+
const dragStateRef = useRef25(null);
|
|
19070
19634
|
useEffect29(() => {
|
|
19071
19635
|
const img = imgRef.current;
|
|
19072
19636
|
if (!img) return;
|
|
@@ -19161,7 +19725,7 @@ function ResizableImageNodeView(props) {
|
|
|
19161
19725
|
const showHandle = selected || isHovered || isResizing;
|
|
19162
19726
|
const wrapperAlignClass = textAlign === "center" ? "mx-auto" : textAlign === "right" ? "ml-auto" : textAlign === "justify" ? "mx-auto" : "";
|
|
19163
19727
|
const wrapperWidthClass = "w-fit";
|
|
19164
|
-
return /* @__PURE__ */
|
|
19728
|
+
return /* @__PURE__ */ jsxs68(
|
|
19165
19729
|
NodeViewWrapper,
|
|
19166
19730
|
{
|
|
19167
19731
|
as: "div",
|
|
@@ -19175,7 +19739,7 @@ function ResizableImageNodeView(props) {
|
|
|
19175
19739
|
},
|
|
19176
19740
|
contentEditable: false,
|
|
19177
19741
|
children: [
|
|
19178
|
-
/* @__PURE__ */
|
|
19742
|
+
/* @__PURE__ */ jsx76(
|
|
19179
19743
|
"img",
|
|
19180
19744
|
{
|
|
19181
19745
|
ref: imgRef,
|
|
@@ -19194,7 +19758,7 @@ function ResizableImageNodeView(props) {
|
|
|
19194
19758
|
}
|
|
19195
19759
|
}
|
|
19196
19760
|
),
|
|
19197
|
-
showHandle && /* @__PURE__ */
|
|
19761
|
+
showHandle && /* @__PURE__ */ jsx76(
|
|
19198
19762
|
"div",
|
|
19199
19763
|
{
|
|
19200
19764
|
"aria-hidden": "true",
|
|
@@ -19359,7 +19923,7 @@ function buildUEditorExtensions({
|
|
|
19359
19923
|
}
|
|
19360
19924
|
|
|
19361
19925
|
// ../../components/ui/UEditor/toolbar.tsx
|
|
19362
|
-
import React66, { useRef as
|
|
19926
|
+
import React66, { useRef as useRef27, useState as useState50 } from "react";
|
|
19363
19927
|
import { useTranslations as useTranslations4 } from "next-intl";
|
|
19364
19928
|
import {
|
|
19365
19929
|
AlignCenter,
|
|
@@ -19371,7 +19935,7 @@ import {
|
|
|
19371
19935
|
Bold as BoldIcon,
|
|
19372
19936
|
ChevronDown as ChevronDown6,
|
|
19373
19937
|
Code as CodeIcon,
|
|
19374
|
-
FileCode as
|
|
19938
|
+
FileCode as FileCode3,
|
|
19375
19939
|
Heading1 as Heading1Icon,
|
|
19376
19940
|
Heading2 as Heading2Icon,
|
|
19377
19941
|
Heading3 as Heading3Icon,
|
|
@@ -19389,21 +19953,21 @@ import {
|
|
|
19389
19953
|
Subscript as SubscriptIcon,
|
|
19390
19954
|
Superscript as SuperscriptIcon,
|
|
19391
19955
|
Table as TableIcon,
|
|
19392
|
-
Trash2,
|
|
19956
|
+
Trash2 as Trash22,
|
|
19393
19957
|
Type as Type2,
|
|
19394
19958
|
Underline as UnderlineIcon,
|
|
19395
19959
|
Undo as UndoIcon,
|
|
19396
|
-
Upload as
|
|
19960
|
+
Upload as Upload3
|
|
19397
19961
|
} from "lucide-react";
|
|
19398
19962
|
|
|
19399
19963
|
// ../../components/ui/UEditor/colors.tsx
|
|
19400
|
-
import { useMemo as
|
|
19964
|
+
import { useMemo as useMemo23 } from "react";
|
|
19401
19965
|
import { useTranslations as useTranslations2 } from "next-intl";
|
|
19402
|
-
import { X as
|
|
19403
|
-
import { jsx as
|
|
19966
|
+
import { X as X15 } from "lucide-react";
|
|
19967
|
+
import { jsx as jsx77, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
19404
19968
|
var useEditorColors = () => {
|
|
19405
19969
|
const t = useTranslations2("UEditor");
|
|
19406
|
-
const textColors =
|
|
19970
|
+
const textColors = useMemo23(
|
|
19407
19971
|
() => [
|
|
19408
19972
|
{ name: t("colors.default"), color: "inherit", cssClass: "text-foreground" },
|
|
19409
19973
|
{ name: t("colors.muted"), color: "var(--muted-foreground)", cssClass: "text-muted-foreground" },
|
|
@@ -19416,7 +19980,7 @@ var useEditorColors = () => {
|
|
|
19416
19980
|
],
|
|
19417
19981
|
[t]
|
|
19418
19982
|
);
|
|
19419
|
-
const highlightColors =
|
|
19983
|
+
const highlightColors = useMemo23(
|
|
19420
19984
|
() => [
|
|
19421
19985
|
{ name: t("colors.default"), color: "", cssClass: "" },
|
|
19422
19986
|
{ name: t("colors.muted"), color: "var(--muted)", cssClass: "bg-muted" },
|
|
@@ -19437,9 +20001,9 @@ var EditorColorPalette = ({
|
|
|
19437
20001
|
currentColor,
|
|
19438
20002
|
onSelect,
|
|
19439
20003
|
label
|
|
19440
|
-
}) => /* @__PURE__ */
|
|
19441
|
-
/* @__PURE__ */
|
|
19442
|
-
/* @__PURE__ */
|
|
20004
|
+
}) => /* @__PURE__ */ jsxs69("div", { className: "p-2", children: [
|
|
20005
|
+
/* @__PURE__ */ jsx77("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider px-2", children: label }),
|
|
20006
|
+
/* @__PURE__ */ jsx77("div", { className: "grid grid-cols-4 gap-1.5 mt-2", children: colors.map((c) => /* @__PURE__ */ jsxs69(
|
|
19443
20007
|
"button",
|
|
19444
20008
|
{
|
|
19445
20009
|
type: "button",
|
|
@@ -19452,8 +20016,8 @@ var EditorColorPalette = ({
|
|
|
19452
20016
|
style: { backgroundColor: c.color || "transparent" },
|
|
19453
20017
|
title: c.name,
|
|
19454
20018
|
children: [
|
|
19455
|
-
c.color === "" && /* @__PURE__ */
|
|
19456
|
-
c.color === "inherit" && /* @__PURE__ */
|
|
20019
|
+
c.color === "" && /* @__PURE__ */ jsx77(X15, { className: "w-4 h-4 text-muted-foreground" }),
|
|
20020
|
+
c.color === "inherit" && /* @__PURE__ */ jsx77("span", { className: "text-xs font-medium", children: "A" })
|
|
19457
20021
|
]
|
|
19458
20022
|
},
|
|
19459
20023
|
c.name
|
|
@@ -19461,10 +20025,10 @@ var EditorColorPalette = ({
|
|
|
19461
20025
|
] });
|
|
19462
20026
|
|
|
19463
20027
|
// ../../components/ui/UEditor/inputs.tsx
|
|
19464
|
-
import { useEffect as useEffect30, useRef as
|
|
20028
|
+
import { useEffect as useEffect30, useRef as useRef26, useState as useState49 } from "react";
|
|
19465
20029
|
import { useTranslations as useTranslations3 } from "next-intl";
|
|
19466
|
-
import { Check as
|
|
19467
|
-
import { jsx as
|
|
20030
|
+
import { Check as Check10, X as X16 } from "lucide-react";
|
|
20031
|
+
import { jsx as jsx78, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
19468
20032
|
function normalizeUrl(raw) {
|
|
19469
20033
|
const url = raw.trim();
|
|
19470
20034
|
if (!url) return "";
|
|
@@ -19478,8 +20042,8 @@ var LinkInput = ({
|
|
|
19478
20042
|
initialUrl = ""
|
|
19479
20043
|
}) => {
|
|
19480
20044
|
const t = useTranslations3("UEditor");
|
|
19481
|
-
const [url, setUrl] =
|
|
19482
|
-
const inputRef =
|
|
20045
|
+
const [url, setUrl] = useState49(initialUrl);
|
|
20046
|
+
const inputRef = useRef26(null);
|
|
19483
20047
|
useEffect30(() => {
|
|
19484
20048
|
inputRef.current?.focus();
|
|
19485
20049
|
inputRef.current?.select();
|
|
@@ -19489,8 +20053,8 @@ var LinkInput = ({
|
|
|
19489
20053
|
const normalized = normalizeUrl(url);
|
|
19490
20054
|
if (normalized) onSubmit(normalized);
|
|
19491
20055
|
};
|
|
19492
|
-
return /* @__PURE__ */
|
|
19493
|
-
/* @__PURE__ */
|
|
20056
|
+
return /* @__PURE__ */ jsxs70("form", { onSubmit: handleSubmit, className: "flex items-center gap-2 p-2", children: [
|
|
20057
|
+
/* @__PURE__ */ jsx78(
|
|
19494
20058
|
"input",
|
|
19495
20059
|
{
|
|
19496
20060
|
ref: inputRef,
|
|
@@ -19501,15 +20065,15 @@ var LinkInput = ({
|
|
|
19501
20065
|
className: "flex-1 px-3 py-2 text-sm bg-muted/50 border-0 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
19502
20066
|
}
|
|
19503
20067
|
),
|
|
19504
|
-
/* @__PURE__ */
|
|
19505
|
-
/* @__PURE__ */
|
|
20068
|
+
/* @__PURE__ */ jsx78("button", { type: "submit", className: "p-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors", children: /* @__PURE__ */ jsx78(Check10, { className: "w-4 h-4" }) }),
|
|
20069
|
+
/* @__PURE__ */ jsx78("button", { type: "button", onClick: onCancel, className: "p-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: /* @__PURE__ */ jsx78(X16, { className: "w-4 h-4" }) })
|
|
19506
20070
|
] });
|
|
19507
20071
|
};
|
|
19508
20072
|
var ImageInput = ({ onSubmit, onCancel }) => {
|
|
19509
20073
|
const t = useTranslations3("UEditor");
|
|
19510
|
-
const [url, setUrl] =
|
|
19511
|
-
const [alt, setAlt] =
|
|
19512
|
-
const inputRef =
|
|
20074
|
+
const [url, setUrl] = useState49("");
|
|
20075
|
+
const [alt, setAlt] = useState49("");
|
|
20076
|
+
const inputRef = useRef26(null);
|
|
19513
20077
|
useEffect30(() => {
|
|
19514
20078
|
inputRef.current?.focus();
|
|
19515
20079
|
}, []);
|
|
@@ -19519,10 +20083,10 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
19519
20083
|
onSubmit(url, alt);
|
|
19520
20084
|
}
|
|
19521
20085
|
};
|
|
19522
|
-
return /* @__PURE__ */
|
|
19523
|
-
/* @__PURE__ */
|
|
19524
|
-
/* @__PURE__ */
|
|
19525
|
-
/* @__PURE__ */
|
|
20086
|
+
return /* @__PURE__ */ jsxs70("form", { onSubmit: handleSubmit, className: "p-3 space-y-3", children: [
|
|
20087
|
+
/* @__PURE__ */ jsxs70("div", { children: [
|
|
20088
|
+
/* @__PURE__ */ jsx78("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.urlLabel") }),
|
|
20089
|
+
/* @__PURE__ */ jsx78(
|
|
19526
20090
|
"input",
|
|
19527
20091
|
{
|
|
19528
20092
|
ref: inputRef,
|
|
@@ -19534,9 +20098,9 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
19534
20098
|
}
|
|
19535
20099
|
)
|
|
19536
20100
|
] }),
|
|
19537
|
-
/* @__PURE__ */
|
|
19538
|
-
/* @__PURE__ */
|
|
19539
|
-
/* @__PURE__ */
|
|
20101
|
+
/* @__PURE__ */ jsxs70("div", { children: [
|
|
20102
|
+
/* @__PURE__ */ jsx78("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.altLabel") }),
|
|
20103
|
+
/* @__PURE__ */ jsx78(
|
|
19540
20104
|
"input",
|
|
19541
20105
|
{
|
|
19542
20106
|
type: "text",
|
|
@@ -19547,8 +20111,8 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
19547
20111
|
}
|
|
19548
20112
|
)
|
|
19549
20113
|
] }),
|
|
19550
|
-
/* @__PURE__ */
|
|
19551
|
-
/* @__PURE__ */
|
|
20114
|
+
/* @__PURE__ */ jsxs70("div", { className: "flex gap-2", children: [
|
|
20115
|
+
/* @__PURE__ */ jsx78(
|
|
19552
20116
|
"button",
|
|
19553
20117
|
{
|
|
19554
20118
|
type: "submit",
|
|
@@ -19557,13 +20121,13 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
19557
20121
|
children: t("imageInput.addBtn")
|
|
19558
20122
|
}
|
|
19559
20123
|
),
|
|
19560
|
-
/* @__PURE__ */
|
|
20124
|
+
/* @__PURE__ */ jsx78("button", { type: "button", onClick: onCancel, className: "px-4 py-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: t("imageInput.cancelBtn") })
|
|
19561
20125
|
] })
|
|
19562
20126
|
] });
|
|
19563
20127
|
};
|
|
19564
20128
|
|
|
19565
20129
|
// ../../components/ui/UEditor/toolbar.tsx
|
|
19566
|
-
import { Fragment as
|
|
20130
|
+
import { Fragment as Fragment29, jsx as jsx79, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
19567
20131
|
function fileToDataUrl2(file) {
|
|
19568
20132
|
return new Promise((resolve, reject) => {
|
|
19569
20133
|
const reader = new FileReader();
|
|
@@ -19573,7 +20137,7 @@ function fileToDataUrl2(file) {
|
|
|
19573
20137
|
});
|
|
19574
20138
|
}
|
|
19575
20139
|
var ToolbarButton = React66.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
|
|
19576
|
-
const button = /* @__PURE__ */
|
|
20140
|
+
const button = /* @__PURE__ */ jsx79(
|
|
19577
20141
|
"button",
|
|
19578
20142
|
{
|
|
19579
20143
|
ref,
|
|
@@ -19596,12 +20160,12 @@ var ToolbarButton = React66.forwardRef(({ onClick, onMouseDown, active, disabled
|
|
|
19596
20160
|
}
|
|
19597
20161
|
);
|
|
19598
20162
|
if (title) {
|
|
19599
|
-
return /* @__PURE__ */
|
|
20163
|
+
return /* @__PURE__ */ jsx79(Tooltip, { content: title, placement: "top", delay: { open: 200, close: 0 }, children: button });
|
|
19600
20164
|
}
|
|
19601
20165
|
return button;
|
|
19602
20166
|
});
|
|
19603
20167
|
ToolbarButton.displayName = "ToolbarButton";
|
|
19604
|
-
var ToolbarDivider = () => /* @__PURE__ */
|
|
20168
|
+
var ToolbarDivider = () => /* @__PURE__ */ jsx79("div", { className: "w-px h-6 bg-border/50 mx-1" });
|
|
19605
20169
|
var EditorToolbar = ({
|
|
19606
20170
|
editor,
|
|
19607
20171
|
variant,
|
|
@@ -19610,10 +20174,10 @@ var EditorToolbar = ({
|
|
|
19610
20174
|
}) => {
|
|
19611
20175
|
const t = useTranslations4("UEditor");
|
|
19612
20176
|
const { textColors, highlightColors } = useEditorColors();
|
|
19613
|
-
const [showImageInput, setShowImageInput] =
|
|
19614
|
-
const fileInputRef =
|
|
19615
|
-
const [isUploadingImage, setIsUploadingImage] =
|
|
19616
|
-
const [imageUploadError, setImageUploadError] =
|
|
20177
|
+
const [showImageInput, setShowImageInput] = useState50(false);
|
|
20178
|
+
const fileInputRef = useRef27(null);
|
|
20179
|
+
const [isUploadingImage, setIsUploadingImage] = useState50(false);
|
|
20180
|
+
const [imageUploadError, setImageUploadError] = useState50(null);
|
|
19617
20181
|
const insertImageFiles = async (files) => {
|
|
19618
20182
|
if (files.length === 0) return;
|
|
19619
20183
|
setIsUploadingImage(true);
|
|
@@ -19632,31 +20196,31 @@ var EditorToolbar = ({
|
|
|
19632
20196
|
setIsUploadingImage(false);
|
|
19633
20197
|
};
|
|
19634
20198
|
if (variant === "minimal") {
|
|
19635
|
-
return /* @__PURE__ */
|
|
19636
|
-
/* @__PURE__ */
|
|
19637
|
-
/* @__PURE__ */
|
|
19638
|
-
/* @__PURE__ */
|
|
20199
|
+
return /* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-1 p-2 border-b bg-muted/30", children: [
|
|
20200
|
+
/* @__PURE__ */ jsx79(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx79(BoldIcon, { className: "w-4 h-4" }) }),
|
|
20201
|
+
/* @__PURE__ */ jsx79(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx79(ItalicIcon, { className: "w-4 h-4" }) }),
|
|
20202
|
+
/* @__PURE__ */ jsx79(
|
|
19639
20203
|
ToolbarButton,
|
|
19640
20204
|
{
|
|
19641
20205
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
19642
20206
|
active: editor.isActive("bulletList"),
|
|
19643
20207
|
title: t("toolbar.bulletList"),
|
|
19644
|
-
children: /* @__PURE__ */
|
|
20208
|
+
children: /* @__PURE__ */ jsx79(ListIcon, { className: "w-4 h-4" })
|
|
19645
20209
|
}
|
|
19646
20210
|
)
|
|
19647
20211
|
] });
|
|
19648
20212
|
}
|
|
19649
|
-
return /* @__PURE__ */
|
|
19650
|
-
/* @__PURE__ */
|
|
20213
|
+
return /* @__PURE__ */ jsxs71("div", { className: "flex flex-wrap items-center gap-1 p-2 border-b bg-linear-to-r from-muted/30 to-transparent", children: [
|
|
20214
|
+
/* @__PURE__ */ jsxs71(
|
|
19651
20215
|
DropdownMenu,
|
|
19652
20216
|
{
|
|
19653
|
-
trigger: /* @__PURE__ */
|
|
20217
|
+
trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
|
|
19654
20218
|
}, title: t("toolbar.textStyle"), className: "px-2 w-auto gap-1", children: [
|
|
19655
|
-
/* @__PURE__ */
|
|
19656
|
-
/* @__PURE__ */
|
|
20219
|
+
/* @__PURE__ */ jsx79(Type2, { className: "w-4 h-4" }),
|
|
20220
|
+
/* @__PURE__ */ jsx79(ChevronDown6, { className: "w-3 h-3" })
|
|
19657
20221
|
] }),
|
|
19658
20222
|
children: [
|
|
19659
|
-
/* @__PURE__ */
|
|
20223
|
+
/* @__PURE__ */ jsx79(
|
|
19660
20224
|
DropdownMenuItem,
|
|
19661
20225
|
{
|
|
19662
20226
|
icon: Type2,
|
|
@@ -19665,7 +20229,7 @@ var EditorToolbar = ({
|
|
|
19665
20229
|
active: editor.isActive("paragraph")
|
|
19666
20230
|
}
|
|
19667
20231
|
),
|
|
19668
|
-
/* @__PURE__ */
|
|
20232
|
+
/* @__PURE__ */ jsx79(
|
|
19669
20233
|
DropdownMenuItem,
|
|
19670
20234
|
{
|
|
19671
20235
|
icon: Heading1Icon,
|
|
@@ -19675,7 +20239,7 @@ var EditorToolbar = ({
|
|
|
19675
20239
|
shortcut: "Ctrl+Alt+1"
|
|
19676
20240
|
}
|
|
19677
20241
|
),
|
|
19678
|
-
/* @__PURE__ */
|
|
20242
|
+
/* @__PURE__ */ jsx79(
|
|
19679
20243
|
DropdownMenuItem,
|
|
19680
20244
|
{
|
|
19681
20245
|
icon: Heading2Icon,
|
|
@@ -19685,7 +20249,7 @@ var EditorToolbar = ({
|
|
|
19685
20249
|
shortcut: "Ctrl+Alt+2"
|
|
19686
20250
|
}
|
|
19687
20251
|
),
|
|
19688
|
-
/* @__PURE__ */
|
|
20252
|
+
/* @__PURE__ */ jsx79(
|
|
19689
20253
|
DropdownMenuItem,
|
|
19690
20254
|
{
|
|
19691
20255
|
icon: Heading3Icon,
|
|
@@ -19698,30 +20262,30 @@ var EditorToolbar = ({
|
|
|
19698
20262
|
]
|
|
19699
20263
|
}
|
|
19700
20264
|
),
|
|
19701
|
-
/* @__PURE__ */
|
|
19702
|
-
/* @__PURE__ */
|
|
19703
|
-
/* @__PURE__ */
|
|
19704
|
-
/* @__PURE__ */
|
|
20265
|
+
/* @__PURE__ */ jsx79(ToolbarDivider, {}),
|
|
20266
|
+
/* @__PURE__ */ jsx79(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx79(BoldIcon, { className: "w-4 h-4" }) }),
|
|
20267
|
+
/* @__PURE__ */ jsx79(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx79(ItalicIcon, { className: "w-4 h-4" }) }),
|
|
20268
|
+
/* @__PURE__ */ jsx79(
|
|
19705
20269
|
ToolbarButton,
|
|
19706
20270
|
{
|
|
19707
20271
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
19708
20272
|
active: editor.isActive("underline"),
|
|
19709
20273
|
title: t("toolbar.underline"),
|
|
19710
|
-
children: /* @__PURE__ */
|
|
20274
|
+
children: /* @__PURE__ */ jsx79(UnderlineIcon, { className: "w-4 h-4" })
|
|
19711
20275
|
}
|
|
19712
20276
|
),
|
|
19713
|
-
/* @__PURE__ */
|
|
19714
|
-
/* @__PURE__ */
|
|
19715
|
-
/* @__PURE__ */
|
|
19716
|
-
/* @__PURE__ */
|
|
20277
|
+
/* @__PURE__ */ jsx79(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx79(StrikethroughIcon, { className: "w-4 h-4" }) }),
|
|
20278
|
+
/* @__PURE__ */ jsx79(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx79(CodeIcon, { className: "w-4 h-4" }) }),
|
|
20279
|
+
/* @__PURE__ */ jsx79(ToolbarDivider, {}),
|
|
20280
|
+
/* @__PURE__ */ jsx79(
|
|
19717
20281
|
DropdownMenu,
|
|
19718
20282
|
{
|
|
19719
|
-
trigger: /* @__PURE__ */
|
|
20283
|
+
trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
|
|
19720
20284
|
}, title: t("colors.textColor"), children: [
|
|
19721
|
-
/* @__PURE__ */
|
|
19722
|
-
/* @__PURE__ */
|
|
20285
|
+
/* @__PURE__ */ jsx79(Palette2, { className: "w-4 h-4" }),
|
|
20286
|
+
/* @__PURE__ */ jsx79(ChevronDown6, { className: "w-3 h-3" })
|
|
19723
20287
|
] }),
|
|
19724
|
-
children: /* @__PURE__ */
|
|
20288
|
+
children: /* @__PURE__ */ jsx79(
|
|
19725
20289
|
EditorColorPalette,
|
|
19726
20290
|
{
|
|
19727
20291
|
colors: textColors,
|
|
@@ -19738,15 +20302,15 @@ var EditorToolbar = ({
|
|
|
19738
20302
|
)
|
|
19739
20303
|
}
|
|
19740
20304
|
),
|
|
19741
|
-
/* @__PURE__ */
|
|
20305
|
+
/* @__PURE__ */ jsx79(
|
|
19742
20306
|
DropdownMenu,
|
|
19743
20307
|
{
|
|
19744
|
-
trigger: /* @__PURE__ */
|
|
20308
|
+
trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
|
|
19745
20309
|
}, active: editor.isActive("highlight"), title: t("colors.highlight"), children: [
|
|
19746
|
-
/* @__PURE__ */
|
|
19747
|
-
/* @__PURE__ */
|
|
20310
|
+
/* @__PURE__ */ jsx79(Highlighter, { className: "w-4 h-4" }),
|
|
20311
|
+
/* @__PURE__ */ jsx79(ChevronDown6, { className: "w-3 h-3" })
|
|
19748
20312
|
] }),
|
|
19749
|
-
children: /* @__PURE__ */
|
|
20313
|
+
children: /* @__PURE__ */ jsx79(
|
|
19750
20314
|
EditorColorPalette,
|
|
19751
20315
|
{
|
|
19752
20316
|
colors: highlightColors,
|
|
@@ -19763,17 +20327,17 @@ var EditorToolbar = ({
|
|
|
19763
20327
|
)
|
|
19764
20328
|
}
|
|
19765
20329
|
),
|
|
19766
|
-
/* @__PURE__ */
|
|
19767
|
-
/* @__PURE__ */
|
|
20330
|
+
/* @__PURE__ */ jsx79(ToolbarDivider, {}),
|
|
20331
|
+
/* @__PURE__ */ jsxs71(
|
|
19768
20332
|
DropdownMenu,
|
|
19769
20333
|
{
|
|
19770
|
-
trigger: /* @__PURE__ */
|
|
20334
|
+
trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
|
|
19771
20335
|
}, title: t("toolbar.alignment"), children: [
|
|
19772
|
-
/* @__PURE__ */
|
|
19773
|
-
/* @__PURE__ */
|
|
20336
|
+
/* @__PURE__ */ jsx79(AlignLeft, { className: "w-4 h-4" }),
|
|
20337
|
+
/* @__PURE__ */ jsx79(ChevronDown6, { className: "w-3 h-3" })
|
|
19774
20338
|
] }),
|
|
19775
20339
|
children: [
|
|
19776
|
-
/* @__PURE__ */
|
|
20340
|
+
/* @__PURE__ */ jsx79(
|
|
19777
20341
|
DropdownMenuItem,
|
|
19778
20342
|
{
|
|
19779
20343
|
icon: AlignLeft,
|
|
@@ -19782,7 +20346,7 @@ var EditorToolbar = ({
|
|
|
19782
20346
|
active: editor.isActive({ textAlign: "left" })
|
|
19783
20347
|
}
|
|
19784
20348
|
),
|
|
19785
|
-
/* @__PURE__ */
|
|
20349
|
+
/* @__PURE__ */ jsx79(
|
|
19786
20350
|
DropdownMenuItem,
|
|
19787
20351
|
{
|
|
19788
20352
|
icon: AlignCenter,
|
|
@@ -19791,7 +20355,7 @@ var EditorToolbar = ({
|
|
|
19791
20355
|
active: editor.isActive({ textAlign: "center" })
|
|
19792
20356
|
}
|
|
19793
20357
|
),
|
|
19794
|
-
/* @__PURE__ */
|
|
20358
|
+
/* @__PURE__ */ jsx79(
|
|
19795
20359
|
DropdownMenuItem,
|
|
19796
20360
|
{
|
|
19797
20361
|
icon: AlignRight,
|
|
@@ -19800,7 +20364,7 @@ var EditorToolbar = ({
|
|
|
19800
20364
|
active: editor.isActive({ textAlign: "right" })
|
|
19801
20365
|
}
|
|
19802
20366
|
),
|
|
19803
|
-
/* @__PURE__ */
|
|
20367
|
+
/* @__PURE__ */ jsx79(
|
|
19804
20368
|
DropdownMenuItem,
|
|
19805
20369
|
{
|
|
19806
20370
|
icon: AlignJustify,
|
|
@@ -19812,17 +20376,17 @@ var EditorToolbar = ({
|
|
|
19812
20376
|
]
|
|
19813
20377
|
}
|
|
19814
20378
|
),
|
|
19815
|
-
/* @__PURE__ */
|
|
19816
|
-
/* @__PURE__ */
|
|
20379
|
+
/* @__PURE__ */ jsx79(ToolbarDivider, {}),
|
|
20380
|
+
/* @__PURE__ */ jsxs71(
|
|
19817
20381
|
DropdownMenu,
|
|
19818
20382
|
{
|
|
19819
|
-
trigger: /* @__PURE__ */
|
|
20383
|
+
trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
|
|
19820
20384
|
}, title: t("toolbar.bulletList"), children: [
|
|
19821
|
-
/* @__PURE__ */
|
|
19822
|
-
/* @__PURE__ */
|
|
20385
|
+
/* @__PURE__ */ jsx79(ListIcon, { className: "w-4 h-4" }),
|
|
20386
|
+
/* @__PURE__ */ jsx79(ChevronDown6, { className: "w-3 h-3" })
|
|
19823
20387
|
] }),
|
|
19824
20388
|
children: [
|
|
19825
|
-
/* @__PURE__ */
|
|
20389
|
+
/* @__PURE__ */ jsx79(
|
|
19826
20390
|
DropdownMenuItem,
|
|
19827
20391
|
{
|
|
19828
20392
|
icon: ListIcon,
|
|
@@ -19832,7 +20396,7 @@ var EditorToolbar = ({
|
|
|
19832
20396
|
shortcut: "Ctrl+Shift+8"
|
|
19833
20397
|
}
|
|
19834
20398
|
),
|
|
19835
|
-
/* @__PURE__ */
|
|
20399
|
+
/* @__PURE__ */ jsx79(
|
|
19836
20400
|
DropdownMenuItem,
|
|
19837
20401
|
{
|
|
19838
20402
|
icon: ListOrderedIcon,
|
|
@@ -19842,7 +20406,7 @@ var EditorToolbar = ({
|
|
|
19842
20406
|
shortcut: "Ctrl+Shift+7"
|
|
19843
20407
|
}
|
|
19844
20408
|
),
|
|
19845
|
-
/* @__PURE__ */
|
|
20409
|
+
/* @__PURE__ */ jsx79(
|
|
19846
20410
|
DropdownMenuItem,
|
|
19847
20411
|
{
|
|
19848
20412
|
icon: ListTodo2,
|
|
@@ -19855,16 +20419,16 @@ var EditorToolbar = ({
|
|
|
19855
20419
|
]
|
|
19856
20420
|
}
|
|
19857
20421
|
),
|
|
19858
|
-
/* @__PURE__ */
|
|
20422
|
+
/* @__PURE__ */ jsxs71(
|
|
19859
20423
|
DropdownMenu,
|
|
19860
20424
|
{
|
|
19861
|
-
trigger: /* @__PURE__ */
|
|
20425
|
+
trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
|
|
19862
20426
|
}, title: t("toolbar.quote"), children: [
|
|
19863
|
-
/* @__PURE__ */
|
|
19864
|
-
/* @__PURE__ */
|
|
20427
|
+
/* @__PURE__ */ jsx79(QuoteIcon, { className: "w-4 h-4" }),
|
|
20428
|
+
/* @__PURE__ */ jsx79(ChevronDown6, { className: "w-3 h-3" })
|
|
19865
20429
|
] }),
|
|
19866
20430
|
children: [
|
|
19867
|
-
/* @__PURE__ */
|
|
20431
|
+
/* @__PURE__ */ jsx79(
|
|
19868
20432
|
DropdownMenuItem,
|
|
19869
20433
|
{
|
|
19870
20434
|
icon: QuoteIcon,
|
|
@@ -19874,10 +20438,10 @@ var EditorToolbar = ({
|
|
|
19874
20438
|
shortcut: "Ctrl+Shift+B"
|
|
19875
20439
|
}
|
|
19876
20440
|
),
|
|
19877
|
-
/* @__PURE__ */
|
|
20441
|
+
/* @__PURE__ */ jsx79(
|
|
19878
20442
|
DropdownMenuItem,
|
|
19879
20443
|
{
|
|
19880
|
-
icon:
|
|
20444
|
+
icon: FileCode3,
|
|
19881
20445
|
label: t("toolbar.codeBlock"),
|
|
19882
20446
|
onClick: () => editor.chain().focus().toggleCodeBlock().run(),
|
|
19883
20447
|
active: editor.isActive("codeBlock"),
|
|
@@ -19887,15 +20451,15 @@ var EditorToolbar = ({
|
|
|
19887
20451
|
]
|
|
19888
20452
|
}
|
|
19889
20453
|
),
|
|
19890
|
-
/* @__PURE__ */
|
|
20454
|
+
/* @__PURE__ */ jsx79(
|
|
19891
20455
|
DropdownMenu,
|
|
19892
20456
|
{
|
|
19893
|
-
trigger: /* @__PURE__ */
|
|
20457
|
+
trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
|
|
19894
20458
|
}, title: t("toolbar.image"), children: [
|
|
19895
|
-
/* @__PURE__ */
|
|
19896
|
-
/* @__PURE__ */
|
|
20459
|
+
/* @__PURE__ */ jsx79(ImageIcon2, { className: "w-4 h-4" }),
|
|
20460
|
+
/* @__PURE__ */ jsx79(ChevronDown6, { className: "w-3 h-3" })
|
|
19897
20461
|
] }),
|
|
19898
|
-
children: showImageInput ? /* @__PURE__ */
|
|
20462
|
+
children: showImageInput ? /* @__PURE__ */ jsx79(
|
|
19899
20463
|
ImageInput,
|
|
19900
20464
|
{
|
|
19901
20465
|
onSubmit: (url, alt) => {
|
|
@@ -19904,19 +20468,19 @@ var EditorToolbar = ({
|
|
|
19904
20468
|
},
|
|
19905
20469
|
onCancel: () => setShowImageInput(false)
|
|
19906
20470
|
}
|
|
19907
|
-
) : /* @__PURE__ */
|
|
19908
|
-
/* @__PURE__ */
|
|
19909
|
-
/* @__PURE__ */
|
|
20471
|
+
) : /* @__PURE__ */ jsxs71(Fragment29, { children: [
|
|
20472
|
+
/* @__PURE__ */ jsx79(DropdownMenuItem, { icon: LinkIcon, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true) }),
|
|
20473
|
+
/* @__PURE__ */ jsx79(
|
|
19910
20474
|
DropdownMenuItem,
|
|
19911
20475
|
{
|
|
19912
|
-
icon:
|
|
20476
|
+
icon: Upload3,
|
|
19913
20477
|
label: isUploadingImage ? t("imageInput.uploading") : t("imageInput.uploadTab"),
|
|
19914
20478
|
disabled: isUploadingImage,
|
|
19915
20479
|
onClick: () => fileInputRef.current?.click()
|
|
19916
20480
|
}
|
|
19917
20481
|
),
|
|
19918
|
-
imageUploadError && /* @__PURE__ */
|
|
19919
|
-
/* @__PURE__ */
|
|
20482
|
+
imageUploadError && /* @__PURE__ */ jsx79(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }),
|
|
20483
|
+
/* @__PURE__ */ jsx79(
|
|
19920
20484
|
"input",
|
|
19921
20485
|
{
|
|
19922
20486
|
ref: fileInputRef,
|
|
@@ -19934,16 +20498,16 @@ var EditorToolbar = ({
|
|
|
19934
20498
|
] })
|
|
19935
20499
|
}
|
|
19936
20500
|
),
|
|
19937
|
-
/* @__PURE__ */
|
|
20501
|
+
/* @__PURE__ */ jsxs71(
|
|
19938
20502
|
DropdownMenu,
|
|
19939
20503
|
{
|
|
19940
|
-
trigger: /* @__PURE__ */
|
|
20504
|
+
trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
|
|
19941
20505
|
}, title: t("toolbar.table"), children: [
|
|
19942
|
-
/* @__PURE__ */
|
|
19943
|
-
/* @__PURE__ */
|
|
20506
|
+
/* @__PURE__ */ jsx79(TableIcon, { className: "w-4 h-4" }),
|
|
20507
|
+
/* @__PURE__ */ jsx79(ChevronDown6, { className: "w-3 h-3" })
|
|
19944
20508
|
] }),
|
|
19945
20509
|
children: [
|
|
19946
|
-
/* @__PURE__ */
|
|
20510
|
+
/* @__PURE__ */ jsx79(
|
|
19947
20511
|
DropdownMenuItem,
|
|
19948
20512
|
{
|
|
19949
20513
|
icon: TableIcon,
|
|
@@ -19951,8 +20515,8 @@ var EditorToolbar = ({
|
|
|
19951
20515
|
onClick: () => editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run()
|
|
19952
20516
|
}
|
|
19953
20517
|
),
|
|
19954
|
-
/* @__PURE__ */
|
|
19955
|
-
/* @__PURE__ */
|
|
20518
|
+
/* @__PURE__ */ jsx79("div", { className: "my-1 border-t" }),
|
|
20519
|
+
/* @__PURE__ */ jsx79(
|
|
19956
20520
|
DropdownMenuItem,
|
|
19957
20521
|
{
|
|
19958
20522
|
icon: ArrowDown,
|
|
@@ -19961,7 +20525,7 @@ var EditorToolbar = ({
|
|
|
19961
20525
|
disabled: !editor.can().addColumnBefore()
|
|
19962
20526
|
}
|
|
19963
20527
|
),
|
|
19964
|
-
/* @__PURE__ */
|
|
20528
|
+
/* @__PURE__ */ jsx79(
|
|
19965
20529
|
DropdownMenuItem,
|
|
19966
20530
|
{
|
|
19967
20531
|
icon: ArrowDown,
|
|
@@ -19970,7 +20534,7 @@ var EditorToolbar = ({
|
|
|
19970
20534
|
disabled: !editor.can().addColumnAfter()
|
|
19971
20535
|
}
|
|
19972
20536
|
),
|
|
19973
|
-
/* @__PURE__ */
|
|
20537
|
+
/* @__PURE__ */ jsx79(
|
|
19974
20538
|
DropdownMenuItem,
|
|
19975
20539
|
{
|
|
19976
20540
|
icon: ArrowRight,
|
|
@@ -19979,7 +20543,7 @@ var EditorToolbar = ({
|
|
|
19979
20543
|
disabled: !editor.can().addRowBefore()
|
|
19980
20544
|
}
|
|
19981
20545
|
),
|
|
19982
|
-
/* @__PURE__ */
|
|
20546
|
+
/* @__PURE__ */ jsx79(
|
|
19983
20547
|
DropdownMenuItem,
|
|
19984
20548
|
{
|
|
19985
20549
|
icon: ArrowRight,
|
|
@@ -19988,29 +20552,29 @@ var EditorToolbar = ({
|
|
|
19988
20552
|
disabled: !editor.can().addRowAfter()
|
|
19989
20553
|
}
|
|
19990
20554
|
),
|
|
19991
|
-
/* @__PURE__ */
|
|
19992
|
-
/* @__PURE__ */
|
|
20555
|
+
/* @__PURE__ */ jsx79("div", { className: "my-1 border-t" }),
|
|
20556
|
+
/* @__PURE__ */ jsx79(
|
|
19993
20557
|
DropdownMenuItem,
|
|
19994
20558
|
{
|
|
19995
|
-
icon:
|
|
20559
|
+
icon: Trash22,
|
|
19996
20560
|
label: t("tableMenu.deleteColumn"),
|
|
19997
20561
|
onClick: () => editor.chain().focus().deleteColumn().run(),
|
|
19998
20562
|
disabled: !editor.can().deleteColumn()
|
|
19999
20563
|
}
|
|
20000
20564
|
),
|
|
20001
|
-
/* @__PURE__ */
|
|
20565
|
+
/* @__PURE__ */ jsx79(
|
|
20002
20566
|
DropdownMenuItem,
|
|
20003
20567
|
{
|
|
20004
|
-
icon:
|
|
20568
|
+
icon: Trash22,
|
|
20005
20569
|
label: t("tableMenu.deleteRow"),
|
|
20006
20570
|
onClick: () => editor.chain().focus().deleteRow().run(),
|
|
20007
20571
|
disabled: !editor.can().deleteRow()
|
|
20008
20572
|
}
|
|
20009
20573
|
),
|
|
20010
|
-
/* @__PURE__ */
|
|
20574
|
+
/* @__PURE__ */ jsx79(
|
|
20011
20575
|
DropdownMenuItem,
|
|
20012
20576
|
{
|
|
20013
|
-
icon:
|
|
20577
|
+
icon: Trash22,
|
|
20014
20578
|
label: t("tableMenu.deleteTable"),
|
|
20015
20579
|
onClick: () => editor.chain().focus().deleteTable().run(),
|
|
20016
20580
|
disabled: !editor.can().deleteTable()
|
|
@@ -20019,39 +20583,39 @@ var EditorToolbar = ({
|
|
|
20019
20583
|
]
|
|
20020
20584
|
}
|
|
20021
20585
|
),
|
|
20022
|
-
/* @__PURE__ */
|
|
20023
|
-
/* @__PURE__ */
|
|
20586
|
+
/* @__PURE__ */ jsx79(ToolbarDivider, {}),
|
|
20587
|
+
/* @__PURE__ */ jsx79(
|
|
20024
20588
|
ToolbarButton,
|
|
20025
20589
|
{
|
|
20026
20590
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
20027
20591
|
active: editor.isActive("subscript"),
|
|
20028
20592
|
title: t("toolbar.subscript"),
|
|
20029
|
-
children: /* @__PURE__ */
|
|
20593
|
+
children: /* @__PURE__ */ jsx79(SubscriptIcon, { className: "w-4 h-4" })
|
|
20030
20594
|
}
|
|
20031
20595
|
),
|
|
20032
|
-
/* @__PURE__ */
|
|
20596
|
+
/* @__PURE__ */ jsx79(
|
|
20033
20597
|
ToolbarButton,
|
|
20034
20598
|
{
|
|
20035
20599
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
20036
20600
|
active: editor.isActive("superscript"),
|
|
20037
20601
|
title: t("toolbar.superscript"),
|
|
20038
|
-
children: /* @__PURE__ */
|
|
20602
|
+
children: /* @__PURE__ */ jsx79(SuperscriptIcon, { className: "w-4 h-4" })
|
|
20039
20603
|
}
|
|
20040
20604
|
),
|
|
20041
|
-
/* @__PURE__ */
|
|
20042
|
-
/* @__PURE__ */
|
|
20043
|
-
/* @__PURE__ */
|
|
20605
|
+
/* @__PURE__ */ jsx79(ToolbarDivider, {}),
|
|
20606
|
+
/* @__PURE__ */ jsx79(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ jsx79(UndoIcon, { className: "w-4 h-4" }) }),
|
|
20607
|
+
/* @__PURE__ */ jsx79(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ jsx79(RedoIcon, { className: "w-4 h-4" }) })
|
|
20044
20608
|
] });
|
|
20045
20609
|
};
|
|
20046
20610
|
|
|
20047
20611
|
// ../../components/ui/UEditor/menus.tsx
|
|
20048
|
-
import { useCallback as
|
|
20612
|
+
import { useCallback as useCallback16, useEffect as useEffect31, useMemo as useMemo24, useRef as useRef28, useState as useState51 } from "react";
|
|
20049
20613
|
import { createPortal as createPortal9 } from "react-dom";
|
|
20050
20614
|
import { useTranslations as useTranslations5 } from "next-intl";
|
|
20051
20615
|
import {
|
|
20052
20616
|
Bold as BoldIcon2,
|
|
20053
20617
|
Code as CodeIcon2,
|
|
20054
|
-
FileCode as
|
|
20618
|
+
FileCode as FileCode4,
|
|
20055
20619
|
Heading1 as Heading1Icon2,
|
|
20056
20620
|
Heading2 as Heading2Icon2,
|
|
20057
20621
|
Heading3 as Heading3Icon2,
|
|
@@ -20071,12 +20635,12 @@ import {
|
|
|
20071
20635
|
Underline as UnderlineIcon2,
|
|
20072
20636
|
Strikethrough as StrikethroughIcon2
|
|
20073
20637
|
} from "lucide-react";
|
|
20074
|
-
import { jsx as
|
|
20638
|
+
import { jsx as jsx80, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
20075
20639
|
var SlashCommandMenu = ({ editor, onClose, filterText = "" }) => {
|
|
20076
20640
|
const t = useTranslations5("UEditor");
|
|
20077
|
-
const [selectedIndex, setSelectedIndex] =
|
|
20078
|
-
const menuRef =
|
|
20079
|
-
const allCommands =
|
|
20641
|
+
const [selectedIndex, setSelectedIndex] = useState51(0);
|
|
20642
|
+
const menuRef = useRef28(null);
|
|
20643
|
+
const allCommands = useMemo24(
|
|
20080
20644
|
() => [
|
|
20081
20645
|
{
|
|
20082
20646
|
icon: Type3,
|
|
@@ -20127,7 +20691,7 @@ var SlashCommandMenu = ({ editor, onClose, filterText = "" }) => {
|
|
|
20127
20691
|
action: () => editor.chain().focus().toggleBlockquote().run()
|
|
20128
20692
|
},
|
|
20129
20693
|
{
|
|
20130
|
-
icon:
|
|
20694
|
+
icon: FileCode4,
|
|
20131
20695
|
label: t("slashCommand.codeBlock"),
|
|
20132
20696
|
description: t("slashCommand.codeBlockDesc"),
|
|
20133
20697
|
action: () => editor.chain().focus().toggleCodeBlock().run()
|
|
@@ -20147,7 +20711,7 @@ var SlashCommandMenu = ({ editor, onClose, filterText = "" }) => {
|
|
|
20147
20711
|
],
|
|
20148
20712
|
[editor, t]
|
|
20149
20713
|
);
|
|
20150
|
-
const commands =
|
|
20714
|
+
const commands = useMemo24(() => {
|
|
20151
20715
|
if (!filterText) return allCommands;
|
|
20152
20716
|
const lowerFilter = filterText.toLowerCase();
|
|
20153
20717
|
return allCommands.filter((cmd) => cmd.label.toLowerCase().includes(lowerFilter) || cmd.description.toLowerCase().includes(lowerFilter));
|
|
@@ -20159,7 +20723,7 @@ var SlashCommandMenu = ({ editor, onClose, filterText = "" }) => {
|
|
|
20159
20723
|
const selectedElement = menuRef.current?.querySelector(`[data-index="${selectedIndex}"]`);
|
|
20160
20724
|
selectedElement?.scrollIntoView({ block: "nearest" });
|
|
20161
20725
|
}, [selectedIndex]);
|
|
20162
|
-
const selectCommand =
|
|
20726
|
+
const selectCommand = useCallback16(
|
|
20163
20727
|
(index) => {
|
|
20164
20728
|
const command = commands[index];
|
|
20165
20729
|
if (command) {
|
|
@@ -20190,11 +20754,11 @@ var SlashCommandMenu = ({ editor, onClose, filterText = "" }) => {
|
|
|
20190
20754
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
20191
20755
|
}, [commands, selectedIndex, selectCommand, onClose]);
|
|
20192
20756
|
if (commands.length === 0) {
|
|
20193
|
-
return /* @__PURE__ */
|
|
20757
|
+
return /* @__PURE__ */ jsx80("div", { className: "w-72 p-4 text-center text-muted-foreground text-sm", children: t("slashCommand.noResults") });
|
|
20194
20758
|
}
|
|
20195
|
-
return /* @__PURE__ */
|
|
20196
|
-
/* @__PURE__ */
|
|
20197
|
-
/* @__PURE__ */
|
|
20759
|
+
return /* @__PURE__ */ jsxs72("div", { ref: menuRef, className: "w-72 max-h-80 overflow-y-auto", children: [
|
|
20760
|
+
/* @__PURE__ */ jsx80("div", { className: "px-3 py-2 border-b", children: /* @__PURE__ */ jsx80("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("slashCommand.basicBlocks") }) }),
|
|
20761
|
+
/* @__PURE__ */ jsx80("div", { className: "p-1", children: commands.map((cmd, index) => /* @__PURE__ */ jsxs72(
|
|
20198
20762
|
"button",
|
|
20199
20763
|
{
|
|
20200
20764
|
type: "button",
|
|
@@ -20207,19 +20771,19 @@ var SlashCommandMenu = ({ editor, onClose, filterText = "" }) => {
|
|
|
20207
20771
|
selectedIndex === index ? "bg-accent" : "hover:bg-accent/50"
|
|
20208
20772
|
),
|
|
20209
20773
|
children: [
|
|
20210
|
-
/* @__PURE__ */
|
|
20774
|
+
/* @__PURE__ */ jsx80(
|
|
20211
20775
|
"div",
|
|
20212
20776
|
{
|
|
20213
20777
|
className: cn(
|
|
20214
20778
|
"flex items-center justify-center w-10 h-10 rounded-lg mr-3 transition-colors",
|
|
20215
20779
|
selectedIndex === index ? "bg-primary/10" : "bg-muted/50 group-hover:bg-muted"
|
|
20216
20780
|
),
|
|
20217
|
-
children: /* @__PURE__ */
|
|
20781
|
+
children: /* @__PURE__ */ jsx80(cmd.icon, { className: cn("w-5 h-5", selectedIndex === index ? "text-primary" : "text-muted-foreground") })
|
|
20218
20782
|
}
|
|
20219
20783
|
),
|
|
20220
|
-
/* @__PURE__ */
|
|
20221
|
-
/* @__PURE__ */
|
|
20222
|
-
/* @__PURE__ */
|
|
20784
|
+
/* @__PURE__ */ jsxs72("div", { className: "text-left", children: [
|
|
20785
|
+
/* @__PURE__ */ jsx80("div", { className: cn("text-sm font-medium", selectedIndex === index && "text-primary"), children: cmd.label }),
|
|
20786
|
+
/* @__PURE__ */ jsx80("div", { className: "text-xs text-muted-foreground", children: cmd.description })
|
|
20223
20787
|
] })
|
|
20224
20788
|
]
|
|
20225
20789
|
},
|
|
@@ -20229,19 +20793,19 @@ var SlashCommandMenu = ({ editor, onClose, filterText = "" }) => {
|
|
|
20229
20793
|
};
|
|
20230
20794
|
var FloatingMenuContent = ({ editor }) => {
|
|
20231
20795
|
const t = useTranslations5("UEditor");
|
|
20232
|
-
const [showCommands, setShowCommands] =
|
|
20796
|
+
const [showCommands, setShowCommands] = useState51(false);
|
|
20233
20797
|
if (showCommands) {
|
|
20234
|
-
return /* @__PURE__ */
|
|
20798
|
+
return /* @__PURE__ */ jsx80(SlashCommandMenu, { editor, onClose: () => setShowCommands(false) });
|
|
20235
20799
|
}
|
|
20236
|
-
return /* @__PURE__ */
|
|
20800
|
+
return /* @__PURE__ */ jsxs72(
|
|
20237
20801
|
"button",
|
|
20238
20802
|
{
|
|
20239
20803
|
type: "button",
|
|
20240
20804
|
onClick: () => setShowCommands(true),
|
|
20241
20805
|
className: "flex items-center gap-1 px-2 py-1.5 rounded-lg hover:bg-accent transition-all group",
|
|
20242
20806
|
children: [
|
|
20243
|
-
/* @__PURE__ */
|
|
20244
|
-
/* @__PURE__ */
|
|
20807
|
+
/* @__PURE__ */ jsx80(Plus3, { className: "w-4 h-4 text-muted-foreground group-hover:text-foreground" }),
|
|
20808
|
+
/* @__PURE__ */ jsx80("span", { className: "text-sm text-muted-foreground group-hover:text-foreground", children: t("floatingMenu.addBlock") })
|
|
20245
20809
|
]
|
|
20246
20810
|
}
|
|
20247
20811
|
);
|
|
@@ -20252,8 +20816,8 @@ var BubbleMenuContent = ({
|
|
|
20252
20816
|
}) => {
|
|
20253
20817
|
const t = useTranslations5("UEditor");
|
|
20254
20818
|
const { textColors, highlightColors } = useEditorColors();
|
|
20255
|
-
const [showLinkInput, setShowLinkInput] =
|
|
20256
|
-
const [showEditorColorPalette, setShowEditorColorPalette] =
|
|
20819
|
+
const [showLinkInput, setShowLinkInput] = useState51(false);
|
|
20820
|
+
const [showEditorColorPalette, setShowEditorColorPalette] = useState51(false);
|
|
20257
20821
|
useEffect31(() => {
|
|
20258
20822
|
onKeepOpenChange?.(showLinkInput);
|
|
20259
20823
|
}, [onKeepOpenChange, showLinkInput]);
|
|
@@ -20268,7 +20832,7 @@ var BubbleMenuContent = ({
|
|
|
20268
20832
|
};
|
|
20269
20833
|
}, [editor, showLinkInput]);
|
|
20270
20834
|
if (showLinkInput) {
|
|
20271
|
-
return /* @__PURE__ */
|
|
20835
|
+
return /* @__PURE__ */ jsx80(
|
|
20272
20836
|
LinkInput,
|
|
20273
20837
|
{
|
|
20274
20838
|
initialUrl: editor.getAttributes("link").href || "",
|
|
@@ -20285,8 +20849,8 @@ var BubbleMenuContent = ({
|
|
|
20285
20849
|
);
|
|
20286
20850
|
}
|
|
20287
20851
|
if (showEditorColorPalette) {
|
|
20288
|
-
return /* @__PURE__ */
|
|
20289
|
-
/* @__PURE__ */
|
|
20852
|
+
return /* @__PURE__ */ jsxs72("div", { className: "w-48", children: [
|
|
20853
|
+
/* @__PURE__ */ jsx80(
|
|
20290
20854
|
EditorColorPalette,
|
|
20291
20855
|
{
|
|
20292
20856
|
colors: textColors,
|
|
@@ -20301,8 +20865,8 @@ var BubbleMenuContent = ({
|
|
|
20301
20865
|
label: t("colors.textColor")
|
|
20302
20866
|
}
|
|
20303
20867
|
),
|
|
20304
|
-
/* @__PURE__ */
|
|
20305
|
-
/* @__PURE__ */
|
|
20868
|
+
/* @__PURE__ */ jsx80("div", { className: "border-t my-1" }),
|
|
20869
|
+
/* @__PURE__ */ jsx80(
|
|
20306
20870
|
EditorColorPalette,
|
|
20307
20871
|
{
|
|
20308
20872
|
colors: highlightColors,
|
|
@@ -20317,7 +20881,7 @@ var BubbleMenuContent = ({
|
|
|
20317
20881
|
label: t("colors.highlight")
|
|
20318
20882
|
}
|
|
20319
20883
|
),
|
|
20320
|
-
/* @__PURE__ */
|
|
20884
|
+
/* @__PURE__ */ jsx80("div", { className: "p-2 border-t", children: /* @__PURE__ */ jsx80(
|
|
20321
20885
|
"button",
|
|
20322
20886
|
{
|
|
20323
20887
|
type: "button",
|
|
@@ -20328,22 +20892,22 @@ var BubbleMenuContent = ({
|
|
|
20328
20892
|
) })
|
|
20329
20893
|
] });
|
|
20330
20894
|
}
|
|
20331
|
-
return /* @__PURE__ */
|
|
20332
|
-
/* @__PURE__ */
|
|
20333
|
-
/* @__PURE__ */
|
|
20334
|
-
/* @__PURE__ */
|
|
20895
|
+
return /* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-0.5 p-1", children: [
|
|
20896
|
+
/* @__PURE__ */ jsx80(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx80(BoldIcon2, { className: "w-4 h-4" }) }),
|
|
20897
|
+
/* @__PURE__ */ jsx80(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx80(ItalicIcon2, { className: "w-4 h-4" }) }),
|
|
20898
|
+
/* @__PURE__ */ jsx80(
|
|
20335
20899
|
ToolbarButton,
|
|
20336
20900
|
{
|
|
20337
20901
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
20338
20902
|
active: editor.isActive("underline"),
|
|
20339
20903
|
title: t("toolbar.underline"),
|
|
20340
|
-
children: /* @__PURE__ */
|
|
20904
|
+
children: /* @__PURE__ */ jsx80(UnderlineIcon2, { className: "w-4 h-4" })
|
|
20341
20905
|
}
|
|
20342
20906
|
),
|
|
20343
|
-
/* @__PURE__ */
|
|
20344
|
-
/* @__PURE__ */
|
|
20345
|
-
/* @__PURE__ */
|
|
20346
|
-
/* @__PURE__ */
|
|
20907
|
+
/* @__PURE__ */ jsx80(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx80(StrikethroughIcon2, { className: "w-4 h-4" }) }),
|
|
20908
|
+
/* @__PURE__ */ jsx80(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx80(CodeIcon2, { className: "w-4 h-4" }) }),
|
|
20909
|
+
/* @__PURE__ */ jsx80("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
20910
|
+
/* @__PURE__ */ jsx80(
|
|
20347
20911
|
ToolbarButton,
|
|
20348
20912
|
{
|
|
20349
20913
|
onMouseDown: () => {
|
|
@@ -20354,37 +20918,37 @@ var BubbleMenuContent = ({
|
|
|
20354
20918
|
},
|
|
20355
20919
|
active: editor.isActive("link"),
|
|
20356
20920
|
title: t("toolbar.link"),
|
|
20357
|
-
children: /* @__PURE__ */
|
|
20921
|
+
children: /* @__PURE__ */ jsx80(LinkIcon2, { className: "w-4 h-4" })
|
|
20358
20922
|
}
|
|
20359
20923
|
),
|
|
20360
|
-
/* @__PURE__ */
|
|
20361
|
-
/* @__PURE__ */
|
|
20362
|
-
/* @__PURE__ */
|
|
20924
|
+
/* @__PURE__ */ jsx80(ToolbarButton, { onClick: () => setShowEditorColorPalette(true), title: t("colors.textColor"), children: /* @__PURE__ */ jsx80(Palette3, { className: "w-4 h-4" }) }),
|
|
20925
|
+
/* @__PURE__ */ jsx80("div", { className: "w-px h-6 bg-border/50 mx-1" }),
|
|
20926
|
+
/* @__PURE__ */ jsx80(
|
|
20363
20927
|
ToolbarButton,
|
|
20364
20928
|
{
|
|
20365
20929
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
20366
20930
|
active: editor.isActive("subscript"),
|
|
20367
20931
|
title: t("toolbar.subscript"),
|
|
20368
|
-
children: /* @__PURE__ */
|
|
20932
|
+
children: /* @__PURE__ */ jsx80(SubscriptIcon2, { className: "w-4 h-4" })
|
|
20369
20933
|
}
|
|
20370
20934
|
),
|
|
20371
|
-
/* @__PURE__ */
|
|
20935
|
+
/* @__PURE__ */ jsx80(
|
|
20372
20936
|
ToolbarButton,
|
|
20373
20937
|
{
|
|
20374
20938
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
20375
20939
|
active: editor.isActive("superscript"),
|
|
20376
20940
|
title: t("toolbar.superscript"),
|
|
20377
|
-
children: /* @__PURE__ */
|
|
20941
|
+
children: /* @__PURE__ */ jsx80(SuperscriptIcon2, { className: "w-4 h-4" })
|
|
20378
20942
|
}
|
|
20379
20943
|
)
|
|
20380
20944
|
] });
|
|
20381
20945
|
};
|
|
20382
20946
|
var CustomBubbleMenu = ({ editor }) => {
|
|
20383
|
-
const [isVisible, setIsVisible] =
|
|
20384
|
-
const [position, setPosition] =
|
|
20385
|
-
const menuRef =
|
|
20386
|
-
const keepOpenRef =
|
|
20387
|
-
const setKeepOpen =
|
|
20947
|
+
const [isVisible, setIsVisible] = useState51(false);
|
|
20948
|
+
const [position, setPosition] = useState51({ top: 0, left: 0 });
|
|
20949
|
+
const menuRef = useRef28(null);
|
|
20950
|
+
const keepOpenRef = useRef28(false);
|
|
20951
|
+
const setKeepOpen = useCallback16((next) => {
|
|
20388
20952
|
keepOpenRef.current = next;
|
|
20389
20953
|
if (next) setIsVisible(true);
|
|
20390
20954
|
}, []);
|
|
@@ -20417,7 +20981,7 @@ var CustomBubbleMenu = ({ editor }) => {
|
|
|
20417
20981
|
}, [editor]);
|
|
20418
20982
|
if (!isVisible) return null;
|
|
20419
20983
|
return createPortal9(
|
|
20420
|
-
/* @__PURE__ */
|
|
20984
|
+
/* @__PURE__ */ jsx80(
|
|
20421
20985
|
"div",
|
|
20422
20986
|
{
|
|
20423
20987
|
ref: menuRef,
|
|
@@ -20428,7 +20992,7 @@ var CustomBubbleMenu = ({ editor }) => {
|
|
|
20428
20992
|
transform: "translate(-50%, -100%)"
|
|
20429
20993
|
},
|
|
20430
20994
|
onMouseDown: (e) => e.preventDefault(),
|
|
20431
|
-
children: /* @__PURE__ */
|
|
20995
|
+
children: /* @__PURE__ */ jsx80(
|
|
20432
20996
|
BubbleMenuContent,
|
|
20433
20997
|
{
|
|
20434
20998
|
editor,
|
|
@@ -20441,8 +21005,8 @@ var CustomBubbleMenu = ({ editor }) => {
|
|
|
20441
21005
|
);
|
|
20442
21006
|
};
|
|
20443
21007
|
var CustomFloatingMenu = ({ editor }) => {
|
|
20444
|
-
const [isVisible, setIsVisible] =
|
|
20445
|
-
const [position, setPosition] =
|
|
21008
|
+
const [isVisible, setIsVisible] = useState51(false);
|
|
21009
|
+
const [position, setPosition] = useState51({ top: 0, left: 0 });
|
|
20446
21010
|
useEffect31(() => {
|
|
20447
21011
|
const updatePosition = () => {
|
|
20448
21012
|
const { state, view } = editor;
|
|
@@ -20470,7 +21034,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
20470
21034
|
}, [editor]);
|
|
20471
21035
|
if (!isVisible) return null;
|
|
20472
21036
|
return createPortal9(
|
|
20473
|
-
/* @__PURE__ */
|
|
21037
|
+
/* @__PURE__ */ jsx80(
|
|
20474
21038
|
"div",
|
|
20475
21039
|
{
|
|
20476
21040
|
className: "fixed z-50 rounded-2xl border border-border bg-card text-card-foreground shadow-lg backdrop-blur-sm overflow-hidden animate-in fade-in-0 slide-in-from-bottom-2",
|
|
@@ -20480,7 +21044,7 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
20480
21044
|
transform: "translate(-50%, -100%)"
|
|
20481
21045
|
},
|
|
20482
21046
|
onMouseDown: (e) => e.preventDefault(),
|
|
20483
|
-
children: /* @__PURE__ */
|
|
21047
|
+
children: /* @__PURE__ */ jsx80(FloatingMenuContent, { editor })
|
|
20484
21048
|
}
|
|
20485
21049
|
),
|
|
20486
21050
|
document.body
|
|
@@ -20489,25 +21053,25 @@ var CustomFloatingMenu = ({ editor }) => {
|
|
|
20489
21053
|
|
|
20490
21054
|
// ../../components/ui/UEditor/CharacterCount.tsx
|
|
20491
21055
|
import { useTranslations as useTranslations6 } from "next-intl";
|
|
20492
|
-
import { jsxs as
|
|
21056
|
+
import { jsxs as jsxs73 } from "react/jsx-runtime";
|
|
20493
21057
|
var CharacterCountDisplay = ({ editor, maxCharacters }) => {
|
|
20494
21058
|
const t = useTranslations6("UEditor");
|
|
20495
21059
|
const storage = editor.storage;
|
|
20496
21060
|
const characterCount = storage.characterCount?.characters?.() ?? 0;
|
|
20497
21061
|
const wordCount = storage.characterCount?.words?.() ?? 0;
|
|
20498
21062
|
const percentage = maxCharacters ? Math.round(characterCount / maxCharacters * 100) : 0;
|
|
20499
|
-
return /* @__PURE__ */
|
|
20500
|
-
/* @__PURE__ */
|
|
21063
|
+
return /* @__PURE__ */ jsxs73("div", { className: "flex items-center gap-3 px-3 py-2 text-xs text-muted-foreground border-t bg-muted/20", children: [
|
|
21064
|
+
/* @__PURE__ */ jsxs73("span", { children: [
|
|
20501
21065
|
wordCount,
|
|
20502
21066
|
" ",
|
|
20503
21067
|
t("words")
|
|
20504
21068
|
] }),
|
|
20505
|
-
/* @__PURE__ */
|
|
21069
|
+
/* @__PURE__ */ jsxs73("span", { children: [
|
|
20506
21070
|
characterCount,
|
|
20507
21071
|
" ",
|
|
20508
21072
|
t("characters")
|
|
20509
21073
|
] }),
|
|
20510
|
-
maxCharacters && /* @__PURE__ */
|
|
21074
|
+
maxCharacters && /* @__PURE__ */ jsxs73("span", { className: cn(percentage > 90 && "text-destructive", percentage > 100 && "font-bold"), children: [
|
|
20511
21075
|
characterCount,
|
|
20512
21076
|
"/",
|
|
20513
21077
|
maxCharacters
|
|
@@ -20516,7 +21080,7 @@ var CharacterCountDisplay = ({ editor, maxCharacters }) => {
|
|
|
20516
21080
|
};
|
|
20517
21081
|
|
|
20518
21082
|
// ../../components/ui/UEditor/UEditor.tsx
|
|
20519
|
-
import { jsx as
|
|
21083
|
+
import { jsx as jsx81, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
20520
21084
|
var UEditor = ({
|
|
20521
21085
|
content = "",
|
|
20522
21086
|
onChange,
|
|
@@ -20539,7 +21103,7 @@ var UEditor = ({
|
|
|
20539
21103
|
}) => {
|
|
20540
21104
|
const t = useTranslations7("UEditor");
|
|
20541
21105
|
const effectivePlaceholder = placeholder ?? t("placeholder");
|
|
20542
|
-
const extensions =
|
|
21106
|
+
const extensions = useMemo25(
|
|
20543
21107
|
() => buildUEditorExtensions({ placeholder: effectivePlaceholder, maxCharacters, uploadImage, imageInsertMode, editable }),
|
|
20544
21108
|
[effectivePlaceholder, maxCharacters, uploadImage, imageInsertMode, editable]
|
|
20545
21109
|
);
|
|
@@ -20656,7 +21220,7 @@ var UEditor = ({
|
|
|
20656
21220
|
}
|
|
20657
21221
|
}, [content, editor]);
|
|
20658
21222
|
if (!editor) {
|
|
20659
|
-
return /* @__PURE__ */
|
|
21223
|
+
return /* @__PURE__ */ jsx81(
|
|
20660
21224
|
"div",
|
|
20661
21225
|
{
|
|
20662
21226
|
className: cn("w-full rounded-lg border bg-background flex items-center justify-center text-muted-foreground", className),
|
|
@@ -20665,7 +21229,7 @@ var UEditor = ({
|
|
|
20665
21229
|
}
|
|
20666
21230
|
);
|
|
20667
21231
|
}
|
|
20668
|
-
return /* @__PURE__ */
|
|
21232
|
+
return /* @__PURE__ */ jsxs74(
|
|
20669
21233
|
"div",
|
|
20670
21234
|
{
|
|
20671
21235
|
className: cn(
|
|
@@ -20677,10 +21241,10 @@ var UEditor = ({
|
|
|
20677
21241
|
className
|
|
20678
21242
|
),
|
|
20679
21243
|
children: [
|
|
20680
|
-
editable && showToolbar && /* @__PURE__ */
|
|
20681
|
-
editable && showBubbleMenu && /* @__PURE__ */
|
|
20682
|
-
editable && showFloatingMenu && /* @__PURE__ */
|
|
20683
|
-
/* @__PURE__ */
|
|
21244
|
+
editable && showToolbar && /* @__PURE__ */ jsx81(EditorToolbar, { editor, variant, uploadImage, imageInsertMode }),
|
|
21245
|
+
editable && showBubbleMenu && /* @__PURE__ */ jsx81(CustomBubbleMenu, { editor }),
|
|
21246
|
+
editable && showFloatingMenu && /* @__PURE__ */ jsx81(CustomFloatingMenu, { editor }),
|
|
21247
|
+
/* @__PURE__ */ jsx81(
|
|
20684
21248
|
EditorContent,
|
|
20685
21249
|
{
|
|
20686
21250
|
editor,
|
|
@@ -20691,7 +21255,7 @@ var UEditor = ({
|
|
|
20691
21255
|
}
|
|
20692
21256
|
}
|
|
20693
21257
|
),
|
|
20694
|
-
showCharacterCount && /* @__PURE__ */
|
|
21258
|
+
showCharacterCount && /* @__PURE__ */ jsx81(CharacterCountDisplay, { editor, maxCharacters })
|
|
20695
21259
|
]
|
|
20696
21260
|
}
|
|
20697
21261
|
);
|
|
@@ -20737,6 +21301,7 @@ export {
|
|
|
20737
21301
|
DropdownMenuItem,
|
|
20738
21302
|
DropdownMenuSeparator,
|
|
20739
21303
|
FallingIcons,
|
|
21304
|
+
FileUpload,
|
|
20740
21305
|
FloatingContacts,
|
|
20741
21306
|
ForceInternalTranslationsProvider,
|
|
20742
21307
|
Form,
|