@underverse-ui/underverse 0.1.4 → 0.1.6
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/README.md +59 -3
- package/dist/index.cjs +310 -339
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +283 -12
- package/dist/index.d.ts +283 -12
- package/dist/index.js +296 -326
- package/dist/index.js.map +1 -1
- package/package.json +12 -1
package/dist/index.cjs
CHANGED
|
@@ -69,7 +69,6 @@ __export(index_exports, {
|
|
|
69
69
|
Pagination: () => Pagination,
|
|
70
70
|
PillTabs: () => PillTabs,
|
|
71
71
|
Popover: () => Popover,
|
|
72
|
-
ProductImageUpload: () => ProductImageUpload_default,
|
|
73
72
|
Progress: () => Progress_default,
|
|
74
73
|
PulseBadge: () => PulseBadge,
|
|
75
74
|
RadioGroup: () => RadioGroup_default,
|
|
@@ -102,6 +101,8 @@ __export(index_exports, {
|
|
|
102
101
|
VARIANT_STYLES_BTN: () => VARIANT_STYLES_BTN,
|
|
103
102
|
VerticalTabs: () => VerticalTabs,
|
|
104
103
|
cn: () => cn,
|
|
104
|
+
getUnderverseMessages: () => getUnderverseMessages,
|
|
105
|
+
underverseMessages: () => underverseMessages,
|
|
105
106
|
useToast: () => useToast
|
|
106
107
|
});
|
|
107
108
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -2587,7 +2588,7 @@ var variantIcons = {
|
|
|
2587
2588
|
warning: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(WarningIcon, { className: "h-4 w-4 text-warning" }),
|
|
2588
2589
|
error: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ErrorIcon, { className: "h-4 w-4 text-destructive" })
|
|
2589
2590
|
};
|
|
2590
|
-
var Alert = ({ title, description, variant = "default", className, icon, dismissible = false, onClose, actions }) => {
|
|
2591
|
+
var Alert = ({ title, description, variant = "default", className, icon, dismissible = false, onClose, actions, closeAriaLabel }) => {
|
|
2591
2592
|
const [open, setOpen] = (0, import_react7.useState)(true);
|
|
2592
2593
|
const t = (0, import_next_intl2.useTranslations)("Common");
|
|
2593
2594
|
if (!open) return null;
|
|
@@ -2613,7 +2614,7 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
2613
2614
|
{
|
|
2614
2615
|
onClick: handleClose,
|
|
2615
2616
|
className: "rounded-md p-1 hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
2616
|
-
"aria-label": t("closeAlert"),
|
|
2617
|
+
"aria-label": closeAriaLabel || t("closeAlert"),
|
|
2617
2618
|
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react9.X, { className: "h-4 w-4" })
|
|
2618
2619
|
}
|
|
2619
2620
|
)
|
|
@@ -3674,7 +3675,8 @@ var Pagination = ({
|
|
|
3674
3675
|
pageSize,
|
|
3675
3676
|
pageSizeOptions,
|
|
3676
3677
|
onPageSizeChange,
|
|
3677
|
-
totalItems
|
|
3678
|
+
totalItems,
|
|
3679
|
+
labels
|
|
3678
3680
|
}) => {
|
|
3679
3681
|
const t = (0, import_next_intl4.useTranslations)("Pagination");
|
|
3680
3682
|
const createPageArray = () => {
|
|
@@ -3728,8 +3730,8 @@ var Pagination = ({
|
|
|
3728
3730
|
}
|
|
3729
3731
|
};
|
|
3730
3732
|
if (totalPages <= 1) return null;
|
|
3731
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("nav", { className: cn("flex flex-col gap-4", className), "aria-label": t("navigationLabel"), children: [
|
|
3732
|
-
showInfo && totalItems && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-sm text-muted-foreground text-center", children: t("showingResults", { startItem: startItem || 0, endItem: endItem || 0, totalItems }) }),
|
|
3733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("nav", { className: cn("flex flex-col gap-4", className), "aria-label": labels?.navigationLabel || t("navigationLabel"), children: [
|
|
3734
|
+
showInfo && totalItems && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-sm text-muted-foreground text-center", children: labels?.showingResults ? labels.showingResults({ startItem: startItem || 0, endItem: endItem || 0, totalItems }) : t("showingResults", { startItem: startItem || 0, endItem: endItem || 0, totalItems }) }),
|
|
3733
3735
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-center gap-1", children: [
|
|
3734
3736
|
showFirstLast && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3735
3737
|
Button_default,
|
|
@@ -3740,8 +3742,8 @@ var Pagination = ({
|
|
|
3740
3742
|
onClick: () => onChange(1),
|
|
3741
3743
|
disabled: disabled || page === 1,
|
|
3742
3744
|
className: "hidden sm:flex",
|
|
3743
|
-
title: t("firstPage"),
|
|
3744
|
-
"aria-label": t("firstPage"),
|
|
3745
|
+
title: labels?.firstPage || t("firstPage"),
|
|
3746
|
+
"aria-label": labels?.firstPage || t("firstPage"),
|
|
3745
3747
|
"aria-disabled": disabled || page === 1
|
|
3746
3748
|
}
|
|
3747
3749
|
),
|
|
@@ -3753,10 +3755,10 @@ var Pagination = ({
|
|
|
3753
3755
|
icon: import_lucide_react13.ChevronLeft,
|
|
3754
3756
|
onClick: () => onChange(Math.max(1, page - 1)),
|
|
3755
3757
|
disabled: disabled || page === 1,
|
|
3756
|
-
title: t("previousPage"),
|
|
3757
|
-
"aria-label": t("previousPage"),
|
|
3758
|
+
title: labels?.previousPage || t("previousPage"),
|
|
3759
|
+
"aria-label": labels?.previousPage || t("previousPage"),
|
|
3758
3760
|
"aria-disabled": disabled || page === 1,
|
|
3759
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "hidden sm:inline", children: t("previous") })
|
|
3761
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "hidden sm:inline", children: labels?.previous || t("previous") })
|
|
3760
3762
|
}
|
|
3761
3763
|
),
|
|
3762
3764
|
showPageNumbers && createPageArray().map((p, i) => {
|
|
@@ -3773,7 +3775,7 @@ var Pagination = ({
|
|
|
3773
3775
|
onClick: () => onChange(pageNumber),
|
|
3774
3776
|
disabled,
|
|
3775
3777
|
className: cn("min-w-[2.5rem]", isActive && "font-semibold"),
|
|
3776
|
-
"aria-label": t("pageNumber", { page: pageNumber }),
|
|
3778
|
+
"aria-label": labels?.pageNumber ? labels.pageNumber(pageNumber) : t("pageNumber", { page: pageNumber }),
|
|
3777
3779
|
"aria-current": isActive ? "page" : void 0,
|
|
3778
3780
|
children: pageNumber
|
|
3779
3781
|
},
|
|
@@ -3788,10 +3790,10 @@ var Pagination = ({
|
|
|
3788
3790
|
iconRight: import_lucide_react13.ChevronRight,
|
|
3789
3791
|
onClick: () => onChange(Math.min(totalPages, page + 1)),
|
|
3790
3792
|
disabled: disabled || page === totalPages,
|
|
3791
|
-
title: t("nextPage"),
|
|
3792
|
-
"aria-label": t("nextPage"),
|
|
3793
|
+
title: labels?.nextPage || t("nextPage"),
|
|
3794
|
+
"aria-label": labels?.nextPage || t("nextPage"),
|
|
3793
3795
|
"aria-disabled": disabled || page === totalPages,
|
|
3794
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "hidden sm:inline", children: t("next") })
|
|
3796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "hidden sm:inline", children: labels?.next || t("next") })
|
|
3795
3797
|
}
|
|
3796
3798
|
),
|
|
3797
3799
|
showFirstLast && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
@@ -3803,15 +3805,15 @@ var Pagination = ({
|
|
|
3803
3805
|
onClick: () => onChange(totalPages),
|
|
3804
3806
|
disabled: disabled || page === totalPages,
|
|
3805
3807
|
className: "hidden sm:flex",
|
|
3806
|
-
title: t("lastPage"),
|
|
3807
|
-
"aria-label": t("lastPage"),
|
|
3808
|
+
title: labels?.lastPage || t("lastPage"),
|
|
3809
|
+
"aria-label": labels?.lastPage || t("lastPage"),
|
|
3808
3810
|
"aria-disabled": disabled || page === totalPages
|
|
3809
3811
|
}
|
|
3810
3812
|
)
|
|
3811
3813
|
] }),
|
|
3812
3814
|
pageSizeOptions && onPageSizeChange && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-center gap-2 text-sm", children: [
|
|
3813
3815
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "text-muted-foreground", children: [
|
|
3814
|
-
t("itemsPerPage"),
|
|
3816
|
+
labels?.itemsPerPage || t("itemsPerPage"),
|
|
3815
3817
|
":"
|
|
3816
3818
|
] }),
|
|
3817
3819
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-20", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
@@ -3821,8 +3823,8 @@ var Pagination = ({
|
|
|
3821
3823
|
value: pageSize?.toString() || "10",
|
|
3822
3824
|
onChange: handlePageSizeChange,
|
|
3823
3825
|
placeholder: "10",
|
|
3824
|
-
searchPlaceholder: t("search"),
|
|
3825
|
-
emptyText: t("noOptions"),
|
|
3826
|
+
searchPlaceholder: labels?.search || t("search"),
|
|
3827
|
+
emptyText: labels?.noOptions || t("noOptions"),
|
|
3826
3828
|
disabled
|
|
3827
3829
|
}
|
|
3828
3830
|
) })
|
|
@@ -4078,7 +4080,10 @@ var DatePicker = ({
|
|
|
4078
4080
|
disabled = false,
|
|
4079
4081
|
size = "md",
|
|
4080
4082
|
label,
|
|
4081
|
-
required
|
|
4083
|
+
required,
|
|
4084
|
+
todayLabel,
|
|
4085
|
+
clearLabel,
|
|
4086
|
+
weekdayLabels
|
|
4082
4087
|
}) => {
|
|
4083
4088
|
const t = (0, import_next_intl5.useTranslations)("DatePicker");
|
|
4084
4089
|
const locale = (0, import_next_intl5.useLocale)();
|
|
@@ -4219,10 +4224,10 @@ var DatePicker = ({
|
|
|
4219
4224
|
children: [
|
|
4220
4225
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4221
4226
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("prev"), className: "p-1 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react14.ChevronLeft, { className: "h-4 w-4" }) }),
|
|
4222
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString(
|
|
4227
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
4223
4228
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("next"), className: "p-1 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react14.ChevronRight, { className: "h-4 w-4" }) })
|
|
4224
4229
|
] }),
|
|
4225
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cn("grid grid-cols-7 gap-1", size === "sm" ? "mb-1" : "mb-2"), children: (
|
|
4230
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cn("grid grid-cols-7 gap-1", size === "sm" ? "mb-1" : "mb-2"), children: (weekdayLabels || ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]).map((day) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cn("text-muted-foreground text-center font-medium", size === "sm" ? "text-[10px] py-0.5" : "text-xs py-1"), children: day }, day)) }),
|
|
4226
4231
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "grid grid-cols-7 gap-1", children: renderCalendar() })
|
|
4227
4232
|
]
|
|
4228
4233
|
}
|
|
@@ -5449,220 +5454,52 @@ function ImageUpload({
|
|
|
5449
5454
|
] });
|
|
5450
5455
|
}
|
|
5451
5456
|
|
|
5452
|
-
// ../../components/ui/
|
|
5453
|
-
var
|
|
5454
|
-
var import_image2 = __toESM(require("next/image"), 1);
|
|
5457
|
+
// ../../components/ui/Carousel.tsx
|
|
5458
|
+
var React27 = __toESM(require("react"), 1);
|
|
5455
5459
|
var import_lucide_react18 = require("lucide-react");
|
|
5456
5460
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5457
|
-
var ProductImageUpload = ({ value, onChange, disabled = false, className }) => {
|
|
5458
|
-
const [uploading, setUploading] = (0, import_react18.useState)(false);
|
|
5459
|
-
const [error, setError] = (0, import_react18.useState)(null);
|
|
5460
|
-
const [isDragging, setIsDragging] = (0, import_react18.useState)(false);
|
|
5461
|
-
const fileInputRef = (0, import_react18.useRef)(null);
|
|
5462
|
-
const handleFileChange = async (e) => {
|
|
5463
|
-
const file = e.target.files?.[0];
|
|
5464
|
-
if (!file) return;
|
|
5465
|
-
await uploadFile(file);
|
|
5466
|
-
};
|
|
5467
|
-
const uploadFile = async (file) => {
|
|
5468
|
-
const acceptedFormats = ["image/jpeg", "image/png", "image/webp", "image/gif"];
|
|
5469
|
-
if (!acceptedFormats.includes(file.type)) {
|
|
5470
|
-
setError(`\u0110\u1ECBnh d\u1EA1ng kh\xF4ng h\u1ED7 tr\u1EE3. Ch\u1EC9 ch\u1EA5p nh\u1EADn: JPG, PNG, WEBP, GIF`);
|
|
5471
|
-
return;
|
|
5472
|
-
}
|
|
5473
|
-
const maxSizeBytes = 10 * 1024 * 1024;
|
|
5474
|
-
if (file.size > maxSizeBytes) {
|
|
5475
|
-
setError(`File qu\xE1 l\u1EDBn. K\xEDch th\u01B0\u1EDBc t\u1ED1i \u0111a: 10MB`);
|
|
5476
|
-
return;
|
|
5477
|
-
}
|
|
5478
|
-
setError(null);
|
|
5479
|
-
setUploading(true);
|
|
5480
|
-
try {
|
|
5481
|
-
const formData = new FormData();
|
|
5482
|
-
formData.append("file", file);
|
|
5483
|
-
const response = await fetch("/api/upload/product-image", {
|
|
5484
|
-
method: "POST",
|
|
5485
|
-
body: formData,
|
|
5486
|
-
credentials: "include"
|
|
5487
|
-
});
|
|
5488
|
-
if (!response.ok) {
|
|
5489
|
-
throw new Error("Upload failed");
|
|
5490
|
-
}
|
|
5491
|
-
const result = await response.json();
|
|
5492
|
-
if (result.success && result.data?.path) {
|
|
5493
|
-
onChange(result.data.path);
|
|
5494
|
-
} else {
|
|
5495
|
-
throw new Error(result.message || "Upload failed");
|
|
5496
|
-
}
|
|
5497
|
-
} catch (err) {
|
|
5498
|
-
setError(err.message || "Kh\xF4ng th\u1EC3 upload \u1EA3nh");
|
|
5499
|
-
console.error("Upload error:", err);
|
|
5500
|
-
} finally {
|
|
5501
|
-
setUploading(false);
|
|
5502
|
-
if (fileInputRef.current) {
|
|
5503
|
-
fileInputRef.current.value = "";
|
|
5504
|
-
}
|
|
5505
|
-
}
|
|
5506
|
-
};
|
|
5507
|
-
const handleDragOver = (e) => {
|
|
5508
|
-
e.preventDefault();
|
|
5509
|
-
e.stopPropagation();
|
|
5510
|
-
if (!disabled && !uploading) {
|
|
5511
|
-
setIsDragging(true);
|
|
5512
|
-
}
|
|
5513
|
-
};
|
|
5514
|
-
const handleDragLeave = (e) => {
|
|
5515
|
-
e.preventDefault();
|
|
5516
|
-
e.stopPropagation();
|
|
5517
|
-
setIsDragging(false);
|
|
5518
|
-
};
|
|
5519
|
-
const handleDrop = async (e) => {
|
|
5520
|
-
e.preventDefault();
|
|
5521
|
-
e.stopPropagation();
|
|
5522
|
-
setIsDragging(false);
|
|
5523
|
-
if (disabled || uploading) return;
|
|
5524
|
-
const file = e.dataTransfer.files?.[0];
|
|
5525
|
-
if (file) {
|
|
5526
|
-
await uploadFile(file);
|
|
5527
|
-
}
|
|
5528
|
-
};
|
|
5529
|
-
const handleRemove = () => {
|
|
5530
|
-
onChange("");
|
|
5531
|
-
setError(null);
|
|
5532
|
-
};
|
|
5533
|
-
const handleClickUpload = () => {
|
|
5534
|
-
fileInputRef.current?.click();
|
|
5535
|
-
};
|
|
5536
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("space-y-4", className), children: [
|
|
5537
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5538
|
-
"input",
|
|
5539
|
-
{
|
|
5540
|
-
ref: fileInputRef,
|
|
5541
|
-
type: "file",
|
|
5542
|
-
accept: "image/jpeg,image/png,image/webp,image/gif",
|
|
5543
|
-
onChange: handleFileChange,
|
|
5544
|
-
disabled: disabled || uploading,
|
|
5545
|
-
className: "hidden"
|
|
5546
|
-
}
|
|
5547
|
-
),
|
|
5548
|
-
value ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "space-y-4", children: [
|
|
5549
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "relative w-full aspect-square max-w-md rounded-xl overflow-hidden border-2 border-border bg-muted shadow-lg group", children: [
|
|
5550
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5551
|
-
import_image2.default,
|
|
5552
|
-
{
|
|
5553
|
-
src: value,
|
|
5554
|
-
alt: "Product image",
|
|
5555
|
-
fill: true,
|
|
5556
|
-
className: "object-cover transition-transform duration-300 group-hover:scale-105",
|
|
5557
|
-
unoptimized: true
|
|
5558
|
-
}
|
|
5559
|
-
),
|
|
5560
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "absolute inset-0 bg-foreground/0 group-hover:bg-foreground/30 transition-colors duration-300 flex items-center justify-center opacity-0 group-hover:opacity-100", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex gap-2", children: [
|
|
5561
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Button_default, { type: "button", variant: "default", size: "sm", onClick: handleClickUpload, disabled: disabled || uploading, children: [
|
|
5562
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.Upload, { className: "w-4 h-4 mr-2" }),
|
|
5563
|
-
"Thay \u0111\u1ED5i"
|
|
5564
|
-
] }),
|
|
5565
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Button_default, { type: "button", variant: "danger", size: "sm", onClick: handleRemove, disabled: disabled || uploading, children: [
|
|
5566
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.X, { className: "w-4 h-4 mr-2" }),
|
|
5567
|
-
"X\xF3a"
|
|
5568
|
-
] })
|
|
5569
|
-
] }) })
|
|
5570
|
-
] }),
|
|
5571
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
5572
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.Image, { className: "w-4 h-4" }),
|
|
5573
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "\u1EA2nh s\u1EA3n ph\u1EA9m \u0111\xE3 t\u1EA3i l\xEAn th\xE0nh c\xF4ng" })
|
|
5574
|
-
] })
|
|
5575
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5576
|
-
"div",
|
|
5577
|
-
{
|
|
5578
|
-
className: cn(
|
|
5579
|
-
"w-full aspect-square max-w-md rounded-xl border-2 border-dashed transition-all duration-200",
|
|
5580
|
-
"bg-gradient-to-br from-muted/30 to-muted/10",
|
|
5581
|
-
"flex flex-col items-center justify-center cursor-pointer",
|
|
5582
|
-
"hover:border-primary/60 hover:bg-primary/5 hover:shadow-lg hover:scale-[1.02]",
|
|
5583
|
-
isDragging && "border-primary bg-primary/10 shadow-lg scale-[1.02]",
|
|
5584
|
-
(disabled || uploading) && "opacity-50 cursor-not-allowed hover:scale-100",
|
|
5585
|
-
!isDragging && !disabled && !uploading && "border-border"
|
|
5586
|
-
),
|
|
5587
|
-
onClick: !disabled && !uploading ? handleClickUpload : void 0,
|
|
5588
|
-
onDragOver: handleDragOver,
|
|
5589
|
-
onDragLeave: handleDragLeave,
|
|
5590
|
-
onDrop: handleDrop,
|
|
5591
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col items-center justify-center p-8 text-center", children: [
|
|
5592
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5593
|
-
"div",
|
|
5594
|
-
{
|
|
5595
|
-
className: cn(
|
|
5596
|
-
"w-20 h-20 rounded-full flex items-center justify-center mb-4 transition-colors",
|
|
5597
|
-
isDragging ? "bg-primary/20" : "bg-primary/10"
|
|
5598
|
-
),
|
|
5599
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.Upload, { className: cn("w-10 h-10 transition-colors", isDragging ? "text-primary" : "text-muted-foreground") })
|
|
5600
|
-
}
|
|
5601
|
-
),
|
|
5602
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h3", { className: "text-lg font-semibold text-foreground mb-2", children: uploading ? "\u0110ang t\u1EA3i l\xEAn..." : isDragging ? "Th\u1EA3 \u1EA3nh v\xE0o \u0111\xE2y" : "T\u1EA3i \u1EA3nh s\u1EA3n ph\u1EA9m" }),
|
|
5603
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm text-muted-foreground mb-3 max-w-xs", children: uploading ? "Vui l\xF2ng \u0111\u1EE3i trong gi\xE2y l\xE1t" : "Click \u0111\u1EC3 ch\u1ECDn ho\u1EB7c k\xE9o th\u1EA3 \u1EA3nh v\xE0o \u0111\xE2y" }),
|
|
5604
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2 text-xs text-muted-foreground mt-2", children: [
|
|
5605
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "px-3 py-1.5 bg-muted rounded-full", children: "JPG, PNG, WEBP, GIF" }),
|
|
5606
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "px-3 py-1.5 bg-muted rounded-full", children: "T\u1ED1i \u0111a 10MB" })
|
|
5607
|
-
] }),
|
|
5608
|
-
uploading && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mt-4 w-48 h-1.5 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "h-full bg-primary rounded-full animate-[progress_1s_ease-in-out_infinite]" }) })
|
|
5609
|
-
] })
|
|
5610
|
-
}
|
|
5611
|
-
),
|
|
5612
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2 p-3 rounded-lg bg-destructive/10 border border-destructive/20", children: [
|
|
5613
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.X, { className: "w-4 h-4 text-destructive flex-shrink-0" }),
|
|
5614
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm text-destructive", children: error })
|
|
5615
|
-
] })
|
|
5616
|
-
] });
|
|
5617
|
-
};
|
|
5618
|
-
var ProductImageUpload_default = ProductImageUpload;
|
|
5619
|
-
|
|
5620
|
-
// ../../components/ui/Carousel.tsx
|
|
5621
|
-
var React28 = __toESM(require("react"), 1);
|
|
5622
|
-
var import_lucide_react19 = require("lucide-react");
|
|
5623
|
-
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5624
5461
|
function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
5625
|
-
const [currentIndex, setCurrentIndex] =
|
|
5626
|
-
const totalSlides =
|
|
5627
|
-
const [isPaused, setIsPaused] =
|
|
5628
|
-
const scrollPrev =
|
|
5462
|
+
const [currentIndex, setCurrentIndex] = React27.useState(0);
|
|
5463
|
+
const totalSlides = React27.Children.count(children);
|
|
5464
|
+
const [isPaused, setIsPaused] = React27.useState(false);
|
|
5465
|
+
const scrollPrev = React27.useCallback(() => {
|
|
5629
5466
|
setCurrentIndex((prev) => prev > 0 ? prev - 1 : totalSlides - 1);
|
|
5630
5467
|
}, [totalSlides]);
|
|
5631
|
-
const scrollNext =
|
|
5468
|
+
const scrollNext = React27.useCallback(() => {
|
|
5632
5469
|
setCurrentIndex((prev) => prev < totalSlides - 1 ? prev + 1 : 0);
|
|
5633
5470
|
}, [totalSlides]);
|
|
5634
|
-
|
|
5471
|
+
React27.useEffect(() => {
|
|
5635
5472
|
if (!autoScroll || isPaused || totalSlides <= 1) return;
|
|
5636
5473
|
const interval = setInterval(() => {
|
|
5637
5474
|
scrollNext();
|
|
5638
5475
|
}, autoScrollInterval);
|
|
5639
5476
|
return () => clearInterval(interval);
|
|
5640
5477
|
}, [autoScroll, isPaused, totalSlides, autoScrollInterval, scrollNext]);
|
|
5641
|
-
return /* @__PURE__ */ (0,
|
|
5642
|
-
/* @__PURE__ */ (0,
|
|
5643
|
-
totalSlides > 1 && /* @__PURE__ */ (0,
|
|
5644
|
-
/* @__PURE__ */ (0,
|
|
5478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "relative w-full overflow-hidden", onMouseEnter: () => setIsPaused(true), onMouseLeave: () => setIsPaused(false), children: [
|
|
5479
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex transition-transform duration-500 ease-in-out", style: { transform: `translateX(-${currentIndex * 100}%)` }, children: React27.Children.map(children, (child, idx) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex-shrink-0 w-full h-full", children: child }, idx)) }),
|
|
5480
|
+
totalSlides > 1 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
5481
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5645
5482
|
Button_default,
|
|
5646
5483
|
{
|
|
5647
5484
|
onClick: scrollPrev,
|
|
5648
5485
|
variant: "outline",
|
|
5649
5486
|
size: "icon",
|
|
5650
|
-
icon:
|
|
5487
|
+
icon: import_lucide_react18.ArrowLeft,
|
|
5651
5488
|
className: "absolute left-4 top-1/2 -translate-y-1/2 hover:-translate-y-1/2 z-10 rounded-full will-change-transform bg-background/80 hover:bg-background border-border/50 hover:border-border text-foreground"
|
|
5652
5489
|
}
|
|
5653
5490
|
),
|
|
5654
|
-
/* @__PURE__ */ (0,
|
|
5491
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5655
5492
|
Button_default,
|
|
5656
5493
|
{
|
|
5657
5494
|
onClick: scrollNext,
|
|
5658
5495
|
variant: "outline",
|
|
5659
5496
|
size: "icon",
|
|
5660
|
-
icon:
|
|
5497
|
+
icon: import_lucide_react18.ArrowRight,
|
|
5661
5498
|
className: "absolute right-4 top-1/2 -translate-y-1/2 hover:-translate-y-1/2 z-10 rounded-full will-change-transform bg-background/80 hover:bg-background border-border/50 hover:border-border text-foreground"
|
|
5662
5499
|
}
|
|
5663
5500
|
)
|
|
5664
5501
|
] }),
|
|
5665
|
-
totalSlides > 1 && /* @__PURE__ */ (0,
|
|
5502
|
+
totalSlides > 1 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2", children: Array.from({ length: totalSlides }, (_, idx) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5666
5503
|
"button",
|
|
5667
5504
|
{
|
|
5668
5505
|
onClick: () => setCurrentIndex(idx),
|
|
@@ -5675,22 +5512,22 @@ function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
|
5675
5512
|
}
|
|
5676
5513
|
|
|
5677
5514
|
// ../../components/ui/ClientOnly.tsx
|
|
5678
|
-
var
|
|
5679
|
-
var
|
|
5515
|
+
var import_react18 = require("react");
|
|
5516
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5680
5517
|
function ClientOnly({ children, fallback = null }) {
|
|
5681
|
-
const [hasMounted, setHasMounted] = (0,
|
|
5682
|
-
(0,
|
|
5518
|
+
const [hasMounted, setHasMounted] = (0, import_react18.useState)(false);
|
|
5519
|
+
(0, import_react18.useEffect)(() => {
|
|
5683
5520
|
setHasMounted(true);
|
|
5684
5521
|
}, []);
|
|
5685
5522
|
if (!hasMounted) {
|
|
5686
|
-
return /* @__PURE__ */ (0,
|
|
5523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: fallback });
|
|
5687
5524
|
}
|
|
5688
|
-
return /* @__PURE__ */ (0,
|
|
5525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children });
|
|
5689
5526
|
}
|
|
5690
5527
|
|
|
5691
5528
|
// ../../components/ui/Loading.tsx
|
|
5692
|
-
var
|
|
5693
|
-
var
|
|
5529
|
+
var import_lucide_react19 = require("lucide-react");
|
|
5530
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5694
5531
|
var LoadingSpinner = ({
|
|
5695
5532
|
size = "md",
|
|
5696
5533
|
className,
|
|
@@ -5706,8 +5543,8 @@ var LoadingSpinner = ({
|
|
|
5706
5543
|
foreground: "text-foreground",
|
|
5707
5544
|
muted: "text-muted-foreground"
|
|
5708
5545
|
};
|
|
5709
|
-
return /* @__PURE__ */ (0,
|
|
5710
|
-
|
|
5546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5547
|
+
import_lucide_react19.Activity,
|
|
5711
5548
|
{
|
|
5712
5549
|
className: cn(
|
|
5713
5550
|
"animate-spin",
|
|
@@ -5727,7 +5564,7 @@ var LoadingDots = ({
|
|
|
5727
5564
|
foreground: "bg-foreground",
|
|
5728
5565
|
muted: "bg-muted-foreground"
|
|
5729
5566
|
};
|
|
5730
|
-
return /* @__PURE__ */ (0,
|
|
5567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: cn("flex items-center space-x-1", className), children: [0, 1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5731
5568
|
"div",
|
|
5732
5569
|
{
|
|
5733
5570
|
className: cn(
|
|
@@ -5749,7 +5586,7 @@ var LoadingBar = ({
|
|
|
5749
5586
|
label
|
|
5750
5587
|
}) => {
|
|
5751
5588
|
const pct = progress ? Math.min(Math.max(progress, 0), 100) : void 0;
|
|
5752
|
-
return /* @__PURE__ */ (0,
|
|
5589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5753
5590
|
"div",
|
|
5754
5591
|
{
|
|
5755
5592
|
className: cn("w-full bg-muted rounded-full h-2", className),
|
|
@@ -5758,7 +5595,7 @@ var LoadingBar = ({
|
|
|
5758
5595
|
"aria-valuemax": pct === void 0 ? void 0 : 100,
|
|
5759
5596
|
"aria-valuenow": pct === void 0 ? void 0 : Math.round(pct),
|
|
5760
5597
|
"aria-label": label || "Loading",
|
|
5761
|
-
children: /* @__PURE__ */ (0,
|
|
5598
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5762
5599
|
"div",
|
|
5763
5600
|
{
|
|
5764
5601
|
className: cn(
|
|
@@ -5775,10 +5612,10 @@ var LoadingBar = ({
|
|
|
5775
5612
|
};
|
|
5776
5613
|
|
|
5777
5614
|
// ../../components/ui/Table.tsx
|
|
5778
|
-
var
|
|
5779
|
-
var
|
|
5780
|
-
var Table =
|
|
5781
|
-
({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5615
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
5616
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
5617
|
+
var Table = import_react19.default.forwardRef(
|
|
5618
|
+
({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5782
5619
|
"div",
|
|
5783
5620
|
{
|
|
5784
5621
|
className: cn(
|
|
@@ -5788,7 +5625,7 @@ var Table = import_react20.default.forwardRef(
|
|
|
5788
5625
|
"backdrop-blur-sm transition-all duration-300",
|
|
5789
5626
|
containerClassName
|
|
5790
5627
|
),
|
|
5791
|
-
children: /* @__PURE__ */ (0,
|
|
5628
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5792
5629
|
"table",
|
|
5793
5630
|
{
|
|
5794
5631
|
ref,
|
|
@@ -5800,8 +5637,8 @@ var Table = import_react20.default.forwardRef(
|
|
|
5800
5637
|
)
|
|
5801
5638
|
);
|
|
5802
5639
|
Table.displayName = "Table";
|
|
5803
|
-
var TableHeader =
|
|
5804
|
-
({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5640
|
+
var TableHeader = import_react19.default.forwardRef(
|
|
5641
|
+
({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
5805
5642
|
"thead",
|
|
5806
5643
|
{
|
|
5807
5644
|
ref,
|
|
@@ -5819,7 +5656,7 @@ var TableHeader = import_react20.default.forwardRef(
|
|
|
5819
5656
|
)
|
|
5820
5657
|
);
|
|
5821
5658
|
TableHeader.displayName = "TableHeader";
|
|
5822
|
-
var TableBody =
|
|
5659
|
+
var TableBody = import_react19.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5823
5660
|
"tbody",
|
|
5824
5661
|
{
|
|
5825
5662
|
ref,
|
|
@@ -5828,7 +5665,7 @@ var TableBody = import_react20.default.forwardRef(({ className, ...props }, ref)
|
|
|
5828
5665
|
}
|
|
5829
5666
|
));
|
|
5830
5667
|
TableBody.displayName = "TableBody";
|
|
5831
|
-
var TableFooter =
|
|
5668
|
+
var TableFooter = import_react19.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5832
5669
|
"tfoot",
|
|
5833
5670
|
{
|
|
5834
5671
|
ref,
|
|
@@ -5840,7 +5677,7 @@ var TableFooter = import_react20.default.forwardRef(({ className, ...props }, re
|
|
|
5840
5677
|
}
|
|
5841
5678
|
));
|
|
5842
5679
|
TableFooter.displayName = "TableFooter";
|
|
5843
|
-
var TableRow =
|
|
5680
|
+
var TableRow = import_react19.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5844
5681
|
"tr",
|
|
5845
5682
|
{
|
|
5846
5683
|
ref,
|
|
@@ -5854,7 +5691,7 @@ var TableRow = import_react20.default.forwardRef(({ className, ...props }, ref)
|
|
|
5854
5691
|
}
|
|
5855
5692
|
));
|
|
5856
5693
|
TableRow.displayName = "TableRow";
|
|
5857
|
-
var TableHead =
|
|
5694
|
+
var TableHead = import_react19.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5858
5695
|
"th",
|
|
5859
5696
|
{
|
|
5860
5697
|
ref,
|
|
@@ -5866,7 +5703,7 @@ var TableHead = import_react20.default.forwardRef(({ className, ...props }, ref)
|
|
|
5866
5703
|
}
|
|
5867
5704
|
));
|
|
5868
5705
|
TableHead.displayName = "TableHead";
|
|
5869
|
-
var TableCell =
|
|
5706
|
+
var TableCell = import_react19.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5870
5707
|
"td",
|
|
5871
5708
|
{
|
|
5872
5709
|
ref,
|
|
@@ -5875,7 +5712,7 @@ var TableCell = import_react20.default.forwardRef(({ className, ...props }, ref)
|
|
|
5875
5712
|
}
|
|
5876
5713
|
));
|
|
5877
5714
|
TableCell.displayName = "TableCell";
|
|
5878
|
-
var TableCaption =
|
|
5715
|
+
var TableCaption = import_react19.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5879
5716
|
"caption",
|
|
5880
5717
|
{
|
|
5881
5718
|
ref,
|
|
@@ -5886,13 +5723,13 @@ var TableCaption = import_react20.default.forwardRef(({ className, ...props }, r
|
|
|
5886
5723
|
TableCaption.displayName = "TableCaption";
|
|
5887
5724
|
|
|
5888
5725
|
// ../../components/ui/DataTable.tsx
|
|
5889
|
-
var
|
|
5890
|
-
var
|
|
5726
|
+
var import_lucide_react20 = require("lucide-react");
|
|
5727
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
5891
5728
|
var import_next_intl7 = require("next-intl");
|
|
5892
|
-
var
|
|
5729
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5893
5730
|
function useDebounced(value, delay = 300) {
|
|
5894
|
-
const [debounced, setDebounced] =
|
|
5895
|
-
|
|
5731
|
+
const [debounced, setDebounced] = import_react20.default.useState(value);
|
|
5732
|
+
import_react20.default.useEffect(() => {
|
|
5896
5733
|
const id = setTimeout(() => setDebounced(value), delay);
|
|
5897
5734
|
return () => clearTimeout(id);
|
|
5898
5735
|
}, [value, delay]);
|
|
@@ -5913,17 +5750,18 @@ function DataTable({
|
|
|
5913
5750
|
enableDensityToggle = true,
|
|
5914
5751
|
striped = true,
|
|
5915
5752
|
// Mặc định bật màu nền sẽn kẽ cho các dòng
|
|
5916
|
-
className
|
|
5753
|
+
className,
|
|
5754
|
+
labels
|
|
5917
5755
|
}) {
|
|
5918
5756
|
const t = (0, import_next_intl7.useTranslations)("Common");
|
|
5919
|
-
const [visibleCols, setVisibleCols] =
|
|
5920
|
-
const [filters, setFilters] =
|
|
5921
|
-
const [sort, setSort] =
|
|
5922
|
-
const [density, setDensity] =
|
|
5923
|
-
const [curPage, setCurPage] =
|
|
5924
|
-
const [curPageSize, setCurPageSize] =
|
|
5757
|
+
const [visibleCols, setVisibleCols] = import_react20.default.useState(() => columns.filter((c) => c.visible !== false).map((c) => c.key));
|
|
5758
|
+
const [filters, setFilters] = import_react20.default.useState({});
|
|
5759
|
+
const [sort, setSort] = import_react20.default.useState(null);
|
|
5760
|
+
const [density, setDensity] = import_react20.default.useState("normal");
|
|
5761
|
+
const [curPage, setCurPage] = import_react20.default.useState(page);
|
|
5762
|
+
const [curPageSize, setCurPageSize] = import_react20.default.useState(pageSize);
|
|
5925
5763
|
const debouncedFilters = useDebounced(filters, 350);
|
|
5926
|
-
|
|
5764
|
+
import_react20.default.useEffect(() => {
|
|
5927
5765
|
if (!onQueryChange) return;
|
|
5928
5766
|
onQueryChange({ filters: debouncedFilters, sort, page: curPage, pageSize: curPageSize });
|
|
5929
5767
|
}, [debouncedFilters, sort, curPage, curPageSize]);
|
|
@@ -5942,7 +5780,7 @@ function DataTable({
|
|
|
5942
5780
|
className: "h-8 w-full text-sm"
|
|
5943
5781
|
};
|
|
5944
5782
|
if (col.filter.type === "text") {
|
|
5945
|
-
return /* @__PURE__ */ (0,
|
|
5783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5946
5784
|
Input_default,
|
|
5947
5785
|
{
|
|
5948
5786
|
...commonProps,
|
|
@@ -5957,7 +5795,7 @@ function DataTable({
|
|
|
5957
5795
|
}
|
|
5958
5796
|
if (col.filter.type === "select") {
|
|
5959
5797
|
const options = col.filter.options || [];
|
|
5960
|
-
return /* @__PURE__ */ (0,
|
|
5798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5961
5799
|
Combobox,
|
|
5962
5800
|
{
|
|
5963
5801
|
options: ["", ...options],
|
|
@@ -5973,7 +5811,7 @@ function DataTable({
|
|
|
5973
5811
|
);
|
|
5974
5812
|
}
|
|
5975
5813
|
if (col.filter.type === "date") {
|
|
5976
|
-
return /* @__PURE__ */ (0,
|
|
5814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5977
5815
|
DatePicker,
|
|
5978
5816
|
{
|
|
5979
5817
|
placeholder: col.filter.placeholder || `Select ${String(col.title)}`,
|
|
@@ -5987,15 +5825,15 @@ function DataTable({
|
|
|
5987
5825
|
}
|
|
5988
5826
|
return null;
|
|
5989
5827
|
};
|
|
5990
|
-
const renderHeader = /* @__PURE__ */ (0,
|
|
5828
|
+
const renderHeader = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TableRow, { children: visibleColumns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5991
5829
|
TableHead,
|
|
5992
5830
|
{
|
|
5993
5831
|
style: { width: col.width },
|
|
5994
5832
|
className: cn(col.align === "right" && "text-right", col.align === "center" && "text-center"),
|
|
5995
|
-
children: /* @__PURE__ */ (0,
|
|
5996
|
-
/* @__PURE__ */ (0,
|
|
5997
|
-
/* @__PURE__ */ (0,
|
|
5998
|
-
col.sortable && /* @__PURE__ */ (0,
|
|
5833
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between gap-2 select-none min-h-[2.5rem]", children: [
|
|
5834
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-1 min-w-0 flex-1", children: [
|
|
5835
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "truncate font-medium text-sm", children: col.title }),
|
|
5836
|
+
col.sortable && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5999
5837
|
"button",
|
|
6000
5838
|
{
|
|
6001
5839
|
className: cn(
|
|
@@ -6012,8 +5850,8 @@ function DataTable({
|
|
|
6012
5850
|
},
|
|
6013
5851
|
"aria-label": "Sort",
|
|
6014
5852
|
title: `Sort by ${String(col.title)}`,
|
|
6015
|
-
children: /* @__PURE__ */ (0,
|
|
6016
|
-
/* @__PURE__ */ (0,
|
|
5853
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "none", className: "inline-block", children: [
|
|
5854
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6017
5855
|
"path",
|
|
6018
5856
|
{
|
|
6019
5857
|
d: "M7 8l3-3 3 3",
|
|
@@ -6024,7 +5862,7 @@ function DataTable({
|
|
|
6024
5862
|
opacity: sort?.key === col.key && sort.order === "asc" ? 1 : 0.4
|
|
6025
5863
|
}
|
|
6026
5864
|
),
|
|
6027
|
-
/* @__PURE__ */ (0,
|
|
5865
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6028
5866
|
"path",
|
|
6029
5867
|
{
|
|
6030
5868
|
d: "M7 12l3 3 3-3",
|
|
@@ -6039,11 +5877,11 @@ function DataTable({
|
|
|
6039
5877
|
}
|
|
6040
5878
|
)
|
|
6041
5879
|
] }),
|
|
6042
|
-
col.filter && /* @__PURE__ */ (0,
|
|
5880
|
+
col.filter && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6043
5881
|
Popover,
|
|
6044
5882
|
{
|
|
6045
5883
|
placement: "bottom-start",
|
|
6046
|
-
trigger: /* @__PURE__ */ (0,
|
|
5884
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6047
5885
|
"button",
|
|
6048
5886
|
{
|
|
6049
5887
|
className: cn(
|
|
@@ -6053,16 +5891,16 @@ function DataTable({
|
|
|
6053
5891
|
),
|
|
6054
5892
|
"aria-label": "Filter",
|
|
6055
5893
|
title: "Filter",
|
|
6056
|
-
children: /* @__PURE__ */ (0,
|
|
5894
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react20.Filter, { className: "h-4 w-4" })
|
|
6057
5895
|
}
|
|
6058
5896
|
),
|
|
6059
|
-
children: /* @__PURE__ */ (0,
|
|
6060
|
-
/* @__PURE__ */ (0,
|
|
5897
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "w-48 p-2 space-y-2", children: [
|
|
5898
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "text-xs font-medium text-muted-foreground mb-2", children: [
|
|
6061
5899
|
"Filter ",
|
|
6062
5900
|
col.title
|
|
6063
5901
|
] }),
|
|
6064
5902
|
renderFilterControl(col),
|
|
6065
|
-
filters[col.key] && /* @__PURE__ */ (0,
|
|
5903
|
+
filters[col.key] && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6066
5904
|
"button",
|
|
6067
5905
|
{
|
|
6068
5906
|
onClick: () => {
|
|
@@ -6084,29 +5922,29 @@ function DataTable({
|
|
|
6084
5922
|
},
|
|
6085
5923
|
col.key
|
|
6086
5924
|
)) });
|
|
6087
|
-
return /* @__PURE__ */ (0,
|
|
6088
|
-
/* @__PURE__ */ (0,
|
|
6089
|
-
/* @__PURE__ */ (0,
|
|
6090
|
-
/* @__PURE__ */ (0,
|
|
6091
|
-
enableDensityToggle && /* @__PURE__ */ (0,
|
|
5925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("space-y-2", className), children: [
|
|
5926
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between gap-4 mb-1", children: [
|
|
5927
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "text-sm text-muted-foreground", children: caption }),
|
|
5928
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5929
|
+
enableDensityToggle && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6092
5930
|
DropdownMenu_default,
|
|
6093
5931
|
{
|
|
6094
|
-
trigger: /* @__PURE__ */ (0,
|
|
6095
|
-
/* @__PURE__ */ (0,
|
|
6096
|
-
t("density")
|
|
5932
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Button_default, { variant: "ghost", size: "sm", className: "h-8 px-2", children: [
|
|
5933
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("svg", { className: "w-4 h-4 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }),
|
|
5934
|
+
labels?.density || t("density")
|
|
6097
5935
|
] }),
|
|
6098
5936
|
items: [
|
|
6099
|
-
{ label: t("compact"), onClick: () => setDensity("compact") },
|
|
6100
|
-
{ label: t("normal"), onClick: () => setDensity("normal") },
|
|
6101
|
-
{ label: t("comfortable"), onClick: () => setDensity("comfortable") }
|
|
5937
|
+
{ label: labels?.compact || t("compact"), onClick: () => setDensity("compact") },
|
|
5938
|
+
{ label: labels?.normal || t("normal"), onClick: () => setDensity("normal") },
|
|
5939
|
+
{ label: labels?.comfortable || t("comfortable"), onClick: () => setDensity("comfortable") }
|
|
6102
5940
|
]
|
|
6103
5941
|
}
|
|
6104
5942
|
),
|
|
6105
|
-
enableColumnVisibilityToggle && /* @__PURE__ */ (0,
|
|
5943
|
+
enableColumnVisibilityToggle && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6106
5944
|
DropdownMenu_default,
|
|
6107
5945
|
{
|
|
6108
|
-
trigger: /* @__PURE__ */ (0,
|
|
6109
|
-
/* @__PURE__ */ (0,
|
|
5946
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Button_default, { variant: "ghost", size: "sm", className: "h-8 px-2", children: [
|
|
5947
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("svg", { className: "w-4 h-4 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6110
5948
|
"path",
|
|
6111
5949
|
{
|
|
6112
5950
|
strokeLinecap: "round",
|
|
@@ -6115,17 +5953,17 @@ function DataTable({
|
|
|
6115
5953
|
d: "M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7m0 10a2 2 0 002 2h2a2 2 0 002-2V7a2 2 0 00-2-2h-2a2 2 0 00-2 2"
|
|
6116
5954
|
}
|
|
6117
5955
|
) }),
|
|
6118
|
-
t("columns")
|
|
5956
|
+
labels?.columns || t("columns")
|
|
6119
5957
|
] }),
|
|
6120
|
-
children: columns.map((c) => /* @__PURE__ */ (0,
|
|
5958
|
+
children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
6121
5959
|
DropdownMenuItem,
|
|
6122
5960
|
{
|
|
6123
5961
|
onClick: () => {
|
|
6124
5962
|
setVisibleCols((prev) => prev.includes(c.key) ? prev.filter((k) => k !== c.key) : [...prev, c.key]);
|
|
6125
5963
|
},
|
|
6126
5964
|
children: [
|
|
6127
|
-
/* @__PURE__ */ (0,
|
|
6128
|
-
/* @__PURE__ */ (0,
|
|
5965
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", { type: "checkbox", className: "mr-2 rounded border-border", readOnly: true, checked: visibleCols.includes(c.key) }),
|
|
5966
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "truncate", children: c.title })
|
|
6129
5967
|
]
|
|
6130
5968
|
},
|
|
6131
5969
|
c.key
|
|
@@ -6135,17 +5973,17 @@ function DataTable({
|
|
|
6135
5973
|
toolbar
|
|
6136
5974
|
] })
|
|
6137
5975
|
] }),
|
|
6138
|
-
/* @__PURE__ */ (0,
|
|
5976
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: cn("relative rounded-lg border border-border/50 overflow-hidden", loading2 && "opacity-60 pointer-events-none"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
6139
5977
|
Table,
|
|
6140
5978
|
{
|
|
6141
5979
|
containerClassName: "border-0 rounded-none shadow-none",
|
|
6142
5980
|
className: "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-[5] [&_thead]:bg-background [&_thead]:backdrop-blur-sm",
|
|
6143
5981
|
children: [
|
|
6144
|
-
/* @__PURE__ */ (0,
|
|
6145
|
-
/* @__PURE__ */ (0,
|
|
6146
|
-
/* @__PURE__ */ (0,
|
|
6147
|
-
/* @__PURE__ */ (0,
|
|
6148
|
-
/* @__PURE__ */ (0,
|
|
5982
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TableHeader, { children: renderHeader }),
|
|
5983
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TableBody, { children: loading2 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TableCell, { colSpan: visibleColumns.length, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-center gap-2 text-muted-foreground", children: [
|
|
5984
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("svg", { className: "animate-spin h-4 w-4", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
5985
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
5986
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6149
5987
|
"path",
|
|
6150
5988
|
{
|
|
6151
5989
|
className: "opacity-75",
|
|
@@ -6154,10 +5992,10 @@ function DataTable({
|
|
|
6154
5992
|
}
|
|
6155
5993
|
)
|
|
6156
5994
|
] }),
|
|
6157
|
-
/* @__PURE__ */ (0,
|
|
6158
|
-
] }) }) }) : !data || data.length === 0 ? /* @__PURE__ */ (0,
|
|
5995
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-sm", children: "Loading..." })
|
|
5996
|
+
] }) }) }) : !data || data.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TableCell, { colSpan: visibleColumns.length, className: "text-center py-6 text-muted-foreground", children: "No data" }) }) : data.map((row, idx) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/30"), children: visibleColumns.map((col) => {
|
|
6159
5997
|
const value = col.dataIndex ? row[col.dataIndex] : void 0;
|
|
6160
|
-
return /* @__PURE__ */ (0,
|
|
5998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6161
5999
|
TableCell,
|
|
6162
6000
|
{
|
|
6163
6001
|
className: cn(
|
|
@@ -6175,7 +6013,7 @@ function DataTable({
|
|
|
6175
6013
|
]
|
|
6176
6014
|
}
|
|
6177
6015
|
) }),
|
|
6178
|
-
total > 0 && /* @__PURE__ */ (0,
|
|
6016
|
+
total > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "border-t bg-muted/30 p-4 rounded-b-lg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6179
6017
|
Pagination,
|
|
6180
6018
|
{
|
|
6181
6019
|
page: curPage,
|
|
@@ -6192,10 +6030,10 @@ function DataTable({
|
|
|
6192
6030
|
var DataTable_default = DataTable;
|
|
6193
6031
|
|
|
6194
6032
|
// ../../components/ui/NotificationModal.tsx
|
|
6195
|
-
var
|
|
6033
|
+
var import_lucide_react21 = require("lucide-react");
|
|
6196
6034
|
var import_next_intl8 = require("next-intl");
|
|
6197
|
-
var
|
|
6198
|
-
function NotificationModal({ isOpen, onClose, notification }) {
|
|
6035
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6036
|
+
function NotificationModal({ isOpen, onClose, notification, titleText, openLinkText, closeText }) {
|
|
6199
6037
|
const t = (0, import_next_intl8.useTranslations)("Common");
|
|
6200
6038
|
if (!notification) return null;
|
|
6201
6039
|
const formatTime2 = (dateString) => {
|
|
@@ -6215,26 +6053,26 @@ function NotificationModal({ isOpen, onClose, notification }) {
|
|
|
6215
6053
|
onClose();
|
|
6216
6054
|
}
|
|
6217
6055
|
};
|
|
6218
|
-
return /* @__PURE__ */ (0,
|
|
6056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6219
6057
|
Modal_default,
|
|
6220
6058
|
{
|
|
6221
6059
|
isOpen,
|
|
6222
6060
|
onClose,
|
|
6223
|
-
title: t("notifications"),
|
|
6061
|
+
title: titleText || t("notifications"),
|
|
6224
6062
|
size: "md",
|
|
6225
|
-
children: /* @__PURE__ */ (0,
|
|
6226
|
-
/* @__PURE__ */ (0,
|
|
6227
|
-
/* @__PURE__ */ (0,
|
|
6063
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "space-y-4", children: [
|
|
6064
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2 pb-2 border-b border-border", children: [
|
|
6065
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn(
|
|
6228
6066
|
"w-2 h-2 rounded-full",
|
|
6229
6067
|
!notification.is_read ? "bg-primary" : "bg-border"
|
|
6230
6068
|
) }),
|
|
6231
|
-
/* @__PURE__ */ (0,
|
|
6069
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-xs text-muted-foreground", children: !notification.is_read ? t("newNotification") : t("readStatus") })
|
|
6232
6070
|
] }),
|
|
6233
|
-
notification.title && /* @__PURE__ */ (0,
|
|
6234
|
-
notification.body && /* @__PURE__ */ (0,
|
|
6235
|
-
/* @__PURE__ */ (0,
|
|
6236
|
-
/* @__PURE__ */ (0,
|
|
6237
|
-
hasLink && /* @__PURE__ */ (0,
|
|
6071
|
+
notification.title && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h3", { className: "text-lg font-semibold text-foreground", children: notification.title }),
|
|
6072
|
+
notification.body && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "text-sm text-muted-foreground whitespace-pre-wrap leading-relaxed", children: notification.body }),
|
|
6073
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "text-xs text-muted-foreground border-t border-border pt-2", children: formatTime2(notification.created_at) }),
|
|
6074
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex gap-2 justify-end pt-2", children: [
|
|
6075
|
+
hasLink && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6238
6076
|
Button_default,
|
|
6239
6077
|
{
|
|
6240
6078
|
variant: "primary",
|
|
@@ -6242,18 +6080,18 @@ function NotificationModal({ isOpen, onClose, notification }) {
|
|
|
6242
6080
|
onClick: handleLinkClick,
|
|
6243
6081
|
className: "gap-2",
|
|
6244
6082
|
children: [
|
|
6245
|
-
/* @__PURE__ */ (0,
|
|
6246
|
-
t("openLink")
|
|
6083
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.ExternalLink, { className: "w-4 h-4" }),
|
|
6084
|
+
openLinkText || t("openLink")
|
|
6247
6085
|
]
|
|
6248
6086
|
}
|
|
6249
6087
|
),
|
|
6250
|
-
/* @__PURE__ */ (0,
|
|
6088
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6251
6089
|
Button_default,
|
|
6252
6090
|
{
|
|
6253
6091
|
variant: "ghost",
|
|
6254
6092
|
size: "sm",
|
|
6255
6093
|
onClick: onClose,
|
|
6256
|
-
children: t("close")
|
|
6094
|
+
children: closeText || t("close")
|
|
6257
6095
|
}
|
|
6258
6096
|
)
|
|
6259
6097
|
] })
|
|
@@ -6266,13 +6104,13 @@ var NotificationModal_default = NotificationModal;
|
|
|
6266
6104
|
// ../../components/ui/FloatingContacts.tsx
|
|
6267
6105
|
var import_link2 = __toESM(require("next/link"), 1);
|
|
6268
6106
|
var import_navigation = require("next/navigation");
|
|
6269
|
-
var
|
|
6107
|
+
var import_lucide_react22 = require("lucide-react");
|
|
6270
6108
|
|
|
6271
6109
|
// ../../node_modules/react-icons/lib/iconBase.mjs
|
|
6272
|
-
var
|
|
6110
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
6273
6111
|
|
|
6274
6112
|
// ../../node_modules/react-icons/lib/iconContext.mjs
|
|
6275
|
-
var
|
|
6113
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
6276
6114
|
var DefaultContext = {
|
|
6277
6115
|
color: void 0,
|
|
6278
6116
|
size: void 0,
|
|
@@ -6280,7 +6118,7 @@ var DefaultContext = {
|
|
|
6280
6118
|
style: void 0,
|
|
6281
6119
|
attr: void 0
|
|
6282
6120
|
};
|
|
6283
|
-
var IconContext =
|
|
6121
|
+
var IconContext = import_react21.default.createContext && /* @__PURE__ */ import_react21.default.createContext(DefaultContext);
|
|
6284
6122
|
|
|
6285
6123
|
// ../../node_modules/react-icons/lib/iconBase.mjs
|
|
6286
6124
|
var _excluded = ["attr", "size", "title"];
|
|
@@ -6369,12 +6207,12 @@ function _toPrimitive(t, r) {
|
|
|
6369
6207
|
return ("string" === r ? String : Number)(t);
|
|
6370
6208
|
}
|
|
6371
6209
|
function Tree2Element(tree) {
|
|
6372
|
-
return tree && tree.map((node, i) => /* @__PURE__ */
|
|
6210
|
+
return tree && tree.map((node, i) => /* @__PURE__ */ import_react22.default.createElement(node.tag, _objectSpread({
|
|
6373
6211
|
key: i
|
|
6374
6212
|
}, node.attr), Tree2Element(node.child)));
|
|
6375
6213
|
}
|
|
6376
6214
|
function GenIcon(data) {
|
|
6377
|
-
return (props) => /* @__PURE__ */
|
|
6215
|
+
return (props) => /* @__PURE__ */ import_react22.default.createElement(IconBase, _extends({
|
|
6378
6216
|
attr: _objectSpread({}, data.attr)
|
|
6379
6217
|
}, props), Tree2Element(data.child));
|
|
6380
6218
|
}
|
|
@@ -6389,7 +6227,7 @@ function IconBase(props) {
|
|
|
6389
6227
|
var className;
|
|
6390
6228
|
if (conf.className) className = conf.className;
|
|
6391
6229
|
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
6392
|
-
return /* @__PURE__ */
|
|
6230
|
+
return /* @__PURE__ */ import_react22.default.createElement("svg", _extends({
|
|
6393
6231
|
stroke: "currentColor",
|
|
6394
6232
|
fill: "currentColor",
|
|
6395
6233
|
strokeWidth: "0"
|
|
@@ -6401,9 +6239,9 @@ function IconBase(props) {
|
|
|
6401
6239
|
height: computedSize,
|
|
6402
6240
|
width: computedSize,
|
|
6403
6241
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6404
|
-
}), title && /* @__PURE__ */
|
|
6242
|
+
}), title && /* @__PURE__ */ import_react22.default.createElement("title", null, title), props.children);
|
|
6405
6243
|
};
|
|
6406
|
-
return IconContext !== void 0 ? /* @__PURE__ */
|
|
6244
|
+
return IconContext !== void 0 ? /* @__PURE__ */ import_react22.default.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
|
6407
6245
|
}
|
|
6408
6246
|
|
|
6409
6247
|
// ../../node_modules/react-icons/fa/index.mjs
|
|
@@ -6417,9 +6255,9 @@ function SiZalo(props) {
|
|
|
6417
6255
|
}
|
|
6418
6256
|
|
|
6419
6257
|
// ../../components/ui/FloatingContacts.tsx
|
|
6420
|
-
var
|
|
6258
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6421
6259
|
function MessengerIcon(props) {
|
|
6422
|
-
return /* @__PURE__ */ (0,
|
|
6260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("svg", { viewBox: "0 0 24 24", width: 24, height: 24, "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6423
6261
|
"path",
|
|
6424
6262
|
{
|
|
6425
6263
|
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",
|
|
@@ -6428,10 +6266,10 @@ function MessengerIcon(props) {
|
|
|
6428
6266
|
) });
|
|
6429
6267
|
}
|
|
6430
6268
|
function ZaloIcon(props) {
|
|
6431
|
-
return /* @__PURE__ */ (0,
|
|
6269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SiZalo, { size: 20, ...props });
|
|
6432
6270
|
}
|
|
6433
6271
|
function InstagramIcon(props) {
|
|
6434
|
-
return /* @__PURE__ */ (0,
|
|
6272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FaInstagram, { size: 20, ...props });
|
|
6435
6273
|
}
|
|
6436
6274
|
function FloatingContacts({ className }) {
|
|
6437
6275
|
const pathname = (0, import_navigation.usePathname)();
|
|
@@ -6466,8 +6304,8 @@ function FloatingContacts({ className }) {
|
|
|
6466
6304
|
external: true
|
|
6467
6305
|
}
|
|
6468
6306
|
];
|
|
6469
|
-
return /* @__PURE__ */ (0,
|
|
6470
|
-
/* @__PURE__ */ (0,
|
|
6307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("fixed bottom-6 right-4 z-[100000]", "flex flex-col items-end gap-3", className), "aria-label": "Quick contacts", children: [
|
|
6308
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6471
6309
|
import_link2.default,
|
|
6472
6310
|
{
|
|
6473
6311
|
href: `tel:${hotline.replace(/\D/g, "")}`,
|
|
@@ -6478,10 +6316,10 @@ function FloatingContacts({ className }) {
|
|
|
6478
6316
|
"hover:scale-105 active:scale-95 transition-transform",
|
|
6479
6317
|
"bg-[#22c55e]"
|
|
6480
6318
|
),
|
|
6481
|
-
children: /* @__PURE__ */ (0,
|
|
6319
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Phone, { className: "w-6 h-6" })
|
|
6482
6320
|
}
|
|
6483
6321
|
),
|
|
6484
|
-
moreItems.map(({ key, href, label, bg, Icon, external }) => /* @__PURE__ */ (0,
|
|
6322
|
+
moreItems.map(({ key, href, label, bg, Icon, external }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6485
6323
|
import_link2.default,
|
|
6486
6324
|
{
|
|
6487
6325
|
href,
|
|
@@ -6493,7 +6331,7 @@ function FloatingContacts({ className }) {
|
|
|
6493
6331
|
"hover:scale-105 active:scale-95 transition-transform",
|
|
6494
6332
|
bg
|
|
6495
6333
|
),
|
|
6496
|
-
children: /* @__PURE__ */ (0,
|
|
6334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { className: "w-6 h-6" })
|
|
6497
6335
|
},
|
|
6498
6336
|
key
|
|
6499
6337
|
))
|
|
@@ -6501,17 +6339,17 @@ function FloatingContacts({ className }) {
|
|
|
6501
6339
|
}
|
|
6502
6340
|
|
|
6503
6341
|
// ../../components/ui/AccessDenied.tsx
|
|
6504
|
-
var
|
|
6505
|
-
var
|
|
6342
|
+
var import_lucide_react23 = require("lucide-react");
|
|
6343
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6506
6344
|
var VARIANT_STYLES = {
|
|
6507
6345
|
destructive: { bg: "bg-destructive/5", border: "border-destructive/20", text: "text-destructive" },
|
|
6508
6346
|
warning: { bg: "bg-warning/5", border: "border-warning/20", text: "text-warning" },
|
|
6509
6347
|
info: { bg: "bg-info/5", border: "border-info/20", text: "text-info" }
|
|
6510
6348
|
};
|
|
6511
6349
|
var DEFAULT_ICONS = {
|
|
6512
|
-
destructive:
|
|
6513
|
-
warning:
|
|
6514
|
-
info:
|
|
6350
|
+
destructive: import_lucide_react23.ShieldAlert,
|
|
6351
|
+
warning: import_lucide_react23.Ban,
|
|
6352
|
+
info: import_lucide_react23.Lock
|
|
6515
6353
|
};
|
|
6516
6354
|
function AccessDenied({
|
|
6517
6355
|
title = "Access Restricted",
|
|
@@ -6523,15 +6361,147 @@ function AccessDenied({
|
|
|
6523
6361
|
}) {
|
|
6524
6362
|
const styles = VARIANT_STYLES[variant];
|
|
6525
6363
|
const UsedIcon = Icon || DEFAULT_ICONS[variant];
|
|
6526
|
-
return /* @__PURE__ */ (0,
|
|
6527
|
-
/* @__PURE__ */ (0,
|
|
6528
|
-
/* @__PURE__ */ (0,
|
|
6529
|
-
/* @__PURE__ */ (0,
|
|
6530
|
-
/* @__PURE__ */ (0,
|
|
6364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Card_default, { className: cn("p-8 text-center shadow-sm", styles.bg, styles.border, className), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [
|
|
6365
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: cn("p-3 rounded-lg", styles.bg.replace("/5", "/10")), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(UsedIcon, { className: cn("w-8 h-8", styles.text) }) }),
|
|
6366
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
6367
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h3", { className: cn("font-semibold mb-2", styles.text), children: title }),
|
|
6368
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: cn(styles.text.replace("text-", "text-") + "/80", "text-sm"), children: description })
|
|
6531
6369
|
] }),
|
|
6532
|
-
children && /* @__PURE__ */ (0,
|
|
6370
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "mt-2 flex flex-wrap gap-2 justify-center", children })
|
|
6533
6371
|
] }) });
|
|
6534
6372
|
}
|
|
6373
|
+
|
|
6374
|
+
// locales/en.json
|
|
6375
|
+
var en_default = {
|
|
6376
|
+
Common: {
|
|
6377
|
+
close: "Close",
|
|
6378
|
+
closeAlert: "Close alert",
|
|
6379
|
+
notifications: "Notifications",
|
|
6380
|
+
newNotification: "New",
|
|
6381
|
+
readStatus: "Read",
|
|
6382
|
+
openLink: "Open link",
|
|
6383
|
+
theme: "Theme",
|
|
6384
|
+
lightTheme: "Light",
|
|
6385
|
+
darkTheme: "Dark",
|
|
6386
|
+
systemTheme: "System",
|
|
6387
|
+
density: "Density",
|
|
6388
|
+
compact: "Compact",
|
|
6389
|
+
normal: "Normal",
|
|
6390
|
+
comfortable: "Comfortable",
|
|
6391
|
+
columns: "Columns"
|
|
6392
|
+
},
|
|
6393
|
+
ValidationInput: {
|
|
6394
|
+
required: "This field is required",
|
|
6395
|
+
typeMismatch: "Invalid format",
|
|
6396
|
+
pattern: "Invalid pattern",
|
|
6397
|
+
tooShort: "Too short",
|
|
6398
|
+
tooLong: "Too long",
|
|
6399
|
+
rangeUnderflow: "Below minimum",
|
|
6400
|
+
rangeOverflow: "Above maximum",
|
|
6401
|
+
stepMismatch: "Step mismatch",
|
|
6402
|
+
badInput: "Bad input",
|
|
6403
|
+
invalid: "Invalid value"
|
|
6404
|
+
},
|
|
6405
|
+
Loading: {
|
|
6406
|
+
loadingPage: "Loading page",
|
|
6407
|
+
pleaseWait: "Please wait"
|
|
6408
|
+
},
|
|
6409
|
+
DatePicker: {
|
|
6410
|
+
placeholder: "Select date",
|
|
6411
|
+
today: "Today",
|
|
6412
|
+
clear: "Clear"
|
|
6413
|
+
},
|
|
6414
|
+
Pagination: {
|
|
6415
|
+
navigationLabel: "Pagination navigation",
|
|
6416
|
+
showingResults: "Showing {startItem}\u2013{endItem} of {totalItems}",
|
|
6417
|
+
firstPage: "First page",
|
|
6418
|
+
previousPage: "Previous page",
|
|
6419
|
+
previous: "Previous",
|
|
6420
|
+
nextPage: "Next page",
|
|
6421
|
+
next: "Next",
|
|
6422
|
+
lastPage: "Last page",
|
|
6423
|
+
pageNumber: "Page {page}",
|
|
6424
|
+
itemsPerPage: "Items per page",
|
|
6425
|
+
search: "Search",
|
|
6426
|
+
noOptions: "No options"
|
|
6427
|
+
},
|
|
6428
|
+
OCR: {
|
|
6429
|
+
imageUpload: {
|
|
6430
|
+
dragDropText: "Drag & drop files here",
|
|
6431
|
+
browseFiles: "Browse files",
|
|
6432
|
+
supportedFormats: "Supported formats: images"
|
|
6433
|
+
}
|
|
6434
|
+
}
|
|
6435
|
+
};
|
|
6436
|
+
|
|
6437
|
+
// locales/vi.json
|
|
6438
|
+
var vi_default = {
|
|
6439
|
+
Common: {
|
|
6440
|
+
close: "\u0110\xF3ng",
|
|
6441
|
+
closeAlert: "\u0110\xF3ng c\u1EA3nh b\xE1o",
|
|
6442
|
+
notifications: "Th\xF4ng b\xE1o",
|
|
6443
|
+
newNotification: "M\u1EDBi",
|
|
6444
|
+
readStatus: "\u0110\xE3 \u0111\u1ECDc",
|
|
6445
|
+
openLink: "M\u1EDF li\xEAn k\u1EBFt",
|
|
6446
|
+
theme: "Ch\u1EE7 \u0111\u1EC1",
|
|
6447
|
+
lightTheme: "Giao di\u1EC7n s\xE1ng",
|
|
6448
|
+
darkTheme: "Giao di\u1EC7n t\u1ED1i",
|
|
6449
|
+
systemTheme: "Theo h\u1EC7 th\u1ED1ng",
|
|
6450
|
+
density: "M\u1EADt \u0111\u1ED9",
|
|
6451
|
+
compact: "G\u1ECDn",
|
|
6452
|
+
normal: "Th\u01B0\u1EDDng",
|
|
6453
|
+
comfortable: "Tho\u1EA3i m\xE1i",
|
|
6454
|
+
columns: "C\u1ED9t"
|
|
6455
|
+
},
|
|
6456
|
+
ValidationInput: {
|
|
6457
|
+
required: "Tr\u01B0\u1EDDng n\xE0y l\xE0 b\u1EAFt bu\u1ED9c",
|
|
6458
|
+
typeMismatch: "\u0110\u1ECBnh d\u1EA1ng kh\xF4ng h\u1EE3p l\u1EC7",
|
|
6459
|
+
pattern: "Sai m\u1EABu",
|
|
6460
|
+
tooShort: "Qu\xE1 ng\u1EAFn",
|
|
6461
|
+
tooLong: "Qu\xE1 d\xE0i",
|
|
6462
|
+
rangeUnderflow: "Nh\u1ECF h\u01A1n gi\xE1 tr\u1ECB t\u1ED1i thi\u1EC3u",
|
|
6463
|
+
rangeOverflow: "L\u1EDBn h\u01A1n gi\xE1 tr\u1ECB t\u1ED1i \u0111a",
|
|
6464
|
+
stepMismatch: "Sai b\u01B0\u1EDBc",
|
|
6465
|
+
badInput: "Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7",
|
|
6466
|
+
invalid: "Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7"
|
|
6467
|
+
},
|
|
6468
|
+
Loading: {
|
|
6469
|
+
loadingPage: "\u0110ang t\u1EA3i trang",
|
|
6470
|
+
pleaseWait: "Vui l\xF2ng ch\u1EDD"
|
|
6471
|
+
},
|
|
6472
|
+
DatePicker: {
|
|
6473
|
+
placeholder: "Ch\u1ECDn ng\xE0y",
|
|
6474
|
+
today: "H\xF4m nay",
|
|
6475
|
+
clear: "X\xF3a"
|
|
6476
|
+
},
|
|
6477
|
+
Pagination: {
|
|
6478
|
+
navigationLabel: "\u0110i\u1EC1u h\u01B0\u1EDBng ph\xE2n trang",
|
|
6479
|
+
showingResults: "Hi\u1EC3n th\u1ECB {startItem}\u2013{endItem} trong t\u1ED5ng {totalItems}",
|
|
6480
|
+
firstPage: "Trang \u0111\u1EA7u",
|
|
6481
|
+
previousPage: "Trang tr\u01B0\u1EDBc",
|
|
6482
|
+
previous: "Tr\u01B0\u1EDBc",
|
|
6483
|
+
nextPage: "Trang sau",
|
|
6484
|
+
next: "Sau",
|
|
6485
|
+
lastPage: "Trang cu\u1ED1i",
|
|
6486
|
+
pageNumber: "Trang {page}",
|
|
6487
|
+
itemsPerPage: "S\u1ED1 m\u1EE5c/trang",
|
|
6488
|
+
search: "T\xECm ki\u1EBFm",
|
|
6489
|
+
noOptions: "Kh\xF4ng c\xF3 l\u1EF1a ch\u1ECDn"
|
|
6490
|
+
},
|
|
6491
|
+
OCR: {
|
|
6492
|
+
imageUpload: {
|
|
6493
|
+
dragDropText: "K\xE9o & th\u1EA3 \u1EA3nh v\xE0o \u0111\xE2y",
|
|
6494
|
+
browseFiles: "Ch\u1ECDn t\u1EC7p",
|
|
6495
|
+
supportedFormats: "H\u1ED7 tr\u1EE3 c\xE1c \u0111\u1ECBnh d\u1EA1ng \u1EA3nh"
|
|
6496
|
+
}
|
|
6497
|
+
}
|
|
6498
|
+
};
|
|
6499
|
+
|
|
6500
|
+
// src/index.ts
|
|
6501
|
+
var underverseMessages = { en: en_default, vi: vi_default };
|
|
6502
|
+
function getUnderverseMessages(locale = "en") {
|
|
6503
|
+
return underverseMessages[locale] || underverseMessages.en;
|
|
6504
|
+
}
|
|
6535
6505
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6536
6506
|
0 && (module.exports = {
|
|
6537
6507
|
AccessDenied,
|
|
@@ -6573,7 +6543,6 @@ function AccessDenied({
|
|
|
6573
6543
|
Pagination,
|
|
6574
6544
|
PillTabs,
|
|
6575
6545
|
Popover,
|
|
6576
|
-
ProductImageUpload,
|
|
6577
6546
|
Progress,
|
|
6578
6547
|
PulseBadge,
|
|
6579
6548
|
RadioGroup,
|
|
@@ -6606,6 +6575,8 @@ function AccessDenied({
|
|
|
6606
6575
|
VARIANT_STYLES_BTN,
|
|
6607
6576
|
VerticalTabs,
|
|
6608
6577
|
cn,
|
|
6578
|
+
getUnderverseMessages,
|
|
6579
|
+
underverseMessages,
|
|
6609
6580
|
useToast
|
|
6610
6581
|
});
|
|
6611
6582
|
//# sourceMappingURL=index.cjs.map
|