@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.js
CHANGED
|
@@ -1289,35 +1289,124 @@ var Label = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1289
1289
|
));
|
|
1290
1290
|
Label.displayName = "Label";
|
|
1291
1291
|
|
|
1292
|
+
// ../../components/ui/SmartImage.tsx
|
|
1293
|
+
import Image from "next/image";
|
|
1294
|
+
import React7 from "react";
|
|
1295
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1296
|
+
var DEFAULT_FALLBACK = "/images/products/hoa-hong-do.png";
|
|
1297
|
+
var FAILED_SRCS = /* @__PURE__ */ new Set();
|
|
1298
|
+
function SmartImage({
|
|
1299
|
+
src,
|
|
1300
|
+
alt,
|
|
1301
|
+
className,
|
|
1302
|
+
ratioClass,
|
|
1303
|
+
roundedClass = "rounded-lg",
|
|
1304
|
+
fill = true,
|
|
1305
|
+
width,
|
|
1306
|
+
height,
|
|
1307
|
+
sizes = "(max-width: 768px) 100vw, 33vw",
|
|
1308
|
+
priority = false,
|
|
1309
|
+
quality = 80,
|
|
1310
|
+
fit = "cover",
|
|
1311
|
+
objectPosition,
|
|
1312
|
+
fallbackSrc = DEFAULT_FALLBACK
|
|
1313
|
+
}) {
|
|
1314
|
+
const normalize = (input) => {
|
|
1315
|
+
if (!input || input.length === 0) return fallbackSrc;
|
|
1316
|
+
const raw = input.trim();
|
|
1317
|
+
if (raw.startsWith("/images/products/") && /\.(jpg|jpeg)($|\?)/i.test(raw)) {
|
|
1318
|
+
return raw.replace(/\.(jpg|jpeg)(?=$|\?)/i, ".png");
|
|
1319
|
+
}
|
|
1320
|
+
if (raw.startsWith("//")) {
|
|
1321
|
+
return `https:${raw}`;
|
|
1322
|
+
}
|
|
1323
|
+
if (/^(https?:|data:|blob:)/i.test(raw)) {
|
|
1324
|
+
return FAILED_SRCS.has(raw) ? fallbackSrc : raw;
|
|
1325
|
+
}
|
|
1326
|
+
if (raw.startsWith("/")) {
|
|
1327
|
+
return FAILED_SRCS.has(raw) ? fallbackSrc : raw;
|
|
1328
|
+
}
|
|
1329
|
+
const normalized = `/${raw.replace(/^\.\/?/, "")}`;
|
|
1330
|
+
return FAILED_SRCS.has(normalized) ? fallbackSrc : normalized;
|
|
1331
|
+
};
|
|
1332
|
+
const [resolvedSrc, setResolvedSrc] = React7.useState(() => normalize(src));
|
|
1333
|
+
React7.useEffect(() => {
|
|
1334
|
+
setResolvedSrc(normalize(src));
|
|
1335
|
+
}, [src]);
|
|
1336
|
+
const handleError = () => {
|
|
1337
|
+
if (resolvedSrc && resolvedSrc !== fallbackSrc) FAILED_SRCS.add(resolvedSrc);
|
|
1338
|
+
if (resolvedSrc.endsWith(".jpg")) {
|
|
1339
|
+
const next = resolvedSrc.replace(/\.jpg($|\?)/, ".png$1");
|
|
1340
|
+
setResolvedSrc(next);
|
|
1341
|
+
} else if (resolvedSrc !== fallbackSrc) {
|
|
1342
|
+
setResolvedSrc(fallbackSrc);
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
const Wrapper = ({ children }) => /* @__PURE__ */ jsx9(
|
|
1346
|
+
"div",
|
|
1347
|
+
{
|
|
1348
|
+
className: cn(
|
|
1349
|
+
"relative overflow-hidden bg-muted/30",
|
|
1350
|
+
// remove any default focus outline/ring for visual consistency with Card
|
|
1351
|
+
"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0",
|
|
1352
|
+
ratioClass,
|
|
1353
|
+
roundedClass,
|
|
1354
|
+
className
|
|
1355
|
+
),
|
|
1356
|
+
children
|
|
1357
|
+
}
|
|
1358
|
+
);
|
|
1359
|
+
if (fill) {
|
|
1360
|
+
return /* @__PURE__ */ jsx9(Wrapper, { children: /* @__PURE__ */ jsx9(
|
|
1361
|
+
Image,
|
|
1362
|
+
{
|
|
1363
|
+
src: resolvedSrc,
|
|
1364
|
+
alt,
|
|
1365
|
+
fill: true,
|
|
1366
|
+
sizes,
|
|
1367
|
+
onError: handleError,
|
|
1368
|
+
priority,
|
|
1369
|
+
quality,
|
|
1370
|
+
style: { objectFit: fit, objectPosition }
|
|
1371
|
+
}
|
|
1372
|
+
) });
|
|
1373
|
+
}
|
|
1374
|
+
return /* @__PURE__ */ jsx9(
|
|
1375
|
+
"div",
|
|
1376
|
+
{
|
|
1377
|
+
className: cn(
|
|
1378
|
+
"relative overflow-hidden bg-muted/30",
|
|
1379
|
+
"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0",
|
|
1380
|
+
roundedClass,
|
|
1381
|
+
className
|
|
1382
|
+
),
|
|
1383
|
+
children: /* @__PURE__ */ jsx9(
|
|
1384
|
+
Image,
|
|
1385
|
+
{
|
|
1386
|
+
src: resolvedSrc,
|
|
1387
|
+
alt,
|
|
1388
|
+
width,
|
|
1389
|
+
height,
|
|
1390
|
+
sizes,
|
|
1391
|
+
onError: handleError,
|
|
1392
|
+
priority,
|
|
1393
|
+
quality,
|
|
1394
|
+
style: { objectFit: fit, objectPosition, width: "100%", height: "100%" }
|
|
1395
|
+
}
|
|
1396
|
+
)
|
|
1397
|
+
}
|
|
1398
|
+
);
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1292
1401
|
// ../../components/ui/Avatar.tsx
|
|
1293
|
-
import
|
|
1294
|
-
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1402
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1295
1403
|
var sizeClasses = {
|
|
1296
1404
|
sm: "h-8 w-8 text-sm",
|
|
1297
1405
|
md: "h-10 w-10 text-base",
|
|
1298
1406
|
lg: "h-14 w-14 text-lg"
|
|
1299
1407
|
};
|
|
1300
1408
|
var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onClick, ...props }) => {
|
|
1301
|
-
const
|
|
1302
|
-
const [isImageLoading, setIsImageLoading] = React7.useState(!!src);
|
|
1303
|
-
const [imageError, setImageError] = React7.useState(false);
|
|
1304
|
-
React7.useEffect(() => {
|
|
1305
|
-
if (src) {
|
|
1306
|
-
setIsImageLoading(true);
|
|
1307
|
-
setImageError(false);
|
|
1308
|
-
setLoaded(false);
|
|
1309
|
-
}
|
|
1310
|
-
}, [src]);
|
|
1311
|
-
const handleImageLoad = () => {
|
|
1312
|
-
setLoaded(true);
|
|
1313
|
-
setIsImageLoading(false);
|
|
1314
|
-
};
|
|
1315
|
-
const handleImageError = () => {
|
|
1316
|
-
setLoaded(false);
|
|
1317
|
-
setIsImageLoading(false);
|
|
1318
|
-
setImageError(true);
|
|
1319
|
-
};
|
|
1320
|
-
const hasValidSrc = src && src.trim().length > 0;
|
|
1409
|
+
const hasValidSrc = !!(src && src.trim().length > 0);
|
|
1321
1410
|
return /* @__PURE__ */ jsxs8(
|
|
1322
1411
|
"div",
|
|
1323
1412
|
{
|
|
@@ -1330,23 +1419,21 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
|
|
|
1330
1419
|
onClick,
|
|
1331
1420
|
...props,
|
|
1332
1421
|
children: [
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
hasValidSrc && !imageError && // eslint-disable-next-line @next/next/no-img-element
|
|
1336
|
-
/* @__PURE__ */ jsx9(
|
|
1337
|
-
"img",
|
|
1422
|
+
hasValidSrc && /* @__PURE__ */ jsx10("div", { className: "absolute inset-0", children: /* @__PURE__ */ jsx10(
|
|
1423
|
+
SmartImage,
|
|
1338
1424
|
{
|
|
1339
1425
|
src,
|
|
1340
1426
|
alt,
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
className:
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1427
|
+
fill: true,
|
|
1428
|
+
ratioClass: void 0,
|
|
1429
|
+
className: "h-full w-full",
|
|
1430
|
+
roundedClass: "rounded-full",
|
|
1431
|
+
fit: "cover",
|
|
1432
|
+
objectPosition: "center",
|
|
1433
|
+
quality: 80
|
|
1347
1434
|
}
|
|
1348
|
-
),
|
|
1349
|
-
|
|
1435
|
+
) }),
|
|
1436
|
+
!hasValidSrc && /* @__PURE__ */ jsx10(
|
|
1350
1437
|
"span",
|
|
1351
1438
|
{
|
|
1352
1439
|
className: cn(
|
|
@@ -1356,7 +1443,7 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
|
|
|
1356
1443
|
children: fallback
|
|
1357
1444
|
}
|
|
1358
1445
|
),
|
|
1359
|
-
/* @__PURE__ */
|
|
1446
|
+
/* @__PURE__ */ jsx10("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" })
|
|
1360
1447
|
]
|
|
1361
1448
|
}
|
|
1362
1449
|
);
|
|
@@ -1364,7 +1451,7 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
|
|
|
1364
1451
|
var Avatar_default = Avatar;
|
|
1365
1452
|
|
|
1366
1453
|
// ../../components/ui/Skeleton.tsx
|
|
1367
|
-
import { jsx as
|
|
1454
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1368
1455
|
var Skeleton = ({
|
|
1369
1456
|
className,
|
|
1370
1457
|
width,
|
|
@@ -1385,7 +1472,7 @@ var Skeleton = ({
|
|
|
1385
1472
|
none: ""
|
|
1386
1473
|
};
|
|
1387
1474
|
if (variant === "text" && lines > 1) {
|
|
1388
|
-
return /* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ jsx11("div", { className: cn("space-y-2", className), children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx11(
|
|
1389
1476
|
"div",
|
|
1390
1477
|
{
|
|
1391
1478
|
className: cn(
|
|
@@ -1403,7 +1490,7 @@ var Skeleton = ({
|
|
|
1403
1490
|
index
|
|
1404
1491
|
)) });
|
|
1405
1492
|
}
|
|
1406
|
-
return /* @__PURE__ */
|
|
1493
|
+
return /* @__PURE__ */ jsx11(
|
|
1407
1494
|
"div",
|
|
1408
1495
|
{
|
|
1409
1496
|
className: cn(
|
|
@@ -1425,7 +1512,7 @@ var SkeletonAvatar = ({
|
|
|
1425
1512
|
md: "w-10 h-10",
|
|
1426
1513
|
lg: "w-12 h-12"
|
|
1427
1514
|
};
|
|
1428
|
-
return /* @__PURE__ */
|
|
1515
|
+
return /* @__PURE__ */ jsx11(
|
|
1429
1516
|
Skeleton,
|
|
1430
1517
|
{
|
|
1431
1518
|
variant: "circular",
|
|
@@ -1442,7 +1529,7 @@ var SkeletonButton = ({
|
|
|
1442
1529
|
md: "h-10 w-24",
|
|
1443
1530
|
lg: "h-12 w-28"
|
|
1444
1531
|
};
|
|
1445
|
-
return /* @__PURE__ */
|
|
1532
|
+
return /* @__PURE__ */ jsx11(
|
|
1446
1533
|
Skeleton,
|
|
1447
1534
|
{
|
|
1448
1535
|
variant: "rounded",
|
|
@@ -1455,7 +1542,7 @@ var SkeletonText = ({
|
|
|
1455
1542
|
className,
|
|
1456
1543
|
width = "100%"
|
|
1457
1544
|
}) => {
|
|
1458
|
-
return /* @__PURE__ */
|
|
1545
|
+
return /* @__PURE__ */ jsx11(
|
|
1459
1546
|
Skeleton,
|
|
1460
1547
|
{
|
|
1461
1548
|
variant: "text",
|
|
@@ -1471,42 +1558,42 @@ var SkeletonCard = ({
|
|
|
1471
1558
|
textLines = 3,
|
|
1472
1559
|
className
|
|
1473
1560
|
}) => {
|
|
1474
|
-
return /* @__PURE__ */ jsxs9("div", { className: cn("p-4 space-y-4 rounded-lg
|
|
1561
|
+
return /* @__PURE__ */ jsxs9("div", { className: cn("p-4 space-y-4 rounded-lg bg-card outline-none focus:outline-none", className), children: [
|
|
1475
1562
|
showAvatar && /* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-3", children: [
|
|
1476
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ jsx11(SkeletonAvatar, {}),
|
|
1477
1564
|
/* @__PURE__ */ jsxs9("div", { className: "space-y-2", children: [
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-4 w-24" }),
|
|
1566
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-16" })
|
|
1480
1567
|
] })
|
|
1481
1568
|
] }),
|
|
1482
|
-
showImage && /* @__PURE__ */
|
|
1483
|
-
/* @__PURE__ */
|
|
1569
|
+
showImage && /* @__PURE__ */ jsx11(Skeleton, { className: "h-48 w-full rounded-md" }),
|
|
1570
|
+
/* @__PURE__ */ jsx11(SkeletonText, { lines: textLines }),
|
|
1484
1571
|
/* @__PURE__ */ jsxs9("div", { className: "flex space-x-2", children: [
|
|
1485
|
-
/* @__PURE__ */
|
|
1486
|
-
/* @__PURE__ */
|
|
1572
|
+
/* @__PURE__ */ jsx11(SkeletonButton, { size: "sm" }),
|
|
1573
|
+
/* @__PURE__ */ jsx11(SkeletonButton, { size: "sm" })
|
|
1487
1574
|
] })
|
|
1488
1575
|
] });
|
|
1489
1576
|
};
|
|
1490
1577
|
var SkeletonPost = ({ className }) => {
|
|
1491
|
-
return /* @__PURE__ */ jsxs9("div", { className: cn("p-6 space-y-4 rounded-xl
|
|
1578
|
+
return /* @__PURE__ */ jsxs9("div", { className: cn("p-6 space-y-4 rounded-xl bg-card outline-none focus:outline-none", className), children: [
|
|
1492
1579
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-3", children: [
|
|
1493
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ jsx11(SkeletonAvatar, { size: "lg" }),
|
|
1494
1581
|
/* @__PURE__ */ jsxs9("div", { className: "space-y-2", children: [
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
-
/* @__PURE__ */
|
|
1582
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-4 w-32" }),
|
|
1583
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-20" })
|
|
1497
1584
|
] })
|
|
1498
1585
|
] }),
|
|
1499
|
-
/* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ jsx11(SkeletonText, { lines: 2 }),
|
|
1587
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-64 w-full rounded-lg" }),
|
|
1501
1588
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-4", children: [
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
/* @__PURE__ */
|
|
1589
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-16" }),
|
|
1590
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-20" }),
|
|
1591
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-12" })
|
|
1505
1592
|
] }),
|
|
1506
|
-
/* @__PURE__ */
|
|
1507
|
-
/* @__PURE__ */
|
|
1508
|
-
/* @__PURE__ */
|
|
1509
|
-
/* @__PURE__ */
|
|
1593
|
+
/* @__PURE__ */ jsx11("div", { className: "flex items-center justify-between pt-2", children: /* @__PURE__ */ jsxs9("div", { className: "flex space-x-4", children: [
|
|
1594
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-8 w-16" }),
|
|
1595
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-8 w-20" }),
|
|
1596
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-8 w-16" })
|
|
1510
1597
|
] }) })
|
|
1511
1598
|
] });
|
|
1512
1599
|
};
|
|
@@ -1520,16 +1607,16 @@ var SkeletonMessage = ({
|
|
|
1520
1607
|
own && "flex-row-reverse space-x-reverse",
|
|
1521
1608
|
className
|
|
1522
1609
|
), children: [
|
|
1523
|
-
showAvatar && !own && /* @__PURE__ */
|
|
1610
|
+
showAvatar && !own && /* @__PURE__ */ jsx11(SkeletonAvatar, { size: "sm" }),
|
|
1524
1611
|
/* @__PURE__ */ jsxs9("div", { className: cn(
|
|
1525
1612
|
"max-w-xs space-y-1",
|
|
1526
1613
|
own ? "items-end" : "items-start"
|
|
1527
1614
|
), children: [
|
|
1528
|
-
/* @__PURE__ */
|
|
1615
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: cn(
|
|
1529
1616
|
"h-10 rounded-2xl",
|
|
1530
1617
|
own ? "w-32 bg-primary/20" : "w-40 bg-muted"
|
|
1531
1618
|
) }),
|
|
1532
|
-
/* @__PURE__ */
|
|
1619
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-12" })
|
|
1533
1620
|
] })
|
|
1534
1621
|
] });
|
|
1535
1622
|
};
|
|
@@ -1539,13 +1626,13 @@ var SkeletonList = ({
|
|
|
1539
1626
|
showAvatar = true,
|
|
1540
1627
|
className
|
|
1541
1628
|
}) => {
|
|
1542
|
-
return /* @__PURE__ */
|
|
1543
|
-
showAvatar && /* @__PURE__ */
|
|
1629
|
+
return /* @__PURE__ */ jsx11("div", { className: cn("space-y-3", className), children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-3 p-3 rounded-lg", children: [
|
|
1630
|
+
showAvatar && /* @__PURE__ */ jsx11(SkeletonAvatar, {}),
|
|
1544
1631
|
/* @__PURE__ */ jsxs9("div", { className: "flex-1 space-y-2", children: [
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
1632
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-4 w-3/4" }),
|
|
1633
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-1/2" })
|
|
1547
1634
|
] }),
|
|
1548
|
-
/* @__PURE__ */
|
|
1635
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-6 w-16" })
|
|
1549
1636
|
] }, index)) });
|
|
1550
1637
|
};
|
|
1551
1638
|
var SkeletonTable = ({
|
|
@@ -1554,8 +1641,8 @@ var SkeletonTable = ({
|
|
|
1554
1641
|
className
|
|
1555
1642
|
}) => {
|
|
1556
1643
|
return /* @__PURE__ */ jsxs9("div", { className: cn("space-y-3", className), children: [
|
|
1557
|
-
/* @__PURE__ */
|
|
1558
|
-
Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ jsx11("div", { className: "flex space-x-4 p-3", children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsx11(Skeleton, { className: "h-4 flex-1" }, index)) }),
|
|
1645
|
+
Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */ jsx11("div", { className: "flex space-x-4 p-3", children: Array.from({ length: columns }).map((_2, colIndex) => /* @__PURE__ */ jsx11(Skeleton, { className: "h-4 flex-1" }, colIndex)) }, rowIndex))
|
|
1559
1646
|
] });
|
|
1560
1647
|
};
|
|
1561
1648
|
var Skeleton_default = Skeleton;
|
|
@@ -1563,7 +1650,7 @@ var Skeleton_default = Skeleton;
|
|
|
1563
1650
|
// ../../components/ui/Progress.tsx
|
|
1564
1651
|
import React8 from "react";
|
|
1565
1652
|
import { Check as Check2, X as X2, Clock } from "lucide-react";
|
|
1566
|
-
import { Fragment as Fragment2, jsx as
|
|
1653
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1567
1654
|
var variantStyles2 = {
|
|
1568
1655
|
default: "bg-muted-foreground",
|
|
1569
1656
|
primary: "bg-gradient-to-r from-primary via-primary/90 to-primary",
|
|
@@ -1598,26 +1685,26 @@ var Progress = ({
|
|
|
1598
1685
|
const labelId = React8.useId();
|
|
1599
1686
|
const descId = React8.useId();
|
|
1600
1687
|
const getStatusIcon = () => {
|
|
1601
|
-
if (isComplete) return /* @__PURE__ */
|
|
1602
|
-
if (isError) return /* @__PURE__ */
|
|
1603
|
-
if (animated || indeterminate) return /* @__PURE__ */
|
|
1688
|
+
if (isComplete) return /* @__PURE__ */ jsx12(Check2, { className: "w-4 h-4 text-success" });
|
|
1689
|
+
if (isError) return /* @__PURE__ */ jsx12(X2, { className: "w-4 h-4 text-destructive" });
|
|
1690
|
+
if (animated || indeterminate) return /* @__PURE__ */ jsx12(Clock, { className: "w-4 h-4 text-muted-foreground animate-spin" });
|
|
1604
1691
|
return null;
|
|
1605
1692
|
};
|
|
1606
1693
|
return /* @__PURE__ */ jsxs10("div", { className: cn("w-full space-y-3", className), children: [
|
|
1607
1694
|
(label || showValue || description) && /* @__PURE__ */ jsxs10("div", { className: "space-y-1", children: [
|
|
1608
1695
|
/* @__PURE__ */ jsxs10("div", { className: "flex justify-between items-center", children: [
|
|
1609
1696
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
1610
|
-
label && /* @__PURE__ */
|
|
1697
|
+
label && /* @__PURE__ */ jsx12("span", { id: labelId, className: "font-medium text-foreground", children: label }),
|
|
1611
1698
|
getStatusIcon()
|
|
1612
1699
|
] }),
|
|
1613
|
-
showValue && !indeterminate && /* @__PURE__ */
|
|
1700
|
+
showValue && !indeterminate && /* @__PURE__ */ jsx12("span", { className: cn(
|
|
1614
1701
|
"text-sm font-medium",
|
|
1615
1702
|
isComplete ? "text-success" : isError ? "text-destructive" : "text-muted-foreground"
|
|
1616
1703
|
), children: isComplete ? "Complete" : isError ? "Error" : `${Math.round(percentage)}%` })
|
|
1617
1704
|
] }),
|
|
1618
|
-
description && /* @__PURE__ */
|
|
1705
|
+
description && /* @__PURE__ */ jsx12("p", { id: descId, className: "text-sm text-muted-foreground", children: description })
|
|
1619
1706
|
] }),
|
|
1620
|
-
/* @__PURE__ */
|
|
1707
|
+
/* @__PURE__ */ jsx12(
|
|
1621
1708
|
"div",
|
|
1622
1709
|
{
|
|
1623
1710
|
role: "progressbar",
|
|
@@ -1631,7 +1718,7 @@ var Progress = ({
|
|
|
1631
1718
|
"border border-border/50",
|
|
1632
1719
|
sizeStyles2[size]
|
|
1633
1720
|
),
|
|
1634
|
-
children: /* @__PURE__ */
|
|
1721
|
+
children: /* @__PURE__ */ jsx12(
|
|
1635
1722
|
"div",
|
|
1636
1723
|
{
|
|
1637
1724
|
className: cn(
|
|
@@ -1684,8 +1771,8 @@ var CircularProgress = ({
|
|
|
1684
1771
|
info: "stroke-info"
|
|
1685
1772
|
};
|
|
1686
1773
|
const getContentIcon = () => {
|
|
1687
|
-
if (isComplete) return /* @__PURE__ */
|
|
1688
|
-
if (isError) return /* @__PURE__ */
|
|
1774
|
+
if (isComplete) return /* @__PURE__ */ jsx12(Check2, { className: "w-5 h-5 text-success" });
|
|
1775
|
+
if (isError) return /* @__PURE__ */ jsx12(X2, { className: "w-5 h-5 text-destructive" });
|
|
1689
1776
|
return null;
|
|
1690
1777
|
};
|
|
1691
1778
|
return /* @__PURE__ */ jsxs10(
|
|
@@ -1709,7 +1796,7 @@ var CircularProgress = ({
|
|
|
1709
1796
|
),
|
|
1710
1797
|
style: { animationDuration: indeterminate ? "2s" : void 0 },
|
|
1711
1798
|
children: [
|
|
1712
|
-
/* @__PURE__ */
|
|
1799
|
+
/* @__PURE__ */ jsx12(
|
|
1713
1800
|
"circle",
|
|
1714
1801
|
{
|
|
1715
1802
|
cx: size / 2,
|
|
@@ -1721,7 +1808,7 @@ var CircularProgress = ({
|
|
|
1721
1808
|
className: trackColor
|
|
1722
1809
|
}
|
|
1723
1810
|
),
|
|
1724
|
-
/* @__PURE__ */
|
|
1811
|
+
/* @__PURE__ */ jsx12(
|
|
1725
1812
|
"circle",
|
|
1726
1813
|
{
|
|
1727
1814
|
cx: size / 2,
|
|
@@ -1745,13 +1832,13 @@ var CircularProgress = ({
|
|
|
1745
1832
|
]
|
|
1746
1833
|
}
|
|
1747
1834
|
),
|
|
1748
|
-
/* @__PURE__ */
|
|
1835
|
+
/* @__PURE__ */ jsx12("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center", children: children ? children : /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
1749
1836
|
getContentIcon(),
|
|
1750
|
-
showValue && !indeterminate && /* @__PURE__ */
|
|
1837
|
+
showValue && !indeterminate && /* @__PURE__ */ jsx12("span", { className: cn(
|
|
1751
1838
|
"text-sm font-semibold",
|
|
1752
1839
|
isComplete ? "text-success" : isError ? "text-destructive" : "text-foreground"
|
|
1753
1840
|
), children: isComplete ? "\u2713" : isError ? "\u2717" : `${Math.round(percentage)}%` }),
|
|
1754
|
-
indeterminate && /* @__PURE__ */
|
|
1841
|
+
indeterminate && /* @__PURE__ */ jsx12(Clock, { className: "w-4 h-4 text-muted-foreground animate-pulse" })
|
|
1755
1842
|
] }) })
|
|
1756
1843
|
]
|
|
1757
1844
|
}
|
|
@@ -1774,10 +1861,10 @@ var StepProgress = ({
|
|
|
1774
1861
|
if (stepIndex === currentStep) return "current";
|
|
1775
1862
|
return "upcoming";
|
|
1776
1863
|
};
|
|
1777
|
-
return /* @__PURE__ */
|
|
1864
|
+
return /* @__PURE__ */ jsx12("div", { className: cn("w-full", className), role: "list", "aria-label": "Progress steps", children: /* @__PURE__ */ jsx12("div", { className: "flex items-center justify-between", children: steps.map((step, index) => {
|
|
1778
1865
|
const status = getStepStatus(index);
|
|
1779
1866
|
return /* @__PURE__ */ jsxs10("div", { className: "flex items-center", role: "listitem", "aria-current": status === "current" ? "step" : void 0, children: [
|
|
1780
|
-
/* @__PURE__ */
|
|
1867
|
+
/* @__PURE__ */ jsx12(
|
|
1781
1868
|
"div",
|
|
1782
1869
|
{
|
|
1783
1870
|
className: cn(
|
|
@@ -1798,10 +1885,10 @@ var StepProgress = ({
|
|
|
1798
1885
|
"hover:border-muted-foreground/50"
|
|
1799
1886
|
]
|
|
1800
1887
|
),
|
|
1801
|
-
children: status === "completed" ? /* @__PURE__ */
|
|
1888
|
+
children: status === "completed" ? /* @__PURE__ */ jsx12(Check2, { className: "w-3 h-3" }) : index + 1
|
|
1802
1889
|
}
|
|
1803
1890
|
),
|
|
1804
|
-
/* @__PURE__ */
|
|
1891
|
+
/* @__PURE__ */ jsx12(
|
|
1805
1892
|
"span",
|
|
1806
1893
|
{
|
|
1807
1894
|
className: cn(
|
|
@@ -1813,7 +1900,7 @@ var StepProgress = ({
|
|
|
1813
1900
|
children: step
|
|
1814
1901
|
}
|
|
1815
1902
|
),
|
|
1816
|
-
index < steps.length - 1 && /* @__PURE__ */
|
|
1903
|
+
index < steps.length - 1 && /* @__PURE__ */ jsx12(
|
|
1817
1904
|
"div",
|
|
1818
1905
|
{
|
|
1819
1906
|
className: cn(
|
|
@@ -1834,7 +1921,7 @@ var MiniProgress = ({
|
|
|
1834
1921
|
}) => {
|
|
1835
1922
|
const percentage = Math.min(Math.max(value / max * 100, 0), 100);
|
|
1836
1923
|
return /* @__PURE__ */ jsxs10("div", { className: cn("flex items-center gap-2", className), children: [
|
|
1837
|
-
/* @__PURE__ */
|
|
1924
|
+
/* @__PURE__ */ jsx12(
|
|
1838
1925
|
"div",
|
|
1839
1926
|
{
|
|
1840
1927
|
className: "flex-1 h-1.5 bg-muted/50 rounded-full overflow-hidden",
|
|
@@ -1842,7 +1929,7 @@ var MiniProgress = ({
|
|
|
1842
1929
|
"aria-valuemin": 0,
|
|
1843
1930
|
"aria-valuemax": max,
|
|
1844
1931
|
"aria-valuenow": Math.round(percentage),
|
|
1845
|
-
children: /* @__PURE__ */
|
|
1932
|
+
children: /* @__PURE__ */ jsx12(
|
|
1846
1933
|
"div",
|
|
1847
1934
|
{
|
|
1848
1935
|
className: cn(
|
|
@@ -1877,8 +1964,8 @@ var BatteryProgress = ({
|
|
|
1877
1964
|
return /* @__PURE__ */ jsxs10("div", { className: cn("flex items-center gap-2", className), children: [
|
|
1878
1965
|
/* @__PURE__ */ jsxs10("div", { className: "relative", role: "progressbar", "aria-label": "Battery level", "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": Math.round(percentage), children: [
|
|
1879
1966
|
/* @__PURE__ */ jsxs10("div", { className: "w-6 h-3 border-2 border-foreground/20 rounded-sm relative", children: [
|
|
1880
|
-
/* @__PURE__ */
|
|
1881
|
-
/* @__PURE__ */
|
|
1967
|
+
/* @__PURE__ */ jsx12("div", { className: "absolute -right-1 top-0.5 w-0.5 h-1 bg-foreground/20 rounded-r-sm" }),
|
|
1968
|
+
/* @__PURE__ */ jsx12(
|
|
1882
1969
|
"div",
|
|
1883
1970
|
{
|
|
1884
1971
|
className: cn(
|
|
@@ -1890,7 +1977,7 @@ var BatteryProgress = ({
|
|
|
1890
1977
|
}
|
|
1891
1978
|
)
|
|
1892
1979
|
] }),
|
|
1893
|
-
charging && /* @__PURE__ */
|
|
1980
|
+
charging && /* @__PURE__ */ jsx12("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx12("div", { className: "w-2 h-2 text-info-foreground", children: "\u26A1" }) })
|
|
1894
1981
|
] }),
|
|
1895
1982
|
showValue && /* @__PURE__ */ jsxs10("span", { className: cn(
|
|
1896
1983
|
"text-xs font-medium",
|
|
@@ -1913,7 +2000,7 @@ var SegmentedProgress = ({
|
|
|
1913
2000
|
md: "h-2",
|
|
1914
2001
|
lg: "h-3"
|
|
1915
2002
|
};
|
|
1916
|
-
return /* @__PURE__ */
|
|
2003
|
+
return /* @__PURE__ */ jsx12(
|
|
1917
2004
|
"div",
|
|
1918
2005
|
{
|
|
1919
2006
|
className: cn("flex gap-1", className),
|
|
@@ -1921,7 +2008,7 @@ var SegmentedProgress = ({
|
|
|
1921
2008
|
"aria-valuemin": 0,
|
|
1922
2009
|
"aria-valuemax": segments,
|
|
1923
2010
|
"aria-valuenow": activeSegments,
|
|
1924
|
-
children: Array.from({ length: segments }, (_, index) => /* @__PURE__ */
|
|
2011
|
+
children: Array.from({ length: segments }, (_, index) => /* @__PURE__ */ jsx12(
|
|
1925
2012
|
"div",
|
|
1926
2013
|
{
|
|
1927
2014
|
className: cn(
|
|
@@ -1949,13 +2036,13 @@ var LoadingProgress = ({
|
|
|
1949
2036
|
const getStatusIcon = () => {
|
|
1950
2037
|
switch (status) {
|
|
1951
2038
|
case "complete":
|
|
1952
|
-
return /* @__PURE__ */
|
|
2039
|
+
return /* @__PURE__ */ jsx12(Check2, { className: "w-4 h-4 text-success" });
|
|
1953
2040
|
case "error":
|
|
1954
|
-
return /* @__PURE__ */
|
|
2041
|
+
return /* @__PURE__ */ jsx12(X2, { className: "w-4 h-4 text-destructive" });
|
|
1955
2042
|
case "paused":
|
|
1956
|
-
return /* @__PURE__ */
|
|
2043
|
+
return /* @__PURE__ */ jsx12(Clock, { className: "w-4 h-4 text-warning" });
|
|
1957
2044
|
default:
|
|
1958
|
-
return /* @__PURE__ */
|
|
2045
|
+
return /* @__PURE__ */ jsx12("div", { className: "w-2 h-2 bg-primary rounded-full animate-bounce" });
|
|
1959
2046
|
}
|
|
1960
2047
|
};
|
|
1961
2048
|
const getStatusColor = () => {
|
|
@@ -1974,11 +2061,11 @@ var LoadingProgress = ({
|
|
|
1974
2061
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between text-sm", children: [
|
|
1975
2062
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
1976
2063
|
getStatusIcon(),
|
|
1977
|
-
label && /* @__PURE__ */
|
|
2064
|
+
label && /* @__PURE__ */ jsx12("span", { className: "font-medium text-foreground", children: label })
|
|
1978
2065
|
] }),
|
|
1979
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground", children: status === "complete" ? "Complete" : `${Math.round(percentage)}%` })
|
|
1980
2067
|
] }),
|
|
1981
|
-
/* @__PURE__ */
|
|
2068
|
+
/* @__PURE__ */ jsx12(
|
|
1982
2069
|
"div",
|
|
1983
2070
|
{
|
|
1984
2071
|
className: "w-full h-2 bg-muted/50 rounded-full overflow-hidden",
|
|
@@ -1987,7 +2074,7 @@ var LoadingProgress = ({
|
|
|
1987
2074
|
"aria-valuemax": max,
|
|
1988
2075
|
"aria-valuenow": Math.round(percentage),
|
|
1989
2076
|
"aria-label": label || "Loading progress",
|
|
1990
|
-
children: /* @__PURE__ */
|
|
2077
|
+
children: /* @__PURE__ */ jsx12(
|
|
1991
2078
|
"div",
|
|
1992
2079
|
{
|
|
1993
2080
|
className: cn(
|
|
@@ -2001,8 +2088,8 @@ var LoadingProgress = ({
|
|
|
2001
2088
|
}
|
|
2002
2089
|
),
|
|
2003
2090
|
(speed || timeRemaining) && /* @__PURE__ */ jsxs10("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
|
|
2004
|
-
speed && /* @__PURE__ */
|
|
2005
|
-
timeRemaining && /* @__PURE__ */
|
|
2091
|
+
speed && /* @__PURE__ */ jsx12("span", { children: speed }),
|
|
2092
|
+
timeRemaining && /* @__PURE__ */ jsx12("span", { children: timeRemaining })
|
|
2006
2093
|
] })
|
|
2007
2094
|
] });
|
|
2008
2095
|
};
|
|
@@ -2011,7 +2098,7 @@ var LoadingProgress = ({
|
|
|
2011
2098
|
import * as React9 from "react";
|
|
2012
2099
|
import { createPortal } from "react-dom";
|
|
2013
2100
|
import { X as X3 } from "lucide-react";
|
|
2014
|
-
import { jsx as
|
|
2101
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2015
2102
|
var sizeStyles3 = {
|
|
2016
2103
|
sm: "max-w-sm",
|
|
2017
2104
|
md: "max-w-md",
|
|
@@ -2083,7 +2170,7 @@ var Modal = ({
|
|
|
2083
2170
|
return null;
|
|
2084
2171
|
}
|
|
2085
2172
|
const modalContent = /* @__PURE__ */ jsxs11("div", { className: cn("fixed inset-0 z-[9999] flex items-center justify-center", overlayClassName), onClick: handleOverlayClick, children: [
|
|
2086
|
-
/* @__PURE__ */
|
|
2173
|
+
/* @__PURE__ */ jsx13(
|
|
2087
2174
|
"div",
|
|
2088
2175
|
{
|
|
2089
2176
|
className: "absolute inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-200 ease-out",
|
|
@@ -2111,10 +2198,10 @@ var Modal = ({
|
|
|
2111
2198
|
children: [
|
|
2112
2199
|
(title || description || showCloseButton) && /* @__PURE__ */ jsxs11("div", { className: "flex items-start justify-between p-6 pb-0", children: [
|
|
2113
2200
|
/* @__PURE__ */ jsxs11("div", { className: "space-y-1.5", children: [
|
|
2114
|
-
title && /* @__PURE__ */
|
|
2115
|
-
description && /* @__PURE__ */
|
|
2201
|
+
title && /* @__PURE__ */ jsx13("h2", { className: "text-lg font-semibold leading-none tracking-tight", children: title }),
|
|
2202
|
+
description && /* @__PURE__ */ jsx13("p", { className: "text-sm text-muted-foreground", children: description })
|
|
2116
2203
|
] }),
|
|
2117
|
-
showCloseButton && /* @__PURE__ */
|
|
2204
|
+
showCloseButton && /* @__PURE__ */ jsx13(
|
|
2118
2205
|
"button",
|
|
2119
2206
|
{
|
|
2120
2207
|
onClick: onClose,
|
|
@@ -2123,11 +2210,11 @@ var Modal = ({
|
|
|
2123
2210
|
"hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
2124
2211
|
"disabled:pointer-events-none "
|
|
2125
2212
|
),
|
|
2126
|
-
children: /* @__PURE__ */
|
|
2213
|
+
children: /* @__PURE__ */ jsx13(X3, { className: "h-4 w-4 cursor-pointer" })
|
|
2127
2214
|
}
|
|
2128
2215
|
)
|
|
2129
2216
|
] }),
|
|
2130
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsx13("div", { className: "p-6", children })
|
|
2131
2218
|
]
|
|
2132
2219
|
}
|
|
2133
2220
|
)
|
|
@@ -2137,9 +2224,9 @@ var Modal = ({
|
|
|
2137
2224
|
var Modal_default = Modal;
|
|
2138
2225
|
|
|
2139
2226
|
// ../../components/ui/Toast.tsx
|
|
2140
|
-
import { createContext, useContext, useState as
|
|
2227
|
+
import { createContext, useContext, useState as useState8, useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
2141
2228
|
import { X as X4, CheckCircle as CheckCircle2, AlertCircle as AlertCircle2, Info, AlertTriangle as AlertTriangle2 } from "lucide-react";
|
|
2142
|
-
import { jsx as
|
|
2229
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2143
2230
|
var ToastContext = createContext(void 0);
|
|
2144
2231
|
var useToast = () => {
|
|
2145
2232
|
const context = useContext(ToastContext);
|
|
@@ -2153,7 +2240,7 @@ var ToastProvider = ({
|
|
|
2153
2240
|
position = "top-right",
|
|
2154
2241
|
maxToasts = 5
|
|
2155
2242
|
}) => {
|
|
2156
|
-
const [toasts, setToasts] =
|
|
2243
|
+
const [toasts, setToasts] = useState8([]);
|
|
2157
2244
|
const idRef = useRef2(0);
|
|
2158
2245
|
const removeToast = useCallback2((id) => {
|
|
2159
2246
|
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
@@ -2181,17 +2268,17 @@ var ToastProvider = ({
|
|
|
2181
2268
|
};
|
|
2182
2269
|
return /* @__PURE__ */ jsxs12(ToastContext.Provider, { value: { addToast, removeToast, toasts }, children: [
|
|
2183
2270
|
children,
|
|
2184
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ jsx14("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__ */ jsx14(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
|
|
2185
2272
|
] });
|
|
2186
2273
|
};
|
|
2187
2274
|
var ToastComponent = ({ toast, onRemove }) => {
|
|
2188
|
-
const [isVisible, setIsVisible] =
|
|
2189
|
-
const [progress, setProgress] =
|
|
2190
|
-
const [paused, setPaused] =
|
|
2191
|
-
const [startTs] =
|
|
2275
|
+
const [isVisible, setIsVisible] = useState8(false);
|
|
2276
|
+
const [progress, setProgress] = useState8(100);
|
|
2277
|
+
const [paused, setPaused] = useState8(false);
|
|
2278
|
+
const [startTs] = useState8(() => Date.now());
|
|
2192
2279
|
const total = toast.duration && toast.duration > 0 ? toast.duration : 5e3;
|
|
2193
|
-
const [remaining, setRemaining] =
|
|
2194
|
-
|
|
2280
|
+
const [remaining, setRemaining] = useState8(total);
|
|
2281
|
+
useEffect2(() => {
|
|
2195
2282
|
setIsVisible(true);
|
|
2196
2283
|
if (toast.duration === 0) return;
|
|
2197
2284
|
let raf;
|
|
@@ -2254,11 +2341,11 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2254
2341
|
onMouseLeave: () => setPaused(false),
|
|
2255
2342
|
children: [
|
|
2256
2343
|
/* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-3 p-4", children: [
|
|
2257
|
-
/* @__PURE__ */
|
|
2344
|
+
/* @__PURE__ */ jsx14(Icon, { className: cn("h-5 w-5 mt-0.5 shrink-0", config.iconClassName) }),
|
|
2258
2345
|
/* @__PURE__ */ jsxs12("div", { className: "flex-1 space-y-1", children: [
|
|
2259
|
-
toast.title && /* @__PURE__ */
|
|
2260
|
-
/* @__PURE__ */
|
|
2261
|
-
toast.action && /* @__PURE__ */
|
|
2346
|
+
toast.title && /* @__PURE__ */ jsx14("h4", { className: "font-medium text-sm leading-none", children: toast.title }),
|
|
2347
|
+
/* @__PURE__ */ jsx14("p", { className: "text-sm text-muted-foreground leading-relaxed", children: toast.message }),
|
|
2348
|
+
toast.action && /* @__PURE__ */ jsx14(
|
|
2262
2349
|
"button",
|
|
2263
2350
|
{
|
|
2264
2351
|
onClick: () => {
|
|
@@ -2270,7 +2357,7 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2270
2357
|
}
|
|
2271
2358
|
)
|
|
2272
2359
|
] }),
|
|
2273
|
-
(toast.dismissible ?? true) && /* @__PURE__ */
|
|
2360
|
+
(toast.dismissible ?? true) && /* @__PURE__ */ jsx14(
|
|
2274
2361
|
"button",
|
|
2275
2362
|
{
|
|
2276
2363
|
onClick: handleRemove,
|
|
@@ -2279,11 +2366,11 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2279
2366
|
"transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-primary/50"
|
|
2280
2367
|
),
|
|
2281
2368
|
"aria-label": "Close toast",
|
|
2282
|
-
children: /* @__PURE__ */
|
|
2369
|
+
children: /* @__PURE__ */ jsx14(X4, { className: "h-4 w-4" })
|
|
2283
2370
|
}
|
|
2284
2371
|
)
|
|
2285
2372
|
] }),
|
|
2286
|
-
toast.duration !== 0 && /* @__PURE__ */
|
|
2373
|
+
toast.duration !== 0 && /* @__PURE__ */ jsx14("div", { className: "absolute left-0 right-0 bottom-0 h-1 bg-transparent", children: /* @__PURE__ */ jsx14(
|
|
2287
2374
|
"div",
|
|
2288
2375
|
{
|
|
2289
2376
|
className: cn(
|
|
@@ -2305,7 +2392,7 @@ var Toast_default = ToastProvider;
|
|
|
2305
2392
|
// ../../components/ui/Tooltip.tsx
|
|
2306
2393
|
import * as React11 from "react";
|
|
2307
2394
|
import { createPortal as createPortal2 } from "react-dom";
|
|
2308
|
-
import { Fragment as Fragment3, jsx as
|
|
2395
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2309
2396
|
var variantStyles3 = {
|
|
2310
2397
|
default: "bg-popover text-popover-foreground border-border",
|
|
2311
2398
|
info: "bg-info text-info-foreground border-info/20",
|
|
@@ -2400,7 +2487,7 @@ var Tooltip = ({
|
|
|
2400
2487
|
onBlur: handleBlur
|
|
2401
2488
|
}),
|
|
2402
2489
|
isMounted && isOpen && position && createPortal2(
|
|
2403
|
-
/* @__PURE__ */
|
|
2490
|
+
/* @__PURE__ */ jsx15(
|
|
2404
2491
|
"div",
|
|
2405
2492
|
{
|
|
2406
2493
|
style: {
|
|
@@ -2531,7 +2618,7 @@ var useShadCNAnimations = () => {
|
|
|
2531
2618
|
};
|
|
2532
2619
|
|
|
2533
2620
|
// ../../components/ui/Popover.tsx
|
|
2534
|
-
import { Fragment as Fragment4, jsx as
|
|
2621
|
+
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2535
2622
|
var Popover = ({
|
|
2536
2623
|
trigger,
|
|
2537
2624
|
children,
|
|
@@ -2643,7 +2730,7 @@ var Popover = ({
|
|
|
2643
2730
|
setIsOpen(next);
|
|
2644
2731
|
}
|
|
2645
2732
|
};
|
|
2646
|
-
const popoverContent = isOpen && dropdownPosition ? /* @__PURE__ */
|
|
2733
|
+
const popoverContent = isOpen && dropdownPosition ? /* @__PURE__ */ jsx16(
|
|
2647
2734
|
"div",
|
|
2648
2735
|
{
|
|
2649
2736
|
"data-popover": true,
|
|
@@ -2664,7 +2751,7 @@ var Popover = ({
|
|
|
2664
2751
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
2665
2752
|
className
|
|
2666
2753
|
),
|
|
2667
|
-
children: /* @__PURE__ */
|
|
2754
|
+
children: /* @__PURE__ */ jsx16(
|
|
2668
2755
|
"div",
|
|
2669
2756
|
{
|
|
2670
2757
|
className: cn(
|
|
@@ -2707,7 +2794,7 @@ var Popover = ({
|
|
|
2707
2794
|
import * as React13 from "react";
|
|
2708
2795
|
import { createPortal as createPortal4 } from "react-dom";
|
|
2709
2796
|
import { X as X5 } from "lucide-react";
|
|
2710
|
-
import { jsx as
|
|
2797
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2711
2798
|
var sizeStyles4 = {
|
|
2712
2799
|
sm: {
|
|
2713
2800
|
right: "w-[300px]",
|
|
@@ -2835,7 +2922,7 @@ var Sheet = ({
|
|
|
2835
2922
|
};
|
|
2836
2923
|
if (!mounted || !open && !isVisible) return null;
|
|
2837
2924
|
const sheetContent = /* @__PURE__ */ jsxs15("div", { className: "fixed inset-0 z-50", children: [
|
|
2838
|
-
/* @__PURE__ */
|
|
2925
|
+
/* @__PURE__ */ jsx17(
|
|
2839
2926
|
"div",
|
|
2840
2927
|
{
|
|
2841
2928
|
className: cn(
|
|
@@ -2868,14 +2955,14 @@ var Sheet = ({
|
|
|
2868
2955
|
transition: "transform 300ms cubic-bezier(0.4, 0, 0.2, 1)"
|
|
2869
2956
|
},
|
|
2870
2957
|
children: [
|
|
2871
|
-
(title || description || header || showClose) && /* @__PURE__ */
|
|
2958
|
+
(title || description || header || showClose) && /* @__PURE__ */ jsx17("div", { className: "flex-shrink-0 border-b border-border", children: header || /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between p-4", children: [
|
|
2872
2959
|
/* @__PURE__ */ jsxs15("div", { className: "flex-1", children: [
|
|
2873
|
-
title && /* @__PURE__ */
|
|
2874
|
-
description && /* @__PURE__ */
|
|
2960
|
+
title && /* @__PURE__ */ jsx17("h2", { className: "text-lg font-semibold text-foreground", children: title }),
|
|
2961
|
+
description && /* @__PURE__ */ jsx17("p", { className: "text-sm text-muted-foreground mt-1", children: description })
|
|
2875
2962
|
] }),
|
|
2876
|
-
showClose && /* @__PURE__ */
|
|
2963
|
+
showClose && /* @__PURE__ */ jsx17(Button_default, { variant: "ghost", size: "sm", onClick: handleClose, className: "h-8 w-8 p-0 rounded-md cursor-pointer", icon: X5 })
|
|
2877
2964
|
] }) }),
|
|
2878
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ jsx17(
|
|
2879
2966
|
"div",
|
|
2880
2967
|
{
|
|
2881
2968
|
className: "flex-1 overflow-auto p-4",
|
|
@@ -2887,7 +2974,7 @@ var Sheet = ({
|
|
|
2887
2974
|
children
|
|
2888
2975
|
}
|
|
2889
2976
|
),
|
|
2890
|
-
footer && /* @__PURE__ */
|
|
2977
|
+
footer && /* @__PURE__ */ jsx17("div", { className: "flex-shrink-0 border-t border-border p-4", children: footer })
|
|
2891
2978
|
]
|
|
2892
2979
|
}
|
|
2893
2980
|
)
|
|
@@ -2895,38 +2982,38 @@ var Sheet = ({
|
|
|
2895
2982
|
return typeof window !== "undefined" ? createPortal4(sheetContent, document.body) : null;
|
|
2896
2983
|
};
|
|
2897
2984
|
var Drawer = ({ placement = "right", ...props }) => {
|
|
2898
|
-
return /* @__PURE__ */
|
|
2985
|
+
return /* @__PURE__ */ jsx17(Sheet, { ...props, side: placement, variant: "overlay" });
|
|
2899
2986
|
};
|
|
2900
2987
|
var SlideOver = (props) => {
|
|
2901
|
-
return /* @__PURE__ */
|
|
2988
|
+
return /* @__PURE__ */ jsx17(Sheet, { ...props, side: "right", variant: "overlay", size: "lg" });
|
|
2902
2989
|
};
|
|
2903
2990
|
var BottomSheet = ({ snapPoints = ["25%", "50%", "90%"], defaultSnap = 1, ...props }) => {
|
|
2904
|
-
return /* @__PURE__ */
|
|
2991
|
+
return /* @__PURE__ */ jsx17(Sheet, { ...props, side: "bottom", variant: "overlay", className: cn("rounded-t-lg", props.className) });
|
|
2905
2992
|
};
|
|
2906
2993
|
var SidebarSheet = ({ navigation, children, ...props }) => {
|
|
2907
2994
|
return /* @__PURE__ */ jsxs15(Sheet, { ...props, side: "left", variant: "push", size: "md", children: [
|
|
2908
|
-
navigation && /* @__PURE__ */
|
|
2995
|
+
navigation && /* @__PURE__ */ jsx17("div", { className: "border-b border-border pb-4 mb-4", children: navigation }),
|
|
2909
2996
|
children
|
|
2910
2997
|
] });
|
|
2911
2998
|
};
|
|
2912
2999
|
|
|
2913
3000
|
// ../../components/ui/Alert.tsx
|
|
2914
|
-
import { useState as
|
|
3001
|
+
import { useState as useState12 } from "react";
|
|
2915
3002
|
|
|
2916
3003
|
// ../../components/icons/AlertIcons.tsx
|
|
2917
3004
|
import { Info as Info2, AlertTriangle as AlertTriangle3, CheckCircle2 as CheckCircle22, OctagonX } from "lucide-react";
|
|
2918
|
-
import { jsx as
|
|
3005
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2919
3006
|
function InfoIcon(props) {
|
|
2920
|
-
return /* @__PURE__ */
|
|
3007
|
+
return /* @__PURE__ */ jsx18(Info2, { "aria-hidden": true, className: props.className });
|
|
2921
3008
|
}
|
|
2922
3009
|
function WarningIcon(props) {
|
|
2923
|
-
return /* @__PURE__ */
|
|
3010
|
+
return /* @__PURE__ */ jsx18(AlertTriangle3, { "aria-hidden": true, className: props.className });
|
|
2924
3011
|
}
|
|
2925
3012
|
function CheckCircleIcon(props) {
|
|
2926
|
-
return /* @__PURE__ */
|
|
3013
|
+
return /* @__PURE__ */ jsx18(CheckCircle22, { "aria-hidden": true, className: props.className });
|
|
2927
3014
|
}
|
|
2928
3015
|
function ErrorIcon(props) {
|
|
2929
|
-
return /* @__PURE__ */
|
|
3016
|
+
return /* @__PURE__ */ jsx18(OctagonX, { "aria-hidden": true, className: props.className });
|
|
2930
3017
|
}
|
|
2931
3018
|
|
|
2932
3019
|
// ../../components/ui/Alert.tsx
|
|
@@ -2944,16 +3031,16 @@ var VARIANT_STYLES_ALERT = {
|
|
|
2944
3031
|
};
|
|
2945
3032
|
|
|
2946
3033
|
// ../../components/ui/Alert.tsx
|
|
2947
|
-
import { jsx as
|
|
3034
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2948
3035
|
var variantIcons = {
|
|
2949
|
-
default: /* @__PURE__ */
|
|
2950
|
-
info: /* @__PURE__ */
|
|
2951
|
-
success: /* @__PURE__ */
|
|
2952
|
-
warning: /* @__PURE__ */
|
|
2953
|
-
error: /* @__PURE__ */
|
|
3036
|
+
default: /* @__PURE__ */ jsx19(InfoIcon, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3037
|
+
info: /* @__PURE__ */ jsx19(InfoIcon, { className: "h-4 w-4 text-info" }),
|
|
3038
|
+
success: /* @__PURE__ */ jsx19(CheckCircleIcon, { className: "h-4 w-4 text-success" }),
|
|
3039
|
+
warning: /* @__PURE__ */ jsx19(WarningIcon, { className: "h-4 w-4 text-warning" }),
|
|
3040
|
+
error: /* @__PURE__ */ jsx19(ErrorIcon, { className: "h-4 w-4 text-destructive" })
|
|
2954
3041
|
};
|
|
2955
3042
|
var Alert = ({ title, description, variant = "default", className, icon, dismissible = false, onClose, actions, closeAriaLabel }) => {
|
|
2956
|
-
const [open, setOpen] =
|
|
3043
|
+
const [open, setOpen] = useState12(true);
|
|
2957
3044
|
const t = useTranslations2("Common");
|
|
2958
3045
|
if (!open) return null;
|
|
2959
3046
|
const handleClose = () => {
|
|
@@ -2967,19 +3054,19 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
2967
3054
|
role: "alert",
|
|
2968
3055
|
"aria-live": variant === "error" ? "assertive" : "polite",
|
|
2969
3056
|
children: [
|
|
2970
|
-
/* @__PURE__ */
|
|
3057
|
+
/* @__PURE__ */ jsx19("div", { className: "pt-1", children: icon ?? variantIcons[variant] }),
|
|
2971
3058
|
/* @__PURE__ */ jsxs16("div", { className: "flex-1 min-w-0", children: [
|
|
2972
|
-
title && /* @__PURE__ */
|
|
2973
|
-
description && (typeof description === "string" ? /* @__PURE__ */
|
|
2974
|
-
actions && /* @__PURE__ */
|
|
3059
|
+
title && /* @__PURE__ */ jsx19("p", { className: "font-semibold text-sm leading-none mb-1 text-foreground", children: title }),
|
|
3060
|
+
description && (typeof description === "string" ? /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground leading-relaxed break-words", children: description }) : /* @__PURE__ */ jsx19("div", { className: "text-sm text-muted-foreground leading-relaxed break-words", children: description })),
|
|
3061
|
+
actions && /* @__PURE__ */ jsx19("div", { className: "mt-2 flex flex-wrap gap-2", children: actions })
|
|
2975
3062
|
] }),
|
|
2976
|
-
dismissible && /* @__PURE__ */
|
|
3063
|
+
dismissible && /* @__PURE__ */ jsx19(
|
|
2977
3064
|
"button",
|
|
2978
3065
|
{
|
|
2979
3066
|
onClick: handleClose,
|
|
2980
3067
|
className: "rounded-md p-1 hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
2981
3068
|
"aria-label": closeAriaLabel || t("closeAlert"),
|
|
2982
|
-
children: /* @__PURE__ */
|
|
3069
|
+
children: /* @__PURE__ */ jsx19(X6, { className: "h-4 w-4" })
|
|
2983
3070
|
}
|
|
2984
3071
|
)
|
|
2985
3072
|
]
|
|
@@ -2989,7 +3076,7 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
2989
3076
|
var Alert_default = Alert;
|
|
2990
3077
|
|
|
2991
3078
|
// ../../components/ui/GlobalLoading.tsx
|
|
2992
|
-
import React14, { useEffect as
|
|
3079
|
+
import React14, { useEffect as useEffect6, useState as useState13 } from "react";
|
|
2993
3080
|
import { Activity as Activity2 } from "lucide-react";
|
|
2994
3081
|
|
|
2995
3082
|
// ../../lib/utils/loading.ts
|
|
@@ -3035,20 +3122,20 @@ var loading = new LoadingManager();
|
|
|
3035
3122
|
|
|
3036
3123
|
// ../../components/ui/GlobalLoading.tsx
|
|
3037
3124
|
import { useTranslations as useTranslations3 } from "next-intl";
|
|
3038
|
-
import { jsx as
|
|
3125
|
+
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3039
3126
|
var GlobalLoading = ({
|
|
3040
3127
|
className,
|
|
3041
3128
|
backdrop = true,
|
|
3042
3129
|
position = "fixed",
|
|
3043
3130
|
size = "lg"
|
|
3044
3131
|
}) => {
|
|
3045
|
-
const [state, setState] =
|
|
3046
|
-
|
|
3132
|
+
const [state, setState] = useState13(() => loading.getState());
|
|
3133
|
+
useEffect6(() => {
|
|
3047
3134
|
const unsubscribe = loading.subscribe(setState);
|
|
3048
3135
|
return unsubscribe;
|
|
3049
3136
|
}, []);
|
|
3050
3137
|
if (!state.isVisible) return null;
|
|
3051
|
-
return /* @__PURE__ */
|
|
3138
|
+
return /* @__PURE__ */ jsx20(
|
|
3052
3139
|
"div",
|
|
3053
3140
|
{
|
|
3054
3141
|
className: cn(
|
|
@@ -3061,8 +3148,8 @@ var GlobalLoading = ({
|
|
|
3061
3148
|
"aria-modal": true,
|
|
3062
3149
|
"aria-label": "Loading",
|
|
3063
3150
|
children: /* @__PURE__ */ jsxs17("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: [
|
|
3064
|
-
/* @__PURE__ */
|
|
3065
|
-
state.text && /* @__PURE__ */
|
|
3151
|
+
/* @__PURE__ */ jsx20(Activity2, { className: "w-6 h-6 animate-spin text-primary-background", "aria-hidden": true }),
|
|
3152
|
+
state.text && /* @__PURE__ */ jsx20("span", { className: "text-base font-medium text-foreground", children: state.text })
|
|
3066
3153
|
] })
|
|
3067
3154
|
}
|
|
3068
3155
|
);
|
|
@@ -3073,14 +3160,14 @@ var PageLoading = ({
|
|
|
3073
3160
|
}) => {
|
|
3074
3161
|
const t = useTranslations3("Loading");
|
|
3075
3162
|
const defaultMessage = message || t("loadingPage");
|
|
3076
|
-
return /* @__PURE__ */
|
|
3163
|
+
return /* @__PURE__ */ jsx20("div", { className: cn(
|
|
3077
3164
|
"min-h-screen flex items-center justify-center bg-background",
|
|
3078
3165
|
className
|
|
3079
3166
|
), children: /* @__PURE__ */ jsxs17("div", { className: "text-center space-y-4", children: [
|
|
3080
|
-
/* @__PURE__ */
|
|
3167
|
+
/* @__PURE__ */ jsx20(Activity2, { className: "w-8 h-8 animate-spin text-primary mx-auto" }),
|
|
3081
3168
|
/* @__PURE__ */ jsxs17("div", { children: [
|
|
3082
|
-
/* @__PURE__ */
|
|
3083
|
-
/* @__PURE__ */
|
|
3169
|
+
/* @__PURE__ */ jsx20("p", { className: "text-lg font-medium text-foreground", children: defaultMessage }),
|
|
3170
|
+
/* @__PURE__ */ jsx20("p", { className: "text-sm text-muted-foreground mt-2", children: t("pleaseWait") })
|
|
3084
3171
|
] })
|
|
3085
3172
|
] }) });
|
|
3086
3173
|
};
|
|
@@ -3097,8 +3184,8 @@ var InlineLoading = ({
|
|
|
3097
3184
|
lg: "w-8 h-8"
|
|
3098
3185
|
};
|
|
3099
3186
|
return /* @__PURE__ */ jsxs17("div", { className: cn("flex items-center justify-center space-x-2", className), children: [
|
|
3100
|
-
/* @__PURE__ */
|
|
3101
|
-
text && /* @__PURE__ */
|
|
3187
|
+
/* @__PURE__ */ jsx20(Activity2, { className: cn("animate-spin text-primary", sizeClasses2[size]) }),
|
|
3188
|
+
text && /* @__PURE__ */ jsx20("span", { className: "text-sm text-muted-foreground animate-pulse", children: text })
|
|
3102
3189
|
] });
|
|
3103
3190
|
};
|
|
3104
3191
|
var ButtonLoading = ({
|
|
@@ -3122,10 +3209,10 @@ var ButtonLoading = ({
|
|
|
3122
3209
|
),
|
|
3123
3210
|
children: [
|
|
3124
3211
|
isLoading && /* @__PURE__ */ jsxs17("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: [
|
|
3125
|
-
/* @__PURE__ */
|
|
3126
|
-
loadingText && /* @__PURE__ */
|
|
3212
|
+
/* @__PURE__ */ jsx20(Activity2, { className: "w-4 h-4 animate-spin text-primary-foreground" }),
|
|
3213
|
+
loadingText && /* @__PURE__ */ jsx20("span", { className: "ml-2 text-sm", children: loadingText })
|
|
3127
3214
|
] }),
|
|
3128
|
-
/* @__PURE__ */
|
|
3215
|
+
/* @__PURE__ */ jsx20("div", { className: cn(isLoading && "opacity-50 pointer-events-none"), children: child })
|
|
3129
3216
|
]
|
|
3130
3217
|
}
|
|
3131
3218
|
);
|
|
@@ -3135,7 +3222,7 @@ var ButtonLoading = ({
|
|
|
3135
3222
|
import * as React15 from "react";
|
|
3136
3223
|
import Link from "next/link";
|
|
3137
3224
|
import { ChevronRight, Home, MoreHorizontal } from "lucide-react";
|
|
3138
|
-
import { jsx as
|
|
3225
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3139
3226
|
var sizeStyles5 = {
|
|
3140
3227
|
sm: {
|
|
3141
3228
|
text: "text-xs",
|
|
@@ -3182,16 +3269,16 @@ var Breadcrumb = ({
|
|
|
3182
3269
|
}, [items.length, maxItems, collapsible]);
|
|
3183
3270
|
const getSeparator = () => {
|
|
3184
3271
|
if (typeof separator === "string") {
|
|
3185
|
-
return /* @__PURE__ */
|
|
3272
|
+
return /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: separator });
|
|
3186
3273
|
}
|
|
3187
3274
|
if (variant === "slash") {
|
|
3188
|
-
return /* @__PURE__ */
|
|
3275
|
+
return /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "/" });
|
|
3189
3276
|
}
|
|
3190
3277
|
if (variant === "arrow") {
|
|
3191
|
-
return /* @__PURE__ */
|
|
3278
|
+
return /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "\u2192" });
|
|
3192
3279
|
}
|
|
3193
3280
|
const SeparatorComponent = separator;
|
|
3194
|
-
return /* @__PURE__ */
|
|
3281
|
+
return /* @__PURE__ */ jsx21(SeparatorComponent, { className: cn("text-muted-foreground", sizeStyles5[size].icon) });
|
|
3195
3282
|
};
|
|
3196
3283
|
const processedItems = React15.useMemo(() => {
|
|
3197
3284
|
let finalItems = [...items];
|
|
@@ -3212,17 +3299,17 @@ var Breadcrumb = ({
|
|
|
3212
3299
|
const handleCollapseToggle = () => {
|
|
3213
3300
|
setIsCollapsed(!isCollapsed);
|
|
3214
3301
|
};
|
|
3215
|
-
return /* @__PURE__ */
|
|
3302
|
+
return /* @__PURE__ */ jsx21(
|
|
3216
3303
|
"nav",
|
|
3217
3304
|
{
|
|
3218
3305
|
className: cn("flex w-full items-center", sizeStyles5[size].text, className),
|
|
3219
3306
|
"aria-label": "Breadcrumb navigation",
|
|
3220
|
-
children: /* @__PURE__ */
|
|
3307
|
+
children: /* @__PURE__ */ jsx21("ol", { className: cn("flex items-center", sizeStyles5[size].spacing), children: processedItems.map((item, index) => {
|
|
3221
3308
|
const isLast = index === processedItems.length - 1;
|
|
3222
3309
|
const isCollapsedIndicator = item.label === "...";
|
|
3223
3310
|
const Icon = item.icon;
|
|
3224
3311
|
return /* @__PURE__ */ jsxs18("li", { className: "flex items-center", children: [
|
|
3225
|
-
isCollapsedIndicator ? /* @__PURE__ */
|
|
3312
|
+
isCollapsedIndicator ? /* @__PURE__ */ jsx21(
|
|
3226
3313
|
"button",
|
|
3227
3314
|
{
|
|
3228
3315
|
onClick: handleCollapseToggle,
|
|
@@ -3233,7 +3320,7 @@ var Breadcrumb = ({
|
|
|
3233
3320
|
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
|
|
3234
3321
|
),
|
|
3235
3322
|
"aria-label": "Show all breadcrumb items",
|
|
3236
|
-
children: /* @__PURE__ */
|
|
3323
|
+
children: /* @__PURE__ */ jsx21(MoreHorizontal, { className: sizeStyles5[size].icon })
|
|
3237
3324
|
}
|
|
3238
3325
|
) : item.href && !isLast && !item.disabled ? /* @__PURE__ */ jsxs18(
|
|
3239
3326
|
Link,
|
|
@@ -3246,8 +3333,8 @@ var Breadcrumb = ({
|
|
|
3246
3333
|
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 rounded-sm"
|
|
3247
3334
|
),
|
|
3248
3335
|
children: [
|
|
3249
|
-
Icon && /* @__PURE__ */
|
|
3250
|
-
/* @__PURE__ */
|
|
3336
|
+
Icon && /* @__PURE__ */ jsx21(Icon, { className: sizeStyles5[size].icon }),
|
|
3337
|
+
/* @__PURE__ */ jsx21("span", { children: item.label })
|
|
3251
3338
|
]
|
|
3252
3339
|
}
|
|
3253
3340
|
) : /* @__PURE__ */ jsxs18(
|
|
@@ -3260,12 +3347,12 @@ var Breadcrumb = ({
|
|
|
3260
3347
|
),
|
|
3261
3348
|
"aria-current": isLast ? "page" : void 0,
|
|
3262
3349
|
children: [
|
|
3263
|
-
Icon && /* @__PURE__ */
|
|
3264
|
-
/* @__PURE__ */
|
|
3350
|
+
Icon && /* @__PURE__ */ jsx21(Icon, { className: sizeStyles5[size].icon }),
|
|
3351
|
+
/* @__PURE__ */ jsx21("span", { children: item.label })
|
|
3265
3352
|
]
|
|
3266
3353
|
}
|
|
3267
3354
|
),
|
|
3268
|
-
!isLast && /* @__PURE__ */
|
|
3355
|
+
!isLast && /* @__PURE__ */ jsx21(
|
|
3269
3356
|
"span",
|
|
3270
3357
|
{
|
|
3271
3358
|
className: cn("mx-1", sizeStyles5[size].spacing),
|
|
@@ -3283,7 +3370,7 @@ var Breadcrumb_default = Breadcrumb;
|
|
|
3283
3370
|
|
|
3284
3371
|
// ../../components/ui/Tab.tsx
|
|
3285
3372
|
import * as React16 from "react";
|
|
3286
|
-
import { jsx as
|
|
3373
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3287
3374
|
var sizeStyles6 = {
|
|
3288
3375
|
sm: {
|
|
3289
3376
|
tab: "py-1.5 px-3 text-xs",
|
|
@@ -3430,14 +3517,14 @@ var Tabs = ({
|
|
|
3430
3517
|
}
|
|
3431
3518
|
},
|
|
3432
3519
|
children: [
|
|
3433
|
-
Icon && /* @__PURE__ */
|
|
3520
|
+
Icon && /* @__PURE__ */ jsx22(Icon, { className: "h-4 w-4" }),
|
|
3434
3521
|
tab.label
|
|
3435
3522
|
]
|
|
3436
3523
|
},
|
|
3437
3524
|
tab.value
|
|
3438
3525
|
);
|
|
3439
3526
|
}),
|
|
3440
|
-
variant === "underline" && orientation === "horizontal" && /* @__PURE__ */
|
|
3527
|
+
variant === "underline" && orientation === "horizontal" && /* @__PURE__ */ jsx22(
|
|
3441
3528
|
"div",
|
|
3442
3529
|
{
|
|
3443
3530
|
className: "absolute bottom-0 h-0.5 bg-primary transition-all duration-300 ease-out",
|
|
@@ -3445,7 +3532,7 @@ var Tabs = ({
|
|
|
3445
3532
|
}
|
|
3446
3533
|
)
|
|
3447
3534
|
] }),
|
|
3448
|
-
/* @__PURE__ */
|
|
3535
|
+
/* @__PURE__ */ jsx22(
|
|
3449
3536
|
"div",
|
|
3450
3537
|
{
|
|
3451
3538
|
role: "tabpanel",
|
|
@@ -3463,7 +3550,7 @@ var Tabs = ({
|
|
|
3463
3550
|
] });
|
|
3464
3551
|
};
|
|
3465
3552
|
var SimpleTabs = ({ tabs, defaultValue, className }) => {
|
|
3466
|
-
return /* @__PURE__ */
|
|
3553
|
+
return /* @__PURE__ */ jsx22(
|
|
3467
3554
|
Tabs,
|
|
3468
3555
|
{
|
|
3469
3556
|
tabs,
|
|
@@ -3475,7 +3562,7 @@ var SimpleTabs = ({ tabs, defaultValue, className }) => {
|
|
|
3475
3562
|
);
|
|
3476
3563
|
};
|
|
3477
3564
|
var PillTabs = ({ contained = true, ...props }) => {
|
|
3478
|
-
return /* @__PURE__ */
|
|
3565
|
+
return /* @__PURE__ */ jsx22(
|
|
3479
3566
|
Tabs,
|
|
3480
3567
|
{
|
|
3481
3568
|
...props,
|
|
@@ -3489,7 +3576,7 @@ var VerticalTabs = ({
|
|
|
3489
3576
|
className,
|
|
3490
3577
|
...props
|
|
3491
3578
|
}) => {
|
|
3492
|
-
return /* @__PURE__ */
|
|
3579
|
+
return /* @__PURE__ */ jsx22("div", { className: cn("flex gap-6", className), children: /* @__PURE__ */ jsx22("div", { className: cn(sidebarWidth, "flex-shrink-0"), children: /* @__PURE__ */ jsx22(
|
|
3493
3580
|
Tabs,
|
|
3494
3581
|
{
|
|
3495
3582
|
...props,
|
|
@@ -3501,9 +3588,9 @@ var VerticalTabs = ({
|
|
|
3501
3588
|
};
|
|
3502
3589
|
|
|
3503
3590
|
// ../../components/ui/DropdownMenu.tsx
|
|
3504
|
-
import React17, { useState as
|
|
3591
|
+
import React17, { useState as useState16 } from "react";
|
|
3505
3592
|
import { createPortal as createPortal5 } from "react-dom";
|
|
3506
|
-
import { Fragment as Fragment5, jsx as
|
|
3593
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3507
3594
|
var DropdownMenu = ({
|
|
3508
3595
|
trigger,
|
|
3509
3596
|
children,
|
|
@@ -3516,12 +3603,12 @@ var DropdownMenu = ({
|
|
|
3516
3603
|
onOpenChange,
|
|
3517
3604
|
items
|
|
3518
3605
|
}) => {
|
|
3519
|
-
const [internalOpen, setInternalOpen] =
|
|
3520
|
-
const [position, setPosition] =
|
|
3606
|
+
const [internalOpen, setInternalOpen] = useState16(false);
|
|
3607
|
+
const [position, setPosition] = useState16(null);
|
|
3521
3608
|
const triggerRef = React17.useRef(null);
|
|
3522
3609
|
const contentRef = React17.useRef(null);
|
|
3523
3610
|
const itemsRef = React17.useRef([]);
|
|
3524
|
-
const [activeIndex, setActiveIndex] =
|
|
3611
|
+
const [activeIndex, setActiveIndex] = useState16(-1);
|
|
3525
3612
|
useShadCNAnimations();
|
|
3526
3613
|
const open = isOpen !== void 0 ? isOpen : internalOpen;
|
|
3527
3614
|
const setOpen = onOpenChange || setInternalOpen;
|
|
@@ -3625,7 +3712,7 @@ var DropdownMenu = ({
|
|
|
3625
3712
|
setOpen(false);
|
|
3626
3713
|
}
|
|
3627
3714
|
};
|
|
3628
|
-
const dropdownContent = open ? /* @__PURE__ */
|
|
3715
|
+
const dropdownContent = open ? /* @__PURE__ */ jsx23(
|
|
3629
3716
|
"div",
|
|
3630
3717
|
{
|
|
3631
3718
|
"data-dropdown-menu": true,
|
|
@@ -3646,7 +3733,7 @@ var DropdownMenu = ({
|
|
|
3646
3733
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
3647
3734
|
className
|
|
3648
3735
|
),
|
|
3649
|
-
children: /* @__PURE__ */
|
|
3736
|
+
children: /* @__PURE__ */ jsx23(
|
|
3650
3737
|
"div",
|
|
3651
3738
|
{
|
|
3652
3739
|
className: cn(
|
|
@@ -3678,7 +3765,7 @@ var DropdownMenu = ({
|
|
|
3678
3765
|
item.destructive && "text-destructive hover:bg-destructive/10 focus:bg-destructive/10"
|
|
3679
3766
|
),
|
|
3680
3767
|
children: [
|
|
3681
|
-
IconComponent && /* @__PURE__ */
|
|
3768
|
+
IconComponent && /* @__PURE__ */ jsx23(IconComponent, { className: "h-4 w-4" }),
|
|
3682
3769
|
item.label
|
|
3683
3770
|
]
|
|
3684
3771
|
},
|
|
@@ -3705,7 +3792,7 @@ var DropdownMenu = ({
|
|
|
3705
3792
|
dropdownContent && typeof window !== "undefined" && createPortal5(dropdownContent, document.body)
|
|
3706
3793
|
] });
|
|
3707
3794
|
};
|
|
3708
|
-
var DropdownMenuItem = ({ children, onClick, disabled, destructive, className }) => /* @__PURE__ */
|
|
3795
|
+
var DropdownMenuItem = ({ children, onClick, disabled, destructive, className }) => /* @__PURE__ */ jsx23(
|
|
3709
3796
|
"button",
|
|
3710
3797
|
{
|
|
3711
3798
|
onClick,
|
|
@@ -3721,22 +3808,22 @@ var DropdownMenuItem = ({ children, onClick, disabled, destructive, className })
|
|
|
3721
3808
|
children
|
|
3722
3809
|
}
|
|
3723
3810
|
);
|
|
3724
|
-
var DropdownMenuSeparator = ({ className }) => /* @__PURE__ */
|
|
3725
|
-
var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", className }) => /* @__PURE__ */
|
|
3811
|
+
var DropdownMenuSeparator = ({ className }) => /* @__PURE__ */ jsx23("div", { className: cn("h-px bg-border my-1", className) });
|
|
3812
|
+
var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", className }) => /* @__PURE__ */ jsx23(
|
|
3726
3813
|
DropdownMenu,
|
|
3727
3814
|
{
|
|
3728
3815
|
trigger: /* @__PURE__ */ jsxs20(
|
|
3729
3816
|
"button",
|
|
3730
3817
|
{
|
|
3731
3818
|
className: cn(
|
|
3732
|
-
"inline-flex items-center justify-between gap-2 px-3 py-2 text-sm rounded-md border bg-background",
|
|
3819
|
+
"inline-flex items-center justify-between gap-2 px-3 py-2 text-sm rounded-md border bg-background border-border/60",
|
|
3733
3820
|
"hover:bg-accent/50",
|
|
3734
3821
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
3735
3822
|
className
|
|
3736
3823
|
),
|
|
3737
3824
|
children: [
|
|
3738
|
-
/* @__PURE__ */
|
|
3739
|
-
/* @__PURE__ */
|
|
3825
|
+
/* @__PURE__ */ jsx23("span", { className: "truncate max-w-[16rem] text-foreground/90", children: value || placeholder }),
|
|
3826
|
+
/* @__PURE__ */ jsx23("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", className: "opacity-70", children: /* @__PURE__ */ jsx23("path", { d: "M6 8l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
3740
3827
|
]
|
|
3741
3828
|
}
|
|
3742
3829
|
),
|
|
@@ -3757,7 +3844,7 @@ import * as React18 from "react";
|
|
|
3757
3844
|
import { useId as useId2 } from "react";
|
|
3758
3845
|
import { createPortal as createPortal6 } from "react-dom";
|
|
3759
3846
|
import { ChevronDown, Search as Search2, Check as Check3, X as X7 } from "lucide-react";
|
|
3760
|
-
import { jsx as
|
|
3847
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3761
3848
|
var getOptionLabel = (option) => {
|
|
3762
3849
|
return typeof option === "string" ? option : option.label;
|
|
3763
3850
|
};
|
|
@@ -3872,7 +3959,7 @@ var Combobox = ({
|
|
|
3872
3959
|
}, [open, enableSearch]);
|
|
3873
3960
|
const selectedOption = findOptionByValue(options, value);
|
|
3874
3961
|
const displayValue = selectedOption ? getOptionLabel(selectedOption) : "";
|
|
3875
|
-
const dropdownContent = /* @__PURE__ */
|
|
3962
|
+
const dropdownContent = /* @__PURE__ */ jsx24(
|
|
3876
3963
|
"div",
|
|
3877
3964
|
{
|
|
3878
3965
|
"data-combobox-dropdown": true,
|
|
@@ -3893,8 +3980,8 @@ var Combobox = ({
|
|
|
3893
3980
|
),
|
|
3894
3981
|
children: /* @__PURE__ */ jsxs21("div", { className: cn("rounded-md border bg-popover text-popover-foreground shadow-md", "backdrop-blur-sm bg-popover/95 border-border/60"), children: [
|
|
3895
3982
|
enableSearch && /* @__PURE__ */ jsxs21("div", { className: "relative p-3 border-b border-border/50 bg-muted/20", children: [
|
|
3896
|
-
/* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
3983
|
+
/* @__PURE__ */ jsx24(Search2, { className: "absolute left-6 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground transition-colors" }),
|
|
3984
|
+
/* @__PURE__ */ jsx24(
|
|
3898
3985
|
"input",
|
|
3899
3986
|
{
|
|
3900
3987
|
ref: inputRef,
|
|
@@ -3933,7 +4020,7 @@ var Combobox = ({
|
|
|
3933
4020
|
}
|
|
3934
4021
|
)
|
|
3935
4022
|
] }),
|
|
3936
|
-
/* @__PURE__ */
|
|
4023
|
+
/* @__PURE__ */ jsx24("div", { className: "max-h-64 overflow-y-auto overscroll-contain", children: /* @__PURE__ */ jsx24("ul", { className: "p-1 space-y-1", children: filteredOptions.length > 0 ? filteredOptions.map((item, index) => {
|
|
3937
4024
|
const itemValue = getOptionValue(item);
|
|
3938
4025
|
const itemLabel = getOptionLabel(item);
|
|
3939
4026
|
const isSelected = itemValue === value;
|
|
@@ -3961,15 +4048,15 @@ var Combobox = ({
|
|
|
3961
4048
|
isSelected && "bg-accent text-accent-foreground"
|
|
3962
4049
|
),
|
|
3963
4050
|
children: [
|
|
3964
|
-
/* @__PURE__ */
|
|
3965
|
-
isSelected && /* @__PURE__ */
|
|
4051
|
+
/* @__PURE__ */ jsx24("span", { className: "truncate", children: itemLabel }),
|
|
4052
|
+
isSelected && /* @__PURE__ */ jsx24(Check3, { className: "h-4 w-4 text-primary" })
|
|
3966
4053
|
]
|
|
3967
4054
|
},
|
|
3968
4055
|
`${itemValue}-${index}`
|
|
3969
4056
|
);
|
|
3970
|
-
}) : /* @__PURE__ */
|
|
3971
|
-
/* @__PURE__ */
|
|
3972
|
-
/* @__PURE__ */
|
|
4057
|
+
}) : /* @__PURE__ */ jsx24("li", { className: "px-3 py-8 text-center text-muted-foreground text-sm", children: /* @__PURE__ */ jsxs21("div", { className: "flex flex-col items-center gap-2", children: [
|
|
4058
|
+
/* @__PURE__ */ jsx24(Search2, { className: "h-6 w-6 opacity-50" }),
|
|
4059
|
+
/* @__PURE__ */ jsx24("span", { children: emptyText })
|
|
3973
4060
|
] }) }) }) })
|
|
3974
4061
|
] })
|
|
3975
4062
|
}
|
|
@@ -3984,7 +4071,7 @@ var Combobox = ({
|
|
|
3984
4071
|
const radiusClass = size === "sm" ? "rounded-md" : "rounded-lg";
|
|
3985
4072
|
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
3986
4073
|
return /* @__PURE__ */ jsxs21("div", { className: cn("w-full group", verticalGap), children: [
|
|
3987
|
-
label && /* @__PURE__ */
|
|
4074
|
+
label && /* @__PURE__ */ jsx24("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs21(
|
|
3988
4075
|
"label",
|
|
3989
4076
|
{
|
|
3990
4077
|
id: labelId,
|
|
@@ -3996,7 +4083,7 @@ var Combobox = ({
|
|
|
3996
4083
|
),
|
|
3997
4084
|
children: [
|
|
3998
4085
|
label,
|
|
3999
|
-
required && /* @__PURE__ */
|
|
4086
|
+
required && /* @__PURE__ */ jsx24("span", { className: "text-destructive ml-1", children: "*" })
|
|
4000
4087
|
]
|
|
4001
4088
|
}
|
|
4002
4089
|
) }),
|
|
@@ -4030,10 +4117,10 @@ var Combobox = ({
|
|
|
4030
4117
|
className
|
|
4031
4118
|
),
|
|
4032
4119
|
children: [
|
|
4033
|
-
/* @__PURE__ */
|
|
4120
|
+
/* @__PURE__ */ jsx24("span", { className: cn("truncate", !displayValue && "text-muted-foreground", fontBold && "font-bold"), children: displayValue || placeholder }),
|
|
4034
4121
|
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1 ml-2", children: [
|
|
4035
4122
|
allowClear && value && !disabled && // FIX: Use a div instead of a nested button
|
|
4036
|
-
/* @__PURE__ */
|
|
4123
|
+
/* @__PURE__ */ jsx24(
|
|
4037
4124
|
"div",
|
|
4038
4125
|
{
|
|
4039
4126
|
role: "button",
|
|
@@ -4042,10 +4129,10 @@ var Combobox = ({
|
|
|
4042
4129
|
onClick: handleClear,
|
|
4043
4130
|
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && handleClear(e),
|
|
4044
4131
|
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",
|
|
4045
|
-
children: /* @__PURE__ */
|
|
4132
|
+
children: /* @__PURE__ */ jsx24(X7, { className: "h-3 w-3" })
|
|
4046
4133
|
}
|
|
4047
4134
|
),
|
|
4048
|
-
/* @__PURE__ */
|
|
4135
|
+
/* @__PURE__ */ jsx24(ChevronDown, { className: cn("h-4 w-4 text-muted-foreground transition-transform duration-200", open && "rotate-180") })
|
|
4049
4136
|
] })
|
|
4050
4137
|
]
|
|
4051
4138
|
}
|
|
@@ -4056,7 +4143,7 @@ var Combobox = ({
|
|
|
4056
4143
|
|
|
4057
4144
|
// ../../components/ui/Pagination.tsx
|
|
4058
4145
|
import { useTranslations as useTranslations4 } from "next-intl";
|
|
4059
|
-
import { jsx as
|
|
4146
|
+
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4060
4147
|
var Pagination = ({
|
|
4061
4148
|
page,
|
|
4062
4149
|
totalPages,
|
|
@@ -4140,12 +4227,12 @@ var Pagination = ({
|
|
|
4140
4227
|
};
|
|
4141
4228
|
if (totalPages <= 1) return null;
|
|
4142
4229
|
return /* @__PURE__ */ jsxs22("nav", { className: cn("flex flex-col gap-4", className), "aria-label": labels?.navigationLabel || t("navigationLabel"), children: [
|
|
4143
|
-
showInfo && totalItems && /* @__PURE__ */
|
|
4230
|
+
showInfo && totalItems && /* @__PURE__ */ jsx25("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 }) }),
|
|
4144
4231
|
/* @__PURE__ */ jsxs22("div", { className: cn("flex items-center justify-between", {
|
|
4145
4232
|
"flex-row-reverse": alignment === "right" || alignment === "center"
|
|
4146
4233
|
}), children: [
|
|
4147
4234
|
/* @__PURE__ */ jsxs22("div", { className: cn("flex items-center gap-1"), children: [
|
|
4148
|
-
showFirstLast && /* @__PURE__ */
|
|
4235
|
+
showFirstLast && /* @__PURE__ */ jsx25(
|
|
4149
4236
|
Button_default,
|
|
4150
4237
|
{
|
|
4151
4238
|
variant: getButtonVariant(false),
|
|
@@ -4159,7 +4246,7 @@ var Pagination = ({
|
|
|
4159
4246
|
"aria-disabled": disabled || page === 1
|
|
4160
4247
|
}
|
|
4161
4248
|
),
|
|
4162
|
-
showPrevNext && /* @__PURE__ */
|
|
4249
|
+
showPrevNext && /* @__PURE__ */ jsx25(
|
|
4163
4250
|
Button_default,
|
|
4164
4251
|
{
|
|
4165
4252
|
variant: getButtonVariant(false),
|
|
@@ -4170,16 +4257,16 @@ var Pagination = ({
|
|
|
4170
4257
|
title: labels?.previousPage || t("previousPage"),
|
|
4171
4258
|
"aria-label": labels?.previousPage || t("previousPage"),
|
|
4172
4259
|
"aria-disabled": disabled || page === 1,
|
|
4173
|
-
children: /* @__PURE__ */
|
|
4260
|
+
children: /* @__PURE__ */ jsx25("span", { className: "hidden sm:inline", children: labels?.previous || t("previous") })
|
|
4174
4261
|
}
|
|
4175
4262
|
),
|
|
4176
4263
|
showPageNumbers && createPageArray().map((p, i) => {
|
|
4177
4264
|
if (p === "...") {
|
|
4178
|
-
return /* @__PURE__ */
|
|
4265
|
+
return /* @__PURE__ */ jsx25(Button_default, { variant: "ghost", size, disabled: true, icon: MoreHorizontal2, className: "cursor-default" }, i);
|
|
4179
4266
|
}
|
|
4180
4267
|
const pageNumber = p;
|
|
4181
4268
|
const isActive = page === pageNumber;
|
|
4182
|
-
return /* @__PURE__ */
|
|
4269
|
+
return /* @__PURE__ */ jsx25(
|
|
4183
4270
|
Button_default,
|
|
4184
4271
|
{
|
|
4185
4272
|
variant: getButtonVariant(isActive),
|
|
@@ -4194,7 +4281,7 @@ var Pagination = ({
|
|
|
4194
4281
|
i
|
|
4195
4282
|
);
|
|
4196
4283
|
}),
|
|
4197
|
-
showPrevNext && /* @__PURE__ */
|
|
4284
|
+
showPrevNext && /* @__PURE__ */ jsx25(
|
|
4198
4285
|
Button_default,
|
|
4199
4286
|
{
|
|
4200
4287
|
variant: getButtonVariant(false),
|
|
@@ -4205,10 +4292,10 @@ var Pagination = ({
|
|
|
4205
4292
|
title: labels?.nextPage || t("nextPage"),
|
|
4206
4293
|
"aria-label": labels?.nextPage || t("nextPage"),
|
|
4207
4294
|
"aria-disabled": disabled || page === totalPages,
|
|
4208
|
-
children: /* @__PURE__ */
|
|
4295
|
+
children: /* @__PURE__ */ jsx25("span", { className: "hidden sm:inline", children: labels?.next || t("next") })
|
|
4209
4296
|
}
|
|
4210
4297
|
),
|
|
4211
|
-
showFirstLast && /* @__PURE__ */
|
|
4298
|
+
showFirstLast && /* @__PURE__ */ jsx25(
|
|
4212
4299
|
Button_default,
|
|
4213
4300
|
{
|
|
4214
4301
|
variant: getButtonVariant(false),
|
|
@@ -4228,7 +4315,7 @@ var Pagination = ({
|
|
|
4228
4315
|
labels?.itemsPerPage || t("itemsPerPage"),
|
|
4229
4316
|
":"
|
|
4230
4317
|
] }),
|
|
4231
|
-
/* @__PURE__ */
|
|
4318
|
+
/* @__PURE__ */ jsx25("div", { className: "w-20", children: /* @__PURE__ */ jsx25(
|
|
4232
4319
|
Combobox,
|
|
4233
4320
|
{
|
|
4234
4321
|
options: pageSizeOptionsStrings,
|
|
@@ -4268,14 +4355,14 @@ var SimplePagination = ({
|
|
|
4268
4355
|
" total items)"
|
|
4269
4356
|
] }),
|
|
4270
4357
|
/* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
|
|
4271
|
-
/* @__PURE__ */
|
|
4358
|
+
/* @__PURE__ */ jsx25(Button_default, { variant, size, icon: ChevronLeft, onClick: () => onChange(Math.max(1, page - 1)), disabled: disabled || page === 1, children: "Previous" }),
|
|
4272
4359
|
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
4273
|
-
/* @__PURE__ */
|
|
4274
|
-
/* @__PURE__ */
|
|
4275
|
-
/* @__PURE__ */
|
|
4276
|
-
/* @__PURE__ */
|
|
4360
|
+
/* @__PURE__ */ jsx25("span", { children: "Page" }),
|
|
4361
|
+
/* @__PURE__ */ jsx25("span", { className: "font-medium text-foreground", children: page }),
|
|
4362
|
+
/* @__PURE__ */ jsx25("span", { children: "of" }),
|
|
4363
|
+
/* @__PURE__ */ jsx25("span", { className: "font-medium text-foreground", children: totalPages })
|
|
4277
4364
|
] }),
|
|
4278
|
-
/* @__PURE__ */
|
|
4365
|
+
/* @__PURE__ */ jsx25(
|
|
4279
4366
|
Button_default,
|
|
4280
4367
|
{
|
|
4281
4368
|
variant,
|
|
@@ -4299,7 +4386,7 @@ var CompactPagination = ({
|
|
|
4299
4386
|
}) => {
|
|
4300
4387
|
if (totalPages <= 1) return null;
|
|
4301
4388
|
return /* @__PURE__ */ jsxs22("nav", { className: cn("flex items-center gap-1", className), "aria-label": "Compact Pagination", children: [
|
|
4302
|
-
/* @__PURE__ */
|
|
4389
|
+
/* @__PURE__ */ jsx25(
|
|
4303
4390
|
Button_default,
|
|
4304
4391
|
{
|
|
4305
4392
|
variant,
|
|
@@ -4311,7 +4398,7 @@ var CompactPagination = ({
|
|
|
4311
4398
|
"aria-label": "First page"
|
|
4312
4399
|
}
|
|
4313
4400
|
),
|
|
4314
|
-
/* @__PURE__ */
|
|
4401
|
+
/* @__PURE__ */ jsx25(
|
|
4315
4402
|
Button_default,
|
|
4316
4403
|
{
|
|
4317
4404
|
variant,
|
|
@@ -4327,7 +4414,7 @@ var CompactPagination = ({
|
|
|
4327
4414
|
" / ",
|
|
4328
4415
|
totalPages
|
|
4329
4416
|
] }),
|
|
4330
|
-
/* @__PURE__ */
|
|
4417
|
+
/* @__PURE__ */ jsx25(
|
|
4331
4418
|
Button_default,
|
|
4332
4419
|
{
|
|
4333
4420
|
variant,
|
|
@@ -4338,7 +4425,7 @@ var CompactPagination = ({
|
|
|
4338
4425
|
title: "Next page"
|
|
4339
4426
|
}
|
|
4340
4427
|
),
|
|
4341
|
-
/* @__PURE__ */
|
|
4428
|
+
/* @__PURE__ */ jsx25(
|
|
4342
4429
|
Button_default,
|
|
4343
4430
|
{
|
|
4344
4431
|
variant,
|
|
@@ -4354,7 +4441,7 @@ var CompactPagination = ({
|
|
|
4354
4441
|
|
|
4355
4442
|
// ../../components/ui/Section.tsx
|
|
4356
4443
|
import React20 from "react";
|
|
4357
|
-
import { jsx as
|
|
4444
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
4358
4445
|
var Section = React20.forwardRef(
|
|
4359
4446
|
({
|
|
4360
4447
|
children,
|
|
@@ -4362,6 +4449,7 @@ var Section = React20.forwardRef(
|
|
|
4362
4449
|
variant = "default",
|
|
4363
4450
|
spacing = "lg",
|
|
4364
4451
|
fullWidth = false,
|
|
4452
|
+
outlined = false,
|
|
4365
4453
|
...props
|
|
4366
4454
|
}, ref) => {
|
|
4367
4455
|
const variantClasses = {
|
|
@@ -4376,13 +4464,14 @@ var Section = React20.forwardRef(
|
|
|
4376
4464
|
lg: "py-12",
|
|
4377
4465
|
xl: "py-16"
|
|
4378
4466
|
};
|
|
4379
|
-
return /* @__PURE__ */
|
|
4467
|
+
return /* @__PURE__ */ jsx26(
|
|
4380
4468
|
"section",
|
|
4381
4469
|
{
|
|
4382
4470
|
ref,
|
|
4383
4471
|
className: cn(
|
|
4384
4472
|
variantClasses[variant],
|
|
4385
4473
|
spacingClasses[spacing],
|
|
4474
|
+
outlined && "rounded-lg border border-border/60",
|
|
4386
4475
|
!fullWidth && "container mx-auto px-4 md:px-6",
|
|
4387
4476
|
className
|
|
4388
4477
|
),
|
|
@@ -4397,9 +4486,9 @@ var Section_default = Section;
|
|
|
4397
4486
|
|
|
4398
4487
|
// ../../components/ui/ScrollArea.tsx
|
|
4399
4488
|
import { forwardRef as forwardRef6 } from "react";
|
|
4400
|
-
import { jsx as
|
|
4489
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
4401
4490
|
var ScrollArea = forwardRef6(({ className, children, ...props }, ref) => {
|
|
4402
|
-
return /* @__PURE__ */
|
|
4491
|
+
return /* @__PURE__ */ jsx27("div", { ref, className: cn("relative overflow-hidden bg-background", className), ...props, children: /* @__PURE__ */ jsx27("div", { className: cn("h-full w-full overflow-y-auto scroll-area-viewport"), children }) });
|
|
4403
4492
|
});
|
|
4404
4493
|
ScrollArea.displayName = "ScrollArea";
|
|
4405
4494
|
|
|
@@ -4590,7 +4679,7 @@ function formatDateWithDay(date) {
|
|
|
4590
4679
|
}
|
|
4591
4680
|
|
|
4592
4681
|
// ../../components/ui/DatePicker.tsx
|
|
4593
|
-
import { Fragment as Fragment6, jsx as
|
|
4682
|
+
import { Fragment as Fragment6, jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4594
4683
|
var DatePicker = ({
|
|
4595
4684
|
id,
|
|
4596
4685
|
value,
|
|
@@ -4701,7 +4790,7 @@ var DatePicker = ({
|
|
|
4701
4790
|
const firstDayOfMonth = getFirstDayOfMonth(viewDate);
|
|
4702
4791
|
const days = [];
|
|
4703
4792
|
for (let i = 0; i < firstDayOfMonth; i++) {
|
|
4704
|
-
days.push(/* @__PURE__ */
|
|
4793
|
+
days.push(/* @__PURE__ */ jsx28("div", { className: "w-8 h-8" }, `empty-${i}`));
|
|
4705
4794
|
}
|
|
4706
4795
|
for (let day = 1; day <= daysInMonth; day++) {
|
|
4707
4796
|
const date = new Date(viewDate.getFullYear(), viewDate.getMonth(), day);
|
|
@@ -4710,7 +4799,7 @@ var DatePicker = ({
|
|
|
4710
4799
|
const totalDaysFromStart = firstDayOfMonth + day - 1;
|
|
4711
4800
|
const rowIndex = Math.floor(totalDaysFromStart / 7);
|
|
4712
4801
|
days.push(
|
|
4713
|
-
/* @__PURE__ */
|
|
4802
|
+
/* @__PURE__ */ jsx28(
|
|
4714
4803
|
"button",
|
|
4715
4804
|
{
|
|
4716
4805
|
onClick: () => handleDateSelect(date),
|
|
@@ -4733,7 +4822,7 @@ var DatePicker = ({
|
|
|
4733
4822
|
}
|
|
4734
4823
|
return days;
|
|
4735
4824
|
};
|
|
4736
|
-
const datePickerContent = isOpen && dropdownPosition ? /* @__PURE__ */
|
|
4825
|
+
const datePickerContent = isOpen && dropdownPosition ? /* @__PURE__ */ jsx28(
|
|
4737
4826
|
"div",
|
|
4738
4827
|
{
|
|
4739
4828
|
"data-datepicker": true,
|
|
@@ -4763,13 +4852,13 @@ var DatePicker = ({
|
|
|
4763
4852
|
style: { pointerEvents: "auto" },
|
|
4764
4853
|
children: [
|
|
4765
4854
|
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4766
|
-
/* @__PURE__ */
|
|
4767
|
-
/* @__PURE__ */
|
|
4768
|
-
/* @__PURE__ */
|
|
4855
|
+
/* @__PURE__ */ jsx28(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("prev"), className: "p-1 h-auto", children: /* @__PURE__ */ jsx28(ChevronLeft2, { className: "h-4 w-4" }) }),
|
|
4856
|
+
/* @__PURE__ */ jsx28("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
4857
|
+
/* @__PURE__ */ jsx28(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("next"), className: "p-1 h-auto", children: /* @__PURE__ */ jsx28(ChevronRight3, { className: "h-4 w-4" }) })
|
|
4769
4858
|
] }),
|
|
4770
|
-
/* @__PURE__ */
|
|
4771
|
-
/* @__PURE__ */
|
|
4772
|
-
/* @__PURE__ */
|
|
4859
|
+
/* @__PURE__ */ jsx28("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__ */ jsx28("div", { className: cn("text-muted-foreground text-center font-medium", size === "sm" ? "text-[10px] py-0.5" : "text-xs py-1"), children: day }, day)) }),
|
|
4860
|
+
/* @__PURE__ */ jsx28("div", { className: "grid grid-cols-7 gap-1", children: renderCalendar() }),
|
|
4861
|
+
/* @__PURE__ */ jsx28("div", { className: "flex items-center justify-end mt-2", children: /* @__PURE__ */ jsx28(
|
|
4773
4862
|
Button_default,
|
|
4774
4863
|
{
|
|
4775
4864
|
variant: "outline",
|
|
@@ -4794,7 +4883,7 @@ var DatePicker = ({
|
|
|
4794
4883
|
const radiusClass = size === "sm" ? "rounded-md" : "rounded-lg";
|
|
4795
4884
|
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
4796
4885
|
return /* @__PURE__ */ jsxs23("div", { className: cn("w-full group", verticalGap), children: [
|
|
4797
|
-
label && /* @__PURE__ */
|
|
4886
|
+
label && /* @__PURE__ */ jsx28("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs23(
|
|
4798
4887
|
"label",
|
|
4799
4888
|
{
|
|
4800
4889
|
id: labelId,
|
|
@@ -4806,7 +4895,7 @@ var DatePicker = ({
|
|
|
4806
4895
|
),
|
|
4807
4896
|
children: [
|
|
4808
4897
|
label,
|
|
4809
|
-
required && /* @__PURE__ */
|
|
4898
|
+
required && /* @__PURE__ */ jsx28("span", { className: "text-destructive ml-1", children: "*" })
|
|
4810
4899
|
]
|
|
4811
4900
|
}
|
|
4812
4901
|
) }),
|
|
@@ -4838,8 +4927,8 @@ var DatePicker = ({
|
|
|
4838
4927
|
className
|
|
4839
4928
|
),
|
|
4840
4929
|
children: [
|
|
4841
|
-
/* @__PURE__ */
|
|
4842
|
-
value && /* @__PURE__ */
|
|
4930
|
+
/* @__PURE__ */ jsx28("span", { className: cn("truncate", !value && "text-muted-foreground"), children: value ? formatDateDisplay(value) : placeholder || t("placeholder") }),
|
|
4931
|
+
value && /* @__PURE__ */ jsx28(
|
|
4843
4932
|
"span",
|
|
4844
4933
|
{
|
|
4845
4934
|
role: "button",
|
|
@@ -4861,10 +4950,10 @@ var DatePicker = ({
|
|
|
4861
4950
|
},
|
|
4862
4951
|
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",
|
|
4863
4952
|
style: { width: 20, height: 20 },
|
|
4864
|
-
children: /* @__PURE__ */
|
|
4953
|
+
children: /* @__PURE__ */ jsx28(XIcon, { className: "h-3.5 w-3.5" })
|
|
4865
4954
|
}
|
|
4866
4955
|
),
|
|
4867
|
-
/* @__PURE__ */
|
|
4956
|
+
/* @__PURE__ */ jsx28(Calendar, { className: "h-4 w-4 text-muted-foreground ml-2" })
|
|
4868
4957
|
]
|
|
4869
4958
|
}
|
|
4870
4959
|
),
|
|
@@ -4949,7 +5038,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
4949
5038
|
const nodes = [];
|
|
4950
5039
|
const daysInMonth = getDaysInMonth(viewDate);
|
|
4951
5040
|
const firstDay = getFirstDayOfMonth(viewDate);
|
|
4952
|
-
for (let i = 0; i < firstDay; i++) nodes.push(/* @__PURE__ */
|
|
5041
|
+
for (let i = 0; i < firstDay; i++) nodes.push(/* @__PURE__ */ jsx28("div", { className: "w-8 h-8" }, `e-${i}`));
|
|
4953
5042
|
for (let d = 1; d <= daysInMonth; d++) {
|
|
4954
5043
|
const date = new Date(viewDate.getFullYear(), viewDate.getMonth(), d);
|
|
4955
5044
|
const isSelectedStart = isSameDay(date, tempStart);
|
|
@@ -4974,7 +5063,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
4974
5063
|
}
|
|
4975
5064
|
}
|
|
4976
5065
|
nodes.push(
|
|
4977
|
-
/* @__PURE__ */
|
|
5066
|
+
/* @__PURE__ */ jsx28(
|
|
4978
5067
|
"button",
|
|
4979
5068
|
{
|
|
4980
5069
|
onClick: () => handleSelect(date),
|
|
@@ -5004,7 +5093,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5004
5093
|
}
|
|
5005
5094
|
return nodes;
|
|
5006
5095
|
};
|
|
5007
|
-
const panel = isOpen && dropdownPosition ? /* @__PURE__ */
|
|
5096
|
+
const panel = isOpen && dropdownPosition ? /* @__PURE__ */ jsx28(
|
|
5008
5097
|
"div",
|
|
5009
5098
|
{
|
|
5010
5099
|
style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width || 256, zIndex: 9999 },
|
|
@@ -5021,30 +5110,30 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5021
5110
|
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"),
|
|
5022
5111
|
children: [
|
|
5023
5112
|
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between mb-3", children: [
|
|
5024
|
-
/* @__PURE__ */
|
|
5113
|
+
/* @__PURE__ */ jsx28(
|
|
5025
5114
|
Button_default,
|
|
5026
5115
|
{
|
|
5027
5116
|
variant: "ghost",
|
|
5028
5117
|
size: "sm",
|
|
5029
5118
|
onClick: () => setViewDate(new Date(viewDate.getFullYear(), viewDate.getMonth() - 1, 1)),
|
|
5030
5119
|
className: "p-1 h-auto",
|
|
5031
|
-
children: /* @__PURE__ */
|
|
5120
|
+
children: /* @__PURE__ */ jsx28(ChevronLeft2, { className: "h-4 w-4" })
|
|
5032
5121
|
}
|
|
5033
5122
|
),
|
|
5034
|
-
/* @__PURE__ */
|
|
5035
|
-
/* @__PURE__ */
|
|
5123
|
+
/* @__PURE__ */ jsx28("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
5124
|
+
/* @__PURE__ */ jsx28(
|
|
5036
5125
|
Button_default,
|
|
5037
5126
|
{
|
|
5038
5127
|
variant: "ghost",
|
|
5039
5128
|
size: "sm",
|
|
5040
5129
|
onClick: () => setViewDate(new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 1)),
|
|
5041
5130
|
className: "p-1 h-auto",
|
|
5042
|
-
children: /* @__PURE__ */
|
|
5131
|
+
children: /* @__PURE__ */ jsx28(ChevronRight3, { className: "h-4 w-4" })
|
|
5043
5132
|
}
|
|
5044
5133
|
)
|
|
5045
5134
|
] }),
|
|
5046
|
-
/* @__PURE__ */
|
|
5047
|
-
/* @__PURE__ */
|
|
5135
|
+
/* @__PURE__ */ jsx28("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((d) => /* @__PURE__ */ jsx28("div", { className: "text-xs text-muted-foreground text-center py-1 font-medium", children: d }, d)) }),
|
|
5136
|
+
/* @__PURE__ */ jsx28("div", { className: "grid grid-cols-7", children: renderGrid() })
|
|
5048
5137
|
]
|
|
5049
5138
|
}
|
|
5050
5139
|
)
|
|
@@ -5072,8 +5161,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5072
5161
|
className
|
|
5073
5162
|
),
|
|
5074
5163
|
children: [
|
|
5075
|
-
/* @__PURE__ */
|
|
5076
|
-
/* @__PURE__ */
|
|
5164
|
+
/* @__PURE__ */ jsx28("span", { className: cn("truncate", !tempStart && !tempEnd && "text-muted-foreground"), children: label }),
|
|
5165
|
+
/* @__PURE__ */ jsx28(Calendar, { className: "h-4 w-4 text-muted-foreground ml-2" })
|
|
5077
5166
|
]
|
|
5078
5167
|
}
|
|
5079
5168
|
),
|
|
@@ -5086,7 +5175,7 @@ import * as React22 from "react";
|
|
|
5086
5175
|
import { useId as useId4 } from "react";
|
|
5087
5176
|
import { createPortal as createPortal8 } from "react-dom";
|
|
5088
5177
|
import { ChevronDown as ChevronDown2, Search as Search3, Check as Check4 } from "lucide-react";
|
|
5089
|
-
import { jsx as
|
|
5178
|
+
import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5090
5179
|
var MultiCombobox = ({
|
|
5091
5180
|
id,
|
|
5092
5181
|
options,
|
|
@@ -5229,7 +5318,7 @@ var MultiCombobox = ({
|
|
|
5229
5318
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
5230
5319
|
const labelSize = size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm";
|
|
5231
5320
|
return /* @__PURE__ */ jsxs24("div", { className: cn("w-full space-y-2 group", className), children: [
|
|
5232
|
-
title && /* @__PURE__ */
|
|
5321
|
+
title && /* @__PURE__ */ jsx29("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs24(
|
|
5233
5322
|
"label",
|
|
5234
5323
|
{
|
|
5235
5324
|
className: cn(
|
|
@@ -5239,7 +5328,7 @@ var MultiCombobox = ({
|
|
|
5239
5328
|
),
|
|
5240
5329
|
children: [
|
|
5241
5330
|
title,
|
|
5242
|
-
required && /* @__PURE__ */
|
|
5331
|
+
required && /* @__PURE__ */ jsx29("span", { className: "text-destructive ml-1", children: "*" })
|
|
5243
5332
|
]
|
|
5244
5333
|
}
|
|
5245
5334
|
) }),
|
|
@@ -5255,11 +5344,11 @@ var MultiCombobox = ({
|
|
|
5255
5344
|
),
|
|
5256
5345
|
children: [
|
|
5257
5346
|
label,
|
|
5258
|
-
required && /* @__PURE__ */
|
|
5347
|
+
required && /* @__PURE__ */ jsx29("span", { className: "text-destructive ml-1", children: "*" })
|
|
5259
5348
|
]
|
|
5260
5349
|
}
|
|
5261
5350
|
),
|
|
5262
|
-
/* @__PURE__ */
|
|
5351
|
+
/* @__PURE__ */ jsx29("div", { className: "relative w-full" }),
|
|
5263
5352
|
/* @__PURE__ */ jsxs24(
|
|
5264
5353
|
"button",
|
|
5265
5354
|
{
|
|
@@ -5283,11 +5372,11 @@ var MultiCombobox = ({
|
|
|
5283
5372
|
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
5284
5373
|
),
|
|
5285
5374
|
children: [
|
|
5286
|
-
/* @__PURE__ */
|
|
5375
|
+
/* @__PURE__ */ jsx29("div", { className: "flex items-center gap-1 flex-wrap min-h-[1.5rem] flex-1", children: value.length > 0 ? showTags ? value.map((itemValue) => {
|
|
5287
5376
|
const option = normalizedOptions.find((o) => o.value === itemValue);
|
|
5288
5377
|
return /* @__PURE__ */ jsxs24("span", { className: "inline-flex items-center gap-1 bg-accent text-accent-foreground rounded px-2 py-1 text-xs", children: [
|
|
5289
|
-
/* @__PURE__ */
|
|
5290
|
-
/* @__PURE__ */
|
|
5378
|
+
/* @__PURE__ */ jsx29("span", { className: "truncate max-w-[120px]", children: option ? displayFormat(option) : itemValue }),
|
|
5379
|
+
/* @__PURE__ */ jsx29(
|
|
5291
5380
|
"span",
|
|
5292
5381
|
{
|
|
5293
5382
|
role: "button",
|
|
@@ -5313,13 +5402,13 @@ var MultiCombobox = ({
|
|
|
5313
5402
|
}) : /* @__PURE__ */ jsxs24("span", { className: "truncate text-sm", children: [
|
|
5314
5403
|
value.length,
|
|
5315
5404
|
" selected"
|
|
5316
|
-
] }) : /* @__PURE__ */
|
|
5317
|
-
/* @__PURE__ */
|
|
5405
|
+
] }) : /* @__PURE__ */ jsx29("span", { className: "text-muted-foreground", children: placeholder || "Select..." }) }),
|
|
5406
|
+
/* @__PURE__ */ jsx29(ChevronDown2, { className: cn("opacity-50 transition-transform", sizeStyles8[size].icon, open && "rotate-180") })
|
|
5318
5407
|
]
|
|
5319
5408
|
}
|
|
5320
5409
|
),
|
|
5321
5410
|
open && dropdownPosition && typeof window !== "undefined" ? createPortal8(
|
|
5322
|
-
/* @__PURE__ */
|
|
5411
|
+
/* @__PURE__ */ jsx29(
|
|
5323
5412
|
"div",
|
|
5324
5413
|
{
|
|
5325
5414
|
"data-dropdown": "multicombobox",
|
|
@@ -5344,7 +5433,7 @@ var MultiCombobox = ({
|
|
|
5344
5433
|
"backdrop-blur-sm bg-popover/95 border-border/60"
|
|
5345
5434
|
),
|
|
5346
5435
|
children: [
|
|
5347
|
-
showClear && value.length > 0 && /* @__PURE__ */
|
|
5436
|
+
showClear && value.length > 0 && /* @__PURE__ */ jsx29("div", { className: "px-3 py-2 border-b border-border/60 flex justify-end", children: /* @__PURE__ */ jsx29(
|
|
5348
5437
|
"button",
|
|
5349
5438
|
{
|
|
5350
5439
|
type: "button",
|
|
@@ -5358,8 +5447,8 @@ var MultiCombobox = ({
|
|
|
5358
5447
|
}
|
|
5359
5448
|
) }),
|
|
5360
5449
|
enableSearch && /* @__PURE__ */ jsxs24("div", { className: "relative border-b border-border/60", children: [
|
|
5361
|
-
/* @__PURE__ */
|
|
5362
|
-
/* @__PURE__ */
|
|
5450
|
+
/* @__PURE__ */ jsx29(Search3, { className: cn("absolute left-2 top-2.5 text-muted-foreground", sizeStyles8[size].icon) }),
|
|
5451
|
+
/* @__PURE__ */ jsx29(
|
|
5363
5452
|
"input",
|
|
5364
5453
|
{
|
|
5365
5454
|
ref: inputRef,
|
|
@@ -5374,7 +5463,7 @@ var MultiCombobox = ({
|
|
|
5374
5463
|
}
|
|
5375
5464
|
)
|
|
5376
5465
|
] }),
|
|
5377
|
-
/* @__PURE__ */
|
|
5466
|
+
/* @__PURE__ */ jsx29("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) => {
|
|
5378
5467
|
const isSelected = value.includes(item.value);
|
|
5379
5468
|
const isDisabled = disabledOptions.includes(item.value);
|
|
5380
5469
|
return /* @__PURE__ */ jsxs24(
|
|
@@ -5401,12 +5490,12 @@ var MultiCombobox = ({
|
|
|
5401
5490
|
),
|
|
5402
5491
|
children: [
|
|
5403
5492
|
item.label,
|
|
5404
|
-
isSelected && /* @__PURE__ */
|
|
5493
|
+
isSelected && /* @__PURE__ */ jsx29(Check4, { className: sizeStyles8[size].icon })
|
|
5405
5494
|
]
|
|
5406
5495
|
},
|
|
5407
5496
|
item.value
|
|
5408
5497
|
);
|
|
5409
|
-
}) : /* @__PURE__ */
|
|
5498
|
+
}) : /* @__PURE__ */ jsx29("li", { className: cn("px-3 py-2 text-muted-foreground", size === "lg" ? "text-base" : size === "sm" ? "text-xs" : "text-sm"), children: "No result." }) })
|
|
5410
5499
|
]
|
|
5411
5500
|
}
|
|
5412
5501
|
)
|
|
@@ -5419,7 +5508,7 @@ var MultiCombobox = ({
|
|
|
5419
5508
|
|
|
5420
5509
|
// ../../components/ui/RadioGroup.tsx
|
|
5421
5510
|
import * as React23 from "react";
|
|
5422
|
-
import { jsx as
|
|
5511
|
+
import { jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5423
5512
|
var RadioGroupContext = React23.createContext(void 0);
|
|
5424
5513
|
var useRadioGroup = () => {
|
|
5425
5514
|
const context = React23.useContext(RadioGroupContext);
|
|
@@ -5457,7 +5546,7 @@ var RadioGroup = React23.forwardRef(
|
|
|
5457
5546
|
};
|
|
5458
5547
|
const uniqueId = React23.useId();
|
|
5459
5548
|
const radioName = name || `radio-group-${uniqueId}`;
|
|
5460
|
-
return /* @__PURE__ */
|
|
5549
|
+
return /* @__PURE__ */ jsx30(
|
|
5461
5550
|
RadioGroupContext.Provider,
|
|
5462
5551
|
{
|
|
5463
5552
|
value: {
|
|
@@ -5469,7 +5558,7 @@ var RadioGroup = React23.forwardRef(
|
|
|
5469
5558
|
variant
|
|
5470
5559
|
},
|
|
5471
5560
|
children: /* @__PURE__ */ jsxs25("div", { className: "space-y-2", children: [
|
|
5472
|
-
/* @__PURE__ */
|
|
5561
|
+
/* @__PURE__ */ jsx30(
|
|
5473
5562
|
"div",
|
|
5474
5563
|
{
|
|
5475
5564
|
ref,
|
|
@@ -5486,7 +5575,7 @@ var RadioGroup = React23.forwardRef(
|
|
|
5486
5575
|
children
|
|
5487
5576
|
}
|
|
5488
5577
|
),
|
|
5489
|
-
error && errorMessage && /* @__PURE__ */
|
|
5578
|
+
error && errorMessage && /* @__PURE__ */ jsx30("p", { className: "text-sm text-destructive mt-1", children: errorMessage })
|
|
5490
5579
|
] })
|
|
5491
5580
|
}
|
|
5492
5581
|
);
|
|
@@ -5541,7 +5630,7 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5541
5630
|
),
|
|
5542
5631
|
children: [
|
|
5543
5632
|
/* @__PURE__ */ jsxs25("div", { className: "flex items-start gap-3", children: [
|
|
5544
|
-
/* @__PURE__ */
|
|
5633
|
+
/* @__PURE__ */ jsx30(
|
|
5545
5634
|
"button",
|
|
5546
5635
|
{
|
|
5547
5636
|
ref,
|
|
@@ -5560,22 +5649,22 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5560
5649
|
sizeStyles7[size].radio
|
|
5561
5650
|
),
|
|
5562
5651
|
onClick: () => onValueChange?.(value),
|
|
5563
|
-
children: /* @__PURE__ */
|
|
5652
|
+
children: /* @__PURE__ */ jsx30(
|
|
5564
5653
|
"span",
|
|
5565
5654
|
{
|
|
5566
5655
|
className: cn(
|
|
5567
5656
|
"flex items-center justify-center w-full h-full rounded-full transition-all duration-200",
|
|
5568
5657
|
isSelected && "bg-primary"
|
|
5569
5658
|
),
|
|
5570
|
-
children: isSelected && /* @__PURE__ */
|
|
5659
|
+
children: isSelected && /* @__PURE__ */ jsx30("span", { className: cn("bg-primary-foreground rounded-full", sizeStyles7[size].dot) })
|
|
5571
5660
|
}
|
|
5572
5661
|
)
|
|
5573
5662
|
}
|
|
5574
5663
|
),
|
|
5575
5664
|
/* @__PURE__ */ jsxs25("div", { className: "flex-1 min-w-0", children: [
|
|
5576
5665
|
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
|
|
5577
|
-
Icon && /* @__PURE__ */
|
|
5578
|
-
/* @__PURE__ */
|
|
5666
|
+
Icon && /* @__PURE__ */ jsx30(Icon, { className: "h-4 w-4 text-foreground" }),
|
|
5667
|
+
/* @__PURE__ */ jsx30(
|
|
5579
5668
|
"label",
|
|
5580
5669
|
{
|
|
5581
5670
|
htmlFor: radioId,
|
|
@@ -5587,10 +5676,10 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5587
5676
|
}
|
|
5588
5677
|
)
|
|
5589
5678
|
] }),
|
|
5590
|
-
description && /* @__PURE__ */
|
|
5679
|
+
description && /* @__PURE__ */ jsx30("p", { className: "text-muted-foreground mt-1 text-xs", children: description })
|
|
5591
5680
|
] })
|
|
5592
5681
|
] }),
|
|
5593
|
-
/* @__PURE__ */
|
|
5682
|
+
/* @__PURE__ */ jsx30(
|
|
5594
5683
|
"input",
|
|
5595
5684
|
{
|
|
5596
5685
|
type: "radio",
|
|
@@ -5630,9 +5719,9 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5630
5719
|
),
|
|
5631
5720
|
onClick: () => onValueChange?.(value),
|
|
5632
5721
|
children: [
|
|
5633
|
-
Icon && /* @__PURE__ */
|
|
5722
|
+
Icon && /* @__PURE__ */ jsx30(Icon, { className: "h-4 w-4" }),
|
|
5634
5723
|
label || children,
|
|
5635
|
-
/* @__PURE__ */
|
|
5724
|
+
/* @__PURE__ */ jsx30(
|
|
5636
5725
|
"input",
|
|
5637
5726
|
{
|
|
5638
5727
|
type: "radio",
|
|
@@ -5650,7 +5739,7 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5650
5739
|
);
|
|
5651
5740
|
}
|
|
5652
5741
|
return /* @__PURE__ */ jsxs25("div", { className: cn("flex items-center gap-2", className), children: [
|
|
5653
|
-
/* @__PURE__ */
|
|
5742
|
+
/* @__PURE__ */ jsx30(
|
|
5654
5743
|
"button",
|
|
5655
5744
|
{
|
|
5656
5745
|
ref,
|
|
@@ -5669,14 +5758,14 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5669
5758
|
sizeStyles7[size].radio
|
|
5670
5759
|
),
|
|
5671
5760
|
onClick: () => onValueChange?.(value),
|
|
5672
|
-
children: /* @__PURE__ */
|
|
5761
|
+
children: /* @__PURE__ */ jsx30(
|
|
5673
5762
|
"span",
|
|
5674
5763
|
{
|
|
5675
5764
|
className: cn(
|
|
5676
5765
|
"flex items-center justify-center w-full h-full rounded-full transition-all duration-200",
|
|
5677
5766
|
isSelected && "bg-primary"
|
|
5678
5767
|
),
|
|
5679
|
-
children: isSelected && /* @__PURE__ */
|
|
5768
|
+
children: isSelected && /* @__PURE__ */ jsx30("span", { className: cn("bg-primary-foreground rounded-full", sizeStyles7[size].dot) })
|
|
5680
5769
|
}
|
|
5681
5770
|
)
|
|
5682
5771
|
}
|
|
@@ -5693,14 +5782,14 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5693
5782
|
),
|
|
5694
5783
|
children: [
|
|
5695
5784
|
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
|
|
5696
|
-
Icon && /* @__PURE__ */
|
|
5697
|
-
/* @__PURE__ */
|
|
5785
|
+
Icon && /* @__PURE__ */ jsx30(Icon, { className: "h-4 w-4" }),
|
|
5786
|
+
/* @__PURE__ */ jsx30("span", { children: label || children })
|
|
5698
5787
|
] }),
|
|
5699
|
-
description && /* @__PURE__ */
|
|
5788
|
+
description && /* @__PURE__ */ jsx30("p", { className: "text-muted-foreground mt-0.5 text-xs", children: description })
|
|
5700
5789
|
]
|
|
5701
5790
|
}
|
|
5702
5791
|
),
|
|
5703
|
-
/* @__PURE__ */
|
|
5792
|
+
/* @__PURE__ */ jsx30(
|
|
5704
5793
|
"input",
|
|
5705
5794
|
{
|
|
5706
5795
|
type: "radio",
|
|
@@ -5720,7 +5809,7 @@ RadioGroupItem.displayName = "RadioGroupItem";
|
|
|
5720
5809
|
|
|
5721
5810
|
// ../../components/ui/Slider.tsx
|
|
5722
5811
|
import * as React24 from "react";
|
|
5723
|
-
import { jsx as
|
|
5812
|
+
import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5724
5813
|
var SIZE_STYLES = {
|
|
5725
5814
|
sm: {
|
|
5726
5815
|
track: "h-1",
|
|
@@ -5782,18 +5871,18 @@ var Slider = React24.forwardRef(
|
|
|
5782
5871
|
}
|
|
5783
5872
|
return /* @__PURE__ */ jsxs26("div", { className: cn("w-full space-y-2", containerClassName), children: [
|
|
5784
5873
|
(label || showValue) && /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between", children: [
|
|
5785
|
-
label && /* @__PURE__ */
|
|
5786
|
-
showValue && /* @__PURE__ */
|
|
5874
|
+
label && /* @__PURE__ */ jsx31("label", { className: cn("text-sm font-medium text-foreground", labelClassName), children: label }),
|
|
5875
|
+
showValue && /* @__PURE__ */ jsx31("span", { className: cn("text-xs font-mono text-muted-foreground min-w-[2rem] text-right", valueClassName), children: displayValue })
|
|
5787
5876
|
] }),
|
|
5788
5877
|
/* @__PURE__ */ jsxs26("div", { className: cn("relative flex items-center", sizeStyles8.container), children: [
|
|
5789
|
-
/* @__PURE__ */
|
|
5878
|
+
/* @__PURE__ */ jsx31("div", { className: cn("w-full rounded-full bg-secondary relative overflow-hidden", sizeStyles8.track, trackClassName), children: /* @__PURE__ */ jsx31(
|
|
5790
5879
|
"div",
|
|
5791
5880
|
{
|
|
5792
5881
|
className: "absolute left-0 top-0 h-full bg-primary rounded-full transition-all duration-150 ease-out",
|
|
5793
5882
|
style: { width: `${percentage}%` }
|
|
5794
5883
|
}
|
|
5795
5884
|
) }),
|
|
5796
|
-
/* @__PURE__ */
|
|
5885
|
+
/* @__PURE__ */ jsx31(
|
|
5797
5886
|
"input",
|
|
5798
5887
|
{
|
|
5799
5888
|
ref,
|
|
@@ -5859,7 +5948,7 @@ Slider.displayName = "Slider";
|
|
|
5859
5948
|
// ../../components/ui/OverlayControls.tsx
|
|
5860
5949
|
import { Dot, Maximize2, Pause, Play, RotateCcw, RotateCw, Volume2, VolumeX } from "lucide-react";
|
|
5861
5950
|
import React25 from "react";
|
|
5862
|
-
import { Fragment as Fragment7, jsx as
|
|
5951
|
+
import { Fragment as Fragment7, jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5863
5952
|
function OverlayControls({
|
|
5864
5953
|
mode,
|
|
5865
5954
|
value,
|
|
@@ -6083,7 +6172,7 @@ function OverlayControls({
|
|
|
6083
6172
|
setPreviewData(null);
|
|
6084
6173
|
};
|
|
6085
6174
|
return /* @__PURE__ */ jsxs27(Fragment7, { children: [
|
|
6086
|
-
keyboardFeedback && /* @__PURE__ */
|
|
6175
|
+
keyboardFeedback && /* @__PURE__ */ jsx32(
|
|
6087
6176
|
"div",
|
|
6088
6177
|
{
|
|
6089
6178
|
className: cn(
|
|
@@ -6091,10 +6180,10 @@ function OverlayControls({
|
|
|
6091
6180
|
keyboardFeedback.type === "seek" && (keyboardFeedback.value ?? 0) > 0 ? "justify-end pr-32" : keyboardFeedback.type === "seek" && (keyboardFeedback.value ?? 0) < 0 ? "justify-start pl-32" : "justify-center"
|
|
6092
6181
|
),
|
|
6093
6182
|
children: /* @__PURE__ */ jsxs27("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: [
|
|
6094
|
-
keyboardFeedback.type === "play" && /* @__PURE__ */
|
|
6095
|
-
keyboardFeedback.type === "pause" && /* @__PURE__ */
|
|
6183
|
+
keyboardFeedback.type === "play" && /* @__PURE__ */ jsx32(Play, { className: "w-16 h-16 text-white", fill: "white" }),
|
|
6184
|
+
keyboardFeedback.type === "pause" && /* @__PURE__ */ jsx32(Pause, { className: "w-16 h-16 text-white", fill: "white" }),
|
|
6096
6185
|
keyboardFeedback.type === "seek" && /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-3", children: [
|
|
6097
|
-
(keyboardFeedback.value ?? 0) > 0 ? /* @__PURE__ */
|
|
6186
|
+
(keyboardFeedback.value ?? 0) > 0 ? /* @__PURE__ */ jsx32(RotateCw, { className: "w-12 h-12 text-white" }) : /* @__PURE__ */ jsx32(RotateCcw, { className: "w-12 h-12 text-white" }),
|
|
6098
6187
|
/* @__PURE__ */ jsxs27("span", { className: "text-3xl font-bold text-white", children: [
|
|
6099
6188
|
keyboardFeedback.value && keyboardFeedback.value > 0 ? "+" : "",
|
|
6100
6189
|
keyboardFeedback.value,
|
|
@@ -6102,21 +6191,21 @@ function OverlayControls({
|
|
|
6102
6191
|
] })
|
|
6103
6192
|
] }),
|
|
6104
6193
|
keyboardFeedback.type === "volume" && /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-3", children: [
|
|
6105
|
-
/* @__PURE__ */
|
|
6194
|
+
/* @__PURE__ */ jsx32(Volume2, { className: "w-12 h-12 text-white" }),
|
|
6106
6195
|
/* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-1.5", children: [
|
|
6107
6196
|
/* @__PURE__ */ jsxs27("span", { className: "text-2xl font-bold text-white", children: [
|
|
6108
6197
|
keyboardFeedback.value,
|
|
6109
6198
|
"%"
|
|
6110
6199
|
] }),
|
|
6111
|
-
/* @__PURE__ */
|
|
6200
|
+
/* @__PURE__ */ jsx32("div", { className: "w-32 h-1.5 bg-white/30 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx32("div", { className: "h-full bg-white rounded-full transition-all", style: { width: `${keyboardFeedback.value}%` } }) })
|
|
6112
6201
|
] })
|
|
6113
6202
|
] }),
|
|
6114
|
-
keyboardFeedback.type === "mute" && /* @__PURE__ */
|
|
6115
|
-
keyboardFeedback.type === "unmute" && /* @__PURE__ */
|
|
6203
|
+
keyboardFeedback.type === "mute" && /* @__PURE__ */ jsx32(VolumeX, { className: "w-16 h-16 text-white" }),
|
|
6204
|
+
keyboardFeedback.type === "unmute" && /* @__PURE__ */ jsx32(Volume2, { className: "w-16 h-16 text-white" })
|
|
6116
6205
|
] })
|
|
6117
6206
|
}
|
|
6118
6207
|
),
|
|
6119
|
-
/* @__PURE__ */
|
|
6208
|
+
/* @__PURE__ */ jsx32(
|
|
6120
6209
|
"div",
|
|
6121
6210
|
{
|
|
6122
6211
|
className: cn(
|
|
@@ -6127,7 +6216,7 @@ function OverlayControls({
|
|
|
6127
6216
|
),
|
|
6128
6217
|
children: /* @__PURE__ */ jsxs27("div", { className: "px-4", children: [
|
|
6129
6218
|
/* @__PURE__ */ jsxs27("div", { ref: sliderRef, onMouseMove: handleSliderMouseMove, onMouseLeave: handleSliderMouseLeave, className: "relative", children: [
|
|
6130
|
-
/* @__PURE__ */
|
|
6219
|
+
/* @__PURE__ */ jsx32(
|
|
6131
6220
|
Slider,
|
|
6132
6221
|
{
|
|
6133
6222
|
min: 0,
|
|
@@ -6152,14 +6241,14 @@ function OverlayControls({
|
|
|
6152
6241
|
noFocus: true
|
|
6153
6242
|
}
|
|
6154
6243
|
),
|
|
6155
|
-
previewData && /* @__PURE__ */
|
|
6156
|
-
/* @__PURE__ */
|
|
6157
|
-
/* @__PURE__ */
|
|
6158
|
-
] }) : /* @__PURE__ */
|
|
6244
|
+
previewData && /* @__PURE__ */ jsx32("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__ */ jsxs27("div", { className: "bg-background/95 backdrop-blur rounded-md border border-border shadow-lg overflow-hidden", children: [
|
|
6245
|
+
/* @__PURE__ */ jsx32("img", { src: previewData.url, alt: "Preview", className: "w-40 h-24 object-cover" }),
|
|
6246
|
+
/* @__PURE__ */ jsx32("div", { className: "px-2 py-1 text-xs font-mono text-center bg-background/80", children: formatTime2(previewData.time) })
|
|
6247
|
+
] }) : /* @__PURE__ */ jsx32("div", { className: "px-3 py-1.5 rounded-md bg-background/90 backdrop-blur border border-border shadow-lg", children: /* @__PURE__ */ jsx32("div", { className: "text-xs font-mono text-center", children: formatTime2(previewData.time) }) }) })
|
|
6159
6248
|
] }),
|
|
6160
6249
|
showControlsBar && /* @__PURE__ */ jsxs27("div", { className: "mt-2 flex items-center justify-between gap-2", children: [
|
|
6161
6250
|
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", children: [
|
|
6162
|
-
/* @__PURE__ */
|
|
6251
|
+
/* @__PURE__ */ jsx32(
|
|
6163
6252
|
Button_default,
|
|
6164
6253
|
{
|
|
6165
6254
|
variant: "ghost",
|
|
@@ -6167,10 +6256,10 @@ function OverlayControls({
|
|
|
6167
6256
|
onClick: onTogglePlay,
|
|
6168
6257
|
title: playing ? "T\u1EA1m d\u1EEBng" : "Ph\xE1t",
|
|
6169
6258
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6170
|
-
children: playing ? /* @__PURE__ */
|
|
6259
|
+
children: playing ? /* @__PURE__ */ jsx32(Pause, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx32(Play, { className: "w-4 h-4" })
|
|
6171
6260
|
}
|
|
6172
6261
|
),
|
|
6173
|
-
onSkip && /* @__PURE__ */
|
|
6262
|
+
onSkip && /* @__PURE__ */ jsx32(
|
|
6174
6263
|
Button_default,
|
|
6175
6264
|
{
|
|
6176
6265
|
variant: "ghost",
|
|
@@ -6178,10 +6267,10 @@ function OverlayControls({
|
|
|
6178
6267
|
onClick: () => onSkip(-skipSeconds),
|
|
6179
6268
|
title: `L\xF9i ${skipSeconds}s`,
|
|
6180
6269
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6181
|
-
children: /* @__PURE__ */
|
|
6270
|
+
children: /* @__PURE__ */ jsx32(RotateCcw, { className: "w-4 h-4" })
|
|
6182
6271
|
}
|
|
6183
6272
|
),
|
|
6184
|
-
onSkip && /* @__PURE__ */
|
|
6273
|
+
onSkip && /* @__PURE__ */ jsx32(
|
|
6185
6274
|
Button_default,
|
|
6186
6275
|
{
|
|
6187
6276
|
variant: "ghost",
|
|
@@ -6189,7 +6278,7 @@ function OverlayControls({
|
|
|
6189
6278
|
onClick: () => onSkip(skipSeconds),
|
|
6190
6279
|
title: `Tua ${skipSeconds}s`,
|
|
6191
6280
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6192
|
-
children: /* @__PURE__ */
|
|
6281
|
+
children: /* @__PURE__ */ jsx32(RotateCw, { className: "w-4 h-4" })
|
|
6193
6282
|
}
|
|
6194
6283
|
),
|
|
6195
6284
|
(showTime ?? true) && /* @__PURE__ */ jsxs27("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: [
|
|
@@ -6198,7 +6287,7 @@ function OverlayControls({
|
|
|
6198
6287
|
formatTime2(max)
|
|
6199
6288
|
] }),
|
|
6200
6289
|
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", children: [
|
|
6201
|
-
/* @__PURE__ */
|
|
6290
|
+
/* @__PURE__ */ jsx32(
|
|
6202
6291
|
Button_default,
|
|
6203
6292
|
{
|
|
6204
6293
|
variant: "ghost",
|
|
@@ -6206,10 +6295,10 @@ function OverlayControls({
|
|
|
6206
6295
|
onClick: onToggleMute,
|
|
6207
6296
|
title: muted ? "B\u1EADt ti\u1EBFng" : "T\u1EAFt ti\u1EBFng",
|
|
6208
6297
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6209
|
-
children: muted || (volume ?? 1) === 0 ? /* @__PURE__ */
|
|
6298
|
+
children: muted || (volume ?? 1) === 0 ? /* @__PURE__ */ jsx32(VolumeX, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx32(Volume2, { className: "w-4 h-4" })
|
|
6210
6299
|
}
|
|
6211
6300
|
),
|
|
6212
|
-
/* @__PURE__ */
|
|
6301
|
+
/* @__PURE__ */ jsx32("div", { className: "w-24", children: /* @__PURE__ */ jsx32(
|
|
6213
6302
|
Slider,
|
|
6214
6303
|
{
|
|
6215
6304
|
min: 0,
|
|
@@ -6234,7 +6323,7 @@ function OverlayControls({
|
|
|
6234
6323
|
title: "Tr\u1EF1c ti\u1EBFp (v\u1EC1 Live)",
|
|
6235
6324
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6236
6325
|
children: [
|
|
6237
|
-
/* @__PURE__ */
|
|
6326
|
+
/* @__PURE__ */ jsx32(Dot, { className: "w-10 h-10 text-destructive" }),
|
|
6238
6327
|
"Tr\u1EF1c ti\u1EBFp"
|
|
6239
6328
|
]
|
|
6240
6329
|
}
|
|
@@ -6254,7 +6343,7 @@ function OverlayControls({
|
|
|
6254
6343
|
]
|
|
6255
6344
|
}
|
|
6256
6345
|
),
|
|
6257
|
-
rateOpen && /* @__PURE__ */
|
|
6346
|
+
rateOpen && /* @__PURE__ */ jsx32("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__ */ jsxs27(
|
|
6258
6347
|
"button",
|
|
6259
6348
|
{
|
|
6260
6349
|
onClick: () => {
|
|
@@ -6270,7 +6359,7 @@ function OverlayControls({
|
|
|
6270
6359
|
r
|
|
6271
6360
|
)) })
|
|
6272
6361
|
] }),
|
|
6273
|
-
onToggleFullscreen && /* @__PURE__ */
|
|
6362
|
+
onToggleFullscreen && /* @__PURE__ */ jsx32(
|
|
6274
6363
|
Button_default,
|
|
6275
6364
|
{
|
|
6276
6365
|
variant: "ghost",
|
|
@@ -6278,7 +6367,7 @@ function OverlayControls({
|
|
|
6278
6367
|
onClick: onToggleFullscreen,
|
|
6279
6368
|
title: "To\xE0n m\xE0n h\xECnh",
|
|
6280
6369
|
className: "px-3 bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6281
|
-
children: /* @__PURE__ */
|
|
6370
|
+
children: /* @__PURE__ */ jsx32(Maximize2, { className: "w-4 h-4" })
|
|
6282
6371
|
}
|
|
6283
6372
|
)
|
|
6284
6373
|
] })
|
|
@@ -6290,12 +6379,12 @@ function OverlayControls({
|
|
|
6290
6379
|
}
|
|
6291
6380
|
|
|
6292
6381
|
// ../../components/ui/CategoryTreeSelect.tsx
|
|
6293
|
-
import { useState as
|
|
6382
|
+
import { useState as useState22 } from "react";
|
|
6294
6383
|
import { ChevronRight as ChevronRight4, ChevronDown as ChevronDown3, Check as Check5 } from "lucide-react";
|
|
6295
|
-
import { Fragment as Fragment8, jsx as
|
|
6384
|
+
import { Fragment as Fragment8, jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6296
6385
|
function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1ECDn danh m\u1EE5c", disabled }) {
|
|
6297
|
-
const [isOpen, setIsOpen] =
|
|
6298
|
-
const [expandedNodes, setExpandedNodes] =
|
|
6386
|
+
const [isOpen, setIsOpen] = useState22(false);
|
|
6387
|
+
const [expandedNodes, setExpandedNodes] = useState22(/* @__PURE__ */ new Set());
|
|
6299
6388
|
const parentCategories = categories.filter((c) => !c.parent_id);
|
|
6300
6389
|
const childrenMap = /* @__PURE__ */ new Map();
|
|
6301
6390
|
categories.forEach((cat) => {
|
|
@@ -6339,13 +6428,21 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
6339
6428
|
"div",
|
|
6340
6429
|
{
|
|
6341
6430
|
className: cn(
|
|
6342
|
-
"flex items-center gap-2 px-3 py-2 cursor-pointer rounded-md transition-colors",
|
|
6431
|
+
"relative flex items-center gap-2 px-3 py-2 cursor-pointer rounded-md transition-colors",
|
|
6343
6432
|
"hover:bg-accent",
|
|
6344
|
-
|
|
6433
|
+
// Selected state: subtle bg + square left indicator, avoid left rounding
|
|
6434
|
+
isSelected && "bg-primary/10 rounded-r-md"
|
|
6345
6435
|
),
|
|
6346
6436
|
style: { paddingLeft: `${level * 1.5 + 0.75}rem` },
|
|
6347
6437
|
children: [
|
|
6348
|
-
|
|
6438
|
+
isSelected && /* @__PURE__ */ jsx33(
|
|
6439
|
+
"span",
|
|
6440
|
+
{
|
|
6441
|
+
"aria-hidden": true,
|
|
6442
|
+
className: "absolute left-0 top-0 bottom-0 w-1 bg-primary"
|
|
6443
|
+
}
|
|
6444
|
+
),
|
|
6445
|
+
hasChildren ? /* @__PURE__ */ jsx33(
|
|
6349
6446
|
"button",
|
|
6350
6447
|
{
|
|
6351
6448
|
type: "button",
|
|
@@ -6354,33 +6451,33 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
6354
6451
|
toggleExpand(category.id);
|
|
6355
6452
|
},
|
|
6356
6453
|
className: "p-0.5 hover:bg-accent rounded",
|
|
6357
|
-
children: isExpanded ? /* @__PURE__ */
|
|
6454
|
+
children: isExpanded ? /* @__PURE__ */ jsx33(ChevronDown3, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx33(ChevronRight4, { className: "w-4 h-4" })
|
|
6358
6455
|
}
|
|
6359
|
-
) : /* @__PURE__ */
|
|
6456
|
+
) : /* @__PURE__ */ jsx33("span", { className: "w-5" }),
|
|
6360
6457
|
/* @__PURE__ */ jsxs28(
|
|
6361
6458
|
"div",
|
|
6362
6459
|
{
|
|
6363
6460
|
onClick: () => handleSelect(category.id, category),
|
|
6364
6461
|
className: "flex items-center gap-2 flex-1",
|
|
6365
6462
|
children: [
|
|
6366
|
-
/* @__PURE__ */
|
|
6463
|
+
/* @__PURE__ */ jsx33(
|
|
6367
6464
|
"div",
|
|
6368
6465
|
{
|
|
6369
6466
|
className: cn(
|
|
6370
6467
|
"w-4 h-4 border-2 rounded flex items-center justify-center transition-colors",
|
|
6371
6468
|
isSelected ? "bg-primary border-primary" : "border-muted-foreground/30"
|
|
6372
6469
|
),
|
|
6373
|
-
children: isSelected && /* @__PURE__ */
|
|
6470
|
+
children: isSelected && /* @__PURE__ */ jsx33(Check5, { className: "w-3 h-3 text-primary-foreground" })
|
|
6374
6471
|
}
|
|
6375
6472
|
),
|
|
6376
|
-
/* @__PURE__ */
|
|
6473
|
+
/* @__PURE__ */ jsx33("span", { className: cn("text-sm", isSelected && "font-medium text-primary"), children: category.name })
|
|
6377
6474
|
]
|
|
6378
6475
|
}
|
|
6379
6476
|
)
|
|
6380
6477
|
]
|
|
6381
6478
|
}
|
|
6382
6479
|
),
|
|
6383
|
-
hasChildren && isExpanded && /* @__PURE__ */
|
|
6480
|
+
hasChildren && isExpanded && /* @__PURE__ */ jsx33("div", { children: children.map((child) => renderCategory(child, level + 1)) })
|
|
6384
6481
|
] }, category.id);
|
|
6385
6482
|
};
|
|
6386
6483
|
const selectedCount = value.length;
|
|
@@ -6393,93 +6490,39 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
6393
6490
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
6394
6491
|
disabled,
|
|
6395
6492
|
className: cn(
|
|
6396
|
-
|
|
6397
|
-
"
|
|
6493
|
+
// Match Combobox trigger outline + focus styles
|
|
6494
|
+
"flex w-full items-center justify-between px-3 bg-background border border-input",
|
|
6495
|
+
"rounded-md h-10 py-2 text-sm",
|
|
6496
|
+
"hover:bg-accent/5 transition-colors hover:border-primary/40 focus:border-primary",
|
|
6497
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
6398
6498
|
disabled && "opacity-50 cursor-not-allowed",
|
|
6399
|
-
isOpen && "border-primary
|
|
6499
|
+
isOpen && "border-primary"
|
|
6400
6500
|
),
|
|
6401
6501
|
children: [
|
|
6402
|
-
/* @__PURE__ */
|
|
6403
|
-
/* @__PURE__ */
|
|
6502
|
+
/* @__PURE__ */ jsx33("span", { className: cn("text-sm", selectedCount === 0 && "text-muted-foreground"), children: displayText }),
|
|
6503
|
+
/* @__PURE__ */ jsx33(ChevronDown3, { className: cn("w-4 h-4 transition-transform", isOpen && "transform rotate-180") })
|
|
6404
6504
|
]
|
|
6405
6505
|
}
|
|
6406
6506
|
),
|
|
6407
6507
|
isOpen && !disabled && /* @__PURE__ */ jsxs28(Fragment8, { children: [
|
|
6408
|
-
/* @__PURE__ */
|
|
6409
|
-
/* @__PURE__ */
|
|
6508
|
+
/* @__PURE__ */ jsx33("div", { className: "fixed inset-0 z-10", onClick: () => setIsOpen(false) }),
|
|
6509
|
+
/* @__PURE__ */ jsx33(
|
|
6510
|
+
"div",
|
|
6511
|
+
{
|
|
6512
|
+
className: cn(
|
|
6513
|
+
"absolute z-20 mt-1 w-full max-h-80 overflow-auto",
|
|
6514
|
+
"rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
6515
|
+
"backdrop-blur-sm bg-popover/95 border-border/60"
|
|
6516
|
+
),
|
|
6517
|
+
children: /* @__PURE__ */ jsx33("div", { className: "p-1", children: parentCategories.length === 0 ? /* @__PURE__ */ jsx33("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)) })
|
|
6518
|
+
}
|
|
6519
|
+
)
|
|
6410
6520
|
] })
|
|
6411
6521
|
] });
|
|
6412
6522
|
}
|
|
6413
6523
|
|
|
6414
|
-
// ../../components/ui/SmartImage.tsx
|
|
6415
|
-
import Image from "next/image";
|
|
6416
|
-
import React27 from "react";
|
|
6417
|
-
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
6418
|
-
var DEFAULT_FALLBACK = "/images/products/hoa-hong-do.png";
|
|
6419
|
-
function SmartImage({
|
|
6420
|
-
src,
|
|
6421
|
-
alt,
|
|
6422
|
-
className,
|
|
6423
|
-
ratioClass,
|
|
6424
|
-
roundedClass = "rounded-lg",
|
|
6425
|
-
fill = true,
|
|
6426
|
-
width,
|
|
6427
|
-
height,
|
|
6428
|
-
sizes = "(max-width: 768px) 100vw, 33vw",
|
|
6429
|
-
priority = false,
|
|
6430
|
-
quality = 80,
|
|
6431
|
-
fit = "cover",
|
|
6432
|
-
fallbackSrc = DEFAULT_FALLBACK
|
|
6433
|
-
}) {
|
|
6434
|
-
const normalize = (input) => {
|
|
6435
|
-
if (!input || input.length === 0) return fallbackSrc;
|
|
6436
|
-
if (input.startsWith("/images/products/") && /\.(jpg|jpeg)($|\?)/i.test(input)) {
|
|
6437
|
-
return input.replace(/\.(jpg|jpeg)(?=$|\?)/i, ".png");
|
|
6438
|
-
}
|
|
6439
|
-
return input;
|
|
6440
|
-
};
|
|
6441
|
-
const [resolvedSrc, setResolvedSrc] = React27.useState(() => normalize(src));
|
|
6442
|
-
const handleError = () => {
|
|
6443
|
-
if (resolvedSrc.endsWith(".jpg")) {
|
|
6444
|
-
setResolvedSrc(resolvedSrc.replace(/\.jpg($|\?)/, ".png$1"));
|
|
6445
|
-
} else if (resolvedSrc !== fallbackSrc) {
|
|
6446
|
-
setResolvedSrc(fallbackSrc);
|
|
6447
|
-
}
|
|
6448
|
-
};
|
|
6449
|
-
const Wrapper = ({ children }) => /* @__PURE__ */ jsx33("div", { className: cn("relative overflow-hidden bg-muted/30", ratioClass, roundedClass, className), children });
|
|
6450
|
-
if (fill) {
|
|
6451
|
-
return /* @__PURE__ */ jsx33(Wrapper, { children: /* @__PURE__ */ jsx33(
|
|
6452
|
-
Image,
|
|
6453
|
-
{
|
|
6454
|
-
src: resolvedSrc,
|
|
6455
|
-
alt,
|
|
6456
|
-
fill: true,
|
|
6457
|
-
sizes,
|
|
6458
|
-
onError: handleError,
|
|
6459
|
-
priority,
|
|
6460
|
-
quality,
|
|
6461
|
-
style: { objectFit: fit }
|
|
6462
|
-
}
|
|
6463
|
-
) });
|
|
6464
|
-
}
|
|
6465
|
-
return /* @__PURE__ */ jsx33("div", { className: cn("relative overflow-hidden bg-muted/30", roundedClass, className), children: /* @__PURE__ */ jsx33(
|
|
6466
|
-
Image,
|
|
6467
|
-
{
|
|
6468
|
-
src: resolvedSrc,
|
|
6469
|
-
alt,
|
|
6470
|
-
width,
|
|
6471
|
-
height,
|
|
6472
|
-
sizes,
|
|
6473
|
-
onError: handleError,
|
|
6474
|
-
priority,
|
|
6475
|
-
quality,
|
|
6476
|
-
style: { objectFit: fit, width: "100%", height: "100%" }
|
|
6477
|
-
}
|
|
6478
|
-
) });
|
|
6479
|
-
}
|
|
6480
|
-
|
|
6481
6524
|
// ../../components/ui/ImageUpload.tsx
|
|
6482
|
-
import { useState as
|
|
6525
|
+
import { useState as useState23, useRef as useRef9, useCallback as useCallback7 } from "react";
|
|
6483
6526
|
import { Upload, X as X8, Image as ImageIcon, Loader2 as Loader22, Check as Check6 } from "lucide-react";
|
|
6484
6527
|
import { useTranslations as useTranslations6 } from "next-intl";
|
|
6485
6528
|
import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
@@ -6498,9 +6541,9 @@ function ImageUpload({
|
|
|
6498
6541
|
browseText,
|
|
6499
6542
|
supportedFormatsText
|
|
6500
6543
|
}) {
|
|
6501
|
-
const [isDragging, setIsDragging] =
|
|
6502
|
-
const [uploading, setUploading] =
|
|
6503
|
-
const [uploadedImages, setUploadedImages] =
|
|
6544
|
+
const [isDragging, setIsDragging] = useState23(false);
|
|
6545
|
+
const [uploading, setUploading] = useState23(false);
|
|
6546
|
+
const [uploadedImages, setUploadedImages] = useState23([]);
|
|
6504
6547
|
const fileInputRef = useRef9(null);
|
|
6505
6548
|
const { addToast } = useToast();
|
|
6506
6549
|
const t = useTranslations6("OCR.imageUpload");
|
|
@@ -6707,20 +6750,20 @@ function ImageUpload({
|
|
|
6707
6750
|
}
|
|
6708
6751
|
|
|
6709
6752
|
// ../../components/ui/Carousel.tsx
|
|
6710
|
-
import * as
|
|
6753
|
+
import * as React27 from "react";
|
|
6711
6754
|
import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
6712
6755
|
import { Fragment as Fragment9, jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6713
6756
|
function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
6714
|
-
const [currentIndex, setCurrentIndex] =
|
|
6715
|
-
const totalSlides =
|
|
6716
|
-
const [isPaused, setIsPaused] =
|
|
6717
|
-
const scrollPrev =
|
|
6757
|
+
const [currentIndex, setCurrentIndex] = React27.useState(0);
|
|
6758
|
+
const totalSlides = React27.Children.count(children);
|
|
6759
|
+
const [isPaused, setIsPaused] = React27.useState(false);
|
|
6760
|
+
const scrollPrev = React27.useCallback(() => {
|
|
6718
6761
|
setCurrentIndex((prev) => prev > 0 ? prev - 1 : totalSlides - 1);
|
|
6719
6762
|
}, [totalSlides]);
|
|
6720
|
-
const scrollNext =
|
|
6763
|
+
const scrollNext = React27.useCallback(() => {
|
|
6721
6764
|
setCurrentIndex((prev) => prev < totalSlides - 1 ? prev + 1 : 0);
|
|
6722
6765
|
}, [totalSlides]);
|
|
6723
|
-
|
|
6766
|
+
React27.useEffect(() => {
|
|
6724
6767
|
if (!autoScroll || isPaused || totalSlides <= 1) return;
|
|
6725
6768
|
const interval = setInterval(() => {
|
|
6726
6769
|
scrollNext();
|
|
@@ -6728,7 +6771,7 @@ function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
|
6728
6771
|
return () => clearInterval(interval);
|
|
6729
6772
|
}, [autoScroll, isPaused, totalSlides, autoScrollInterval, scrollNext]);
|
|
6730
6773
|
return /* @__PURE__ */ jsxs30("div", { className: "relative w-full overflow-hidden", onMouseEnter: () => setIsPaused(true), onMouseLeave: () => setIsPaused(false), children: [
|
|
6731
|
-
/* @__PURE__ */ jsx35("div", { className: "flex transition-transform duration-500 ease-in-out", style: { transform: `translateX(-${currentIndex * 100}%)` }, children:
|
|
6774
|
+
/* @__PURE__ */ jsx35("div", { className: "flex transition-transform duration-500 ease-in-out", style: { transform: `translateX(-${currentIndex * 100}%)` }, children: React27.Children.map(children, (child, idx) => /* @__PURE__ */ jsx35("div", { className: "flex-shrink-0 w-full h-full", children: child }, idx)) }),
|
|
6732
6775
|
totalSlides > 1 && /* @__PURE__ */ jsxs30(Fragment9, { children: [
|
|
6733
6776
|
/* @__PURE__ */ jsx35(
|
|
6734
6777
|
Button_default,
|
|
@@ -6764,11 +6807,11 @@ function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
|
6764
6807
|
}
|
|
6765
6808
|
|
|
6766
6809
|
// ../../components/ui/ClientOnly.tsx
|
|
6767
|
-
import { useEffect as
|
|
6810
|
+
import { useEffect as useEffect14, useState as useState25 } from "react";
|
|
6768
6811
|
import { Fragment as Fragment10, jsx as jsx36 } from "react/jsx-runtime";
|
|
6769
6812
|
function ClientOnly({ children, fallback = null }) {
|
|
6770
|
-
const [hasMounted, setHasMounted] =
|
|
6771
|
-
|
|
6813
|
+
const [hasMounted, setHasMounted] = useState25(false);
|
|
6814
|
+
useEffect14(() => {
|
|
6772
6815
|
setHasMounted(true);
|
|
6773
6816
|
}, []);
|
|
6774
6817
|
if (!hasMounted) {
|
|
@@ -6864,9 +6907,9 @@ var LoadingBar = ({
|
|
|
6864
6907
|
};
|
|
6865
6908
|
|
|
6866
6909
|
// ../../components/ui/Table.tsx
|
|
6867
|
-
import
|
|
6910
|
+
import React28 from "react";
|
|
6868
6911
|
import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6869
|
-
var Table =
|
|
6912
|
+
var Table = React28.forwardRef(
|
|
6870
6913
|
({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6871
6914
|
"div",
|
|
6872
6915
|
{
|
|
@@ -6889,7 +6932,7 @@ var Table = React29.forwardRef(
|
|
|
6889
6932
|
)
|
|
6890
6933
|
);
|
|
6891
6934
|
Table.displayName = "Table";
|
|
6892
|
-
var TableHeader =
|
|
6935
|
+
var TableHeader = React28.forwardRef(
|
|
6893
6936
|
({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ jsxs32(
|
|
6894
6937
|
"thead",
|
|
6895
6938
|
{
|
|
@@ -6908,7 +6951,7 @@ var TableHeader = React29.forwardRef(
|
|
|
6908
6951
|
)
|
|
6909
6952
|
);
|
|
6910
6953
|
TableHeader.displayName = "TableHeader";
|
|
6911
|
-
var TableBody =
|
|
6954
|
+
var TableBody = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6912
6955
|
"tbody",
|
|
6913
6956
|
{
|
|
6914
6957
|
ref,
|
|
@@ -6917,7 +6960,7 @@ var TableBody = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
6917
6960
|
}
|
|
6918
6961
|
));
|
|
6919
6962
|
TableBody.displayName = "TableBody";
|
|
6920
|
-
var TableFooter =
|
|
6963
|
+
var TableFooter = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6921
6964
|
"tfoot",
|
|
6922
6965
|
{
|
|
6923
6966
|
ref,
|
|
@@ -6929,7 +6972,7 @@ var TableFooter = React29.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6929
6972
|
}
|
|
6930
6973
|
));
|
|
6931
6974
|
TableFooter.displayName = "TableFooter";
|
|
6932
|
-
var TableRow =
|
|
6975
|
+
var TableRow = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6933
6976
|
"tr",
|
|
6934
6977
|
{
|
|
6935
6978
|
ref,
|
|
@@ -6943,7 +6986,7 @@ var TableRow = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
6943
6986
|
}
|
|
6944
6987
|
));
|
|
6945
6988
|
TableRow.displayName = "TableRow";
|
|
6946
|
-
var TableHead =
|
|
6989
|
+
var TableHead = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6947
6990
|
"th",
|
|
6948
6991
|
{
|
|
6949
6992
|
ref,
|
|
@@ -6955,7 +6998,7 @@ var TableHead = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
6955
6998
|
}
|
|
6956
6999
|
));
|
|
6957
7000
|
TableHead.displayName = "TableHead";
|
|
6958
|
-
var TableCell =
|
|
7001
|
+
var TableCell = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6959
7002
|
"td",
|
|
6960
7003
|
{
|
|
6961
7004
|
ref,
|
|
@@ -6964,7 +7007,7 @@ var TableCell = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
6964
7007
|
}
|
|
6965
7008
|
));
|
|
6966
7009
|
TableCell.displayName = "TableCell";
|
|
6967
|
-
var TableCaption =
|
|
7010
|
+
var TableCaption = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6968
7011
|
"caption",
|
|
6969
7012
|
{
|
|
6970
7013
|
ref,
|
|
@@ -6976,12 +7019,12 @@ TableCaption.displayName = "TableCaption";
|
|
|
6976
7019
|
|
|
6977
7020
|
// ../../components/ui/DataTable.tsx
|
|
6978
7021
|
import { Filter as FilterIcon } from "lucide-react";
|
|
6979
|
-
import
|
|
7022
|
+
import React29 from "react";
|
|
6980
7023
|
import { useTranslations as useTranslations7 } from "next-intl";
|
|
6981
7024
|
import { jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6982
7025
|
function useDebounced(value, delay = 300) {
|
|
6983
|
-
const [debounced, setDebounced] =
|
|
6984
|
-
|
|
7026
|
+
const [debounced, setDebounced] = React29.useState(value);
|
|
7027
|
+
React29.useEffect(() => {
|
|
6985
7028
|
const id = setTimeout(() => setDebounced(value), delay);
|
|
6986
7029
|
return () => clearTimeout(id);
|
|
6987
7030
|
}, [value, delay]);
|
|
@@ -7003,24 +7046,25 @@ function DataTable({
|
|
|
7003
7046
|
enableDensityToggle = true,
|
|
7004
7047
|
striped = true,
|
|
7005
7048
|
// Mặc định bật màu nền sẽn kẽ cho các dòng
|
|
7049
|
+
columnDividers = false,
|
|
7006
7050
|
className,
|
|
7007
7051
|
labels
|
|
7008
7052
|
}) {
|
|
7009
7053
|
const t = useTranslations7("Common");
|
|
7010
|
-
const [visibleCols, setVisibleCols] =
|
|
7011
|
-
const [filters, setFilters] =
|
|
7012
|
-
const [sort, setSort] =
|
|
7013
|
-
const [density, setDensity] =
|
|
7014
|
-
const [curPage, setCurPage] =
|
|
7015
|
-
const [curPageSize, setCurPageSize] =
|
|
7054
|
+
const [visibleCols, setVisibleCols] = React29.useState(() => columns.filter((c) => c.visible !== false).map((c) => c.key));
|
|
7055
|
+
const [filters, setFilters] = React29.useState({});
|
|
7056
|
+
const [sort, setSort] = React29.useState(null);
|
|
7057
|
+
const [density, setDensity] = React29.useState("normal");
|
|
7058
|
+
const [curPage, setCurPage] = React29.useState(page);
|
|
7059
|
+
const [curPageSize, setCurPageSize] = React29.useState(pageSize);
|
|
7016
7060
|
const debouncedFilters = useDebounced(filters, 350);
|
|
7017
|
-
|
|
7061
|
+
React29.useEffect(() => {
|
|
7018
7062
|
setCurPage(page);
|
|
7019
7063
|
}, [page]);
|
|
7020
|
-
|
|
7064
|
+
React29.useEffect(() => {
|
|
7021
7065
|
setCurPageSize(pageSize);
|
|
7022
7066
|
}, [pageSize]);
|
|
7023
|
-
|
|
7067
|
+
React29.useEffect(() => {
|
|
7024
7068
|
if (!onQueryChange) return;
|
|
7025
7069
|
onQueryChange({ filters: debouncedFilters, sort, page: curPage, pageSize: curPageSize });
|
|
7026
7070
|
}, [debouncedFilters, sort, curPage, curPageSize]);
|
|
@@ -7084,11 +7128,15 @@ function DataTable({
|
|
|
7084
7128
|
}
|
|
7085
7129
|
return null;
|
|
7086
7130
|
};
|
|
7087
|
-
const renderHeader = /* @__PURE__ */ jsx39(TableRow, { children: visibleColumns.map((col) => /* @__PURE__ */ jsx39(
|
|
7131
|
+
const renderHeader = /* @__PURE__ */ jsx39(TableRow, { children: visibleColumns.map((col, colIdx) => /* @__PURE__ */ jsx39(
|
|
7088
7132
|
TableHead,
|
|
7089
7133
|
{
|
|
7090
7134
|
style: { width: col.width },
|
|
7091
|
-
className: cn(
|
|
7135
|
+
className: cn(
|
|
7136
|
+
col.align === "right" && "text-right",
|
|
7137
|
+
col.align === "center" && "text-center",
|
|
7138
|
+
columnDividers && colIdx > 0 && "border-l border-border/60"
|
|
7139
|
+
),
|
|
7092
7140
|
children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center justify-between gap-2 select-none min-h-[2.5rem]", children: [
|
|
7093
7141
|
/* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-1 min-w-0 flex-1", children: [
|
|
7094
7142
|
/* @__PURE__ */ jsx39("span", { className: "truncate font-medium text-sm", children: col.title }),
|
|
@@ -7182,7 +7230,7 @@ function DataTable({
|
|
|
7182
7230
|
col.key
|
|
7183
7231
|
)) });
|
|
7184
7232
|
const isServerMode = Boolean(onQueryChange);
|
|
7185
|
-
const displayedData = isServerMode ? data :
|
|
7233
|
+
const displayedData = isServerMode ? data : React29.useMemo(() => {
|
|
7186
7234
|
const start = (curPage - 1) * curPageSize;
|
|
7187
7235
|
return data.slice(start, start + curPageSize);
|
|
7188
7236
|
}, [data, curPage, curPageSize]);
|
|
@@ -7238,10 +7286,10 @@ function DataTable({
|
|
|
7238
7286
|
toolbar
|
|
7239
7287
|
] })
|
|
7240
7288
|
] }),
|
|
7241
|
-
/* @__PURE__ */ jsx39("div", { className: cn("relative rounded-
|
|
7289
|
+
/* @__PURE__ */ jsx39("div", { className: cn("relative rounded-md border border-border/50 overflow-hidden", loading2 && "opacity-60 pointer-events-none"), children: /* @__PURE__ */ jsxs33(
|
|
7242
7290
|
Table,
|
|
7243
7291
|
{
|
|
7244
|
-
containerClassName: "border-0 rounded-none shadow-none",
|
|
7292
|
+
containerClassName: "border-0 md:border-0 rounded-none md:rounded-none shadow-none bg-transparent",
|
|
7245
7293
|
className: "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-[5] [&_thead]:bg-background [&_thead]:backdrop-blur-sm",
|
|
7246
7294
|
children: [
|
|
7247
7295
|
/* @__PURE__ */ jsx39(TableHeader, { children: renderHeader }),
|
|
@@ -7258,7 +7306,7 @@ function DataTable({
|
|
|
7258
7306
|
)
|
|
7259
7307
|
] }),
|
|
7260
7308
|
/* @__PURE__ */ jsx39("span", { className: "text-sm", children: "Loading..." })
|
|
7261
|
-
] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */ jsx39(TableRow, { children: /* @__PURE__ */ jsx39(TableCell, { colSpan: visibleColumns.length, className: "text-center py-6 text-muted-foreground", children: "No data" }) }) : displayedData.map((row, idx) => /* @__PURE__ */ jsx39(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/30"), children: visibleColumns.map((col) => {
|
|
7309
|
+
] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */ jsx39(TableRow, { children: /* @__PURE__ */ jsx39(TableCell, { colSpan: visibleColumns.length, className: "text-center py-6 text-muted-foreground", children: "No data" }) }) : displayedData.map((row, idx) => /* @__PURE__ */ jsx39(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/30"), children: visibleColumns.map((col, colIdx) => {
|
|
7262
7310
|
const value = col.dataIndex ? row[col.dataIndex] : void 0;
|
|
7263
7311
|
return /* @__PURE__ */ jsx39(
|
|
7264
7312
|
TableCell,
|
|
@@ -7267,8 +7315,9 @@ function DataTable({
|
|
|
7267
7315
|
cellPadding,
|
|
7268
7316
|
col.align === "right" && "text-right",
|
|
7269
7317
|
col.align === "center" && "text-center",
|
|
7270
|
-
|
|
7271
|
-
idx === data.length - 1 && col === visibleColumns[
|
|
7318
|
+
columnDividers && colIdx > 0 && "border-l border-border/60",
|
|
7319
|
+
idx === data.length - 1 && col === visibleColumns[0] && "rounded-bl-md",
|
|
7320
|
+
idx === data.length - 1 && col === visibleColumns[visibleColumns.length - 1] && "rounded-br-md"
|
|
7272
7321
|
),
|
|
7273
7322
|
children: col.render ? col.render(value, row, idx) : String(value ?? "")
|
|
7274
7323
|
},
|
|
@@ -7278,7 +7327,7 @@ function DataTable({
|
|
|
7278
7327
|
]
|
|
7279
7328
|
}
|
|
7280
7329
|
) }),
|
|
7281
|
-
totalItems > 0 && /* @__PURE__ */ jsx39("div", { className: "border-t bg-muted/30 p-4 rounded-b-
|
|
7330
|
+
totalItems > 0 && /* @__PURE__ */ jsx39("div", { className: "border-t bg-muted/30 p-4 rounded-b-md", children: /* @__PURE__ */ jsx39(
|
|
7282
7331
|
Pagination,
|
|
7283
7332
|
{
|
|
7284
7333
|
page: curPage,
|
|
@@ -7300,10 +7349,10 @@ function DataTable({
|
|
|
7300
7349
|
var DataTable_default = DataTable;
|
|
7301
7350
|
|
|
7302
7351
|
// ../../components/ui/Form.tsx
|
|
7303
|
-
import * as
|
|
7352
|
+
import * as React31 from "react";
|
|
7304
7353
|
|
|
7305
7354
|
// ../../node_modules/react-hook-form/dist/index.esm.mjs
|
|
7306
|
-
import
|
|
7355
|
+
import React30 from "react";
|
|
7307
7356
|
var isCheckBoxInput = (element) => element.type === "checkbox";
|
|
7308
7357
|
var isDateObject = (value) => value instanceof Date;
|
|
7309
7358
|
var isNullOrUndefined = (value) => value == null;
|
|
@@ -7391,12 +7440,12 @@ var INPUT_VALIDATION_RULES = {
|
|
|
7391
7440
|
required: "required",
|
|
7392
7441
|
validate: "validate"
|
|
7393
7442
|
};
|
|
7394
|
-
var HookFormContext =
|
|
7443
|
+
var HookFormContext = React30.createContext(null);
|
|
7395
7444
|
HookFormContext.displayName = "HookFormContext";
|
|
7396
|
-
var useFormContext = () =>
|
|
7445
|
+
var useFormContext = () => React30.useContext(HookFormContext);
|
|
7397
7446
|
var FormProvider = (props) => {
|
|
7398
7447
|
const { children, ...data } = props;
|
|
7399
|
-
return
|
|
7448
|
+
return React30.createElement(HookFormContext.Provider, { value: data }, children);
|
|
7400
7449
|
};
|
|
7401
7450
|
var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {
|
|
7402
7451
|
const result = {
|
|
@@ -7416,12 +7465,12 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
|
|
|
7416
7465
|
}
|
|
7417
7466
|
return result;
|
|
7418
7467
|
};
|
|
7419
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
7468
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React30.useLayoutEffect : React30.useEffect;
|
|
7420
7469
|
function useFormState(props) {
|
|
7421
7470
|
const methods = useFormContext();
|
|
7422
7471
|
const { control = methods.control, disabled, name, exact } = props || {};
|
|
7423
|
-
const [formState, updateFormState] =
|
|
7424
|
-
const _localProxyFormState =
|
|
7472
|
+
const [formState, updateFormState] = React30.useState(control._formState);
|
|
7473
|
+
const _localProxyFormState = React30.useRef({
|
|
7425
7474
|
isDirty: false,
|
|
7426
7475
|
isLoading: false,
|
|
7427
7476
|
dirtyFields: false,
|
|
@@ -7442,10 +7491,10 @@ function useFormState(props) {
|
|
|
7442
7491
|
});
|
|
7443
7492
|
}
|
|
7444
7493
|
}), [name, disabled, exact]);
|
|
7445
|
-
|
|
7494
|
+
React30.useEffect(() => {
|
|
7446
7495
|
_localProxyFormState.current.isValid && control._setValid(true);
|
|
7447
7496
|
}, [control]);
|
|
7448
|
-
return
|
|
7497
|
+
return React30.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);
|
|
7449
7498
|
}
|
|
7450
7499
|
var isString = (value) => typeof value === "string";
|
|
7451
7500
|
var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {
|
|
@@ -7494,12 +7543,12 @@ function deepEqual(object1, object2, _internal_visited = /* @__PURE__ */ new Wea
|
|
|
7494
7543
|
function useWatch(props) {
|
|
7495
7544
|
const methods = useFormContext();
|
|
7496
7545
|
const { control = methods.control, name, defaultValue, disabled, exact, compute } = props || {};
|
|
7497
|
-
const _defaultValue =
|
|
7498
|
-
const _compute =
|
|
7499
|
-
const _computeFormValues =
|
|
7546
|
+
const _defaultValue = React30.useRef(defaultValue);
|
|
7547
|
+
const _compute = React30.useRef(compute);
|
|
7548
|
+
const _computeFormValues = React30.useRef(void 0);
|
|
7500
7549
|
_compute.current = compute;
|
|
7501
|
-
const defaultValueMemo =
|
|
7502
|
-
const [value, updateValue] =
|
|
7550
|
+
const defaultValueMemo = React30.useMemo(() => control._getWatch(name, _defaultValue.current), [control, name]);
|
|
7551
|
+
const [value, updateValue] = React30.useState(_compute.current ? _compute.current(defaultValueMemo) : defaultValueMemo);
|
|
7503
7552
|
useIsomorphicLayoutEffect(() => control._subscribe({
|
|
7504
7553
|
name,
|
|
7505
7554
|
formState: {
|
|
@@ -7521,14 +7570,14 @@ function useWatch(props) {
|
|
|
7521
7570
|
}
|
|
7522
7571
|
}
|
|
7523
7572
|
}), [control, disabled, name, exact]);
|
|
7524
|
-
|
|
7573
|
+
React30.useEffect(() => control._removeUnmounted());
|
|
7525
7574
|
return value;
|
|
7526
7575
|
}
|
|
7527
7576
|
function useController(props) {
|
|
7528
7577
|
const methods = useFormContext();
|
|
7529
7578
|
const { name, disabled, control = methods.control, shouldUnregister, defaultValue } = props;
|
|
7530
7579
|
const isArrayField = isNameInFieldArray(control._names.array, name);
|
|
7531
|
-
const defaultValueMemo =
|
|
7580
|
+
const defaultValueMemo = React30.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
|
|
7532
7581
|
const value = useWatch({
|
|
7533
7582
|
control,
|
|
7534
7583
|
name,
|
|
@@ -7540,15 +7589,15 @@ function useController(props) {
|
|
|
7540
7589
|
name,
|
|
7541
7590
|
exact: true
|
|
7542
7591
|
});
|
|
7543
|
-
const _props =
|
|
7544
|
-
const _previousNameRef =
|
|
7545
|
-
const _registerProps =
|
|
7592
|
+
const _props = React30.useRef(props);
|
|
7593
|
+
const _previousNameRef = React30.useRef(void 0);
|
|
7594
|
+
const _registerProps = React30.useRef(control.register(name, {
|
|
7546
7595
|
...props.rules,
|
|
7547
7596
|
value,
|
|
7548
7597
|
...isBoolean(props.disabled) ? { disabled: props.disabled } : {}
|
|
7549
7598
|
}));
|
|
7550
7599
|
_props.current = props;
|
|
7551
|
-
const fieldState =
|
|
7600
|
+
const fieldState = React30.useMemo(() => Object.defineProperties({}, {
|
|
7552
7601
|
invalid: {
|
|
7553
7602
|
enumerable: true,
|
|
7554
7603
|
get: () => !!get(formState.errors, name)
|
|
@@ -7570,21 +7619,21 @@ function useController(props) {
|
|
|
7570
7619
|
get: () => get(formState.errors, name)
|
|
7571
7620
|
}
|
|
7572
7621
|
}), [formState, name]);
|
|
7573
|
-
const onChange =
|
|
7622
|
+
const onChange = React30.useCallback((event) => _registerProps.current.onChange({
|
|
7574
7623
|
target: {
|
|
7575
7624
|
value: getEventValue(event),
|
|
7576
7625
|
name
|
|
7577
7626
|
},
|
|
7578
7627
|
type: EVENTS.CHANGE
|
|
7579
7628
|
}), [name]);
|
|
7580
|
-
const onBlur =
|
|
7629
|
+
const onBlur = React30.useCallback(() => _registerProps.current.onBlur({
|
|
7581
7630
|
target: {
|
|
7582
7631
|
value: get(control._formValues, name),
|
|
7583
7632
|
name
|
|
7584
7633
|
},
|
|
7585
7634
|
type: EVENTS.BLUR
|
|
7586
7635
|
}), [name, control._formValues]);
|
|
7587
|
-
const ref =
|
|
7636
|
+
const ref = React30.useCallback((elm) => {
|
|
7588
7637
|
const field2 = get(control._fields, name);
|
|
7589
7638
|
if (field2 && elm) {
|
|
7590
7639
|
field2._f.ref = {
|
|
@@ -7595,7 +7644,7 @@ function useController(props) {
|
|
|
7595
7644
|
};
|
|
7596
7645
|
}
|
|
7597
7646
|
}, [control._fields, name]);
|
|
7598
|
-
const field =
|
|
7647
|
+
const field = React30.useMemo(() => ({
|
|
7599
7648
|
name,
|
|
7600
7649
|
value,
|
|
7601
7650
|
...isBoolean(disabled) || formState.disabled ? { disabled: formState.disabled || disabled } : {},
|
|
@@ -7603,7 +7652,7 @@ function useController(props) {
|
|
|
7603
7652
|
onBlur,
|
|
7604
7653
|
ref
|
|
7605
7654
|
}), [name, disabled, formState.disabled, onChange, onBlur, ref, value]);
|
|
7606
|
-
|
|
7655
|
+
React30.useEffect(() => {
|
|
7607
7656
|
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
|
7608
7657
|
const previousName = _previousNameRef.current;
|
|
7609
7658
|
if (previousName && previousName !== name && !isArrayField) {
|
|
@@ -7633,13 +7682,13 @@ function useController(props) {
|
|
|
7633
7682
|
(isArrayField ? _shouldUnregisterField && !control._state.action : _shouldUnregisterField) ? control.unregister(name) : updateMounted(name, false);
|
|
7634
7683
|
};
|
|
7635
7684
|
}, [name, control, isArrayField, shouldUnregister]);
|
|
7636
|
-
|
|
7685
|
+
React30.useEffect(() => {
|
|
7637
7686
|
control._setDisabledField({
|
|
7638
7687
|
disabled,
|
|
7639
7688
|
name
|
|
7640
7689
|
});
|
|
7641
7690
|
}, [disabled, name, control]);
|
|
7642
|
-
return
|
|
7691
|
+
return React30.useMemo(() => ({
|
|
7643
7692
|
field,
|
|
7644
7693
|
formState,
|
|
7645
7694
|
fieldState
|
|
@@ -8958,9 +9007,9 @@ function createFormControl(props = {}) {
|
|
|
8958
9007
|
};
|
|
8959
9008
|
}
|
|
8960
9009
|
function useForm(props = {}) {
|
|
8961
|
-
const _formControl =
|
|
8962
|
-
const _values =
|
|
8963
|
-
const [formState, updateFormState] =
|
|
9010
|
+
const _formControl = React30.useRef(void 0);
|
|
9011
|
+
const _values = React30.useRef(void 0);
|
|
9012
|
+
const [formState, updateFormState] = React30.useState({
|
|
8964
9013
|
isDirty: false,
|
|
8965
9014
|
isValidating: false,
|
|
8966
9015
|
isLoading: isFunction(props.defaultValues),
|
|
@@ -9009,8 +9058,8 @@ function useForm(props = {}) {
|
|
|
9009
9058
|
control._formState.isReady = true;
|
|
9010
9059
|
return sub;
|
|
9011
9060
|
}, [control]);
|
|
9012
|
-
|
|
9013
|
-
|
|
9061
|
+
React30.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
|
|
9062
|
+
React30.useEffect(() => {
|
|
9014
9063
|
if (props.mode) {
|
|
9015
9064
|
control._options.mode = props.mode;
|
|
9016
9065
|
}
|
|
@@ -9018,18 +9067,18 @@ function useForm(props = {}) {
|
|
|
9018
9067
|
control._options.reValidateMode = props.reValidateMode;
|
|
9019
9068
|
}
|
|
9020
9069
|
}, [control, props.mode, props.reValidateMode]);
|
|
9021
|
-
|
|
9070
|
+
React30.useEffect(() => {
|
|
9022
9071
|
if (props.errors) {
|
|
9023
9072
|
control._setErrors(props.errors);
|
|
9024
9073
|
control._focusError();
|
|
9025
9074
|
}
|
|
9026
9075
|
}, [control, props.errors]);
|
|
9027
|
-
|
|
9076
|
+
React30.useEffect(() => {
|
|
9028
9077
|
props.shouldUnregister && control._subjects.state.next({
|
|
9029
9078
|
values: control._getWatch()
|
|
9030
9079
|
});
|
|
9031
9080
|
}, [control, props.shouldUnregister]);
|
|
9032
|
-
|
|
9081
|
+
React30.useEffect(() => {
|
|
9033
9082
|
if (control._proxyFormState.isDirty) {
|
|
9034
9083
|
const isDirty = control._getDirty();
|
|
9035
9084
|
if (isDirty !== formState.isDirty) {
|
|
@@ -9039,7 +9088,7 @@ function useForm(props = {}) {
|
|
|
9039
9088
|
}
|
|
9040
9089
|
}
|
|
9041
9090
|
}, [control, formState.isDirty]);
|
|
9042
|
-
|
|
9091
|
+
React30.useEffect(() => {
|
|
9043
9092
|
if (props.values && !deepEqual(props.values, _values.current)) {
|
|
9044
9093
|
control._reset(props.values, {
|
|
9045
9094
|
keepFieldsRef: true,
|
|
@@ -9051,7 +9100,7 @@ function useForm(props = {}) {
|
|
|
9051
9100
|
control._resetDefaultValues();
|
|
9052
9101
|
}
|
|
9053
9102
|
}, [control, props.values]);
|
|
9054
|
-
|
|
9103
|
+
React30.useEffect(() => {
|
|
9055
9104
|
if (!control._state.mount) {
|
|
9056
9105
|
control._setValid();
|
|
9057
9106
|
control._state.mount = true;
|
|
@@ -9069,7 +9118,7 @@ function useForm(props = {}) {
|
|
|
9069
9118
|
// ../../components/ui/Form.tsx
|
|
9070
9119
|
import { useTranslations as useTranslations8 } from "next-intl";
|
|
9071
9120
|
import { jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
9072
|
-
var FormConfigContext =
|
|
9121
|
+
var FormConfigContext = React31.createContext({ size: "md" });
|
|
9073
9122
|
var FormWrapper = ({
|
|
9074
9123
|
children,
|
|
9075
9124
|
onSubmit,
|
|
@@ -9082,7 +9131,7 @@ var FormWrapper = ({
|
|
|
9082
9131
|
const methods = useForm({
|
|
9083
9132
|
defaultValues: initialValues
|
|
9084
9133
|
});
|
|
9085
|
-
|
|
9134
|
+
React31.useEffect(() => {
|
|
9086
9135
|
if (initialValues) {
|
|
9087
9136
|
methods.reset(initialValues);
|
|
9088
9137
|
}
|
|
@@ -9091,15 +9140,15 @@ var FormWrapper = ({
|
|
|
9091
9140
|
return /* @__PURE__ */ jsx40(FormProvider, { ...methods, children: /* @__PURE__ */ jsx40(FormConfigContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx40("form", { onSubmit: methods.handleSubmit(onSubmit), className, ...formProps, children }) }) });
|
|
9092
9141
|
};
|
|
9093
9142
|
var Form = FormWrapper;
|
|
9094
|
-
var FormFieldContext =
|
|
9143
|
+
var FormFieldContext = React31.createContext({});
|
|
9095
9144
|
var FormField = ({
|
|
9096
9145
|
...props
|
|
9097
9146
|
}) => {
|
|
9098
9147
|
return /* @__PURE__ */ jsx40(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx40(Controller, { ...props }) });
|
|
9099
9148
|
};
|
|
9100
9149
|
var useFormField = () => {
|
|
9101
|
-
const fieldContext =
|
|
9102
|
-
const itemContext =
|
|
9150
|
+
const fieldContext = React31.useContext(FormFieldContext);
|
|
9151
|
+
const itemContext = React31.useContext(FormItemContext);
|
|
9103
9152
|
const { getFieldState, formState } = useFormContext();
|
|
9104
9153
|
if (!fieldContext) {
|
|
9105
9154
|
try {
|
|
@@ -9120,20 +9169,20 @@ var useFormField = () => {
|
|
|
9120
9169
|
...fieldState
|
|
9121
9170
|
};
|
|
9122
9171
|
};
|
|
9123
|
-
var FormItemContext =
|
|
9124
|
-
var FormItem =
|
|
9125
|
-
const id =
|
|
9172
|
+
var FormItemContext = React31.createContext({});
|
|
9173
|
+
var FormItem = React31.forwardRef(({ className, ...props }, ref) => {
|
|
9174
|
+
const id = React31.useId();
|
|
9126
9175
|
return /* @__PURE__ */ jsx40(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx40("div", { ref, className: cn("space-y-2", className), ...props }) });
|
|
9127
9176
|
});
|
|
9128
9177
|
FormItem.displayName = "FormItem";
|
|
9129
|
-
var FormLabel =
|
|
9178
|
+
var FormLabel = React31.forwardRef(({ className, ...props }, ref) => {
|
|
9130
9179
|
const { error, formItemId } = useFormField();
|
|
9131
|
-
const config =
|
|
9180
|
+
const config = React31.useContext(FormConfigContext);
|
|
9132
9181
|
const sizeClass = config.size === "sm" ? "text-xs" : config.size === "lg" ? "text-base" : "text-sm";
|
|
9133
9182
|
return /* @__PURE__ */ jsx40(Label, { ref, className: cn(sizeClass, error && "text-destructive", className), htmlFor: formItemId, ...props });
|
|
9134
9183
|
});
|
|
9135
9184
|
FormLabel.displayName = "FormLabel";
|
|
9136
|
-
var FormControl =
|
|
9185
|
+
var FormControl = React31.forwardRef(({ ...props }, ref) => {
|
|
9137
9186
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
9138
9187
|
return /* @__PURE__ */ jsx40(
|
|
9139
9188
|
"div",
|
|
@@ -9147,12 +9196,12 @@ var FormControl = React32.forwardRef(({ ...props }, ref) => {
|
|
|
9147
9196
|
);
|
|
9148
9197
|
});
|
|
9149
9198
|
FormControl.displayName = "FormControl";
|
|
9150
|
-
var FormDescription =
|
|
9199
|
+
var FormDescription = React31.forwardRef(({ className, ...props }, ref) => {
|
|
9151
9200
|
const { formDescriptionId } = useFormField();
|
|
9152
9201
|
return /* @__PURE__ */ jsx40("p", { ref, id: formDescriptionId, className: cn("text-sm text-muted-foreground", className), ...props });
|
|
9153
9202
|
});
|
|
9154
9203
|
FormDescription.displayName = "FormDescription";
|
|
9155
|
-
var FormMessage =
|
|
9204
|
+
var FormMessage = React31.forwardRef(({ className, children, ...props }, ref) => {
|
|
9156
9205
|
const { error, formMessageId } = useFormField();
|
|
9157
9206
|
const body = error ? String(error?.message) : children;
|
|
9158
9207
|
if (!body) {
|
|
@@ -9161,7 +9210,7 @@ var FormMessage = React32.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
9161
9210
|
return /* @__PURE__ */ jsx40("p", { ref, id: formMessageId, className: cn("text-sm font-medium text-destructive", className), ...props, children: body });
|
|
9162
9211
|
});
|
|
9163
9212
|
FormMessage.displayName = "FormMessage";
|
|
9164
|
-
var FormInput =
|
|
9213
|
+
var FormInput = React31.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ jsx40(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx40(
|
|
9165
9214
|
FormField,
|
|
9166
9215
|
{
|
|
9167
9216
|
name,
|
|
@@ -9172,7 +9221,7 @@ var FormInput = React32.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */
|
|
|
9172
9221
|
}
|
|
9173
9222
|
) }));
|
|
9174
9223
|
FormInput.displayName = "FormInput";
|
|
9175
|
-
var FormCheckbox =
|
|
9224
|
+
var FormCheckbox = React31.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ jsx40(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx40(
|
|
9176
9225
|
FormField,
|
|
9177
9226
|
{
|
|
9178
9227
|
name,
|
|
@@ -9196,9 +9245,9 @@ var FormCheckbox = React32.forwardRef(({ name, ...props }, ref) => /* @__PURE__
|
|
|
9196
9245
|
}
|
|
9197
9246
|
) }));
|
|
9198
9247
|
FormCheckbox.displayName = "FormCheckbox";
|
|
9199
|
-
var FormActions =
|
|
9248
|
+
var FormActions = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40("div", { ref, className: cn("flex gap-2 justify-end", className), ...props }));
|
|
9200
9249
|
FormActions.displayName = "FormActions";
|
|
9201
|
-
var FormSubmitButton =
|
|
9250
|
+
var FormSubmitButton = React31.forwardRef(({ children, loading: loading2, ...props }, ref) => /* @__PURE__ */ jsx40(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx40(Button_default, { ref, type: "submit", size: props.size ?? size, disabled: loading2, ...props, children }) }));
|
|
9202
9251
|
FormSubmitButton.displayName = "FormSubmitButton";
|
|
9203
9252
|
|
|
9204
9253
|
// ../../components/ui/NotificationModal.tsx
|
|
@@ -9279,10 +9328,10 @@ import { usePathname } from "next/navigation";
|
|
|
9279
9328
|
import { Phone } from "lucide-react";
|
|
9280
9329
|
|
|
9281
9330
|
// ../../node_modules/react-icons/lib/iconBase.mjs
|
|
9282
|
-
import
|
|
9331
|
+
import React33 from "react";
|
|
9283
9332
|
|
|
9284
9333
|
// ../../node_modules/react-icons/lib/iconContext.mjs
|
|
9285
|
-
import
|
|
9334
|
+
import React32 from "react";
|
|
9286
9335
|
var DefaultContext = {
|
|
9287
9336
|
color: void 0,
|
|
9288
9337
|
size: void 0,
|
|
@@ -9290,7 +9339,7 @@ var DefaultContext = {
|
|
|
9290
9339
|
style: void 0,
|
|
9291
9340
|
attr: void 0
|
|
9292
9341
|
};
|
|
9293
|
-
var IconContext =
|
|
9342
|
+
var IconContext = React32.createContext && /* @__PURE__ */ React32.createContext(DefaultContext);
|
|
9294
9343
|
|
|
9295
9344
|
// ../../node_modules/react-icons/lib/iconBase.mjs
|
|
9296
9345
|
var _excluded = ["attr", "size", "title"];
|
|
@@ -9379,12 +9428,12 @@ function _toPrimitive(t, r) {
|
|
|
9379
9428
|
return ("string" === r ? String : Number)(t);
|
|
9380
9429
|
}
|
|
9381
9430
|
function Tree2Element(tree) {
|
|
9382
|
-
return tree && tree.map((node, i) => /* @__PURE__ */
|
|
9431
|
+
return tree && tree.map((node, i) => /* @__PURE__ */ React33.createElement(node.tag, _objectSpread({
|
|
9383
9432
|
key: i
|
|
9384
9433
|
}, node.attr), Tree2Element(node.child)));
|
|
9385
9434
|
}
|
|
9386
9435
|
function GenIcon(data) {
|
|
9387
|
-
return (props) => /* @__PURE__ */
|
|
9436
|
+
return (props) => /* @__PURE__ */ React33.createElement(IconBase, _extends({
|
|
9388
9437
|
attr: _objectSpread({}, data.attr)
|
|
9389
9438
|
}, props), Tree2Element(data.child));
|
|
9390
9439
|
}
|
|
@@ -9399,7 +9448,7 @@ function IconBase(props) {
|
|
|
9399
9448
|
var className;
|
|
9400
9449
|
if (conf.className) className = conf.className;
|
|
9401
9450
|
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
9402
|
-
return /* @__PURE__ */
|
|
9451
|
+
return /* @__PURE__ */ React33.createElement("svg", _extends({
|
|
9403
9452
|
stroke: "currentColor",
|
|
9404
9453
|
fill: "currentColor",
|
|
9405
9454
|
strokeWidth: "0"
|
|
@@ -9411,9 +9460,9 @@ function IconBase(props) {
|
|
|
9411
9460
|
height: computedSize,
|
|
9412
9461
|
width: computedSize,
|
|
9413
9462
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9414
|
-
}), title && /* @__PURE__ */
|
|
9463
|
+
}), title && /* @__PURE__ */ React33.createElement("title", null, title), props.children);
|
|
9415
9464
|
};
|
|
9416
|
-
return IconContext !== void 0 ? /* @__PURE__ */
|
|
9465
|
+
return IconContext !== void 0 ? /* @__PURE__ */ React33.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
|
9417
9466
|
}
|
|
9418
9467
|
|
|
9419
9468
|
// ../../node_modules/react-icons/fa/index.mjs
|
|
@@ -9545,7 +9594,7 @@ function AccessDenied({
|
|
|
9545
9594
|
|
|
9546
9595
|
// ../../components/ui/ThemeToggleHeadless.tsx
|
|
9547
9596
|
import { Moon, Sun, Monitor } from "lucide-react";
|
|
9548
|
-
import { useEffect as
|
|
9597
|
+
import { useEffect as useEffect16, useRef as useRef10, useState as useState26 } from "react";
|
|
9549
9598
|
import { createPortal as createPortal9 } from "react-dom";
|
|
9550
9599
|
import { Fragment as Fragment11, jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
9551
9600
|
function ThemeToggleHeadless({
|
|
@@ -9554,11 +9603,11 @@ function ThemeToggleHeadless({
|
|
|
9554
9603
|
labels,
|
|
9555
9604
|
className
|
|
9556
9605
|
}) {
|
|
9557
|
-
const [isOpen, setIsOpen] =
|
|
9558
|
-
const [mounted, setMounted] =
|
|
9606
|
+
const [isOpen, setIsOpen] = useState26(false);
|
|
9607
|
+
const [mounted, setMounted] = useState26(false);
|
|
9559
9608
|
const triggerRef = useRef10(null);
|
|
9560
|
-
const [dropdownPosition, setDropdownPosition] =
|
|
9561
|
-
|
|
9609
|
+
const [dropdownPosition, setDropdownPosition] = useState26(null);
|
|
9610
|
+
useEffect16(() => setMounted(true), []);
|
|
9562
9611
|
const themes = [
|
|
9563
9612
|
{ value: "light", label: labels?.light ?? "Light", icon: Sun },
|
|
9564
9613
|
{ value: "dark", label: labels?.dark ?? "Dark", icon: Moon },
|
|
@@ -9647,7 +9696,7 @@ function ThemeToggleHeadless({
|
|
|
9647
9696
|
}
|
|
9648
9697
|
|
|
9649
9698
|
// ../../components/ui/LanguageSwitcherHeadless.tsx
|
|
9650
|
-
import { useRef as useRef11, useState as
|
|
9699
|
+
import { useRef as useRef11, useState as useState27 } from "react";
|
|
9651
9700
|
import { createPortal as createPortal10 } from "react-dom";
|
|
9652
9701
|
import { Globe } from "lucide-react";
|
|
9653
9702
|
import { Fragment as Fragment12, jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
@@ -9658,8 +9707,8 @@ function LanguageSwitcherHeadless({
|
|
|
9658
9707
|
labels,
|
|
9659
9708
|
className
|
|
9660
9709
|
}) {
|
|
9661
|
-
const [isOpen, setIsOpen] =
|
|
9662
|
-
const [dropdownPosition, setDropdownPosition] =
|
|
9710
|
+
const [isOpen, setIsOpen] = useState27(false);
|
|
9711
|
+
const [dropdownPosition, setDropdownPosition] = useState27(null);
|
|
9663
9712
|
const triggerButtonRef = useRef11(null);
|
|
9664
9713
|
const currentLanguage = locales.find((l) => l.code === currentLocale) || locales[0];
|
|
9665
9714
|
const calculatePosition = () => {
|