@underverse-ui/underverse 0.1.32 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +700 -651
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +613 -564
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1433,36 +1433,125 @@ var Label = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1433
1433
|
));
|
|
1434
1434
|
Label.displayName = "Label";
|
|
1435
1435
|
|
|
1436
|
-
// ../../components/ui/
|
|
1437
|
-
var
|
|
1436
|
+
// ../../components/ui/SmartImage.tsx
|
|
1437
|
+
var import_image = __toESM(require("next/image"), 1);
|
|
1438
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
1438
1439
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1440
|
+
var DEFAULT_FALLBACK = "/images/products/hoa-hong-do.png";
|
|
1441
|
+
var FAILED_SRCS = /* @__PURE__ */ new Set();
|
|
1442
|
+
function SmartImage({
|
|
1443
|
+
src,
|
|
1444
|
+
alt,
|
|
1445
|
+
className,
|
|
1446
|
+
ratioClass,
|
|
1447
|
+
roundedClass = "rounded-lg",
|
|
1448
|
+
fill = true,
|
|
1449
|
+
width,
|
|
1450
|
+
height,
|
|
1451
|
+
sizes = "(max-width: 768px) 100vw, 33vw",
|
|
1452
|
+
priority = false,
|
|
1453
|
+
quality = 80,
|
|
1454
|
+
fit = "cover",
|
|
1455
|
+
objectPosition,
|
|
1456
|
+
fallbackSrc = DEFAULT_FALLBACK
|
|
1457
|
+
}) {
|
|
1458
|
+
const normalize = (input) => {
|
|
1459
|
+
if (!input || input.length === 0) return fallbackSrc;
|
|
1460
|
+
const raw = input.trim();
|
|
1461
|
+
if (raw.startsWith("/images/products/") && /\.(jpg|jpeg)($|\?)/i.test(raw)) {
|
|
1462
|
+
return raw.replace(/\.(jpg|jpeg)(?=$|\?)/i, ".png");
|
|
1463
|
+
}
|
|
1464
|
+
if (raw.startsWith("//")) {
|
|
1465
|
+
return `https:${raw}`;
|
|
1466
|
+
}
|
|
1467
|
+
if (/^(https?:|data:|blob:)/i.test(raw)) {
|
|
1468
|
+
return FAILED_SRCS.has(raw) ? fallbackSrc : raw;
|
|
1469
|
+
}
|
|
1470
|
+
if (raw.startsWith("/")) {
|
|
1471
|
+
return FAILED_SRCS.has(raw) ? fallbackSrc : raw;
|
|
1472
|
+
}
|
|
1473
|
+
const normalized = `/${raw.replace(/^\.\/?/, "")}`;
|
|
1474
|
+
return FAILED_SRCS.has(normalized) ? fallbackSrc : normalized;
|
|
1475
|
+
};
|
|
1476
|
+
const [resolvedSrc, setResolvedSrc] = import_react5.default.useState(() => normalize(src));
|
|
1477
|
+
import_react5.default.useEffect(() => {
|
|
1478
|
+
setResolvedSrc(normalize(src));
|
|
1479
|
+
}, [src]);
|
|
1480
|
+
const handleError = () => {
|
|
1481
|
+
if (resolvedSrc && resolvedSrc !== fallbackSrc) FAILED_SRCS.add(resolvedSrc);
|
|
1482
|
+
if (resolvedSrc.endsWith(".jpg")) {
|
|
1483
|
+
const next = resolvedSrc.replace(/\.jpg($|\?)/, ".png$1");
|
|
1484
|
+
setResolvedSrc(next);
|
|
1485
|
+
} else if (resolvedSrc !== fallbackSrc) {
|
|
1486
|
+
setResolvedSrc(fallbackSrc);
|
|
1487
|
+
}
|
|
1488
|
+
};
|
|
1489
|
+
const Wrapper = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1490
|
+
"div",
|
|
1491
|
+
{
|
|
1492
|
+
className: cn(
|
|
1493
|
+
"relative overflow-hidden bg-muted/30",
|
|
1494
|
+
// remove any default focus outline/ring for visual consistency with Card
|
|
1495
|
+
"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0",
|
|
1496
|
+
ratioClass,
|
|
1497
|
+
roundedClass,
|
|
1498
|
+
className
|
|
1499
|
+
),
|
|
1500
|
+
children
|
|
1501
|
+
}
|
|
1502
|
+
);
|
|
1503
|
+
if (fill) {
|
|
1504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1505
|
+
import_image.default,
|
|
1506
|
+
{
|
|
1507
|
+
src: resolvedSrc,
|
|
1508
|
+
alt,
|
|
1509
|
+
fill: true,
|
|
1510
|
+
sizes,
|
|
1511
|
+
onError: handleError,
|
|
1512
|
+
priority,
|
|
1513
|
+
quality,
|
|
1514
|
+
style: { objectFit: fit, objectPosition }
|
|
1515
|
+
}
|
|
1516
|
+
) });
|
|
1517
|
+
}
|
|
1518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1519
|
+
"div",
|
|
1520
|
+
{
|
|
1521
|
+
className: cn(
|
|
1522
|
+
"relative overflow-hidden bg-muted/30",
|
|
1523
|
+
"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0",
|
|
1524
|
+
roundedClass,
|
|
1525
|
+
className
|
|
1526
|
+
),
|
|
1527
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1528
|
+
import_image.default,
|
|
1529
|
+
{
|
|
1530
|
+
src: resolvedSrc,
|
|
1531
|
+
alt,
|
|
1532
|
+
width,
|
|
1533
|
+
height,
|
|
1534
|
+
sizes,
|
|
1535
|
+
onError: handleError,
|
|
1536
|
+
priority,
|
|
1537
|
+
quality,
|
|
1538
|
+
style: { objectFit: fit, objectPosition, width: "100%", height: "100%" }
|
|
1539
|
+
}
|
|
1540
|
+
)
|
|
1541
|
+
}
|
|
1542
|
+
);
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
// ../../components/ui/Avatar.tsx
|
|
1546
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1439
1547
|
var sizeClasses = {
|
|
1440
1548
|
sm: "h-8 w-8 text-sm",
|
|
1441
1549
|
md: "h-10 w-10 text-base",
|
|
1442
1550
|
lg: "h-14 w-14 text-lg"
|
|
1443
1551
|
};
|
|
1444
1552
|
var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onClick, ...props }) => {
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1447
|
-
const [imageError, setImageError] = React7.useState(false);
|
|
1448
|
-
React7.useEffect(() => {
|
|
1449
|
-
if (src) {
|
|
1450
|
-
setIsImageLoading(true);
|
|
1451
|
-
setImageError(false);
|
|
1452
|
-
setLoaded(false);
|
|
1453
|
-
}
|
|
1454
|
-
}, [src]);
|
|
1455
|
-
const handleImageLoad = () => {
|
|
1456
|
-
setLoaded(true);
|
|
1457
|
-
setIsImageLoading(false);
|
|
1458
|
-
};
|
|
1459
|
-
const handleImageError = () => {
|
|
1460
|
-
setLoaded(false);
|
|
1461
|
-
setIsImageLoading(false);
|
|
1462
|
-
setImageError(true);
|
|
1463
|
-
};
|
|
1464
|
-
const hasValidSrc = src && src.trim().length > 0;
|
|
1465
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1553
|
+
const hasValidSrc = !!(src && src.trim().length > 0);
|
|
1554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1466
1555
|
"div",
|
|
1467
1556
|
{
|
|
1468
1557
|
className: cn(
|
|
@@ -1474,23 +1563,21 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
|
|
|
1474
1563
|
onClick,
|
|
1475
1564
|
...props,
|
|
1476
1565
|
children: [
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
hasValidSrc && !imageError && // eslint-disable-next-line @next/next/no-img-element
|
|
1480
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1481
|
-
"img",
|
|
1566
|
+
hasValidSrc && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute inset-0", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1567
|
+
SmartImage,
|
|
1482
1568
|
{
|
|
1483
1569
|
src,
|
|
1484
1570
|
alt,
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
className:
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1571
|
+
fill: true,
|
|
1572
|
+
ratioClass: void 0,
|
|
1573
|
+
className: "h-full w-full",
|
|
1574
|
+
roundedClass: "rounded-full",
|
|
1575
|
+
fit: "cover",
|
|
1576
|
+
objectPosition: "center",
|
|
1577
|
+
quality: 80
|
|
1491
1578
|
}
|
|
1492
|
-
),
|
|
1493
|
-
|
|
1579
|
+
) }),
|
|
1580
|
+
!hasValidSrc && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1494
1581
|
"span",
|
|
1495
1582
|
{
|
|
1496
1583
|
className: cn(
|
|
@@ -1500,7 +1587,7 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
|
|
|
1500
1587
|
children: fallback
|
|
1501
1588
|
}
|
|
1502
1589
|
),
|
|
1503
|
-
/* @__PURE__ */ (0,
|
|
1590
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute bottom-0 right-0 w-3 h-3 bg-success border-2 border-background rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-200" })
|
|
1504
1591
|
]
|
|
1505
1592
|
}
|
|
1506
1593
|
);
|
|
@@ -1508,7 +1595,7 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
|
|
|
1508
1595
|
var Avatar_default = Avatar;
|
|
1509
1596
|
|
|
1510
1597
|
// ../../components/ui/Skeleton.tsx
|
|
1511
|
-
var
|
|
1598
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1512
1599
|
var Skeleton = ({
|
|
1513
1600
|
className,
|
|
1514
1601
|
width,
|
|
@@ -1529,7 +1616,7 @@ var Skeleton = ({
|
|
|
1529
1616
|
none: ""
|
|
1530
1617
|
};
|
|
1531
1618
|
if (variant === "text" && lines > 1) {
|
|
1532
|
-
return /* @__PURE__ */ (0,
|
|
1619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: cn("space-y-2", className), children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1533
1620
|
"div",
|
|
1534
1621
|
{
|
|
1535
1622
|
className: cn(
|
|
@@ -1547,7 +1634,7 @@ var Skeleton = ({
|
|
|
1547
1634
|
index
|
|
1548
1635
|
)) });
|
|
1549
1636
|
}
|
|
1550
|
-
return /* @__PURE__ */ (0,
|
|
1637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1551
1638
|
"div",
|
|
1552
1639
|
{
|
|
1553
1640
|
className: cn(
|
|
@@ -1569,7 +1656,7 @@ var SkeletonAvatar = ({
|
|
|
1569
1656
|
md: "w-10 h-10",
|
|
1570
1657
|
lg: "w-12 h-12"
|
|
1571
1658
|
};
|
|
1572
|
-
return /* @__PURE__ */ (0,
|
|
1659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1573
1660
|
Skeleton,
|
|
1574
1661
|
{
|
|
1575
1662
|
variant: "circular",
|
|
@@ -1586,7 +1673,7 @@ var SkeletonButton = ({
|
|
|
1586
1673
|
md: "h-10 w-24",
|
|
1587
1674
|
lg: "h-12 w-28"
|
|
1588
1675
|
};
|
|
1589
|
-
return /* @__PURE__ */ (0,
|
|
1676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1590
1677
|
Skeleton,
|
|
1591
1678
|
{
|
|
1592
1679
|
variant: "rounded",
|
|
@@ -1599,7 +1686,7 @@ var SkeletonText = ({
|
|
|
1599
1686
|
className,
|
|
1600
1687
|
width = "100%"
|
|
1601
1688
|
}) => {
|
|
1602
|
-
return /* @__PURE__ */ (0,
|
|
1689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1603
1690
|
Skeleton,
|
|
1604
1691
|
{
|
|
1605
1692
|
variant: "text",
|
|
@@ -1615,42 +1702,42 @@ var SkeletonCard = ({
|
|
|
1615
1702
|
textLines = 3,
|
|
1616
1703
|
className
|
|
1617
1704
|
}) => {
|
|
1618
|
-
return /* @__PURE__ */ (0,
|
|
1619
|
-
showAvatar && /* @__PURE__ */ (0,
|
|
1620
|
-
/* @__PURE__ */ (0,
|
|
1621
|
-
/* @__PURE__ */ (0,
|
|
1622
|
-
/* @__PURE__ */ (0,
|
|
1623
|
-
/* @__PURE__ */ (0,
|
|
1705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn("p-4 space-y-4 rounded-lg bg-card outline-none focus:outline-none", className), children: [
|
|
1706
|
+
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
1707
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonAvatar, {}),
|
|
1708
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "space-y-2", children: [
|
|
1709
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-4 w-24" }),
|
|
1710
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-3 w-16" })
|
|
1624
1711
|
] })
|
|
1625
1712
|
] }),
|
|
1626
|
-
showImage && /* @__PURE__ */ (0,
|
|
1627
|
-
/* @__PURE__ */ (0,
|
|
1628
|
-
/* @__PURE__ */ (0,
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1630
|
-
/* @__PURE__ */ (0,
|
|
1713
|
+
showImage && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-48 w-full rounded-md" }),
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonText, { lines: textLines }),
|
|
1715
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex space-x-2", children: [
|
|
1716
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonButton, { size: "sm" }),
|
|
1717
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonButton, { size: "sm" })
|
|
1631
1718
|
] })
|
|
1632
1719
|
] });
|
|
1633
1720
|
};
|
|
1634
1721
|
var SkeletonPost = ({ className }) => {
|
|
1635
|
-
return /* @__PURE__ */ (0,
|
|
1636
|
-
/* @__PURE__ */ (0,
|
|
1637
|
-
/* @__PURE__ */ (0,
|
|
1638
|
-
/* @__PURE__ */ (0,
|
|
1639
|
-
/* @__PURE__ */ (0,
|
|
1640
|
-
/* @__PURE__ */ (0,
|
|
1722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn("p-6 space-y-4 rounded-xl bg-card outline-none focus:outline-none", className), children: [
|
|
1723
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
1724
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonAvatar, { size: "lg" }),
|
|
1725
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "space-y-2", children: [
|
|
1726
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-4 w-32" }),
|
|
1727
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-3 w-20" })
|
|
1641
1728
|
] })
|
|
1642
1729
|
] }),
|
|
1643
|
-
/* @__PURE__ */ (0,
|
|
1644
|
-
/* @__PURE__ */ (0,
|
|
1645
|
-
/* @__PURE__ */ (0,
|
|
1646
|
-
/* @__PURE__ */ (0,
|
|
1647
|
-
/* @__PURE__ */ (0,
|
|
1648
|
-
/* @__PURE__ */ (0,
|
|
1730
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonText, { lines: 2 }),
|
|
1731
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-64 w-full rounded-lg" }),
|
|
1732
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center space-x-4", children: [
|
|
1733
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-3 w-16" }),
|
|
1734
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-3 w-20" }),
|
|
1735
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-3 w-12" })
|
|
1649
1736
|
] }),
|
|
1650
|
-
/* @__PURE__ */ (0,
|
|
1651
|
-
/* @__PURE__ */ (0,
|
|
1652
|
-
/* @__PURE__ */ (0,
|
|
1653
|
-
/* @__PURE__ */ (0,
|
|
1737
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex items-center justify-between pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex space-x-4", children: [
|
|
1738
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-8 w-16" }),
|
|
1739
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-8 w-20" }),
|
|
1740
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-8 w-16" })
|
|
1654
1741
|
] }) })
|
|
1655
1742
|
] });
|
|
1656
1743
|
};
|
|
@@ -1659,21 +1746,21 @@ var SkeletonMessage = ({
|
|
|
1659
1746
|
showAvatar = true,
|
|
1660
1747
|
className
|
|
1661
1748
|
}) => {
|
|
1662
|
-
return /* @__PURE__ */ (0,
|
|
1749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn(
|
|
1663
1750
|
"flex items-end space-x-2",
|
|
1664
1751
|
own && "flex-row-reverse space-x-reverse",
|
|
1665
1752
|
className
|
|
1666
1753
|
), children: [
|
|
1667
|
-
showAvatar && !own && /* @__PURE__ */ (0,
|
|
1668
|
-
/* @__PURE__ */ (0,
|
|
1754
|
+
showAvatar && !own && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonAvatar, { size: "sm" }),
|
|
1755
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn(
|
|
1669
1756
|
"max-w-xs space-y-1",
|
|
1670
1757
|
own ? "items-end" : "items-start"
|
|
1671
1758
|
), children: [
|
|
1672
|
-
/* @__PURE__ */ (0,
|
|
1759
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: cn(
|
|
1673
1760
|
"h-10 rounded-2xl",
|
|
1674
1761
|
own ? "w-32 bg-primary/20" : "w-40 bg-muted"
|
|
1675
1762
|
) }),
|
|
1676
|
-
/* @__PURE__ */ (0,
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-3 w-12" })
|
|
1677
1764
|
] })
|
|
1678
1765
|
] });
|
|
1679
1766
|
};
|
|
@@ -1683,13 +1770,13 @@ var SkeletonList = ({
|
|
|
1683
1770
|
showAvatar = true,
|
|
1684
1771
|
className
|
|
1685
1772
|
}) => {
|
|
1686
|
-
return /* @__PURE__ */ (0,
|
|
1687
|
-
showAvatar && /* @__PURE__ */ (0,
|
|
1688
|
-
/* @__PURE__ */ (0,
|
|
1689
|
-
/* @__PURE__ */ (0,
|
|
1690
|
-
/* @__PURE__ */ (0,
|
|
1773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: cn("space-y-3", className), children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center space-x-3 p-3 rounded-lg", children: [
|
|
1774
|
+
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonAvatar, {}),
|
|
1775
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
1776
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-4 w-3/4" }),
|
|
1777
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-3 w-1/2" })
|
|
1691
1778
|
] }),
|
|
1692
|
-
/* @__PURE__ */ (0,
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-6 w-16" })
|
|
1693
1780
|
] }, index)) });
|
|
1694
1781
|
};
|
|
1695
1782
|
var SkeletonTable = ({
|
|
@@ -1697,17 +1784,17 @@ var SkeletonTable = ({
|
|
|
1697
1784
|
columns = 4,
|
|
1698
1785
|
className
|
|
1699
1786
|
}) => {
|
|
1700
|
-
return /* @__PURE__ */ (0,
|
|
1701
|
-
/* @__PURE__ */ (0,
|
|
1702
|
-
Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */ (0,
|
|
1787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn("space-y-3", className), children: [
|
|
1788
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex space-x-4 p-3", children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-4 flex-1" }, index)) }),
|
|
1789
|
+
Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex space-x-4 p-3", children: Array.from({ length: columns }).map((_2, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Skeleton, { className: "h-4 flex-1" }, colIndex)) }, rowIndex))
|
|
1703
1790
|
] });
|
|
1704
1791
|
};
|
|
1705
1792
|
var Skeleton_default = Skeleton;
|
|
1706
1793
|
|
|
1707
1794
|
// ../../components/ui/Progress.tsx
|
|
1708
|
-
var
|
|
1795
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
1709
1796
|
var import_lucide_react4 = require("lucide-react");
|
|
1710
|
-
var
|
|
1797
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1711
1798
|
var variantStyles2 = {
|
|
1712
1799
|
default: "bg-muted-foreground",
|
|
1713
1800
|
primary: "bg-gradient-to-r from-primary via-primary/90 to-primary",
|
|
@@ -1739,29 +1826,29 @@ var Progress = ({
|
|
|
1739
1826
|
const percentage = Math.min(Math.max(value / max * 100, 0), 100);
|
|
1740
1827
|
const isComplete = status === "complete" || percentage >= 100;
|
|
1741
1828
|
const isError = status === "error";
|
|
1742
|
-
const labelId =
|
|
1743
|
-
const descId =
|
|
1829
|
+
const labelId = import_react6.default.useId();
|
|
1830
|
+
const descId = import_react6.default.useId();
|
|
1744
1831
|
const getStatusIcon = () => {
|
|
1745
|
-
if (isComplete) return /* @__PURE__ */ (0,
|
|
1746
|
-
if (isError) return /* @__PURE__ */ (0,
|
|
1747
|
-
if (animated || indeterminate) return /* @__PURE__ */ (0,
|
|
1832
|
+
if (isComplete) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Check, { className: "w-4 h-4 text-success" });
|
|
1833
|
+
if (isError) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.X, { className: "w-4 h-4 text-destructive" });
|
|
1834
|
+
if (animated || indeterminate) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Clock, { className: "w-4 h-4 text-muted-foreground animate-spin" });
|
|
1748
1835
|
return null;
|
|
1749
1836
|
};
|
|
1750
|
-
return /* @__PURE__ */ (0,
|
|
1751
|
-
(label || showValue || description) && /* @__PURE__ */ (0,
|
|
1752
|
-
/* @__PURE__ */ (0,
|
|
1753
|
-
/* @__PURE__ */ (0,
|
|
1754
|
-
label && /* @__PURE__ */ (0,
|
|
1837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("w-full space-y-3", className), children: [
|
|
1838
|
+
(label || showValue || description) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-1", children: [
|
|
1839
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between items-center", children: [
|
|
1840
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1841
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { id: labelId, className: "font-medium text-foreground", children: label }),
|
|
1755
1842
|
getStatusIcon()
|
|
1756
1843
|
] }),
|
|
1757
|
-
showValue && !indeterminate && /* @__PURE__ */ (0,
|
|
1844
|
+
showValue && !indeterminate && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn(
|
|
1758
1845
|
"text-sm font-medium",
|
|
1759
1846
|
isComplete ? "text-success" : isError ? "text-destructive" : "text-muted-foreground"
|
|
1760
1847
|
), children: isComplete ? "Complete" : isError ? "Error" : `${Math.round(percentage)}%` })
|
|
1761
1848
|
] }),
|
|
1762
|
-
description && /* @__PURE__ */ (0,
|
|
1849
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { id: descId, className: "text-sm text-muted-foreground", children: description })
|
|
1763
1850
|
] }),
|
|
1764
|
-
/* @__PURE__ */ (0,
|
|
1851
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1765
1852
|
"div",
|
|
1766
1853
|
{
|
|
1767
1854
|
role: "progressbar",
|
|
@@ -1775,7 +1862,7 @@ var Progress = ({
|
|
|
1775
1862
|
"border border-border/50",
|
|
1776
1863
|
sizeStyles2[size]
|
|
1777
1864
|
),
|
|
1778
|
-
children: /* @__PURE__ */ (0,
|
|
1865
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1779
1866
|
"div",
|
|
1780
1867
|
{
|
|
1781
1868
|
className: cn(
|
|
@@ -1828,11 +1915,11 @@ var CircularProgress = ({
|
|
|
1828
1915
|
info: "stroke-info"
|
|
1829
1916
|
};
|
|
1830
1917
|
const getContentIcon = () => {
|
|
1831
|
-
if (isComplete) return /* @__PURE__ */ (0,
|
|
1832
|
-
if (isError) return /* @__PURE__ */ (0,
|
|
1918
|
+
if (isComplete) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Check, { className: "w-5 h-5 text-success" });
|
|
1919
|
+
if (isError) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.X, { className: "w-5 h-5 text-destructive" });
|
|
1833
1920
|
return null;
|
|
1834
1921
|
};
|
|
1835
|
-
return /* @__PURE__ */ (0,
|
|
1922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1836
1923
|
"div",
|
|
1837
1924
|
{
|
|
1838
1925
|
className: cn("relative inline-flex items-center justify-center", className),
|
|
@@ -1842,7 +1929,7 @@ var CircularProgress = ({
|
|
|
1842
1929
|
"aria-valuenow": indeterminate ? void 0 : Math.round(percentage),
|
|
1843
1930
|
"aria-label": children ? void 0 : "Progress",
|
|
1844
1931
|
children: [
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1932
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1846
1933
|
"svg",
|
|
1847
1934
|
{
|
|
1848
1935
|
width: size,
|
|
@@ -1853,7 +1940,7 @@ var CircularProgress = ({
|
|
|
1853
1940
|
),
|
|
1854
1941
|
style: { animationDuration: indeterminate ? "2s" : void 0 },
|
|
1855
1942
|
children: [
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1943
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1857
1944
|
"circle",
|
|
1858
1945
|
{
|
|
1859
1946
|
cx: size / 2,
|
|
@@ -1865,7 +1952,7 @@ var CircularProgress = ({
|
|
|
1865
1952
|
className: trackColor
|
|
1866
1953
|
}
|
|
1867
1954
|
),
|
|
1868
|
-
/* @__PURE__ */ (0,
|
|
1955
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1869
1956
|
"circle",
|
|
1870
1957
|
{
|
|
1871
1958
|
cx: size / 2,
|
|
@@ -1889,13 +1976,13 @@ var CircularProgress = ({
|
|
|
1889
1976
|
]
|
|
1890
1977
|
}
|
|
1891
1978
|
),
|
|
1892
|
-
/* @__PURE__ */ (0,
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center", children: children ? children : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1893
1980
|
getContentIcon(),
|
|
1894
|
-
showValue && !indeterminate && /* @__PURE__ */ (0,
|
|
1981
|
+
showValue && !indeterminate && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn(
|
|
1895
1982
|
"text-sm font-semibold",
|
|
1896
1983
|
isComplete ? "text-success" : isError ? "text-destructive" : "text-foreground"
|
|
1897
1984
|
), children: isComplete ? "\u2713" : isError ? "\u2717" : `${Math.round(percentage)}%` }),
|
|
1898
|
-
indeterminate && /* @__PURE__ */ (0,
|
|
1985
|
+
indeterminate && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Clock, { className: "w-4 h-4 text-muted-foreground animate-pulse" })
|
|
1899
1986
|
] }) })
|
|
1900
1987
|
]
|
|
1901
1988
|
}
|
|
@@ -1918,10 +2005,10 @@ var StepProgress = ({
|
|
|
1918
2005
|
if (stepIndex === currentStep) return "current";
|
|
1919
2006
|
return "upcoming";
|
|
1920
2007
|
};
|
|
1921
|
-
return /* @__PURE__ */ (0,
|
|
2008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: cn("w-full", className), role: "list", "aria-label": "Progress steps", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex items-center justify-between", children: steps.map((step, index) => {
|
|
1922
2009
|
const status = getStepStatus(index);
|
|
1923
|
-
return /* @__PURE__ */ (0,
|
|
1924
|
-
/* @__PURE__ */ (0,
|
|
2010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center", role: "listitem", "aria-current": status === "current" ? "step" : void 0, children: [
|
|
2011
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1925
2012
|
"div",
|
|
1926
2013
|
{
|
|
1927
2014
|
className: cn(
|
|
@@ -1942,10 +2029,10 @@ var StepProgress = ({
|
|
|
1942
2029
|
"hover:border-muted-foreground/50"
|
|
1943
2030
|
]
|
|
1944
2031
|
),
|
|
1945
|
-
children: status === "completed" ? /* @__PURE__ */ (0,
|
|
2032
|
+
children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Check, { className: "w-3 h-3" }) : index + 1
|
|
1946
2033
|
}
|
|
1947
2034
|
),
|
|
1948
|
-
/* @__PURE__ */ (0,
|
|
2035
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1949
2036
|
"span",
|
|
1950
2037
|
{
|
|
1951
2038
|
className: cn(
|
|
@@ -1957,7 +2044,7 @@ var StepProgress = ({
|
|
|
1957
2044
|
children: step
|
|
1958
2045
|
}
|
|
1959
2046
|
),
|
|
1960
|
-
index < steps.length - 1 && /* @__PURE__ */ (0,
|
|
2047
|
+
index < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1961
2048
|
"div",
|
|
1962
2049
|
{
|
|
1963
2050
|
className: cn(
|
|
@@ -1977,8 +2064,8 @@ var MiniProgress = ({
|
|
|
1977
2064
|
showValue = false
|
|
1978
2065
|
}) => {
|
|
1979
2066
|
const percentage = Math.min(Math.max(value / max * 100, 0), 100);
|
|
1980
|
-
return /* @__PURE__ */ (0,
|
|
1981
|
-
/* @__PURE__ */ (0,
|
|
2067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("flex items-center gap-2", className), children: [
|
|
2068
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1982
2069
|
"div",
|
|
1983
2070
|
{
|
|
1984
2071
|
className: "flex-1 h-1.5 bg-muted/50 rounded-full overflow-hidden",
|
|
@@ -1986,7 +2073,7 @@ var MiniProgress = ({
|
|
|
1986
2073
|
"aria-valuemin": 0,
|
|
1987
2074
|
"aria-valuemax": max,
|
|
1988
2075
|
"aria-valuenow": Math.round(percentage),
|
|
1989
|
-
children: /* @__PURE__ */ (0,
|
|
2076
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1990
2077
|
"div",
|
|
1991
2078
|
{
|
|
1992
2079
|
className: cn(
|
|
@@ -1998,7 +2085,7 @@ var MiniProgress = ({
|
|
|
1998
2085
|
)
|
|
1999
2086
|
}
|
|
2000
2087
|
),
|
|
2001
|
-
showValue && /* @__PURE__ */ (0,
|
|
2088
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "text-xs font-medium text-muted-foreground min-w-[2.5rem] text-right", children: [
|
|
2002
2089
|
Math.round(percentage),
|
|
2003
2090
|
"%"
|
|
2004
2091
|
] })
|
|
@@ -2018,11 +2105,11 @@ var BatteryProgress = ({
|
|
|
2018
2105
|
if (percentage <= 50) return "warning";
|
|
2019
2106
|
return "success";
|
|
2020
2107
|
};
|
|
2021
|
-
return /* @__PURE__ */ (0,
|
|
2022
|
-
/* @__PURE__ */ (0,
|
|
2023
|
-
/* @__PURE__ */ (0,
|
|
2024
|
-
/* @__PURE__ */ (0,
|
|
2025
|
-
/* @__PURE__ */ (0,
|
|
2108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("flex items-center gap-2", className), children: [
|
|
2109
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative", role: "progressbar", "aria-label": "Battery level", "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": Math.round(percentage), children: [
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "w-6 h-3 border-2 border-foreground/20 rounded-sm relative", children: [
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute -right-1 top-0.5 w-0.5 h-1 bg-foreground/20 rounded-r-sm" }),
|
|
2112
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2026
2113
|
"div",
|
|
2027
2114
|
{
|
|
2028
2115
|
className: cn(
|
|
@@ -2034,9 +2121,9 @@ var BatteryProgress = ({
|
|
|
2034
2121
|
}
|
|
2035
2122
|
)
|
|
2036
2123
|
] }),
|
|
2037
|
-
charging && /* @__PURE__ */ (0,
|
|
2124
|
+
charging && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-2 h-2 text-info-foreground", children: "\u26A1" }) })
|
|
2038
2125
|
] }),
|
|
2039
|
-
showValue && /* @__PURE__ */ (0,
|
|
2126
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: cn(
|
|
2040
2127
|
"text-xs font-medium",
|
|
2041
2128
|
percentage <= 20 ? "text-destructive" : "text-muted-foreground"
|
|
2042
2129
|
), children: [
|
|
@@ -2057,7 +2144,7 @@ var SegmentedProgress = ({
|
|
|
2057
2144
|
md: "h-2",
|
|
2058
2145
|
lg: "h-3"
|
|
2059
2146
|
};
|
|
2060
|
-
return /* @__PURE__ */ (0,
|
|
2147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2061
2148
|
"div",
|
|
2062
2149
|
{
|
|
2063
2150
|
className: cn("flex gap-1", className),
|
|
@@ -2065,7 +2152,7 @@ var SegmentedProgress = ({
|
|
|
2065
2152
|
"aria-valuemin": 0,
|
|
2066
2153
|
"aria-valuemax": segments,
|
|
2067
2154
|
"aria-valuenow": activeSegments,
|
|
2068
|
-
children: Array.from({ length: segments }, (_, index) => /* @__PURE__ */ (0,
|
|
2155
|
+
children: Array.from({ length: segments }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2069
2156
|
"div",
|
|
2070
2157
|
{
|
|
2071
2158
|
className: cn(
|
|
@@ -2093,13 +2180,13 @@ var LoadingProgress = ({
|
|
|
2093
2180
|
const getStatusIcon = () => {
|
|
2094
2181
|
switch (status) {
|
|
2095
2182
|
case "complete":
|
|
2096
|
-
return /* @__PURE__ */ (0,
|
|
2183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Check, { className: "w-4 h-4 text-success" });
|
|
2097
2184
|
case "error":
|
|
2098
|
-
return /* @__PURE__ */ (0,
|
|
2185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.X, { className: "w-4 h-4 text-destructive" });
|
|
2099
2186
|
case "paused":
|
|
2100
|
-
return /* @__PURE__ */ (0,
|
|
2187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Clock, { className: "w-4 h-4 text-warning" });
|
|
2101
2188
|
default:
|
|
2102
|
-
return /* @__PURE__ */ (0,
|
|
2189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-2 h-2 bg-primary rounded-full animate-bounce" });
|
|
2103
2190
|
}
|
|
2104
2191
|
};
|
|
2105
2192
|
const getStatusColor = () => {
|
|
@@ -2114,15 +2201,15 @@ var LoadingProgress = ({
|
|
|
2114
2201
|
return variant;
|
|
2115
2202
|
}
|
|
2116
2203
|
};
|
|
2117
|
-
return /* @__PURE__ */ (0,
|
|
2118
|
-
/* @__PURE__ */ (0,
|
|
2119
|
-
/* @__PURE__ */ (0,
|
|
2204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("w-full space-y-2", className), children: [
|
|
2205
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between text-sm", children: [
|
|
2206
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2120
2207
|
getStatusIcon(),
|
|
2121
|
-
label && /* @__PURE__ */ (0,
|
|
2208
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-medium text-foreground", children: label })
|
|
2122
2209
|
] }),
|
|
2123
|
-
/* @__PURE__ */ (0,
|
|
2210
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-muted-foreground", children: status === "complete" ? "Complete" : `${Math.round(percentage)}%` })
|
|
2124
2211
|
] }),
|
|
2125
|
-
/* @__PURE__ */ (0,
|
|
2212
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2126
2213
|
"div",
|
|
2127
2214
|
{
|
|
2128
2215
|
className: "w-full h-2 bg-muted/50 rounded-full overflow-hidden",
|
|
@@ -2131,7 +2218,7 @@ var LoadingProgress = ({
|
|
|
2131
2218
|
"aria-valuemax": max,
|
|
2132
2219
|
"aria-valuenow": Math.round(percentage),
|
|
2133
2220
|
"aria-label": label || "Loading progress",
|
|
2134
|
-
children: /* @__PURE__ */ (0,
|
|
2221
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2135
2222
|
"div",
|
|
2136
2223
|
{
|
|
2137
2224
|
className: cn(
|
|
@@ -2144,9 +2231,9 @@ var LoadingProgress = ({
|
|
|
2144
2231
|
)
|
|
2145
2232
|
}
|
|
2146
2233
|
),
|
|
2147
|
-
(speed || timeRemaining) && /* @__PURE__ */ (0,
|
|
2148
|
-
speed && /* @__PURE__ */ (0,
|
|
2149
|
-
timeRemaining && /* @__PURE__ */ (0,
|
|
2234
|
+
(speed || timeRemaining) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
|
|
2235
|
+
speed && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: speed }),
|
|
2236
|
+
timeRemaining && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: timeRemaining })
|
|
2150
2237
|
] })
|
|
2151
2238
|
] });
|
|
2152
2239
|
};
|
|
@@ -2155,7 +2242,7 @@ var LoadingProgress = ({
|
|
|
2155
2242
|
var React9 = __toESM(require("react"), 1);
|
|
2156
2243
|
var import_react_dom = require("react-dom");
|
|
2157
2244
|
var import_lucide_react5 = require("lucide-react");
|
|
2158
|
-
var
|
|
2245
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2159
2246
|
var sizeStyles3 = {
|
|
2160
2247
|
sm: "max-w-sm",
|
|
2161
2248
|
md: "max-w-md",
|
|
@@ -2226,8 +2313,8 @@ var Modal = ({
|
|
|
2226
2313
|
if (!isMounted || !isOpen && !isVisible) {
|
|
2227
2314
|
return null;
|
|
2228
2315
|
}
|
|
2229
|
-
const modalContent = /* @__PURE__ */ (0,
|
|
2230
|
-
/* @__PURE__ */ (0,
|
|
2316
|
+
const modalContent = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cn("fixed inset-0 z-[9999] flex items-center justify-center", overlayClassName), onClick: handleOverlayClick, children: [
|
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2231
2318
|
"div",
|
|
2232
2319
|
{
|
|
2233
2320
|
className: "absolute inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-200 ease-out",
|
|
@@ -2236,7 +2323,7 @@ var Modal = ({
|
|
|
2236
2323
|
}
|
|
2237
2324
|
}
|
|
2238
2325
|
),
|
|
2239
|
-
/* @__PURE__ */ (0,
|
|
2326
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2240
2327
|
"div",
|
|
2241
2328
|
{
|
|
2242
2329
|
className: cn(
|
|
@@ -2253,12 +2340,12 @@ var Modal = ({
|
|
|
2253
2340
|
},
|
|
2254
2341
|
onClick: (e) => e.stopPropagation(),
|
|
2255
2342
|
children: [
|
|
2256
|
-
(title || description || showCloseButton) && /* @__PURE__ */ (0,
|
|
2257
|
-
/* @__PURE__ */ (0,
|
|
2258
|
-
title && /* @__PURE__ */ (0,
|
|
2259
|
-
description && /* @__PURE__ */ (0,
|
|
2343
|
+
(title || description || showCloseButton) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-start justify-between p-6 pb-0", children: [
|
|
2344
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-1.5", children: [
|
|
2345
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { className: "text-lg font-semibold leading-none tracking-tight", children: title }),
|
|
2346
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-sm text-muted-foreground", children: description })
|
|
2260
2347
|
] }),
|
|
2261
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
2348
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2262
2349
|
"button",
|
|
2263
2350
|
{
|
|
2264
2351
|
onClick: onClose,
|
|
@@ -2267,11 +2354,11 @@ var Modal = ({
|
|
|
2267
2354
|
"hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
2268
2355
|
"disabled:pointer-events-none "
|
|
2269
2356
|
),
|
|
2270
|
-
children: /* @__PURE__ */ (0,
|
|
2357
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.X, { className: "h-4 w-4 cursor-pointer" })
|
|
2271
2358
|
}
|
|
2272
2359
|
)
|
|
2273
2360
|
] }),
|
|
2274
|
-
/* @__PURE__ */ (0,
|
|
2361
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "p-6", children })
|
|
2275
2362
|
]
|
|
2276
2363
|
}
|
|
2277
2364
|
)
|
|
@@ -2281,12 +2368,12 @@ var Modal = ({
|
|
|
2281
2368
|
var Modal_default = Modal;
|
|
2282
2369
|
|
|
2283
2370
|
// ../../components/ui/Toast.tsx
|
|
2284
|
-
var
|
|
2371
|
+
var import_react7 = require("react");
|
|
2285
2372
|
var import_lucide_react6 = require("lucide-react");
|
|
2286
|
-
var
|
|
2287
|
-
var ToastContext = (0,
|
|
2373
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2374
|
+
var ToastContext = (0, import_react7.createContext)(void 0);
|
|
2288
2375
|
var useToast = () => {
|
|
2289
|
-
const context = (0,
|
|
2376
|
+
const context = (0, import_react7.useContext)(ToastContext);
|
|
2290
2377
|
if (!context) {
|
|
2291
2378
|
throw new Error("useToast must be used within a ToastProvider");
|
|
2292
2379
|
}
|
|
@@ -2297,12 +2384,12 @@ var ToastProvider = ({
|
|
|
2297
2384
|
position = "top-right",
|
|
2298
2385
|
maxToasts = 5
|
|
2299
2386
|
}) => {
|
|
2300
|
-
const [toasts, setToasts] = (0,
|
|
2301
|
-
const idRef = (0,
|
|
2302
|
-
const removeToast = (0,
|
|
2387
|
+
const [toasts, setToasts] = (0, import_react7.useState)([]);
|
|
2388
|
+
const idRef = (0, import_react7.useRef)(0);
|
|
2389
|
+
const removeToast = (0, import_react7.useCallback)((id) => {
|
|
2303
2390
|
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
2304
2391
|
}, []);
|
|
2305
|
-
const addToast = (0,
|
|
2392
|
+
const addToast = (0, import_react7.useCallback)((toast) => {
|
|
2306
2393
|
const id = `toast-${++idRef.current}`;
|
|
2307
2394
|
const newToast = { ...toast, id };
|
|
2308
2395
|
setToasts((prev) => {
|
|
@@ -2323,19 +2410,19 @@ var ToastProvider = ({
|
|
|
2323
2410
|
"top-center": "top-4 left-1/2 transform -translate-x-1/2",
|
|
2324
2411
|
"bottom-center": "bottom-4 left-1/2 transform -translate-x-1/2"
|
|
2325
2412
|
};
|
|
2326
|
-
return /* @__PURE__ */ (0,
|
|
2413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(ToastContext.Provider, { value: { addToast, removeToast, toasts }, children: [
|
|
2327
2414
|
children,
|
|
2328
|
-
/* @__PURE__ */ (0,
|
|
2415
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: cn("fixed z-50 flex flex-col gap-2 pointer-events-none", positionClasses[position]), "aria-live": "polite", "aria-atomic": true, children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
|
|
2329
2416
|
] });
|
|
2330
2417
|
};
|
|
2331
2418
|
var ToastComponent = ({ toast, onRemove }) => {
|
|
2332
|
-
const [isVisible, setIsVisible] = (0,
|
|
2333
|
-
const [progress, setProgress] = (0,
|
|
2334
|
-
const [paused, setPaused] = (0,
|
|
2335
|
-
const [startTs] = (0,
|
|
2419
|
+
const [isVisible, setIsVisible] = (0, import_react7.useState)(false);
|
|
2420
|
+
const [progress, setProgress] = (0, import_react7.useState)(100);
|
|
2421
|
+
const [paused, setPaused] = (0, import_react7.useState)(false);
|
|
2422
|
+
const [startTs] = (0, import_react7.useState)(() => Date.now());
|
|
2336
2423
|
const total = toast.duration && toast.duration > 0 ? toast.duration : 5e3;
|
|
2337
|
-
const [remaining, setRemaining] = (0,
|
|
2338
|
-
(0,
|
|
2424
|
+
const [remaining, setRemaining] = (0, import_react7.useState)(total);
|
|
2425
|
+
(0, import_react7.useEffect)(() => {
|
|
2339
2426
|
setIsVisible(true);
|
|
2340
2427
|
if (toast.duration === 0) return;
|
|
2341
2428
|
let raf;
|
|
@@ -2383,7 +2470,7 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2383
2470
|
};
|
|
2384
2471
|
const config = typeConfig[toast.type];
|
|
2385
2472
|
const Icon = config.icon;
|
|
2386
|
-
return /* @__PURE__ */ (0,
|
|
2473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2387
2474
|
"div",
|
|
2388
2475
|
{
|
|
2389
2476
|
className: cn(
|
|
@@ -2397,12 +2484,12 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2397
2484
|
onMouseEnter: () => setPaused(true),
|
|
2398
2485
|
onMouseLeave: () => setPaused(false),
|
|
2399
2486
|
children: [
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2401
|
-
/* @__PURE__ */ (0,
|
|
2402
|
-
/* @__PURE__ */ (0,
|
|
2403
|
-
toast.title && /* @__PURE__ */ (0,
|
|
2404
|
-
/* @__PURE__ */ (0,
|
|
2405
|
-
toast.action && /* @__PURE__ */ (0,
|
|
2487
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-start gap-3 p-4", children: [
|
|
2488
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { className: cn("h-5 w-5 mt-0.5 shrink-0", config.iconClassName) }),
|
|
2489
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex-1 space-y-1", children: [
|
|
2490
|
+
toast.title && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { className: "font-medium text-sm leading-none", children: toast.title }),
|
|
2491
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-sm text-muted-foreground leading-relaxed", children: toast.message }),
|
|
2492
|
+
toast.action && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2406
2493
|
"button",
|
|
2407
2494
|
{
|
|
2408
2495
|
onClick: () => {
|
|
@@ -2414,7 +2501,7 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2414
2501
|
}
|
|
2415
2502
|
)
|
|
2416
2503
|
] }),
|
|
2417
|
-
(toast.dismissible ?? true) && /* @__PURE__ */ (0,
|
|
2504
|
+
(toast.dismissible ?? true) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2418
2505
|
"button",
|
|
2419
2506
|
{
|
|
2420
2507
|
onClick: handleRemove,
|
|
@@ -2423,11 +2510,11 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2423
2510
|
"transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-primary/50"
|
|
2424
2511
|
),
|
|
2425
2512
|
"aria-label": "Close toast",
|
|
2426
|
-
children: /* @__PURE__ */ (0,
|
|
2513
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react6.X, { className: "h-4 w-4" })
|
|
2427
2514
|
}
|
|
2428
2515
|
)
|
|
2429
2516
|
] }),
|
|
2430
|
-
toast.duration !== 0 && /* @__PURE__ */ (0,
|
|
2517
|
+
toast.duration !== 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "absolute left-0 right-0 bottom-0 h-1 bg-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2431
2518
|
"div",
|
|
2432
2519
|
{
|
|
2433
2520
|
className: cn(
|
|
@@ -2449,7 +2536,7 @@ var Toast_default = ToastProvider;
|
|
|
2449
2536
|
// ../../components/ui/Tooltip.tsx
|
|
2450
2537
|
var React11 = __toESM(require("react"), 1);
|
|
2451
2538
|
var import_react_dom2 = require("react-dom");
|
|
2452
|
-
var
|
|
2539
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2453
2540
|
var variantStyles3 = {
|
|
2454
2541
|
default: "bg-popover text-popover-foreground border-border",
|
|
2455
2542
|
info: "bg-info text-info-foreground border-info/20",
|
|
@@ -2535,7 +2622,7 @@ var Tooltip = ({
|
|
|
2535
2622
|
if (disabled || !content) {
|
|
2536
2623
|
return children;
|
|
2537
2624
|
}
|
|
2538
|
-
return /* @__PURE__ */ (0,
|
|
2625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
2539
2626
|
React11.cloneElement(children, {
|
|
2540
2627
|
ref: triggerRef,
|
|
2541
2628
|
onMouseEnter: handleMouseEnter,
|
|
@@ -2544,7 +2631,7 @@ var Tooltip = ({
|
|
|
2544
2631
|
onBlur: handleBlur
|
|
2545
2632
|
}),
|
|
2546
2633
|
isMounted && isOpen && position && (0, import_react_dom2.createPortal)(
|
|
2547
|
-
/* @__PURE__ */ (0,
|
|
2634
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2548
2635
|
"div",
|
|
2549
2636
|
{
|
|
2550
2637
|
style: {
|
|
@@ -2675,7 +2762,7 @@ var useShadCNAnimations = () => {
|
|
|
2675
2762
|
};
|
|
2676
2763
|
|
|
2677
2764
|
// ../../components/ui/Popover.tsx
|
|
2678
|
-
var
|
|
2765
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2679
2766
|
var Popover = ({
|
|
2680
2767
|
trigger,
|
|
2681
2768
|
children,
|
|
@@ -2787,7 +2874,7 @@ var Popover = ({
|
|
|
2787
2874
|
setIsOpen(next);
|
|
2788
2875
|
}
|
|
2789
2876
|
};
|
|
2790
|
-
const popoverContent = isOpen && dropdownPosition ? /* @__PURE__ */ (0,
|
|
2877
|
+
const popoverContent = isOpen && dropdownPosition ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2791
2878
|
"div",
|
|
2792
2879
|
{
|
|
2793
2880
|
"data-popover": true,
|
|
@@ -2808,7 +2895,7 @@ var Popover = ({
|
|
|
2808
2895
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
2809
2896
|
className
|
|
2810
2897
|
),
|
|
2811
|
-
children: /* @__PURE__ */ (0,
|
|
2898
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2812
2899
|
"div",
|
|
2813
2900
|
{
|
|
2814
2901
|
className: cn(
|
|
@@ -2822,7 +2909,7 @@ var Popover = ({
|
|
|
2822
2909
|
)
|
|
2823
2910
|
}
|
|
2824
2911
|
) : null;
|
|
2825
|
-
return /* @__PURE__ */ (0,
|
|
2912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2826
2913
|
(() => {
|
|
2827
2914
|
const triggerEl = trigger;
|
|
2828
2915
|
return React12.cloneElement(triggerEl, {
|
|
@@ -2851,7 +2938,7 @@ var Popover = ({
|
|
|
2851
2938
|
var React13 = __toESM(require("react"), 1);
|
|
2852
2939
|
var import_react_dom4 = require("react-dom");
|
|
2853
2940
|
var import_lucide_react7 = require("lucide-react");
|
|
2854
|
-
var
|
|
2941
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2855
2942
|
var sizeStyles4 = {
|
|
2856
2943
|
sm: {
|
|
2857
2944
|
right: "w-[300px]",
|
|
@@ -2978,8 +3065,8 @@ var Sheet = ({
|
|
|
2978
3065
|
onOpenChange(false);
|
|
2979
3066
|
};
|
|
2980
3067
|
if (!mounted || !open && !isVisible) return null;
|
|
2981
|
-
const sheetContent = /* @__PURE__ */ (0,
|
|
2982
|
-
/* @__PURE__ */ (0,
|
|
3068
|
+
const sheetContent = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "fixed inset-0 z-50", children: [
|
|
3069
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2983
3070
|
"div",
|
|
2984
3071
|
{
|
|
2985
3072
|
className: cn(
|
|
@@ -2990,7 +3077,7 @@ var Sheet = ({
|
|
|
2990
3077
|
onClick: handleOverlayClick
|
|
2991
3078
|
}
|
|
2992
3079
|
),
|
|
2993
|
-
/* @__PURE__ */ (0,
|
|
3080
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2994
3081
|
"div",
|
|
2995
3082
|
{
|
|
2996
3083
|
className: cn(
|
|
@@ -3012,14 +3099,14 @@ var Sheet = ({
|
|
|
3012
3099
|
transition: "transform 300ms cubic-bezier(0.4, 0, 0.2, 1)"
|
|
3013
3100
|
},
|
|
3014
3101
|
children: [
|
|
3015
|
-
(title || description || header || showClose) && /* @__PURE__ */ (0,
|
|
3016
|
-
/* @__PURE__ */ (0,
|
|
3017
|
-
title && /* @__PURE__ */ (0,
|
|
3018
|
-
description && /* @__PURE__ */ (0,
|
|
3102
|
+
(title || description || header || showClose) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex-shrink-0 border-b border-border", children: header || /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between p-4", children: [
|
|
3103
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex-1", children: [
|
|
3104
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h2", { className: "text-lg font-semibold text-foreground", children: title }),
|
|
3105
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm text-muted-foreground mt-1", children: description })
|
|
3019
3106
|
] }),
|
|
3020
|
-
showClose && /* @__PURE__ */ (0,
|
|
3107
|
+
showClose && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button_default, { variant: "ghost", size: "sm", onClick: handleClose, className: "h-8 w-8 p-0 rounded-md cursor-pointer", icon: import_lucide_react7.X })
|
|
3021
3108
|
] }) }),
|
|
3022
|
-
/* @__PURE__ */ (0,
|
|
3109
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3023
3110
|
"div",
|
|
3024
3111
|
{
|
|
3025
3112
|
className: "flex-1 overflow-auto p-4",
|
|
@@ -3031,7 +3118,7 @@ var Sheet = ({
|
|
|
3031
3118
|
children
|
|
3032
3119
|
}
|
|
3033
3120
|
),
|
|
3034
|
-
footer && /* @__PURE__ */ (0,
|
|
3121
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex-shrink-0 border-t border-border p-4", children: footer })
|
|
3035
3122
|
]
|
|
3036
3123
|
}
|
|
3037
3124
|
)
|
|
@@ -3039,38 +3126,38 @@ var Sheet = ({
|
|
|
3039
3126
|
return typeof window !== "undefined" ? (0, import_react_dom4.createPortal)(sheetContent, document.body) : null;
|
|
3040
3127
|
};
|
|
3041
3128
|
var Drawer = ({ placement = "right", ...props }) => {
|
|
3042
|
-
return /* @__PURE__ */ (0,
|
|
3129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Sheet, { ...props, side: placement, variant: "overlay" });
|
|
3043
3130
|
};
|
|
3044
3131
|
var SlideOver = (props) => {
|
|
3045
|
-
return /* @__PURE__ */ (0,
|
|
3132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Sheet, { ...props, side: "right", variant: "overlay", size: "lg" });
|
|
3046
3133
|
};
|
|
3047
3134
|
var BottomSheet = ({ snapPoints = ["25%", "50%", "90%"], defaultSnap = 1, ...props }) => {
|
|
3048
|
-
return /* @__PURE__ */ (0,
|
|
3135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Sheet, { ...props, side: "bottom", variant: "overlay", className: cn("rounded-t-lg", props.className) });
|
|
3049
3136
|
};
|
|
3050
3137
|
var SidebarSheet = ({ navigation, children, ...props }) => {
|
|
3051
|
-
return /* @__PURE__ */ (0,
|
|
3052
|
-
navigation && /* @__PURE__ */ (0,
|
|
3138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Sheet, { ...props, side: "left", variant: "push", size: "md", children: [
|
|
3139
|
+
navigation && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "border-b border-border pb-4 mb-4", children: navigation }),
|
|
3053
3140
|
children
|
|
3054
3141
|
] });
|
|
3055
3142
|
};
|
|
3056
3143
|
|
|
3057
3144
|
// ../../components/ui/Alert.tsx
|
|
3058
|
-
var
|
|
3145
|
+
var import_react8 = require("react");
|
|
3059
3146
|
|
|
3060
3147
|
// ../../components/icons/AlertIcons.tsx
|
|
3061
3148
|
var import_lucide_react8 = require("lucide-react");
|
|
3062
|
-
var
|
|
3149
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3063
3150
|
function InfoIcon(props) {
|
|
3064
|
-
return /* @__PURE__ */ (0,
|
|
3151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Info, { "aria-hidden": true, className: props.className });
|
|
3065
3152
|
}
|
|
3066
3153
|
function WarningIcon(props) {
|
|
3067
|
-
return /* @__PURE__ */ (0,
|
|
3154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.AlertTriangle, { "aria-hidden": true, className: props.className });
|
|
3068
3155
|
}
|
|
3069
3156
|
function CheckCircleIcon(props) {
|
|
3070
|
-
return /* @__PURE__ */ (0,
|
|
3157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.CheckCircle2, { "aria-hidden": true, className: props.className });
|
|
3071
3158
|
}
|
|
3072
3159
|
function ErrorIcon(props) {
|
|
3073
|
-
return /* @__PURE__ */ (0,
|
|
3160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.OctagonX, { "aria-hidden": true, className: props.className });
|
|
3074
3161
|
}
|
|
3075
3162
|
|
|
3076
3163
|
// ../../components/ui/Alert.tsx
|
|
@@ -3088,42 +3175,42 @@ var VARIANT_STYLES_ALERT = {
|
|
|
3088
3175
|
};
|
|
3089
3176
|
|
|
3090
3177
|
// ../../components/ui/Alert.tsx
|
|
3091
|
-
var
|
|
3178
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3092
3179
|
var variantIcons = {
|
|
3093
|
-
default: /* @__PURE__ */ (0,
|
|
3094
|
-
info: /* @__PURE__ */ (0,
|
|
3095
|
-
success: /* @__PURE__ */ (0,
|
|
3096
|
-
warning: /* @__PURE__ */ (0,
|
|
3097
|
-
error: /* @__PURE__ */ (0,
|
|
3180
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InfoIcon, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3181
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InfoIcon, { className: "h-4 w-4 text-info" }),
|
|
3182
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CheckCircleIcon, { className: "h-4 w-4 text-success" }),
|
|
3183
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WarningIcon, { className: "h-4 w-4 text-warning" }),
|
|
3184
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ErrorIcon, { className: "h-4 w-4 text-destructive" })
|
|
3098
3185
|
};
|
|
3099
3186
|
var Alert = ({ title, description, variant = "default", className, icon, dismissible = false, onClose, actions, closeAriaLabel }) => {
|
|
3100
|
-
const [open, setOpen] = (0,
|
|
3187
|
+
const [open, setOpen] = (0, import_react8.useState)(true);
|
|
3101
3188
|
const t = (0, import_next_intl2.useTranslations)("Common");
|
|
3102
3189
|
if (!open) return null;
|
|
3103
3190
|
const handleClose = () => {
|
|
3104
3191
|
setOpen(false);
|
|
3105
3192
|
onClose?.();
|
|
3106
3193
|
};
|
|
3107
|
-
return /* @__PURE__ */ (0,
|
|
3194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3108
3195
|
"div",
|
|
3109
3196
|
{
|
|
3110
3197
|
className: cn("w-full p-4 rounded-md flex items-start gap-3", VARIANT_STYLES_ALERT[variant], className),
|
|
3111
3198
|
role: "alert",
|
|
3112
3199
|
"aria-live": variant === "error" ? "assertive" : "polite",
|
|
3113
3200
|
children: [
|
|
3114
|
-
/* @__PURE__ */ (0,
|
|
3115
|
-
/* @__PURE__ */ (0,
|
|
3116
|
-
title && /* @__PURE__ */ (0,
|
|
3117
|
-
description && (typeof description === "string" ? /* @__PURE__ */ (0,
|
|
3118
|
-
actions && /* @__PURE__ */ (0,
|
|
3201
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pt-1", children: icon ?? variantIcons[variant] }),
|
|
3202
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3203
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "font-semibold text-sm leading-none mb-1 text-foreground", children: title }),
|
|
3204
|
+
description && (typeof description === "string" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-muted-foreground leading-relaxed break-words", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-sm text-muted-foreground leading-relaxed break-words", children: description })),
|
|
3205
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mt-2 flex flex-wrap gap-2", children: actions })
|
|
3119
3206
|
] }),
|
|
3120
|
-
dismissible && /* @__PURE__ */ (0,
|
|
3207
|
+
dismissible && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3121
3208
|
"button",
|
|
3122
3209
|
{
|
|
3123
3210
|
onClick: handleClose,
|
|
3124
3211
|
className: "rounded-md p-1 hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3125
3212
|
"aria-label": closeAriaLabel || t("closeAlert"),
|
|
3126
|
-
children: /* @__PURE__ */ (0,
|
|
3213
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.X, { className: "h-4 w-4" })
|
|
3127
3214
|
}
|
|
3128
3215
|
)
|
|
3129
3216
|
]
|
|
@@ -3133,7 +3220,7 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
3133
3220
|
var Alert_default = Alert;
|
|
3134
3221
|
|
|
3135
3222
|
// ../../components/ui/GlobalLoading.tsx
|
|
3136
|
-
var
|
|
3223
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
3137
3224
|
var import_lucide_react10 = require("lucide-react");
|
|
3138
3225
|
|
|
3139
3226
|
// ../../lib/utils/loading.ts
|
|
@@ -3179,20 +3266,20 @@ var loading = new LoadingManager();
|
|
|
3179
3266
|
|
|
3180
3267
|
// ../../components/ui/GlobalLoading.tsx
|
|
3181
3268
|
var import_next_intl3 = require("next-intl");
|
|
3182
|
-
var
|
|
3269
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3183
3270
|
var GlobalLoading = ({
|
|
3184
3271
|
className,
|
|
3185
3272
|
backdrop = true,
|
|
3186
3273
|
position = "fixed",
|
|
3187
3274
|
size = "lg"
|
|
3188
3275
|
}) => {
|
|
3189
|
-
const [state, setState] = (0,
|
|
3190
|
-
(0,
|
|
3276
|
+
const [state, setState] = (0, import_react9.useState)(() => loading.getState());
|
|
3277
|
+
(0, import_react9.useEffect)(() => {
|
|
3191
3278
|
const unsubscribe = loading.subscribe(setState);
|
|
3192
3279
|
return unsubscribe;
|
|
3193
3280
|
}, []);
|
|
3194
3281
|
if (!state.isVisible) return null;
|
|
3195
|
-
return /* @__PURE__ */ (0,
|
|
3282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3196
3283
|
"div",
|
|
3197
3284
|
{
|
|
3198
3285
|
className: cn(
|
|
@@ -3204,9 +3291,9 @@ var GlobalLoading = ({
|
|
|
3204
3291
|
role: "dialog",
|
|
3205
3292
|
"aria-modal": true,
|
|
3206
3293
|
"aria-label": "Loading",
|
|
3207
|
-
children: /* @__PURE__ */ (0,
|
|
3208
|
-
/* @__PURE__ */ (0,
|
|
3209
|
-
state.text && /* @__PURE__ */ (0,
|
|
3294
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center justify-center space-x-3 backdrop-blur-sm rounded-lg px-6 py-4 shadow-lg", role: "status", "aria-live": "assertive", "aria-busy": true, children: [
|
|
3295
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.Activity, { className: "w-6 h-6 animate-spin text-primary-background", "aria-hidden": true }),
|
|
3296
|
+
state.text && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-base font-medium text-foreground", children: state.text })
|
|
3210
3297
|
] })
|
|
3211
3298
|
}
|
|
3212
3299
|
);
|
|
@@ -3217,14 +3304,14 @@ var PageLoading = ({
|
|
|
3217
3304
|
}) => {
|
|
3218
3305
|
const t = (0, import_next_intl3.useTranslations)("Loading");
|
|
3219
3306
|
const defaultMessage = message || t("loadingPage");
|
|
3220
|
-
return /* @__PURE__ */ (0,
|
|
3307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn(
|
|
3221
3308
|
"min-h-screen flex items-center justify-center bg-background",
|
|
3222
3309
|
className
|
|
3223
|
-
), children: /* @__PURE__ */ (0,
|
|
3224
|
-
/* @__PURE__ */ (0,
|
|
3225
|
-
/* @__PURE__ */ (0,
|
|
3226
|
-
/* @__PURE__ */ (0,
|
|
3227
|
-
/* @__PURE__ */ (0,
|
|
3310
|
+
), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "text-center space-y-4", children: [
|
|
3311
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.Activity, { className: "w-8 h-8 animate-spin text-primary mx-auto" }),
|
|
3312
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
3313
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-lg font-medium text-foreground", children: defaultMessage }),
|
|
3314
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-muted-foreground mt-2", children: t("pleaseWait") })
|
|
3228
3315
|
] })
|
|
3229
3316
|
] }) });
|
|
3230
3317
|
};
|
|
@@ -3240,9 +3327,9 @@ var InlineLoading = ({
|
|
|
3240
3327
|
md: "w-6 h-6",
|
|
3241
3328
|
lg: "w-8 h-8"
|
|
3242
3329
|
};
|
|
3243
|
-
return /* @__PURE__ */ (0,
|
|
3244
|
-
/* @__PURE__ */ (0,
|
|
3245
|
-
text && /* @__PURE__ */ (0,
|
|
3330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex items-center justify-center space-x-2", className), children: [
|
|
3331
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.Activity, { className: cn("animate-spin text-primary", sizeClasses2[size]) }),
|
|
3332
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-sm text-muted-foreground animate-pulse", children: text })
|
|
3246
3333
|
] });
|
|
3247
3334
|
};
|
|
3248
3335
|
var ButtonLoading = ({
|
|
@@ -3252,11 +3339,11 @@ var ButtonLoading = ({
|
|
|
3252
3339
|
disabled,
|
|
3253
3340
|
loadingText
|
|
3254
3341
|
}) => {
|
|
3255
|
-
const child =
|
|
3342
|
+
const child = import_react9.default.isValidElement(children) ? import_react9.default.cloneElement(children, {
|
|
3256
3343
|
disabled: (children.props?.disabled ?? false) || disabled || isLoading,
|
|
3257
3344
|
"aria-busy": isLoading || void 0
|
|
3258
3345
|
}) : children;
|
|
3259
|
-
return /* @__PURE__ */ (0,
|
|
3346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3260
3347
|
"div",
|
|
3261
3348
|
{
|
|
3262
3349
|
className: cn(
|
|
@@ -3265,11 +3352,11 @@ var ButtonLoading = ({
|
|
|
3265
3352
|
className
|
|
3266
3353
|
),
|
|
3267
3354
|
children: [
|
|
3268
|
-
isLoading && /* @__PURE__ */ (0,
|
|
3269
|
-
/* @__PURE__ */ (0,
|
|
3270
|
-
loadingText && /* @__PURE__ */ (0,
|
|
3355
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: [
|
|
3356
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.Activity, { className: "w-4 h-4 animate-spin text-primary-foreground" }),
|
|
3357
|
+
loadingText && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ml-2 text-sm", children: loadingText })
|
|
3271
3358
|
] }),
|
|
3272
|
-
/* @__PURE__ */ (0,
|
|
3359
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn(isLoading && "opacity-50 pointer-events-none"), children: child })
|
|
3273
3360
|
]
|
|
3274
3361
|
}
|
|
3275
3362
|
);
|
|
@@ -3279,7 +3366,7 @@ var ButtonLoading = ({
|
|
|
3279
3366
|
var React15 = __toESM(require("react"), 1);
|
|
3280
3367
|
var import_link = __toESM(require("next/link"), 1);
|
|
3281
3368
|
var import_lucide_react11 = require("lucide-react");
|
|
3282
|
-
var
|
|
3369
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3283
3370
|
var sizeStyles5 = {
|
|
3284
3371
|
sm: {
|
|
3285
3372
|
text: "text-xs",
|
|
@@ -3326,16 +3413,16 @@ var Breadcrumb = ({
|
|
|
3326
3413
|
}, [items.length, maxItems, collapsible]);
|
|
3327
3414
|
const getSeparator = () => {
|
|
3328
3415
|
if (typeof separator === "string") {
|
|
3329
|
-
return /* @__PURE__ */ (0,
|
|
3416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-muted-foreground", children: separator });
|
|
3330
3417
|
}
|
|
3331
3418
|
if (variant === "slash") {
|
|
3332
|
-
return /* @__PURE__ */ (0,
|
|
3419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-muted-foreground", children: "/" });
|
|
3333
3420
|
}
|
|
3334
3421
|
if (variant === "arrow") {
|
|
3335
|
-
return /* @__PURE__ */ (0,
|
|
3422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-muted-foreground", children: "\u2192" });
|
|
3336
3423
|
}
|
|
3337
3424
|
const SeparatorComponent = separator;
|
|
3338
|
-
return /* @__PURE__ */ (0,
|
|
3425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SeparatorComponent, { className: cn("text-muted-foreground", sizeStyles5[size].icon) });
|
|
3339
3426
|
};
|
|
3340
3427
|
const processedItems = React15.useMemo(() => {
|
|
3341
3428
|
let finalItems = [...items];
|
|
@@ -3356,17 +3443,17 @@ var Breadcrumb = ({
|
|
|
3356
3443
|
const handleCollapseToggle = () => {
|
|
3357
3444
|
setIsCollapsed(!isCollapsed);
|
|
3358
3445
|
};
|
|
3359
|
-
return /* @__PURE__ */ (0,
|
|
3446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3360
3447
|
"nav",
|
|
3361
3448
|
{
|
|
3362
3449
|
className: cn("flex w-full items-center", sizeStyles5[size].text, className),
|
|
3363
3450
|
"aria-label": "Breadcrumb navigation",
|
|
3364
|
-
children: /* @__PURE__ */ (0,
|
|
3451
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ol", { className: cn("flex items-center", sizeStyles5[size].spacing), children: processedItems.map((item, index) => {
|
|
3365
3452
|
const isLast = index === processedItems.length - 1;
|
|
3366
3453
|
const isCollapsedIndicator = item.label === "...";
|
|
3367
3454
|
const Icon = item.icon;
|
|
3368
|
-
return /* @__PURE__ */ (0,
|
|
3369
|
-
isCollapsedIndicator ? /* @__PURE__ */ (0,
|
|
3455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { className: "flex items-center", children: [
|
|
3456
|
+
isCollapsedIndicator ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3370
3457
|
"button",
|
|
3371
3458
|
{
|
|
3372
3459
|
onClick: handleCollapseToggle,
|
|
@@ -3377,9 +3464,9 @@ var Breadcrumb = ({
|
|
|
3377
3464
|
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
|
|
3378
3465
|
),
|
|
3379
3466
|
"aria-label": "Show all breadcrumb items",
|
|
3380
|
-
children: /* @__PURE__ */ (0,
|
|
3467
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.MoreHorizontal, { className: sizeStyles5[size].icon })
|
|
3381
3468
|
}
|
|
3382
|
-
) : item.href && !isLast && !item.disabled ? /* @__PURE__ */ (0,
|
|
3469
|
+
) : item.href && !isLast && !item.disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3383
3470
|
import_link.default,
|
|
3384
3471
|
{
|
|
3385
3472
|
href: item.href,
|
|
@@ -3390,11 +3477,11 @@ var Breadcrumb = ({
|
|
|
3390
3477
|
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 rounded-sm"
|
|
3391
3478
|
),
|
|
3392
3479
|
children: [
|
|
3393
|
-
Icon && /* @__PURE__ */ (0,
|
|
3394
|
-
/* @__PURE__ */ (0,
|
|
3480
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { className: sizeStyles5[size].icon }),
|
|
3481
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: item.label })
|
|
3395
3482
|
]
|
|
3396
3483
|
}
|
|
3397
|
-
) : /* @__PURE__ */ (0,
|
|
3484
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3398
3485
|
"span",
|
|
3399
3486
|
{
|
|
3400
3487
|
className: cn(
|
|
@@ -3404,12 +3491,12 @@ var Breadcrumb = ({
|
|
|
3404
3491
|
),
|
|
3405
3492
|
"aria-current": isLast ? "page" : void 0,
|
|
3406
3493
|
children: [
|
|
3407
|
-
Icon && /* @__PURE__ */ (0,
|
|
3408
|
-
/* @__PURE__ */ (0,
|
|
3494
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { className: sizeStyles5[size].icon }),
|
|
3495
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: item.label })
|
|
3409
3496
|
]
|
|
3410
3497
|
}
|
|
3411
3498
|
),
|
|
3412
|
-
!isLast && /* @__PURE__ */ (0,
|
|
3499
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3413
3500
|
"span",
|
|
3414
3501
|
{
|
|
3415
3502
|
className: cn("mx-1", sizeStyles5[size].spacing),
|
|
@@ -3427,7 +3514,7 @@ var Breadcrumb_default = Breadcrumb;
|
|
|
3427
3514
|
|
|
3428
3515
|
// ../../components/ui/Tab.tsx
|
|
3429
3516
|
var React16 = __toESM(require("react"), 1);
|
|
3430
|
-
var
|
|
3517
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3431
3518
|
var sizeStyles6 = {
|
|
3432
3519
|
sm: {
|
|
3433
3520
|
tab: "py-1.5 px-3 text-xs",
|
|
@@ -3515,14 +3602,14 @@ var Tabs = ({
|
|
|
3515
3602
|
className
|
|
3516
3603
|
);
|
|
3517
3604
|
const activeTab = tabs.find((tab) => tab.value === active);
|
|
3518
|
-
return /* @__PURE__ */ (0,
|
|
3519
|
-
/* @__PURE__ */ (0,
|
|
3605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cn("w-full", orientation === "vertical" && "flex gap-6"), children: [
|
|
3606
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: containerClasses, role: "tablist", "aria-orientation": orientation, children: [
|
|
3520
3607
|
tabs.map((tab, index) => {
|
|
3521
3608
|
const isActive = active === tab.value;
|
|
3522
3609
|
const Icon = tab.icon;
|
|
3523
3610
|
const tabId = `${baseId}-tab-${index}`;
|
|
3524
3611
|
const panelId = `${baseId}-panel-${index}`;
|
|
3525
|
-
return /* @__PURE__ */ (0,
|
|
3612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3526
3613
|
"button",
|
|
3527
3614
|
{
|
|
3528
3615
|
ref: (el) => {
|
|
@@ -3574,14 +3661,14 @@ var Tabs = ({
|
|
|
3574
3661
|
}
|
|
3575
3662
|
},
|
|
3576
3663
|
children: [
|
|
3577
|
-
Icon && /* @__PURE__ */ (0,
|
|
3664
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { className: "h-4 w-4" }),
|
|
3578
3665
|
tab.label
|
|
3579
3666
|
]
|
|
3580
3667
|
},
|
|
3581
3668
|
tab.value
|
|
3582
3669
|
);
|
|
3583
3670
|
}),
|
|
3584
|
-
variant === "underline" && orientation === "horizontal" && /* @__PURE__ */ (0,
|
|
3671
|
+
variant === "underline" && orientation === "horizontal" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3585
3672
|
"div",
|
|
3586
3673
|
{
|
|
3587
3674
|
className: "absolute bottom-0 h-0.5 bg-primary transition-all duration-300 ease-out",
|
|
@@ -3589,7 +3676,7 @@ var Tabs = ({
|
|
|
3589
3676
|
}
|
|
3590
3677
|
)
|
|
3591
3678
|
] }),
|
|
3592
|
-
/* @__PURE__ */ (0,
|
|
3679
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3593
3680
|
"div",
|
|
3594
3681
|
{
|
|
3595
3682
|
role: "tabpanel",
|
|
@@ -3607,7 +3694,7 @@ var Tabs = ({
|
|
|
3607
3694
|
] });
|
|
3608
3695
|
};
|
|
3609
3696
|
var SimpleTabs = ({ tabs, defaultValue, className }) => {
|
|
3610
|
-
return /* @__PURE__ */ (0,
|
|
3697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3611
3698
|
Tabs,
|
|
3612
3699
|
{
|
|
3613
3700
|
tabs,
|
|
@@ -3619,7 +3706,7 @@ var SimpleTabs = ({ tabs, defaultValue, className }) => {
|
|
|
3619
3706
|
);
|
|
3620
3707
|
};
|
|
3621
3708
|
var PillTabs = ({ contained = true, ...props }) => {
|
|
3622
|
-
return /* @__PURE__ */ (0,
|
|
3709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3623
3710
|
Tabs,
|
|
3624
3711
|
{
|
|
3625
3712
|
...props,
|
|
@@ -3633,7 +3720,7 @@ var VerticalTabs = ({
|
|
|
3633
3720
|
className,
|
|
3634
3721
|
...props
|
|
3635
3722
|
}) => {
|
|
3636
|
-
return /* @__PURE__ */ (0,
|
|
3723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: cn("flex gap-6", className), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: cn(sidebarWidth, "flex-shrink-0"), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3637
3724
|
Tabs,
|
|
3638
3725
|
{
|
|
3639
3726
|
...props,
|
|
@@ -3645,9 +3732,9 @@ var VerticalTabs = ({
|
|
|
3645
3732
|
};
|
|
3646
3733
|
|
|
3647
3734
|
// ../../components/ui/DropdownMenu.tsx
|
|
3648
|
-
var
|
|
3735
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
3649
3736
|
var import_react_dom5 = require("react-dom");
|
|
3650
|
-
var
|
|
3737
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3651
3738
|
var DropdownMenu = ({
|
|
3652
3739
|
trigger,
|
|
3653
3740
|
children,
|
|
@@ -3660,16 +3747,16 @@ var DropdownMenu = ({
|
|
|
3660
3747
|
onOpenChange,
|
|
3661
3748
|
items
|
|
3662
3749
|
}) => {
|
|
3663
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
3664
|
-
const [position, setPosition] = (0,
|
|
3665
|
-
const triggerRef =
|
|
3666
|
-
const contentRef =
|
|
3667
|
-
const itemsRef =
|
|
3668
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
3750
|
+
const [internalOpen, setInternalOpen] = (0, import_react10.useState)(false);
|
|
3751
|
+
const [position, setPosition] = (0, import_react10.useState)(null);
|
|
3752
|
+
const triggerRef = import_react10.default.useRef(null);
|
|
3753
|
+
const contentRef = import_react10.default.useRef(null);
|
|
3754
|
+
const itemsRef = import_react10.default.useRef([]);
|
|
3755
|
+
const [activeIndex, setActiveIndex] = (0, import_react10.useState)(-1);
|
|
3669
3756
|
useShadCNAnimations();
|
|
3670
3757
|
const open = isOpen !== void 0 ? isOpen : internalOpen;
|
|
3671
3758
|
const setOpen = onOpenChange || setInternalOpen;
|
|
3672
|
-
|
|
3759
|
+
import_react10.default.useEffect(() => {
|
|
3673
3760
|
if (open && triggerRef.current && contentRef.current) {
|
|
3674
3761
|
const rect = triggerRef.current.getBoundingClientRect();
|
|
3675
3762
|
const menuRect = contentRef.current.getBoundingClientRect();
|
|
@@ -3709,7 +3796,7 @@ var DropdownMenu = ({
|
|
|
3709
3796
|
}
|
|
3710
3797
|
if (open) setActiveIndex(-1);
|
|
3711
3798
|
}, [open, placement]);
|
|
3712
|
-
|
|
3799
|
+
import_react10.default.useEffect(() => {
|
|
3713
3800
|
if (!open) return;
|
|
3714
3801
|
const handleClickOutside = (event) => {
|
|
3715
3802
|
const target = event.target;
|
|
@@ -3769,7 +3856,7 @@ var DropdownMenu = ({
|
|
|
3769
3856
|
setOpen(false);
|
|
3770
3857
|
}
|
|
3771
3858
|
};
|
|
3772
|
-
const dropdownContent = open ? /* @__PURE__ */ (0,
|
|
3859
|
+
const dropdownContent = open ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3773
3860
|
"div",
|
|
3774
3861
|
{
|
|
3775
3862
|
"data-dropdown-menu": true,
|
|
@@ -3790,7 +3877,7 @@ var DropdownMenu = ({
|
|
|
3790
3877
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
3791
3878
|
className
|
|
3792
3879
|
),
|
|
3793
|
-
children: /* @__PURE__ */ (0,
|
|
3880
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3794
3881
|
"div",
|
|
3795
3882
|
{
|
|
3796
3883
|
className: cn(
|
|
@@ -3800,7 +3887,7 @@ var DropdownMenu = ({
|
|
|
3800
3887
|
),
|
|
3801
3888
|
children: items ? items.map((item, index) => {
|
|
3802
3889
|
const IconComponent = item.icon;
|
|
3803
|
-
return /* @__PURE__ */ (0,
|
|
3890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3804
3891
|
"button",
|
|
3805
3892
|
{
|
|
3806
3893
|
ref: (el) => {
|
|
@@ -3822,7 +3909,7 @@ var DropdownMenu = ({
|
|
|
3822
3909
|
item.destructive && "text-destructive hover:bg-destructive/10 focus:bg-destructive/10"
|
|
3823
3910
|
),
|
|
3824
3911
|
children: [
|
|
3825
|
-
IconComponent && /* @__PURE__ */ (0,
|
|
3912
|
+
IconComponent && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IconComponent, { className: "h-4 w-4" }),
|
|
3826
3913
|
item.label
|
|
3827
3914
|
]
|
|
3828
3915
|
},
|
|
@@ -3833,8 +3920,8 @@ var DropdownMenu = ({
|
|
|
3833
3920
|
)
|
|
3834
3921
|
}
|
|
3835
3922
|
) : null;
|
|
3836
|
-
return /* @__PURE__ */ (0,
|
|
3837
|
-
|
|
3923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
3924
|
+
import_react10.default.cloneElement(trigger, {
|
|
3838
3925
|
ref: triggerRef,
|
|
3839
3926
|
onClick: handleTriggerClick,
|
|
3840
3927
|
"aria-expanded": open,
|
|
@@ -3849,7 +3936,7 @@ var DropdownMenu = ({
|
|
|
3849
3936
|
dropdownContent && typeof window !== "undefined" && (0, import_react_dom5.createPortal)(dropdownContent, document.body)
|
|
3850
3937
|
] });
|
|
3851
3938
|
};
|
|
3852
|
-
var DropdownMenuItem = ({ children, onClick, disabled, destructive, className }) => /* @__PURE__ */ (0,
|
|
3939
|
+
var DropdownMenuItem = ({ children, onClick, disabled, destructive, className }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3853
3940
|
"button",
|
|
3854
3941
|
{
|
|
3855
3942
|
onClick,
|
|
@@ -3865,22 +3952,22 @@ var DropdownMenuItem = ({ children, onClick, disabled, destructive, className })
|
|
|
3865
3952
|
children
|
|
3866
3953
|
}
|
|
3867
3954
|
);
|
|
3868
|
-
var DropdownMenuSeparator = ({ className }) => /* @__PURE__ */ (0,
|
|
3869
|
-
var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", className }) => /* @__PURE__ */ (0,
|
|
3955
|
+
var DropdownMenuSeparator = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("h-px bg-border my-1", className) });
|
|
3956
|
+
var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", className }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3870
3957
|
DropdownMenu,
|
|
3871
3958
|
{
|
|
3872
|
-
trigger: /* @__PURE__ */ (0,
|
|
3959
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3873
3960
|
"button",
|
|
3874
3961
|
{
|
|
3875
3962
|
className: cn(
|
|
3876
|
-
"inline-flex items-center justify-between gap-2 px-3 py-2 text-sm rounded-md border bg-background",
|
|
3963
|
+
"inline-flex items-center justify-between gap-2 px-3 py-2 text-sm rounded-md border bg-background border-border/60",
|
|
3877
3964
|
"hover:bg-accent/50",
|
|
3878
3965
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
3879
3966
|
className
|
|
3880
3967
|
),
|
|
3881
3968
|
children: [
|
|
3882
|
-
/* @__PURE__ */ (0,
|
|
3883
|
-
/* @__PURE__ */ (0,
|
|
3969
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "truncate max-w-[16rem] text-foreground/90", children: value || placeholder }),
|
|
3970
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", className: "opacity-70", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { d: "M6 8l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
3884
3971
|
]
|
|
3885
3972
|
}
|
|
3886
3973
|
),
|
|
@@ -3898,10 +3985,10 @@ var import_lucide_react13 = require("lucide-react");
|
|
|
3898
3985
|
|
|
3899
3986
|
// ../../components/ui/Combobox.tsx
|
|
3900
3987
|
var React18 = __toESM(require("react"), 1);
|
|
3901
|
-
var
|
|
3988
|
+
var import_react11 = require("react");
|
|
3902
3989
|
var import_react_dom6 = require("react-dom");
|
|
3903
3990
|
var import_lucide_react12 = require("lucide-react");
|
|
3904
|
-
var
|
|
3991
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3905
3992
|
var getOptionLabel = (option) => {
|
|
3906
3993
|
return typeof option === "string" ? option : option.label;
|
|
3907
3994
|
};
|
|
@@ -3934,7 +4021,7 @@ var Combobox = ({
|
|
|
3934
4021
|
useShadCNAnimations();
|
|
3935
4022
|
const listRef = React18.useRef([]);
|
|
3936
4023
|
const inputRef = React18.useRef(null);
|
|
3937
|
-
const autoId = (0,
|
|
4024
|
+
const autoId = (0, import_react11.useId)();
|
|
3938
4025
|
const resolvedId = id ? String(id) : `combobox-${autoId}`;
|
|
3939
4026
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
3940
4027
|
const enableSearch = options.length > 10;
|
|
@@ -4016,7 +4103,7 @@ var Combobox = ({
|
|
|
4016
4103
|
}, [open, enableSearch]);
|
|
4017
4104
|
const selectedOption = findOptionByValue(options, value);
|
|
4018
4105
|
const displayValue = selectedOption ? getOptionLabel(selectedOption) : "";
|
|
4019
|
-
const dropdownContent = /* @__PURE__ */ (0,
|
|
4106
|
+
const dropdownContent = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4020
4107
|
"div",
|
|
4021
4108
|
{
|
|
4022
4109
|
"data-combobox-dropdown": true,
|
|
@@ -4035,10 +4122,10 @@ var Combobox = ({
|
|
|
4035
4122
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
4036
4123
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
4037
4124
|
),
|
|
4038
|
-
children: /* @__PURE__ */ (0,
|
|
4039
|
-
enableSearch && /* @__PURE__ */ (0,
|
|
4040
|
-
/* @__PURE__ */ (0,
|
|
4041
|
-
/* @__PURE__ */ (0,
|
|
4125
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("rounded-md border bg-popover text-popover-foreground shadow-md", "backdrop-blur-sm bg-popover/95 border-border/60"), children: [
|
|
4126
|
+
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative p-3 border-b border-border/50 bg-muted/20", children: [
|
|
4127
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Search, { className: "absolute left-6 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground transition-colors" }),
|
|
4128
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4042
4129
|
"input",
|
|
4043
4130
|
{
|
|
4044
4131
|
ref: inputRef,
|
|
@@ -4077,11 +4164,11 @@ var Combobox = ({
|
|
|
4077
4164
|
}
|
|
4078
4165
|
)
|
|
4079
4166
|
] }),
|
|
4080
|
-
/* @__PURE__ */ (0,
|
|
4167
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "max-h-64 overflow-y-auto overscroll-contain", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ul", { className: "p-1 space-y-1", children: filteredOptions.length > 0 ? filteredOptions.map((item, index) => {
|
|
4081
4168
|
const itemValue = getOptionValue(item);
|
|
4082
4169
|
const itemLabel = getOptionLabel(item);
|
|
4083
4170
|
const isSelected = itemValue === value;
|
|
4084
|
-
return /* @__PURE__ */ (0,
|
|
4171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4085
4172
|
"li",
|
|
4086
4173
|
{
|
|
4087
4174
|
ref: (node) => {
|
|
@@ -4105,15 +4192,15 @@ var Combobox = ({
|
|
|
4105
4192
|
isSelected && "bg-accent text-accent-foreground"
|
|
4106
4193
|
),
|
|
4107
4194
|
children: [
|
|
4108
|
-
/* @__PURE__ */ (0,
|
|
4109
|
-
isSelected && /* @__PURE__ */ (0,
|
|
4195
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate", children: itemLabel }),
|
|
4196
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Check, { className: "h-4 w-4 text-primary" })
|
|
4110
4197
|
]
|
|
4111
4198
|
},
|
|
4112
4199
|
`${itemValue}-${index}`
|
|
4113
4200
|
);
|
|
4114
|
-
}) : /* @__PURE__ */ (0,
|
|
4115
|
-
/* @__PURE__ */ (0,
|
|
4116
|
-
/* @__PURE__ */ (0,
|
|
4201
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { className: "px-3 py-8 text-center text-muted-foreground text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col items-center gap-2", children: [
|
|
4202
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Search, { className: "h-6 w-6 opacity-50" }),
|
|
4203
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: emptyText })
|
|
4117
4204
|
] }) }) }) })
|
|
4118
4205
|
] })
|
|
4119
4206
|
}
|
|
@@ -4127,8 +4214,8 @@ var Combobox = ({
|
|
|
4127
4214
|
const labelSize = size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm";
|
|
4128
4215
|
const radiusClass = size === "sm" ? "rounded-md" : "rounded-lg";
|
|
4129
4216
|
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
4130
|
-
return /* @__PURE__ */ (0,
|
|
4131
|
-
label && /* @__PURE__ */ (0,
|
|
4217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("w-full group", verticalGap), children: [
|
|
4218
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4132
4219
|
"label",
|
|
4133
4220
|
{
|
|
4134
4221
|
id: labelId,
|
|
@@ -4140,11 +4227,11 @@ var Combobox = ({
|
|
|
4140
4227
|
),
|
|
4141
4228
|
children: [
|
|
4142
4229
|
label,
|
|
4143
|
-
required && /* @__PURE__ */ (0,
|
|
4230
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
4144
4231
|
]
|
|
4145
4232
|
}
|
|
4146
4233
|
) }),
|
|
4147
|
-
/* @__PURE__ */ (0,
|
|
4234
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4148
4235
|
"button",
|
|
4149
4236
|
{
|
|
4150
4237
|
ref: triggerRef,
|
|
@@ -4174,10 +4261,10 @@ var Combobox = ({
|
|
|
4174
4261
|
className
|
|
4175
4262
|
),
|
|
4176
4263
|
children: [
|
|
4177
|
-
/* @__PURE__ */ (0,
|
|
4178
|
-
/* @__PURE__ */ (0,
|
|
4264
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: cn("truncate", !displayValue && "text-muted-foreground", fontBold && "font-bold"), children: displayValue || placeholder }),
|
|
4265
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-1 ml-2", children: [
|
|
4179
4266
|
allowClear && value && !disabled && // FIX: Use a div instead of a nested button
|
|
4180
|
-
/* @__PURE__ */ (0,
|
|
4267
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4181
4268
|
"div",
|
|
4182
4269
|
{
|
|
4183
4270
|
role: "button",
|
|
@@ -4186,10 +4273,10 @@ var Combobox = ({
|
|
|
4186
4273
|
onClick: handleClear,
|
|
4187
4274
|
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && handleClear(e),
|
|
4188
4275
|
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",
|
|
4189
|
-
children: /* @__PURE__ */ (0,
|
|
4276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.X, { className: "h-3 w-3" })
|
|
4190
4277
|
}
|
|
4191
4278
|
),
|
|
4192
|
-
/* @__PURE__ */ (0,
|
|
4279
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.ChevronDown, { className: cn("h-4 w-4 text-muted-foreground transition-transform duration-200", open && "rotate-180") })
|
|
4193
4280
|
] })
|
|
4194
4281
|
]
|
|
4195
4282
|
}
|
|
@@ -4200,7 +4287,7 @@ var Combobox = ({
|
|
|
4200
4287
|
|
|
4201
4288
|
// ../../components/ui/Pagination.tsx
|
|
4202
4289
|
var import_next_intl4 = require("next-intl");
|
|
4203
|
-
var
|
|
4290
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4204
4291
|
var Pagination = ({
|
|
4205
4292
|
page,
|
|
4206
4293
|
totalPages,
|
|
@@ -4283,13 +4370,13 @@ var Pagination = ({
|
|
|
4283
4370
|
}
|
|
4284
4371
|
};
|
|
4285
4372
|
if (totalPages <= 1) return null;
|
|
4286
|
-
return /* @__PURE__ */ (0,
|
|
4287
|
-
showInfo && totalItems && /* @__PURE__ */ (0,
|
|
4288
|
-
/* @__PURE__ */ (0,
|
|
4373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("nav", { className: cn("flex flex-col gap-4", className), "aria-label": labels?.navigationLabel || t("navigationLabel"), children: [
|
|
4374
|
+
showInfo && totalItems && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: cn("text-sm text-muted-foreground", textAlignmentClass), children: labels?.showingResults ? labels.showingResults({ startItem: startItem || 0, endItem: endItem || 0, totalItems }) : t("showingResults", { startItem: startItem || 0, endItem: endItem || 0, totalItems }) }),
|
|
4375
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cn("flex items-center justify-between", {
|
|
4289
4376
|
"flex-row-reverse": alignment === "right" || alignment === "center"
|
|
4290
4377
|
}), children: [
|
|
4291
|
-
/* @__PURE__ */ (0,
|
|
4292
|
-
showFirstLast && /* @__PURE__ */ (0,
|
|
4378
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cn("flex items-center gap-1"), children: [
|
|
4379
|
+
showFirstLast && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4293
4380
|
Button_default,
|
|
4294
4381
|
{
|
|
4295
4382
|
variant: getButtonVariant(false),
|
|
@@ -4303,7 +4390,7 @@ var Pagination = ({
|
|
|
4303
4390
|
"aria-disabled": disabled || page === 1
|
|
4304
4391
|
}
|
|
4305
4392
|
),
|
|
4306
|
-
showPrevNext && /* @__PURE__ */ (0,
|
|
4393
|
+
showPrevNext && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4307
4394
|
Button_default,
|
|
4308
4395
|
{
|
|
4309
4396
|
variant: getButtonVariant(false),
|
|
@@ -4314,16 +4401,16 @@ var Pagination = ({
|
|
|
4314
4401
|
title: labels?.previousPage || t("previousPage"),
|
|
4315
4402
|
"aria-label": labels?.previousPage || t("previousPage"),
|
|
4316
4403
|
"aria-disabled": disabled || page === 1,
|
|
4317
|
-
children: /* @__PURE__ */ (0,
|
|
4404
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "hidden sm:inline", children: labels?.previous || t("previous") })
|
|
4318
4405
|
}
|
|
4319
4406
|
),
|
|
4320
4407
|
showPageNumbers && createPageArray().map((p, i) => {
|
|
4321
4408
|
if (p === "...") {
|
|
4322
|
-
return /* @__PURE__ */ (0,
|
|
4409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button_default, { variant: "ghost", size, disabled: true, icon: import_lucide_react13.MoreHorizontal, className: "cursor-default" }, i);
|
|
4323
4410
|
}
|
|
4324
4411
|
const pageNumber = p;
|
|
4325
4412
|
const isActive = page === pageNumber;
|
|
4326
|
-
return /* @__PURE__ */ (0,
|
|
4413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4327
4414
|
Button_default,
|
|
4328
4415
|
{
|
|
4329
4416
|
variant: getButtonVariant(isActive),
|
|
@@ -4338,7 +4425,7 @@ var Pagination = ({
|
|
|
4338
4425
|
i
|
|
4339
4426
|
);
|
|
4340
4427
|
}),
|
|
4341
|
-
showPrevNext && /* @__PURE__ */ (0,
|
|
4428
|
+
showPrevNext && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4342
4429
|
Button_default,
|
|
4343
4430
|
{
|
|
4344
4431
|
variant: getButtonVariant(false),
|
|
@@ -4349,10 +4436,10 @@ var Pagination = ({
|
|
|
4349
4436
|
title: labels?.nextPage || t("nextPage"),
|
|
4350
4437
|
"aria-label": labels?.nextPage || t("nextPage"),
|
|
4351
4438
|
"aria-disabled": disabled || page === totalPages,
|
|
4352
|
-
children: /* @__PURE__ */ (0,
|
|
4439
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "hidden sm:inline", children: labels?.next || t("next") })
|
|
4353
4440
|
}
|
|
4354
4441
|
),
|
|
4355
|
-
showFirstLast && /* @__PURE__ */ (0,
|
|
4442
|
+
showFirstLast && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4356
4443
|
Button_default,
|
|
4357
4444
|
{
|
|
4358
4445
|
variant: getButtonVariant(false),
|
|
@@ -4367,12 +4454,12 @@ var Pagination = ({
|
|
|
4367
4454
|
}
|
|
4368
4455
|
)
|
|
4369
4456
|
] }),
|
|
4370
|
-
pageSizeOptions && onPageSizeChange && /* @__PURE__ */ (0,
|
|
4371
|
-
/* @__PURE__ */ (0,
|
|
4457
|
+
pageSizeOptions && onPageSizeChange && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cn("flex items-center gap-2 text-sm"), children: [
|
|
4458
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "text-muted-foreground", children: [
|
|
4372
4459
|
labels?.itemsPerPage || t("itemsPerPage"),
|
|
4373
4460
|
":"
|
|
4374
4461
|
] }),
|
|
4375
|
-
/* @__PURE__ */ (0,
|
|
4462
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "w-20", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4376
4463
|
Combobox,
|
|
4377
4464
|
{
|
|
4378
4465
|
options: pageSizeOptionsStrings,
|
|
@@ -4401,8 +4488,8 @@ var SimplePagination = ({
|
|
|
4401
4488
|
pageSize = 10
|
|
4402
4489
|
}) => {
|
|
4403
4490
|
if (totalPages <= 1) return null;
|
|
4404
|
-
return /* @__PURE__ */ (0,
|
|
4405
|
-
showInfo && totalItems && /* @__PURE__ */ (0,
|
|
4491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
4492
|
+
showInfo && totalItems && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "text-sm text-muted-foreground text-center", children: [
|
|
4406
4493
|
"Page ",
|
|
4407
4494
|
page,
|
|
4408
4495
|
" of ",
|
|
@@ -4411,15 +4498,15 @@ var SimplePagination = ({
|
|
|
4411
4498
|
totalItems,
|
|
4412
4499
|
" total items)"
|
|
4413
4500
|
] }),
|
|
4414
|
-
/* @__PURE__ */ (0,
|
|
4415
|
-
/* @__PURE__ */ (0,
|
|
4416
|
-
/* @__PURE__ */ (0,
|
|
4417
|
-
/* @__PURE__ */ (0,
|
|
4418
|
-
/* @__PURE__ */ (0,
|
|
4419
|
-
/* @__PURE__ */ (0,
|
|
4420
|
-
/* @__PURE__ */ (0,
|
|
4501
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
4502
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button_default, { variant, size, icon: import_lucide_react13.ChevronLeft, onClick: () => onChange(Math.max(1, page - 1)), disabled: disabled || page === 1, children: "Previous" }),
|
|
4503
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
4504
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: "Page" }),
|
|
4505
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "font-medium text-foreground", children: page }),
|
|
4506
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: "of" }),
|
|
4507
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "font-medium text-foreground", children: totalPages })
|
|
4421
4508
|
] }),
|
|
4422
|
-
/* @__PURE__ */ (0,
|
|
4509
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4423
4510
|
Button_default,
|
|
4424
4511
|
{
|
|
4425
4512
|
variant,
|
|
@@ -4442,8 +4529,8 @@ var CompactPagination = ({
|
|
|
4442
4529
|
disabled = false
|
|
4443
4530
|
}) => {
|
|
4444
4531
|
if (totalPages <= 1) return null;
|
|
4445
|
-
return /* @__PURE__ */ (0,
|
|
4446
|
-
/* @__PURE__ */ (0,
|
|
4532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("nav", { className: cn("flex items-center gap-1", className), "aria-label": "Compact Pagination", children: [
|
|
4533
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4447
4534
|
Button_default,
|
|
4448
4535
|
{
|
|
4449
4536
|
variant,
|
|
@@ -4455,7 +4542,7 @@ var CompactPagination = ({
|
|
|
4455
4542
|
"aria-label": "First page"
|
|
4456
4543
|
}
|
|
4457
4544
|
),
|
|
4458
|
-
/* @__PURE__ */ (0,
|
|
4545
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4459
4546
|
Button_default,
|
|
4460
4547
|
{
|
|
4461
4548
|
variant,
|
|
@@ -4466,12 +4553,12 @@ var CompactPagination = ({
|
|
|
4466
4553
|
title: "Previous page"
|
|
4467
4554
|
}
|
|
4468
4555
|
),
|
|
4469
|
-
/* @__PURE__ */ (0,
|
|
4556
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "px-2 py-1 text-sm text-muted-foreground min-w-[4rem] text-center", children: [
|
|
4470
4557
|
page,
|
|
4471
4558
|
" / ",
|
|
4472
4559
|
totalPages
|
|
4473
4560
|
] }),
|
|
4474
|
-
/* @__PURE__ */ (0,
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4475
4562
|
Button_default,
|
|
4476
4563
|
{
|
|
4477
4564
|
variant,
|
|
@@ -4482,7 +4569,7 @@ var CompactPagination = ({
|
|
|
4482
4569
|
title: "Next page"
|
|
4483
4570
|
}
|
|
4484
4571
|
),
|
|
4485
|
-
/* @__PURE__ */ (0,
|
|
4572
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4486
4573
|
Button_default,
|
|
4487
4574
|
{
|
|
4488
4575
|
variant,
|
|
@@ -4497,15 +4584,16 @@ var CompactPagination = ({
|
|
|
4497
4584
|
};
|
|
4498
4585
|
|
|
4499
4586
|
// ../../components/ui/Section.tsx
|
|
4500
|
-
var
|
|
4501
|
-
var
|
|
4502
|
-
var Section =
|
|
4587
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
4588
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4589
|
+
var Section = import_react12.default.forwardRef(
|
|
4503
4590
|
({
|
|
4504
4591
|
children,
|
|
4505
4592
|
className,
|
|
4506
4593
|
variant = "default",
|
|
4507
4594
|
spacing = "lg",
|
|
4508
4595
|
fullWidth = false,
|
|
4596
|
+
outlined = false,
|
|
4509
4597
|
...props
|
|
4510
4598
|
}, ref) => {
|
|
4511
4599
|
const variantClasses = {
|
|
@@ -4520,13 +4608,14 @@ var Section = import_react11.default.forwardRef(
|
|
|
4520
4608
|
lg: "py-12",
|
|
4521
4609
|
xl: "py-16"
|
|
4522
4610
|
};
|
|
4523
|
-
return /* @__PURE__ */ (0,
|
|
4611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4524
4612
|
"section",
|
|
4525
4613
|
{
|
|
4526
4614
|
ref,
|
|
4527
4615
|
className: cn(
|
|
4528
4616
|
variantClasses[variant],
|
|
4529
4617
|
spacingClasses[spacing],
|
|
4618
|
+
outlined && "rounded-lg border border-border/60",
|
|
4530
4619
|
!fullWidth && "container mx-auto px-4 md:px-6",
|
|
4531
4620
|
className
|
|
4532
4621
|
),
|
|
@@ -4540,16 +4629,16 @@ Section.displayName = "Section";
|
|
|
4540
4629
|
var Section_default = Section;
|
|
4541
4630
|
|
|
4542
4631
|
// ../../components/ui/ScrollArea.tsx
|
|
4543
|
-
var
|
|
4544
|
-
var
|
|
4545
|
-
var ScrollArea = (0,
|
|
4546
|
-
return /* @__PURE__ */ (0,
|
|
4632
|
+
var import_react13 = require("react");
|
|
4633
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4634
|
+
var ScrollArea = (0, import_react13.forwardRef)(({ className, children, ...props }, ref) => {
|
|
4635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, className: cn("relative overflow-hidden bg-background", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cn("h-full w-full overflow-y-auto scroll-area-viewport"), children }) });
|
|
4547
4636
|
});
|
|
4548
4637
|
ScrollArea.displayName = "ScrollArea";
|
|
4549
4638
|
|
|
4550
4639
|
// ../../components/ui/DatePicker.tsx
|
|
4551
4640
|
var React21 = __toESM(require("react"), 1);
|
|
4552
|
-
var
|
|
4641
|
+
var import_react14 = require("react");
|
|
4553
4642
|
var import_react_dom7 = require("react-dom");
|
|
4554
4643
|
var import_lucide_react14 = require("lucide-react");
|
|
4555
4644
|
var import_next_intl5 = require("next-intl");
|
|
@@ -4734,7 +4823,7 @@ function formatDateWithDay(date) {
|
|
|
4734
4823
|
}
|
|
4735
4824
|
|
|
4736
4825
|
// ../../components/ui/DatePicker.tsx
|
|
4737
|
-
var
|
|
4826
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4738
4827
|
var DatePicker = ({
|
|
4739
4828
|
id,
|
|
4740
4829
|
value,
|
|
@@ -4845,7 +4934,7 @@ var DatePicker = ({
|
|
|
4845
4934
|
const firstDayOfMonth = getFirstDayOfMonth(viewDate);
|
|
4846
4935
|
const days = [];
|
|
4847
4936
|
for (let i = 0; i < firstDayOfMonth; i++) {
|
|
4848
|
-
days.push(/* @__PURE__ */ (0,
|
|
4937
|
+
days.push(/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-8 h-8" }, `empty-${i}`));
|
|
4849
4938
|
}
|
|
4850
4939
|
for (let day = 1; day <= daysInMonth; day++) {
|
|
4851
4940
|
const date = new Date(viewDate.getFullYear(), viewDate.getMonth(), day);
|
|
@@ -4854,7 +4943,7 @@ var DatePicker = ({
|
|
|
4854
4943
|
const totalDaysFromStart = firstDayOfMonth + day - 1;
|
|
4855
4944
|
const rowIndex = Math.floor(totalDaysFromStart / 7);
|
|
4856
4945
|
days.push(
|
|
4857
|
-
/* @__PURE__ */ (0,
|
|
4946
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4858
4947
|
"button",
|
|
4859
4948
|
{
|
|
4860
4949
|
onClick: () => handleDateSelect(date),
|
|
@@ -4877,7 +4966,7 @@ var DatePicker = ({
|
|
|
4877
4966
|
}
|
|
4878
4967
|
return days;
|
|
4879
4968
|
};
|
|
4880
|
-
const datePickerContent = isOpen && dropdownPosition ? /* @__PURE__ */ (0,
|
|
4969
|
+
const datePickerContent = isOpen && dropdownPosition ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4881
4970
|
"div",
|
|
4882
4971
|
{
|
|
4883
4972
|
"data-datepicker": true,
|
|
@@ -4895,7 +4984,7 @@ var DatePicker = ({
|
|
|
4895
4984
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
4896
4985
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
4897
4986
|
),
|
|
4898
|
-
children: /* @__PURE__ */ (0,
|
|
4987
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
4899
4988
|
"div",
|
|
4900
4989
|
{
|
|
4901
4990
|
ref: dropdownRef,
|
|
@@ -4906,14 +4995,14 @@ var DatePicker = ({
|
|
|
4906
4995
|
),
|
|
4907
4996
|
style: { pointerEvents: "auto" },
|
|
4908
4997
|
children: [
|
|
4909
|
-
/* @__PURE__ */ (0,
|
|
4910
|
-
/* @__PURE__ */ (0,
|
|
4911
|
-
/* @__PURE__ */ (0,
|
|
4912
|
-
/* @__PURE__ */ (0,
|
|
4998
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4999
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("prev"), className: "p-1 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ChevronLeft, { className: "h-4 w-4" }) }),
|
|
5000
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
5001
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("next"), className: "p-1 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ChevronRight, { className: "h-4 w-4" }) })
|
|
4913
5002
|
] }),
|
|
4914
|
-
/* @__PURE__ */ (0,
|
|
4915
|
-
/* @__PURE__ */ (0,
|
|
4916
|
-
/* @__PURE__ */ (0,
|
|
5003
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.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_runtime28.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)) }),
|
|
5004
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7 gap-1", children: renderCalendar() }),
|
|
5005
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-end mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4917
5006
|
Button_default,
|
|
4918
5007
|
{
|
|
4919
5008
|
variant: "outline",
|
|
@@ -4931,14 +5020,14 @@ var DatePicker = ({
|
|
|
4931
5020
|
)
|
|
4932
5021
|
}
|
|
4933
5022
|
) : null;
|
|
4934
|
-
const autoId = (0,
|
|
5023
|
+
const autoId = (0, import_react14.useId)();
|
|
4935
5024
|
const resolvedId = id ? String(id) : `datepicker-${autoId}`;
|
|
4936
5025
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
4937
5026
|
const labelSize = size === "sm" ? "text-xs" : "text-sm";
|
|
4938
5027
|
const radiusClass = size === "sm" ? "rounded-md" : "rounded-lg";
|
|
4939
5028
|
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
4940
|
-
return /* @__PURE__ */ (0,
|
|
4941
|
-
label && /* @__PURE__ */ (0,
|
|
5029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: cn("w-full group", verticalGap), children: [
|
|
5030
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
4942
5031
|
"label",
|
|
4943
5032
|
{
|
|
4944
5033
|
id: labelId,
|
|
@@ -4950,11 +5039,11 @@ var DatePicker = ({
|
|
|
4950
5039
|
),
|
|
4951
5040
|
children: [
|
|
4952
5041
|
label,
|
|
4953
|
-
required && /* @__PURE__ */ (0,
|
|
5042
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
4954
5043
|
]
|
|
4955
5044
|
}
|
|
4956
5045
|
) }),
|
|
4957
|
-
/* @__PURE__ */ (0,
|
|
5046
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
4958
5047
|
"button",
|
|
4959
5048
|
{
|
|
4960
5049
|
ref: triggerRef,
|
|
@@ -4982,8 +5071,8 @@ var DatePicker = ({
|
|
|
4982
5071
|
className
|
|
4983
5072
|
),
|
|
4984
5073
|
children: [
|
|
4985
|
-
/* @__PURE__ */ (0,
|
|
4986
|
-
value && /* @__PURE__ */ (0,
|
|
5074
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: cn("truncate", !value && "text-muted-foreground"), children: value ? formatDateDisplay(value) : placeholder || t("placeholder") }),
|
|
5075
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4987
5076
|
"span",
|
|
4988
5077
|
{
|
|
4989
5078
|
role: "button",
|
|
@@ -5005,10 +5094,10 @@ var DatePicker = ({
|
|
|
5005
5094
|
},
|
|
5006
5095
|
className: "absolute right-8 inline-flex items-center justify-center rounded-sm text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors cursor-pointer",
|
|
5007
5096
|
style: { width: 20, height: 20 },
|
|
5008
|
-
children: /* @__PURE__ */ (0,
|
|
5097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.X, { className: "h-3.5 w-3.5" })
|
|
5009
5098
|
}
|
|
5010
5099
|
),
|
|
5011
|
-
/* @__PURE__ */ (0,
|
|
5100
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.Calendar, { className: "h-4 w-4 text-muted-foreground ml-2" })
|
|
5012
5101
|
]
|
|
5013
5102
|
}
|
|
5014
5103
|
),
|
|
@@ -5093,7 +5182,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5093
5182
|
const nodes = [];
|
|
5094
5183
|
const daysInMonth = getDaysInMonth(viewDate);
|
|
5095
5184
|
const firstDay = getFirstDayOfMonth(viewDate);
|
|
5096
|
-
for (let i = 0; i < firstDay; i++) nodes.push(/* @__PURE__ */ (0,
|
|
5185
|
+
for (let i = 0; i < firstDay; i++) nodes.push(/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-8 h-8" }, `e-${i}`));
|
|
5097
5186
|
for (let d = 1; d <= daysInMonth; d++) {
|
|
5098
5187
|
const date = new Date(viewDate.getFullYear(), viewDate.getMonth(), d);
|
|
5099
5188
|
const isSelectedStart = isSameDay(date, tempStart);
|
|
@@ -5118,7 +5207,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5118
5207
|
}
|
|
5119
5208
|
}
|
|
5120
5209
|
nodes.push(
|
|
5121
|
-
/* @__PURE__ */ (0,
|
|
5210
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5122
5211
|
"button",
|
|
5123
5212
|
{
|
|
5124
5213
|
onClick: () => handleSelect(date),
|
|
@@ -5148,7 +5237,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5148
5237
|
}
|
|
5149
5238
|
return nodes;
|
|
5150
5239
|
};
|
|
5151
|
-
const panel = isOpen && dropdownPosition ? /* @__PURE__ */ (0,
|
|
5240
|
+
const panel = isOpen && dropdownPosition ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5152
5241
|
"div",
|
|
5153
5242
|
{
|
|
5154
5243
|
style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width || 256, zIndex: 9999 },
|
|
@@ -5158,37 +5247,37 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5158
5247
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
5159
5248
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
5160
5249
|
),
|
|
5161
|
-
children: /* @__PURE__ */ (0,
|
|
5250
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5162
5251
|
"div",
|
|
5163
5252
|
{
|
|
5164
5253
|
ref: panelRef,
|
|
5165
5254
|
className: cn("rounded-md border bg-popover text-popover-foreground shadow-md", "backdrop-blur-sm bg-popover/95 border-border/60 p-4 w-64"),
|
|
5166
5255
|
children: [
|
|
5167
|
-
/* @__PURE__ */ (0,
|
|
5168
|
-
/* @__PURE__ */ (0,
|
|
5256
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [
|
|
5257
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5169
5258
|
Button_default,
|
|
5170
5259
|
{
|
|
5171
5260
|
variant: "ghost",
|
|
5172
5261
|
size: "sm",
|
|
5173
5262
|
onClick: () => setViewDate(new Date(viewDate.getFullYear(), viewDate.getMonth() - 1, 1)),
|
|
5174
5263
|
className: "p-1 h-auto",
|
|
5175
|
-
children: /* @__PURE__ */ (0,
|
|
5264
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ChevronLeft, { className: "h-4 w-4" })
|
|
5176
5265
|
}
|
|
5177
5266
|
),
|
|
5178
|
-
/* @__PURE__ */ (0,
|
|
5179
|
-
/* @__PURE__ */ (0,
|
|
5267
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
5268
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5180
5269
|
Button_default,
|
|
5181
5270
|
{
|
|
5182
5271
|
variant: "ghost",
|
|
5183
5272
|
size: "sm",
|
|
5184
5273
|
onClick: () => setViewDate(new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 1)),
|
|
5185
5274
|
className: "p-1 h-auto",
|
|
5186
|
-
children: /* @__PURE__ */ (0,
|
|
5275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ChevronRight, { className: "h-4 w-4" })
|
|
5187
5276
|
}
|
|
5188
5277
|
)
|
|
5189
5278
|
] }),
|
|
5190
|
-
/* @__PURE__ */ (0,
|
|
5191
|
-
/* @__PURE__ */ (0,
|
|
5279
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((d) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-xs text-muted-foreground text-center py-1 font-medium", children: d }, d)) }),
|
|
5280
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7", children: renderGrid() })
|
|
5192
5281
|
]
|
|
5193
5282
|
}
|
|
5194
5283
|
)
|
|
@@ -5196,8 +5285,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5196
5285
|
) : null;
|
|
5197
5286
|
const displayFormat = (date) => formatDateShort(date);
|
|
5198
5287
|
const label = tempStart && tempEnd ? `${displayFormat(tempStart)} - ${displayFormat(tempEnd)}` : tempStart ? `${displayFormat(tempStart)} - ...` : placeholder;
|
|
5199
|
-
return /* @__PURE__ */ (0,
|
|
5200
|
-
/* @__PURE__ */ (0,
|
|
5288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
5289
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5201
5290
|
"button",
|
|
5202
5291
|
{
|
|
5203
5292
|
ref: triggerRef,
|
|
@@ -5216,8 +5305,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5216
5305
|
className
|
|
5217
5306
|
),
|
|
5218
5307
|
children: [
|
|
5219
|
-
/* @__PURE__ */ (0,
|
|
5220
|
-
/* @__PURE__ */ (0,
|
|
5308
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: cn("truncate", !tempStart && !tempEnd && "text-muted-foreground"), children: label }),
|
|
5309
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.Calendar, { className: "h-4 w-4 text-muted-foreground ml-2" })
|
|
5221
5310
|
]
|
|
5222
5311
|
}
|
|
5223
5312
|
),
|
|
@@ -5227,10 +5316,10 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5227
5316
|
|
|
5228
5317
|
// ../../components/ui/MultiCombobox.tsx
|
|
5229
5318
|
var React22 = __toESM(require("react"), 1);
|
|
5230
|
-
var
|
|
5319
|
+
var import_react15 = require("react");
|
|
5231
5320
|
var import_react_dom8 = require("react-dom");
|
|
5232
5321
|
var import_lucide_react15 = require("lucide-react");
|
|
5233
|
-
var
|
|
5322
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5234
5323
|
var MultiCombobox = ({
|
|
5235
5324
|
id,
|
|
5236
5325
|
options,
|
|
@@ -5368,12 +5457,12 @@ var MultiCombobox = ({
|
|
|
5368
5457
|
tag: "px-2.5 py-1 text-sm"
|
|
5369
5458
|
}
|
|
5370
5459
|
};
|
|
5371
|
-
const autoId = (0,
|
|
5460
|
+
const autoId = (0, import_react15.useId)();
|
|
5372
5461
|
const resolvedId = id ? String(id) : `multicombobox-${autoId}`;
|
|
5373
5462
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
5374
5463
|
const labelSize = size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm";
|
|
5375
|
-
return /* @__PURE__ */ (0,
|
|
5376
|
-
title && /* @__PURE__ */ (0,
|
|
5464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("w-full space-y-2 group", className), children: [
|
|
5465
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5377
5466
|
"label",
|
|
5378
5467
|
{
|
|
5379
5468
|
className: cn(
|
|
@@ -5383,11 +5472,11 @@ var MultiCombobox = ({
|
|
|
5383
5472
|
),
|
|
5384
5473
|
children: [
|
|
5385
5474
|
title,
|
|
5386
|
-
required && /* @__PURE__ */ (0,
|
|
5475
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
5387
5476
|
]
|
|
5388
5477
|
}
|
|
5389
5478
|
) }),
|
|
5390
|
-
label && /* @__PURE__ */ (0,
|
|
5479
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5391
5480
|
"label",
|
|
5392
5481
|
{
|
|
5393
5482
|
id: labelId,
|
|
@@ -5399,12 +5488,12 @@ var MultiCombobox = ({
|
|
|
5399
5488
|
),
|
|
5400
5489
|
children: [
|
|
5401
5490
|
label,
|
|
5402
|
-
required && /* @__PURE__ */ (0,
|
|
5491
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
5403
5492
|
]
|
|
5404
5493
|
}
|
|
5405
5494
|
),
|
|
5406
|
-
/* @__PURE__ */ (0,
|
|
5407
|
-
/* @__PURE__ */ (0,
|
|
5495
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "relative w-full" }),
|
|
5496
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5408
5497
|
"button",
|
|
5409
5498
|
{
|
|
5410
5499
|
ref: triggerRef,
|
|
@@ -5427,11 +5516,11 @@ var MultiCombobox = ({
|
|
|
5427
5516
|
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
5428
5517
|
),
|
|
5429
5518
|
children: [
|
|
5430
|
-
/* @__PURE__ */ (0,
|
|
5519
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex items-center gap-1 flex-wrap min-h-[1.5rem] flex-1", children: value.length > 0 ? showTags ? value.map((itemValue) => {
|
|
5431
5520
|
const option = normalizedOptions.find((o) => o.value === itemValue);
|
|
5432
|
-
return /* @__PURE__ */ (0,
|
|
5433
|
-
/* @__PURE__ */ (0,
|
|
5434
|
-
/* @__PURE__ */ (0,
|
|
5521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "inline-flex items-center gap-1 bg-accent text-accent-foreground rounded px-2 py-1 text-xs", children: [
|
|
5522
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "truncate max-w-[120px]", children: option ? displayFormat(option) : itemValue }),
|
|
5523
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5435
5524
|
"span",
|
|
5436
5525
|
{
|
|
5437
5526
|
role: "button",
|
|
@@ -5454,16 +5543,16 @@ var MultiCombobox = ({
|
|
|
5454
5543
|
}
|
|
5455
5544
|
)
|
|
5456
5545
|
] }, itemValue);
|
|
5457
|
-
}) : /* @__PURE__ */ (0,
|
|
5546
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "truncate text-sm", children: [
|
|
5458
5547
|
value.length,
|
|
5459
5548
|
" selected"
|
|
5460
|
-
] }) : /* @__PURE__ */ (0,
|
|
5461
|
-
/* @__PURE__ */ (0,
|
|
5549
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-muted-foreground", children: placeholder || "Select..." }) }),
|
|
5550
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ChevronDown, { className: cn("opacity-50 transition-transform", sizeStyles8[size].icon, open && "rotate-180") })
|
|
5462
5551
|
]
|
|
5463
5552
|
}
|
|
5464
5553
|
),
|
|
5465
5554
|
open && dropdownPosition && typeof window !== "undefined" ? (0, import_react_dom8.createPortal)(
|
|
5466
|
-
/* @__PURE__ */ (0,
|
|
5555
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5467
5556
|
"div",
|
|
5468
5557
|
{
|
|
5469
5558
|
"data-dropdown": "multicombobox",
|
|
@@ -5480,7 +5569,7 @@ var MultiCombobox = ({
|
|
|
5480
5569
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
5481
5570
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
5482
5571
|
),
|
|
5483
|
-
children: /* @__PURE__ */ (0,
|
|
5572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5484
5573
|
"div",
|
|
5485
5574
|
{
|
|
5486
5575
|
className: cn(
|
|
@@ -5488,7 +5577,7 @@ var MultiCombobox = ({
|
|
|
5488
5577
|
"backdrop-blur-sm bg-popover/95 border-border/60"
|
|
5489
5578
|
),
|
|
5490
5579
|
children: [
|
|
5491
|
-
showClear && value.length > 0 && /* @__PURE__ */ (0,
|
|
5580
|
+
showClear && value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "px-3 py-2 border-b border-border/60 flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5492
5581
|
"button",
|
|
5493
5582
|
{
|
|
5494
5583
|
type: "button",
|
|
@@ -5501,9 +5590,9 @@ var MultiCombobox = ({
|
|
|
5501
5590
|
children: "Clear all"
|
|
5502
5591
|
}
|
|
5503
5592
|
) }),
|
|
5504
|
-
enableSearch && /* @__PURE__ */ (0,
|
|
5505
|
-
/* @__PURE__ */ (0,
|
|
5506
|
-
/* @__PURE__ */ (0,
|
|
5593
|
+
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "relative border-b border-border/60", children: [
|
|
5594
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.Search, { className: cn("absolute left-2 top-2.5 text-muted-foreground", sizeStyles8[size].icon) }),
|
|
5595
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5507
5596
|
"input",
|
|
5508
5597
|
{
|
|
5509
5598
|
ref: inputRef,
|
|
@@ -5518,10 +5607,10 @@ var MultiCombobox = ({
|
|
|
5518
5607
|
}
|
|
5519
5608
|
)
|
|
5520
5609
|
] }),
|
|
5521
|
-
/* @__PURE__ */ (0,
|
|
5610
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("ul", { className: cn("max-h-60 overflow-y-auto p-1", size === "lg" ? "text-base" : size === "sm" ? "text-xs" : "text-sm"), children: filtered.length ? filtered.map((item, index) => {
|
|
5522
5611
|
const isSelected = value.includes(item.value);
|
|
5523
5612
|
const isDisabled = disabledOptions.includes(item.value);
|
|
5524
|
-
return /* @__PURE__ */ (0,
|
|
5613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5525
5614
|
"li",
|
|
5526
5615
|
{
|
|
5527
5616
|
ref: (node) => {
|
|
@@ -5545,12 +5634,12 @@ var MultiCombobox = ({
|
|
|
5545
5634
|
),
|
|
5546
5635
|
children: [
|
|
5547
5636
|
item.label,
|
|
5548
|
-
isSelected && /* @__PURE__ */ (0,
|
|
5637
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.Check, { className: sizeStyles8[size].icon })
|
|
5549
5638
|
]
|
|
5550
5639
|
},
|
|
5551
5640
|
item.value
|
|
5552
5641
|
);
|
|
5553
|
-
}) : /* @__PURE__ */ (0,
|
|
5642
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("li", { className: cn("px-3 py-2 text-muted-foreground", size === "lg" ? "text-base" : size === "sm" ? "text-xs" : "text-sm"), children: "No result." }) })
|
|
5554
5643
|
]
|
|
5555
5644
|
}
|
|
5556
5645
|
)
|
|
@@ -5563,7 +5652,7 @@ var MultiCombobox = ({
|
|
|
5563
5652
|
|
|
5564
5653
|
// ../../components/ui/RadioGroup.tsx
|
|
5565
5654
|
var React23 = __toESM(require("react"), 1);
|
|
5566
|
-
var
|
|
5655
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5567
5656
|
var RadioGroupContext = React23.createContext(void 0);
|
|
5568
5657
|
var useRadioGroup = () => {
|
|
5569
5658
|
const context = React23.useContext(RadioGroupContext);
|
|
@@ -5601,7 +5690,7 @@ var RadioGroup = React23.forwardRef(
|
|
|
5601
5690
|
};
|
|
5602
5691
|
const uniqueId = React23.useId();
|
|
5603
5692
|
const radioName = name || `radio-group-${uniqueId}`;
|
|
5604
|
-
return /* @__PURE__ */ (0,
|
|
5693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5605
5694
|
RadioGroupContext.Provider,
|
|
5606
5695
|
{
|
|
5607
5696
|
value: {
|
|
@@ -5612,8 +5701,8 @@ var RadioGroup = React23.forwardRef(
|
|
|
5612
5701
|
size,
|
|
5613
5702
|
variant
|
|
5614
5703
|
},
|
|
5615
|
-
children: /* @__PURE__ */ (0,
|
|
5616
|
-
/* @__PURE__ */ (0,
|
|
5704
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-2", children: [
|
|
5705
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5617
5706
|
"div",
|
|
5618
5707
|
{
|
|
5619
5708
|
ref,
|
|
@@ -5630,7 +5719,7 @@ var RadioGroup = React23.forwardRef(
|
|
|
5630
5719
|
children
|
|
5631
5720
|
}
|
|
5632
5721
|
),
|
|
5633
|
-
error && errorMessage && /* @__PURE__ */ (0,
|
|
5722
|
+
error && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-sm text-destructive mt-1", children: errorMessage })
|
|
5634
5723
|
] })
|
|
5635
5724
|
}
|
|
5636
5725
|
);
|
|
@@ -5672,7 +5761,7 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5672
5761
|
const Icon = icon;
|
|
5673
5762
|
const radioId = id || `radio-${value}`;
|
|
5674
5763
|
if (variant === "card") {
|
|
5675
|
-
return /* @__PURE__ */ (0,
|
|
5764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5676
5765
|
"div",
|
|
5677
5766
|
{
|
|
5678
5767
|
className: cn(
|
|
@@ -5684,8 +5773,8 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5684
5773
|
className
|
|
5685
5774
|
),
|
|
5686
5775
|
children: [
|
|
5687
|
-
/* @__PURE__ */ (0,
|
|
5688
|
-
/* @__PURE__ */ (0,
|
|
5776
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
5777
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5689
5778
|
"button",
|
|
5690
5779
|
{
|
|
5691
5780
|
ref,
|
|
@@ -5704,22 +5793,22 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5704
5793
|
sizeStyles7[size].radio
|
|
5705
5794
|
),
|
|
5706
5795
|
onClick: () => onValueChange?.(value),
|
|
5707
|
-
children: /* @__PURE__ */ (0,
|
|
5796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5708
5797
|
"span",
|
|
5709
5798
|
{
|
|
5710
5799
|
className: cn(
|
|
5711
5800
|
"flex items-center justify-center w-full h-full rounded-full transition-all duration-200",
|
|
5712
5801
|
isSelected && "bg-primary"
|
|
5713
5802
|
),
|
|
5714
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
5803
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: cn("bg-primary-foreground rounded-full", sizeStyles7[size].dot) })
|
|
5715
5804
|
}
|
|
5716
5805
|
)
|
|
5717
5806
|
}
|
|
5718
5807
|
),
|
|
5719
|
-
/* @__PURE__ */ (0,
|
|
5720
|
-
/* @__PURE__ */ (0,
|
|
5721
|
-
Icon && /* @__PURE__ */ (0,
|
|
5722
|
-
/* @__PURE__ */ (0,
|
|
5808
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
5809
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5810
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { className: "h-4 w-4 text-foreground" }),
|
|
5811
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5723
5812
|
"label",
|
|
5724
5813
|
{
|
|
5725
5814
|
htmlFor: radioId,
|
|
@@ -5731,10 +5820,10 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5731
5820
|
}
|
|
5732
5821
|
)
|
|
5733
5822
|
] }),
|
|
5734
|
-
description && /* @__PURE__ */ (0,
|
|
5823
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-muted-foreground mt-1 text-xs", children: description })
|
|
5735
5824
|
] })
|
|
5736
5825
|
] }),
|
|
5737
|
-
/* @__PURE__ */ (0,
|
|
5826
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5738
5827
|
"input",
|
|
5739
5828
|
{
|
|
5740
5829
|
type: "radio",
|
|
@@ -5752,7 +5841,7 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5752
5841
|
);
|
|
5753
5842
|
}
|
|
5754
5843
|
if (variant === "button") {
|
|
5755
|
-
return /* @__PURE__ */ (0,
|
|
5844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5756
5845
|
"button",
|
|
5757
5846
|
{
|
|
5758
5847
|
ref,
|
|
@@ -5774,9 +5863,9 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5774
5863
|
),
|
|
5775
5864
|
onClick: () => onValueChange?.(value),
|
|
5776
5865
|
children: [
|
|
5777
|
-
Icon && /* @__PURE__ */ (0,
|
|
5866
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { className: "h-4 w-4" }),
|
|
5778
5867
|
label || children,
|
|
5779
|
-
/* @__PURE__ */ (0,
|
|
5868
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5780
5869
|
"input",
|
|
5781
5870
|
{
|
|
5782
5871
|
type: "radio",
|
|
@@ -5793,8 +5882,8 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5793
5882
|
}
|
|
5794
5883
|
);
|
|
5795
5884
|
}
|
|
5796
|
-
return /* @__PURE__ */ (0,
|
|
5797
|
-
/* @__PURE__ */ (0,
|
|
5885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("flex items-center gap-2", className), children: [
|
|
5886
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5798
5887
|
"button",
|
|
5799
5888
|
{
|
|
5800
5889
|
ref,
|
|
@@ -5813,19 +5902,19 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5813
5902
|
sizeStyles7[size].radio
|
|
5814
5903
|
),
|
|
5815
5904
|
onClick: () => onValueChange?.(value),
|
|
5816
|
-
children: /* @__PURE__ */ (0,
|
|
5905
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5817
5906
|
"span",
|
|
5818
5907
|
{
|
|
5819
5908
|
className: cn(
|
|
5820
5909
|
"flex items-center justify-center w-full h-full rounded-full transition-all duration-200",
|
|
5821
5910
|
isSelected && "bg-primary"
|
|
5822
5911
|
),
|
|
5823
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
5912
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: cn("bg-primary-foreground rounded-full", sizeStyles7[size].dot) })
|
|
5824
5913
|
}
|
|
5825
5914
|
)
|
|
5826
5915
|
}
|
|
5827
5916
|
),
|
|
5828
|
-
(label || children) && /* @__PURE__ */ (0,
|
|
5917
|
+
(label || children) && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5829
5918
|
"label",
|
|
5830
5919
|
{
|
|
5831
5920
|
htmlFor: radioId,
|
|
@@ -5836,15 +5925,15 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5836
5925
|
isDisabled && "cursor-not-allowed opacity-50"
|
|
5837
5926
|
),
|
|
5838
5927
|
children: [
|
|
5839
|
-
/* @__PURE__ */ (0,
|
|
5840
|
-
Icon && /* @__PURE__ */ (0,
|
|
5841
|
-
/* @__PURE__ */ (0,
|
|
5928
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5929
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { className: "h-4 w-4" }),
|
|
5930
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: label || children })
|
|
5842
5931
|
] }),
|
|
5843
|
-
description && /* @__PURE__ */ (0,
|
|
5932
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-muted-foreground mt-0.5 text-xs", children: description })
|
|
5844
5933
|
]
|
|
5845
5934
|
}
|
|
5846
5935
|
),
|
|
5847
|
-
/* @__PURE__ */ (0,
|
|
5936
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5848
5937
|
"input",
|
|
5849
5938
|
{
|
|
5850
5939
|
type: "radio",
|
|
@@ -5864,7 +5953,7 @@ RadioGroupItem.displayName = "RadioGroupItem";
|
|
|
5864
5953
|
|
|
5865
5954
|
// ../../components/ui/Slider.tsx
|
|
5866
5955
|
var React24 = __toESM(require("react"), 1);
|
|
5867
|
-
var
|
|
5956
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5868
5957
|
var SIZE_STYLES = {
|
|
5869
5958
|
sm: {
|
|
5870
5959
|
track: "h-1",
|
|
@@ -5924,20 +6013,20 @@ var Slider = React24.forwardRef(
|
|
|
5924
6013
|
const displayValue = formatValue ? formatValue(currentValue) : currentValue.toString();
|
|
5925
6014
|
if (orientation === "vertical") {
|
|
5926
6015
|
}
|
|
5927
|
-
return /* @__PURE__ */ (0,
|
|
5928
|
-
(label || showValue) && /* @__PURE__ */ (0,
|
|
5929
|
-
label && /* @__PURE__ */ (0,
|
|
5930
|
-
showValue && /* @__PURE__ */ (0,
|
|
6016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("w-full space-y-2", containerClassName), children: [
|
|
6017
|
+
(label || showValue) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
6018
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { className: cn("text-sm font-medium text-foreground", labelClassName), children: label }),
|
|
6019
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn("text-xs font-mono text-muted-foreground min-w-[2rem] text-right", valueClassName), children: displayValue })
|
|
5931
6020
|
] }),
|
|
5932
|
-
/* @__PURE__ */ (0,
|
|
5933
|
-
/* @__PURE__ */ (0,
|
|
6021
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("relative flex items-center", sizeStyles8.container), children: [
|
|
6022
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("w-full rounded-full bg-secondary relative overflow-hidden", sizeStyles8.track, trackClassName), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5934
6023
|
"div",
|
|
5935
6024
|
{
|
|
5936
6025
|
className: "absolute left-0 top-0 h-full bg-primary rounded-full transition-all duration-150 ease-out",
|
|
5937
6026
|
style: { width: `${percentage}%` }
|
|
5938
6027
|
}
|
|
5939
6028
|
) }),
|
|
5940
|
-
/* @__PURE__ */ (0,
|
|
6029
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5941
6030
|
"input",
|
|
5942
6031
|
{
|
|
5943
6032
|
ref,
|
|
@@ -6002,8 +6091,8 @@ Slider.displayName = "Slider";
|
|
|
6002
6091
|
|
|
6003
6092
|
// ../../components/ui/OverlayControls.tsx
|
|
6004
6093
|
var import_lucide_react16 = require("lucide-react");
|
|
6005
|
-
var
|
|
6006
|
-
var
|
|
6094
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
6095
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
6007
6096
|
function OverlayControls({
|
|
6008
6097
|
mode,
|
|
6009
6098
|
value,
|
|
@@ -6033,24 +6122,24 @@ function OverlayControls({
|
|
|
6033
6122
|
}) {
|
|
6034
6123
|
const hoverClasses = showOnHover ? "opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto" : "opacity-100 pointer-events-auto";
|
|
6035
6124
|
const showControlsBar = mode === "review";
|
|
6036
|
-
const [rateOpen, setRateOpen] =
|
|
6037
|
-
const rateWrapRef =
|
|
6038
|
-
const [controlsVisible, setControlsVisible] =
|
|
6039
|
-
const hideTimerRef =
|
|
6040
|
-
const [previewData, setPreviewData] =
|
|
6041
|
-
const sliderRef =
|
|
6042
|
-
const [isDragging, setIsDragging] =
|
|
6043
|
-
const [dragValue, setDragValue] =
|
|
6044
|
-
|
|
6125
|
+
const [rateOpen, setRateOpen] = import_react16.default.useState(false);
|
|
6126
|
+
const rateWrapRef = import_react16.default.useRef(null);
|
|
6127
|
+
const [controlsVisible, setControlsVisible] = import_react16.default.useState(true);
|
|
6128
|
+
const hideTimerRef = import_react16.default.useRef(null);
|
|
6129
|
+
const [previewData, setPreviewData] = import_react16.default.useState(null);
|
|
6130
|
+
const sliderRef = import_react16.default.useRef(null);
|
|
6131
|
+
const [isDragging, setIsDragging] = import_react16.default.useState(false);
|
|
6132
|
+
const [dragValue, setDragValue] = import_react16.default.useState(value);
|
|
6133
|
+
import_react16.default.useEffect(() => {
|
|
6045
6134
|
if (!isDragging) {
|
|
6046
6135
|
setDragValue(value);
|
|
6047
6136
|
}
|
|
6048
6137
|
}, [value, isDragging]);
|
|
6049
|
-
const [keyboardFeedback, setKeyboardFeedback] =
|
|
6050
|
-
const feedbackTimerRef =
|
|
6051
|
-
const seekAccumulatorRef =
|
|
6052
|
-
const seekAccumulatorTimerRef =
|
|
6053
|
-
|
|
6138
|
+
const [keyboardFeedback, setKeyboardFeedback] = import_react16.default.useState(null);
|
|
6139
|
+
const feedbackTimerRef = import_react16.default.useRef(null);
|
|
6140
|
+
const seekAccumulatorRef = import_react16.default.useRef(0);
|
|
6141
|
+
const seekAccumulatorTimerRef = import_react16.default.useRef(null);
|
|
6142
|
+
import_react16.default.useEffect(() => {
|
|
6054
6143
|
const onDocDown = (e) => {
|
|
6055
6144
|
if (!rateOpen) return;
|
|
6056
6145
|
const wrap = rateWrapRef.current;
|
|
@@ -6061,7 +6150,7 @@ function OverlayControls({
|
|
|
6061
6150
|
document.addEventListener("mousedown", onDocDown);
|
|
6062
6151
|
return () => document.removeEventListener("mousedown", onDocDown);
|
|
6063
6152
|
}, [rateOpen]);
|
|
6064
|
-
|
|
6153
|
+
import_react16.default.useEffect(() => {
|
|
6065
6154
|
if (!autoHide || showOnHover) return;
|
|
6066
6155
|
const resetTimer = () => {
|
|
6067
6156
|
if (hideTimerRef.current) clearTimeout(hideTimerRef.current);
|
|
@@ -6099,7 +6188,7 @@ function OverlayControls({
|
|
|
6099
6188
|
seekAccumulatorRef.current = 0;
|
|
6100
6189
|
}, 1e3);
|
|
6101
6190
|
};
|
|
6102
|
-
|
|
6191
|
+
import_react16.default.useEffect(() => {
|
|
6103
6192
|
if (!enableKeyboardShortcuts) return;
|
|
6104
6193
|
const handleKeyDown = (e) => {
|
|
6105
6194
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
|
|
@@ -6226,41 +6315,41 @@ function OverlayControls({
|
|
|
6226
6315
|
const handleSliderMouseLeave = () => {
|
|
6227
6316
|
setPreviewData(null);
|
|
6228
6317
|
};
|
|
6229
|
-
return /* @__PURE__ */ (0,
|
|
6230
|
-
keyboardFeedback && /* @__PURE__ */ (0,
|
|
6318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
6319
|
+
keyboardFeedback && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6231
6320
|
"div",
|
|
6232
6321
|
{
|
|
6233
6322
|
className: cn(
|
|
6234
6323
|
"absolute inset-0 flex items-center pointer-events-none z-50",
|
|
6235
6324
|
keyboardFeedback.type === "seek" && (keyboardFeedback.value ?? 0) > 0 ? "justify-end pr-32" : keyboardFeedback.type === "seek" && (keyboardFeedback.value ?? 0) < 0 ? "justify-start pl-32" : "justify-center"
|
|
6236
6325
|
),
|
|
6237
|
-
children: /* @__PURE__ */ (0,
|
|
6238
|
-
keyboardFeedback.type === "play" && /* @__PURE__ */ (0,
|
|
6239
|
-
keyboardFeedback.type === "pause" && /* @__PURE__ */ (0,
|
|
6240
|
-
keyboardFeedback.type === "seek" && /* @__PURE__ */ (0,
|
|
6241
|
-
(keyboardFeedback.value ?? 0) > 0 ? /* @__PURE__ */ (0,
|
|
6242
|
-
/* @__PURE__ */ (0,
|
|
6326
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "bg-black/50 backdrop-blur-sm rounded-xl px-6 py-4 shadow-xl border border-white/10 animate-in fade-in zoom-in duration-200", children: [
|
|
6327
|
+
keyboardFeedback.type === "play" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Play, { className: "w-16 h-16 text-white", fill: "white" }),
|
|
6328
|
+
keyboardFeedback.type === "pause" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Pause, { className: "w-16 h-16 text-white", fill: "white" }),
|
|
6329
|
+
keyboardFeedback.type === "seek" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
6330
|
+
(keyboardFeedback.value ?? 0) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.RotateCw, { className: "w-12 h-12 text-white" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.RotateCcw, { className: "w-12 h-12 text-white" }),
|
|
6331
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "text-3xl font-bold text-white", children: [
|
|
6243
6332
|
keyboardFeedback.value && keyboardFeedback.value > 0 ? "+" : "",
|
|
6244
6333
|
keyboardFeedback.value,
|
|
6245
6334
|
"s"
|
|
6246
6335
|
] })
|
|
6247
6336
|
] }),
|
|
6248
|
-
keyboardFeedback.type === "volume" && /* @__PURE__ */ (0,
|
|
6249
|
-
/* @__PURE__ */ (0,
|
|
6250
|
-
/* @__PURE__ */ (0,
|
|
6251
|
-
/* @__PURE__ */ (0,
|
|
6337
|
+
keyboardFeedback.type === "volume" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
6338
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Volume2, { className: "w-12 h-12 text-white" }),
|
|
6339
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
6340
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "text-2xl font-bold text-white", children: [
|
|
6252
6341
|
keyboardFeedback.value,
|
|
6253
6342
|
"%"
|
|
6254
6343
|
] }),
|
|
6255
|
-
/* @__PURE__ */ (0,
|
|
6344
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "w-32 h-1.5 bg-white/30 rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "h-full bg-white rounded-full transition-all", style: { width: `${keyboardFeedback.value}%` } }) })
|
|
6256
6345
|
] })
|
|
6257
6346
|
] }),
|
|
6258
|
-
keyboardFeedback.type === "mute" && /* @__PURE__ */ (0,
|
|
6259
|
-
keyboardFeedback.type === "unmute" && /* @__PURE__ */ (0,
|
|
6347
|
+
keyboardFeedback.type === "mute" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.VolumeX, { className: "w-16 h-16 text-white" }),
|
|
6348
|
+
keyboardFeedback.type === "unmute" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Volume2, { className: "w-16 h-16 text-white" })
|
|
6260
6349
|
] })
|
|
6261
6350
|
}
|
|
6262
6351
|
),
|
|
6263
|
-
/* @__PURE__ */ (0,
|
|
6352
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6264
6353
|
"div",
|
|
6265
6354
|
{
|
|
6266
6355
|
className: cn(
|
|
@@ -6269,9 +6358,9 @@ function OverlayControls({
|
|
|
6269
6358
|
autoHide && !controlsVisible && "opacity-0 pointer-events-none",
|
|
6270
6359
|
className
|
|
6271
6360
|
),
|
|
6272
|
-
children: /* @__PURE__ */ (0,
|
|
6273
|
-
/* @__PURE__ */ (0,
|
|
6274
|
-
/* @__PURE__ */ (0,
|
|
6361
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "px-4", children: [
|
|
6362
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { ref: sliderRef, onMouseMove: handleSliderMouseMove, onMouseLeave: handleSliderMouseLeave, className: "relative", children: [
|
|
6363
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6275
6364
|
Slider,
|
|
6276
6365
|
{
|
|
6277
6366
|
min: 0,
|
|
@@ -6296,14 +6385,14 @@ function OverlayControls({
|
|
|
6296
6385
|
noFocus: true
|
|
6297
6386
|
}
|
|
6298
6387
|
),
|
|
6299
|
-
previewData && /* @__PURE__ */ (0,
|
|
6300
|
-
/* @__PURE__ */ (0,
|
|
6301
|
-
/* @__PURE__ */ (0,
|
|
6302
|
-
] }) : /* @__PURE__ */ (0,
|
|
6388
|
+
previewData && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "absolute bottom-full mb-2 transform -translate-x-1/2 pointer-events-none z-30", style: { left: `${previewData.x}px` }, children: previewData.url ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "bg-background/95 backdrop-blur rounded-md border border-border shadow-lg overflow-hidden", children: [
|
|
6389
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("img", { src: previewData.url, alt: "Preview", className: "w-40 h-24 object-cover" }),
|
|
6390
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "px-2 py-1 text-xs font-mono text-center bg-background/80", children: formatTime2(previewData.time) })
|
|
6391
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "px-3 py-1.5 rounded-md bg-background/90 backdrop-blur border border-border shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "text-xs font-mono text-center", children: formatTime2(previewData.time) }) }) })
|
|
6303
6392
|
] }),
|
|
6304
|
-
showControlsBar && /* @__PURE__ */ (0,
|
|
6305
|
-
/* @__PURE__ */ (0,
|
|
6306
|
-
/* @__PURE__ */ (0,
|
|
6393
|
+
showControlsBar && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mt-2 flex items-center justify-between gap-2", children: [
|
|
6394
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6395
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6307
6396
|
Button_default,
|
|
6308
6397
|
{
|
|
6309
6398
|
variant: "ghost",
|
|
@@ -6311,10 +6400,10 @@ function OverlayControls({
|
|
|
6311
6400
|
onClick: onTogglePlay,
|
|
6312
6401
|
title: playing ? "T\u1EA1m d\u1EEBng" : "Ph\xE1t",
|
|
6313
6402
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6314
|
-
children: playing ? /* @__PURE__ */ (0,
|
|
6403
|
+
children: playing ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Pause, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Play, { className: "w-4 h-4" })
|
|
6315
6404
|
}
|
|
6316
6405
|
),
|
|
6317
|
-
onSkip && /* @__PURE__ */ (0,
|
|
6406
|
+
onSkip && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6318
6407
|
Button_default,
|
|
6319
6408
|
{
|
|
6320
6409
|
variant: "ghost",
|
|
@@ -6322,10 +6411,10 @@ function OverlayControls({
|
|
|
6322
6411
|
onClick: () => onSkip(-skipSeconds),
|
|
6323
6412
|
title: `L\xF9i ${skipSeconds}s`,
|
|
6324
6413
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6325
|
-
children: /* @__PURE__ */ (0,
|
|
6414
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.RotateCcw, { className: "w-4 h-4" })
|
|
6326
6415
|
}
|
|
6327
6416
|
),
|
|
6328
|
-
onSkip && /* @__PURE__ */ (0,
|
|
6417
|
+
onSkip && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6329
6418
|
Button_default,
|
|
6330
6419
|
{
|
|
6331
6420
|
variant: "ghost",
|
|
@@ -6333,16 +6422,16 @@ function OverlayControls({
|
|
|
6333
6422
|
onClick: () => onSkip(skipSeconds),
|
|
6334
6423
|
title: `Tua ${skipSeconds}s`,
|
|
6335
6424
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6336
|
-
children: /* @__PURE__ */ (0,
|
|
6425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.RotateCw, { className: "w-4 h-4" })
|
|
6337
6426
|
}
|
|
6338
6427
|
),
|
|
6339
|
-
(showTime ?? true) && /* @__PURE__ */ (0,
|
|
6428
|
+
(showTime ?? true) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "px-3 py-1 rounded-full text-xs font-mono bg-background/60 text-foreground shadow-sm border border-border whitespace-nowrap", children: [
|
|
6340
6429
|
formatTime2(dragValue),
|
|
6341
6430
|
" / ",
|
|
6342
6431
|
formatTime2(max)
|
|
6343
6432
|
] }),
|
|
6344
|
-
/* @__PURE__ */ (0,
|
|
6345
|
-
/* @__PURE__ */ (0,
|
|
6433
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6434
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6346
6435
|
Button_default,
|
|
6347
6436
|
{
|
|
6348
6437
|
variant: "ghost",
|
|
@@ -6350,10 +6439,10 @@ function OverlayControls({
|
|
|
6350
6439
|
onClick: onToggleMute,
|
|
6351
6440
|
title: muted ? "B\u1EADt ti\u1EBFng" : "T\u1EAFt ti\u1EBFng",
|
|
6352
6441
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6353
|
-
children: muted || (volume ?? 1) === 0 ? /* @__PURE__ */ (0,
|
|
6442
|
+
children: muted || (volume ?? 1) === 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.VolumeX, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Volume2, { className: "w-4 h-4" })
|
|
6354
6443
|
}
|
|
6355
6444
|
),
|
|
6356
|
-
/* @__PURE__ */ (0,
|
|
6445
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "w-24", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6357
6446
|
Slider,
|
|
6358
6447
|
{
|
|
6359
6448
|
min: 0,
|
|
@@ -6368,8 +6457,8 @@ function OverlayControls({
|
|
|
6368
6457
|
) })
|
|
6369
6458
|
] })
|
|
6370
6459
|
] }),
|
|
6371
|
-
/* @__PURE__ */ (0,
|
|
6372
|
-
onGoLive && /* @__PURE__ */ (0,
|
|
6460
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-2 relative", children: [
|
|
6461
|
+
onGoLive && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
6373
6462
|
Button_default,
|
|
6374
6463
|
{
|
|
6375
6464
|
variant: "ghost",
|
|
@@ -6378,13 +6467,13 @@ function OverlayControls({
|
|
|
6378
6467
|
title: "Tr\u1EF1c ti\u1EBFp (v\u1EC1 Live)",
|
|
6379
6468
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6380
6469
|
children: [
|
|
6381
|
-
/* @__PURE__ */ (0,
|
|
6470
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Dot, { className: "w-10 h-10 text-destructive" }),
|
|
6382
6471
|
"Tr\u1EF1c ti\u1EBFp"
|
|
6383
6472
|
]
|
|
6384
6473
|
}
|
|
6385
6474
|
),
|
|
6386
|
-
onChangeRate && /* @__PURE__ */ (0,
|
|
6387
|
-
/* @__PURE__ */ (0,
|
|
6475
|
+
onChangeRate && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "relative", ref: rateWrapRef, children: [
|
|
6476
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
6388
6477
|
Button_default,
|
|
6389
6478
|
{
|
|
6390
6479
|
variant: "ghost",
|
|
@@ -6398,7 +6487,7 @@ function OverlayControls({
|
|
|
6398
6487
|
]
|
|
6399
6488
|
}
|
|
6400
6489
|
),
|
|
6401
|
-
rateOpen && /* @__PURE__ */ (0,
|
|
6490
|
+
rateOpen && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "absolute bottom-9 right-0 bg-background/90 backdrop-blur rounded-md border border-border shadow-lg p-1 z-30", children: [0.5, 0.75, 1, 1.25, 1.5].map((r) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
6402
6491
|
"button",
|
|
6403
6492
|
{
|
|
6404
6493
|
onClick: () => {
|
|
@@ -6414,7 +6503,7 @@ function OverlayControls({
|
|
|
6414
6503
|
r
|
|
6415
6504
|
)) })
|
|
6416
6505
|
] }),
|
|
6417
|
-
onToggleFullscreen && /* @__PURE__ */ (0,
|
|
6506
|
+
onToggleFullscreen && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6418
6507
|
Button_default,
|
|
6419
6508
|
{
|
|
6420
6509
|
variant: "ghost",
|
|
@@ -6422,7 +6511,7 @@ function OverlayControls({
|
|
|
6422
6511
|
onClick: onToggleFullscreen,
|
|
6423
6512
|
title: "To\xE0n m\xE0n h\xECnh",
|
|
6424
6513
|
className: "px-3 bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6425
|
-
children: /* @__PURE__ */ (0,
|
|
6514
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Maximize2, { className: "w-4 h-4" })
|
|
6426
6515
|
}
|
|
6427
6516
|
)
|
|
6428
6517
|
] })
|
|
@@ -6434,12 +6523,12 @@ function OverlayControls({
|
|
|
6434
6523
|
}
|
|
6435
6524
|
|
|
6436
6525
|
// ../../components/ui/CategoryTreeSelect.tsx
|
|
6437
|
-
var
|
|
6526
|
+
var import_react17 = require("react");
|
|
6438
6527
|
var import_lucide_react17 = require("lucide-react");
|
|
6439
|
-
var
|
|
6528
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
6440
6529
|
function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1ECDn danh m\u1EE5c", disabled }) {
|
|
6441
|
-
const [isOpen, setIsOpen] = (0,
|
|
6442
|
-
const [expandedNodes, setExpandedNodes] = (0,
|
|
6530
|
+
const [isOpen, setIsOpen] = (0, import_react17.useState)(false);
|
|
6531
|
+
const [expandedNodes, setExpandedNodes] = (0, import_react17.useState)(/* @__PURE__ */ new Set());
|
|
6443
6532
|
const parentCategories = categories.filter((c) => !c.parent_id);
|
|
6444
6533
|
const childrenMap = /* @__PURE__ */ new Map();
|
|
6445
6534
|
categories.forEach((cat) => {
|
|
@@ -6478,18 +6567,26 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
6478
6567
|
const hasChildren = children.length > 0;
|
|
6479
6568
|
const isExpanded = expandedNodes.has(category.id);
|
|
6480
6569
|
const isSelected = value.includes(category.id);
|
|
6481
|
-
return /* @__PURE__ */ (0,
|
|
6482
|
-
/* @__PURE__ */ (0,
|
|
6570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
6571
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6483
6572
|
"div",
|
|
6484
6573
|
{
|
|
6485
6574
|
className: cn(
|
|
6486
|
-
"flex items-center gap-2 px-3 py-2 cursor-pointer rounded-md transition-colors",
|
|
6575
|
+
"relative flex items-center gap-2 px-3 py-2 cursor-pointer rounded-md transition-colors",
|
|
6487
6576
|
"hover:bg-accent",
|
|
6488
|
-
|
|
6577
|
+
// Selected state: subtle bg + square left indicator, avoid left rounding
|
|
6578
|
+
isSelected && "bg-primary/10 rounded-r-md"
|
|
6489
6579
|
),
|
|
6490
6580
|
style: { paddingLeft: `${level * 1.5 + 0.75}rem` },
|
|
6491
6581
|
children: [
|
|
6492
|
-
|
|
6582
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6583
|
+
"span",
|
|
6584
|
+
{
|
|
6585
|
+
"aria-hidden": true,
|
|
6586
|
+
className: "absolute left-0 top-0 bottom-0 w-1 bg-primary"
|
|
6587
|
+
}
|
|
6588
|
+
),
|
|
6589
|
+
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6493
6590
|
"button",
|
|
6494
6591
|
{
|
|
6495
6592
|
type: "button",
|
|
@@ -6498,130 +6595,76 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
6498
6595
|
toggleExpand(category.id);
|
|
6499
6596
|
},
|
|
6500
6597
|
className: "p-0.5 hover:bg-accent rounded",
|
|
6501
|
-
children: isExpanded ? /* @__PURE__ */ (0,
|
|
6598
|
+
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.ChevronDown, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" })
|
|
6502
6599
|
}
|
|
6503
|
-
) : /* @__PURE__ */ (0,
|
|
6504
|
-
/* @__PURE__ */ (0,
|
|
6600
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "w-5" }),
|
|
6601
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6505
6602
|
"div",
|
|
6506
6603
|
{
|
|
6507
6604
|
onClick: () => handleSelect(category.id, category),
|
|
6508
6605
|
className: "flex items-center gap-2 flex-1",
|
|
6509
6606
|
children: [
|
|
6510
|
-
/* @__PURE__ */ (0,
|
|
6607
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6511
6608
|
"div",
|
|
6512
6609
|
{
|
|
6513
6610
|
className: cn(
|
|
6514
6611
|
"w-4 h-4 border-2 rounded flex items-center justify-center transition-colors",
|
|
6515
6612
|
isSelected ? "bg-primary border-primary" : "border-muted-foreground/30"
|
|
6516
6613
|
),
|
|
6517
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
6614
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Check, { className: "w-3 h-3 text-primary-foreground" })
|
|
6518
6615
|
}
|
|
6519
6616
|
),
|
|
6520
|
-
/* @__PURE__ */ (0,
|
|
6617
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("text-sm", isSelected && "font-medium text-primary"), children: category.name })
|
|
6521
6618
|
]
|
|
6522
6619
|
}
|
|
6523
6620
|
)
|
|
6524
6621
|
]
|
|
6525
6622
|
}
|
|
6526
6623
|
),
|
|
6527
|
-
hasChildren && isExpanded && /* @__PURE__ */ (0,
|
|
6624
|
+
hasChildren && isExpanded && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: children.map((child) => renderCategory(child, level + 1)) })
|
|
6528
6625
|
] }, category.id);
|
|
6529
6626
|
};
|
|
6530
6627
|
const selectedCount = value.length;
|
|
6531
6628
|
const displayText = selectedCount > 0 ? `\u0110\xE3 ch\u1ECDn ${selectedCount} danh m\u1EE5c` : placeholder;
|
|
6532
|
-
return /* @__PURE__ */ (0,
|
|
6533
|
-
/* @__PURE__ */ (0,
|
|
6629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative", children: [
|
|
6630
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6534
6631
|
"button",
|
|
6535
6632
|
{
|
|
6536
6633
|
type: "button",
|
|
6537
6634
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
6538
6635
|
disabled,
|
|
6539
6636
|
className: cn(
|
|
6540
|
-
|
|
6541
|
-
"
|
|
6637
|
+
// Match Combobox trigger outline + focus styles
|
|
6638
|
+
"flex w-full items-center justify-between px-3 bg-background border border-input",
|
|
6639
|
+
"rounded-md h-10 py-2 text-sm",
|
|
6640
|
+
"hover:bg-accent/5 transition-colors hover:border-primary/40 focus:border-primary",
|
|
6641
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
6542
6642
|
disabled && "opacity-50 cursor-not-allowed",
|
|
6543
|
-
isOpen && "border-primary
|
|
6643
|
+
isOpen && "border-primary"
|
|
6544
6644
|
),
|
|
6545
6645
|
children: [
|
|
6546
|
-
/* @__PURE__ */ (0,
|
|
6547
|
-
/* @__PURE__ */ (0,
|
|
6646
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("text-sm", selectedCount === 0 && "text-muted-foreground"), children: displayText }),
|
|
6647
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.ChevronDown, { className: cn("w-4 h-4 transition-transform", isOpen && "transform rotate-180") })
|
|
6548
6648
|
]
|
|
6549
6649
|
}
|
|
6550
6650
|
),
|
|
6551
|
-
isOpen && !disabled && /* @__PURE__ */ (0,
|
|
6552
|
-
/* @__PURE__ */ (0,
|
|
6553
|
-
/* @__PURE__ */ (0,
|
|
6651
|
+
isOpen && !disabled && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
6652
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "fixed inset-0 z-10", onClick: () => setIsOpen(false) }),
|
|
6653
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6654
|
+
"div",
|
|
6655
|
+
{
|
|
6656
|
+
className: cn(
|
|
6657
|
+
"absolute z-20 mt-1 w-full max-h-80 overflow-auto",
|
|
6658
|
+
"rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
6659
|
+
"backdrop-blur-sm bg-popover/95 border-border/60"
|
|
6660
|
+
),
|
|
6661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "p-1", children: parentCategories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "px-3 py-2 text-sm text-muted-foreground", children: "Kh\xF4ng c\xF3 danh m\u1EE5c n\xE0o" }) : parentCategories.map((cat) => renderCategory(cat)) })
|
|
6662
|
+
}
|
|
6663
|
+
)
|
|
6554
6664
|
] })
|
|
6555
6665
|
] });
|
|
6556
6666
|
}
|
|
6557
6667
|
|
|
6558
|
-
// ../../components/ui/SmartImage.tsx
|
|
6559
|
-
var import_image = __toESM(require("next/image"), 1);
|
|
6560
|
-
var import_react17 = __toESM(require("react"), 1);
|
|
6561
|
-
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
6562
|
-
var DEFAULT_FALLBACK = "/images/products/hoa-hong-do.png";
|
|
6563
|
-
function SmartImage({
|
|
6564
|
-
src,
|
|
6565
|
-
alt,
|
|
6566
|
-
className,
|
|
6567
|
-
ratioClass,
|
|
6568
|
-
roundedClass = "rounded-lg",
|
|
6569
|
-
fill = true,
|
|
6570
|
-
width,
|
|
6571
|
-
height,
|
|
6572
|
-
sizes = "(max-width: 768px) 100vw, 33vw",
|
|
6573
|
-
priority = false,
|
|
6574
|
-
quality = 80,
|
|
6575
|
-
fit = "cover",
|
|
6576
|
-
fallbackSrc = DEFAULT_FALLBACK
|
|
6577
|
-
}) {
|
|
6578
|
-
const normalize = (input) => {
|
|
6579
|
-
if (!input || input.length === 0) return fallbackSrc;
|
|
6580
|
-
if (input.startsWith("/images/products/") && /\.(jpg|jpeg)($|\?)/i.test(input)) {
|
|
6581
|
-
return input.replace(/\.(jpg|jpeg)(?=$|\?)/i, ".png");
|
|
6582
|
-
}
|
|
6583
|
-
return input;
|
|
6584
|
-
};
|
|
6585
|
-
const [resolvedSrc, setResolvedSrc] = import_react17.default.useState(() => normalize(src));
|
|
6586
|
-
const handleError = () => {
|
|
6587
|
-
if (resolvedSrc.endsWith(".jpg")) {
|
|
6588
|
-
setResolvedSrc(resolvedSrc.replace(/\.jpg($|\?)/, ".png$1"));
|
|
6589
|
-
} else if (resolvedSrc !== fallbackSrc) {
|
|
6590
|
-
setResolvedSrc(fallbackSrc);
|
|
6591
|
-
}
|
|
6592
|
-
};
|
|
6593
|
-
const Wrapper = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("relative overflow-hidden bg-muted/30", ratioClass, roundedClass, className), children });
|
|
6594
|
-
if (fill) {
|
|
6595
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6596
|
-
import_image.default,
|
|
6597
|
-
{
|
|
6598
|
-
src: resolvedSrc,
|
|
6599
|
-
alt,
|
|
6600
|
-
fill: true,
|
|
6601
|
-
sizes,
|
|
6602
|
-
onError: handleError,
|
|
6603
|
-
priority,
|
|
6604
|
-
quality,
|
|
6605
|
-
style: { objectFit: fit }
|
|
6606
|
-
}
|
|
6607
|
-
) });
|
|
6608
|
-
}
|
|
6609
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("relative overflow-hidden bg-muted/30", roundedClass, className), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6610
|
-
import_image.default,
|
|
6611
|
-
{
|
|
6612
|
-
src: resolvedSrc,
|
|
6613
|
-
alt,
|
|
6614
|
-
width,
|
|
6615
|
-
height,
|
|
6616
|
-
sizes,
|
|
6617
|
-
onError: handleError,
|
|
6618
|
-
priority,
|
|
6619
|
-
quality,
|
|
6620
|
-
style: { objectFit: fit, width: "100%", height: "100%" }
|
|
6621
|
-
}
|
|
6622
|
-
) });
|
|
6623
|
-
}
|
|
6624
|
-
|
|
6625
6668
|
// ../../components/ui/ImageUpload.tsx
|
|
6626
6669
|
var import_react18 = require("react");
|
|
6627
6670
|
var import_lucide_react18 = require("lucide-react");
|
|
@@ -6851,20 +6894,20 @@ function ImageUpload({
|
|
|
6851
6894
|
}
|
|
6852
6895
|
|
|
6853
6896
|
// ../../components/ui/Carousel.tsx
|
|
6854
|
-
var
|
|
6897
|
+
var React27 = __toESM(require("react"), 1);
|
|
6855
6898
|
var import_lucide_react19 = require("lucide-react");
|
|
6856
6899
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
6857
6900
|
function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
6858
|
-
const [currentIndex, setCurrentIndex] =
|
|
6859
|
-
const totalSlides =
|
|
6860
|
-
const [isPaused, setIsPaused] =
|
|
6861
|
-
const scrollPrev =
|
|
6901
|
+
const [currentIndex, setCurrentIndex] = React27.useState(0);
|
|
6902
|
+
const totalSlides = React27.Children.count(children);
|
|
6903
|
+
const [isPaused, setIsPaused] = React27.useState(false);
|
|
6904
|
+
const scrollPrev = React27.useCallback(() => {
|
|
6862
6905
|
setCurrentIndex((prev) => prev > 0 ? prev - 1 : totalSlides - 1);
|
|
6863
6906
|
}, [totalSlides]);
|
|
6864
|
-
const scrollNext =
|
|
6907
|
+
const scrollNext = React27.useCallback(() => {
|
|
6865
6908
|
setCurrentIndex((prev) => prev < totalSlides - 1 ? prev + 1 : 0);
|
|
6866
6909
|
}, [totalSlides]);
|
|
6867
|
-
|
|
6910
|
+
React27.useEffect(() => {
|
|
6868
6911
|
if (!autoScroll || isPaused || totalSlides <= 1) return;
|
|
6869
6912
|
const interval = setInterval(() => {
|
|
6870
6913
|
scrollNext();
|
|
@@ -6872,7 +6915,7 @@ function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
|
6872
6915
|
return () => clearInterval(interval);
|
|
6873
6916
|
}, [autoScroll, isPaused, totalSlides, autoScrollInterval, scrollNext]);
|
|
6874
6917
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative w-full overflow-hidden", onMouseEnter: () => setIsPaused(true), onMouseLeave: () => setIsPaused(false), children: [
|
|
6875
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex transition-transform duration-500 ease-in-out", style: { transform: `translateX(-${currentIndex * 100}%)` }, children:
|
|
6918
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.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_runtime35.jsx)("div", { className: "flex-shrink-0 w-full h-full", children: child }, idx)) }),
|
|
6876
6919
|
totalSlides > 1 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
6877
6920
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6878
6921
|
Button_default,
|
|
@@ -7147,6 +7190,7 @@ function DataTable({
|
|
|
7147
7190
|
enableDensityToggle = true,
|
|
7148
7191
|
striped = true,
|
|
7149
7192
|
// Mặc định bật màu nền sẽn kẽ cho các dòng
|
|
7193
|
+
columnDividers = false,
|
|
7150
7194
|
className,
|
|
7151
7195
|
labels
|
|
7152
7196
|
}) {
|
|
@@ -7228,11 +7272,15 @@ function DataTable({
|
|
|
7228
7272
|
}
|
|
7229
7273
|
return null;
|
|
7230
7274
|
};
|
|
7231
|
-
const renderHeader = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableRow, { children: visibleColumns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7275
|
+
const renderHeader = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableRow, { children: visibleColumns.map((col, colIdx) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7232
7276
|
TableHead,
|
|
7233
7277
|
{
|
|
7234
7278
|
style: { width: col.width },
|
|
7235
|
-
className: cn(
|
|
7279
|
+
className: cn(
|
|
7280
|
+
col.align === "right" && "text-right",
|
|
7281
|
+
col.align === "center" && "text-center",
|
|
7282
|
+
columnDividers && colIdx > 0 && "border-l border-border/60"
|
|
7283
|
+
),
|
|
7236
7284
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center justify-between gap-2 select-none min-h-[2.5rem]", children: [
|
|
7237
7285
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-1 min-w-0 flex-1", children: [
|
|
7238
7286
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "truncate font-medium text-sm", children: col.title }),
|
|
@@ -7382,10 +7430,10 @@ function DataTable({
|
|
|
7382
7430
|
toolbar
|
|
7383
7431
|
] })
|
|
7384
7432
|
] }),
|
|
7385
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn("relative rounded-
|
|
7433
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn("relative rounded-md border border-border/50 overflow-hidden", loading2 && "opacity-60 pointer-events-none"), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
7386
7434
|
Table,
|
|
7387
7435
|
{
|
|
7388
|
-
containerClassName: "border-0 rounded-none shadow-none",
|
|
7436
|
+
containerClassName: "border-0 md:border-0 rounded-none md:rounded-none shadow-none bg-transparent",
|
|
7389
7437
|
className: "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-[5] [&_thead]:bg-background [&_thead]:backdrop-blur-sm",
|
|
7390
7438
|
children: [
|
|
7391
7439
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableHeader, { children: renderHeader }),
|
|
@@ -7402,7 +7450,7 @@ function DataTable({
|
|
|
7402
7450
|
)
|
|
7403
7451
|
] }),
|
|
7404
7452
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-sm", children: "Loading..." })
|
|
7405
|
-
] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableCell, { colSpan: visibleColumns.length, className: "text-center py-6 text-muted-foreground", children: "No data" }) }) : displayedData.map((row, idx) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/30"), children: visibleColumns.map((col) => {
|
|
7453
|
+
] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableCell, { colSpan: visibleColumns.length, className: "text-center py-6 text-muted-foreground", children: "No data" }) }) : displayedData.map((row, idx) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/30"), children: visibleColumns.map((col, colIdx) => {
|
|
7406
7454
|
const value = col.dataIndex ? row[col.dataIndex] : void 0;
|
|
7407
7455
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7408
7456
|
TableCell,
|
|
@@ -7411,8 +7459,9 @@ function DataTable({
|
|
|
7411
7459
|
cellPadding,
|
|
7412
7460
|
col.align === "right" && "text-right",
|
|
7413
7461
|
col.align === "center" && "text-center",
|
|
7414
|
-
|
|
7415
|
-
idx === data.length - 1 && col === visibleColumns[
|
|
7462
|
+
columnDividers && colIdx > 0 && "border-l border-border/60",
|
|
7463
|
+
idx === data.length - 1 && col === visibleColumns[0] && "rounded-bl-md",
|
|
7464
|
+
idx === data.length - 1 && col === visibleColumns[visibleColumns.length - 1] && "rounded-br-md"
|
|
7416
7465
|
),
|
|
7417
7466
|
children: col.render ? col.render(value, row, idx) : String(value ?? "")
|
|
7418
7467
|
},
|
|
@@ -7422,7 +7471,7 @@ function DataTable({
|
|
|
7422
7471
|
]
|
|
7423
7472
|
}
|
|
7424
7473
|
) }),
|
|
7425
|
-
totalItems > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "border-t bg-muted/30 p-4 rounded-b-
|
|
7474
|
+
totalItems > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "border-t bg-muted/30 p-4 rounded-b-md", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7426
7475
|
Pagination,
|
|
7427
7476
|
{
|
|
7428
7477
|
page: curPage,
|
|
@@ -7444,7 +7493,7 @@ function DataTable({
|
|
|
7444
7493
|
var DataTable_default = DataTable;
|
|
7445
7494
|
|
|
7446
7495
|
// ../../components/ui/Form.tsx
|
|
7447
|
-
var
|
|
7496
|
+
var React31 = __toESM(require("react"), 1);
|
|
7448
7497
|
|
|
7449
7498
|
// ../../node_modules/react-hook-form/dist/index.esm.mjs
|
|
7450
7499
|
var import_react22 = __toESM(require("react"), 1);
|
|
@@ -9213,7 +9262,7 @@ function useForm(props = {}) {
|
|
|
9213
9262
|
// ../../components/ui/Form.tsx
|
|
9214
9263
|
var import_next_intl8 = require("next-intl");
|
|
9215
9264
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
9216
|
-
var FormConfigContext =
|
|
9265
|
+
var FormConfigContext = React31.createContext({ size: "md" });
|
|
9217
9266
|
var FormWrapper = ({
|
|
9218
9267
|
children,
|
|
9219
9268
|
onSubmit,
|
|
@@ -9226,7 +9275,7 @@ var FormWrapper = ({
|
|
|
9226
9275
|
const methods = useForm({
|
|
9227
9276
|
defaultValues: initialValues
|
|
9228
9277
|
});
|
|
9229
|
-
|
|
9278
|
+
React31.useEffect(() => {
|
|
9230
9279
|
if (initialValues) {
|
|
9231
9280
|
methods.reset(initialValues);
|
|
9232
9281
|
}
|
|
@@ -9235,15 +9284,15 @@ var FormWrapper = ({
|
|
|
9235
9284
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormProvider, { ...methods, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormConfigContext.Provider, { value: { size }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("form", { onSubmit: methods.handleSubmit(onSubmit), className, ...formProps, children }) }) });
|
|
9236
9285
|
};
|
|
9237
9286
|
var Form = FormWrapper;
|
|
9238
|
-
var FormFieldContext =
|
|
9287
|
+
var FormFieldContext = React31.createContext({});
|
|
9239
9288
|
var FormField = ({
|
|
9240
9289
|
...props
|
|
9241
9290
|
}) => {
|
|
9242
9291
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Controller, { ...props }) });
|
|
9243
9292
|
};
|
|
9244
9293
|
var useFormField = () => {
|
|
9245
|
-
const fieldContext =
|
|
9246
|
-
const itemContext =
|
|
9294
|
+
const fieldContext = React31.useContext(FormFieldContext);
|
|
9295
|
+
const itemContext = React31.useContext(FormItemContext);
|
|
9247
9296
|
const { getFieldState, formState } = useFormContext();
|
|
9248
9297
|
if (!fieldContext) {
|
|
9249
9298
|
try {
|
|
@@ -9264,20 +9313,20 @@ var useFormField = () => {
|
|
|
9264
9313
|
...fieldState
|
|
9265
9314
|
};
|
|
9266
9315
|
};
|
|
9267
|
-
var FormItemContext =
|
|
9268
|
-
var FormItem =
|
|
9269
|
-
const id =
|
|
9316
|
+
var FormItemContext = React31.createContext({});
|
|
9317
|
+
var FormItem = React31.forwardRef(({ className, ...props }, ref) => {
|
|
9318
|
+
const id = React31.useId();
|
|
9270
9319
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { ref, className: cn("space-y-2", className), ...props }) });
|
|
9271
9320
|
});
|
|
9272
9321
|
FormItem.displayName = "FormItem";
|
|
9273
|
-
var FormLabel =
|
|
9322
|
+
var FormLabel = React31.forwardRef(({ className, ...props }, ref) => {
|
|
9274
9323
|
const { error, formItemId } = useFormField();
|
|
9275
|
-
const config =
|
|
9324
|
+
const config = React31.useContext(FormConfigContext);
|
|
9276
9325
|
const sizeClass = config.size === "sm" ? "text-xs" : config.size === "lg" ? "text-base" : "text-sm";
|
|
9277
9326
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Label, { ref, className: cn(sizeClass, error && "text-destructive", className), htmlFor: formItemId, ...props });
|
|
9278
9327
|
});
|
|
9279
9328
|
FormLabel.displayName = "FormLabel";
|
|
9280
|
-
var FormControl =
|
|
9329
|
+
var FormControl = React31.forwardRef(({ ...props }, ref) => {
|
|
9281
9330
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
9282
9331
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9283
9332
|
"div",
|
|
@@ -9291,12 +9340,12 @@ var FormControl = React32.forwardRef(({ ...props }, ref) => {
|
|
|
9291
9340
|
);
|
|
9292
9341
|
});
|
|
9293
9342
|
FormControl.displayName = "FormControl";
|
|
9294
|
-
var FormDescription =
|
|
9343
|
+
var FormDescription = React31.forwardRef(({ className, ...props }, ref) => {
|
|
9295
9344
|
const { formDescriptionId } = useFormField();
|
|
9296
9345
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { ref, id: formDescriptionId, className: cn("text-sm text-muted-foreground", className), ...props });
|
|
9297
9346
|
});
|
|
9298
9347
|
FormDescription.displayName = "FormDescription";
|
|
9299
|
-
var FormMessage =
|
|
9348
|
+
var FormMessage = React31.forwardRef(({ className, children, ...props }, ref) => {
|
|
9300
9349
|
const { error, formMessageId } = useFormField();
|
|
9301
9350
|
const body = error ? String(error?.message) : children;
|
|
9302
9351
|
if (!body) {
|
|
@@ -9305,7 +9354,7 @@ var FormMessage = React32.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
9305
9354
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { ref, id: formMessageId, className: cn("text-sm font-medium text-destructive", className), ...props, children: body });
|
|
9306
9355
|
});
|
|
9307
9356
|
FormMessage.displayName = "FormMessage";
|
|
9308
|
-
var FormInput =
|
|
9357
|
+
var FormInput = React31.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9309
9358
|
FormField,
|
|
9310
9359
|
{
|
|
9311
9360
|
name,
|
|
@@ -9316,7 +9365,7 @@ var FormInput = React32.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */
|
|
|
9316
9365
|
}
|
|
9317
9366
|
) }));
|
|
9318
9367
|
FormInput.displayName = "FormInput";
|
|
9319
|
-
var FormCheckbox =
|
|
9368
|
+
var FormCheckbox = React31.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9320
9369
|
FormField,
|
|
9321
9370
|
{
|
|
9322
9371
|
name,
|
|
@@ -9340,9 +9389,9 @@ var FormCheckbox = React32.forwardRef(({ name, ...props }, ref) => /* @__PURE__
|
|
|
9340
9389
|
}
|
|
9341
9390
|
) }));
|
|
9342
9391
|
FormCheckbox.displayName = "FormCheckbox";
|
|
9343
|
-
var FormActions =
|
|
9392
|
+
var FormActions = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { ref, className: cn("flex gap-2 justify-end", className), ...props }));
|
|
9344
9393
|
FormActions.displayName = "FormActions";
|
|
9345
|
-
var FormSubmitButton =
|
|
9394
|
+
var FormSubmitButton = React31.forwardRef(({ children, loading: loading2, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Button_default, { ref, type: "submit", size: props.size ?? size, disabled: loading2, ...props, children }) }));
|
|
9346
9395
|
FormSubmitButton.displayName = "FormSubmitButton";
|
|
9347
9396
|
|
|
9348
9397
|
// ../../components/ui/NotificationModal.tsx
|