@prediktif/ui 0.1.24 → 0.1.26
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.d.mts +182 -3
- package/dist/index.d.ts +182 -3
- package/dist/index.js +1561 -478
- package/dist/index.mjs +1525 -449
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -60,8 +60,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
60
60
|
// src/index.ts
|
|
61
61
|
var index_exports = {};
|
|
62
62
|
__export(index_exports, {
|
|
63
|
+
ActiveTokensStatus: () => ActiveTokensStatus,
|
|
63
64
|
AppSidebar: () => AppSidebar,
|
|
65
|
+
AvatarGroupInvitations: () => AvatarGroupInvitations,
|
|
66
|
+
AvatarGroupUsers: () => AvatarGroupUsers,
|
|
67
|
+
AvatarInvitations: () => AvatarInvitations,
|
|
64
68
|
AvatarUser: () => AvatarUser,
|
|
69
|
+
AvatarUsers: () => AvatarUsers,
|
|
70
|
+
CodeLabel: () => CodeLabel,
|
|
71
|
+
CopyableCode: () => CopyableCode,
|
|
72
|
+
DEFAULT_METADATA_FIELDS: () => DEFAULT_METADATA_FIELDS,
|
|
65
73
|
DataTable: () => DataTable,
|
|
66
74
|
DataTableContentBody: () => DataTableContentBody,
|
|
67
75
|
DataTableContentHeader: () => DataTableContentHeader,
|
|
@@ -74,14 +82,32 @@ __export(index_exports, {
|
|
|
74
82
|
DataTableHeaderSearch: () => DataTableHeaderSearch,
|
|
75
83
|
DataTableHeaderSort: () => DataTableHeaderSort,
|
|
76
84
|
DataTableHeaderToggle: () => DataTableHeaderToggle,
|
|
85
|
+
DescriptionLabel: () => DescriptionLabel,
|
|
77
86
|
EmailLabel: () => EmailLabel,
|
|
78
87
|
EmailVerified: () => EmailVerified,
|
|
79
88
|
GoogleIcon: () => GoogleIcon,
|
|
80
89
|
HeaderTabs: () => HeaderTabs,
|
|
81
90
|
HeaderTitle: () => HeaderTitle,
|
|
91
|
+
ItemStatus: () => ItemStatus,
|
|
82
92
|
JoinedLabel: () => JoinedLabel,
|
|
93
|
+
MetadataProgress: () => MetadataProgress,
|
|
94
|
+
MetadataStatus: () => MetadataStatus,
|
|
95
|
+
OrganizationInvitations: () => OrganizationInvitations,
|
|
96
|
+
OrganizationRoleBadge: () => OrganizationRoleBadge,
|
|
97
|
+
OrganizationRoles: () => OrganizationRoles,
|
|
98
|
+
PermissionBadges: () => PermissionBadges,
|
|
99
|
+
PermissionsBadges: () => PermissionsBadges,
|
|
100
|
+
ProgressStatus: () => ProgressStatus,
|
|
101
|
+
RedirectUriLabel: () => RedirectUriLabel,
|
|
102
|
+
RedirectUris: () => RedirectUris,
|
|
83
103
|
RowActions: () => RowActions,
|
|
104
|
+
RunningStatus: () => RunningStatus,
|
|
105
|
+
SlugLabel: () => SlugLabel,
|
|
84
106
|
StateEmpty: () => StateEmpty,
|
|
107
|
+
StatusBadge: () => StatusBadge,
|
|
108
|
+
TokenActivity: () => TokenActivity,
|
|
109
|
+
UrisLabel: () => UrisLabel,
|
|
110
|
+
UrisList: () => UrisList,
|
|
85
111
|
UserRole: () => UserRole,
|
|
86
112
|
UserStatus: () => UserStatus,
|
|
87
113
|
exportToCSV: () => exportToCSV,
|
|
@@ -369,6 +395,36 @@ function AvatarFallback(_a) {
|
|
|
369
395
|
}, props)
|
|
370
396
|
);
|
|
371
397
|
}
|
|
398
|
+
function AvatarGroup(_a) {
|
|
399
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
401
|
+
"div",
|
|
402
|
+
__spreadValues({
|
|
403
|
+
"data-slot": "avatar-group",
|
|
404
|
+
className: (0, import_cn3.cn)(
|
|
405
|
+
"group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
|
|
406
|
+
className
|
|
407
|
+
)
|
|
408
|
+
}, props)
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
function AvatarGroupCount(_a) {
|
|
412
|
+
var _b = _a, {
|
|
413
|
+
className
|
|
414
|
+
} = _b, props = __objRest(_b, [
|
|
415
|
+
"className"
|
|
416
|
+
]);
|
|
417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
418
|
+
"div",
|
|
419
|
+
__spreadValues({
|
|
420
|
+
"data-slot": "avatar-group-count",
|
|
421
|
+
className: (0, import_cn3.cn)(
|
|
422
|
+
"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs/relaxed text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
|
|
423
|
+
className
|
|
424
|
+
)
|
|
425
|
+
}, props)
|
|
426
|
+
);
|
|
427
|
+
}
|
|
372
428
|
|
|
373
429
|
// src/components/ui/breadcrumb.tsx
|
|
374
430
|
var import_merge_props = require("@base-ui/react/merge-props");
|
|
@@ -1347,7 +1403,7 @@ function isRouteActive(url, pathname) {
|
|
|
1347
1403
|
if (cleanUrl === "/") return cleanPath === "/";
|
|
1348
1404
|
return cleanPath === cleanUrl || cleanPath.startsWith(`${cleanUrl}/`);
|
|
1349
1405
|
}
|
|
1350
|
-
|
|
1406
|
+
function AppSidebarInner({
|
|
1351
1407
|
name = "",
|
|
1352
1408
|
email = "",
|
|
1353
1409
|
orgRole = "",
|
|
@@ -1356,7 +1412,6 @@ var AppSidebar = (0, import_react.memo)(function AppSidebar2({
|
|
|
1356
1412
|
confirmDialog = false,
|
|
1357
1413
|
headerDropdown = false,
|
|
1358
1414
|
image,
|
|
1359
|
-
defaultOpen = true,
|
|
1360
1415
|
navMainItems,
|
|
1361
1416
|
navSecondaryItems = [],
|
|
1362
1417
|
organizations,
|
|
@@ -1364,11 +1419,19 @@ var AppSidebar = (0, import_react.memo)(function AppSidebar2({
|
|
|
1364
1419
|
setActiveOrg,
|
|
1365
1420
|
children
|
|
1366
1421
|
}) {
|
|
1367
|
-
const _isMobile = useIsMobile();
|
|
1368
1422
|
const pathname = (0, import_navigation.usePathname)();
|
|
1423
|
+
const { setOpenMobile } = useSidebar();
|
|
1369
1424
|
const segments = pathname ? pathname.split("/").filter(Boolean) : [];
|
|
1425
|
+
(0, import_react.useEffect)(() => {
|
|
1426
|
+
if (pathname) {
|
|
1427
|
+
setOpenMobile(false);
|
|
1428
|
+
}
|
|
1429
|
+
}, [pathname, setOpenMobile]);
|
|
1430
|
+
const handleLinkClick = () => {
|
|
1431
|
+
setOpenMobile(false);
|
|
1432
|
+
};
|
|
1370
1433
|
const initials = name ? name.trim().split(" ").map((n) => n[0]).join("").substring(0, 2).toUpperCase() : "U";
|
|
1371
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1372
1435
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Sidebar, { collapsible: "icon", children: [
|
|
1373
1436
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarHeader, { children: headerDropdown ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(DropdownMenu, { children: [
|
|
1374
1437
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
@@ -1417,55 +1480,73 @@ var AppSidebar = (0, import_react.memo)(function AppSidebar2({
|
|
|
1417
1480
|
] })
|
|
1418
1481
|
}
|
|
1419
1482
|
)
|
|
1420
|
-
] }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1462
|
-
]
|
|
1463
|
-
}
|
|
1464
|
-
),
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1483
|
+
] }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1484
|
+
SidebarMenuButton,
|
|
1485
|
+
{
|
|
1486
|
+
size: "lg",
|
|
1487
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_link.default, { href: "/", onClick: handleLinkClick }),
|
|
1488
|
+
children: [
|
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.Command, { className: "size-4" }) }),
|
|
1490
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate font-medium", children: brand }),
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate text-xs capitalize", children: orgRole })
|
|
1493
|
+
] })
|
|
1494
|
+
]
|
|
1495
|
+
}
|
|
1496
|
+
) }) }) }),
|
|
1497
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1498
|
+
SidebarContent,
|
|
1499
|
+
{
|
|
1500
|
+
onClick: (e) => {
|
|
1501
|
+
const target = e.target;
|
|
1502
|
+
if (target.closest("a")) {
|
|
1503
|
+
setOpenMobile(false);
|
|
1504
|
+
}
|
|
1505
|
+
},
|
|
1506
|
+
children: [
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SidebarGroup, { children: [
|
|
1508
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarGroupLabel, { children: "Platform" }),
|
|
1509
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenu, { children: navMainItems.map(({ title, url, icon, locked }) => {
|
|
1510
|
+
const isActive = isRouteActive(url, pathname);
|
|
1511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SidebarMenuItem, { children: [
|
|
1512
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1513
|
+
SidebarMenuButton,
|
|
1514
|
+
{
|
|
1515
|
+
isActive,
|
|
1516
|
+
tooltip: title,
|
|
1517
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_link.default, { href: url, onClick: handleLinkClick }),
|
|
1518
|
+
children: [
|
|
1519
|
+
renderNavIcon(icon),
|
|
1520
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: title })
|
|
1521
|
+
]
|
|
1522
|
+
}
|
|
1523
|
+
),
|
|
1524
|
+
locked && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenuBadge, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.LockIcon, { size: 12 }) })
|
|
1525
|
+
] }, title);
|
|
1526
|
+
}) })
|
|
1527
|
+
] }),
|
|
1528
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarGroup, { className: "mt-auto", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarGroupContent, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenu, { children: navSecondaryItems.map(({ title, url, icon, locked }) => {
|
|
1529
|
+
const isActive = isRouteActive(url, pathname);
|
|
1530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SidebarMenuItem, { children: [
|
|
1531
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1532
|
+
SidebarMenuButton,
|
|
1533
|
+
{
|
|
1534
|
+
size: "sm",
|
|
1535
|
+
isActive,
|
|
1536
|
+
tooltip: title,
|
|
1537
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_link.default, { href: url, onClick: handleLinkClick }),
|
|
1538
|
+
children: [
|
|
1539
|
+
renderNavIcon(icon),
|
|
1540
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: title })
|
|
1541
|
+
]
|
|
1542
|
+
}
|
|
1543
|
+
),
|
|
1544
|
+
locked && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenuBadge, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.LockIcon, { size: 12 }) })
|
|
1545
|
+
] }, title);
|
|
1546
|
+
}) }) }) })
|
|
1547
|
+
]
|
|
1548
|
+
}
|
|
1549
|
+
),
|
|
1469
1550
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenuItem, { children: confirmDialog ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(AlertDialog, { children: [
|
|
1470
1551
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1471
1552
|
AlertDialogTrigger,
|
|
@@ -1493,22 +1574,36 @@ var AppSidebar = (0, import_react.memo)(function AppSidebar2({
|
|
|
1493
1574
|
AlertDialogAction,
|
|
1494
1575
|
{
|
|
1495
1576
|
nativeButton: false,
|
|
1496
|
-
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1577
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1578
|
+
import_link.default,
|
|
1579
|
+
{
|
|
1580
|
+
href,
|
|
1581
|
+
target: "_blank",
|
|
1582
|
+
onClick: handleLinkClick
|
|
1583
|
+
}
|
|
1584
|
+
),
|
|
1497
1585
|
children: "Continue"
|
|
1498
1586
|
}
|
|
1499
1587
|
)
|
|
1500
1588
|
] })
|
|
1501
1589
|
] })
|
|
1502
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1590
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1591
|
+
SidebarMenuButton,
|
|
1592
|
+
{
|
|
1593
|
+
size: "lg",
|
|
1594
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_link.default, { href, onClick: handleLinkClick }),
|
|
1595
|
+
children: [
|
|
1596
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Avatar, { children: [
|
|
1597
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AvatarImage, { src: image || "", alt: name || "" }),
|
|
1598
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AvatarFallback, { children: initials })
|
|
1599
|
+
] }),
|
|
1600
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
1601
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate font-medium", children: name }),
|
|
1602
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: email })
|
|
1603
|
+
] })
|
|
1604
|
+
]
|
|
1605
|
+
}
|
|
1606
|
+
) }) }) }),
|
|
1512
1607
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarRail, {})
|
|
1513
1608
|
] }),
|
|
1514
1609
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SidebarInset, { children: [
|
|
@@ -1535,46 +1630,329 @@ var AppSidebar = (0, import_react.memo)(function AppSidebar2({
|
|
|
1535
1630
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "p-4 pt-0", children })
|
|
1536
1631
|
] })
|
|
1537
1632
|
] });
|
|
1633
|
+
}
|
|
1634
|
+
var AppSidebar = (0, import_react.memo)(function AppSidebar2(_a) {
|
|
1635
|
+
var _b = _a, {
|
|
1636
|
+
defaultOpen = true
|
|
1637
|
+
} = _b, props = __objRest(_b, [
|
|
1638
|
+
"defaultOpen"
|
|
1639
|
+
]);
|
|
1640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarProvider, { defaultOpen, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AppSidebarInner, __spreadValues({}, props)) });
|
|
1538
1641
|
});
|
|
1539
1642
|
|
|
1540
|
-
// src/components/composed/columns/avatar-
|
|
1643
|
+
// src/components/composed/columns/avatar-group-invitations.tsx
|
|
1541
1644
|
var import_react2 = require("react");
|
|
1542
1645
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1543
|
-
function getInitials(name) {
|
|
1646
|
+
function getInitials(name, email) {
|
|
1647
|
+
const target = (name || email || "U").trim();
|
|
1648
|
+
return target.split(/[\s.@]/).filter(Boolean).map((n) => n[0]).join("").slice(0, 1).toUpperCase();
|
|
1649
|
+
}
|
|
1650
|
+
var AvatarGroupInvitations = (0, import_react2.memo)(function AvatarGroupInvitations2({
|
|
1651
|
+
invitations,
|
|
1652
|
+
maxDisplay = 3,
|
|
1653
|
+
onlyPending = true,
|
|
1654
|
+
fallback = null,
|
|
1655
|
+
size = "sm",
|
|
1656
|
+
className
|
|
1657
|
+
}) {
|
|
1658
|
+
const list = invitations != null ? invitations : [];
|
|
1659
|
+
const targetInvites = onlyPending ? list.filter((i) => {
|
|
1660
|
+
var _a;
|
|
1661
|
+
return ((_a = i.status) == null ? void 0 : _a.toLowerCase()) === "pending";
|
|
1662
|
+
}) : list;
|
|
1663
|
+
if (targetInvites.length === 0) {
|
|
1664
|
+
if (!fallback) return null;
|
|
1665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: fallback });
|
|
1666
|
+
}
|
|
1667
|
+
const visibleInvites = targetInvites.slice(0, maxDisplay);
|
|
1668
|
+
const remainingCount = targetInvites.length - visibleInvites.length;
|
|
1669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(AvatarGroup, { className, children: [
|
|
1670
|
+
visibleInvites.map((inv, index) => {
|
|
1671
|
+
var _a, _b, _c, _d, _e;
|
|
1672
|
+
const displayName = ((_a = inv.invitedUser) == null ? void 0 : _a.name) || inv.email;
|
|
1673
|
+
const initials = getInitials((_b = inv.invitedUser) == null ? void 0 : _b.name, inv.email);
|
|
1674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Tooltip, { children: [
|
|
1675
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1676
|
+
TooltipTrigger,
|
|
1677
|
+
{
|
|
1678
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1679
|
+
Avatar,
|
|
1680
|
+
{
|
|
1681
|
+
size,
|
|
1682
|
+
className: "border border-dashed border-primary/40",
|
|
1683
|
+
children: [
|
|
1684
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1685
|
+
AvatarImage,
|
|
1686
|
+
{
|
|
1687
|
+
src: (_e = (_d = inv.invitedUser) == null ? void 0 : _d.image) != null ? _e : void 0,
|
|
1688
|
+
alt: displayName
|
|
1689
|
+
}
|
|
1690
|
+
),
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AvatarFallback, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-[10px]", children: initials }) })
|
|
1692
|
+
]
|
|
1693
|
+
}
|
|
1694
|
+
)
|
|
1695
|
+
}
|
|
1696
|
+
),
|
|
1697
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(TooltipContent, { children: [
|
|
1698
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "font-medium text-xs", children: displayName }),
|
|
1699
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
1700
|
+
"Invited as ",
|
|
1701
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "capitalize", children: inv.role })
|
|
1702
|
+
] })
|
|
1703
|
+
] })
|
|
1704
|
+
] }, (_c = inv.id) != null ? _c : `${displayName}-${index}`);
|
|
1705
|
+
}),
|
|
1706
|
+
remainingCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Tooltip, { children: [
|
|
1707
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1708
|
+
TooltipTrigger,
|
|
1709
|
+
{
|
|
1710
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(AvatarGroupCount, { className: "border border-dashed border-primary/40 text-[10px]", children: [
|
|
1711
|
+
"+",
|
|
1712
|
+
remainingCount
|
|
1713
|
+
] })
|
|
1714
|
+
}
|
|
1715
|
+
),
|
|
1716
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipContent, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-0.5 text-xs", children: [
|
|
1717
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "font-semibold text-xs mb-0.5", children: onlyPending ? "Other Pending Invitations:" : "Other Invitations:" }),
|
|
1718
|
+
targetInvites.slice(maxDisplay).map((rem, idx) => {
|
|
1719
|
+
var _a, _b;
|
|
1720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "text-xs", children: [
|
|
1721
|
+
((_b = rem.invitedUser) == null ? void 0 : _b.name) || rem.email,
|
|
1722
|
+
" (",
|
|
1723
|
+
rem.role,
|
|
1724
|
+
")"
|
|
1725
|
+
] }, (_a = rem.id) != null ? _a : `${rem.email}-${idx}`);
|
|
1726
|
+
})
|
|
1727
|
+
] }) })
|
|
1728
|
+
] })
|
|
1729
|
+
] });
|
|
1730
|
+
});
|
|
1731
|
+
var AvatarInvitations = AvatarGroupInvitations;
|
|
1732
|
+
var OrganizationInvitations = AvatarGroupInvitations;
|
|
1733
|
+
|
|
1734
|
+
// src/components/composed/columns/avatar-group-users.tsx
|
|
1735
|
+
var import_react3 = require("react");
|
|
1736
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1737
|
+
function getInitials2(name, email) {
|
|
1738
|
+
const target = (name || email || "U").trim();
|
|
1739
|
+
return target.split(" ").map((w) => w[0]).join("").slice(0, 2).toUpperCase();
|
|
1740
|
+
}
|
|
1741
|
+
var AvatarGroupUsers = (0, import_react3.memo)(function AvatarGroupUsers2({
|
|
1742
|
+
users,
|
|
1743
|
+
maxDisplay = 3,
|
|
1744
|
+
fallback = null,
|
|
1745
|
+
className,
|
|
1746
|
+
size = "sm"
|
|
1747
|
+
}) {
|
|
1748
|
+
const list = users != null ? users : [];
|
|
1749
|
+
if (list.length === 0) {
|
|
1750
|
+
if (!fallback) return null;
|
|
1751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: fallback });
|
|
1752
|
+
}
|
|
1753
|
+
const visibleUsers = list.slice(0, maxDisplay);
|
|
1754
|
+
const remainingCount = list.length - visibleUsers.length;
|
|
1755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(AvatarGroup, { className, children: [
|
|
1756
|
+
visibleUsers.map((u, index) => {
|
|
1757
|
+
var _a, _b;
|
|
1758
|
+
const initials = getInitials2(u.name, u.email);
|
|
1759
|
+
const displayName = u.name || u.email || "User";
|
|
1760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Tooltip, { children: [
|
|
1761
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1762
|
+
TooltipTrigger,
|
|
1763
|
+
{
|
|
1764
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Avatar, { size, children: [
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AvatarImage, { src: (_b = u.image) != null ? _b : void 0, alt: displayName }),
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AvatarFallback, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-[10px]", children: initials }) })
|
|
1767
|
+
] })
|
|
1768
|
+
}
|
|
1769
|
+
),
|
|
1770
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipContent, { children: displayName })
|
|
1771
|
+
] }, (_a = u.id) != null ? _a : `${displayName}-${index}`);
|
|
1772
|
+
}),
|
|
1773
|
+
remainingCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Tooltip, { children: [
|
|
1774
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1775
|
+
TooltipTrigger,
|
|
1776
|
+
{
|
|
1777
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(AvatarGroupCount, { className: "text-[10px]", children: [
|
|
1778
|
+
"+",
|
|
1779
|
+
remainingCount
|
|
1780
|
+
] })
|
|
1781
|
+
}
|
|
1782
|
+
),
|
|
1783
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipContent, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-col gap-0.5 text-xs", children: list.slice(maxDisplay).map((rem, idx) => {
|
|
1784
|
+
var _a, _b;
|
|
1785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: rem.name || rem.email }, (_b = rem.id) != null ? _b : `${(_a = rem.name) != null ? _a : rem.email}-${idx}`);
|
|
1786
|
+
}) }) })
|
|
1787
|
+
] })
|
|
1788
|
+
] });
|
|
1789
|
+
});
|
|
1790
|
+
var AvatarUsers = AvatarGroupUsers;
|
|
1791
|
+
|
|
1792
|
+
// src/components/composed/columns/avatar-user.tsx
|
|
1793
|
+
var import_cn12 = require("cn");
|
|
1794
|
+
var import_react4 = require("react");
|
|
1795
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1796
|
+
function getInitials3(name) {
|
|
1544
1797
|
if (name) {
|
|
1545
1798
|
return name.split(" ").map((w) => w[0]).join("").slice(0, 2).toUpperCase();
|
|
1546
1799
|
}
|
|
1547
1800
|
return "U";
|
|
1548
1801
|
}
|
|
1549
|
-
var AvatarUser = (0,
|
|
1802
|
+
var AvatarUser = (0, import_react4.memo)(function AvatarUser2({
|
|
1550
1803
|
name,
|
|
1551
|
-
image
|
|
1804
|
+
image,
|
|
1805
|
+
className,
|
|
1806
|
+
size = "sm"
|
|
1552
1807
|
}) {
|
|
1553
|
-
return /* @__PURE__ */ (0,
|
|
1554
|
-
/* @__PURE__ */ (0,
|
|
1555
|
-
/* @__PURE__ */ (0,
|
|
1556
|
-
/* @__PURE__ */ (0,
|
|
1808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_cn12.cn)("flex items-center gap-2", className), children: [
|
|
1809
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Avatar, { size, children: [
|
|
1810
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AvatarImage, { src: image != null ? image : void 0, alt: name != null ? name : void 0 }),
|
|
1811
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AvatarFallback, { children: getInitials3(name) })
|
|
1557
1812
|
] }),
|
|
1558
|
-
/* @__PURE__ */ (0,
|
|
1813
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-xs font-medium truncate", children: name })
|
|
1814
|
+
] });
|
|
1815
|
+
});
|
|
1816
|
+
|
|
1817
|
+
// src/components/composed/columns/copyable-code.tsx
|
|
1818
|
+
var import_cn14 = require("cn");
|
|
1819
|
+
var import_lucide_react7 = require("lucide-react");
|
|
1820
|
+
var import_react5 = require("react");
|
|
1821
|
+
|
|
1822
|
+
// src/components/ui/toast.tsx
|
|
1823
|
+
var import_toast = require("@base-ui/react/toast");
|
|
1824
|
+
var import_cn13 = require("cn");
|
|
1825
|
+
var import_lucide_react6 = require("lucide-react");
|
|
1826
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1827
|
+
var toast = import_toast.Toast.createToastManager();
|
|
1828
|
+
var createToastManager = import_toast.Toast.createToastManager;
|
|
1829
|
+
var useToastManager = import_toast.Toast.useToastManager;
|
|
1830
|
+
|
|
1831
|
+
// src/components/composed/columns/copyable-code.tsx
|
|
1832
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1833
|
+
var CopyableCode = (0, import_react5.memo)(function CopyableCode2({
|
|
1834
|
+
value,
|
|
1835
|
+
label,
|
|
1836
|
+
copyMessage,
|
|
1837
|
+
toastOnCopy = true,
|
|
1838
|
+
showTooltip = true,
|
|
1839
|
+
fallback = null,
|
|
1840
|
+
className,
|
|
1841
|
+
codeClassName,
|
|
1842
|
+
onCopy
|
|
1843
|
+
}) {
|
|
1844
|
+
const [copied, setCopied] = (0, import_react5.useState)(false);
|
|
1845
|
+
const handleCopy = (0, import_react5.useCallback)(
|
|
1846
|
+
async (e) => {
|
|
1847
|
+
e.stopPropagation();
|
|
1848
|
+
if (!value) return;
|
|
1849
|
+
try {
|
|
1850
|
+
await navigator.clipboard.writeText(value);
|
|
1851
|
+
setCopied(true);
|
|
1852
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
1853
|
+
} catch (err) {
|
|
1854
|
+
console.error("Failed to copy to clipboard:", err);
|
|
1855
|
+
}
|
|
1856
|
+
if (onCopy) {
|
|
1857
|
+
onCopy(value);
|
|
1858
|
+
} else if (toastOnCopy) {
|
|
1859
|
+
try {
|
|
1860
|
+
toast.add({
|
|
1861
|
+
description: copyMessage || `${label || "Value"} copied to clipboard`
|
|
1862
|
+
});
|
|
1863
|
+
} catch (e2) {
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
},
|
|
1867
|
+
[value, onCopy, toastOnCopy, copyMessage, label]
|
|
1868
|
+
);
|
|
1869
|
+
if (!value) {
|
|
1870
|
+
if (!fallback) return null;
|
|
1871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children: fallback });
|
|
1872
|
+
}
|
|
1873
|
+
const tooltipText = copied ? "Copied!" : `Copy ${label || "value"}`;
|
|
1874
|
+
const copyButton = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1875
|
+
Button,
|
|
1876
|
+
{
|
|
1877
|
+
size: "icon-xs",
|
|
1878
|
+
variant: "ghost",
|
|
1879
|
+
className: "text-muted-foreground hover:text-foreground cursor-pointer",
|
|
1880
|
+
onClick: handleCopy,
|
|
1881
|
+
title: tooltipText,
|
|
1882
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.CheckIcon, { className: "size-3 text-emerald-500" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.CopyIcon, { className: "size-3" })
|
|
1883
|
+
}
|
|
1884
|
+
);
|
|
1885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: (0, import_cn14.cn)("flex items-center gap-1.5", className), children: [
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1887
|
+
"code",
|
|
1888
|
+
{
|
|
1889
|
+
className: (0, import_cn14.cn)(
|
|
1890
|
+
"font-mono text-xs text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded select-all",
|
|
1891
|
+
codeClassName
|
|
1892
|
+
),
|
|
1893
|
+
children: value
|
|
1894
|
+
}
|
|
1895
|
+
),
|
|
1896
|
+
showTooltip ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Tooltip, { children: [
|
|
1897
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipTrigger, { render: copyButton }),
|
|
1898
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipContent, { children: tooltipText })
|
|
1899
|
+
] }) : copyButton
|
|
1900
|
+
] });
|
|
1901
|
+
});
|
|
1902
|
+
var CodeLabel = CopyableCode;
|
|
1903
|
+
var SlugLabel = CopyableCode;
|
|
1904
|
+
|
|
1905
|
+
// src/components/composed/columns/description-label.tsx
|
|
1906
|
+
var import_cn15 = require("cn");
|
|
1907
|
+
var import_react6 = require("react");
|
|
1908
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1909
|
+
var DescriptionLabel = (0, import_react6.memo)(function DescriptionLabel2({
|
|
1910
|
+
description,
|
|
1911
|
+
fallback = null,
|
|
1912
|
+
className
|
|
1913
|
+
}) {
|
|
1914
|
+
const text = description == null ? void 0 : description.trim();
|
|
1915
|
+
if (!text) {
|
|
1916
|
+
if (!fallback) return null;
|
|
1917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: (0, import_cn15.cn)("text-xs text-muted-foreground", className), children: fallback });
|
|
1918
|
+
}
|
|
1919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
1920
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1921
|
+
TooltipTrigger,
|
|
1922
|
+
{
|
|
1923
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1924
|
+
"p",
|
|
1925
|
+
{
|
|
1926
|
+
className: (0, import_cn15.cn)(
|
|
1927
|
+
"text-xs text-muted-foreground truncate max-w-xs cursor-default",
|
|
1928
|
+
className
|
|
1929
|
+
),
|
|
1930
|
+
children: text
|
|
1931
|
+
}
|
|
1932
|
+
)
|
|
1933
|
+
}
|
|
1934
|
+
),
|
|
1935
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { className: "max-w-xs break-words", children: text })
|
|
1559
1936
|
] });
|
|
1560
1937
|
});
|
|
1561
1938
|
|
|
1562
1939
|
// src/components/composed/columns/email-label.tsx
|
|
1563
|
-
var
|
|
1564
|
-
var
|
|
1565
|
-
var EmailLabel = (0,
|
|
1566
|
-
return /* @__PURE__ */ (0,
|
|
1940
|
+
var import_react7 = require("react");
|
|
1941
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1942
|
+
var EmailLabel = (0, import_react7.memo)(function EmailLabel2({ email }) {
|
|
1943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-xs font-mono", children: email });
|
|
1567
1944
|
});
|
|
1568
1945
|
|
|
1569
1946
|
// src/components/composed/columns/email-verified.tsx
|
|
1570
|
-
var
|
|
1571
|
-
var
|
|
1947
|
+
var import_cn17 = require("cn");
|
|
1948
|
+
var import_lucide_react8 = require("lucide-react");
|
|
1949
|
+
var import_react8 = require("react");
|
|
1572
1950
|
|
|
1573
1951
|
// src/components/ui/badge.tsx
|
|
1574
1952
|
var import_merge_props3 = require("@base-ui/react/merge-props");
|
|
1575
1953
|
var import_use_render3 = require("@base-ui/react/use-render");
|
|
1576
1954
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
1577
|
-
var
|
|
1955
|
+
var import_cn16 = require("cn");
|
|
1578
1956
|
var badgeVariants = (0, import_class_variance_authority3.cva)(
|
|
1579
1957
|
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-2.5!",
|
|
1580
1958
|
{
|
|
@@ -1607,97 +1985,776 @@ function Badge(_a) {
|
|
|
1607
1985
|
defaultTagName: "span",
|
|
1608
1986
|
props: (0, import_merge_props3.mergeProps)(
|
|
1609
1987
|
{
|
|
1610
|
-
className: (0,
|
|
1988
|
+
className: (0, import_cn16.cn)(badgeVariants({ variant }), className)
|
|
1989
|
+
},
|
|
1990
|
+
props
|
|
1991
|
+
),
|
|
1992
|
+
render,
|
|
1993
|
+
state: {
|
|
1994
|
+
slot: "badge",
|
|
1995
|
+
variant
|
|
1996
|
+
}
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
// src/components/composed/columns/email-verified.tsx
|
|
2001
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2002
|
+
var EmailVerified = (0, import_react8.memo)(function EmailVerified2({
|
|
2003
|
+
verified,
|
|
2004
|
+
label,
|
|
2005
|
+
className
|
|
2006
|
+
}) {
|
|
2007
|
+
const isVerified = Boolean(verified);
|
|
2008
|
+
if (isVerified) {
|
|
2009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2010
|
+
Badge,
|
|
2011
|
+
{
|
|
2012
|
+
variant: "outline",
|
|
2013
|
+
className: (0, import_cn17.cn)(
|
|
2014
|
+
"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 font-normal",
|
|
2015
|
+
className
|
|
2016
|
+
),
|
|
2017
|
+
children: [
|
|
2018
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2019
|
+
import_lucide_react8.CheckIcon,
|
|
2020
|
+
{
|
|
2021
|
+
"data-icon": "inline-start",
|
|
2022
|
+
className: "text-emerald-600 dark:text-emerald-400"
|
|
2023
|
+
}
|
|
2024
|
+
),
|
|
2025
|
+
label != null ? label : "Verified"
|
|
2026
|
+
]
|
|
2027
|
+
}
|
|
2028
|
+
);
|
|
2029
|
+
}
|
|
2030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2031
|
+
Badge,
|
|
2032
|
+
{
|
|
2033
|
+
variant: "outline",
|
|
2034
|
+
className: (0, import_cn17.cn)(
|
|
2035
|
+
"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300 font-normal",
|
|
2036
|
+
className
|
|
2037
|
+
),
|
|
2038
|
+
children: [
|
|
2039
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2040
|
+
import_lucide_react8.XIcon,
|
|
2041
|
+
{
|
|
2042
|
+
"data-icon": "inline-start",
|
|
2043
|
+
className: "text-amber-600 dark:text-amber-400"
|
|
2044
|
+
}
|
|
2045
|
+
),
|
|
2046
|
+
label != null ? label : "Unverified"
|
|
2047
|
+
]
|
|
2048
|
+
}
|
|
2049
|
+
);
|
|
2050
|
+
});
|
|
2051
|
+
|
|
2052
|
+
// src/components/composed/columns/joined-label.tsx
|
|
2053
|
+
var import_react9 = require("react");
|
|
2054
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2055
|
+
var JoinedLabel = (0, import_react9.memo)(function JoinedLabel2({
|
|
2056
|
+
joined,
|
|
2057
|
+
locale = "id-ID"
|
|
2058
|
+
}) {
|
|
2059
|
+
if (!joined) return null;
|
|
2060
|
+
const date = typeof joined === "string" ? new Date(joined) : joined;
|
|
2061
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
2062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs font-mono", children: new Intl.DateTimeFormat(locale, {
|
|
2063
|
+
day: "numeric",
|
|
2064
|
+
month: "long",
|
|
2065
|
+
year: "numeric"
|
|
2066
|
+
}).format(date) });
|
|
2067
|
+
});
|
|
2068
|
+
|
|
2069
|
+
// src/components/composed/columns/metadata-progress.tsx
|
|
2070
|
+
var import_cn18 = require("cn");
|
|
2071
|
+
var import_react10 = require("react");
|
|
2072
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2073
|
+
var DEFAULT_METADATA_FIELDS = [
|
|
2074
|
+
{ key: "title", label: "Page Title" },
|
|
2075
|
+
{ key: "description", label: "Meta Description" },
|
|
2076
|
+
{ key: "keywords", label: "Keywords" },
|
|
2077
|
+
{ key: "author", label: "Author" },
|
|
2078
|
+
{ key: "canonicalUrl", label: "Canonical URL" },
|
|
2079
|
+
{ key: "favicon", label: "Favicon URL" },
|
|
2080
|
+
{ key: "ogImage", label: "OG Image URL" },
|
|
2081
|
+
{ key: "ogType", label: "OG Type" },
|
|
2082
|
+
{ key: "twitterCard", label: "Twitter Card" },
|
|
2083
|
+
{ key: "twitterHandle", label: "Twitter Handle" },
|
|
2084
|
+
{ key: "robots", label: "Robots" },
|
|
2085
|
+
{ key: "customJsonLd", label: "Custom JSON-LD" }
|
|
2086
|
+
];
|
|
2087
|
+
var MetadataProgress = (0, import_react10.memo)(function MetadataProgress2({
|
|
2088
|
+
metadata,
|
|
2089
|
+
fields = DEFAULT_METADATA_FIELDS,
|
|
2090
|
+
completedCount: propCompleted,
|
|
2091
|
+
totalCount: propTotal,
|
|
2092
|
+
title = "Metadata",
|
|
2093
|
+
fallback = null,
|
|
2094
|
+
className
|
|
2095
|
+
}) {
|
|
2096
|
+
const stats = (0, import_react10.useMemo)(() => {
|
|
2097
|
+
if (propCompleted !== void 0 && propTotal !== void 0) {
|
|
2098
|
+
const total3 = Math.max(1, propTotal);
|
|
2099
|
+
const completed3 = Math.min(propCompleted, total3);
|
|
2100
|
+
const percentage3 = Math.round(completed3 / total3 * 100);
|
|
2101
|
+
return {
|
|
2102
|
+
completed: completed3,
|
|
2103
|
+
total: total3,
|
|
2104
|
+
percentage: percentage3,
|
|
2105
|
+
missing: []
|
|
2106
|
+
};
|
|
2107
|
+
}
|
|
2108
|
+
if (!metadata) {
|
|
2109
|
+
return {
|
|
2110
|
+
completed: 0,
|
|
2111
|
+
total: fields.length,
|
|
2112
|
+
percentage: 0,
|
|
2113
|
+
missing: fields.map((f) => f.label)
|
|
2114
|
+
};
|
|
2115
|
+
}
|
|
2116
|
+
const completedList = [];
|
|
2117
|
+
const missingList = [];
|
|
2118
|
+
for (const field of fields) {
|
|
2119
|
+
const val = metadata[field.key];
|
|
2120
|
+
let isFilled = false;
|
|
2121
|
+
if (field.key === "keywords") {
|
|
2122
|
+
isFilled = Array.isArray(val) ? val.length > 0 : Boolean(typeof val === "string" && val.trim().length > 0);
|
|
2123
|
+
} else if (typeof val === "string") {
|
|
2124
|
+
isFilled = val.trim().length > 0;
|
|
2125
|
+
} else {
|
|
2126
|
+
isFilled = Boolean(val);
|
|
2127
|
+
}
|
|
2128
|
+
if (isFilled) {
|
|
2129
|
+
completedList.push(field.label);
|
|
2130
|
+
} else {
|
|
2131
|
+
missingList.push(field.label);
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
const total2 = fields.length;
|
|
2135
|
+
const completed2 = completedList.length;
|
|
2136
|
+
const percentage2 = Math.round(completed2 / Math.max(1, total2) * 100);
|
|
2137
|
+
return {
|
|
2138
|
+
completed: completed2,
|
|
2139
|
+
total: total2,
|
|
2140
|
+
percentage: percentage2,
|
|
2141
|
+
missing: missingList
|
|
2142
|
+
};
|
|
2143
|
+
}, [metadata, fields, propCompleted, propTotal]);
|
|
2144
|
+
const { completed, total, percentage, missing } = stats;
|
|
2145
|
+
if (completed === 0 && fallback !== null) {
|
|
2146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, { children: fallback });
|
|
2147
|
+
}
|
|
2148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
|
|
2149
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2150
|
+
TooltipTrigger,
|
|
2151
|
+
{
|
|
2152
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2153
|
+
"div",
|
|
2154
|
+
{
|
|
2155
|
+
className: (0, import_cn18.cn)(
|
|
2156
|
+
"inline-flex items-center gap-2 cursor-pointer select-none",
|
|
2157
|
+
className
|
|
2158
|
+
),
|
|
2159
|
+
children: percentage === 100 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2160
|
+
Badge,
|
|
2161
|
+
{
|
|
2162
|
+
variant: "outline",
|
|
2163
|
+
className: "border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 font-mono text-[11px] gap-1.5 font-normal",
|
|
2164
|
+
children: [
|
|
2165
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "size-1.5 rounded-full bg-emerald-500" }),
|
|
2166
|
+
"100%"
|
|
2167
|
+
]
|
|
2168
|
+
}
|
|
2169
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-2 w-24", children: [
|
|
2170
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex-1 h-1.5 rounded-full bg-muted/60 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2171
|
+
"div",
|
|
2172
|
+
{
|
|
2173
|
+
className: (0, import_cn18.cn)(
|
|
2174
|
+
"h-full rounded-full transition-all duration-300",
|
|
2175
|
+
percentage >= 50 ? "bg-primary" : "bg-amber-500"
|
|
2176
|
+
),
|
|
2177
|
+
style: { width: `${percentage}%` }
|
|
2178
|
+
}
|
|
2179
|
+
) }),
|
|
2180
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "font-mono text-[11px] text-muted-foreground shrink-0", children: [
|
|
2181
|
+
completed,
|
|
2182
|
+
"/",
|
|
2183
|
+
total
|
|
2184
|
+
] })
|
|
2185
|
+
] })
|
|
2186
|
+
}
|
|
2187
|
+
)
|
|
2188
|
+
}
|
|
2189
|
+
),
|
|
2190
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContent, { className: "max-w-xs text-xs", children: completed === total ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { children: [
|
|
2191
|
+
"All ",
|
|
2192
|
+
total,
|
|
2193
|
+
" metadata fields completed"
|
|
2194
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col gap-1 py-0.5", children: [
|
|
2195
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center justify-between gap-4 font-medium text-xs", children: [
|
|
2196
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: title }),
|
|
2197
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "font-mono text-[11px] opacity-80", children: [
|
|
2198
|
+
completed,
|
|
2199
|
+
"/",
|
|
2200
|
+
total,
|
|
2201
|
+
" (",
|
|
2202
|
+
percentage,
|
|
2203
|
+
"%)"
|
|
2204
|
+
] })
|
|
2205
|
+
] }),
|
|
2206
|
+
missing.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { className: "text-[11px] opacity-80 leading-normal", children: [
|
|
2207
|
+
"Missing: ",
|
|
2208
|
+
missing.slice(0, 3).join(", "),
|
|
2209
|
+
missing.length > 3 ? ` +${missing.length - 3} more` : ""
|
|
2210
|
+
] })
|
|
2211
|
+
] }) })
|
|
2212
|
+
] });
|
|
2213
|
+
});
|
|
2214
|
+
var MetadataStatus = MetadataProgress;
|
|
2215
|
+
var ProgressStatus = MetadataProgress;
|
|
2216
|
+
|
|
2217
|
+
// src/components/composed/columns/organization-roles.tsx
|
|
2218
|
+
var import_cn19 = require("cn");
|
|
2219
|
+
var import_lucide_react9 = require("lucide-react");
|
|
2220
|
+
var import_react11 = require("react");
|
|
2221
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2222
|
+
var OrganizationRoleBadge = (0, import_react11.forwardRef)(function OrganizationRoleBadge2(_a, ref) {
|
|
2223
|
+
var _b = _a, { role, roleName, className } = _b, props = __objRest(_b, ["role", "roleName", "className"]);
|
|
2224
|
+
const roleValue = roleName != null ? roleName : role;
|
|
2225
|
+
if (!roleValue) return null;
|
|
2226
|
+
const normalized = roleValue.toLowerCase().trim();
|
|
2227
|
+
if (normalized === "owner") {
|
|
2228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2229
|
+
Badge,
|
|
2230
|
+
__spreadProps(__spreadValues({
|
|
2231
|
+
ref,
|
|
2232
|
+
variant: "outline",
|
|
2233
|
+
className: (0, import_cn19.cn)(
|
|
2234
|
+
"capitalize border-purple-500/30 bg-purple-500/10 text-purple-700 dark:text-purple-300 font-normal",
|
|
2235
|
+
className
|
|
2236
|
+
)
|
|
2237
|
+
}, props), {
|
|
2238
|
+
children: [
|
|
2239
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2240
|
+
import_lucide_react9.CrownIcon,
|
|
2241
|
+
{
|
|
2242
|
+
"data-icon": "inline-start",
|
|
2243
|
+
className: "text-purple-600 dark:text-purple-400"
|
|
2244
|
+
}
|
|
2245
|
+
),
|
|
2246
|
+
roleValue
|
|
2247
|
+
]
|
|
2248
|
+
})
|
|
2249
|
+
);
|
|
2250
|
+
}
|
|
2251
|
+
if (normalized === "admin") {
|
|
2252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2253
|
+
Badge,
|
|
2254
|
+
__spreadProps(__spreadValues({
|
|
2255
|
+
ref,
|
|
2256
|
+
variant: "outline",
|
|
2257
|
+
className: (0, import_cn19.cn)(
|
|
2258
|
+
"capitalize border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300 font-normal",
|
|
2259
|
+
className
|
|
2260
|
+
)
|
|
2261
|
+
}, props), {
|
|
2262
|
+
children: [
|
|
2263
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2264
|
+
import_lucide_react9.ShieldCheckIcon,
|
|
2265
|
+
{
|
|
2266
|
+
"data-icon": "inline-start",
|
|
2267
|
+
className: "text-blue-600 dark:text-blue-400"
|
|
2268
|
+
}
|
|
2269
|
+
),
|
|
2270
|
+
roleValue
|
|
2271
|
+
]
|
|
2272
|
+
})
|
|
2273
|
+
);
|
|
2274
|
+
}
|
|
2275
|
+
if (normalized === "redaktur") {
|
|
2276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2277
|
+
Badge,
|
|
2278
|
+
__spreadProps(__spreadValues({
|
|
2279
|
+
ref,
|
|
2280
|
+
variant: "outline",
|
|
2281
|
+
className: (0, import_cn19.cn)(
|
|
2282
|
+
"capitalize border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300 font-normal",
|
|
2283
|
+
className
|
|
2284
|
+
)
|
|
2285
|
+
}, props), {
|
|
2286
|
+
children: [
|
|
2287
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2288
|
+
import_lucide_react9.NewspaperIcon,
|
|
2289
|
+
{
|
|
2290
|
+
"data-icon": "inline-start",
|
|
2291
|
+
className: "text-amber-600 dark:text-amber-400"
|
|
2292
|
+
}
|
|
2293
|
+
),
|
|
2294
|
+
roleValue
|
|
2295
|
+
]
|
|
2296
|
+
})
|
|
2297
|
+
);
|
|
2298
|
+
}
|
|
2299
|
+
if (normalized === "editor") {
|
|
2300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2301
|
+
Badge,
|
|
2302
|
+
__spreadProps(__spreadValues({
|
|
2303
|
+
ref,
|
|
2304
|
+
variant: "outline",
|
|
2305
|
+
className: (0, import_cn19.cn)(
|
|
2306
|
+
"capitalize border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 font-normal",
|
|
2307
|
+
className
|
|
2308
|
+
)
|
|
2309
|
+
}, props), {
|
|
2310
|
+
children: [
|
|
2311
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2312
|
+
import_lucide_react9.PenLineIcon,
|
|
2313
|
+
{
|
|
2314
|
+
"data-icon": "inline-start",
|
|
2315
|
+
className: "text-emerald-600 dark:text-emerald-400"
|
|
2316
|
+
}
|
|
2317
|
+
),
|
|
2318
|
+
roleValue
|
|
2319
|
+
]
|
|
2320
|
+
})
|
|
2321
|
+
);
|
|
2322
|
+
}
|
|
2323
|
+
if (normalized === "staff") {
|
|
2324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2325
|
+
Badge,
|
|
2326
|
+
__spreadProps(__spreadValues({
|
|
2327
|
+
ref,
|
|
2328
|
+
variant: "outline",
|
|
2329
|
+
className: (0, import_cn19.cn)(
|
|
2330
|
+
"capitalize border-slate-500/30 bg-slate-500/10 text-slate-700 dark:text-slate-300 font-normal",
|
|
2331
|
+
className
|
|
2332
|
+
)
|
|
2333
|
+
}, props), {
|
|
2334
|
+
children: [
|
|
2335
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2336
|
+
import_lucide_react9.UserIcon,
|
|
2337
|
+
{
|
|
2338
|
+
"data-icon": "inline-start",
|
|
2339
|
+
className: "text-slate-600 dark:text-slate-400"
|
|
2340
|
+
}
|
|
2341
|
+
),
|
|
2342
|
+
roleValue
|
|
2343
|
+
]
|
|
2344
|
+
})
|
|
2345
|
+
);
|
|
2346
|
+
}
|
|
2347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2348
|
+
Badge,
|
|
2349
|
+
__spreadProps(__spreadValues({
|
|
2350
|
+
ref,
|
|
2351
|
+
variant: "secondary",
|
|
2352
|
+
className: (0, import_cn19.cn)("capitalize font-normal", className)
|
|
2353
|
+
}, props), {
|
|
2354
|
+
children: [
|
|
2355
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2356
|
+
import_lucide_react9.Building2Icon,
|
|
2357
|
+
{
|
|
2358
|
+
"data-icon": "inline-start",
|
|
2359
|
+
className: "text-muted-foreground"
|
|
2360
|
+
}
|
|
2361
|
+
),
|
|
2362
|
+
roleValue
|
|
2363
|
+
]
|
|
2364
|
+
})
|
|
2365
|
+
);
|
|
2366
|
+
});
|
|
2367
|
+
OrganizationRoleBadge.displayName = "OrganizationRoleBadge";
|
|
2368
|
+
var OrganizationRoles = (0, import_react11.memo)(function OrganizationRoles2({
|
|
2369
|
+
roles,
|
|
2370
|
+
className
|
|
2371
|
+
}) {
|
|
2372
|
+
const orgRoles = roles != null ? roles : [];
|
|
2373
|
+
if (orgRoles.length === 0) return null;
|
|
2374
|
+
if (orgRoles.length === 1) {
|
|
2375
|
+
const item = orgRoles[0];
|
|
2376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tooltip, { children: [
|
|
2377
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2378
|
+
TooltipTrigger,
|
|
2379
|
+
{
|
|
2380
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2381
|
+
OrganizationRoleBadge,
|
|
2382
|
+
{
|
|
2383
|
+
roleName: item.roleName,
|
|
2384
|
+
className
|
|
2385
|
+
}
|
|
2386
|
+
)
|
|
2387
|
+
}
|
|
2388
|
+
),
|
|
2389
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(TooltipContent, { children: [
|
|
2390
|
+
item.roleName,
|
|
2391
|
+
" at ",
|
|
2392
|
+
item.organizationName
|
|
2393
|
+
] })
|
|
2394
|
+
] });
|
|
2395
|
+
}
|
|
2396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: (0, import_cn19.cn)("flex items-center gap-1.5", className), children: [
|
|
2397
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tooltip, { children: [
|
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2399
|
+
TooltipTrigger,
|
|
2400
|
+
{
|
|
2401
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(OrganizationRoleBadge, { roleName: orgRoles[0].roleName })
|
|
2402
|
+
}
|
|
2403
|
+
),
|
|
2404
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(TooltipContent, { children: [
|
|
2405
|
+
orgRoles[0].roleName,
|
|
2406
|
+
" at ",
|
|
2407
|
+
orgRoles[0].organizationName
|
|
2408
|
+
] })
|
|
2409
|
+
] }),
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tooltip, { children: [
|
|
2411
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2412
|
+
TooltipTrigger,
|
|
2413
|
+
{
|
|
2414
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Badge, { variant: "secondary", className: "font-mono", children: [
|
|
2415
|
+
"+",
|
|
2416
|
+
orgRoles.length - 1
|
|
2417
|
+
] })
|
|
2418
|
+
}
|
|
2419
|
+
),
|
|
2420
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TooltipContent, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex flex-col", children: orgRoles.slice(1).map((item, index) => {
|
|
2421
|
+
var _a, _b;
|
|
2422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2423
|
+
"span",
|
|
2424
|
+
{
|
|
2425
|
+
children: [
|
|
2426
|
+
item.roleName,
|
|
2427
|
+
" at ",
|
|
2428
|
+
item.organizationName
|
|
2429
|
+
]
|
|
2430
|
+
},
|
|
2431
|
+
(_b = item.membershipId) != null ? _b : `${(_a = item.organizationName) != null ? _a : ""}-${index}`
|
|
2432
|
+
);
|
|
2433
|
+
}) }) })
|
|
2434
|
+
] })
|
|
2435
|
+
] });
|
|
2436
|
+
});
|
|
2437
|
+
|
|
2438
|
+
// src/components/composed/columns/permission-badges.tsx
|
|
2439
|
+
var import_cn20 = require("cn");
|
|
2440
|
+
var import_react12 = require("react");
|
|
2441
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2442
|
+
var PermissionBadges = (0, import_react12.memo)(function PermissionBadges2({
|
|
2443
|
+
permissions,
|
|
2444
|
+
maxDisplay = 3,
|
|
2445
|
+
className
|
|
2446
|
+
}) {
|
|
2447
|
+
const perms = permissions != null ? permissions : [];
|
|
2448
|
+
if (perms.length === 0) return null;
|
|
2449
|
+
const visible = perms.slice(0, maxDisplay);
|
|
2450
|
+
const remaining = perms.slice(maxDisplay);
|
|
2451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: (0, import_cn20.cn)("flex flex-wrap items-center gap-1", className), children: [
|
|
2452
|
+
visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2453
|
+
Badge,
|
|
2454
|
+
{
|
|
2455
|
+
variant: "outline",
|
|
2456
|
+
className: "text-[10px] font-mono py-0 font-normal",
|
|
2457
|
+
children: p
|
|
1611
2458
|
},
|
|
1612
|
-
|
|
1613
|
-
),
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
2459
|
+
p
|
|
2460
|
+
)),
|
|
2461
|
+
remaining.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Tooltip, { children: [
|
|
2462
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2463
|
+
TooltipTrigger,
|
|
2464
|
+
{
|
|
2465
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2466
|
+
Badge,
|
|
2467
|
+
{
|
|
2468
|
+
variant: "secondary",
|
|
2469
|
+
className: "text-[10px] font-mono py-0 cursor-default font-normal",
|
|
2470
|
+
children: [
|
|
2471
|
+
"+",
|
|
2472
|
+
remaining.length
|
|
2473
|
+
]
|
|
2474
|
+
}
|
|
2475
|
+
)
|
|
2476
|
+
}
|
|
2477
|
+
),
|
|
2478
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TooltipContent, { className: "max-w-xs", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col gap-0.5 text-xs font-mono", children: remaining.map((p) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: p }, p)) }) })
|
|
2479
|
+
] })
|
|
2480
|
+
] });
|
|
2481
|
+
});
|
|
2482
|
+
var PermissionsBadges = PermissionBadges;
|
|
1621
2483
|
|
|
1622
|
-
// src/components/composed/columns/
|
|
1623
|
-
var
|
|
1624
|
-
var
|
|
1625
|
-
|
|
2484
|
+
// src/components/composed/columns/redirect-uris.tsx
|
|
2485
|
+
var import_cn21 = require("cn");
|
|
2486
|
+
var import_react13 = require("react");
|
|
2487
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2488
|
+
var RedirectUris = (0, import_react13.memo)(function RedirectUris2({
|
|
2489
|
+
uris,
|
|
2490
|
+
maxDisplay = 1,
|
|
2491
|
+
fallback = null,
|
|
2492
|
+
tooltipTitle = "All Redirect URIs:",
|
|
2493
|
+
className
|
|
1626
2494
|
}) {
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
2495
|
+
const list = (0, import_react13.useMemo)(() => {
|
|
2496
|
+
if (!uris) return [];
|
|
2497
|
+
if (Array.isArray(uris)) return uris.filter(Boolean);
|
|
2498
|
+
return [uris];
|
|
2499
|
+
}, [uris]);
|
|
2500
|
+
if (list.length === 0) {
|
|
2501
|
+
if (!fallback) return null;
|
|
2502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: fallback });
|
|
2503
|
+
}
|
|
2504
|
+
const primaryUri = list[0];
|
|
2505
|
+
const remainingCount = list.length - maxDisplay;
|
|
2506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: (0, import_cn21.cn)("flex items-center gap-2", className), children: [
|
|
2507
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2508
|
+
"p",
|
|
2509
|
+
{
|
|
2510
|
+
className: "text-xs text-muted-foreground font-mono truncate",
|
|
2511
|
+
title: primaryUri,
|
|
2512
|
+
children: primaryUri
|
|
2513
|
+
}
|
|
2514
|
+
),
|
|
2515
|
+
remainingCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2517
|
+
TooltipTrigger,
|
|
2518
|
+
{
|
|
2519
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Badge, { variant: "outline", className: "font-mono cursor-pointer", children: [
|
|
2520
|
+
"+",
|
|
2521
|
+
remainingCount
|
|
2522
|
+
] })
|
|
2523
|
+
}
|
|
2524
|
+
),
|
|
2525
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { className: "text-xs font-mono", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
2526
|
+
tooltipTitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "font-semibold text-xs", children: tooltipTitle }),
|
|
2527
|
+
list.map((uri) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: uri }, uri))
|
|
2528
|
+
] }) })
|
|
2529
|
+
] })
|
|
1633
2530
|
] });
|
|
1634
2531
|
});
|
|
2532
|
+
var RedirectUriLabel = RedirectUris;
|
|
2533
|
+
var UrisList = RedirectUris;
|
|
2534
|
+
var UrisLabel = RedirectUris;
|
|
1635
2535
|
|
|
1636
|
-
// src/components/composed/columns/
|
|
1637
|
-
var
|
|
1638
|
-
var
|
|
1639
|
-
var
|
|
1640
|
-
|
|
1641
|
-
|
|
2536
|
+
// src/components/composed/columns/running-status.tsx
|
|
2537
|
+
var import_cn22 = require("cn");
|
|
2538
|
+
var import_react14 = require("react");
|
|
2539
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2540
|
+
var RunningStatus = (0, import_react14.memo)(function RunningStatus2({
|
|
2541
|
+
count = 0,
|
|
2542
|
+
isRunning,
|
|
2543
|
+
accessTokens,
|
|
2544
|
+
refreshTokens,
|
|
2545
|
+
usersCount,
|
|
2546
|
+
runningLabel = "Running",
|
|
2547
|
+
idleLabel = "Idle",
|
|
2548
|
+
tooltipTitle,
|
|
2549
|
+
className
|
|
1642
2550
|
}) {
|
|
1643
|
-
|
|
1644
|
-
const
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
2551
|
+
const activeCount = count != null ? count : 0;
|
|
2552
|
+
const running = isRunning != null ? isRunning : activeCount > 0;
|
|
2553
|
+
const hasDetails = accessTokens != null && accessTokens > 0 || refreshTokens != null && refreshTokens > 0 || usersCount != null && usersCount > 0;
|
|
2554
|
+
const title = tooltipTitle != null ? tooltipTitle : `${activeCount} Active Token${activeCount === 1 ? "" : "s"}`;
|
|
2555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2557
|
+
TooltipTrigger,
|
|
2558
|
+
{
|
|
2559
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2560
|
+
"div",
|
|
2561
|
+
{
|
|
2562
|
+
className: (0, import_cn22.cn)(
|
|
2563
|
+
"inline-flex items-center cursor-pointer select-none",
|
|
2564
|
+
className
|
|
2565
|
+
),
|
|
2566
|
+
children: running ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2567
|
+
Badge,
|
|
2568
|
+
{
|
|
2569
|
+
variant: "outline",
|
|
2570
|
+
className: "border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 gap-1.5 text-xs font-normal",
|
|
2571
|
+
children: [
|
|
2572
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "size-1.5 rounded-full bg-emerald-500 animate-pulse" }),
|
|
2573
|
+
runningLabel,
|
|
2574
|
+
" (",
|
|
2575
|
+
activeCount,
|
|
2576
|
+
")"
|
|
2577
|
+
]
|
|
2578
|
+
}
|
|
2579
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2580
|
+
Badge,
|
|
2581
|
+
{
|
|
2582
|
+
variant: "outline",
|
|
2583
|
+
className: "border-border/60 bg-muted/40 text-muted-foreground gap-1.5 text-xs font-normal",
|
|
2584
|
+
children: [
|
|
2585
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "size-1.5 rounded-full bg-muted-foreground/40" }),
|
|
2586
|
+
idleLabel
|
|
2587
|
+
]
|
|
2588
|
+
}
|
|
2589
|
+
)
|
|
2590
|
+
}
|
|
2591
|
+
)
|
|
2592
|
+
}
|
|
2593
|
+
),
|
|
2594
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipContent, { className: "text-xs", children: running ? hasDetails ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-1 py-0.5", children: [
|
|
2595
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "font-medium text-xs", children: title }),
|
|
2596
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-0.5 text-[11px] opacity-80", children: [
|
|
2597
|
+
accessTokens != null && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
2598
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Access tokens" }),
|
|
2599
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "font-mono", children: accessTokens })
|
|
2600
|
+
] }),
|
|
2601
|
+
refreshTokens != null && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Refresh tokens" }),
|
|
2603
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "font-mono", children: refreshTokens })
|
|
2604
|
+
] }),
|
|
2605
|
+
usersCount != null && usersCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
2606
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Authorized users" }),
|
|
2607
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "font-mono", children: usersCount })
|
|
2608
|
+
] })
|
|
2609
|
+
] })
|
|
2610
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: title }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "No active tokens" }) })
|
|
2611
|
+
] });
|
|
1651
2612
|
});
|
|
2613
|
+
var TokenActivity = RunningStatus;
|
|
2614
|
+
var ActiveTokensStatus = RunningStatus;
|
|
1652
2615
|
|
|
1653
2616
|
// src/components/composed/columns/user-role.tsx
|
|
1654
|
-
var
|
|
1655
|
-
var
|
|
1656
|
-
var
|
|
1657
|
-
var
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
2617
|
+
var import_cn23 = require("cn");
|
|
2618
|
+
var import_lucide_react10 = require("lucide-react");
|
|
2619
|
+
var import_react15 = require("react");
|
|
2620
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2621
|
+
var UserRole = (0, import_react15.memo)(function UserRole2({
|
|
2622
|
+
role,
|
|
2623
|
+
className
|
|
2624
|
+
}) {
|
|
2625
|
+
if (!role) return null;
|
|
2626
|
+
const normalized = role.toLowerCase().trim();
|
|
2627
|
+
if (normalized === "admin") {
|
|
2628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2629
|
+
Badge,
|
|
2630
|
+
{
|
|
2631
|
+
variant: "outline",
|
|
2632
|
+
className: (0, import_cn23.cn)(
|
|
2633
|
+
"capitalize border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",
|
|
2634
|
+
className
|
|
2635
|
+
),
|
|
2636
|
+
children: [
|
|
2637
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2638
|
+
import_lucide_react10.UserStarIcon,
|
|
2639
|
+
{
|
|
2640
|
+
"data-icon": "inline-start",
|
|
2641
|
+
className: "text-amber-500 dark:text-amber-400"
|
|
2642
|
+
}
|
|
2643
|
+
),
|
|
2644
|
+
role
|
|
2645
|
+
]
|
|
2646
|
+
}
|
|
2647
|
+
);
|
|
2648
|
+
}
|
|
2649
|
+
if (normalized === "client") {
|
|
2650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2651
|
+
Badge,
|
|
2652
|
+
{
|
|
2653
|
+
variant: "outline",
|
|
2654
|
+
className: (0, import_cn23.cn)(
|
|
2655
|
+
"capitalize border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300",
|
|
2656
|
+
className
|
|
2657
|
+
),
|
|
2658
|
+
children: [
|
|
2659
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2660
|
+
import_lucide_react10.BriefcaseIcon,
|
|
2661
|
+
{
|
|
2662
|
+
"data-icon": "inline-start",
|
|
2663
|
+
className: "text-sky-500 dark:text-sky-400"
|
|
2664
|
+
}
|
|
2665
|
+
),
|
|
2666
|
+
role
|
|
2667
|
+
]
|
|
2668
|
+
}
|
|
2669
|
+
);
|
|
2670
|
+
}
|
|
2671
|
+
if (normalized === "user") {
|
|
2672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Badge, { variant: "outline", className: (0, import_cn23.cn)("capitalize", className), children: [
|
|
2673
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.UserIcon, { "data-icon": "inline-start", className: "text-muted-foreground" }),
|
|
2674
|
+
role
|
|
2675
|
+
] });
|
|
2676
|
+
}
|
|
2677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2678
|
+
Badge,
|
|
2679
|
+
{
|
|
2680
|
+
variant: "secondary",
|
|
2681
|
+
className: (0, import_cn23.cn)("capitalize font-normal", className),
|
|
2682
|
+
children: [
|
|
2683
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.ShieldIcon, { "data-icon": "inline-start", className: "text-muted-foreground" }),
|
|
2684
|
+
role
|
|
2685
|
+
]
|
|
2686
|
+
}
|
|
2687
|
+
);
|
|
1663
2688
|
});
|
|
1664
2689
|
|
|
1665
2690
|
// src/components/composed/columns/user-status.tsx
|
|
1666
|
-
var
|
|
1667
|
-
var
|
|
1668
|
-
var
|
|
1669
|
-
var UserStatus = (0,
|
|
1670
|
-
status
|
|
2691
|
+
var import_cn24 = require("cn");
|
|
2692
|
+
var import_react16 = require("react");
|
|
2693
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2694
|
+
var UserStatus = (0, import_react16.memo)(function UserStatus2({
|
|
2695
|
+
status,
|
|
2696
|
+
label,
|
|
2697
|
+
activeLabel = "Active",
|
|
2698
|
+
inactiveLabel,
|
|
2699
|
+
className
|
|
1671
2700
|
}) {
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
/* @__PURE__ */ (0,
|
|
1677
|
-
|
|
1678
|
-
|
|
2701
|
+
var _a;
|
|
2702
|
+
const isInactive = typeof status === "string" ? status.toLowerCase() !== "active" : Boolean(status);
|
|
2703
|
+
if (isInactive) {
|
|
2704
|
+
const displayLabel = (_a = label != null ? label : inactiveLabel) != null ? _a : typeof status === "string" ? status : "Inactive";
|
|
2705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2706
|
+
Badge,
|
|
2707
|
+
{
|
|
2708
|
+
variant: "outline",
|
|
2709
|
+
className: (0, import_cn24.cn)(
|
|
2710
|
+
"capitalize border-destructive/30 bg-destructive/10 text-destructive dark:text-red-400 gap-1.5 font-normal",
|
|
2711
|
+
className
|
|
2712
|
+
),
|
|
2713
|
+
children: [
|
|
2714
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "size-1.5 rounded-full bg-destructive" }),
|
|
2715
|
+
displayLabel
|
|
2716
|
+
]
|
|
2717
|
+
}
|
|
2718
|
+
);
|
|
2719
|
+
}
|
|
2720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2721
|
+
Badge,
|
|
2722
|
+
{
|
|
2723
|
+
variant: "outline",
|
|
2724
|
+
className: (0, import_cn24.cn)(
|
|
2725
|
+
"capitalize border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 gap-1.5 font-normal",
|
|
2726
|
+
className
|
|
2727
|
+
),
|
|
2728
|
+
children: [
|
|
2729
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "size-1.5 rounded-full bg-emerald-500" }),
|
|
2730
|
+
label != null ? label : activeLabel
|
|
2731
|
+
]
|
|
2732
|
+
}
|
|
2733
|
+
);
|
|
1679
2734
|
});
|
|
2735
|
+
var ItemStatus = UserStatus;
|
|
2736
|
+
var StatusBadge = UserStatus;
|
|
1680
2737
|
|
|
1681
2738
|
// src/components/composed/data-table/data-table.tsx
|
|
1682
2739
|
var import_react_table4 = require("@tanstack/react-table");
|
|
1683
|
-
var
|
|
2740
|
+
var import_lucide_react23 = require("lucide-react");
|
|
1684
2741
|
var import_navigation3 = require("next/navigation");
|
|
1685
|
-
var
|
|
2742
|
+
var import_react21 = require("react");
|
|
1686
2743
|
|
|
1687
2744
|
// src/components/composed/state-empty.tsx
|
|
1688
|
-
var
|
|
2745
|
+
var import_react17 = require("react");
|
|
1689
2746
|
|
|
1690
2747
|
// src/components/ui/empty.tsx
|
|
1691
2748
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
1692
|
-
var
|
|
1693
|
-
var
|
|
2749
|
+
var import_cn25 = require("cn");
|
|
2750
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1694
2751
|
function Empty(_a) {
|
|
1695
2752
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1696
|
-
return /* @__PURE__ */ (0,
|
|
2753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1697
2754
|
"div",
|
|
1698
2755
|
__spreadValues({
|
|
1699
2756
|
"data-slot": "empty",
|
|
1700
|
-
className: (0,
|
|
2757
|
+
className: (0, import_cn25.cn)(
|
|
1701
2758
|
"flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",
|
|
1702
2759
|
className
|
|
1703
2760
|
)
|
|
@@ -1706,11 +2763,11 @@ function Empty(_a) {
|
|
|
1706
2763
|
}
|
|
1707
2764
|
function EmptyHeader(_a) {
|
|
1708
2765
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1709
|
-
return /* @__PURE__ */ (0,
|
|
2766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1710
2767
|
"div",
|
|
1711
2768
|
__spreadValues({
|
|
1712
2769
|
"data-slot": "empty-header",
|
|
1713
|
-
className: (0,
|
|
2770
|
+
className: (0, import_cn25.cn)("flex max-w-sm flex-col items-center gap-1", className)
|
|
1714
2771
|
}, props)
|
|
1715
2772
|
);
|
|
1716
2773
|
}
|
|
@@ -1736,22 +2793,22 @@ function EmptyMedia(_a) {
|
|
|
1736
2793
|
"className",
|
|
1737
2794
|
"variant"
|
|
1738
2795
|
]);
|
|
1739
|
-
return /* @__PURE__ */ (0,
|
|
2796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1740
2797
|
"div",
|
|
1741
2798
|
__spreadValues({
|
|
1742
2799
|
"data-slot": "empty-icon",
|
|
1743
2800
|
"data-variant": variant,
|
|
1744
|
-
className: (0,
|
|
2801
|
+
className: (0, import_cn25.cn)(emptyMediaVariants({ variant, className }))
|
|
1745
2802
|
}, props)
|
|
1746
2803
|
);
|
|
1747
2804
|
}
|
|
1748
2805
|
function EmptyTitle(_a) {
|
|
1749
2806
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1750
|
-
return /* @__PURE__ */ (0,
|
|
2807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1751
2808
|
"div",
|
|
1752
2809
|
__spreadValues({
|
|
1753
2810
|
"data-slot": "empty-title",
|
|
1754
|
-
className: (0,
|
|
2811
|
+
className: (0, import_cn25.cn)(
|
|
1755
2812
|
"font-heading text-sm font-medium tracking-tight",
|
|
1756
2813
|
className
|
|
1757
2814
|
)
|
|
@@ -1760,11 +2817,11 @@ function EmptyTitle(_a) {
|
|
|
1760
2817
|
}
|
|
1761
2818
|
function EmptyDescription(_a) {
|
|
1762
2819
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1763
|
-
return /* @__PURE__ */ (0,
|
|
2820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1764
2821
|
"div",
|
|
1765
2822
|
__spreadValues({
|
|
1766
2823
|
"data-slot": "empty-description",
|
|
1767
|
-
className: (0,
|
|
2824
|
+
className: (0, import_cn25.cn)(
|
|
1768
2825
|
"text-xs/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
1769
2826
|
className
|
|
1770
2827
|
)
|
|
@@ -1773,11 +2830,11 @@ function EmptyDescription(_a) {
|
|
|
1773
2830
|
}
|
|
1774
2831
|
function EmptyContent(_a) {
|
|
1775
2832
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1776
|
-
return /* @__PURE__ */ (0,
|
|
2833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1777
2834
|
"div",
|
|
1778
2835
|
__spreadValues({
|
|
1779
2836
|
"data-slot": "empty-content",
|
|
1780
|
-
className: (0,
|
|
2837
|
+
className: (0, import_cn25.cn)(
|
|
1781
2838
|
"flex w-full max-w-sm min-w-0 flex-col items-center gap-2 text-xs/relaxed text-balance",
|
|
1782
2839
|
className
|
|
1783
2840
|
)
|
|
@@ -1786,18 +2843,18 @@ function EmptyContent(_a) {
|
|
|
1786
2843
|
}
|
|
1787
2844
|
|
|
1788
2845
|
// src/lib/utils.ts
|
|
1789
|
-
var
|
|
2846
|
+
var import_cn26 = require("cn");
|
|
1790
2847
|
|
|
1791
2848
|
// src/components/composed/state-empty.tsx
|
|
1792
|
-
var
|
|
2849
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1793
2850
|
function renderStateIcon(icon) {
|
|
1794
2851
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
1795
2852
|
const IconComp = icon;
|
|
1796
|
-
return /* @__PURE__ */ (0,
|
|
2853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(IconComp, {});
|
|
1797
2854
|
}
|
|
1798
2855
|
return icon;
|
|
1799
2856
|
}
|
|
1800
|
-
var StateEmpty = (0,
|
|
2857
|
+
var StateEmpty = (0, import_react17.memo)(function StateEmpty2({
|
|
1801
2858
|
icon,
|
|
1802
2859
|
title,
|
|
1803
2860
|
description,
|
|
@@ -1810,17 +2867,17 @@ var StateEmpty = (0, import_react8.memo)(function StateEmpty2({
|
|
|
1810
2867
|
const actionHandler = isFunctionAction ? render : onClick;
|
|
1811
2868
|
const buttonRender = isFunctionAction ? void 0 : render;
|
|
1812
2869
|
const hasAction = Boolean(buttonText || render || onClick);
|
|
1813
|
-
return /* @__PURE__ */ (0,
|
|
2870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
1814
2871
|
Empty,
|
|
1815
2872
|
{
|
|
1816
|
-
className: (0,
|
|
2873
|
+
className: (0, import_cn26.cn)("w-full", state === "outline" && "border border-dashed"),
|
|
1817
2874
|
children: [
|
|
1818
|
-
/* @__PURE__ */ (0,
|
|
1819
|
-
/* @__PURE__ */ (0,
|
|
1820
|
-
/* @__PURE__ */ (0,
|
|
1821
|
-
/* @__PURE__ */ (0,
|
|
2875
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(EmptyHeader, { children: [
|
|
2876
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(EmptyMedia, { variant: "icon", children: renderStateIcon(icon) }),
|
|
2877
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(EmptyTitle, { children: title }),
|
|
2878
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(EmptyDescription, { children: description })
|
|
1822
2879
|
] }),
|
|
1823
|
-
hasAction && /* @__PURE__ */ (0,
|
|
2880
|
+
hasAction && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(EmptyContent, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1824
2881
|
Button,
|
|
1825
2882
|
{
|
|
1826
2883
|
variant: "outline",
|
|
@@ -1837,20 +2894,20 @@ var StateEmpty = (0, import_react8.memo)(function StateEmpty2({
|
|
|
1837
2894
|
});
|
|
1838
2895
|
|
|
1839
2896
|
// src/components/ui/table.tsx
|
|
1840
|
-
var
|
|
1841
|
-
var
|
|
2897
|
+
var import_cn27 = require("cn");
|
|
2898
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1842
2899
|
function Table(_a) {
|
|
1843
2900
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1844
|
-
return /* @__PURE__ */ (0,
|
|
2901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1845
2902
|
"div",
|
|
1846
2903
|
{
|
|
1847
2904
|
"data-slot": "table-container",
|
|
1848
2905
|
className: "relative w-full overflow-x-auto",
|
|
1849
|
-
children: /* @__PURE__ */ (0,
|
|
2906
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1850
2907
|
"table",
|
|
1851
2908
|
__spreadValues({
|
|
1852
2909
|
"data-slot": "table",
|
|
1853
|
-
className: (0,
|
|
2910
|
+
className: (0, import_cn27.cn)("w-full caption-bottom text-xs", className)
|
|
1854
2911
|
}, props)
|
|
1855
2912
|
)
|
|
1856
2913
|
}
|
|
@@ -1858,31 +2915,31 @@ function Table(_a) {
|
|
|
1858
2915
|
}
|
|
1859
2916
|
function TableHeader(_a) {
|
|
1860
2917
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1861
|
-
return /* @__PURE__ */ (0,
|
|
2918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1862
2919
|
"thead",
|
|
1863
2920
|
__spreadValues({
|
|
1864
2921
|
"data-slot": "table-header",
|
|
1865
|
-
className: (0,
|
|
2922
|
+
className: (0, import_cn27.cn)("[&_tr]:border-b", className)
|
|
1866
2923
|
}, props)
|
|
1867
2924
|
);
|
|
1868
2925
|
}
|
|
1869
2926
|
function TableBody(_a) {
|
|
1870
2927
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1871
|
-
return /* @__PURE__ */ (0,
|
|
2928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1872
2929
|
"tbody",
|
|
1873
2930
|
__spreadValues({
|
|
1874
2931
|
"data-slot": "table-body",
|
|
1875
|
-
className: (0,
|
|
2932
|
+
className: (0, import_cn27.cn)("[&_tr:last-child]:border-0", className)
|
|
1876
2933
|
}, props)
|
|
1877
2934
|
);
|
|
1878
2935
|
}
|
|
1879
2936
|
function TableRow(_a) {
|
|
1880
2937
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1881
|
-
return /* @__PURE__ */ (0,
|
|
2938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1882
2939
|
"tr",
|
|
1883
2940
|
__spreadValues({
|
|
1884
2941
|
"data-slot": "table-row",
|
|
1885
|
-
className: (0,
|
|
2942
|
+
className: (0, import_cn27.cn)(
|
|
1886
2943
|
"border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
|
|
1887
2944
|
className
|
|
1888
2945
|
)
|
|
@@ -1891,11 +2948,11 @@ function TableRow(_a) {
|
|
|
1891
2948
|
}
|
|
1892
2949
|
function TableHead(_a) {
|
|
1893
2950
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1894
|
-
return /* @__PURE__ */ (0,
|
|
2951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1895
2952
|
"th",
|
|
1896
2953
|
__spreadValues({
|
|
1897
2954
|
"data-slot": "table-head",
|
|
1898
|
-
className: (0,
|
|
2955
|
+
className: (0, import_cn27.cn)(
|
|
1899
2956
|
"h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
|
|
1900
2957
|
className
|
|
1901
2958
|
)
|
|
@@ -1904,11 +2961,11 @@ function TableHead(_a) {
|
|
|
1904
2961
|
}
|
|
1905
2962
|
function TableCell(_a) {
|
|
1906
2963
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1907
|
-
return /* @__PURE__ */ (0,
|
|
2964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1908
2965
|
"td",
|
|
1909
2966
|
__spreadValues({
|
|
1910
2967
|
"data-slot": "table-cell",
|
|
1911
|
-
className: (0,
|
|
2968
|
+
className: (0, import_cn27.cn)(
|
|
1912
2969
|
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
|
|
1913
2970
|
className
|
|
1914
2971
|
)
|
|
@@ -1944,20 +3001,20 @@ var features = (0, import_react_table.tableFeatures)({
|
|
|
1944
3001
|
|
|
1945
3002
|
// src/components/composed/data-table/table-content-body.tsx
|
|
1946
3003
|
var import_react_table2 = require("@tanstack/react-table");
|
|
1947
|
-
var
|
|
1948
|
-
var
|
|
3004
|
+
var import_lucide_react11 = require("lucide-react");
|
|
3005
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1949
3006
|
function DataTableContentBody({
|
|
1950
3007
|
table,
|
|
1951
3008
|
columns
|
|
1952
3009
|
}) {
|
|
1953
3010
|
const rows = table.getRowModel().rows;
|
|
1954
3011
|
if (rows == null ? void 0 : rows.length) {
|
|
1955
|
-
return /* @__PURE__ */ (0,
|
|
3012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TableBody, { children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TableCell, { children: (0, import_react_table2.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) });
|
|
1956
3013
|
}
|
|
1957
|
-
return /* @__PURE__ */ (0,
|
|
3014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TableBody, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TableCell, { colSpan: columns.length, className: "h-48 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1958
3015
|
StateEmpty,
|
|
1959
3016
|
{
|
|
1960
|
-
icon: /* @__PURE__ */ (0,
|
|
3017
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react11.SearchXIcon, {}),
|
|
1961
3018
|
title: "No matching results",
|
|
1962
3019
|
description: "No records matched your search query or filter criteria.",
|
|
1963
3020
|
buttonText: "Clear search & filters",
|
|
@@ -1971,18 +3028,18 @@ function DataTableContentBody({
|
|
|
1971
3028
|
|
|
1972
3029
|
// src/components/composed/data-table/table-content-header.tsx
|
|
1973
3030
|
var import_react_table3 = require("@tanstack/react-table");
|
|
1974
|
-
var
|
|
3031
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1975
3032
|
function DataTableContentHeader({
|
|
1976
3033
|
table
|
|
1977
3034
|
}) {
|
|
1978
|
-
return /* @__PURE__ */ (0,
|
|
3035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TableHead, { children: header.isPlaceholder ? null : (0, import_react_table3.flexRender)(
|
|
1979
3036
|
header.column.columnDef.header,
|
|
1980
3037
|
header.getContext()
|
|
1981
3038
|
) }, header.id)) }, headerGroup.id)) });
|
|
1982
3039
|
}
|
|
1983
3040
|
|
|
1984
3041
|
// src/components/composed/data-table/table-footer-entries.tsx
|
|
1985
|
-
var
|
|
3042
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1986
3043
|
function DataTableFooterEntries({
|
|
1987
3044
|
table
|
|
1988
3045
|
}) {
|
|
@@ -1993,131 +3050,131 @@ function DataTableFooterEntries({
|
|
|
1993
3050
|
const totalRows = table.getFilteredRowModel().rows.length;
|
|
1994
3051
|
const startRow = totalRows === 0 ? 0 : pageIndex * pageSize + 1;
|
|
1995
3052
|
const endRow = Math.min((pageIndex + 1) * pageSize, totalRows);
|
|
1996
|
-
return /* @__PURE__ */ (0,
|
|
3053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex-1 text-xs text-muted-foreground", children: [
|
|
1997
3054
|
"Showing",
|
|
1998
3055
|
" ",
|
|
1999
|
-
/* @__PURE__ */ (0,
|
|
3056
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "font-medium text-foreground", children: [
|
|
2000
3057
|
startRow,
|
|
2001
3058
|
"-",
|
|
2002
3059
|
endRow
|
|
2003
3060
|
] }),
|
|
2004
3061
|
" ",
|
|
2005
3062
|
"of ",
|
|
2006
|
-
/* @__PURE__ */ (0,
|
|
3063
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-medium text-foreground", children: totalRows }),
|
|
2007
3064
|
" ",
|
|
2008
3065
|
"entries."
|
|
2009
3066
|
] });
|
|
2010
3067
|
}
|
|
2011
3068
|
|
|
2012
3069
|
// src/components/composed/data-table/table-footer-pagination.tsx
|
|
2013
|
-
var
|
|
2014
|
-
var
|
|
3070
|
+
var import_lucide_react12 = require("lucide-react");
|
|
3071
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2015
3072
|
function DataTableFooterPagination({
|
|
2016
3073
|
table
|
|
2017
3074
|
}) {
|
|
2018
|
-
return /* @__PURE__ */ (0,
|
|
2019
|
-
/* @__PURE__ */ (0,
|
|
2020
|
-
/* @__PURE__ */ (0,
|
|
3075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
3076
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
3077
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2021
3078
|
TooltipTrigger,
|
|
2022
3079
|
{
|
|
2023
|
-
render: /* @__PURE__ */ (0,
|
|
3080
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2024
3081
|
Button,
|
|
2025
3082
|
{
|
|
2026
3083
|
variant: "outline",
|
|
2027
3084
|
size: "icon-xs",
|
|
2028
3085
|
onClick: () => table.firstPage(),
|
|
2029
3086
|
disabled: !table.getCanPreviousPage(),
|
|
2030
|
-
children: /* @__PURE__ */ (0,
|
|
3087
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react12.ChevronsLeftIcon, {})
|
|
2031
3088
|
}
|
|
2032
3089
|
)
|
|
2033
3090
|
}
|
|
2034
3091
|
),
|
|
2035
|
-
/* @__PURE__ */ (0,
|
|
3092
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "Go to first page" })
|
|
2036
3093
|
] }),
|
|
2037
|
-
/* @__PURE__ */ (0,
|
|
2038
|
-
/* @__PURE__ */ (0,
|
|
3094
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
3095
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2039
3096
|
TooltipTrigger,
|
|
2040
3097
|
{
|
|
2041
|
-
render: /* @__PURE__ */ (0,
|
|
3098
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2042
3099
|
Button,
|
|
2043
3100
|
{
|
|
2044
3101
|
variant: "outline",
|
|
2045
3102
|
size: "icon-xs",
|
|
2046
3103
|
onClick: () => table.previousPage(),
|
|
2047
3104
|
disabled: !table.getCanPreviousPage(),
|
|
2048
|
-
children: /* @__PURE__ */ (0,
|
|
3105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react12.ChevronLeftIcon, {})
|
|
2049
3106
|
}
|
|
2050
3107
|
)
|
|
2051
3108
|
}
|
|
2052
3109
|
),
|
|
2053
|
-
/* @__PURE__ */ (0,
|
|
3110
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "Go to previous page" })
|
|
2054
3111
|
] }),
|
|
2055
|
-
/* @__PURE__ */ (0,
|
|
2056
|
-
/* @__PURE__ */ (0,
|
|
3112
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
3113
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2057
3114
|
TooltipTrigger,
|
|
2058
3115
|
{
|
|
2059
|
-
render: /* @__PURE__ */ (0,
|
|
3116
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2060
3117
|
Button,
|
|
2061
3118
|
{
|
|
2062
3119
|
variant: "outline",
|
|
2063
3120
|
size: "icon-xs",
|
|
2064
3121
|
onClick: () => table.nextPage(),
|
|
2065
3122
|
disabled: !table.getCanNextPage(),
|
|
2066
|
-
children: /* @__PURE__ */ (0,
|
|
3123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react12.ChevronRightIcon, {})
|
|
2067
3124
|
}
|
|
2068
3125
|
)
|
|
2069
3126
|
}
|
|
2070
3127
|
),
|
|
2071
|
-
/* @__PURE__ */ (0,
|
|
3128
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "Go to next page" })
|
|
2072
3129
|
] }),
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2074
|
-
/* @__PURE__ */ (0,
|
|
3130
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
3131
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2075
3132
|
TooltipTrigger,
|
|
2076
3133
|
{
|
|
2077
|
-
render: /* @__PURE__ */ (0,
|
|
3134
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2078
3135
|
Button,
|
|
2079
3136
|
{
|
|
2080
3137
|
variant: "outline",
|
|
2081
3138
|
size: "icon-xs",
|
|
2082
3139
|
onClick: () => table.lastPage(),
|
|
2083
3140
|
disabled: !table.getCanNextPage(),
|
|
2084
|
-
children: /* @__PURE__ */ (0,
|
|
3141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react12.ChevronsRightIcon, {})
|
|
2085
3142
|
}
|
|
2086
3143
|
)
|
|
2087
3144
|
}
|
|
2088
3145
|
),
|
|
2089
|
-
/* @__PURE__ */ (0,
|
|
3146
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "Go to last page" })
|
|
2090
3147
|
] })
|
|
2091
3148
|
] });
|
|
2092
3149
|
}
|
|
2093
3150
|
|
|
2094
3151
|
// src/components/composed/data-table/table-header-add.tsx
|
|
2095
|
-
var
|
|
2096
|
-
var
|
|
3152
|
+
var import_lucide_react13 = require("lucide-react");
|
|
3153
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2097
3154
|
function DataTableHeaderAdd({
|
|
2098
3155
|
onAdd,
|
|
2099
3156
|
addLabel
|
|
2100
3157
|
}) {
|
|
2101
|
-
return /* @__PURE__ */ (0,
|
|
2102
|
-
/* @__PURE__ */ (0,
|
|
2103
|
-
/* @__PURE__ */ (0,
|
|
3158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
3159
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Tooltip, { children: [
|
|
3160
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2104
3161
|
TooltipTrigger,
|
|
2105
3162
|
{
|
|
2106
3163
|
className: "flex sm:hidden",
|
|
2107
|
-
render: /* @__PURE__ */ (0,
|
|
3164
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { variant: "default", size: "icon", onClick: onAdd, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react13.PlusIcon, {}) })
|
|
2108
3165
|
}
|
|
2109
3166
|
),
|
|
2110
|
-
/* @__PURE__ */ (0,
|
|
3167
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipContent, { children: addLabel != null ? addLabel : "Add" })
|
|
2111
3168
|
] }),
|
|
2112
|
-
/* @__PURE__ */ (0,
|
|
2113
|
-
/* @__PURE__ */ (0,
|
|
3169
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Button, { variant: "default", onClick: onAdd, className: "hidden sm:flex", children: [
|
|
3170
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react13.PlusIcon, {}),
|
|
2114
3171
|
addLabel != null ? addLabel : "Add"
|
|
2115
3172
|
] })
|
|
2116
3173
|
] });
|
|
2117
3174
|
}
|
|
2118
3175
|
|
|
2119
3176
|
// src/components/composed/data-table/table-header-download.tsx
|
|
2120
|
-
var
|
|
3177
|
+
var import_lucide_react14 = require("lucide-react");
|
|
2121
3178
|
|
|
2122
3179
|
// src/components/composed/data-table/export.ts
|
|
2123
3180
|
var XLSX = __toESM(require("xlsx"));
|
|
@@ -2257,7 +3314,7 @@ function printTable(headers, rows, title = "Data Export") {
|
|
|
2257
3314
|
}
|
|
2258
3315
|
|
|
2259
3316
|
// src/components/composed/data-table/table-header-download.tsx
|
|
2260
|
-
var
|
|
3317
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2261
3318
|
function getTableExportData(table) {
|
|
2262
3319
|
const columns = table.getAllColumns().filter(
|
|
2263
3320
|
(col) => typeof col.accessorFn !== "undefined" && col.getIsVisible()
|
|
@@ -2300,25 +3357,25 @@ function DataTableHeaderDownload({
|
|
|
2300
3357
|
exportFilename,
|
|
2301
3358
|
onDownload
|
|
2302
3359
|
}) {
|
|
2303
|
-
return /* @__PURE__ */ (0,
|
|
2304
|
-
/* @__PURE__ */ (0,
|
|
2305
|
-
/* @__PURE__ */ (0,
|
|
3360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DropdownMenu, { children: [
|
|
3361
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Tooltip, { children: [
|
|
3362
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2306
3363
|
DropdownMenuTrigger,
|
|
2307
3364
|
{
|
|
2308
|
-
render: /* @__PURE__ */ (0,
|
|
3365
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2309
3366
|
TooltipTrigger,
|
|
2310
3367
|
{
|
|
2311
|
-
render: /* @__PURE__ */ (0,
|
|
3368
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "outline", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react14.DownloadIcon, {}) })
|
|
2312
3369
|
}
|
|
2313
3370
|
)
|
|
2314
3371
|
}
|
|
2315
3372
|
),
|
|
2316
|
-
/* @__PURE__ */ (0,
|
|
3373
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipContent, { children: "Download options" })
|
|
2317
3374
|
] }),
|
|
2318
|
-
/* @__PURE__ */ (0,
|
|
2319
|
-
/* @__PURE__ */ (0,
|
|
2320
|
-
/* @__PURE__ */ (0,
|
|
2321
|
-
/* @__PURE__ */ (0,
|
|
3375
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuContent, { align: "end", className: "w-48", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DropdownMenuGroup, { children: [
|
|
3376
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuLabel, { children: "Download data" }),
|
|
3377
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuSeparator, {}),
|
|
3378
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2322
3379
|
DropdownMenuItem,
|
|
2323
3380
|
{
|
|
2324
3381
|
className: "hover:cursor-pointer",
|
|
@@ -2328,12 +3385,12 @@ function DataTableHeaderDownload({
|
|
|
2328
3385
|
onDownload == null ? void 0 : onDownload();
|
|
2329
3386
|
},
|
|
2330
3387
|
children: [
|
|
2331
|
-
/* @__PURE__ */ (0,
|
|
3388
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react14.FileTextIcon, {}),
|
|
2332
3389
|
"Download PDF"
|
|
2333
3390
|
]
|
|
2334
3391
|
}
|
|
2335
3392
|
),
|
|
2336
|
-
/* @__PURE__ */ (0,
|
|
3393
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2337
3394
|
DropdownMenuItem,
|
|
2338
3395
|
{
|
|
2339
3396
|
className: "hover:cursor-pointer",
|
|
@@ -2343,12 +3400,12 @@ function DataTableHeaderDownload({
|
|
|
2343
3400
|
onDownload == null ? void 0 : onDownload();
|
|
2344
3401
|
},
|
|
2345
3402
|
children: [
|
|
2346
|
-
/* @__PURE__ */ (0,
|
|
3403
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react14.FileSpreadsheetIcon, {}),
|
|
2347
3404
|
"Download Excel"
|
|
2348
3405
|
]
|
|
2349
3406
|
}
|
|
2350
3407
|
),
|
|
2351
|
-
/* @__PURE__ */ (0,
|
|
3408
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2352
3409
|
DropdownMenuItem,
|
|
2353
3410
|
{
|
|
2354
3411
|
className: "hover:cursor-pointer",
|
|
@@ -2358,13 +3415,13 @@ function DataTableHeaderDownload({
|
|
|
2358
3415
|
onDownload == null ? void 0 : onDownload();
|
|
2359
3416
|
},
|
|
2360
3417
|
children: [
|
|
2361
|
-
/* @__PURE__ */ (0,
|
|
3418
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react14.FileCodeIcon, {}),
|
|
2362
3419
|
"Download CSV"
|
|
2363
3420
|
]
|
|
2364
3421
|
}
|
|
2365
3422
|
),
|
|
2366
|
-
/* @__PURE__ */ (0,
|
|
2367
|
-
/* @__PURE__ */ (0,
|
|
3423
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuSeparator, {}),
|
|
3424
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2368
3425
|
DropdownMenuItem,
|
|
2369
3426
|
{
|
|
2370
3427
|
className: "hover:cursor-pointer",
|
|
@@ -2373,7 +3430,7 @@ function DataTableHeaderDownload({
|
|
|
2373
3430
|
printTable(headers, rows, exportFilename);
|
|
2374
3431
|
},
|
|
2375
3432
|
children: [
|
|
2376
|
-
/* @__PURE__ */ (0,
|
|
3433
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react14.PrinterIcon, {}),
|
|
2377
3434
|
"Print Table"
|
|
2378
3435
|
]
|
|
2379
3436
|
}
|
|
@@ -2384,15 +3441,15 @@ function DataTableHeaderDownload({
|
|
|
2384
3441
|
|
|
2385
3442
|
// src/components/composed/data-table/table-header-filter.tsx
|
|
2386
3443
|
var import_date_fns = require("date-fns");
|
|
2387
|
-
var
|
|
2388
|
-
var
|
|
3444
|
+
var import_lucide_react17 = require("lucide-react");
|
|
3445
|
+
var import_react18 = require("react");
|
|
2389
3446
|
|
|
2390
3447
|
// src/components/ui/calendar.tsx
|
|
2391
|
-
var
|
|
2392
|
-
var
|
|
3448
|
+
var import_cn28 = require("cn");
|
|
3449
|
+
var import_lucide_react15 = require("lucide-react");
|
|
2393
3450
|
var React3 = __toESM(require("react"));
|
|
2394
3451
|
var import_react_day_picker = require("react-day-picker");
|
|
2395
|
-
var
|
|
3452
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2396
3453
|
function Calendar(_a) {
|
|
2397
3454
|
var _b = _a, {
|
|
2398
3455
|
className,
|
|
@@ -2414,11 +3471,11 @@ function Calendar(_a) {
|
|
|
2414
3471
|
"components"
|
|
2415
3472
|
]);
|
|
2416
3473
|
const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
|
|
2417
|
-
return /* @__PURE__ */ (0,
|
|
3474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2418
3475
|
import_react_day_picker.DayPicker,
|
|
2419
3476
|
__spreadValues({
|
|
2420
3477
|
showOutsideDays,
|
|
2421
|
-
className: (0,
|
|
3478
|
+
className: (0, import_cn28.cn)(
|
|
2422
3479
|
"group/calendar bg-background p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(6)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent",
|
|
2423
3480
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
2424
3481
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
@@ -2430,124 +3487,124 @@ function Calendar(_a) {
|
|
|
2430
3487
|
formatMonthDropdown: (date) => date.toLocaleString(locale == null ? void 0 : locale.code, { month: "short" })
|
|
2431
3488
|
}, formatters),
|
|
2432
3489
|
classNames: __spreadValues({
|
|
2433
|
-
root: (0,
|
|
2434
|
-
months: (0,
|
|
3490
|
+
root: (0, import_cn28.cn)("w-fit", defaultClassNames.root),
|
|
3491
|
+
months: (0, import_cn28.cn)(
|
|
2435
3492
|
"relative flex flex-col gap-4 md:flex-row",
|
|
2436
3493
|
defaultClassNames.months
|
|
2437
3494
|
),
|
|
2438
|
-
month: (0,
|
|
2439
|
-
nav: (0,
|
|
3495
|
+
month: (0, import_cn28.cn)("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
3496
|
+
nav: (0, import_cn28.cn)(
|
|
2440
3497
|
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
2441
3498
|
defaultClassNames.nav
|
|
2442
3499
|
),
|
|
2443
|
-
button_previous: (0,
|
|
3500
|
+
button_previous: (0, import_cn28.cn)(
|
|
2444
3501
|
buttonVariants({ variant: buttonVariant }),
|
|
2445
3502
|
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
2446
3503
|
defaultClassNames.button_previous
|
|
2447
3504
|
),
|
|
2448
|
-
button_next: (0,
|
|
3505
|
+
button_next: (0, import_cn28.cn)(
|
|
2449
3506
|
buttonVariants({ variant: buttonVariant }),
|
|
2450
3507
|
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
2451
3508
|
defaultClassNames.button_next
|
|
2452
3509
|
),
|
|
2453
|
-
month_caption: (0,
|
|
3510
|
+
month_caption: (0, import_cn28.cn)(
|
|
2454
3511
|
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
2455
3512
|
defaultClassNames.month_caption
|
|
2456
3513
|
),
|
|
2457
|
-
dropdowns: (0,
|
|
3514
|
+
dropdowns: (0, import_cn28.cn)(
|
|
2458
3515
|
"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
2459
3516
|
defaultClassNames.dropdowns
|
|
2460
3517
|
),
|
|
2461
|
-
dropdown_root: (0,
|
|
3518
|
+
dropdown_root: (0, import_cn28.cn)(
|
|
2462
3519
|
"relative rounded-(--cell-radius)",
|
|
2463
3520
|
defaultClassNames.dropdown_root
|
|
2464
3521
|
),
|
|
2465
|
-
dropdown: (0,
|
|
3522
|
+
dropdown: (0, import_cn28.cn)(
|
|
2466
3523
|
"absolute inset-0 bg-popover opacity-0",
|
|
2467
3524
|
defaultClassNames.dropdown
|
|
2468
3525
|
),
|
|
2469
|
-
caption_label: (0,
|
|
3526
|
+
caption_label: (0, import_cn28.cn)(
|
|
2470
3527
|
"font-medium select-none",
|
|
2471
3528
|
captionLayout === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
|
|
2472
3529
|
defaultClassNames.caption_label
|
|
2473
3530
|
),
|
|
2474
|
-
month_grid: (0,
|
|
2475
|
-
weekdays: (0,
|
|
2476
|
-
weekday: (0,
|
|
3531
|
+
month_grid: (0, import_cn28.cn)("w-full border-collapse", defaultClassNames.month_grid),
|
|
3532
|
+
weekdays: (0, import_cn28.cn)("flex", defaultClassNames.weekdays),
|
|
3533
|
+
weekday: (0, import_cn28.cn)(
|
|
2477
3534
|
"flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none",
|
|
2478
3535
|
defaultClassNames.weekday
|
|
2479
3536
|
),
|
|
2480
|
-
week: (0,
|
|
2481
|
-
week_number_header: (0,
|
|
3537
|
+
week: (0, import_cn28.cn)("mt-2 flex w-full", defaultClassNames.week),
|
|
3538
|
+
week_number_header: (0, import_cn28.cn)(
|
|
2482
3539
|
"w-(--cell-size) select-none",
|
|
2483
3540
|
defaultClassNames.week_number_header
|
|
2484
3541
|
),
|
|
2485
|
-
week_number: (0,
|
|
3542
|
+
week_number: (0, import_cn28.cn)(
|
|
2486
3543
|
"text-[0.8rem] text-muted-foreground select-none",
|
|
2487
3544
|
defaultClassNames.week_number
|
|
2488
3545
|
),
|
|
2489
|
-
day: (0,
|
|
3546
|
+
day: (0, import_cn28.cn)(
|
|
2490
3547
|
"group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)",
|
|
2491
3548
|
props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
|
|
2492
3549
|
defaultClassNames.day
|
|
2493
3550
|
),
|
|
2494
|
-
range_start: (0,
|
|
3551
|
+
range_start: (0, import_cn28.cn)(
|
|
2495
3552
|
"relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted",
|
|
2496
3553
|
defaultClassNames.range_start
|
|
2497
3554
|
),
|
|
2498
|
-
range_middle: (0,
|
|
2499
|
-
range_end: (0,
|
|
3555
|
+
range_middle: (0, import_cn28.cn)("rounded-none", defaultClassNames.range_middle),
|
|
3556
|
+
range_end: (0, import_cn28.cn)(
|
|
2500
3557
|
"relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted",
|
|
2501
3558
|
defaultClassNames.range_end
|
|
2502
3559
|
),
|
|
2503
|
-
today: (0,
|
|
3560
|
+
today: (0, import_cn28.cn)(
|
|
2504
3561
|
"rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none",
|
|
2505
3562
|
defaultClassNames.today
|
|
2506
3563
|
),
|
|
2507
|
-
outside: (0,
|
|
3564
|
+
outside: (0, import_cn28.cn)(
|
|
2508
3565
|
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
2509
3566
|
defaultClassNames.outside
|
|
2510
3567
|
),
|
|
2511
|
-
disabled: (0,
|
|
3568
|
+
disabled: (0, import_cn28.cn)(
|
|
2512
3569
|
"text-muted-foreground opacity-50",
|
|
2513
3570
|
defaultClassNames.disabled
|
|
2514
3571
|
),
|
|
2515
|
-
hidden: (0,
|
|
3572
|
+
hidden: (0, import_cn28.cn)("invisible", defaultClassNames.hidden)
|
|
2516
3573
|
}, classNames),
|
|
2517
3574
|
components: __spreadValues({
|
|
2518
3575
|
Root: (_a2) => {
|
|
2519
3576
|
var _b2 = _a2, { className: className2, rootRef } = _b2, props2 = __objRest(_b2, ["className", "rootRef"]);
|
|
2520
|
-
return /* @__PURE__ */ (0,
|
|
3577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2521
3578
|
"div",
|
|
2522
3579
|
__spreadValues({
|
|
2523
3580
|
"data-slot": "calendar",
|
|
2524
3581
|
ref: rootRef,
|
|
2525
|
-
className: (0,
|
|
3582
|
+
className: (0, import_cn28.cn)(className2)
|
|
2526
3583
|
}, props2)
|
|
2527
3584
|
);
|
|
2528
3585
|
},
|
|
2529
3586
|
Chevron: (_c) => {
|
|
2530
3587
|
var _d = _c, { className: className2, orientation } = _d, props2 = __objRest(_d, ["className", "orientation"]);
|
|
2531
3588
|
if (orientation === "left") {
|
|
2532
|
-
return /* @__PURE__ */ (0,
|
|
3589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react15.ChevronLeftIcon, __spreadValues({ className: (0, import_cn28.cn)("size-4", className2) }, props2));
|
|
2533
3590
|
}
|
|
2534
3591
|
if (orientation === "right") {
|
|
2535
|
-
return /* @__PURE__ */ (0,
|
|
2536
|
-
|
|
3592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3593
|
+
import_lucide_react15.ChevronRightIcon,
|
|
2537
3594
|
__spreadValues({
|
|
2538
|
-
className: (0,
|
|
3595
|
+
className: (0, import_cn28.cn)("size-4", className2)
|
|
2539
3596
|
}, props2)
|
|
2540
3597
|
);
|
|
2541
3598
|
}
|
|
2542
|
-
return /* @__PURE__ */ (0,
|
|
3599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react15.ChevronDownIcon, __spreadValues({ className: (0, import_cn28.cn)("size-4", className2) }, props2));
|
|
2543
3600
|
},
|
|
2544
3601
|
DayButton: (_e) => {
|
|
2545
3602
|
var props2 = __objRest(_e, []);
|
|
2546
|
-
return /* @__PURE__ */ (0,
|
|
3603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CalendarDayButton, __spreadValues({ locale }, props2));
|
|
2547
3604
|
},
|
|
2548
3605
|
WeekNumber: (_f) => {
|
|
2549
3606
|
var _g = _f, { children } = _g, props2 = __objRest(_g, ["children"]);
|
|
2550
|
-
return /* @__PURE__ */ (0,
|
|
3607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("td", __spreadProps(__spreadValues({}, props2), { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) }));
|
|
2551
3608
|
}
|
|
2552
3609
|
}, components)
|
|
2553
3610
|
}, props)
|
|
@@ -2571,7 +3628,7 @@ function CalendarDayButton(_a) {
|
|
|
2571
3628
|
var _a2;
|
|
2572
3629
|
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
2573
3630
|
}, [modifiers.focused]);
|
|
2574
|
-
return /* @__PURE__ */ (0,
|
|
3631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2575
3632
|
Button,
|
|
2576
3633
|
__spreadValues({
|
|
2577
3634
|
variant: "ghost",
|
|
@@ -2581,7 +3638,7 @@ function CalendarDayButton(_a) {
|
|
|
2581
3638
|
"data-range-start": modifiers.range_start,
|
|
2582
3639
|
"data-range-end": modifiers.range_end,
|
|
2583
3640
|
"data-range-middle": modifiers.range_middle,
|
|
2584
|
-
className: (0,
|
|
3641
|
+
className: (0, import_cn28.cn)(
|
|
2585
3642
|
"relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70",
|
|
2586
3643
|
defaultClassNames.day,
|
|
2587
3644
|
className
|
|
@@ -2592,15 +3649,15 @@ function CalendarDayButton(_a) {
|
|
|
2592
3649
|
|
|
2593
3650
|
// src/components/ui/popover.tsx
|
|
2594
3651
|
var import_popover = require("@base-ui/react/popover");
|
|
2595
|
-
var
|
|
2596
|
-
var
|
|
3652
|
+
var import_cn29 = require("cn");
|
|
3653
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2597
3654
|
function Popover(_a) {
|
|
2598
3655
|
var props = __objRest(_a, []);
|
|
2599
|
-
return /* @__PURE__ */ (0,
|
|
3656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
|
|
2600
3657
|
}
|
|
2601
3658
|
function PopoverTrigger(_a) {
|
|
2602
3659
|
var props = __objRest(_a, []);
|
|
2603
|
-
return /* @__PURE__ */ (0,
|
|
3660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
|
|
2604
3661
|
}
|
|
2605
3662
|
function PopoverContent(_a) {
|
|
2606
3663
|
var _b = _a, {
|
|
@@ -2616,7 +3673,7 @@ function PopoverContent(_a) {
|
|
|
2616
3673
|
"side",
|
|
2617
3674
|
"sideOffset"
|
|
2618
3675
|
]);
|
|
2619
|
-
return /* @__PURE__ */ (0,
|
|
3676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2620
3677
|
import_popover.Popover.Positioner,
|
|
2621
3678
|
{
|
|
2622
3679
|
align,
|
|
@@ -2624,11 +3681,11 @@ function PopoverContent(_a) {
|
|
|
2624
3681
|
side,
|
|
2625
3682
|
sideOffset,
|
|
2626
3683
|
className: "isolate z-50",
|
|
2627
|
-
children: /* @__PURE__ */ (0,
|
|
3684
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2628
3685
|
import_popover.Popover.Popup,
|
|
2629
3686
|
__spreadValues({
|
|
2630
3687
|
"data-slot": "popover-content",
|
|
2631
|
-
className: (0,
|
|
3688
|
+
className: (0, import_cn29.cn)(
|
|
2632
3689
|
"z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-lg bg-popover p-2.5 text-xs text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
2633
3690
|
className
|
|
2634
3691
|
)
|
|
@@ -2640,17 +3697,17 @@ function PopoverContent(_a) {
|
|
|
2640
3697
|
|
|
2641
3698
|
// src/components/ui/select.tsx
|
|
2642
3699
|
var import_select = require("@base-ui/react/select");
|
|
2643
|
-
var
|
|
2644
|
-
var
|
|
2645
|
-
var
|
|
3700
|
+
var import_cn30 = require("cn");
|
|
3701
|
+
var import_lucide_react16 = require("lucide-react");
|
|
3702
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2646
3703
|
var Select = import_select.Select.Root;
|
|
2647
3704
|
function SelectValue(_a) {
|
|
2648
3705
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2649
|
-
return /* @__PURE__ */ (0,
|
|
3706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2650
3707
|
import_select.Select.Value,
|
|
2651
3708
|
__spreadValues({
|
|
2652
3709
|
"data-slot": "select-value",
|
|
2653
|
-
className: (0,
|
|
3710
|
+
className: (0, import_cn30.cn)("flex flex-1 text-left", className)
|
|
2654
3711
|
}, props)
|
|
2655
3712
|
);
|
|
2656
3713
|
}
|
|
@@ -2664,22 +3721,22 @@ function SelectTrigger(_a) {
|
|
|
2664
3721
|
"size",
|
|
2665
3722
|
"children"
|
|
2666
3723
|
]);
|
|
2667
|
-
return /* @__PURE__ */ (0,
|
|
3724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2668
3725
|
import_select.Select.Trigger,
|
|
2669
3726
|
__spreadProps(__spreadValues({
|
|
2670
3727
|
"data-slot": "select-trigger",
|
|
2671
3728
|
"data-size": size,
|
|
2672
|
-
className: (0,
|
|
3729
|
+
className: (0, import_cn30.cn)(
|
|
2673
3730
|
"flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-input/20 px-2 py-1.5 text-xs/relaxed whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
|
2674
3731
|
className
|
|
2675
3732
|
)
|
|
2676
3733
|
}, props), {
|
|
2677
3734
|
children: [
|
|
2678
3735
|
children,
|
|
2679
|
-
/* @__PURE__ */ (0,
|
|
3736
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2680
3737
|
import_select.Select.Icon,
|
|
2681
3738
|
{
|
|
2682
|
-
render: /* @__PURE__ */ (0,
|
|
3739
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react16.ChevronDownIcon, { className: "pointer-events-none size-3.5 text-muted-foreground" })
|
|
2683
3740
|
}
|
|
2684
3741
|
)
|
|
2685
3742
|
]
|
|
@@ -2704,7 +3761,7 @@ function SelectContent(_a) {
|
|
|
2704
3761
|
"alignOffset",
|
|
2705
3762
|
"alignItemWithTrigger"
|
|
2706
3763
|
]);
|
|
2707
|
-
return /* @__PURE__ */ (0,
|
|
3764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_select.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2708
3765
|
import_select.Select.Positioner,
|
|
2709
3766
|
{
|
|
2710
3767
|
side,
|
|
@@ -2713,20 +3770,20 @@ function SelectContent(_a) {
|
|
|
2713
3770
|
alignOffset,
|
|
2714
3771
|
alignItemWithTrigger,
|
|
2715
3772
|
className: "isolate z-50",
|
|
2716
|
-
children: /* @__PURE__ */ (0,
|
|
3773
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2717
3774
|
import_select.Select.Popup,
|
|
2718
3775
|
__spreadProps(__spreadValues({
|
|
2719
3776
|
"data-slot": "select-content",
|
|
2720
3777
|
"data-align-trigger": alignItemWithTrigger,
|
|
2721
|
-
className: (0,
|
|
3778
|
+
className: (0, import_cn30.cn)(
|
|
2722
3779
|
"relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
2723
3780
|
className
|
|
2724
3781
|
)
|
|
2725
3782
|
}, props), {
|
|
2726
3783
|
children: [
|
|
2727
|
-
/* @__PURE__ */ (0,
|
|
2728
|
-
/* @__PURE__ */ (0,
|
|
2729
|
-
/* @__PURE__ */ (0,
|
|
3784
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectScrollUpButton, {}),
|
|
3785
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_select.Select.List, { children }),
|
|
3786
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectScrollDownButton, {})
|
|
2730
3787
|
]
|
|
2731
3788
|
})
|
|
2732
3789
|
)
|
|
@@ -2741,22 +3798,22 @@ function SelectItem(_a) {
|
|
|
2741
3798
|
"className",
|
|
2742
3799
|
"children"
|
|
2743
3800
|
]);
|
|
2744
|
-
return /* @__PURE__ */ (0,
|
|
3801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2745
3802
|
import_select.Select.Item,
|
|
2746
3803
|
__spreadProps(__spreadValues({
|
|
2747
3804
|
"data-slot": "select-item",
|
|
2748
|
-
className: (0,
|
|
3805
|
+
className: (0, import_cn30.cn)(
|
|
2749
3806
|
"relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
2750
3807
|
className
|
|
2751
3808
|
)
|
|
2752
3809
|
}, props), {
|
|
2753
3810
|
children: [
|
|
2754
|
-
/* @__PURE__ */ (0,
|
|
2755
|
-
/* @__PURE__ */ (0,
|
|
3811
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_select.Select.ItemText, { className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap", children }),
|
|
3812
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2756
3813
|
import_select.Select.ItemIndicator,
|
|
2757
3814
|
{
|
|
2758
|
-
render: /* @__PURE__ */ (0,
|
|
2759
|
-
children: /* @__PURE__ */ (0,
|
|
3815
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center" }),
|
|
3816
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react16.CheckIcon, { className: "pointer-events-none" })
|
|
2760
3817
|
}
|
|
2761
3818
|
)
|
|
2762
3819
|
]
|
|
@@ -2769,16 +3826,16 @@ function SelectScrollUpButton(_a) {
|
|
|
2769
3826
|
} = _b, props = __objRest(_b, [
|
|
2770
3827
|
"className"
|
|
2771
3828
|
]);
|
|
2772
|
-
return /* @__PURE__ */ (0,
|
|
3829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2773
3830
|
import_select.Select.ScrollUpArrow,
|
|
2774
3831
|
__spreadProps(__spreadValues({
|
|
2775
3832
|
"data-slot": "select-scroll-up-button",
|
|
2776
|
-
className: (0,
|
|
3833
|
+
className: (0, import_cn30.cn)(
|
|
2777
3834
|
"top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",
|
|
2778
3835
|
className
|
|
2779
3836
|
)
|
|
2780
3837
|
}, props), {
|
|
2781
|
-
children: /* @__PURE__ */ (0,
|
|
3838
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react16.ChevronUpIcon, {})
|
|
2782
3839
|
})
|
|
2783
3840
|
);
|
|
2784
3841
|
}
|
|
@@ -2788,22 +3845,22 @@ function SelectScrollDownButton(_a) {
|
|
|
2788
3845
|
} = _b, props = __objRest(_b, [
|
|
2789
3846
|
"className"
|
|
2790
3847
|
]);
|
|
2791
|
-
return /* @__PURE__ */ (0,
|
|
3848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2792
3849
|
import_select.Select.ScrollDownArrow,
|
|
2793
3850
|
__spreadProps(__spreadValues({
|
|
2794
3851
|
"data-slot": "select-scroll-down-button",
|
|
2795
|
-
className: (0,
|
|
3852
|
+
className: (0, import_cn30.cn)(
|
|
2796
3853
|
"bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",
|
|
2797
3854
|
className
|
|
2798
3855
|
)
|
|
2799
3856
|
}, props), {
|
|
2800
|
-
children: /* @__PURE__ */ (0,
|
|
3857
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react16.ChevronDownIcon, {})
|
|
2801
3858
|
})
|
|
2802
3859
|
);
|
|
2803
3860
|
}
|
|
2804
3861
|
|
|
2805
3862
|
// src/components/composed/data-table/table-header-filter.tsx
|
|
2806
|
-
var
|
|
3863
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2807
3864
|
function smartFilterFn(row, columnId, filterValue) {
|
|
2808
3865
|
var _a, _b, _c;
|
|
2809
3866
|
if (filterValue === void 0 || filterValue === null || filterValue === "" || filterValue === "all") {
|
|
@@ -2944,13 +4001,13 @@ function ColumnFilterInput({
|
|
|
2944
4001
|
table,
|
|
2945
4002
|
headerText
|
|
2946
4003
|
}) {
|
|
2947
|
-
const [calendarOpen, setCalendarOpen] = (0,
|
|
4004
|
+
const [calendarOpen, setCalendarOpen] = (0, import_react18.useState)(false);
|
|
2948
4005
|
const filterValue = column.getFilterValue();
|
|
2949
|
-
const variant = (0,
|
|
4006
|
+
const variant = (0, import_react18.useMemo)(
|
|
2950
4007
|
() => getFilterVariant(column, table),
|
|
2951
4008
|
[column, table]
|
|
2952
4009
|
);
|
|
2953
|
-
const options = (0,
|
|
4010
|
+
const options = (0, import_react18.useMemo)(() => {
|
|
2954
4011
|
if (variant === "boolean") {
|
|
2955
4012
|
return [
|
|
2956
4013
|
{ label: "True / Yes", value: "true" },
|
|
@@ -2964,7 +4021,7 @@ function ColumnFilterInput({
|
|
|
2964
4021
|
}, [column, table, variant]);
|
|
2965
4022
|
if (variant === "boolean" || variant === "select") {
|
|
2966
4023
|
const currentValue = filterValue === void 0 || filterValue === null || filterValue === "" ? "all" : String(filterValue);
|
|
2967
|
-
return /* @__PURE__ */ (0,
|
|
4024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "relative flex items-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2968
4025
|
Select,
|
|
2969
4026
|
{
|
|
2970
4027
|
value: currentValue,
|
|
@@ -2976,13 +4033,13 @@ function ColumnFilterInput({
|
|
|
2976
4033
|
}
|
|
2977
4034
|
},
|
|
2978
4035
|
children: [
|
|
2979
|
-
/* @__PURE__ */ (0,
|
|
4036
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2980
4037
|
SelectTrigger,
|
|
2981
4038
|
{
|
|
2982
4039
|
className: "w-full",
|
|
2983
4040
|
onKeyDown: (e) => e.stopPropagation(),
|
|
2984
4041
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2985
|
-
children: /* @__PURE__ */ (0,
|
|
4042
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2986
4043
|
SelectValue,
|
|
2987
4044
|
{
|
|
2988
4045
|
placeholder: `Select ${headerText.toLowerCase()}...`,
|
|
@@ -2991,9 +4048,9 @@ function ColumnFilterInput({
|
|
|
2991
4048
|
)
|
|
2992
4049
|
}
|
|
2993
4050
|
),
|
|
2994
|
-
/* @__PURE__ */ (0,
|
|
2995
|
-
/* @__PURE__ */ (0,
|
|
2996
|
-
options.map((opt) => /* @__PURE__ */ (0,
|
|
4051
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(SelectContent, { align: "start", children: [
|
|
4052
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SelectItem, { value: "all", children: "All" }),
|
|
4053
|
+
options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2997
4054
|
SelectItem,
|
|
2998
4055
|
{
|
|
2999
4056
|
value: opt.value,
|
|
@@ -3020,36 +4077,36 @@ function ColumnFilterInput({
|
|
|
3020
4077
|
}
|
|
3021
4078
|
}
|
|
3022
4079
|
const formattedDateLabel = dateObj ? (0, import_date_fns.format)(dateObj, "yyyy-MM-dd") : "";
|
|
3023
|
-
return /* @__PURE__ */ (0,
|
|
3024
|
-
/* @__PURE__ */ (0,
|
|
4080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "relative flex items-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Popover, { open: calendarOpen, onOpenChange: setCalendarOpen, children: [
|
|
4081
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3025
4082
|
PopoverTrigger,
|
|
3026
4083
|
{
|
|
3027
|
-
render: /* @__PURE__ */ (0,
|
|
4084
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3028
4085
|
Button,
|
|
3029
4086
|
{
|
|
3030
4087
|
variant: "outline",
|
|
3031
|
-
className: (0,
|
|
4088
|
+
className: (0, import_cn26.cn)(
|
|
3032
4089
|
"w-full justify-start",
|
|
3033
4090
|
!formattedDateLabel && "text-muted-foreground"
|
|
3034
4091
|
),
|
|
3035
4092
|
onKeyDown: (e) => e.stopPropagation(),
|
|
3036
4093
|
onPointerDown: (e) => e.stopPropagation(),
|
|
3037
4094
|
children: [
|
|
3038
|
-
/* @__PURE__ */ (0,
|
|
3039
|
-
/* @__PURE__ */ (0,
|
|
4095
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react17.CalendarIcon, { className: "mr-1 size-3 shrink-0" }),
|
|
4096
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "truncate", children: formattedDateLabel || `Pick ${headerText.toLowerCase()}...` })
|
|
3040
4097
|
]
|
|
3041
4098
|
}
|
|
3042
4099
|
)
|
|
3043
4100
|
}
|
|
3044
4101
|
),
|
|
3045
|
-
/* @__PURE__ */ (0,
|
|
4102
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3046
4103
|
PopoverContent,
|
|
3047
4104
|
{
|
|
3048
4105
|
className: "w-auto p-0",
|
|
3049
4106
|
align: "start",
|
|
3050
4107
|
onPointerDown: (e) => e.stopPropagation(),
|
|
3051
4108
|
onKeyDown: (e) => e.stopPropagation(),
|
|
3052
|
-
children: /* @__PURE__ */ (0,
|
|
4109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3053
4110
|
Calendar,
|
|
3054
4111
|
{
|
|
3055
4112
|
mode: "single",
|
|
@@ -3068,7 +4125,7 @@ function ColumnFilterInput({
|
|
|
3068
4125
|
)
|
|
3069
4126
|
] }) });
|
|
3070
4127
|
}
|
|
3071
|
-
return /* @__PURE__ */ (0,
|
|
4128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "relative flex items-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3072
4129
|
Input,
|
|
3073
4130
|
{
|
|
3074
4131
|
id: `filter-${column.id}`,
|
|
@@ -3085,46 +4142,46 @@ function DataTableHeaderFilter({
|
|
|
3085
4142
|
table,
|
|
3086
4143
|
columnFilters
|
|
3087
4144
|
}) {
|
|
3088
|
-
const filterableColumns = (0,
|
|
4145
|
+
const filterableColumns = (0, import_react18.useMemo)(
|
|
3089
4146
|
() => table.getAllColumns().filter(
|
|
3090
4147
|
(column) => typeof column.accessorFn !== "undefined" && column.getCanFilter()
|
|
3091
4148
|
),
|
|
3092
4149
|
[table]
|
|
3093
4150
|
);
|
|
3094
4151
|
if (filterableColumns.length === 0) return null;
|
|
3095
|
-
return /* @__PURE__ */ (0,
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
3097
|
-
/* @__PURE__ */ (0,
|
|
4152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(DropdownMenu, { children: [
|
|
4153
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Tooltip, { children: [
|
|
4154
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3098
4155
|
DropdownMenuTrigger,
|
|
3099
4156
|
{
|
|
3100
|
-
render: /* @__PURE__ */ (0,
|
|
4157
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3101
4158
|
TooltipTrigger,
|
|
3102
4159
|
{
|
|
3103
|
-
render: /* @__PURE__ */ (0,
|
|
4160
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3104
4161
|
Button,
|
|
3105
4162
|
{
|
|
3106
4163
|
variant: columnFilters.length > 0 ? "secondary" : "outline",
|
|
3107
4164
|
size: "icon",
|
|
3108
|
-
children: /* @__PURE__ */ (0,
|
|
4165
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react17.ListFilterIcon, {})
|
|
3109
4166
|
}
|
|
3110
4167
|
)
|
|
3111
4168
|
}
|
|
3112
4169
|
)
|
|
3113
4170
|
}
|
|
3114
4171
|
),
|
|
3115
|
-
/* @__PURE__ */ (0,
|
|
4172
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TooltipContent, { children: "Filter options" })
|
|
3116
4173
|
] }),
|
|
3117
|
-
/* @__PURE__ */ (0,
|
|
3118
|
-
/* @__PURE__ */ (0,
|
|
3119
|
-
/* @__PURE__ */ (0,
|
|
3120
|
-
/* @__PURE__ */ (0,
|
|
4174
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DropdownMenuContent, { align: "end", className: "w-80", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(DropdownMenuGroup, { children: [
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DropdownMenuLabel, { children: "Filter by column" }),
|
|
4176
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DropdownMenuSeparator, {}),
|
|
4177
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "max-h-64 overflow-y-auto space-y-2.5 p-1", children: filterableColumns.map((column) => {
|
|
3121
4178
|
const headerText = typeof column.columnDef.header === "string" ? column.columnDef.header : column.id;
|
|
3122
|
-
return /* @__PURE__ */ (0,
|
|
4179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3123
4180
|
"div",
|
|
3124
4181
|
{
|
|
3125
4182
|
className: "flex items-center justify-between px-1",
|
|
3126
4183
|
children: [
|
|
3127
|
-
/* @__PURE__ */ (0,
|
|
4184
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3128
4185
|
"label",
|
|
3129
4186
|
{
|
|
3130
4187
|
htmlFor: `filter-${column.id}`,
|
|
@@ -3132,7 +4189,7 @@ function DataTableHeaderFilter({
|
|
|
3132
4189
|
children: headerText
|
|
3133
4190
|
}
|
|
3134
4191
|
),
|
|
3135
|
-
/* @__PURE__ */ (0,
|
|
4192
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3136
4193
|
ColumnFilterInput,
|
|
3137
4194
|
{
|
|
3138
4195
|
column,
|
|
@@ -3145,9 +4202,9 @@ function DataTableHeaderFilter({
|
|
|
3145
4202
|
column.id
|
|
3146
4203
|
);
|
|
3147
4204
|
}) }),
|
|
3148
|
-
columnFilters.length > 0 && /* @__PURE__ */ (0,
|
|
3149
|
-
/* @__PURE__ */ (0,
|
|
3150
|
-
/* @__PURE__ */ (0,
|
|
4205
|
+
columnFilters.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
4206
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DropdownMenuSeparator, {}),
|
|
4207
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3151
4208
|
DropdownMenuItem,
|
|
3152
4209
|
{
|
|
3153
4210
|
className: "hover:cursor-pointer text-destructive focus:text-destructive",
|
|
@@ -3161,13 +4218,13 @@ function DataTableHeaderFilter({
|
|
|
3161
4218
|
}
|
|
3162
4219
|
|
|
3163
4220
|
// src/components/composed/data-table/table-header-refresh.tsx
|
|
3164
|
-
var
|
|
4221
|
+
var import_lucide_react18 = require("lucide-react");
|
|
3165
4222
|
var import_navigation2 = require("next/navigation");
|
|
3166
|
-
var
|
|
3167
|
-
var
|
|
4223
|
+
var import_react19 = require("react");
|
|
4224
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3168
4225
|
function DataTableHeaderRefresh() {
|
|
3169
4226
|
const router = (0, import_navigation2.useRouter)();
|
|
3170
|
-
const [isRefreshing, setIsRefreshing] = (0,
|
|
4227
|
+
const [isRefreshing, setIsRefreshing] = (0, import_react19.useState)(false);
|
|
3171
4228
|
const handleRefresh = () => {
|
|
3172
4229
|
setIsRefreshing(true);
|
|
3173
4230
|
router.refresh();
|
|
@@ -3175,21 +4232,21 @@ function DataTableHeaderRefresh() {
|
|
|
3175
4232
|
setIsRefreshing(false);
|
|
3176
4233
|
}, 750);
|
|
3177
4234
|
};
|
|
3178
|
-
return /* @__PURE__ */ (0,
|
|
3179
|
-
/* @__PURE__ */ (0,
|
|
4235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Tooltip, { children: [
|
|
4236
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3180
4237
|
TooltipTrigger,
|
|
3181
4238
|
{
|
|
3182
|
-
render: /* @__PURE__ */ (0,
|
|
4239
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3183
4240
|
Button,
|
|
3184
4241
|
{
|
|
3185
4242
|
variant: "outline",
|
|
3186
4243
|
size: "icon",
|
|
3187
4244
|
onClick: handleRefresh,
|
|
3188
4245
|
disabled: isRefreshing,
|
|
3189
|
-
children: /* @__PURE__ */ (0,
|
|
3190
|
-
|
|
4246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4247
|
+
import_lucide_react18.RotateCwIcon,
|
|
3191
4248
|
{
|
|
3192
|
-
className: (0,
|
|
4249
|
+
className: (0, import_cn26.cn)(
|
|
3193
4250
|
"transition-transform duration-750",
|
|
3194
4251
|
isRefreshing && "animate-spin"
|
|
3195
4252
|
)
|
|
@@ -3199,19 +4256,19 @@ function DataTableHeaderRefresh() {
|
|
|
3199
4256
|
)
|
|
3200
4257
|
}
|
|
3201
4258
|
),
|
|
3202
|
-
/* @__PURE__ */ (0,
|
|
4259
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TooltipContent, { children: "Refresh data" })
|
|
3203
4260
|
] });
|
|
3204
4261
|
}
|
|
3205
4262
|
|
|
3206
4263
|
// src/components/composed/data-table/table-header-search.tsx
|
|
3207
|
-
var
|
|
3208
|
-
var
|
|
4264
|
+
var import_lucide_react19 = require("lucide-react");
|
|
4265
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3209
4266
|
function DataTableHeaderSearch({
|
|
3210
4267
|
value = "",
|
|
3211
4268
|
onChange
|
|
3212
4269
|
}) {
|
|
3213
|
-
return /* @__PURE__ */ (0,
|
|
3214
|
-
/* @__PURE__ */ (0,
|
|
4270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "relative flex items-center max-w-sm w-full", children: [
|
|
4271
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3215
4272
|
Input,
|
|
3216
4273
|
{
|
|
3217
4274
|
placeholder: "Search...",
|
|
@@ -3220,56 +4277,56 @@ function DataTableHeaderSearch({
|
|
|
3220
4277
|
className: "pr-7"
|
|
3221
4278
|
}
|
|
3222
4279
|
),
|
|
3223
|
-
Boolean(value) && /* @__PURE__ */ (0,
|
|
4280
|
+
Boolean(value) && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3224
4281
|
"button",
|
|
3225
4282
|
{
|
|
3226
4283
|
type: "button",
|
|
3227
4284
|
onClick: () => onChange(""),
|
|
3228
4285
|
className: "absolute right-2 text-muted-foreground hover:text-foreground p-0.5 rounded cursor-pointer",
|
|
3229
4286
|
"aria-label": "Clear search text",
|
|
3230
|
-
children: /* @__PURE__ */ (0,
|
|
4287
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react19.XIcon, { className: "size-3.5" })
|
|
3231
4288
|
}
|
|
3232
4289
|
)
|
|
3233
4290
|
] });
|
|
3234
4291
|
}
|
|
3235
4292
|
|
|
3236
4293
|
// src/components/composed/data-table/table-header-sort.tsx
|
|
3237
|
-
var
|
|
3238
|
-
var
|
|
4294
|
+
var import_lucide_react20 = require("lucide-react");
|
|
4295
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3239
4296
|
function DataTableHeaderSort({
|
|
3240
4297
|
table,
|
|
3241
4298
|
sorting
|
|
3242
4299
|
}) {
|
|
3243
4300
|
const sortableColumns = table.getAllColumns().filter((column) => column.getCanSort());
|
|
3244
|
-
return /* @__PURE__ */ (0,
|
|
3245
|
-
/* @__PURE__ */ (0,
|
|
3246
|
-
/* @__PURE__ */ (0,
|
|
4301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(DropdownMenu, { children: [
|
|
4302
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Tooltip, { children: [
|
|
4303
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3247
4304
|
DropdownMenuTrigger,
|
|
3248
4305
|
{
|
|
3249
|
-
render: /* @__PURE__ */ (0,
|
|
4306
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3250
4307
|
TooltipTrigger,
|
|
3251
4308
|
{
|
|
3252
|
-
render: /* @__PURE__ */ (0,
|
|
4309
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3253
4310
|
Button,
|
|
3254
4311
|
{
|
|
3255
4312
|
variant: sorting.length > 0 ? "secondary" : "outline",
|
|
3256
4313
|
size: "icon",
|
|
3257
|
-
children: /* @__PURE__ */ (0,
|
|
4314
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react20.ArrowUpDownIcon, {})
|
|
3258
4315
|
}
|
|
3259
4316
|
)
|
|
3260
4317
|
}
|
|
3261
4318
|
)
|
|
3262
4319
|
}
|
|
3263
4320
|
),
|
|
3264
|
-
/* @__PURE__ */ (0,
|
|
4321
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(TooltipContent, { children: "Sort options" })
|
|
3265
4322
|
] }),
|
|
3266
|
-
/* @__PURE__ */ (0,
|
|
3267
|
-
/* @__PURE__ */ (0,
|
|
3268
|
-
/* @__PURE__ */ (0,
|
|
4323
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DropdownMenuContent, { align: "end", className: "w-48", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(DropdownMenuGroup, { children: [
|
|
4324
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DropdownMenuLabel, { children: "Sort by column" }),
|
|
4325
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DropdownMenuSeparator, {}),
|
|
3269
4326
|
sortableColumns.map((column) => {
|
|
3270
4327
|
const isSorted = column.getIsSorted();
|
|
3271
4328
|
const headerText = typeof column.columnDef.header === "string" ? column.columnDef.header : column.id;
|
|
3272
|
-
return /* @__PURE__ */ (0,
|
|
4329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3273
4330
|
DropdownMenuItem,
|
|
3274
4331
|
{
|
|
3275
4332
|
className: "flex items-center justify-between hover:cursor-pointer capitalize",
|
|
@@ -3284,16 +4341,16 @@ function DataTableHeaderSort({
|
|
|
3284
4341
|
},
|
|
3285
4342
|
children: [
|
|
3286
4343
|
headerText,
|
|
3287
|
-
isSorted === "asc" && /* @__PURE__ */ (0,
|
|
3288
|
-
isSorted === "desc" && /* @__PURE__ */ (0,
|
|
4344
|
+
isSorted === "asc" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react20.ArrowUpIcon, { className: "size-3.5" }),
|
|
4345
|
+
isSorted === "desc" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react20.ArrowDownIcon, { className: "size-3.5" })
|
|
3289
4346
|
]
|
|
3290
4347
|
},
|
|
3291
4348
|
column.id
|
|
3292
4349
|
);
|
|
3293
4350
|
}),
|
|
3294
|
-
sorting.length > 0 && /* @__PURE__ */ (0,
|
|
3295
|
-
/* @__PURE__ */ (0,
|
|
3296
|
-
/* @__PURE__ */ (0,
|
|
4351
|
+
sorting.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
4352
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DropdownMenuSeparator, {}),
|
|
4353
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3297
4354
|
DropdownMenuItem,
|
|
3298
4355
|
{
|
|
3299
4356
|
className: "hover:cursor-pointer text-destructive focus:text-destructive",
|
|
@@ -3307,34 +4364,34 @@ function DataTableHeaderSort({
|
|
|
3307
4364
|
}
|
|
3308
4365
|
|
|
3309
4366
|
// src/components/composed/data-table/table-header-toggle.tsx
|
|
3310
|
-
var
|
|
3311
|
-
var
|
|
4367
|
+
var import_lucide_react21 = require("lucide-react");
|
|
4368
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3312
4369
|
function DataTableHeaderToggle({
|
|
3313
4370
|
table
|
|
3314
4371
|
}) {
|
|
3315
|
-
return /* @__PURE__ */ (0,
|
|
3316
|
-
/* @__PURE__ */ (0,
|
|
3317
|
-
/* @__PURE__ */ (0,
|
|
4372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DropdownMenu, { children: [
|
|
4373
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Tooltip, { children: [
|
|
4374
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3318
4375
|
DropdownMenuTrigger,
|
|
3319
4376
|
{
|
|
3320
|
-
render: /* @__PURE__ */ (0,
|
|
4377
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3321
4378
|
TooltipTrigger,
|
|
3322
4379
|
{
|
|
3323
|
-
render: /* @__PURE__ */ (0,
|
|
4380
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { variant: "outline", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react21.Columns3CogIcon, {}) })
|
|
3324
4381
|
}
|
|
3325
4382
|
)
|
|
3326
4383
|
}
|
|
3327
4384
|
),
|
|
3328
|
-
/* @__PURE__ */ (0,
|
|
4385
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TooltipContent, { children: "Toggle columns" })
|
|
3329
4386
|
] }),
|
|
3330
|
-
/* @__PURE__ */ (0,
|
|
3331
|
-
/* @__PURE__ */ (0,
|
|
3332
|
-
/* @__PURE__ */ (0,
|
|
4387
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DropdownMenuContent, { align: "end", className: "w-48", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DropdownMenuGroup, { children: [
|
|
4388
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DropdownMenuLabel, { children: "Toggle columns" }),
|
|
4389
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DropdownMenuSeparator, {}),
|
|
3333
4390
|
table.getAllColumns().filter(
|
|
3334
4391
|
(column) => typeof column.accessorFn !== "undefined" && column.getCanHide()
|
|
3335
4392
|
).map((column) => {
|
|
3336
4393
|
const headerText = typeof column.columnDef.header === "string" ? column.columnDef.header : column.id;
|
|
3337
|
-
return /* @__PURE__ */ (0,
|
|
4394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3338
4395
|
DropdownMenuCheckboxItem,
|
|
3339
4396
|
{
|
|
3340
4397
|
className: "capitalize hover:cursor-pointer",
|
|
@@ -3350,9 +4407,9 @@ function DataTableHeaderToggle({
|
|
|
3350
4407
|
}
|
|
3351
4408
|
|
|
3352
4409
|
// src/components/composed/data-table/data-row-actions.tsx
|
|
3353
|
-
var
|
|
3354
|
-
var
|
|
3355
|
-
var
|
|
4410
|
+
var import_lucide_react22 = require("lucide-react");
|
|
4411
|
+
var import_react20 = require("react");
|
|
4412
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3356
4413
|
function RowActions({
|
|
3357
4414
|
label = "Actions",
|
|
3358
4415
|
items = [],
|
|
@@ -3366,50 +4423,50 @@ function RowActions({
|
|
|
3366
4423
|
if (visibleItems.length === 0) {
|
|
3367
4424
|
return null;
|
|
3368
4425
|
}
|
|
3369
|
-
return /* @__PURE__ */ (0,
|
|
4426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3370
4427
|
"div",
|
|
3371
4428
|
{
|
|
3372
|
-
className: (0,
|
|
3373
|
-
children: /* @__PURE__ */ (0,
|
|
3374
|
-
/* @__PURE__ */ (0,
|
|
4429
|
+
className: (0, import_cn26.cn)("flex items-center justify-end w-full", containerClassName),
|
|
4430
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(DropdownMenu, { children: [
|
|
4431
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3375
4432
|
DropdownMenuTrigger,
|
|
3376
4433
|
{
|
|
3377
|
-
render: /* @__PURE__ */ (0,
|
|
4434
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Button, { variant: "ghost", size: "icon-xs", "aria-label": triggerLabel, children: triggerIcon != null ? triggerIcon : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react22.MoreHorizontal, { className: "size-4" }) })
|
|
3378
4435
|
}
|
|
3379
4436
|
),
|
|
3380
|
-
/* @__PURE__ */ (0,
|
|
4437
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3381
4438
|
DropdownMenuContent,
|
|
3382
4439
|
{
|
|
3383
4440
|
align,
|
|
3384
|
-
className: (0,
|
|
3385
|
-
children: /* @__PURE__ */ (0,
|
|
3386
|
-
label && /* @__PURE__ */ (0,
|
|
3387
|
-
/* @__PURE__ */ (0,
|
|
3388
|
-
/* @__PURE__ */ (0,
|
|
4441
|
+
className: (0, import_cn26.cn)("w-40", contentClassName),
|
|
4442
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(DropdownMenuGroup, { children: [
|
|
4443
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
4444
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DropdownMenuLabel, { children: label }),
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DropdownMenuSeparator, {})
|
|
3389
4446
|
] }),
|
|
3390
4447
|
visibleItems.map((item, index) => {
|
|
3391
4448
|
var _a;
|
|
3392
4449
|
const itemKey = (_a = item.id) != null ? _a : `${item.label}-${index}`;
|
|
3393
4450
|
const isDestructive = item.variant === "destructive";
|
|
3394
|
-
return /* @__PURE__ */ (0,
|
|
3395
|
-
item.separatorBefore && /* @__PURE__ */ (0,
|
|
3396
|
-
/* @__PURE__ */ (0,
|
|
4451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react20.Fragment, { children: [
|
|
4452
|
+
item.separatorBefore && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DropdownMenuSeparator, {}),
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3397
4454
|
DropdownMenuItem,
|
|
3398
4455
|
{
|
|
3399
4456
|
onClick: item.onClick,
|
|
3400
4457
|
disabled: item.disabled,
|
|
3401
|
-
className: (0,
|
|
4458
|
+
className: (0, import_cn26.cn)(
|
|
3402
4459
|
"hover:cursor-pointer flex items-center gap-2",
|
|
3403
4460
|
isDestructive && "text-destructive focus:text-destructive",
|
|
3404
4461
|
item.className
|
|
3405
4462
|
),
|
|
3406
4463
|
children: [
|
|
3407
|
-
item.icon && /* @__PURE__ */ (0,
|
|
3408
|
-
/* @__PURE__ */ (0,
|
|
4464
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "size-4 shrink-0 flex items-center justify-center", children: item.icon }),
|
|
4465
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: item.label })
|
|
3409
4466
|
]
|
|
3410
4467
|
}
|
|
3411
4468
|
),
|
|
3412
|
-
item.separatorAfter && /* @__PURE__ */ (0,
|
|
4469
|
+
item.separatorAfter && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DropdownMenuSeparator, {})
|
|
3413
4470
|
] }, itemKey);
|
|
3414
4471
|
})
|
|
3415
4472
|
] })
|
|
@@ -3421,7 +4478,7 @@ function RowActions({
|
|
|
3421
4478
|
}
|
|
3422
4479
|
|
|
3423
4480
|
// src/components/composed/data-table/data-table.tsx
|
|
3424
|
-
var
|
|
4481
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3425
4482
|
function DataTable({
|
|
3426
4483
|
columns,
|
|
3427
4484
|
data,
|
|
@@ -3439,12 +4496,12 @@ function DataTable({
|
|
|
3439
4496
|
showAddButton = true
|
|
3440
4497
|
}) {
|
|
3441
4498
|
const router = (0, import_navigation3.useRouter)();
|
|
3442
|
-
const [createOpen, setCreateOpen] = (0,
|
|
3443
|
-
const [sorting, setSorting] = (0,
|
|
3444
|
-
const [columnFilters, setColumnFilters] = (0,
|
|
3445
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3446
|
-
const [globalFilter, setGlobalFilter] = (0,
|
|
3447
|
-
const columnsWithSmartFilters = (0,
|
|
4499
|
+
const [createOpen, setCreateOpen] = (0, import_react21.useState)(false);
|
|
4500
|
+
const [sorting, setSorting] = (0, import_react21.useState)([]);
|
|
4501
|
+
const [columnFilters, setColumnFilters] = (0, import_react21.useState)([]);
|
|
4502
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react21.useState)(initialColumnVisibility != null ? initialColumnVisibility : {});
|
|
4503
|
+
const [globalFilter, setGlobalFilter] = (0, import_react21.useState)("");
|
|
4504
|
+
const columnsWithSmartFilters = (0, import_react21.useMemo)(() => {
|
|
3448
4505
|
return columns.map((col) => __spreadValues({
|
|
3449
4506
|
filterFn: smartFilterFn
|
|
3450
4507
|
}, col));
|
|
@@ -3474,12 +4531,12 @@ function DataTable({
|
|
|
3474
4531
|
});
|
|
3475
4532
|
if (data.length === 0) {
|
|
3476
4533
|
const hasCreateAction = Boolean(renderCreateDialog);
|
|
3477
|
-
return /* @__PURE__ */ (0,
|
|
3478
|
-
/* @__PURE__ */ (0,
|
|
4534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-2", children: [
|
|
4535
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3479
4536
|
StateEmpty,
|
|
3480
4537
|
{
|
|
3481
4538
|
state: "outline",
|
|
3482
|
-
icon: /* @__PURE__ */ (0,
|
|
4539
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react23.FolderOpenIcon, { className: "size-6 text-muted-foreground" }),
|
|
3483
4540
|
title: "No Data Available",
|
|
3484
4541
|
description: "There are currently no records to display. Create a new record to get started.",
|
|
3485
4542
|
buttonText: hasCreateAction ? addLabel != null ? addLabel : "Add Record" : "Refresh",
|
|
@@ -3489,26 +4546,26 @@ function DataTable({
|
|
|
3489
4546
|
renderCreateDialog == null ? void 0 : renderCreateDialog(createOpen, setCreateOpen)
|
|
3490
4547
|
] });
|
|
3491
4548
|
}
|
|
3492
|
-
return /* @__PURE__ */ (0,
|
|
3493
|
-
/* @__PURE__ */ (0,
|
|
3494
|
-
showSearchInput ? /* @__PURE__ */ (0,
|
|
4549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-2", children: [
|
|
4550
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-row items-center justify-between gap-1", children: [
|
|
4551
|
+
showSearchInput ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3495
4552
|
DataTableHeaderSearch,
|
|
3496
4553
|
{
|
|
3497
4554
|
value: globalFilter,
|
|
3498
4555
|
onChange: setGlobalFilter
|
|
3499
4556
|
}
|
|
3500
|
-
) : /* @__PURE__ */ (0,
|
|
3501
|
-
/* @__PURE__ */ (0,
|
|
3502
|
-
showRefreshButton && /* @__PURE__ */ (0,
|
|
3503
|
-
showSortButton && /* @__PURE__ */ (0,
|
|
3504
|
-
showFilterButton && /* @__PURE__ */ (0,
|
|
4557
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", {}),
|
|
4558
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-row items-center gap-1", children: [
|
|
4559
|
+
showRefreshButton && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DataTableHeaderRefresh, {}),
|
|
4560
|
+
showSortButton && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DataTableHeaderSort, { table, sorting }),
|
|
4561
|
+
showFilterButton && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3505
4562
|
DataTableHeaderFilter,
|
|
3506
4563
|
{
|
|
3507
4564
|
table,
|
|
3508
4565
|
columnFilters
|
|
3509
4566
|
}
|
|
3510
4567
|
),
|
|
3511
|
-
showDownloadButton && /* @__PURE__ */ (0,
|
|
4568
|
+
showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3512
4569
|
DataTableHeaderDownload,
|
|
3513
4570
|
{
|
|
3514
4571
|
table,
|
|
@@ -3516,8 +4573,8 @@ function DataTable({
|
|
|
3516
4573
|
onDownload
|
|
3517
4574
|
}
|
|
3518
4575
|
),
|
|
3519
|
-
showColumnToggleButton && /* @__PURE__ */ (0,
|
|
3520
|
-
showAddButton && renderCreateDialog && /* @__PURE__ */ (0,
|
|
4576
|
+
showColumnToggleButton && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DataTableHeaderToggle, { table }),
|
|
4577
|
+
showAddButton && renderCreateDialog && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3521
4578
|
DataTableHeaderAdd,
|
|
3522
4579
|
{
|
|
3523
4580
|
onAdd: () => setCreateOpen(true),
|
|
@@ -3527,13 +4584,13 @@ function DataTable({
|
|
|
3527
4584
|
] })
|
|
3528
4585
|
] }),
|
|
3529
4586
|
renderCreateDialog == null ? void 0 : renderCreateDialog(createOpen, setCreateOpen),
|
|
3530
|
-
/* @__PURE__ */ (0,
|
|
3531
|
-
/* @__PURE__ */ (0,
|
|
3532
|
-
/* @__PURE__ */ (0,
|
|
4587
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "overflow-hidden rounded-md border [&_[data-slot=table-container]]:no-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Table, { children: [
|
|
4588
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DataTableContentHeader, { table }),
|
|
4589
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DataTableContentBody, { table, columns })
|
|
3533
4590
|
] }) }),
|
|
3534
|
-
/* @__PURE__ */ (0,
|
|
3535
|
-
/* @__PURE__ */ (0,
|
|
3536
|
-
/* @__PURE__ */ (0,
|
|
4591
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center justify-between px-2", children: [
|
|
4592
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DataTableFooterEntries, { table }),
|
|
4593
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DataTableFooterPagination, { table })
|
|
3537
4594
|
] })
|
|
3538
4595
|
] });
|
|
3539
4596
|
}
|
|
@@ -3541,13 +4598,13 @@ function DataTable({
|
|
|
3541
4598
|
// src/components/composed/header-tabs.tsx
|
|
3542
4599
|
var import_link2 = __toESM(require("next/link"));
|
|
3543
4600
|
var import_navigation4 = require("next/navigation");
|
|
3544
|
-
var
|
|
4601
|
+
var import_react22 = require("react");
|
|
3545
4602
|
|
|
3546
4603
|
// src/components/ui/tabs.tsx
|
|
3547
4604
|
var import_tabs = require("@base-ui/react/tabs");
|
|
3548
4605
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
3549
|
-
var
|
|
3550
|
-
var
|
|
4606
|
+
var import_cn31 = require("cn");
|
|
4607
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3551
4608
|
function Tabs(_a) {
|
|
3552
4609
|
var _b = _a, {
|
|
3553
4610
|
className,
|
|
@@ -3556,12 +4613,12 @@ function Tabs(_a) {
|
|
|
3556
4613
|
"className",
|
|
3557
4614
|
"orientation"
|
|
3558
4615
|
]);
|
|
3559
|
-
return /* @__PURE__ */ (0,
|
|
4616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3560
4617
|
import_tabs.Tabs.Root,
|
|
3561
4618
|
__spreadValues({
|
|
3562
4619
|
"data-slot": "tabs",
|
|
3563
4620
|
"data-orientation": orientation,
|
|
3564
|
-
className: (0,
|
|
4621
|
+
className: (0, import_cn31.cn)(
|
|
3565
4622
|
"group/tabs flex gap-2 data-horizontal:flex-col",
|
|
3566
4623
|
className
|
|
3567
4624
|
)
|
|
@@ -3590,22 +4647,22 @@ function TabsList(_a) {
|
|
|
3590
4647
|
"className",
|
|
3591
4648
|
"variant"
|
|
3592
4649
|
]);
|
|
3593
|
-
return /* @__PURE__ */ (0,
|
|
4650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3594
4651
|
import_tabs.Tabs.List,
|
|
3595
4652
|
__spreadValues({
|
|
3596
4653
|
"data-slot": "tabs-list",
|
|
3597
4654
|
"data-variant": variant,
|
|
3598
|
-
className: (0,
|
|
4655
|
+
className: (0, import_cn31.cn)(tabsListVariants({ variant }), className)
|
|
3599
4656
|
}, props)
|
|
3600
4657
|
);
|
|
3601
4658
|
}
|
|
3602
4659
|
function TabsTrigger(_a) {
|
|
3603
4660
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3604
|
-
return /* @__PURE__ */ (0,
|
|
4661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3605
4662
|
import_tabs.Tabs.Tab,
|
|
3606
4663
|
__spreadValues({
|
|
3607
4664
|
"data-slot": "tabs-trigger",
|
|
3608
|
-
className: (0,
|
|
4665
|
+
className: (0, import_cn31.cn)(
|
|
3609
4666
|
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start group-data-vertical/tabs:py-[calc(--spacing(1.25))] hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
|
3610
4667
|
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
3611
4668
|
"data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
@@ -3617,16 +4674,16 @@ function TabsTrigger(_a) {
|
|
|
3617
4674
|
}
|
|
3618
4675
|
|
|
3619
4676
|
// src/components/composed/header-tabs.tsx
|
|
3620
|
-
var
|
|
4677
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3621
4678
|
function renderTabIcon(icon) {
|
|
3622
4679
|
if (!icon) return null;
|
|
3623
4680
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
3624
4681
|
const IconComp = icon;
|
|
3625
|
-
return /* @__PURE__ */ (0,
|
|
4682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(IconComp, {});
|
|
3626
4683
|
}
|
|
3627
4684
|
return icon;
|
|
3628
4685
|
}
|
|
3629
|
-
var HeaderTabs = (0,
|
|
4686
|
+
var HeaderTabs = (0, import_react22.memo)(function HeaderTabs2({
|
|
3630
4687
|
items,
|
|
3631
4688
|
value,
|
|
3632
4689
|
onValueChange,
|
|
@@ -3638,12 +4695,12 @@ var HeaderTabs = (0, import_react13.memo)(function HeaderTabs2({
|
|
|
3638
4695
|
(item) => item.url === pathname || pathname.endsWith(item.url) || pathname.split("/").includes(item.value)
|
|
3639
4696
|
) : void 0;
|
|
3640
4697
|
const activeTab = (_b = value != null ? value : matchedItem == null ? void 0 : matchedItem.value) != null ? _b : (_a = items[0]) == null ? void 0 : _a.value;
|
|
3641
|
-
return /* @__PURE__ */ (0,
|
|
3642
|
-
/* @__PURE__ */ (0,
|
|
4698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Tabs, { value: activeTab, onValueChange, className: "space-y-4", children: [
|
|
4699
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "w-full overflow-x-auto overflow-y-hidden border-b no-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TabsList, { variant: "line", className: "inline-flex w-max justify-start", children: items.map(({ title, value: tabValue, url, icon }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
3643
4700
|
TabsTrigger,
|
|
3644
4701
|
{
|
|
3645
4702
|
nativeButton: false,
|
|
3646
|
-
render: /* @__PURE__ */ (0,
|
|
4703
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_link2.default, { href: url }),
|
|
3647
4704
|
value: tabValue,
|
|
3648
4705
|
children: [
|
|
3649
4706
|
renderTabIcon(icon),
|
|
@@ -3657,27 +4714,27 @@ var HeaderTabs = (0, import_react13.memo)(function HeaderTabs2({
|
|
|
3657
4714
|
});
|
|
3658
4715
|
|
|
3659
4716
|
// src/components/composed/header-title.tsx
|
|
3660
|
-
var
|
|
3661
|
-
var
|
|
3662
|
-
var HeaderTitle = (0,
|
|
4717
|
+
var import_react23 = require("react");
|
|
4718
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4719
|
+
var HeaderTitle = (0, import_react23.memo)(function HeaderTitle2({
|
|
3663
4720
|
title,
|
|
3664
4721
|
subtitle,
|
|
3665
4722
|
children
|
|
3666
4723
|
}) {
|
|
3667
|
-
return /* @__PURE__ */ (0,
|
|
3668
|
-
/* @__PURE__ */ (0,
|
|
3669
|
-
/* @__PURE__ */ (0,
|
|
3670
|
-
/* @__PURE__ */ (0,
|
|
4724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "w-full space-y-4", children: [
|
|
4725
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { children: [
|
|
4726
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h1", { className: "font-semibold", children: title }),
|
|
4727
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-xs text-muted-foreground", children: subtitle })
|
|
3671
4728
|
] }),
|
|
3672
4729
|
children
|
|
3673
4730
|
] });
|
|
3674
4731
|
});
|
|
3675
4732
|
|
|
3676
4733
|
// src/components/composed/icons/google.tsx
|
|
3677
|
-
var
|
|
4734
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3678
4735
|
function GoogleIcon(_a) {
|
|
3679
4736
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3680
|
-
return /* @__PURE__ */ (0,
|
|
4737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
3681
4738
|
"svg",
|
|
3682
4739
|
__spreadProps(__spreadValues({
|
|
3683
4740
|
role: "img",
|
|
@@ -3687,28 +4744,28 @@ function GoogleIcon(_a) {
|
|
|
3687
4744
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3688
4745
|
}, props), {
|
|
3689
4746
|
children: [
|
|
3690
|
-
/* @__PURE__ */ (0,
|
|
4747
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3691
4748
|
"path",
|
|
3692
4749
|
{
|
|
3693
4750
|
fill: "#4285F4",
|
|
3694
4751
|
d: "M23.745 12.27c0-.7-.06-1.4-.19-2.07H12v4.51h6.6c-.29 1.52-1.14 2.82-2.4 3.68v3.05h3.88c2.27-2.09 3.665-5.17 3.665-9.17z"
|
|
3695
4752
|
}
|
|
3696
4753
|
),
|
|
3697
|
-
/* @__PURE__ */ (0,
|
|
4754
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3698
4755
|
"path",
|
|
3699
4756
|
{
|
|
3700
4757
|
fill: "#34A853",
|
|
3701
4758
|
d: "M12 24c3.24 0 5.95-1.08 7.93-2.91l-3.88-3.05c-1.08.72-2.45 1.16-4.05 1.16-3.12 0-5.77-2.1-6.72-4.93H1.24v3.15C3.26 21.36 7.33 24 12 24z"
|
|
3702
4759
|
}
|
|
3703
4760
|
),
|
|
3704
|
-
/* @__PURE__ */ (0,
|
|
4761
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3705
4762
|
"path",
|
|
3706
4763
|
{
|
|
3707
4764
|
fill: "#FBBC05",
|
|
3708
4765
|
d: "M5.28 14.27c-.25-.72-.38-1.49-.38-2.27s.13-1.55.38-2.27V6.58H1.24C.45 8.16 0 9.97 0 12s.45 3.84 1.24 5.42l4.04-3.15z"
|
|
3709
4766
|
}
|
|
3710
4767
|
),
|
|
3711
|
-
/* @__PURE__ */ (0,
|
|
4768
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3712
4769
|
"path",
|
|
3713
4770
|
{
|
|
3714
4771
|
fill: "#EA4335",
|
|
@@ -3721,8 +4778,16 @@ function GoogleIcon(_a) {
|
|
|
3721
4778
|
}
|
|
3722
4779
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3723
4780
|
0 && (module.exports = {
|
|
4781
|
+
ActiveTokensStatus,
|
|
3724
4782
|
AppSidebar,
|
|
4783
|
+
AvatarGroupInvitations,
|
|
4784
|
+
AvatarGroupUsers,
|
|
4785
|
+
AvatarInvitations,
|
|
3725
4786
|
AvatarUser,
|
|
4787
|
+
AvatarUsers,
|
|
4788
|
+
CodeLabel,
|
|
4789
|
+
CopyableCode,
|
|
4790
|
+
DEFAULT_METADATA_FIELDS,
|
|
3726
4791
|
DataTable,
|
|
3727
4792
|
DataTableContentBody,
|
|
3728
4793
|
DataTableContentHeader,
|
|
@@ -3735,14 +4800,32 @@ function GoogleIcon(_a) {
|
|
|
3735
4800
|
DataTableHeaderSearch,
|
|
3736
4801
|
DataTableHeaderSort,
|
|
3737
4802
|
DataTableHeaderToggle,
|
|
4803
|
+
DescriptionLabel,
|
|
3738
4804
|
EmailLabel,
|
|
3739
4805
|
EmailVerified,
|
|
3740
4806
|
GoogleIcon,
|
|
3741
4807
|
HeaderTabs,
|
|
3742
4808
|
HeaderTitle,
|
|
4809
|
+
ItemStatus,
|
|
3743
4810
|
JoinedLabel,
|
|
4811
|
+
MetadataProgress,
|
|
4812
|
+
MetadataStatus,
|
|
4813
|
+
OrganizationInvitations,
|
|
4814
|
+
OrganizationRoleBadge,
|
|
4815
|
+
OrganizationRoles,
|
|
4816
|
+
PermissionBadges,
|
|
4817
|
+
PermissionsBadges,
|
|
4818
|
+
ProgressStatus,
|
|
4819
|
+
RedirectUriLabel,
|
|
4820
|
+
RedirectUris,
|
|
3744
4821
|
RowActions,
|
|
4822
|
+
RunningStatus,
|
|
4823
|
+
SlugLabel,
|
|
3745
4824
|
StateEmpty,
|
|
4825
|
+
StatusBadge,
|
|
4826
|
+
TokenActivity,
|
|
4827
|
+
UrisLabel,
|
|
4828
|
+
UrisList,
|
|
3746
4829
|
UserRole,
|
|
3747
4830
|
UserStatus,
|
|
3748
4831
|
exportToCSV,
|