@underverse-ui/underverse 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -3
- package/dist/index.cjs +273 -307
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +248 -9
- package/dist/index.d.ts +248 -9
- package/dist/index.js +259 -294
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5347,199 +5347,31 @@ function ImageUpload({
|
|
|
5347
5347
|
] });
|
|
5348
5348
|
}
|
|
5349
5349
|
|
|
5350
|
-
// ../../components/ui/ProductImageUpload.tsx
|
|
5351
|
-
import { useState as useState25, useRef as useRef10 } from "react";
|
|
5352
|
-
import Image2 from "next/image";
|
|
5353
|
-
import { Upload as Upload2, X as X9, Image as ImageIcon2 } from "lucide-react";
|
|
5354
|
-
import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5355
|
-
var ProductImageUpload = ({ value, onChange, disabled = false, className }) => {
|
|
5356
|
-
const [uploading, setUploading] = useState25(false);
|
|
5357
|
-
const [error, setError] = useState25(null);
|
|
5358
|
-
const [isDragging, setIsDragging] = useState25(false);
|
|
5359
|
-
const fileInputRef = useRef10(null);
|
|
5360
|
-
const handleFileChange = async (e) => {
|
|
5361
|
-
const file = e.target.files?.[0];
|
|
5362
|
-
if (!file) return;
|
|
5363
|
-
await uploadFile(file);
|
|
5364
|
-
};
|
|
5365
|
-
const uploadFile = async (file) => {
|
|
5366
|
-
const acceptedFormats = ["image/jpeg", "image/png", "image/webp", "image/gif"];
|
|
5367
|
-
if (!acceptedFormats.includes(file.type)) {
|
|
5368
|
-
setError(`\u0110\u1ECBnh d\u1EA1ng kh\xF4ng h\u1ED7 tr\u1EE3. Ch\u1EC9 ch\u1EA5p nh\u1EADn: JPG, PNG, WEBP, GIF`);
|
|
5369
|
-
return;
|
|
5370
|
-
}
|
|
5371
|
-
const maxSizeBytes = 10 * 1024 * 1024;
|
|
5372
|
-
if (file.size > maxSizeBytes) {
|
|
5373
|
-
setError(`File qu\xE1 l\u1EDBn. K\xEDch th\u01B0\u1EDBc t\u1ED1i \u0111a: 10MB`);
|
|
5374
|
-
return;
|
|
5375
|
-
}
|
|
5376
|
-
setError(null);
|
|
5377
|
-
setUploading(true);
|
|
5378
|
-
try {
|
|
5379
|
-
const formData = new FormData();
|
|
5380
|
-
formData.append("file", file);
|
|
5381
|
-
const response = await fetch("/api/upload/product-image", {
|
|
5382
|
-
method: "POST",
|
|
5383
|
-
body: formData,
|
|
5384
|
-
credentials: "include"
|
|
5385
|
-
});
|
|
5386
|
-
if (!response.ok) {
|
|
5387
|
-
throw new Error("Upload failed");
|
|
5388
|
-
}
|
|
5389
|
-
const result = await response.json();
|
|
5390
|
-
if (result.success && result.data?.path) {
|
|
5391
|
-
onChange(result.data.path);
|
|
5392
|
-
} else {
|
|
5393
|
-
throw new Error(result.message || "Upload failed");
|
|
5394
|
-
}
|
|
5395
|
-
} catch (err) {
|
|
5396
|
-
setError(err.message || "Kh\xF4ng th\u1EC3 upload \u1EA3nh");
|
|
5397
|
-
console.error("Upload error:", err);
|
|
5398
|
-
} finally {
|
|
5399
|
-
setUploading(false);
|
|
5400
|
-
if (fileInputRef.current) {
|
|
5401
|
-
fileInputRef.current.value = "";
|
|
5402
|
-
}
|
|
5403
|
-
}
|
|
5404
|
-
};
|
|
5405
|
-
const handleDragOver = (e) => {
|
|
5406
|
-
e.preventDefault();
|
|
5407
|
-
e.stopPropagation();
|
|
5408
|
-
if (!disabled && !uploading) {
|
|
5409
|
-
setIsDragging(true);
|
|
5410
|
-
}
|
|
5411
|
-
};
|
|
5412
|
-
const handleDragLeave = (e) => {
|
|
5413
|
-
e.preventDefault();
|
|
5414
|
-
e.stopPropagation();
|
|
5415
|
-
setIsDragging(false);
|
|
5416
|
-
};
|
|
5417
|
-
const handleDrop = async (e) => {
|
|
5418
|
-
e.preventDefault();
|
|
5419
|
-
e.stopPropagation();
|
|
5420
|
-
setIsDragging(false);
|
|
5421
|
-
if (disabled || uploading) return;
|
|
5422
|
-
const file = e.dataTransfer.files?.[0];
|
|
5423
|
-
if (file) {
|
|
5424
|
-
await uploadFile(file);
|
|
5425
|
-
}
|
|
5426
|
-
};
|
|
5427
|
-
const handleRemove = () => {
|
|
5428
|
-
onChange("");
|
|
5429
|
-
setError(null);
|
|
5430
|
-
};
|
|
5431
|
-
const handleClickUpload = () => {
|
|
5432
|
-
fileInputRef.current?.click();
|
|
5433
|
-
};
|
|
5434
|
-
return /* @__PURE__ */ jsxs29("div", { className: cn("space-y-4", className), children: [
|
|
5435
|
-
/* @__PURE__ */ jsx34(
|
|
5436
|
-
"input",
|
|
5437
|
-
{
|
|
5438
|
-
ref: fileInputRef,
|
|
5439
|
-
type: "file",
|
|
5440
|
-
accept: "image/jpeg,image/png,image/webp,image/gif",
|
|
5441
|
-
onChange: handleFileChange,
|
|
5442
|
-
disabled: disabled || uploading,
|
|
5443
|
-
className: "hidden"
|
|
5444
|
-
}
|
|
5445
|
-
),
|
|
5446
|
-
value ? /* @__PURE__ */ jsxs29("div", { className: "space-y-4", children: [
|
|
5447
|
-
/* @__PURE__ */ jsxs29("div", { className: "relative w-full aspect-square max-w-md rounded-xl overflow-hidden border-2 border-border bg-muted shadow-lg group", children: [
|
|
5448
|
-
/* @__PURE__ */ jsx34(
|
|
5449
|
-
Image2,
|
|
5450
|
-
{
|
|
5451
|
-
src: value,
|
|
5452
|
-
alt: "Product image",
|
|
5453
|
-
fill: true,
|
|
5454
|
-
className: "object-cover transition-transform duration-300 group-hover:scale-105",
|
|
5455
|
-
unoptimized: true
|
|
5456
|
-
}
|
|
5457
|
-
),
|
|
5458
|
-
/* @__PURE__ */ jsx34("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__ */ jsxs29("div", { className: "flex gap-2", children: [
|
|
5459
|
-
/* @__PURE__ */ jsxs29(Button_default, { type: "button", variant: "default", size: "sm", onClick: handleClickUpload, disabled: disabled || uploading, children: [
|
|
5460
|
-
/* @__PURE__ */ jsx34(Upload2, { className: "w-4 h-4 mr-2" }),
|
|
5461
|
-
"Thay \u0111\u1ED5i"
|
|
5462
|
-
] }),
|
|
5463
|
-
/* @__PURE__ */ jsxs29(Button_default, { type: "button", variant: "danger", size: "sm", onClick: handleRemove, disabled: disabled || uploading, children: [
|
|
5464
|
-
/* @__PURE__ */ jsx34(X9, { className: "w-4 h-4 mr-2" }),
|
|
5465
|
-
"X\xF3a"
|
|
5466
|
-
] })
|
|
5467
|
-
] }) })
|
|
5468
|
-
] }),
|
|
5469
|
-
/* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
5470
|
-
/* @__PURE__ */ jsx34(ImageIcon2, { className: "w-4 h-4" }),
|
|
5471
|
-
/* @__PURE__ */ jsx34("span", { children: "\u1EA2nh s\u1EA3n ph\u1EA9m \u0111\xE3 t\u1EA3i l\xEAn th\xE0nh c\xF4ng" })
|
|
5472
|
-
] })
|
|
5473
|
-
] }) : /* @__PURE__ */ jsx34(
|
|
5474
|
-
"div",
|
|
5475
|
-
{
|
|
5476
|
-
className: cn(
|
|
5477
|
-
"w-full aspect-square max-w-md rounded-xl border-2 border-dashed transition-all duration-200",
|
|
5478
|
-
"bg-gradient-to-br from-muted/30 to-muted/10",
|
|
5479
|
-
"flex flex-col items-center justify-center cursor-pointer",
|
|
5480
|
-
"hover:border-primary/60 hover:bg-primary/5 hover:shadow-lg hover:scale-[1.02]",
|
|
5481
|
-
isDragging && "border-primary bg-primary/10 shadow-lg scale-[1.02]",
|
|
5482
|
-
(disabled || uploading) && "opacity-50 cursor-not-allowed hover:scale-100",
|
|
5483
|
-
!isDragging && !disabled && !uploading && "border-border"
|
|
5484
|
-
),
|
|
5485
|
-
onClick: !disabled && !uploading ? handleClickUpload : void 0,
|
|
5486
|
-
onDragOver: handleDragOver,
|
|
5487
|
-
onDragLeave: handleDragLeave,
|
|
5488
|
-
onDrop: handleDrop,
|
|
5489
|
-
children: /* @__PURE__ */ jsxs29("div", { className: "flex flex-col items-center justify-center p-8 text-center", children: [
|
|
5490
|
-
/* @__PURE__ */ jsx34(
|
|
5491
|
-
"div",
|
|
5492
|
-
{
|
|
5493
|
-
className: cn(
|
|
5494
|
-
"w-20 h-20 rounded-full flex items-center justify-center mb-4 transition-colors",
|
|
5495
|
-
isDragging ? "bg-primary/20" : "bg-primary/10"
|
|
5496
|
-
),
|
|
5497
|
-
children: /* @__PURE__ */ jsx34(Upload2, { className: cn("w-10 h-10 transition-colors", isDragging ? "text-primary" : "text-muted-foreground") })
|
|
5498
|
-
}
|
|
5499
|
-
),
|
|
5500
|
-
/* @__PURE__ */ jsx34("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" }),
|
|
5501
|
-
/* @__PURE__ */ jsx34("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" }),
|
|
5502
|
-
/* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2 text-xs text-muted-foreground mt-2", children: [
|
|
5503
|
-
/* @__PURE__ */ jsx34("div", { className: "px-3 py-1.5 bg-muted rounded-full", children: "JPG, PNG, WEBP, GIF" }),
|
|
5504
|
-
/* @__PURE__ */ jsx34("div", { className: "px-3 py-1.5 bg-muted rounded-full", children: "T\u1ED1i \u0111a 10MB" })
|
|
5505
|
-
] }),
|
|
5506
|
-
uploading && /* @__PURE__ */ jsx34("div", { className: "mt-4 w-48 h-1.5 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsx34("div", { className: "h-full bg-primary rounded-full animate-[progress_1s_ease-in-out_infinite]" }) })
|
|
5507
|
-
] })
|
|
5508
|
-
}
|
|
5509
|
-
),
|
|
5510
|
-
error && /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2 p-3 rounded-lg bg-destructive/10 border border-destructive/20", children: [
|
|
5511
|
-
/* @__PURE__ */ jsx34(X9, { className: "w-4 h-4 text-destructive flex-shrink-0" }),
|
|
5512
|
-
/* @__PURE__ */ jsx34("p", { className: "text-sm text-destructive", children: error })
|
|
5513
|
-
] })
|
|
5514
|
-
] });
|
|
5515
|
-
};
|
|
5516
|
-
var ProductImageUpload_default = ProductImageUpload;
|
|
5517
|
-
|
|
5518
5350
|
// ../../components/ui/Carousel.tsx
|
|
5519
|
-
import * as
|
|
5351
|
+
import * as React27 from "react";
|
|
5520
5352
|
import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
5521
|
-
import { Fragment as Fragment8, jsx as
|
|
5353
|
+
import { Fragment as Fragment8, jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5522
5354
|
function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
5523
|
-
const [currentIndex, setCurrentIndex] =
|
|
5524
|
-
const totalSlides =
|
|
5525
|
-
const [isPaused, setIsPaused] =
|
|
5526
|
-
const scrollPrev =
|
|
5355
|
+
const [currentIndex, setCurrentIndex] = React27.useState(0);
|
|
5356
|
+
const totalSlides = React27.Children.count(children);
|
|
5357
|
+
const [isPaused, setIsPaused] = React27.useState(false);
|
|
5358
|
+
const scrollPrev = React27.useCallback(() => {
|
|
5527
5359
|
setCurrentIndex((prev) => prev > 0 ? prev - 1 : totalSlides - 1);
|
|
5528
5360
|
}, [totalSlides]);
|
|
5529
|
-
const scrollNext =
|
|
5361
|
+
const scrollNext = React27.useCallback(() => {
|
|
5530
5362
|
setCurrentIndex((prev) => prev < totalSlides - 1 ? prev + 1 : 0);
|
|
5531
5363
|
}, [totalSlides]);
|
|
5532
|
-
|
|
5364
|
+
React27.useEffect(() => {
|
|
5533
5365
|
if (!autoScroll || isPaused || totalSlides <= 1) return;
|
|
5534
5366
|
const interval = setInterval(() => {
|
|
5535
5367
|
scrollNext();
|
|
5536
5368
|
}, autoScrollInterval);
|
|
5537
5369
|
return () => clearInterval(interval);
|
|
5538
5370
|
}, [autoScroll, isPaused, totalSlides, autoScrollInterval, scrollNext]);
|
|
5539
|
-
return /* @__PURE__ */
|
|
5540
|
-
/* @__PURE__ */
|
|
5541
|
-
totalSlides > 1 && /* @__PURE__ */
|
|
5542
|
-
/* @__PURE__ */
|
|
5371
|
+
return /* @__PURE__ */ jsxs29("div", { className: "relative w-full overflow-hidden", onMouseEnter: () => setIsPaused(true), onMouseLeave: () => setIsPaused(false), children: [
|
|
5372
|
+
/* @__PURE__ */ jsx34("div", { className: "flex transition-transform duration-500 ease-in-out", style: { transform: `translateX(-${currentIndex * 100}%)` }, children: React27.Children.map(children, (child, idx) => /* @__PURE__ */ jsx34("div", { className: "flex-shrink-0 w-full h-full", children: child }, idx)) }),
|
|
5373
|
+
totalSlides > 1 && /* @__PURE__ */ jsxs29(Fragment8, { children: [
|
|
5374
|
+
/* @__PURE__ */ jsx34(
|
|
5543
5375
|
Button_default,
|
|
5544
5376
|
{
|
|
5545
5377
|
onClick: scrollPrev,
|
|
@@ -5549,7 +5381,7 @@ function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
|
5549
5381
|
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"
|
|
5550
5382
|
}
|
|
5551
5383
|
),
|
|
5552
|
-
/* @__PURE__ */
|
|
5384
|
+
/* @__PURE__ */ jsx34(
|
|
5553
5385
|
Button_default,
|
|
5554
5386
|
{
|
|
5555
5387
|
onClick: scrollNext,
|
|
@@ -5560,7 +5392,7 @@ function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
|
5560
5392
|
}
|
|
5561
5393
|
)
|
|
5562
5394
|
] }),
|
|
5563
|
-
totalSlides > 1 && /* @__PURE__ */
|
|
5395
|
+
totalSlides > 1 && /* @__PURE__ */ jsx34("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2", children: Array.from({ length: totalSlides }, (_, idx) => /* @__PURE__ */ jsx34(
|
|
5564
5396
|
"button",
|
|
5565
5397
|
{
|
|
5566
5398
|
onClick: () => setCurrentIndex(idx),
|
|
@@ -5573,22 +5405,22 @@ function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
|
5573
5405
|
}
|
|
5574
5406
|
|
|
5575
5407
|
// ../../components/ui/ClientOnly.tsx
|
|
5576
|
-
import { useEffect as useEffect15, useState as
|
|
5577
|
-
import { Fragment as Fragment9, jsx as
|
|
5408
|
+
import { useEffect as useEffect15, useState as useState26 } from "react";
|
|
5409
|
+
import { Fragment as Fragment9, jsx as jsx35 } from "react/jsx-runtime";
|
|
5578
5410
|
function ClientOnly({ children, fallback = null }) {
|
|
5579
|
-
const [hasMounted, setHasMounted] =
|
|
5411
|
+
const [hasMounted, setHasMounted] = useState26(false);
|
|
5580
5412
|
useEffect15(() => {
|
|
5581
5413
|
setHasMounted(true);
|
|
5582
5414
|
}, []);
|
|
5583
5415
|
if (!hasMounted) {
|
|
5584
|
-
return /* @__PURE__ */
|
|
5416
|
+
return /* @__PURE__ */ jsx35(Fragment9, { children: fallback });
|
|
5585
5417
|
}
|
|
5586
|
-
return /* @__PURE__ */
|
|
5418
|
+
return /* @__PURE__ */ jsx35(Fragment9, { children });
|
|
5587
5419
|
}
|
|
5588
5420
|
|
|
5589
5421
|
// ../../components/ui/Loading.tsx
|
|
5590
5422
|
import { Activity as Activity3 } from "lucide-react";
|
|
5591
|
-
import { jsx as
|
|
5423
|
+
import { jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5592
5424
|
var LoadingSpinner = ({
|
|
5593
5425
|
size = "md",
|
|
5594
5426
|
className,
|
|
@@ -5604,7 +5436,7 @@ var LoadingSpinner = ({
|
|
|
5604
5436
|
foreground: "text-foreground",
|
|
5605
5437
|
muted: "text-muted-foreground"
|
|
5606
5438
|
};
|
|
5607
|
-
return /* @__PURE__ */
|
|
5439
|
+
return /* @__PURE__ */ jsx36(
|
|
5608
5440
|
Activity3,
|
|
5609
5441
|
{
|
|
5610
5442
|
className: cn(
|
|
@@ -5625,7 +5457,7 @@ var LoadingDots = ({
|
|
|
5625
5457
|
foreground: "bg-foreground",
|
|
5626
5458
|
muted: "bg-muted-foreground"
|
|
5627
5459
|
};
|
|
5628
|
-
return /* @__PURE__ */
|
|
5460
|
+
return /* @__PURE__ */ jsx36("div", { className: cn("flex items-center space-x-1", className), children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx36(
|
|
5629
5461
|
"div",
|
|
5630
5462
|
{
|
|
5631
5463
|
className: cn(
|
|
@@ -5647,7 +5479,7 @@ var LoadingBar = ({
|
|
|
5647
5479
|
label
|
|
5648
5480
|
}) => {
|
|
5649
5481
|
const pct = progress ? Math.min(Math.max(progress, 0), 100) : void 0;
|
|
5650
|
-
return /* @__PURE__ */
|
|
5482
|
+
return /* @__PURE__ */ jsx36(
|
|
5651
5483
|
"div",
|
|
5652
5484
|
{
|
|
5653
5485
|
className: cn("w-full bg-muted rounded-full h-2", className),
|
|
@@ -5656,7 +5488,7 @@ var LoadingBar = ({
|
|
|
5656
5488
|
"aria-valuemax": pct === void 0 ? void 0 : 100,
|
|
5657
5489
|
"aria-valuenow": pct === void 0 ? void 0 : Math.round(pct),
|
|
5658
5490
|
"aria-label": label || "Loading",
|
|
5659
|
-
children: /* @__PURE__ */
|
|
5491
|
+
children: /* @__PURE__ */ jsx36(
|
|
5660
5492
|
"div",
|
|
5661
5493
|
{
|
|
5662
5494
|
className: cn(
|
|
@@ -5673,10 +5505,10 @@ var LoadingBar = ({
|
|
|
5673
5505
|
};
|
|
5674
5506
|
|
|
5675
5507
|
// ../../components/ui/Table.tsx
|
|
5676
|
-
import
|
|
5677
|
-
import { jsx as
|
|
5678
|
-
var Table =
|
|
5679
|
-
({ className, containerClassName, ...props }, ref) => /* @__PURE__ */
|
|
5508
|
+
import React28 from "react";
|
|
5509
|
+
import { jsx as jsx37, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5510
|
+
var Table = React28.forwardRef(
|
|
5511
|
+
({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
5680
5512
|
"div",
|
|
5681
5513
|
{
|
|
5682
5514
|
className: cn(
|
|
@@ -5686,7 +5518,7 @@ var Table = React29.forwardRef(
|
|
|
5686
5518
|
"backdrop-blur-sm transition-all duration-300",
|
|
5687
5519
|
containerClassName
|
|
5688
5520
|
),
|
|
5689
|
-
children: /* @__PURE__ */
|
|
5521
|
+
children: /* @__PURE__ */ jsx37(
|
|
5690
5522
|
"table",
|
|
5691
5523
|
{
|
|
5692
5524
|
ref,
|
|
@@ -5698,8 +5530,8 @@ var Table = React29.forwardRef(
|
|
|
5698
5530
|
)
|
|
5699
5531
|
);
|
|
5700
5532
|
Table.displayName = "Table";
|
|
5701
|
-
var TableHeader =
|
|
5702
|
-
({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */
|
|
5533
|
+
var TableHeader = React28.forwardRef(
|
|
5534
|
+
({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ jsxs31(
|
|
5703
5535
|
"thead",
|
|
5704
5536
|
{
|
|
5705
5537
|
ref,
|
|
@@ -5717,7 +5549,7 @@ var TableHeader = React29.forwardRef(
|
|
|
5717
5549
|
)
|
|
5718
5550
|
);
|
|
5719
5551
|
TableHeader.displayName = "TableHeader";
|
|
5720
|
-
var TableBody =
|
|
5552
|
+
var TableBody = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
5721
5553
|
"tbody",
|
|
5722
5554
|
{
|
|
5723
5555
|
ref,
|
|
@@ -5726,7 +5558,7 @@ var TableBody = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
5726
5558
|
}
|
|
5727
5559
|
));
|
|
5728
5560
|
TableBody.displayName = "TableBody";
|
|
5729
|
-
var TableFooter =
|
|
5561
|
+
var TableFooter = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
5730
5562
|
"tfoot",
|
|
5731
5563
|
{
|
|
5732
5564
|
ref,
|
|
@@ -5738,7 +5570,7 @@ var TableFooter = React29.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5738
5570
|
}
|
|
5739
5571
|
));
|
|
5740
5572
|
TableFooter.displayName = "TableFooter";
|
|
5741
|
-
var TableRow =
|
|
5573
|
+
var TableRow = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
5742
5574
|
"tr",
|
|
5743
5575
|
{
|
|
5744
5576
|
ref,
|
|
@@ -5752,7 +5584,7 @@ var TableRow = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5752
5584
|
}
|
|
5753
5585
|
));
|
|
5754
5586
|
TableRow.displayName = "TableRow";
|
|
5755
|
-
var TableHead =
|
|
5587
|
+
var TableHead = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
5756
5588
|
"th",
|
|
5757
5589
|
{
|
|
5758
5590
|
ref,
|
|
@@ -5764,7 +5596,7 @@ var TableHead = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
5764
5596
|
}
|
|
5765
5597
|
));
|
|
5766
5598
|
TableHead.displayName = "TableHead";
|
|
5767
|
-
var TableCell =
|
|
5599
|
+
var TableCell = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
5768
5600
|
"td",
|
|
5769
5601
|
{
|
|
5770
5602
|
ref,
|
|
@@ -5773,7 +5605,7 @@ var TableCell = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
5773
5605
|
}
|
|
5774
5606
|
));
|
|
5775
5607
|
TableCell.displayName = "TableCell";
|
|
5776
|
-
var TableCaption =
|
|
5608
|
+
var TableCaption = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
5777
5609
|
"caption",
|
|
5778
5610
|
{
|
|
5779
5611
|
ref,
|
|
@@ -5785,12 +5617,12 @@ TableCaption.displayName = "TableCaption";
|
|
|
5785
5617
|
|
|
5786
5618
|
// ../../components/ui/DataTable.tsx
|
|
5787
5619
|
import { Filter as FilterIcon } from "lucide-react";
|
|
5788
|
-
import
|
|
5620
|
+
import React29 from "react";
|
|
5789
5621
|
import { useTranslations as useTranslations7 } from "next-intl";
|
|
5790
|
-
import { jsx as
|
|
5622
|
+
import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5791
5623
|
function useDebounced(value, delay = 300) {
|
|
5792
|
-
const [debounced, setDebounced] =
|
|
5793
|
-
|
|
5624
|
+
const [debounced, setDebounced] = React29.useState(value);
|
|
5625
|
+
React29.useEffect(() => {
|
|
5794
5626
|
const id = setTimeout(() => setDebounced(value), delay);
|
|
5795
5627
|
return () => clearTimeout(id);
|
|
5796
5628
|
}, [value, delay]);
|
|
@@ -5814,14 +5646,14 @@ function DataTable({
|
|
|
5814
5646
|
className
|
|
5815
5647
|
}) {
|
|
5816
5648
|
const t = useTranslations7("Common");
|
|
5817
|
-
const [visibleCols, setVisibleCols] =
|
|
5818
|
-
const [filters, setFilters] =
|
|
5819
|
-
const [sort, setSort] =
|
|
5820
|
-
const [density, setDensity] =
|
|
5821
|
-
const [curPage, setCurPage] =
|
|
5822
|
-
const [curPageSize, setCurPageSize] =
|
|
5649
|
+
const [visibleCols, setVisibleCols] = React29.useState(() => columns.filter((c) => c.visible !== false).map((c) => c.key));
|
|
5650
|
+
const [filters, setFilters] = React29.useState({});
|
|
5651
|
+
const [sort, setSort] = React29.useState(null);
|
|
5652
|
+
const [density, setDensity] = React29.useState("normal");
|
|
5653
|
+
const [curPage, setCurPage] = React29.useState(page);
|
|
5654
|
+
const [curPageSize, setCurPageSize] = React29.useState(pageSize);
|
|
5823
5655
|
const debouncedFilters = useDebounced(filters, 350);
|
|
5824
|
-
|
|
5656
|
+
React29.useEffect(() => {
|
|
5825
5657
|
if (!onQueryChange) return;
|
|
5826
5658
|
onQueryChange({ filters: debouncedFilters, sort, page: curPage, pageSize: curPageSize });
|
|
5827
5659
|
}, [debouncedFilters, sort, curPage, curPageSize]);
|
|
@@ -5840,7 +5672,7 @@ function DataTable({
|
|
|
5840
5672
|
className: "h-8 w-full text-sm"
|
|
5841
5673
|
};
|
|
5842
5674
|
if (col.filter.type === "text") {
|
|
5843
|
-
return /* @__PURE__ */
|
|
5675
|
+
return /* @__PURE__ */ jsx38(
|
|
5844
5676
|
Input_default,
|
|
5845
5677
|
{
|
|
5846
5678
|
...commonProps,
|
|
@@ -5855,7 +5687,7 @@ function DataTable({
|
|
|
5855
5687
|
}
|
|
5856
5688
|
if (col.filter.type === "select") {
|
|
5857
5689
|
const options = col.filter.options || [];
|
|
5858
|
-
return /* @__PURE__ */
|
|
5690
|
+
return /* @__PURE__ */ jsx38(
|
|
5859
5691
|
Combobox,
|
|
5860
5692
|
{
|
|
5861
5693
|
options: ["", ...options],
|
|
@@ -5871,7 +5703,7 @@ function DataTable({
|
|
|
5871
5703
|
);
|
|
5872
5704
|
}
|
|
5873
5705
|
if (col.filter.type === "date") {
|
|
5874
|
-
return /* @__PURE__ */
|
|
5706
|
+
return /* @__PURE__ */ jsx38(
|
|
5875
5707
|
DatePicker,
|
|
5876
5708
|
{
|
|
5877
5709
|
placeholder: col.filter.placeholder || `Select ${String(col.title)}`,
|
|
@@ -5885,15 +5717,15 @@ function DataTable({
|
|
|
5885
5717
|
}
|
|
5886
5718
|
return null;
|
|
5887
5719
|
};
|
|
5888
|
-
const renderHeader = /* @__PURE__ */
|
|
5720
|
+
const renderHeader = /* @__PURE__ */ jsx38(TableRow, { children: visibleColumns.map((col) => /* @__PURE__ */ jsx38(
|
|
5889
5721
|
TableHead,
|
|
5890
5722
|
{
|
|
5891
5723
|
style: { width: col.width },
|
|
5892
5724
|
className: cn(col.align === "right" && "text-right", col.align === "center" && "text-center"),
|
|
5893
|
-
children: /* @__PURE__ */
|
|
5894
|
-
/* @__PURE__ */
|
|
5895
|
-
/* @__PURE__ */
|
|
5896
|
-
col.sortable && /* @__PURE__ */
|
|
5725
|
+
children: /* @__PURE__ */ jsxs32("div", { className: "flex items-center justify-between gap-2 select-none min-h-[2.5rem]", children: [
|
|
5726
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-1 min-w-0 flex-1", children: [
|
|
5727
|
+
/* @__PURE__ */ jsx38("span", { className: "truncate font-medium text-sm", children: col.title }),
|
|
5728
|
+
col.sortable && /* @__PURE__ */ jsx38(
|
|
5897
5729
|
"button",
|
|
5898
5730
|
{
|
|
5899
5731
|
className: cn(
|
|
@@ -5910,8 +5742,8 @@ function DataTable({
|
|
|
5910
5742
|
},
|
|
5911
5743
|
"aria-label": "Sort",
|
|
5912
5744
|
title: `Sort by ${String(col.title)}`,
|
|
5913
|
-
children: /* @__PURE__ */
|
|
5914
|
-
/* @__PURE__ */
|
|
5745
|
+
children: /* @__PURE__ */ jsxs32("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "none", className: "inline-block", children: [
|
|
5746
|
+
/* @__PURE__ */ jsx38(
|
|
5915
5747
|
"path",
|
|
5916
5748
|
{
|
|
5917
5749
|
d: "M7 8l3-3 3 3",
|
|
@@ -5922,7 +5754,7 @@ function DataTable({
|
|
|
5922
5754
|
opacity: sort?.key === col.key && sort.order === "asc" ? 1 : 0.4
|
|
5923
5755
|
}
|
|
5924
5756
|
),
|
|
5925
|
-
/* @__PURE__ */
|
|
5757
|
+
/* @__PURE__ */ jsx38(
|
|
5926
5758
|
"path",
|
|
5927
5759
|
{
|
|
5928
5760
|
d: "M7 12l3 3 3-3",
|
|
@@ -5937,11 +5769,11 @@ function DataTable({
|
|
|
5937
5769
|
}
|
|
5938
5770
|
)
|
|
5939
5771
|
] }),
|
|
5940
|
-
col.filter && /* @__PURE__ */
|
|
5772
|
+
col.filter && /* @__PURE__ */ jsx38(
|
|
5941
5773
|
Popover,
|
|
5942
5774
|
{
|
|
5943
5775
|
placement: "bottom-start",
|
|
5944
|
-
trigger: /* @__PURE__ */
|
|
5776
|
+
trigger: /* @__PURE__ */ jsx38(
|
|
5945
5777
|
"button",
|
|
5946
5778
|
{
|
|
5947
5779
|
className: cn(
|
|
@@ -5951,16 +5783,16 @@ function DataTable({
|
|
|
5951
5783
|
),
|
|
5952
5784
|
"aria-label": "Filter",
|
|
5953
5785
|
title: "Filter",
|
|
5954
|
-
children: /* @__PURE__ */
|
|
5786
|
+
children: /* @__PURE__ */ jsx38(FilterIcon, { className: "h-4 w-4" })
|
|
5955
5787
|
}
|
|
5956
5788
|
),
|
|
5957
|
-
children: /* @__PURE__ */
|
|
5958
|
-
/* @__PURE__ */
|
|
5789
|
+
children: /* @__PURE__ */ jsxs32("div", { className: "w-48 p-2 space-y-2", children: [
|
|
5790
|
+
/* @__PURE__ */ jsxs32("div", { className: "text-xs font-medium text-muted-foreground mb-2", children: [
|
|
5959
5791
|
"Filter ",
|
|
5960
5792
|
col.title
|
|
5961
5793
|
] }),
|
|
5962
5794
|
renderFilterControl(col),
|
|
5963
|
-
filters[col.key] && /* @__PURE__ */
|
|
5795
|
+
filters[col.key] && /* @__PURE__ */ jsx38(
|
|
5964
5796
|
"button",
|
|
5965
5797
|
{
|
|
5966
5798
|
onClick: () => {
|
|
@@ -5982,15 +5814,15 @@ function DataTable({
|
|
|
5982
5814
|
},
|
|
5983
5815
|
col.key
|
|
5984
5816
|
)) });
|
|
5985
|
-
return /* @__PURE__ */
|
|
5986
|
-
/* @__PURE__ */
|
|
5987
|
-
/* @__PURE__ */
|
|
5988
|
-
/* @__PURE__ */
|
|
5989
|
-
enableDensityToggle && /* @__PURE__ */
|
|
5817
|
+
return /* @__PURE__ */ jsxs32("div", { className: cn("space-y-2", className), children: [
|
|
5818
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex items-center justify-between gap-4 mb-1", children: [
|
|
5819
|
+
/* @__PURE__ */ jsx38("div", { className: "text-sm text-muted-foreground", children: caption }),
|
|
5820
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2", children: [
|
|
5821
|
+
enableDensityToggle && /* @__PURE__ */ jsx38(
|
|
5990
5822
|
DropdownMenu_default,
|
|
5991
5823
|
{
|
|
5992
|
-
trigger: /* @__PURE__ */
|
|
5993
|
-
/* @__PURE__ */
|
|
5824
|
+
trigger: /* @__PURE__ */ jsxs32(Button_default, { variant: "ghost", size: "sm", className: "h-8 px-2", children: [
|
|
5825
|
+
/* @__PURE__ */ jsx38("svg", { className: "w-4 h-4 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx38("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }),
|
|
5994
5826
|
t("density")
|
|
5995
5827
|
] }),
|
|
5996
5828
|
items: [
|
|
@@ -6000,11 +5832,11 @@ function DataTable({
|
|
|
6000
5832
|
]
|
|
6001
5833
|
}
|
|
6002
5834
|
),
|
|
6003
|
-
enableColumnVisibilityToggle && /* @__PURE__ */
|
|
5835
|
+
enableColumnVisibilityToggle && /* @__PURE__ */ jsx38(
|
|
6004
5836
|
DropdownMenu_default,
|
|
6005
5837
|
{
|
|
6006
|
-
trigger: /* @__PURE__ */
|
|
6007
|
-
/* @__PURE__ */
|
|
5838
|
+
trigger: /* @__PURE__ */ jsxs32(Button_default, { variant: "ghost", size: "sm", className: "h-8 px-2", children: [
|
|
5839
|
+
/* @__PURE__ */ jsx38("svg", { className: "w-4 h-4 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx38(
|
|
6008
5840
|
"path",
|
|
6009
5841
|
{
|
|
6010
5842
|
strokeLinecap: "round",
|
|
@@ -6015,15 +5847,15 @@ function DataTable({
|
|
|
6015
5847
|
) }),
|
|
6016
5848
|
t("columns")
|
|
6017
5849
|
] }),
|
|
6018
|
-
children: columns.map((c) => /* @__PURE__ */
|
|
5850
|
+
children: columns.map((c) => /* @__PURE__ */ jsxs32(
|
|
6019
5851
|
DropdownMenuItem,
|
|
6020
5852
|
{
|
|
6021
5853
|
onClick: () => {
|
|
6022
5854
|
setVisibleCols((prev) => prev.includes(c.key) ? prev.filter((k) => k !== c.key) : [...prev, c.key]);
|
|
6023
5855
|
},
|
|
6024
5856
|
children: [
|
|
6025
|
-
/* @__PURE__ */
|
|
6026
|
-
/* @__PURE__ */
|
|
5857
|
+
/* @__PURE__ */ jsx38("input", { type: "checkbox", className: "mr-2 rounded border-border", readOnly: true, checked: visibleCols.includes(c.key) }),
|
|
5858
|
+
/* @__PURE__ */ jsx38("span", { className: "truncate", children: c.title })
|
|
6027
5859
|
]
|
|
6028
5860
|
},
|
|
6029
5861
|
c.key
|
|
@@ -6033,17 +5865,17 @@ function DataTable({
|
|
|
6033
5865
|
toolbar
|
|
6034
5866
|
] })
|
|
6035
5867
|
] }),
|
|
6036
|
-
/* @__PURE__ */
|
|
5868
|
+
/* @__PURE__ */ jsx38("div", { className: cn("relative rounded-lg border border-border/50 overflow-hidden", loading2 && "opacity-60 pointer-events-none"), children: /* @__PURE__ */ jsxs32(
|
|
6037
5869
|
Table,
|
|
6038
5870
|
{
|
|
6039
5871
|
containerClassName: "border-0 rounded-none shadow-none",
|
|
6040
5872
|
className: "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-[5] [&_thead]:bg-background [&_thead]:backdrop-blur-sm",
|
|
6041
5873
|
children: [
|
|
6042
|
-
/* @__PURE__ */
|
|
6043
|
-
/* @__PURE__ */
|
|
6044
|
-
/* @__PURE__ */
|
|
6045
|
-
/* @__PURE__ */
|
|
6046
|
-
/* @__PURE__ */
|
|
5874
|
+
/* @__PURE__ */ jsx38(TableHeader, { children: renderHeader }),
|
|
5875
|
+
/* @__PURE__ */ jsx38(TableBody, { children: loading2 ? /* @__PURE__ */ jsx38(TableRow, { children: /* @__PURE__ */ jsx38(TableCell, { colSpan: visibleColumns.length, className: "text-center py-8", children: /* @__PURE__ */ jsxs32("div", { className: "flex items-center justify-center gap-2 text-muted-foreground", children: [
|
|
5876
|
+
/* @__PURE__ */ jsxs32("svg", { className: "animate-spin h-4 w-4", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
5877
|
+
/* @__PURE__ */ jsx38("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
5878
|
+
/* @__PURE__ */ jsx38(
|
|
6047
5879
|
"path",
|
|
6048
5880
|
{
|
|
6049
5881
|
className: "opacity-75",
|
|
@@ -6052,10 +5884,10 @@ function DataTable({
|
|
|
6052
5884
|
}
|
|
6053
5885
|
)
|
|
6054
5886
|
] }),
|
|
6055
|
-
/* @__PURE__ */
|
|
6056
|
-
] }) }) }) : !data || data.length === 0 ? /* @__PURE__ */
|
|
5887
|
+
/* @__PURE__ */ jsx38("span", { className: "text-sm", children: "Loading..." })
|
|
5888
|
+
] }) }) }) : !data || data.length === 0 ? /* @__PURE__ */ jsx38(TableRow, { children: /* @__PURE__ */ jsx38(TableCell, { colSpan: visibleColumns.length, className: "text-center py-6 text-muted-foreground", children: "No data" }) }) : data.map((row, idx) => /* @__PURE__ */ jsx38(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/30"), children: visibleColumns.map((col) => {
|
|
6057
5889
|
const value = col.dataIndex ? row[col.dataIndex] : void 0;
|
|
6058
|
-
return /* @__PURE__ */
|
|
5890
|
+
return /* @__PURE__ */ jsx38(
|
|
6059
5891
|
TableCell,
|
|
6060
5892
|
{
|
|
6061
5893
|
className: cn(
|
|
@@ -6073,7 +5905,7 @@ function DataTable({
|
|
|
6073
5905
|
]
|
|
6074
5906
|
}
|
|
6075
5907
|
) }),
|
|
6076
|
-
total > 0 && /* @__PURE__ */
|
|
5908
|
+
total > 0 && /* @__PURE__ */ jsx38("div", { className: "border-t bg-muted/30 p-4 rounded-b-lg", children: /* @__PURE__ */ jsx38(
|
|
6077
5909
|
Pagination,
|
|
6078
5910
|
{
|
|
6079
5911
|
page: curPage,
|
|
@@ -6092,7 +5924,7 @@ var DataTable_default = DataTable;
|
|
|
6092
5924
|
// ../../components/ui/NotificationModal.tsx
|
|
6093
5925
|
import { ExternalLink } from "lucide-react";
|
|
6094
5926
|
import { useTranslations as useTranslations8 } from "next-intl";
|
|
6095
|
-
import { jsx as
|
|
5927
|
+
import { jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6096
5928
|
function NotificationModal({ isOpen, onClose, notification }) {
|
|
6097
5929
|
const t = useTranslations8("Common");
|
|
6098
5930
|
if (!notification) return null;
|
|
@@ -6113,26 +5945,26 @@ function NotificationModal({ isOpen, onClose, notification }) {
|
|
|
6113
5945
|
onClose();
|
|
6114
5946
|
}
|
|
6115
5947
|
};
|
|
6116
|
-
return /* @__PURE__ */
|
|
5948
|
+
return /* @__PURE__ */ jsx39(
|
|
6117
5949
|
Modal_default,
|
|
6118
5950
|
{
|
|
6119
5951
|
isOpen,
|
|
6120
5952
|
onClose,
|
|
6121
5953
|
title: t("notifications"),
|
|
6122
5954
|
size: "md",
|
|
6123
|
-
children: /* @__PURE__ */
|
|
6124
|
-
/* @__PURE__ */
|
|
6125
|
-
/* @__PURE__ */
|
|
5955
|
+
children: /* @__PURE__ */ jsxs33("div", { className: "space-y-4", children: [
|
|
5956
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2 pb-2 border-b border-border", children: [
|
|
5957
|
+
/* @__PURE__ */ jsx39("div", { className: cn(
|
|
6126
5958
|
"w-2 h-2 rounded-full",
|
|
6127
5959
|
!notification.is_read ? "bg-primary" : "bg-border"
|
|
6128
5960
|
) }),
|
|
6129
|
-
/* @__PURE__ */
|
|
5961
|
+
/* @__PURE__ */ jsx39("span", { className: "text-xs text-muted-foreground", children: !notification.is_read ? t("newNotification") : t("readStatus") })
|
|
6130
5962
|
] }),
|
|
6131
|
-
notification.title && /* @__PURE__ */
|
|
6132
|
-
notification.body && /* @__PURE__ */
|
|
6133
|
-
/* @__PURE__ */
|
|
6134
|
-
/* @__PURE__ */
|
|
6135
|
-
hasLink && /* @__PURE__ */
|
|
5963
|
+
notification.title && /* @__PURE__ */ jsx39("h3", { className: "text-lg font-semibold text-foreground", children: notification.title }),
|
|
5964
|
+
notification.body && /* @__PURE__ */ jsx39("div", { className: "text-sm text-muted-foreground whitespace-pre-wrap leading-relaxed", children: notification.body }),
|
|
5965
|
+
/* @__PURE__ */ jsx39("div", { className: "text-xs text-muted-foreground border-t border-border pt-2", children: formatTime2(notification.created_at) }),
|
|
5966
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex gap-2 justify-end pt-2", children: [
|
|
5967
|
+
hasLink && /* @__PURE__ */ jsxs33(
|
|
6136
5968
|
Button_default,
|
|
6137
5969
|
{
|
|
6138
5970
|
variant: "primary",
|
|
@@ -6140,12 +5972,12 @@ function NotificationModal({ isOpen, onClose, notification }) {
|
|
|
6140
5972
|
onClick: handleLinkClick,
|
|
6141
5973
|
className: "gap-2",
|
|
6142
5974
|
children: [
|
|
6143
|
-
/* @__PURE__ */
|
|
5975
|
+
/* @__PURE__ */ jsx39(ExternalLink, { className: "w-4 h-4" }),
|
|
6144
5976
|
t("openLink")
|
|
6145
5977
|
]
|
|
6146
5978
|
}
|
|
6147
5979
|
),
|
|
6148
|
-
/* @__PURE__ */
|
|
5980
|
+
/* @__PURE__ */ jsx39(
|
|
6149
5981
|
Button_default,
|
|
6150
5982
|
{
|
|
6151
5983
|
variant: "ghost",
|
|
@@ -6167,10 +5999,10 @@ import { usePathname } from "next/navigation";
|
|
|
6167
5999
|
import { Phone } from "lucide-react";
|
|
6168
6000
|
|
|
6169
6001
|
// ../../node_modules/react-icons/lib/iconBase.mjs
|
|
6170
|
-
import
|
|
6002
|
+
import React31 from "react";
|
|
6171
6003
|
|
|
6172
6004
|
// ../../node_modules/react-icons/lib/iconContext.mjs
|
|
6173
|
-
import
|
|
6005
|
+
import React30 from "react";
|
|
6174
6006
|
var DefaultContext = {
|
|
6175
6007
|
color: void 0,
|
|
6176
6008
|
size: void 0,
|
|
@@ -6178,7 +6010,7 @@ var DefaultContext = {
|
|
|
6178
6010
|
style: void 0,
|
|
6179
6011
|
attr: void 0
|
|
6180
6012
|
};
|
|
6181
|
-
var IconContext =
|
|
6013
|
+
var IconContext = React30.createContext && /* @__PURE__ */ React30.createContext(DefaultContext);
|
|
6182
6014
|
|
|
6183
6015
|
// ../../node_modules/react-icons/lib/iconBase.mjs
|
|
6184
6016
|
var _excluded = ["attr", "size", "title"];
|
|
@@ -6267,12 +6099,12 @@ function _toPrimitive(t, r) {
|
|
|
6267
6099
|
return ("string" === r ? String : Number)(t);
|
|
6268
6100
|
}
|
|
6269
6101
|
function Tree2Element(tree) {
|
|
6270
|
-
return tree && tree.map((node, i) => /* @__PURE__ */
|
|
6102
|
+
return tree && tree.map((node, i) => /* @__PURE__ */ React31.createElement(node.tag, _objectSpread({
|
|
6271
6103
|
key: i
|
|
6272
6104
|
}, node.attr), Tree2Element(node.child)));
|
|
6273
6105
|
}
|
|
6274
6106
|
function GenIcon(data) {
|
|
6275
|
-
return (props) => /* @__PURE__ */
|
|
6107
|
+
return (props) => /* @__PURE__ */ React31.createElement(IconBase, _extends({
|
|
6276
6108
|
attr: _objectSpread({}, data.attr)
|
|
6277
6109
|
}, props), Tree2Element(data.child));
|
|
6278
6110
|
}
|
|
@@ -6287,7 +6119,7 @@ function IconBase(props) {
|
|
|
6287
6119
|
var className;
|
|
6288
6120
|
if (conf.className) className = conf.className;
|
|
6289
6121
|
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
6290
|
-
return /* @__PURE__ */
|
|
6122
|
+
return /* @__PURE__ */ React31.createElement("svg", _extends({
|
|
6291
6123
|
stroke: "currentColor",
|
|
6292
6124
|
fill: "currentColor",
|
|
6293
6125
|
strokeWidth: "0"
|
|
@@ -6299,9 +6131,9 @@ function IconBase(props) {
|
|
|
6299
6131
|
height: computedSize,
|
|
6300
6132
|
width: computedSize,
|
|
6301
6133
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6302
|
-
}), title && /* @__PURE__ */
|
|
6134
|
+
}), title && /* @__PURE__ */ React31.createElement("title", null, title), props.children);
|
|
6303
6135
|
};
|
|
6304
|
-
return IconContext !== void 0 ? /* @__PURE__ */
|
|
6136
|
+
return IconContext !== void 0 ? /* @__PURE__ */ React31.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
|
6305
6137
|
}
|
|
6306
6138
|
|
|
6307
6139
|
// ../../node_modules/react-icons/fa/index.mjs
|
|
@@ -6315,9 +6147,9 @@ function SiZalo(props) {
|
|
|
6315
6147
|
}
|
|
6316
6148
|
|
|
6317
6149
|
// ../../components/ui/FloatingContacts.tsx
|
|
6318
|
-
import { jsx as
|
|
6150
|
+
import { jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6319
6151
|
function MessengerIcon(props) {
|
|
6320
|
-
return /* @__PURE__ */
|
|
6152
|
+
return /* @__PURE__ */ jsx40("svg", { viewBox: "0 0 24 24", width: 24, height: 24, "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx40(
|
|
6321
6153
|
"path",
|
|
6322
6154
|
{
|
|
6323
6155
|
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",
|
|
@@ -6326,10 +6158,10 @@ function MessengerIcon(props) {
|
|
|
6326
6158
|
) });
|
|
6327
6159
|
}
|
|
6328
6160
|
function ZaloIcon(props) {
|
|
6329
|
-
return /* @__PURE__ */
|
|
6161
|
+
return /* @__PURE__ */ jsx40(SiZalo, { size: 20, ...props });
|
|
6330
6162
|
}
|
|
6331
6163
|
function InstagramIcon(props) {
|
|
6332
|
-
return /* @__PURE__ */
|
|
6164
|
+
return /* @__PURE__ */ jsx40(FaInstagram, { size: 20, ...props });
|
|
6333
6165
|
}
|
|
6334
6166
|
function FloatingContacts({ className }) {
|
|
6335
6167
|
const pathname = usePathname();
|
|
@@ -6364,8 +6196,8 @@ function FloatingContacts({ className }) {
|
|
|
6364
6196
|
external: true
|
|
6365
6197
|
}
|
|
6366
6198
|
];
|
|
6367
|
-
return /* @__PURE__ */
|
|
6368
|
-
/* @__PURE__ */
|
|
6199
|
+
return /* @__PURE__ */ jsxs34("div", { className: cn("fixed bottom-6 right-4 z-[100000]", "flex flex-col items-end gap-3", className), "aria-label": "Quick contacts", children: [
|
|
6200
|
+
/* @__PURE__ */ jsx40(
|
|
6369
6201
|
Link2,
|
|
6370
6202
|
{
|
|
6371
6203
|
href: `tel:${hotline.replace(/\D/g, "")}`,
|
|
@@ -6376,10 +6208,10 @@ function FloatingContacts({ className }) {
|
|
|
6376
6208
|
"hover:scale-105 active:scale-95 transition-transform",
|
|
6377
6209
|
"bg-[#22c55e]"
|
|
6378
6210
|
),
|
|
6379
|
-
children: /* @__PURE__ */
|
|
6211
|
+
children: /* @__PURE__ */ jsx40(Phone, { className: "w-6 h-6" })
|
|
6380
6212
|
}
|
|
6381
6213
|
),
|
|
6382
|
-
moreItems.map(({ key, href, label, bg, Icon, external }) => /* @__PURE__ */
|
|
6214
|
+
moreItems.map(({ key, href, label, bg, Icon, external }) => /* @__PURE__ */ jsx40(
|
|
6383
6215
|
Link2,
|
|
6384
6216
|
{
|
|
6385
6217
|
href,
|
|
@@ -6391,7 +6223,7 @@ function FloatingContacts({ className }) {
|
|
|
6391
6223
|
"hover:scale-105 active:scale-95 transition-transform",
|
|
6392
6224
|
bg
|
|
6393
6225
|
),
|
|
6394
|
-
children: /* @__PURE__ */
|
|
6226
|
+
children: /* @__PURE__ */ jsx40(Icon, { className: "w-6 h-6" })
|
|
6395
6227
|
},
|
|
6396
6228
|
key
|
|
6397
6229
|
))
|
|
@@ -6400,7 +6232,7 @@ function FloatingContacts({ className }) {
|
|
|
6400
6232
|
|
|
6401
6233
|
// ../../components/ui/AccessDenied.tsx
|
|
6402
6234
|
import { Lock, ShieldAlert, Ban } from "lucide-react";
|
|
6403
|
-
import { jsx as
|
|
6235
|
+
import { jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
6404
6236
|
var VARIANT_STYLES = {
|
|
6405
6237
|
destructive: { bg: "bg-destructive/5", border: "border-destructive/20", text: "text-destructive" },
|
|
6406
6238
|
warning: { bg: "bg-warning/5", border: "border-warning/20", text: "text-warning" },
|
|
@@ -6421,15 +6253,147 @@ function AccessDenied({
|
|
|
6421
6253
|
}) {
|
|
6422
6254
|
const styles = VARIANT_STYLES[variant];
|
|
6423
6255
|
const UsedIcon = Icon || DEFAULT_ICONS[variant];
|
|
6424
|
-
return /* @__PURE__ */
|
|
6425
|
-
/* @__PURE__ */
|
|
6426
|
-
/* @__PURE__ */
|
|
6427
|
-
/* @__PURE__ */
|
|
6428
|
-
/* @__PURE__ */
|
|
6256
|
+
return /* @__PURE__ */ jsx41(Card_default, { className: cn("p-8 text-center shadow-sm", styles.bg, styles.border, className), children: /* @__PURE__ */ jsxs35("div", { className: "flex flex-col items-center gap-4", children: [
|
|
6257
|
+
/* @__PURE__ */ jsx41("div", { className: cn("p-3 rounded-lg", styles.bg.replace("/5", "/10")), children: /* @__PURE__ */ jsx41(UsedIcon, { className: cn("w-8 h-8", styles.text) }) }),
|
|
6258
|
+
/* @__PURE__ */ jsxs35("div", { children: [
|
|
6259
|
+
/* @__PURE__ */ jsx41("h3", { className: cn("font-semibold mb-2", styles.text), children: title }),
|
|
6260
|
+
/* @__PURE__ */ jsx41("p", { className: cn(styles.text.replace("text-", "text-") + "/80", "text-sm"), children: description })
|
|
6429
6261
|
] }),
|
|
6430
|
-
children && /* @__PURE__ */
|
|
6262
|
+
children && /* @__PURE__ */ jsx41("div", { className: "mt-2 flex flex-wrap gap-2 justify-center", children })
|
|
6431
6263
|
] }) });
|
|
6432
6264
|
}
|
|
6265
|
+
|
|
6266
|
+
// locales/en.json
|
|
6267
|
+
var en_default = {
|
|
6268
|
+
Common: {
|
|
6269
|
+
close: "Close",
|
|
6270
|
+
closeAlert: "Close alert",
|
|
6271
|
+
notifications: "Notifications",
|
|
6272
|
+
newNotification: "New",
|
|
6273
|
+
readStatus: "Read",
|
|
6274
|
+
openLink: "Open link",
|
|
6275
|
+
theme: "Theme",
|
|
6276
|
+
lightTheme: "Light",
|
|
6277
|
+
darkTheme: "Dark",
|
|
6278
|
+
systemTheme: "System",
|
|
6279
|
+
density: "Density",
|
|
6280
|
+
compact: "Compact",
|
|
6281
|
+
normal: "Normal",
|
|
6282
|
+
comfortable: "Comfortable",
|
|
6283
|
+
columns: "Columns"
|
|
6284
|
+
},
|
|
6285
|
+
ValidationInput: {
|
|
6286
|
+
required: "This field is required",
|
|
6287
|
+
typeMismatch: "Invalid format",
|
|
6288
|
+
pattern: "Invalid pattern",
|
|
6289
|
+
tooShort: "Too short",
|
|
6290
|
+
tooLong: "Too long",
|
|
6291
|
+
rangeUnderflow: "Below minimum",
|
|
6292
|
+
rangeOverflow: "Above maximum",
|
|
6293
|
+
stepMismatch: "Step mismatch",
|
|
6294
|
+
badInput: "Bad input",
|
|
6295
|
+
invalid: "Invalid value"
|
|
6296
|
+
},
|
|
6297
|
+
Loading: {
|
|
6298
|
+
loadingPage: "Loading page",
|
|
6299
|
+
pleaseWait: "Please wait"
|
|
6300
|
+
},
|
|
6301
|
+
DatePicker: {
|
|
6302
|
+
placeholder: "Select date",
|
|
6303
|
+
today: "Today",
|
|
6304
|
+
clear: "Clear"
|
|
6305
|
+
},
|
|
6306
|
+
Pagination: {
|
|
6307
|
+
navigationLabel: "Pagination navigation",
|
|
6308
|
+
showingResults: "Showing {startItem}\u2013{endItem} of {totalItems}",
|
|
6309
|
+
firstPage: "First page",
|
|
6310
|
+
previousPage: "Previous page",
|
|
6311
|
+
previous: "Previous",
|
|
6312
|
+
nextPage: "Next page",
|
|
6313
|
+
next: "Next",
|
|
6314
|
+
lastPage: "Last page",
|
|
6315
|
+
pageNumber: "Page {page}",
|
|
6316
|
+
itemsPerPage: "Items per page",
|
|
6317
|
+
search: "Search",
|
|
6318
|
+
noOptions: "No options"
|
|
6319
|
+
},
|
|
6320
|
+
OCR: {
|
|
6321
|
+
imageUpload: {
|
|
6322
|
+
dragDropText: "Drag & drop files here",
|
|
6323
|
+
browseFiles: "Browse files",
|
|
6324
|
+
supportedFormats: "Supported formats: images"
|
|
6325
|
+
}
|
|
6326
|
+
}
|
|
6327
|
+
};
|
|
6328
|
+
|
|
6329
|
+
// locales/vi.json
|
|
6330
|
+
var vi_default = {
|
|
6331
|
+
Common: {
|
|
6332
|
+
close: "\u0110\xF3ng",
|
|
6333
|
+
closeAlert: "\u0110\xF3ng c\u1EA3nh b\xE1o",
|
|
6334
|
+
notifications: "Th\xF4ng b\xE1o",
|
|
6335
|
+
newNotification: "M\u1EDBi",
|
|
6336
|
+
readStatus: "\u0110\xE3 \u0111\u1ECDc",
|
|
6337
|
+
openLink: "M\u1EDF li\xEAn k\u1EBFt",
|
|
6338
|
+
theme: "Ch\u1EE7 \u0111\u1EC1",
|
|
6339
|
+
lightTheme: "Giao di\u1EC7n s\xE1ng",
|
|
6340
|
+
darkTheme: "Giao di\u1EC7n t\u1ED1i",
|
|
6341
|
+
systemTheme: "Theo h\u1EC7 th\u1ED1ng",
|
|
6342
|
+
density: "M\u1EADt \u0111\u1ED9",
|
|
6343
|
+
compact: "G\u1ECDn",
|
|
6344
|
+
normal: "Th\u01B0\u1EDDng",
|
|
6345
|
+
comfortable: "Tho\u1EA3i m\xE1i",
|
|
6346
|
+
columns: "C\u1ED9t"
|
|
6347
|
+
},
|
|
6348
|
+
ValidationInput: {
|
|
6349
|
+
required: "Tr\u01B0\u1EDDng n\xE0y l\xE0 b\u1EAFt bu\u1ED9c",
|
|
6350
|
+
typeMismatch: "\u0110\u1ECBnh d\u1EA1ng kh\xF4ng h\u1EE3p l\u1EC7",
|
|
6351
|
+
pattern: "Sai m\u1EABu",
|
|
6352
|
+
tooShort: "Qu\xE1 ng\u1EAFn",
|
|
6353
|
+
tooLong: "Qu\xE1 d\xE0i",
|
|
6354
|
+
rangeUnderflow: "Nh\u1ECF h\u01A1n gi\xE1 tr\u1ECB t\u1ED1i thi\u1EC3u",
|
|
6355
|
+
rangeOverflow: "L\u1EDBn h\u01A1n gi\xE1 tr\u1ECB t\u1ED1i \u0111a",
|
|
6356
|
+
stepMismatch: "Sai b\u01B0\u1EDBc",
|
|
6357
|
+
badInput: "Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7",
|
|
6358
|
+
invalid: "Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7"
|
|
6359
|
+
},
|
|
6360
|
+
Loading: {
|
|
6361
|
+
loadingPage: "\u0110ang t\u1EA3i trang",
|
|
6362
|
+
pleaseWait: "Vui l\xF2ng ch\u1EDD"
|
|
6363
|
+
},
|
|
6364
|
+
DatePicker: {
|
|
6365
|
+
placeholder: "Ch\u1ECDn ng\xE0y",
|
|
6366
|
+
today: "H\xF4m nay",
|
|
6367
|
+
clear: "X\xF3a"
|
|
6368
|
+
},
|
|
6369
|
+
Pagination: {
|
|
6370
|
+
navigationLabel: "\u0110i\u1EC1u h\u01B0\u1EDBng ph\xE2n trang",
|
|
6371
|
+
showingResults: "Hi\u1EC3n th\u1ECB {startItem}\u2013{endItem} trong t\u1ED5ng {totalItems}",
|
|
6372
|
+
firstPage: "Trang \u0111\u1EA7u",
|
|
6373
|
+
previousPage: "Trang tr\u01B0\u1EDBc",
|
|
6374
|
+
previous: "Tr\u01B0\u1EDBc",
|
|
6375
|
+
nextPage: "Trang sau",
|
|
6376
|
+
next: "Sau",
|
|
6377
|
+
lastPage: "Trang cu\u1ED1i",
|
|
6378
|
+
pageNumber: "Trang {page}",
|
|
6379
|
+
itemsPerPage: "S\u1ED1 m\u1EE5c/trang",
|
|
6380
|
+
search: "T\xECm ki\u1EBFm",
|
|
6381
|
+
noOptions: "Kh\xF4ng c\xF3 l\u1EF1a ch\u1ECDn"
|
|
6382
|
+
},
|
|
6383
|
+
OCR: {
|
|
6384
|
+
imageUpload: {
|
|
6385
|
+
dragDropText: "K\xE9o & th\u1EA3 \u1EA3nh v\xE0o \u0111\xE2y",
|
|
6386
|
+
browseFiles: "Ch\u1ECDn t\u1EC7p",
|
|
6387
|
+
supportedFormats: "H\u1ED7 tr\u1EE3 c\xE1c \u0111\u1ECBnh d\u1EA1ng \u1EA3nh"
|
|
6388
|
+
}
|
|
6389
|
+
}
|
|
6390
|
+
};
|
|
6391
|
+
|
|
6392
|
+
// src/index.ts
|
|
6393
|
+
var underverseMessages = { en: en_default, vi: vi_default };
|
|
6394
|
+
function getUnderverseMessages(locale = "en") {
|
|
6395
|
+
return underverseMessages[locale] || underverseMessages.en;
|
|
6396
|
+
}
|
|
6433
6397
|
export {
|
|
6434
6398
|
AccessDenied,
|
|
6435
6399
|
Alert_default as Alert,
|
|
@@ -6470,7 +6434,6 @@ export {
|
|
|
6470
6434
|
Pagination,
|
|
6471
6435
|
PillTabs,
|
|
6472
6436
|
Popover,
|
|
6473
|
-
ProductImageUpload_default as ProductImageUpload,
|
|
6474
6437
|
Progress_default as Progress,
|
|
6475
6438
|
PulseBadge,
|
|
6476
6439
|
RadioGroup_default as RadioGroup,
|
|
@@ -6503,6 +6466,8 @@ export {
|
|
|
6503
6466
|
VARIANT_STYLES_BTN,
|
|
6504
6467
|
VerticalTabs,
|
|
6505
6468
|
cn,
|
|
6469
|
+
getUnderverseMessages,
|
|
6470
|
+
underverseMessages,
|
|
6506
6471
|
useToast
|
|
6507
6472
|
};
|
|
6508
6473
|
//# sourceMappingURL=index.js.map
|