@prediktif/ui 0.1.20 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -3
- package/dist/index.d.mts +35 -8
- package/dist/index.d.ts +35 -8
- package/dist/index.js +506 -358
- package/dist/index.mjs +468 -326
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1277,9 +1277,10 @@ function formatSegment(segment, subHref, navMainItems = [], navSecondaryItems =
|
|
|
1277
1277
|
}
|
|
1278
1278
|
function isRouteActive(url, pathname) {
|
|
1279
1279
|
if (!pathname) return false;
|
|
1280
|
-
|
|
1281
|
-
const
|
|
1282
|
-
|
|
1280
|
+
const cleanUrl = url.replace(/\/$/, "") || "/";
|
|
1281
|
+
const cleanPath = pathname.replace(/\/$/, "") || "/";
|
|
1282
|
+
if (cleanUrl === "/") return cleanPath === "/";
|
|
1283
|
+
return cleanPath === cleanUrl || cleanPath.startsWith(`${cleanUrl}/`);
|
|
1283
1284
|
}
|
|
1284
1285
|
var AppSidebar = memo(function AppSidebar2({
|
|
1285
1286
|
name = "",
|
|
@@ -1471,28 +1472,170 @@ var AppSidebar = memo(function AppSidebar2({
|
|
|
1471
1472
|
] });
|
|
1472
1473
|
});
|
|
1473
1474
|
|
|
1475
|
+
// src/components/composed/columns/avatar-user.tsx
|
|
1476
|
+
import { memo as memo2 } from "react";
|
|
1477
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1478
|
+
function getInitials(name) {
|
|
1479
|
+
if (name) {
|
|
1480
|
+
return name.split(" ").map((w) => w[0]).join("").slice(0, 2).toUpperCase();
|
|
1481
|
+
}
|
|
1482
|
+
return "U";
|
|
1483
|
+
}
|
|
1484
|
+
var AvatarUser = memo2(function AvatarUser2({
|
|
1485
|
+
name,
|
|
1486
|
+
image
|
|
1487
|
+
}) {
|
|
1488
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
|
|
1489
|
+
/* @__PURE__ */ jsxs8(Avatar, { size: "sm", children: [
|
|
1490
|
+
/* @__PURE__ */ jsx13(AvatarImage, { src: image != null ? image : void 0, alt: name != null ? name : void 0 }),
|
|
1491
|
+
/* @__PURE__ */ jsx13(AvatarFallback, { children: getInitials(name) })
|
|
1492
|
+
] }),
|
|
1493
|
+
/* @__PURE__ */ jsx13("p", { className: "text-xs font-medium", children: name })
|
|
1494
|
+
] });
|
|
1495
|
+
});
|
|
1496
|
+
|
|
1497
|
+
// src/components/composed/columns/email-label.tsx
|
|
1498
|
+
import { memo as memo3 } from "react";
|
|
1499
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1500
|
+
var EmailLabel = memo3(function EmailLabel2({ email }) {
|
|
1501
|
+
return /* @__PURE__ */ jsx14("span", { className: "text-xs font-mono", children: email });
|
|
1502
|
+
});
|
|
1503
|
+
|
|
1504
|
+
// src/components/composed/columns/email-verified.tsx
|
|
1505
|
+
import { BadgeCheck } from "lucide-react";
|
|
1506
|
+
import { memo as memo4 } from "react";
|
|
1507
|
+
|
|
1508
|
+
// src/components/ui/badge.tsx
|
|
1509
|
+
import { mergeProps as mergeProps3 } from "@base-ui/react/merge-props";
|
|
1510
|
+
import { useRender as useRender3 } from "@base-ui/react/use-render";
|
|
1511
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
1512
|
+
import { cn as cn12 } from "cn";
|
|
1513
|
+
var badgeVariants = cva3(
|
|
1514
|
+
"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!",
|
|
1515
|
+
{
|
|
1516
|
+
variants: {
|
|
1517
|
+
variant: {
|
|
1518
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
1519
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
1520
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
1521
|
+
outline: "border-border bg-input/20 text-foreground dark:bg-input/30 [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
1522
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
1523
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
1524
|
+
}
|
|
1525
|
+
},
|
|
1526
|
+
defaultVariants: {
|
|
1527
|
+
variant: "default"
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
);
|
|
1531
|
+
function Badge(_a) {
|
|
1532
|
+
var _b = _a, {
|
|
1533
|
+
className,
|
|
1534
|
+
variant = "default",
|
|
1535
|
+
render
|
|
1536
|
+
} = _b, props = __objRest(_b, [
|
|
1537
|
+
"className",
|
|
1538
|
+
"variant",
|
|
1539
|
+
"render"
|
|
1540
|
+
]);
|
|
1541
|
+
return useRender3({
|
|
1542
|
+
defaultTagName: "span",
|
|
1543
|
+
props: mergeProps3(
|
|
1544
|
+
{
|
|
1545
|
+
className: cn12(badgeVariants({ variant }), className)
|
|
1546
|
+
},
|
|
1547
|
+
props
|
|
1548
|
+
),
|
|
1549
|
+
render,
|
|
1550
|
+
state: {
|
|
1551
|
+
slot: "badge",
|
|
1552
|
+
variant
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
// src/components/composed/columns/email-verified.tsx
|
|
1558
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1559
|
+
var EmailVerified = memo4(function EmailVerified2({
|
|
1560
|
+
verified
|
|
1561
|
+
}) {
|
|
1562
|
+
return verified ? /* @__PURE__ */ jsxs9(Badge, { variant: "default", children: [
|
|
1563
|
+
/* @__PURE__ */ jsx15(BadgeCheck, { "data-icon": "inline-start" }),
|
|
1564
|
+
"Verified"
|
|
1565
|
+
] }) : /* @__PURE__ */ jsxs9(Badge, { variant: "destructive", children: [
|
|
1566
|
+
/* @__PURE__ */ jsx15(BadgeCheck, { "data-icon": "inline-start" }),
|
|
1567
|
+
"Unverified"
|
|
1568
|
+
] });
|
|
1569
|
+
});
|
|
1570
|
+
|
|
1571
|
+
// src/components/composed/columns/joined-label.tsx
|
|
1572
|
+
import { memo as memo5 } from "react";
|
|
1573
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1574
|
+
var JoinedLabel = memo5(function JoinedLabel2({
|
|
1575
|
+
joined,
|
|
1576
|
+
locale = "id-ID"
|
|
1577
|
+
}) {
|
|
1578
|
+
if (!joined) return null;
|
|
1579
|
+
const date = typeof joined === "string" ? new Date(joined) : joined;
|
|
1580
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
1581
|
+
return /* @__PURE__ */ jsx16("span", { className: "text-xs font-mono", children: new Intl.DateTimeFormat(locale, {
|
|
1582
|
+
day: "numeric",
|
|
1583
|
+
month: "long",
|
|
1584
|
+
year: "numeric"
|
|
1585
|
+
}).format(date) });
|
|
1586
|
+
});
|
|
1587
|
+
|
|
1588
|
+
// src/components/composed/columns/user-role.tsx
|
|
1589
|
+
import { UserIcon, UserStarIcon } from "lucide-react";
|
|
1590
|
+
import { memo as memo6 } from "react";
|
|
1591
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1592
|
+
var UserRole = memo6(function UserRole2({ role }) {
|
|
1593
|
+
const isAdmin = role === "admin";
|
|
1594
|
+
return /* @__PURE__ */ jsxs10(Badge, { variant: "outline", className: "capitalize", children: [
|
|
1595
|
+
isAdmin ? /* @__PURE__ */ jsx17(UserStarIcon, { "data-icon": "inline-start" }) : /* @__PURE__ */ jsx17(UserIcon, { "data-icon": "inline-start" }),
|
|
1596
|
+
role
|
|
1597
|
+
] });
|
|
1598
|
+
});
|
|
1599
|
+
|
|
1600
|
+
// src/components/composed/columns/user-status.tsx
|
|
1601
|
+
import { BadgeCheck as BadgeCheck2 } from "lucide-react";
|
|
1602
|
+
import { memo as memo7 } from "react";
|
|
1603
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1604
|
+
var UserStatus = memo7(function UserStatus2({
|
|
1605
|
+
status
|
|
1606
|
+
}) {
|
|
1607
|
+
return status ? /* @__PURE__ */ jsxs11(Badge, { variant: "destructive", children: [
|
|
1608
|
+
/* @__PURE__ */ jsx18(BadgeCheck2, { "data-icon": "inline-start" }),
|
|
1609
|
+
"Inactive"
|
|
1610
|
+
] }) : /* @__PURE__ */ jsxs11(Badge, { variant: "default", children: [
|
|
1611
|
+
/* @__PURE__ */ jsx18(BadgeCheck2, { "data-icon": "inline-start" }),
|
|
1612
|
+
"Active"
|
|
1613
|
+
] });
|
|
1614
|
+
});
|
|
1615
|
+
|
|
1474
1616
|
// src/components/composed/data-table/data-table.tsx
|
|
1475
1617
|
import {
|
|
1476
1618
|
flexRender as flexRender3,
|
|
1477
1619
|
useTable
|
|
1478
1620
|
} from "@tanstack/react-table";
|
|
1479
1621
|
import { FolderOpenIcon } from "lucide-react";
|
|
1622
|
+
import { useRouter as useRouter2 } from "next/navigation";
|
|
1480
1623
|
import { useMemo as useMemo3, useState as useState5 } from "react";
|
|
1481
1624
|
|
|
1482
1625
|
// src/components/composed/state-empty.tsx
|
|
1483
|
-
import { memo as
|
|
1626
|
+
import { memo as memo8 } from "react";
|
|
1484
1627
|
|
|
1485
1628
|
// src/components/ui/empty.tsx
|
|
1486
|
-
import { cva as
|
|
1487
|
-
import { cn as
|
|
1488
|
-
import { jsx as
|
|
1629
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
1630
|
+
import { cn as cn13 } from "cn";
|
|
1631
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1489
1632
|
function Empty(_a) {
|
|
1490
1633
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1491
|
-
return /* @__PURE__ */
|
|
1634
|
+
return /* @__PURE__ */ jsx19(
|
|
1492
1635
|
"div",
|
|
1493
1636
|
__spreadValues({
|
|
1494
1637
|
"data-slot": "empty",
|
|
1495
|
-
className:
|
|
1638
|
+
className: cn13(
|
|
1496
1639
|
"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",
|
|
1497
1640
|
className
|
|
1498
1641
|
)
|
|
@@ -1501,15 +1644,15 @@ function Empty(_a) {
|
|
|
1501
1644
|
}
|
|
1502
1645
|
function EmptyHeader(_a) {
|
|
1503
1646
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1504
|
-
return /* @__PURE__ */
|
|
1647
|
+
return /* @__PURE__ */ jsx19(
|
|
1505
1648
|
"div",
|
|
1506
1649
|
__spreadValues({
|
|
1507
1650
|
"data-slot": "empty-header",
|
|
1508
|
-
className:
|
|
1651
|
+
className: cn13("flex max-w-sm flex-col items-center gap-1", className)
|
|
1509
1652
|
}, props)
|
|
1510
1653
|
);
|
|
1511
1654
|
}
|
|
1512
|
-
var emptyMediaVariants =
|
|
1655
|
+
var emptyMediaVariants = cva4(
|
|
1513
1656
|
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1514
1657
|
{
|
|
1515
1658
|
variants: {
|
|
@@ -1531,22 +1674,22 @@ function EmptyMedia(_a) {
|
|
|
1531
1674
|
"className",
|
|
1532
1675
|
"variant"
|
|
1533
1676
|
]);
|
|
1534
|
-
return /* @__PURE__ */
|
|
1677
|
+
return /* @__PURE__ */ jsx19(
|
|
1535
1678
|
"div",
|
|
1536
1679
|
__spreadValues({
|
|
1537
1680
|
"data-slot": "empty-icon",
|
|
1538
1681
|
"data-variant": variant,
|
|
1539
|
-
className:
|
|
1682
|
+
className: cn13(emptyMediaVariants({ variant, className }))
|
|
1540
1683
|
}, props)
|
|
1541
1684
|
);
|
|
1542
1685
|
}
|
|
1543
1686
|
function EmptyTitle(_a) {
|
|
1544
1687
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1545
|
-
return /* @__PURE__ */
|
|
1688
|
+
return /* @__PURE__ */ jsx19(
|
|
1546
1689
|
"div",
|
|
1547
1690
|
__spreadValues({
|
|
1548
1691
|
"data-slot": "empty-title",
|
|
1549
|
-
className:
|
|
1692
|
+
className: cn13(
|
|
1550
1693
|
"font-heading text-sm font-medium tracking-tight",
|
|
1551
1694
|
className
|
|
1552
1695
|
)
|
|
@@ -1555,11 +1698,11 @@ function EmptyTitle(_a) {
|
|
|
1555
1698
|
}
|
|
1556
1699
|
function EmptyDescription(_a) {
|
|
1557
1700
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1558
|
-
return /* @__PURE__ */
|
|
1701
|
+
return /* @__PURE__ */ jsx19(
|
|
1559
1702
|
"div",
|
|
1560
1703
|
__spreadValues({
|
|
1561
1704
|
"data-slot": "empty-description",
|
|
1562
|
-
className:
|
|
1705
|
+
className: cn13(
|
|
1563
1706
|
"text-xs/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
1564
1707
|
className
|
|
1565
1708
|
)
|
|
@@ -1568,11 +1711,11 @@ function EmptyDescription(_a) {
|
|
|
1568
1711
|
}
|
|
1569
1712
|
function EmptyContent(_a) {
|
|
1570
1713
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1571
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ jsx19(
|
|
1572
1715
|
"div",
|
|
1573
1716
|
__spreadValues({
|
|
1574
1717
|
"data-slot": "empty-content",
|
|
1575
|
-
className:
|
|
1718
|
+
className: cn13(
|
|
1576
1719
|
"flex w-full max-w-sm min-w-0 flex-col items-center gap-2 text-xs/relaxed text-balance",
|
|
1577
1720
|
className
|
|
1578
1721
|
)
|
|
@@ -1581,18 +1724,18 @@ function EmptyContent(_a) {
|
|
|
1581
1724
|
}
|
|
1582
1725
|
|
|
1583
1726
|
// src/lib/utils.ts
|
|
1584
|
-
import { cn as
|
|
1727
|
+
import { cn as cn14 } from "cn";
|
|
1585
1728
|
|
|
1586
1729
|
// src/components/composed/state-empty.tsx
|
|
1587
|
-
import { jsx as
|
|
1730
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1588
1731
|
function renderStateIcon(icon) {
|
|
1589
1732
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
1590
1733
|
const IconComp = icon;
|
|
1591
|
-
return /* @__PURE__ */
|
|
1734
|
+
return /* @__PURE__ */ jsx20(IconComp, {});
|
|
1592
1735
|
}
|
|
1593
1736
|
return icon;
|
|
1594
1737
|
}
|
|
1595
|
-
var StateEmpty =
|
|
1738
|
+
var StateEmpty = memo8(function StateEmpty2({
|
|
1596
1739
|
icon,
|
|
1597
1740
|
title,
|
|
1598
1741
|
description,
|
|
@@ -1605,17 +1748,17 @@ var StateEmpty = memo2(function StateEmpty2({
|
|
|
1605
1748
|
const actionHandler = isFunctionAction ? render : onClick;
|
|
1606
1749
|
const buttonRender = isFunctionAction ? void 0 : render;
|
|
1607
1750
|
const hasAction = Boolean(buttonText || render || onClick);
|
|
1608
|
-
return /* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ jsxs12(
|
|
1609
1752
|
Empty,
|
|
1610
1753
|
{
|
|
1611
|
-
className:
|
|
1754
|
+
className: cn14("w-full", state === "outline" && "border border-dashed"),
|
|
1612
1755
|
children: [
|
|
1613
|
-
/* @__PURE__ */
|
|
1614
|
-
/* @__PURE__ */
|
|
1615
|
-
/* @__PURE__ */
|
|
1616
|
-
/* @__PURE__ */
|
|
1756
|
+
/* @__PURE__ */ jsxs12(EmptyHeader, { children: [
|
|
1757
|
+
/* @__PURE__ */ jsx20(EmptyMedia, { variant: "icon", children: renderStateIcon(icon) }),
|
|
1758
|
+
/* @__PURE__ */ jsx20(EmptyTitle, { children: title }),
|
|
1759
|
+
/* @__PURE__ */ jsx20(EmptyDescription, { children: description })
|
|
1617
1760
|
] }),
|
|
1618
|
-
hasAction && /* @__PURE__ */
|
|
1761
|
+
hasAction && /* @__PURE__ */ jsx20(EmptyContent, { children: /* @__PURE__ */ jsx20(
|
|
1619
1762
|
Button,
|
|
1620
1763
|
{
|
|
1621
1764
|
variant: "outline",
|
|
@@ -1632,20 +1775,20 @@ var StateEmpty = memo2(function StateEmpty2({
|
|
|
1632
1775
|
});
|
|
1633
1776
|
|
|
1634
1777
|
// src/components/ui/table.tsx
|
|
1635
|
-
import { cn as
|
|
1636
|
-
import { jsx as
|
|
1778
|
+
import { cn as cn15 } from "cn";
|
|
1779
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1637
1780
|
function Table(_a) {
|
|
1638
1781
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1639
|
-
return /* @__PURE__ */
|
|
1782
|
+
return /* @__PURE__ */ jsx21(
|
|
1640
1783
|
"div",
|
|
1641
1784
|
{
|
|
1642
1785
|
"data-slot": "table-container",
|
|
1643
1786
|
className: "relative w-full overflow-x-auto",
|
|
1644
|
-
children: /* @__PURE__ */
|
|
1787
|
+
children: /* @__PURE__ */ jsx21(
|
|
1645
1788
|
"table",
|
|
1646
1789
|
__spreadValues({
|
|
1647
1790
|
"data-slot": "table",
|
|
1648
|
-
className:
|
|
1791
|
+
className: cn15("w-full caption-bottom text-xs", className)
|
|
1649
1792
|
}, props)
|
|
1650
1793
|
)
|
|
1651
1794
|
}
|
|
@@ -1653,31 +1796,31 @@ function Table(_a) {
|
|
|
1653
1796
|
}
|
|
1654
1797
|
function TableHeader(_a) {
|
|
1655
1798
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1656
|
-
return /* @__PURE__ */
|
|
1799
|
+
return /* @__PURE__ */ jsx21(
|
|
1657
1800
|
"thead",
|
|
1658
1801
|
__spreadValues({
|
|
1659
1802
|
"data-slot": "table-header",
|
|
1660
|
-
className:
|
|
1803
|
+
className: cn15("[&_tr]:border-b", className)
|
|
1661
1804
|
}, props)
|
|
1662
1805
|
);
|
|
1663
1806
|
}
|
|
1664
1807
|
function TableBody(_a) {
|
|
1665
1808
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1666
|
-
return /* @__PURE__ */
|
|
1809
|
+
return /* @__PURE__ */ jsx21(
|
|
1667
1810
|
"tbody",
|
|
1668
1811
|
__spreadValues({
|
|
1669
1812
|
"data-slot": "table-body",
|
|
1670
|
-
className:
|
|
1813
|
+
className: cn15("[&_tr:last-child]:border-0", className)
|
|
1671
1814
|
}, props)
|
|
1672
1815
|
);
|
|
1673
1816
|
}
|
|
1674
1817
|
function TableRow(_a) {
|
|
1675
1818
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1676
|
-
return /* @__PURE__ */
|
|
1819
|
+
return /* @__PURE__ */ jsx21(
|
|
1677
1820
|
"tr",
|
|
1678
1821
|
__spreadValues({
|
|
1679
1822
|
"data-slot": "table-row",
|
|
1680
|
-
className:
|
|
1823
|
+
className: cn15(
|
|
1681
1824
|
"border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
|
|
1682
1825
|
className
|
|
1683
1826
|
)
|
|
@@ -1686,11 +1829,11 @@ function TableRow(_a) {
|
|
|
1686
1829
|
}
|
|
1687
1830
|
function TableHead(_a) {
|
|
1688
1831
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1689
|
-
return /* @__PURE__ */
|
|
1832
|
+
return /* @__PURE__ */ jsx21(
|
|
1690
1833
|
"th",
|
|
1691
1834
|
__spreadValues({
|
|
1692
1835
|
"data-slot": "table-head",
|
|
1693
|
-
className:
|
|
1836
|
+
className: cn15(
|
|
1694
1837
|
"h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
|
|
1695
1838
|
className
|
|
1696
1839
|
)
|
|
@@ -1699,11 +1842,11 @@ function TableHead(_a) {
|
|
|
1699
1842
|
}
|
|
1700
1843
|
function TableCell(_a) {
|
|
1701
1844
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1702
|
-
return /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ jsx21(
|
|
1703
1846
|
"td",
|
|
1704
1847
|
__spreadValues({
|
|
1705
1848
|
"data-slot": "table-cell",
|
|
1706
|
-
className:
|
|
1849
|
+
className: cn15(
|
|
1707
1850
|
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
|
|
1708
1851
|
className
|
|
1709
1852
|
)
|
|
@@ -1756,19 +1899,19 @@ import {
|
|
|
1756
1899
|
flexRender
|
|
1757
1900
|
} from "@tanstack/react-table";
|
|
1758
1901
|
import { SearchXIcon } from "lucide-react";
|
|
1759
|
-
import { jsx as
|
|
1902
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1760
1903
|
function DataTableContentBody({
|
|
1761
1904
|
table,
|
|
1762
1905
|
columns
|
|
1763
1906
|
}) {
|
|
1764
1907
|
const rows = table.getRowModel().rows;
|
|
1765
1908
|
if (rows == null ? void 0 : rows.length) {
|
|
1766
|
-
return /* @__PURE__ */
|
|
1909
|
+
return /* @__PURE__ */ jsx22(TableBody, { children: rows.map((row) => /* @__PURE__ */ jsx22(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx22(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) });
|
|
1767
1910
|
}
|
|
1768
|
-
return /* @__PURE__ */
|
|
1911
|
+
return /* @__PURE__ */ jsx22(TableBody, { children: /* @__PURE__ */ jsx22(TableRow, { children: /* @__PURE__ */ jsx22(TableCell, { colSpan: columns.length, className: "h-48 text-center", children: /* @__PURE__ */ jsx22(
|
|
1769
1912
|
StateEmpty,
|
|
1770
1913
|
{
|
|
1771
|
-
icon: /* @__PURE__ */
|
|
1914
|
+
icon: /* @__PURE__ */ jsx22(SearchXIcon, {}),
|
|
1772
1915
|
title: "No matching results",
|
|
1773
1916
|
description: "No records matched your search query or filter criteria.",
|
|
1774
1917
|
buttonText: "Clear search & filters",
|
|
@@ -1782,18 +1925,18 @@ function DataTableContentBody({
|
|
|
1782
1925
|
|
|
1783
1926
|
// src/components/composed/data-table/table-content-header.tsx
|
|
1784
1927
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
1785
|
-
import { jsx as
|
|
1928
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1786
1929
|
function DataTableContentHeader({
|
|
1787
1930
|
table
|
|
1788
1931
|
}) {
|
|
1789
|
-
return /* @__PURE__ */
|
|
1932
|
+
return /* @__PURE__ */ jsx23(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx23(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx23(TableHead, { children: header.isPlaceholder ? null : flexRender2(
|
|
1790
1933
|
header.column.columnDef.header,
|
|
1791
1934
|
header.getContext()
|
|
1792
1935
|
) }, header.id)) }, headerGroup.id)) });
|
|
1793
1936
|
}
|
|
1794
1937
|
|
|
1795
1938
|
// src/components/composed/data-table/table-footer-entries.tsx
|
|
1796
|
-
import { jsx as
|
|
1939
|
+
import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1797
1940
|
function DataTableFooterEntries({
|
|
1798
1941
|
table
|
|
1799
1942
|
}) {
|
|
@@ -1804,17 +1947,17 @@ function DataTableFooterEntries({
|
|
|
1804
1947
|
const totalRows = table.getFilteredRowModel().rows.length;
|
|
1805
1948
|
const startRow = totalRows === 0 ? 0 : pageIndex * pageSize + 1;
|
|
1806
1949
|
const endRow = Math.min((pageIndex + 1) * pageSize, totalRows);
|
|
1807
|
-
return /* @__PURE__ */
|
|
1950
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex-1 text-xs text-muted-foreground", children: [
|
|
1808
1951
|
"Showing",
|
|
1809
1952
|
" ",
|
|
1810
|
-
/* @__PURE__ */
|
|
1953
|
+
/* @__PURE__ */ jsxs13("span", { className: "font-medium text-foreground", children: [
|
|
1811
1954
|
startRow,
|
|
1812
1955
|
"-",
|
|
1813
1956
|
endRow
|
|
1814
1957
|
] }),
|
|
1815
1958
|
" ",
|
|
1816
1959
|
"of ",
|
|
1817
|
-
/* @__PURE__ */
|
|
1960
|
+
/* @__PURE__ */ jsx24("span", { className: "font-medium text-foreground", children: totalRows }),
|
|
1818
1961
|
" ",
|
|
1819
1962
|
"entries."
|
|
1820
1963
|
] });
|
|
@@ -1827,106 +1970,106 @@ import {
|
|
|
1827
1970
|
ChevronsLeftIcon,
|
|
1828
1971
|
ChevronsRightIcon
|
|
1829
1972
|
} from "lucide-react";
|
|
1830
|
-
import { jsx as
|
|
1973
|
+
import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1831
1974
|
function DataTableFooterPagination({
|
|
1832
1975
|
table
|
|
1833
1976
|
}) {
|
|
1834
|
-
return /* @__PURE__ */
|
|
1835
|
-
/* @__PURE__ */
|
|
1836
|
-
/* @__PURE__ */
|
|
1977
|
+
return /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1", children: [
|
|
1978
|
+
/* @__PURE__ */ jsxs14(Tooltip, { children: [
|
|
1979
|
+
/* @__PURE__ */ jsx25(
|
|
1837
1980
|
TooltipTrigger,
|
|
1838
1981
|
{
|
|
1839
|
-
render: /* @__PURE__ */
|
|
1982
|
+
render: /* @__PURE__ */ jsx25(
|
|
1840
1983
|
Button,
|
|
1841
1984
|
{
|
|
1842
1985
|
variant: "outline",
|
|
1843
1986
|
size: "icon-xs",
|
|
1844
1987
|
onClick: () => table.firstPage(),
|
|
1845
1988
|
disabled: !table.getCanPreviousPage(),
|
|
1846
|
-
children: /* @__PURE__ */
|
|
1989
|
+
children: /* @__PURE__ */ jsx25(ChevronsLeftIcon, {})
|
|
1847
1990
|
}
|
|
1848
1991
|
)
|
|
1849
1992
|
}
|
|
1850
1993
|
),
|
|
1851
|
-
/* @__PURE__ */
|
|
1994
|
+
/* @__PURE__ */ jsx25(TooltipContent, { children: "Go to first page" })
|
|
1852
1995
|
] }),
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
1996
|
+
/* @__PURE__ */ jsxs14(Tooltip, { children: [
|
|
1997
|
+
/* @__PURE__ */ jsx25(
|
|
1855
1998
|
TooltipTrigger,
|
|
1856
1999
|
{
|
|
1857
|
-
render: /* @__PURE__ */
|
|
2000
|
+
render: /* @__PURE__ */ jsx25(
|
|
1858
2001
|
Button,
|
|
1859
2002
|
{
|
|
1860
2003
|
variant: "outline",
|
|
1861
2004
|
size: "icon-xs",
|
|
1862
2005
|
onClick: () => table.previousPage(),
|
|
1863
2006
|
disabled: !table.getCanPreviousPage(),
|
|
1864
|
-
children: /* @__PURE__ */
|
|
2007
|
+
children: /* @__PURE__ */ jsx25(ChevronLeftIcon, {})
|
|
1865
2008
|
}
|
|
1866
2009
|
)
|
|
1867
2010
|
}
|
|
1868
2011
|
),
|
|
1869
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ jsx25(TooltipContent, { children: "Go to previous page" })
|
|
1870
2013
|
] }),
|
|
1871
|
-
/* @__PURE__ */
|
|
1872
|
-
/* @__PURE__ */
|
|
2014
|
+
/* @__PURE__ */ jsxs14(Tooltip, { children: [
|
|
2015
|
+
/* @__PURE__ */ jsx25(
|
|
1873
2016
|
TooltipTrigger,
|
|
1874
2017
|
{
|
|
1875
|
-
render: /* @__PURE__ */
|
|
2018
|
+
render: /* @__PURE__ */ jsx25(
|
|
1876
2019
|
Button,
|
|
1877
2020
|
{
|
|
1878
2021
|
variant: "outline",
|
|
1879
2022
|
size: "icon-xs",
|
|
1880
2023
|
onClick: () => table.nextPage(),
|
|
1881
2024
|
disabled: !table.getCanNextPage(),
|
|
1882
|
-
children: /* @__PURE__ */
|
|
2025
|
+
children: /* @__PURE__ */ jsx25(ChevronRightIcon3, {})
|
|
1883
2026
|
}
|
|
1884
2027
|
)
|
|
1885
2028
|
}
|
|
1886
2029
|
),
|
|
1887
|
-
/* @__PURE__ */
|
|
2030
|
+
/* @__PURE__ */ jsx25(TooltipContent, { children: "Go to next page" })
|
|
1888
2031
|
] }),
|
|
1889
|
-
/* @__PURE__ */
|
|
1890
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ jsxs14(Tooltip, { children: [
|
|
2033
|
+
/* @__PURE__ */ jsx25(
|
|
1891
2034
|
TooltipTrigger,
|
|
1892
2035
|
{
|
|
1893
|
-
render: /* @__PURE__ */
|
|
2036
|
+
render: /* @__PURE__ */ jsx25(
|
|
1894
2037
|
Button,
|
|
1895
2038
|
{
|
|
1896
2039
|
variant: "outline",
|
|
1897
2040
|
size: "icon-xs",
|
|
1898
2041
|
onClick: () => table.lastPage(),
|
|
1899
2042
|
disabled: !table.getCanNextPage(),
|
|
1900
|
-
children: /* @__PURE__ */
|
|
2043
|
+
children: /* @__PURE__ */ jsx25(ChevronsRightIcon, {})
|
|
1901
2044
|
}
|
|
1902
2045
|
)
|
|
1903
2046
|
}
|
|
1904
2047
|
),
|
|
1905
|
-
/* @__PURE__ */
|
|
2048
|
+
/* @__PURE__ */ jsx25(TooltipContent, { children: "Go to last page" })
|
|
1906
2049
|
] })
|
|
1907
2050
|
] });
|
|
1908
2051
|
}
|
|
1909
2052
|
|
|
1910
2053
|
// src/components/composed/data-table/table-header-add.tsx
|
|
1911
2054
|
import { PlusIcon } from "lucide-react";
|
|
1912
|
-
import { Fragment, jsx as
|
|
2055
|
+
import { Fragment, jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1913
2056
|
function DataTableHeaderAdd({
|
|
1914
2057
|
onAdd,
|
|
1915
2058
|
addLabel
|
|
1916
2059
|
}) {
|
|
1917
|
-
return /* @__PURE__ */
|
|
1918
|
-
/* @__PURE__ */
|
|
1919
|
-
/* @__PURE__ */
|
|
2060
|
+
return /* @__PURE__ */ jsxs15(Fragment, { children: [
|
|
2061
|
+
/* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
2062
|
+
/* @__PURE__ */ jsx26(
|
|
1920
2063
|
TooltipTrigger,
|
|
1921
2064
|
{
|
|
1922
2065
|
className: "flex sm:hidden",
|
|
1923
|
-
render: /* @__PURE__ */
|
|
2066
|
+
render: /* @__PURE__ */ jsx26(Button, { variant: "default", size: "icon", onClick: onAdd, children: /* @__PURE__ */ jsx26(PlusIcon, {}) })
|
|
1924
2067
|
}
|
|
1925
2068
|
),
|
|
1926
|
-
/* @__PURE__ */
|
|
2069
|
+
/* @__PURE__ */ jsx26(TooltipContent, { children: addLabel != null ? addLabel : "Add" })
|
|
1927
2070
|
] }),
|
|
1928
|
-
/* @__PURE__ */
|
|
1929
|
-
/* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ jsxs15(Button, { variant: "default", onClick: onAdd, className: "hidden sm:flex", children: [
|
|
2072
|
+
/* @__PURE__ */ jsx26(PlusIcon, {}),
|
|
1930
2073
|
addLabel != null ? addLabel : "Add"
|
|
1931
2074
|
] })
|
|
1932
2075
|
] });
|
|
@@ -2079,7 +2222,7 @@ function printTable(headers, rows, title = "Data Export") {
|
|
|
2079
2222
|
}
|
|
2080
2223
|
|
|
2081
2224
|
// src/components/composed/data-table/table-header-download.tsx
|
|
2082
|
-
import { jsx as
|
|
2225
|
+
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2083
2226
|
function getTableExportData(table) {
|
|
2084
2227
|
const columns = table.getAllColumns().filter(
|
|
2085
2228
|
(col) => typeof col.accessorFn !== "undefined" && col.getIsVisible()
|
|
@@ -2122,25 +2265,25 @@ function DataTableHeaderDownload({
|
|
|
2122
2265
|
exportFilename,
|
|
2123
2266
|
onDownload
|
|
2124
2267
|
}) {
|
|
2125
|
-
return /* @__PURE__ */
|
|
2126
|
-
/* @__PURE__ */
|
|
2127
|
-
/* @__PURE__ */
|
|
2268
|
+
return /* @__PURE__ */ jsxs16(DropdownMenu, { children: [
|
|
2269
|
+
/* @__PURE__ */ jsxs16(Tooltip, { children: [
|
|
2270
|
+
/* @__PURE__ */ jsx27(
|
|
2128
2271
|
DropdownMenuTrigger,
|
|
2129
2272
|
{
|
|
2130
|
-
render: /* @__PURE__ */
|
|
2273
|
+
render: /* @__PURE__ */ jsx27(
|
|
2131
2274
|
TooltipTrigger,
|
|
2132
2275
|
{
|
|
2133
|
-
render: /* @__PURE__ */
|
|
2276
|
+
render: /* @__PURE__ */ jsx27(Button, { variant: "outline", size: "icon", children: /* @__PURE__ */ jsx27(DownloadIcon, {}) })
|
|
2134
2277
|
}
|
|
2135
2278
|
)
|
|
2136
2279
|
}
|
|
2137
2280
|
),
|
|
2138
|
-
/* @__PURE__ */
|
|
2281
|
+
/* @__PURE__ */ jsx27(TooltipContent, { children: "Download options" })
|
|
2139
2282
|
] }),
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
/* @__PURE__ */
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2283
|
+
/* @__PURE__ */ jsx27(DropdownMenuContent, { align: "end", className: "w-48", children: /* @__PURE__ */ jsxs16(DropdownMenuGroup, { children: [
|
|
2284
|
+
/* @__PURE__ */ jsx27(DropdownMenuLabel, { children: "Download data" }),
|
|
2285
|
+
/* @__PURE__ */ jsx27(DropdownMenuSeparator, {}),
|
|
2286
|
+
/* @__PURE__ */ jsxs16(
|
|
2144
2287
|
DropdownMenuItem,
|
|
2145
2288
|
{
|
|
2146
2289
|
className: "hover:cursor-pointer",
|
|
@@ -2150,12 +2293,12 @@ function DataTableHeaderDownload({
|
|
|
2150
2293
|
onDownload == null ? void 0 : onDownload();
|
|
2151
2294
|
},
|
|
2152
2295
|
children: [
|
|
2153
|
-
/* @__PURE__ */
|
|
2296
|
+
/* @__PURE__ */ jsx27(FileTextIcon, {}),
|
|
2154
2297
|
"Download PDF"
|
|
2155
2298
|
]
|
|
2156
2299
|
}
|
|
2157
2300
|
),
|
|
2158
|
-
/* @__PURE__ */
|
|
2301
|
+
/* @__PURE__ */ jsxs16(
|
|
2159
2302
|
DropdownMenuItem,
|
|
2160
2303
|
{
|
|
2161
2304
|
className: "hover:cursor-pointer",
|
|
@@ -2165,12 +2308,12 @@ function DataTableHeaderDownload({
|
|
|
2165
2308
|
onDownload == null ? void 0 : onDownload();
|
|
2166
2309
|
},
|
|
2167
2310
|
children: [
|
|
2168
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ jsx27(FileSpreadsheetIcon, {}),
|
|
2169
2312
|
"Download Excel"
|
|
2170
2313
|
]
|
|
2171
2314
|
}
|
|
2172
2315
|
),
|
|
2173
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ jsxs16(
|
|
2174
2317
|
DropdownMenuItem,
|
|
2175
2318
|
{
|
|
2176
2319
|
className: "hover:cursor-pointer",
|
|
@@ -2180,13 +2323,13 @@ function DataTableHeaderDownload({
|
|
|
2180
2323
|
onDownload == null ? void 0 : onDownload();
|
|
2181
2324
|
},
|
|
2182
2325
|
children: [
|
|
2183
|
-
/* @__PURE__ */
|
|
2326
|
+
/* @__PURE__ */ jsx27(FileCodeIcon, {}),
|
|
2184
2327
|
"Download CSV"
|
|
2185
2328
|
]
|
|
2186
2329
|
}
|
|
2187
2330
|
),
|
|
2188
|
-
/* @__PURE__ */
|
|
2189
|
-
/* @__PURE__ */
|
|
2331
|
+
/* @__PURE__ */ jsx27(DropdownMenuSeparator, {}),
|
|
2332
|
+
/* @__PURE__ */ jsxs16(
|
|
2190
2333
|
DropdownMenuItem,
|
|
2191
2334
|
{
|
|
2192
2335
|
className: "hover:cursor-pointer",
|
|
@@ -2195,7 +2338,7 @@ function DataTableHeaderDownload({
|
|
|
2195
2338
|
printTable(headers, rows, exportFilename);
|
|
2196
2339
|
},
|
|
2197
2340
|
children: [
|
|
2198
|
-
/* @__PURE__ */
|
|
2341
|
+
/* @__PURE__ */ jsx27(PrinterIcon, {}),
|
|
2199
2342
|
"Print Table"
|
|
2200
2343
|
]
|
|
2201
2344
|
}
|
|
@@ -2210,7 +2353,7 @@ import { CalendarIcon, ListFilterIcon } from "lucide-react";
|
|
|
2210
2353
|
import { useMemo as useMemo2, useState as useState3 } from "react";
|
|
2211
2354
|
|
|
2212
2355
|
// src/components/ui/calendar.tsx
|
|
2213
|
-
import { cn as
|
|
2356
|
+
import { cn as cn16 } from "cn";
|
|
2214
2357
|
import {
|
|
2215
2358
|
ChevronDownIcon,
|
|
2216
2359
|
ChevronLeftIcon as ChevronLeftIcon2,
|
|
@@ -2221,7 +2364,7 @@ import {
|
|
|
2221
2364
|
DayPicker,
|
|
2222
2365
|
getDefaultClassNames
|
|
2223
2366
|
} from "react-day-picker";
|
|
2224
|
-
import { jsx as
|
|
2367
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2225
2368
|
function Calendar(_a) {
|
|
2226
2369
|
var _b = _a, {
|
|
2227
2370
|
className,
|
|
@@ -2243,11 +2386,11 @@ function Calendar(_a) {
|
|
|
2243
2386
|
"components"
|
|
2244
2387
|
]);
|
|
2245
2388
|
const defaultClassNames = getDefaultClassNames();
|
|
2246
|
-
return /* @__PURE__ */
|
|
2389
|
+
return /* @__PURE__ */ jsx28(
|
|
2247
2390
|
DayPicker,
|
|
2248
2391
|
__spreadValues({
|
|
2249
2392
|
showOutsideDays,
|
|
2250
|
-
className:
|
|
2393
|
+
className: cn16(
|
|
2251
2394
|
"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",
|
|
2252
2395
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
2253
2396
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
@@ -2259,124 +2402,124 @@ function Calendar(_a) {
|
|
|
2259
2402
|
formatMonthDropdown: (date) => date.toLocaleString(locale == null ? void 0 : locale.code, { month: "short" })
|
|
2260
2403
|
}, formatters),
|
|
2261
2404
|
classNames: __spreadValues({
|
|
2262
|
-
root:
|
|
2263
|
-
months:
|
|
2405
|
+
root: cn16("w-fit", defaultClassNames.root),
|
|
2406
|
+
months: cn16(
|
|
2264
2407
|
"relative flex flex-col gap-4 md:flex-row",
|
|
2265
2408
|
defaultClassNames.months
|
|
2266
2409
|
),
|
|
2267
|
-
month:
|
|
2268
|
-
nav:
|
|
2410
|
+
month: cn16("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
2411
|
+
nav: cn16(
|
|
2269
2412
|
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
2270
2413
|
defaultClassNames.nav
|
|
2271
2414
|
),
|
|
2272
|
-
button_previous:
|
|
2415
|
+
button_previous: cn16(
|
|
2273
2416
|
buttonVariants({ variant: buttonVariant }),
|
|
2274
2417
|
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
2275
2418
|
defaultClassNames.button_previous
|
|
2276
2419
|
),
|
|
2277
|
-
button_next:
|
|
2420
|
+
button_next: cn16(
|
|
2278
2421
|
buttonVariants({ variant: buttonVariant }),
|
|
2279
2422
|
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
2280
2423
|
defaultClassNames.button_next
|
|
2281
2424
|
),
|
|
2282
|
-
month_caption:
|
|
2425
|
+
month_caption: cn16(
|
|
2283
2426
|
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
2284
2427
|
defaultClassNames.month_caption
|
|
2285
2428
|
),
|
|
2286
|
-
dropdowns:
|
|
2429
|
+
dropdowns: cn16(
|
|
2287
2430
|
"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
2288
2431
|
defaultClassNames.dropdowns
|
|
2289
2432
|
),
|
|
2290
|
-
dropdown_root:
|
|
2433
|
+
dropdown_root: cn16(
|
|
2291
2434
|
"relative rounded-(--cell-radius)",
|
|
2292
2435
|
defaultClassNames.dropdown_root
|
|
2293
2436
|
),
|
|
2294
|
-
dropdown:
|
|
2437
|
+
dropdown: cn16(
|
|
2295
2438
|
"absolute inset-0 bg-popover opacity-0",
|
|
2296
2439
|
defaultClassNames.dropdown
|
|
2297
2440
|
),
|
|
2298
|
-
caption_label:
|
|
2441
|
+
caption_label: cn16(
|
|
2299
2442
|
"font-medium select-none",
|
|
2300
2443
|
captionLayout === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
|
|
2301
2444
|
defaultClassNames.caption_label
|
|
2302
2445
|
),
|
|
2303
|
-
month_grid:
|
|
2304
|
-
weekdays:
|
|
2305
|
-
weekday:
|
|
2446
|
+
month_grid: cn16("w-full border-collapse", defaultClassNames.month_grid),
|
|
2447
|
+
weekdays: cn16("flex", defaultClassNames.weekdays),
|
|
2448
|
+
weekday: cn16(
|
|
2306
2449
|
"flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none",
|
|
2307
2450
|
defaultClassNames.weekday
|
|
2308
2451
|
),
|
|
2309
|
-
week:
|
|
2310
|
-
week_number_header:
|
|
2452
|
+
week: cn16("mt-2 flex w-full", defaultClassNames.week),
|
|
2453
|
+
week_number_header: cn16(
|
|
2311
2454
|
"w-(--cell-size) select-none",
|
|
2312
2455
|
defaultClassNames.week_number_header
|
|
2313
2456
|
),
|
|
2314
|
-
week_number:
|
|
2457
|
+
week_number: cn16(
|
|
2315
2458
|
"text-[0.8rem] text-muted-foreground select-none",
|
|
2316
2459
|
defaultClassNames.week_number
|
|
2317
2460
|
),
|
|
2318
|
-
day:
|
|
2461
|
+
day: cn16(
|
|
2319
2462
|
"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)",
|
|
2320
2463
|
props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
|
|
2321
2464
|
defaultClassNames.day
|
|
2322
2465
|
),
|
|
2323
|
-
range_start:
|
|
2466
|
+
range_start: cn16(
|
|
2324
2467
|
"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",
|
|
2325
2468
|
defaultClassNames.range_start
|
|
2326
2469
|
),
|
|
2327
|
-
range_middle:
|
|
2328
|
-
range_end:
|
|
2470
|
+
range_middle: cn16("rounded-none", defaultClassNames.range_middle),
|
|
2471
|
+
range_end: cn16(
|
|
2329
2472
|
"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",
|
|
2330
2473
|
defaultClassNames.range_end
|
|
2331
2474
|
),
|
|
2332
|
-
today:
|
|
2475
|
+
today: cn16(
|
|
2333
2476
|
"rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none",
|
|
2334
2477
|
defaultClassNames.today
|
|
2335
2478
|
),
|
|
2336
|
-
outside:
|
|
2479
|
+
outside: cn16(
|
|
2337
2480
|
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
2338
2481
|
defaultClassNames.outside
|
|
2339
2482
|
),
|
|
2340
|
-
disabled:
|
|
2483
|
+
disabled: cn16(
|
|
2341
2484
|
"text-muted-foreground opacity-50",
|
|
2342
2485
|
defaultClassNames.disabled
|
|
2343
2486
|
),
|
|
2344
|
-
hidden:
|
|
2487
|
+
hidden: cn16("invisible", defaultClassNames.hidden)
|
|
2345
2488
|
}, classNames),
|
|
2346
2489
|
components: __spreadValues({
|
|
2347
2490
|
Root: (_a2) => {
|
|
2348
2491
|
var _b2 = _a2, { className: className2, rootRef } = _b2, props2 = __objRest(_b2, ["className", "rootRef"]);
|
|
2349
|
-
return /* @__PURE__ */
|
|
2492
|
+
return /* @__PURE__ */ jsx28(
|
|
2350
2493
|
"div",
|
|
2351
2494
|
__spreadValues({
|
|
2352
2495
|
"data-slot": "calendar",
|
|
2353
2496
|
ref: rootRef,
|
|
2354
|
-
className:
|
|
2497
|
+
className: cn16(className2)
|
|
2355
2498
|
}, props2)
|
|
2356
2499
|
);
|
|
2357
2500
|
},
|
|
2358
2501
|
Chevron: (_c) => {
|
|
2359
2502
|
var _d = _c, { className: className2, orientation } = _d, props2 = __objRest(_d, ["className", "orientation"]);
|
|
2360
2503
|
if (orientation === "left") {
|
|
2361
|
-
return /* @__PURE__ */
|
|
2504
|
+
return /* @__PURE__ */ jsx28(ChevronLeftIcon2, __spreadValues({ className: cn16("size-4", className2) }, props2));
|
|
2362
2505
|
}
|
|
2363
2506
|
if (orientation === "right") {
|
|
2364
|
-
return /* @__PURE__ */
|
|
2507
|
+
return /* @__PURE__ */ jsx28(
|
|
2365
2508
|
ChevronRightIcon4,
|
|
2366
2509
|
__spreadValues({
|
|
2367
|
-
className:
|
|
2510
|
+
className: cn16("size-4", className2)
|
|
2368
2511
|
}, props2)
|
|
2369
2512
|
);
|
|
2370
2513
|
}
|
|
2371
|
-
return /* @__PURE__ */
|
|
2514
|
+
return /* @__PURE__ */ jsx28(ChevronDownIcon, __spreadValues({ className: cn16("size-4", className2) }, props2));
|
|
2372
2515
|
},
|
|
2373
2516
|
DayButton: (_e) => {
|
|
2374
2517
|
var props2 = __objRest(_e, []);
|
|
2375
|
-
return /* @__PURE__ */
|
|
2518
|
+
return /* @__PURE__ */ jsx28(CalendarDayButton, __spreadValues({ locale }, props2));
|
|
2376
2519
|
},
|
|
2377
2520
|
WeekNumber: (_f) => {
|
|
2378
2521
|
var _g = _f, { children } = _g, props2 = __objRest(_g, ["children"]);
|
|
2379
|
-
return /* @__PURE__ */
|
|
2522
|
+
return /* @__PURE__ */ jsx28("td", __spreadProps(__spreadValues({}, props2), { children: /* @__PURE__ */ jsx28("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) }));
|
|
2380
2523
|
}
|
|
2381
2524
|
}, components)
|
|
2382
2525
|
}, props)
|
|
@@ -2400,7 +2543,7 @@ function CalendarDayButton(_a) {
|
|
|
2400
2543
|
var _a2;
|
|
2401
2544
|
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
2402
2545
|
}, [modifiers.focused]);
|
|
2403
|
-
return /* @__PURE__ */
|
|
2546
|
+
return /* @__PURE__ */ jsx28(
|
|
2404
2547
|
Button,
|
|
2405
2548
|
__spreadValues({
|
|
2406
2549
|
variant: "ghost",
|
|
@@ -2410,7 +2553,7 @@ function CalendarDayButton(_a) {
|
|
|
2410
2553
|
"data-range-start": modifiers.range_start,
|
|
2411
2554
|
"data-range-end": modifiers.range_end,
|
|
2412
2555
|
"data-range-middle": modifiers.range_middle,
|
|
2413
|
-
className:
|
|
2556
|
+
className: cn16(
|
|
2414
2557
|
"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",
|
|
2415
2558
|
defaultClassNames.day,
|
|
2416
2559
|
className
|
|
@@ -2421,15 +2564,15 @@ function CalendarDayButton(_a) {
|
|
|
2421
2564
|
|
|
2422
2565
|
// src/components/ui/popover.tsx
|
|
2423
2566
|
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
2424
|
-
import { cn as
|
|
2425
|
-
import { jsx as
|
|
2567
|
+
import { cn as cn17 } from "cn";
|
|
2568
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2426
2569
|
function Popover(_a) {
|
|
2427
2570
|
var props = __objRest(_a, []);
|
|
2428
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsx29(PopoverPrimitive.Root, __spreadValues({ "data-slot": "popover" }, props));
|
|
2429
2572
|
}
|
|
2430
2573
|
function PopoverTrigger(_a) {
|
|
2431
2574
|
var props = __objRest(_a, []);
|
|
2432
|
-
return /* @__PURE__ */
|
|
2575
|
+
return /* @__PURE__ */ jsx29(PopoverPrimitive.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
|
|
2433
2576
|
}
|
|
2434
2577
|
function PopoverContent(_a) {
|
|
2435
2578
|
var _b = _a, {
|
|
@@ -2445,7 +2588,7 @@ function PopoverContent(_a) {
|
|
|
2445
2588
|
"side",
|
|
2446
2589
|
"sideOffset"
|
|
2447
2590
|
]);
|
|
2448
|
-
return /* @__PURE__ */
|
|
2591
|
+
return /* @__PURE__ */ jsx29(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx29(
|
|
2449
2592
|
PopoverPrimitive.Positioner,
|
|
2450
2593
|
{
|
|
2451
2594
|
align,
|
|
@@ -2453,11 +2596,11 @@ function PopoverContent(_a) {
|
|
|
2453
2596
|
side,
|
|
2454
2597
|
sideOffset,
|
|
2455
2598
|
className: "isolate z-50",
|
|
2456
|
-
children: /* @__PURE__ */
|
|
2599
|
+
children: /* @__PURE__ */ jsx29(
|
|
2457
2600
|
PopoverPrimitive.Popup,
|
|
2458
2601
|
__spreadValues({
|
|
2459
2602
|
"data-slot": "popover-content",
|
|
2460
|
-
className:
|
|
2603
|
+
className: cn17(
|
|
2461
2604
|
"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",
|
|
2462
2605
|
className
|
|
2463
2606
|
)
|
|
@@ -2469,17 +2612,17 @@ function PopoverContent(_a) {
|
|
|
2469
2612
|
|
|
2470
2613
|
// src/components/ui/select.tsx
|
|
2471
2614
|
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
2472
|
-
import { cn as
|
|
2615
|
+
import { cn as cn18 } from "cn";
|
|
2473
2616
|
import { CheckIcon as CheckIcon2, ChevronDownIcon as ChevronDownIcon2, ChevronUpIcon } from "lucide-react";
|
|
2474
|
-
import { jsx as
|
|
2617
|
+
import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2475
2618
|
var Select = SelectPrimitive.Root;
|
|
2476
2619
|
function SelectValue(_a) {
|
|
2477
2620
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2478
|
-
return /* @__PURE__ */
|
|
2621
|
+
return /* @__PURE__ */ jsx30(
|
|
2479
2622
|
SelectPrimitive.Value,
|
|
2480
2623
|
__spreadValues({
|
|
2481
2624
|
"data-slot": "select-value",
|
|
2482
|
-
className:
|
|
2625
|
+
className: cn18("flex flex-1 text-left", className)
|
|
2483
2626
|
}, props)
|
|
2484
2627
|
);
|
|
2485
2628
|
}
|
|
@@ -2493,22 +2636,22 @@ function SelectTrigger(_a) {
|
|
|
2493
2636
|
"size",
|
|
2494
2637
|
"children"
|
|
2495
2638
|
]);
|
|
2496
|
-
return /* @__PURE__ */
|
|
2639
|
+
return /* @__PURE__ */ jsxs17(
|
|
2497
2640
|
SelectPrimitive.Trigger,
|
|
2498
2641
|
__spreadProps(__spreadValues({
|
|
2499
2642
|
"data-slot": "select-trigger",
|
|
2500
2643
|
"data-size": size,
|
|
2501
|
-
className:
|
|
2644
|
+
className: cn18(
|
|
2502
2645
|
"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",
|
|
2503
2646
|
className
|
|
2504
2647
|
)
|
|
2505
2648
|
}, props), {
|
|
2506
2649
|
children: [
|
|
2507
2650
|
children,
|
|
2508
|
-
/* @__PURE__ */
|
|
2651
|
+
/* @__PURE__ */ jsx30(
|
|
2509
2652
|
SelectPrimitive.Icon,
|
|
2510
2653
|
{
|
|
2511
|
-
render: /* @__PURE__ */
|
|
2654
|
+
render: /* @__PURE__ */ jsx30(ChevronDownIcon2, { className: "pointer-events-none size-3.5 text-muted-foreground" })
|
|
2512
2655
|
}
|
|
2513
2656
|
)
|
|
2514
2657
|
]
|
|
@@ -2533,7 +2676,7 @@ function SelectContent(_a) {
|
|
|
2533
2676
|
"alignOffset",
|
|
2534
2677
|
"alignItemWithTrigger"
|
|
2535
2678
|
]);
|
|
2536
|
-
return /* @__PURE__ */
|
|
2679
|
+
return /* @__PURE__ */ jsx30(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx30(
|
|
2537
2680
|
SelectPrimitive.Positioner,
|
|
2538
2681
|
{
|
|
2539
2682
|
side,
|
|
@@ -2542,20 +2685,20 @@ function SelectContent(_a) {
|
|
|
2542
2685
|
alignOffset,
|
|
2543
2686
|
alignItemWithTrigger,
|
|
2544
2687
|
className: "isolate z-50",
|
|
2545
|
-
children: /* @__PURE__ */
|
|
2688
|
+
children: /* @__PURE__ */ jsxs17(
|
|
2546
2689
|
SelectPrimitive.Popup,
|
|
2547
2690
|
__spreadProps(__spreadValues({
|
|
2548
2691
|
"data-slot": "select-content",
|
|
2549
2692
|
"data-align-trigger": alignItemWithTrigger,
|
|
2550
|
-
className:
|
|
2693
|
+
className: cn18(
|
|
2551
2694
|
"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",
|
|
2552
2695
|
className
|
|
2553
2696
|
)
|
|
2554
2697
|
}, props), {
|
|
2555
2698
|
children: [
|
|
2556
|
-
/* @__PURE__ */
|
|
2557
|
-
/* @__PURE__ */
|
|
2558
|
-
/* @__PURE__ */
|
|
2699
|
+
/* @__PURE__ */ jsx30(SelectScrollUpButton, {}),
|
|
2700
|
+
/* @__PURE__ */ jsx30(SelectPrimitive.List, { children }),
|
|
2701
|
+
/* @__PURE__ */ jsx30(SelectScrollDownButton, {})
|
|
2559
2702
|
]
|
|
2560
2703
|
})
|
|
2561
2704
|
)
|
|
@@ -2570,22 +2713,22 @@ function SelectItem(_a) {
|
|
|
2570
2713
|
"className",
|
|
2571
2714
|
"children"
|
|
2572
2715
|
]);
|
|
2573
|
-
return /* @__PURE__ */
|
|
2716
|
+
return /* @__PURE__ */ jsxs17(
|
|
2574
2717
|
SelectPrimitive.Item,
|
|
2575
2718
|
__spreadProps(__spreadValues({
|
|
2576
2719
|
"data-slot": "select-item",
|
|
2577
|
-
className:
|
|
2720
|
+
className: cn18(
|
|
2578
2721
|
"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",
|
|
2579
2722
|
className
|
|
2580
2723
|
)
|
|
2581
2724
|
}, props), {
|
|
2582
2725
|
children: [
|
|
2583
|
-
/* @__PURE__ */
|
|
2584
|
-
/* @__PURE__ */
|
|
2726
|
+
/* @__PURE__ */ jsx30(SelectPrimitive.ItemText, { className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap", children }),
|
|
2727
|
+
/* @__PURE__ */ jsx30(
|
|
2585
2728
|
SelectPrimitive.ItemIndicator,
|
|
2586
2729
|
{
|
|
2587
|
-
render: /* @__PURE__ */
|
|
2588
|
-
children: /* @__PURE__ */
|
|
2730
|
+
render: /* @__PURE__ */ jsx30("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center" }),
|
|
2731
|
+
children: /* @__PURE__ */ jsx30(CheckIcon2, { className: "pointer-events-none" })
|
|
2589
2732
|
}
|
|
2590
2733
|
)
|
|
2591
2734
|
]
|
|
@@ -2598,16 +2741,16 @@ function SelectScrollUpButton(_a) {
|
|
|
2598
2741
|
} = _b, props = __objRest(_b, [
|
|
2599
2742
|
"className"
|
|
2600
2743
|
]);
|
|
2601
|
-
return /* @__PURE__ */
|
|
2744
|
+
return /* @__PURE__ */ jsx30(
|
|
2602
2745
|
SelectPrimitive.ScrollUpArrow,
|
|
2603
2746
|
__spreadProps(__spreadValues({
|
|
2604
2747
|
"data-slot": "select-scroll-up-button",
|
|
2605
|
-
className:
|
|
2748
|
+
className: cn18(
|
|
2606
2749
|
"top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",
|
|
2607
2750
|
className
|
|
2608
2751
|
)
|
|
2609
2752
|
}, props), {
|
|
2610
|
-
children: /* @__PURE__ */
|
|
2753
|
+
children: /* @__PURE__ */ jsx30(ChevronUpIcon, {})
|
|
2611
2754
|
})
|
|
2612
2755
|
);
|
|
2613
2756
|
}
|
|
@@ -2617,22 +2760,22 @@ function SelectScrollDownButton(_a) {
|
|
|
2617
2760
|
} = _b, props = __objRest(_b, [
|
|
2618
2761
|
"className"
|
|
2619
2762
|
]);
|
|
2620
|
-
return /* @__PURE__ */
|
|
2763
|
+
return /* @__PURE__ */ jsx30(
|
|
2621
2764
|
SelectPrimitive.ScrollDownArrow,
|
|
2622
2765
|
__spreadProps(__spreadValues({
|
|
2623
2766
|
"data-slot": "select-scroll-down-button",
|
|
2624
|
-
className:
|
|
2767
|
+
className: cn18(
|
|
2625
2768
|
"bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",
|
|
2626
2769
|
className
|
|
2627
2770
|
)
|
|
2628
2771
|
}, props), {
|
|
2629
|
-
children: /* @__PURE__ */
|
|
2772
|
+
children: /* @__PURE__ */ jsx30(ChevronDownIcon2, {})
|
|
2630
2773
|
})
|
|
2631
2774
|
);
|
|
2632
2775
|
}
|
|
2633
2776
|
|
|
2634
2777
|
// src/components/composed/data-table/table-header-filter.tsx
|
|
2635
|
-
import { Fragment as Fragment2, jsx as
|
|
2778
|
+
import { Fragment as Fragment2, jsx as jsx31, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2636
2779
|
function smartFilterFn(row, columnId, filterValue) {
|
|
2637
2780
|
var _a, _b, _c;
|
|
2638
2781
|
if (filterValue === void 0 || filterValue === null || filterValue === "" || filterValue === "all") {
|
|
@@ -2793,7 +2936,7 @@ function ColumnFilterInput({
|
|
|
2793
2936
|
}, [column, table, variant]);
|
|
2794
2937
|
if (variant === "boolean" || variant === "select") {
|
|
2795
2938
|
const currentValue = filterValue === void 0 || filterValue === null || filterValue === "" ? "all" : String(filterValue);
|
|
2796
|
-
return /* @__PURE__ */
|
|
2939
|
+
return /* @__PURE__ */ jsx31("div", { className: "relative flex items-center w-full", children: /* @__PURE__ */ jsxs18(
|
|
2797
2940
|
Select,
|
|
2798
2941
|
{
|
|
2799
2942
|
value: currentValue,
|
|
@@ -2805,13 +2948,13 @@ function ColumnFilterInput({
|
|
|
2805
2948
|
}
|
|
2806
2949
|
},
|
|
2807
2950
|
children: [
|
|
2808
|
-
/* @__PURE__ */
|
|
2951
|
+
/* @__PURE__ */ jsx31(
|
|
2809
2952
|
SelectTrigger,
|
|
2810
2953
|
{
|
|
2811
2954
|
className: "w-full",
|
|
2812
2955
|
onKeyDown: (e) => e.stopPropagation(),
|
|
2813
2956
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2814
|
-
children: /* @__PURE__ */
|
|
2957
|
+
children: /* @__PURE__ */ jsx31(
|
|
2815
2958
|
SelectValue,
|
|
2816
2959
|
{
|
|
2817
2960
|
placeholder: `Select ${headerText.toLowerCase()}...`,
|
|
@@ -2820,9 +2963,9 @@ function ColumnFilterInput({
|
|
|
2820
2963
|
)
|
|
2821
2964
|
}
|
|
2822
2965
|
),
|
|
2823
|
-
/* @__PURE__ */
|
|
2824
|
-
/* @__PURE__ */
|
|
2825
|
-
options.map((opt) => /* @__PURE__ */
|
|
2966
|
+
/* @__PURE__ */ jsxs18(SelectContent, { align: "start", children: [
|
|
2967
|
+
/* @__PURE__ */ jsx31(SelectItem, { value: "all", children: "All" }),
|
|
2968
|
+
options.map((opt) => /* @__PURE__ */ jsx31(
|
|
2826
2969
|
SelectItem,
|
|
2827
2970
|
{
|
|
2828
2971
|
value: opt.value,
|
|
@@ -2849,36 +2992,36 @@ function ColumnFilterInput({
|
|
|
2849
2992
|
}
|
|
2850
2993
|
}
|
|
2851
2994
|
const formattedDateLabel = dateObj ? format(dateObj, "yyyy-MM-dd") : "";
|
|
2852
|
-
return /* @__PURE__ */
|
|
2853
|
-
/* @__PURE__ */
|
|
2995
|
+
return /* @__PURE__ */ jsx31("div", { className: "relative flex items-center w-full", children: /* @__PURE__ */ jsxs18(Popover, { open: calendarOpen, onOpenChange: setCalendarOpen, children: [
|
|
2996
|
+
/* @__PURE__ */ jsx31(
|
|
2854
2997
|
PopoverTrigger,
|
|
2855
2998
|
{
|
|
2856
|
-
render: /* @__PURE__ */
|
|
2999
|
+
render: /* @__PURE__ */ jsxs18(
|
|
2857
3000
|
Button,
|
|
2858
3001
|
{
|
|
2859
3002
|
variant: "outline",
|
|
2860
|
-
className:
|
|
3003
|
+
className: cn14(
|
|
2861
3004
|
"w-full justify-start",
|
|
2862
3005
|
!formattedDateLabel && "text-muted-foreground"
|
|
2863
3006
|
),
|
|
2864
3007
|
onKeyDown: (e) => e.stopPropagation(),
|
|
2865
3008
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2866
3009
|
children: [
|
|
2867
|
-
/* @__PURE__ */
|
|
2868
|
-
/* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ jsx31(CalendarIcon, { className: "mr-1 size-3 shrink-0" }),
|
|
3011
|
+
/* @__PURE__ */ jsx31("span", { className: "truncate", children: formattedDateLabel || `Pick ${headerText.toLowerCase()}...` })
|
|
2869
3012
|
]
|
|
2870
3013
|
}
|
|
2871
3014
|
)
|
|
2872
3015
|
}
|
|
2873
3016
|
),
|
|
2874
|
-
/* @__PURE__ */
|
|
3017
|
+
/* @__PURE__ */ jsx31(
|
|
2875
3018
|
PopoverContent,
|
|
2876
3019
|
{
|
|
2877
3020
|
className: "w-auto p-0",
|
|
2878
3021
|
align: "start",
|
|
2879
3022
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2880
3023
|
onKeyDown: (e) => e.stopPropagation(),
|
|
2881
|
-
children: /* @__PURE__ */
|
|
3024
|
+
children: /* @__PURE__ */ jsx31(
|
|
2882
3025
|
Calendar,
|
|
2883
3026
|
{
|
|
2884
3027
|
mode: "single",
|
|
@@ -2897,7 +3040,7 @@ function ColumnFilterInput({
|
|
|
2897
3040
|
)
|
|
2898
3041
|
] }) });
|
|
2899
3042
|
}
|
|
2900
|
-
return /* @__PURE__ */
|
|
3043
|
+
return /* @__PURE__ */ jsx31("div", { className: "relative flex items-center w-full", children: /* @__PURE__ */ jsx31(
|
|
2901
3044
|
Input,
|
|
2902
3045
|
{
|
|
2903
3046
|
id: `filter-${column.id}`,
|
|
@@ -2921,39 +3064,39 @@ function DataTableHeaderFilter({
|
|
|
2921
3064
|
[table]
|
|
2922
3065
|
);
|
|
2923
3066
|
if (filterableColumns.length === 0) return null;
|
|
2924
|
-
return /* @__PURE__ */
|
|
2925
|
-
/* @__PURE__ */
|
|
2926
|
-
/* @__PURE__ */
|
|
3067
|
+
return /* @__PURE__ */ jsxs18(DropdownMenu, { children: [
|
|
3068
|
+
/* @__PURE__ */ jsxs18(Tooltip, { children: [
|
|
3069
|
+
/* @__PURE__ */ jsx31(
|
|
2927
3070
|
DropdownMenuTrigger,
|
|
2928
3071
|
{
|
|
2929
|
-
render: /* @__PURE__ */
|
|
3072
|
+
render: /* @__PURE__ */ jsx31(
|
|
2930
3073
|
TooltipTrigger,
|
|
2931
3074
|
{
|
|
2932
|
-
render: /* @__PURE__ */
|
|
3075
|
+
render: /* @__PURE__ */ jsx31(
|
|
2933
3076
|
Button,
|
|
2934
3077
|
{
|
|
2935
3078
|
variant: columnFilters.length > 0 ? "secondary" : "outline",
|
|
2936
3079
|
size: "icon",
|
|
2937
|
-
children: /* @__PURE__ */
|
|
3080
|
+
children: /* @__PURE__ */ jsx31(ListFilterIcon, {})
|
|
2938
3081
|
}
|
|
2939
3082
|
)
|
|
2940
3083
|
}
|
|
2941
3084
|
)
|
|
2942
3085
|
}
|
|
2943
3086
|
),
|
|
2944
|
-
/* @__PURE__ */
|
|
3087
|
+
/* @__PURE__ */ jsx31(TooltipContent, { children: "Filter options" })
|
|
2945
3088
|
] }),
|
|
2946
|
-
/* @__PURE__ */
|
|
2947
|
-
/* @__PURE__ */
|
|
2948
|
-
/* @__PURE__ */
|
|
2949
|
-
/* @__PURE__ */
|
|
3089
|
+
/* @__PURE__ */ jsx31(DropdownMenuContent, { align: "end", className: "w-80", children: /* @__PURE__ */ jsxs18(DropdownMenuGroup, { children: [
|
|
3090
|
+
/* @__PURE__ */ jsx31(DropdownMenuLabel, { children: "Filter by column" }),
|
|
3091
|
+
/* @__PURE__ */ jsx31(DropdownMenuSeparator, {}),
|
|
3092
|
+
/* @__PURE__ */ jsx31("div", { className: "max-h-64 overflow-y-auto space-y-2.5 p-1", children: filterableColumns.map((column) => {
|
|
2950
3093
|
const headerText = typeof column.columnDef.header === "string" ? column.columnDef.header : column.id;
|
|
2951
|
-
return /* @__PURE__ */
|
|
3094
|
+
return /* @__PURE__ */ jsxs18(
|
|
2952
3095
|
"div",
|
|
2953
3096
|
{
|
|
2954
3097
|
className: "flex items-center justify-between px-1",
|
|
2955
3098
|
children: [
|
|
2956
|
-
/* @__PURE__ */
|
|
3099
|
+
/* @__PURE__ */ jsx31(
|
|
2957
3100
|
"label",
|
|
2958
3101
|
{
|
|
2959
3102
|
htmlFor: `filter-${column.id}`,
|
|
@@ -2961,7 +3104,7 @@ function DataTableHeaderFilter({
|
|
|
2961
3104
|
children: headerText
|
|
2962
3105
|
}
|
|
2963
3106
|
),
|
|
2964
|
-
/* @__PURE__ */
|
|
3107
|
+
/* @__PURE__ */ jsx31("div", { className: "flex-1", children: /* @__PURE__ */ jsx31(
|
|
2965
3108
|
ColumnFilterInput,
|
|
2966
3109
|
{
|
|
2967
3110
|
column,
|
|
@@ -2974,9 +3117,9 @@ function DataTableHeaderFilter({
|
|
|
2974
3117
|
column.id
|
|
2975
3118
|
);
|
|
2976
3119
|
}) }),
|
|
2977
|
-
columnFilters.length > 0 && /* @__PURE__ */
|
|
2978
|
-
/* @__PURE__ */
|
|
2979
|
-
/* @__PURE__ */
|
|
3120
|
+
columnFilters.length > 0 && /* @__PURE__ */ jsxs18(Fragment2, { children: [
|
|
3121
|
+
/* @__PURE__ */ jsx31(DropdownMenuSeparator, {}),
|
|
3122
|
+
/* @__PURE__ */ jsx31(
|
|
2980
3123
|
DropdownMenuItem,
|
|
2981
3124
|
{
|
|
2982
3125
|
className: "hover:cursor-pointer text-destructive focus:text-destructive",
|
|
@@ -2993,38 +3136,32 @@ function DataTableHeaderFilter({
|
|
|
2993
3136
|
import { RotateCwIcon } from "lucide-react";
|
|
2994
3137
|
import { useRouter } from "next/navigation";
|
|
2995
3138
|
import { useState as useState4 } from "react";
|
|
2996
|
-
import { jsx as
|
|
2997
|
-
function DataTableHeaderRefresh({
|
|
2998
|
-
onRefresh
|
|
2999
|
-
}) {
|
|
3139
|
+
import { jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3140
|
+
function DataTableHeaderRefresh() {
|
|
3000
3141
|
const router = useRouter();
|
|
3001
3142
|
const [isRefreshing, setIsRefreshing] = useState4(false);
|
|
3002
3143
|
const handleRefresh = () => {
|
|
3003
3144
|
setIsRefreshing(true);
|
|
3004
|
-
|
|
3005
|
-
onRefresh();
|
|
3006
|
-
} else {
|
|
3007
|
-
router.refresh();
|
|
3008
|
-
}
|
|
3145
|
+
router.refresh();
|
|
3009
3146
|
setTimeout(() => {
|
|
3010
3147
|
setIsRefreshing(false);
|
|
3011
3148
|
}, 750);
|
|
3012
3149
|
};
|
|
3013
|
-
return /* @__PURE__ */
|
|
3014
|
-
/* @__PURE__ */
|
|
3150
|
+
return /* @__PURE__ */ jsxs19(Tooltip, { children: [
|
|
3151
|
+
/* @__PURE__ */ jsx32(
|
|
3015
3152
|
TooltipTrigger,
|
|
3016
3153
|
{
|
|
3017
|
-
render: /* @__PURE__ */
|
|
3154
|
+
render: /* @__PURE__ */ jsx32(
|
|
3018
3155
|
Button,
|
|
3019
3156
|
{
|
|
3020
3157
|
variant: "outline",
|
|
3021
3158
|
size: "icon",
|
|
3022
3159
|
onClick: handleRefresh,
|
|
3023
3160
|
disabled: isRefreshing,
|
|
3024
|
-
children: /* @__PURE__ */
|
|
3161
|
+
children: /* @__PURE__ */ jsx32(
|
|
3025
3162
|
RotateCwIcon,
|
|
3026
3163
|
{
|
|
3027
|
-
className:
|
|
3164
|
+
className: cn14(
|
|
3028
3165
|
"transition-transform duration-750",
|
|
3029
3166
|
isRefreshing && "animate-spin"
|
|
3030
3167
|
)
|
|
@@ -3034,19 +3171,19 @@ function DataTableHeaderRefresh({
|
|
|
3034
3171
|
)
|
|
3035
3172
|
}
|
|
3036
3173
|
),
|
|
3037
|
-
/* @__PURE__ */
|
|
3174
|
+
/* @__PURE__ */ jsx32(TooltipContent, { children: "Refresh data" })
|
|
3038
3175
|
] });
|
|
3039
3176
|
}
|
|
3040
3177
|
|
|
3041
3178
|
// src/components/composed/data-table/table-header-search.tsx
|
|
3042
3179
|
import { XIcon as XIcon2 } from "lucide-react";
|
|
3043
|
-
import { jsx as
|
|
3180
|
+
import { jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3044
3181
|
function DataTableHeaderSearch({
|
|
3045
3182
|
value = "",
|
|
3046
3183
|
onChange
|
|
3047
3184
|
}) {
|
|
3048
|
-
return /* @__PURE__ */
|
|
3049
|
-
/* @__PURE__ */
|
|
3185
|
+
return /* @__PURE__ */ jsxs20("div", { className: "relative flex items-center max-w-sm w-full", children: [
|
|
3186
|
+
/* @__PURE__ */ jsx33(
|
|
3050
3187
|
Input,
|
|
3051
3188
|
{
|
|
3052
3189
|
placeholder: "Search...",
|
|
@@ -3055,14 +3192,14 @@ function DataTableHeaderSearch({
|
|
|
3055
3192
|
className: "pr-7"
|
|
3056
3193
|
}
|
|
3057
3194
|
),
|
|
3058
|
-
Boolean(value) && /* @__PURE__ */
|
|
3195
|
+
Boolean(value) && /* @__PURE__ */ jsx33(
|
|
3059
3196
|
"button",
|
|
3060
3197
|
{
|
|
3061
3198
|
type: "button",
|
|
3062
3199
|
onClick: () => onChange(""),
|
|
3063
3200
|
className: "absolute right-2 text-muted-foreground hover:text-foreground p-0.5 rounded cursor-pointer",
|
|
3064
3201
|
"aria-label": "Clear search text",
|
|
3065
|
-
children: /* @__PURE__ */
|
|
3202
|
+
children: /* @__PURE__ */ jsx33(XIcon2, { className: "size-3.5" })
|
|
3066
3203
|
}
|
|
3067
3204
|
)
|
|
3068
3205
|
] });
|
|
@@ -3070,41 +3207,41 @@ function DataTableHeaderSearch({
|
|
|
3070
3207
|
|
|
3071
3208
|
// src/components/composed/data-table/table-header-sort.tsx
|
|
3072
3209
|
import { ArrowDownIcon, ArrowUpDownIcon, ArrowUpIcon } from "lucide-react";
|
|
3073
|
-
import { Fragment as Fragment3, jsx as
|
|
3210
|
+
import { Fragment as Fragment3, jsx as jsx34, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3074
3211
|
function DataTableHeaderSort({
|
|
3075
3212
|
table,
|
|
3076
3213
|
sorting
|
|
3077
3214
|
}) {
|
|
3078
3215
|
const sortableColumns = table.getAllColumns().filter((column) => column.getCanSort());
|
|
3079
|
-
return /* @__PURE__ */
|
|
3080
|
-
/* @__PURE__ */
|
|
3081
|
-
/* @__PURE__ */
|
|
3216
|
+
return /* @__PURE__ */ jsxs21(DropdownMenu, { children: [
|
|
3217
|
+
/* @__PURE__ */ jsxs21(Tooltip, { children: [
|
|
3218
|
+
/* @__PURE__ */ jsx34(
|
|
3082
3219
|
DropdownMenuTrigger,
|
|
3083
3220
|
{
|
|
3084
|
-
render: /* @__PURE__ */
|
|
3221
|
+
render: /* @__PURE__ */ jsx34(
|
|
3085
3222
|
TooltipTrigger,
|
|
3086
3223
|
{
|
|
3087
|
-
render: /* @__PURE__ */
|
|
3224
|
+
render: /* @__PURE__ */ jsx34(
|
|
3088
3225
|
Button,
|
|
3089
3226
|
{
|
|
3090
3227
|
variant: sorting.length > 0 ? "secondary" : "outline",
|
|
3091
3228
|
size: "icon",
|
|
3092
|
-
children: /* @__PURE__ */
|
|
3229
|
+
children: /* @__PURE__ */ jsx34(ArrowUpDownIcon, {})
|
|
3093
3230
|
}
|
|
3094
3231
|
)
|
|
3095
3232
|
}
|
|
3096
3233
|
)
|
|
3097
3234
|
}
|
|
3098
3235
|
),
|
|
3099
|
-
/* @__PURE__ */
|
|
3236
|
+
/* @__PURE__ */ jsx34(TooltipContent, { children: "Sort options" })
|
|
3100
3237
|
] }),
|
|
3101
|
-
/* @__PURE__ */
|
|
3102
|
-
/* @__PURE__ */
|
|
3103
|
-
/* @__PURE__ */
|
|
3238
|
+
/* @__PURE__ */ jsx34(DropdownMenuContent, { align: "end", className: "w-48", children: /* @__PURE__ */ jsxs21(DropdownMenuGroup, { children: [
|
|
3239
|
+
/* @__PURE__ */ jsx34(DropdownMenuLabel, { children: "Sort by column" }),
|
|
3240
|
+
/* @__PURE__ */ jsx34(DropdownMenuSeparator, {}),
|
|
3104
3241
|
sortableColumns.map((column) => {
|
|
3105
3242
|
const isSorted = column.getIsSorted();
|
|
3106
3243
|
const headerText = typeof column.columnDef.header === "string" ? column.columnDef.header : column.id;
|
|
3107
|
-
return /* @__PURE__ */
|
|
3244
|
+
return /* @__PURE__ */ jsxs21(
|
|
3108
3245
|
DropdownMenuItem,
|
|
3109
3246
|
{
|
|
3110
3247
|
className: "flex items-center justify-between hover:cursor-pointer capitalize",
|
|
@@ -3119,16 +3256,16 @@ function DataTableHeaderSort({
|
|
|
3119
3256
|
},
|
|
3120
3257
|
children: [
|
|
3121
3258
|
headerText,
|
|
3122
|
-
isSorted === "asc" && /* @__PURE__ */
|
|
3123
|
-
isSorted === "desc" && /* @__PURE__ */
|
|
3259
|
+
isSorted === "asc" && /* @__PURE__ */ jsx34(ArrowUpIcon, { className: "size-3.5" }),
|
|
3260
|
+
isSorted === "desc" && /* @__PURE__ */ jsx34(ArrowDownIcon, { className: "size-3.5" })
|
|
3124
3261
|
]
|
|
3125
3262
|
},
|
|
3126
3263
|
column.id
|
|
3127
3264
|
);
|
|
3128
3265
|
}),
|
|
3129
|
-
sorting.length > 0 && /* @__PURE__ */
|
|
3130
|
-
/* @__PURE__ */
|
|
3131
|
-
/* @__PURE__ */
|
|
3266
|
+
sorting.length > 0 && /* @__PURE__ */ jsxs21(Fragment3, { children: [
|
|
3267
|
+
/* @__PURE__ */ jsx34(DropdownMenuSeparator, {}),
|
|
3268
|
+
/* @__PURE__ */ jsx34(
|
|
3132
3269
|
DropdownMenuItem,
|
|
3133
3270
|
{
|
|
3134
3271
|
className: "hover:cursor-pointer text-destructive focus:text-destructive",
|
|
@@ -3143,33 +3280,33 @@ function DataTableHeaderSort({
|
|
|
3143
3280
|
|
|
3144
3281
|
// src/components/composed/data-table/table-header-toggle.tsx
|
|
3145
3282
|
import { Columns3CogIcon } from "lucide-react";
|
|
3146
|
-
import { jsx as
|
|
3283
|
+
import { jsx as jsx35, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3147
3284
|
function DataTableHeaderToggle({
|
|
3148
3285
|
table
|
|
3149
3286
|
}) {
|
|
3150
|
-
return /* @__PURE__ */
|
|
3151
|
-
/* @__PURE__ */
|
|
3152
|
-
/* @__PURE__ */
|
|
3287
|
+
return /* @__PURE__ */ jsxs22(DropdownMenu, { children: [
|
|
3288
|
+
/* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
3289
|
+
/* @__PURE__ */ jsx35(
|
|
3153
3290
|
DropdownMenuTrigger,
|
|
3154
3291
|
{
|
|
3155
|
-
render: /* @__PURE__ */
|
|
3292
|
+
render: /* @__PURE__ */ jsx35(
|
|
3156
3293
|
TooltipTrigger,
|
|
3157
3294
|
{
|
|
3158
|
-
render: /* @__PURE__ */
|
|
3295
|
+
render: /* @__PURE__ */ jsx35(Button, { variant: "outline", size: "icon", children: /* @__PURE__ */ jsx35(Columns3CogIcon, {}) })
|
|
3159
3296
|
}
|
|
3160
3297
|
)
|
|
3161
3298
|
}
|
|
3162
3299
|
),
|
|
3163
|
-
/* @__PURE__ */
|
|
3300
|
+
/* @__PURE__ */ jsx35(TooltipContent, { children: "Toggle columns" })
|
|
3164
3301
|
] }),
|
|
3165
|
-
/* @__PURE__ */
|
|
3166
|
-
/* @__PURE__ */
|
|
3167
|
-
/* @__PURE__ */
|
|
3302
|
+
/* @__PURE__ */ jsx35(DropdownMenuContent, { align: "end", className: "w-48", children: /* @__PURE__ */ jsxs22(DropdownMenuGroup, { children: [
|
|
3303
|
+
/* @__PURE__ */ jsx35(DropdownMenuLabel, { children: "Toggle columns" }),
|
|
3304
|
+
/* @__PURE__ */ jsx35(DropdownMenuSeparator, {}),
|
|
3168
3305
|
table.getAllColumns().filter(
|
|
3169
3306
|
(column) => typeof column.accessorFn !== "undefined" && column.getCanHide()
|
|
3170
3307
|
).map((column) => {
|
|
3171
3308
|
const headerText = typeof column.columnDef.header === "string" ? column.columnDef.header : column.id;
|
|
3172
|
-
return /* @__PURE__ */
|
|
3309
|
+
return /* @__PURE__ */ jsx35(
|
|
3173
3310
|
DropdownMenuCheckboxItem,
|
|
3174
3311
|
{
|
|
3175
3312
|
className: "capitalize hover:cursor-pointer",
|
|
@@ -3187,7 +3324,7 @@ function DataTableHeaderToggle({
|
|
|
3187
3324
|
// src/components/composed/data-table/data-row-actions.tsx
|
|
3188
3325
|
import { MoreHorizontal } from "lucide-react";
|
|
3189
3326
|
import { Fragment as Fragment4 } from "react";
|
|
3190
|
-
import { Fragment as Fragment5, jsx as
|
|
3327
|
+
import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3191
3328
|
function RowActions({
|
|
3192
3329
|
label = "Actions",
|
|
3193
3330
|
items = [],
|
|
@@ -3201,50 +3338,50 @@ function RowActions({
|
|
|
3201
3338
|
if (visibleItems.length === 0) {
|
|
3202
3339
|
return null;
|
|
3203
3340
|
}
|
|
3204
|
-
return /* @__PURE__ */
|
|
3341
|
+
return /* @__PURE__ */ jsx36(
|
|
3205
3342
|
"div",
|
|
3206
3343
|
{
|
|
3207
|
-
className:
|
|
3208
|
-
children: /* @__PURE__ */
|
|
3209
|
-
/* @__PURE__ */
|
|
3344
|
+
className: cn14("flex items-center justify-end w-full", containerClassName),
|
|
3345
|
+
children: /* @__PURE__ */ jsxs23(DropdownMenu, { children: [
|
|
3346
|
+
/* @__PURE__ */ jsx36(
|
|
3210
3347
|
DropdownMenuTrigger,
|
|
3211
3348
|
{
|
|
3212
|
-
render: /* @__PURE__ */
|
|
3349
|
+
render: /* @__PURE__ */ jsx36(Button, { variant: "ghost", size: "icon-xs", "aria-label": triggerLabel, children: triggerIcon != null ? triggerIcon : /* @__PURE__ */ jsx36(MoreHorizontal, { className: "size-4" }) })
|
|
3213
3350
|
}
|
|
3214
3351
|
),
|
|
3215
|
-
/* @__PURE__ */
|
|
3352
|
+
/* @__PURE__ */ jsx36(
|
|
3216
3353
|
DropdownMenuContent,
|
|
3217
3354
|
{
|
|
3218
3355
|
align,
|
|
3219
|
-
className:
|
|
3220
|
-
children: /* @__PURE__ */
|
|
3221
|
-
label && /* @__PURE__ */
|
|
3222
|
-
/* @__PURE__ */
|
|
3223
|
-
/* @__PURE__ */
|
|
3356
|
+
className: cn14("w-40", contentClassName),
|
|
3357
|
+
children: /* @__PURE__ */ jsxs23(DropdownMenuGroup, { children: [
|
|
3358
|
+
label && /* @__PURE__ */ jsxs23(Fragment5, { children: [
|
|
3359
|
+
/* @__PURE__ */ jsx36(DropdownMenuLabel, { children: label }),
|
|
3360
|
+
/* @__PURE__ */ jsx36(DropdownMenuSeparator, {})
|
|
3224
3361
|
] }),
|
|
3225
3362
|
visibleItems.map((item, index) => {
|
|
3226
3363
|
var _a;
|
|
3227
3364
|
const itemKey = (_a = item.id) != null ? _a : `${item.label}-${index}`;
|
|
3228
3365
|
const isDestructive = item.variant === "destructive";
|
|
3229
|
-
return /* @__PURE__ */
|
|
3230
|
-
item.separatorBefore && /* @__PURE__ */
|
|
3231
|
-
/* @__PURE__ */
|
|
3366
|
+
return /* @__PURE__ */ jsxs23(Fragment4, { children: [
|
|
3367
|
+
item.separatorBefore && /* @__PURE__ */ jsx36(DropdownMenuSeparator, {}),
|
|
3368
|
+
/* @__PURE__ */ jsxs23(
|
|
3232
3369
|
DropdownMenuItem,
|
|
3233
3370
|
{
|
|
3234
3371
|
onClick: item.onClick,
|
|
3235
3372
|
disabled: item.disabled,
|
|
3236
|
-
className:
|
|
3373
|
+
className: cn14(
|
|
3237
3374
|
"hover:cursor-pointer flex items-center gap-2",
|
|
3238
3375
|
isDestructive && "text-destructive focus:text-destructive",
|
|
3239
3376
|
item.className
|
|
3240
3377
|
),
|
|
3241
3378
|
children: [
|
|
3242
|
-
item.icon && /* @__PURE__ */
|
|
3243
|
-
/* @__PURE__ */
|
|
3379
|
+
item.icon && /* @__PURE__ */ jsx36("span", { className: "size-4 shrink-0 flex items-center justify-center", children: item.icon }),
|
|
3380
|
+
/* @__PURE__ */ jsx36("span", { children: item.label })
|
|
3244
3381
|
]
|
|
3245
3382
|
}
|
|
3246
3383
|
),
|
|
3247
|
-
item.separatorAfter && /* @__PURE__ */
|
|
3384
|
+
item.separatorAfter && /* @__PURE__ */ jsx36(DropdownMenuSeparator, {})
|
|
3248
3385
|
] }, itemKey);
|
|
3249
3386
|
})
|
|
3250
3387
|
] })
|
|
@@ -3256,14 +3393,13 @@ function RowActions({
|
|
|
3256
3393
|
}
|
|
3257
3394
|
|
|
3258
3395
|
// src/components/composed/data-table/data-table.tsx
|
|
3259
|
-
import { jsx as
|
|
3396
|
+
import { jsx as jsx37, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3260
3397
|
function DataTable({
|
|
3261
3398
|
columns,
|
|
3262
3399
|
data,
|
|
3263
3400
|
initialColumnVisibility,
|
|
3264
3401
|
renderCreateDialog,
|
|
3265
3402
|
addLabel,
|
|
3266
|
-
onRefresh,
|
|
3267
3403
|
onDownload,
|
|
3268
3404
|
exportFilename = "data-export",
|
|
3269
3405
|
showSearchInput = true,
|
|
@@ -3274,6 +3410,7 @@ function DataTable({
|
|
|
3274
3410
|
showColumnToggleButton = true,
|
|
3275
3411
|
showAddButton = true
|
|
3276
3412
|
}) {
|
|
3413
|
+
const router = useRouter2();
|
|
3277
3414
|
const [createOpen, setCreateOpen] = useState5(false);
|
|
3278
3415
|
const [sorting, setSorting] = useState5([]);
|
|
3279
3416
|
const [columnFilters, setColumnFilters] = useState5([]);
|
|
@@ -3309,42 +3446,41 @@ function DataTable({
|
|
|
3309
3446
|
});
|
|
3310
3447
|
if (data.length === 0) {
|
|
3311
3448
|
const hasCreateAction = Boolean(renderCreateDialog);
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
/* @__PURE__ */ jsx31(
|
|
3449
|
+
return /* @__PURE__ */ jsxs24("div", { className: "space-y-2", children: [
|
|
3450
|
+
/* @__PURE__ */ jsx37(
|
|
3315
3451
|
StateEmpty,
|
|
3316
3452
|
{
|
|
3317
3453
|
state: "outline",
|
|
3318
|
-
icon: /* @__PURE__ */
|
|
3454
|
+
icon: /* @__PURE__ */ jsx37(FolderOpenIcon, { className: "size-6 text-muted-foreground" }),
|
|
3319
3455
|
title: "No Data Available",
|
|
3320
3456
|
description: "There are currently no records to display. Create a new record to get started.",
|
|
3321
|
-
buttonText: hasCreateAction ? addLabel != null ? addLabel : "Add Record" :
|
|
3322
|
-
render: hasCreateAction ? () => setCreateOpen(true) :
|
|
3457
|
+
buttonText: hasCreateAction ? addLabel != null ? addLabel : "Add Record" : "Refresh",
|
|
3458
|
+
render: hasCreateAction ? () => setCreateOpen(true) : () => router.refresh()
|
|
3323
3459
|
}
|
|
3324
3460
|
),
|
|
3325
3461
|
renderCreateDialog == null ? void 0 : renderCreateDialog(createOpen, setCreateOpen)
|
|
3326
3462
|
] });
|
|
3327
3463
|
}
|
|
3328
|
-
return /* @__PURE__ */
|
|
3329
|
-
/* @__PURE__ */
|
|
3330
|
-
showSearchInput ? /* @__PURE__ */
|
|
3464
|
+
return /* @__PURE__ */ jsxs24("div", { className: "space-y-2", children: [
|
|
3465
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-row items-center justify-between gap-1", children: [
|
|
3466
|
+
showSearchInput ? /* @__PURE__ */ jsx37(
|
|
3331
3467
|
DataTableHeaderSearch,
|
|
3332
3468
|
{
|
|
3333
3469
|
value: globalFilter,
|
|
3334
3470
|
onChange: setGlobalFilter
|
|
3335
3471
|
}
|
|
3336
|
-
) : /* @__PURE__ */
|
|
3337
|
-
/* @__PURE__ */
|
|
3338
|
-
showRefreshButton && /* @__PURE__ */
|
|
3339
|
-
showSortButton && /* @__PURE__ */
|
|
3340
|
-
showFilterButton && /* @__PURE__ */
|
|
3472
|
+
) : /* @__PURE__ */ jsx37("div", {}),
|
|
3473
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-row items-center gap-1", children: [
|
|
3474
|
+
showRefreshButton && /* @__PURE__ */ jsx37(DataTableHeaderRefresh, {}),
|
|
3475
|
+
showSortButton && /* @__PURE__ */ jsx37(DataTableHeaderSort, { table, sorting }),
|
|
3476
|
+
showFilterButton && /* @__PURE__ */ jsx37(
|
|
3341
3477
|
DataTableHeaderFilter,
|
|
3342
3478
|
{
|
|
3343
3479
|
table,
|
|
3344
3480
|
columnFilters
|
|
3345
3481
|
}
|
|
3346
3482
|
),
|
|
3347
|
-
showDownloadButton && /* @__PURE__ */
|
|
3483
|
+
showDownloadButton && /* @__PURE__ */ jsx37(
|
|
3348
3484
|
DataTableHeaderDownload,
|
|
3349
3485
|
{
|
|
3350
3486
|
table,
|
|
@@ -3352,8 +3488,8 @@ function DataTable({
|
|
|
3352
3488
|
onDownload
|
|
3353
3489
|
}
|
|
3354
3490
|
),
|
|
3355
|
-
showColumnToggleButton && /* @__PURE__ */
|
|
3356
|
-
showAddButton && renderCreateDialog && /* @__PURE__ */
|
|
3491
|
+
showColumnToggleButton && /* @__PURE__ */ jsx37(DataTableHeaderToggle, { table }),
|
|
3492
|
+
showAddButton && renderCreateDialog && /* @__PURE__ */ jsx37(
|
|
3357
3493
|
DataTableHeaderAdd,
|
|
3358
3494
|
{
|
|
3359
3495
|
onAdd: () => setCreateOpen(true),
|
|
@@ -3363,13 +3499,13 @@ function DataTable({
|
|
|
3363
3499
|
] })
|
|
3364
3500
|
] }),
|
|
3365
3501
|
renderCreateDialog == null ? void 0 : renderCreateDialog(createOpen, setCreateOpen),
|
|
3366
|
-
/* @__PURE__ */
|
|
3367
|
-
/* @__PURE__ */
|
|
3368
|
-
/* @__PURE__ */
|
|
3502
|
+
/* @__PURE__ */ jsx37("div", { className: "overflow-hidden rounded-md border [&_[data-slot=table-container]]:no-scrollbar", children: /* @__PURE__ */ jsxs24(Table, { children: [
|
|
3503
|
+
/* @__PURE__ */ jsx37(DataTableContentHeader, { table }),
|
|
3504
|
+
/* @__PURE__ */ jsx37(DataTableContentBody, { table, columns })
|
|
3369
3505
|
] }) }),
|
|
3370
|
-
/* @__PURE__ */
|
|
3371
|
-
/* @__PURE__ */
|
|
3372
|
-
/* @__PURE__ */
|
|
3506
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between px-2", children: [
|
|
3507
|
+
/* @__PURE__ */ jsx37(DataTableFooterEntries, { table }),
|
|
3508
|
+
/* @__PURE__ */ jsx37(DataTableFooterPagination, { table })
|
|
3373
3509
|
] })
|
|
3374
3510
|
] });
|
|
3375
3511
|
}
|
|
@@ -3377,13 +3513,13 @@ function DataTable({
|
|
|
3377
3513
|
// src/components/composed/header-tabs.tsx
|
|
3378
3514
|
import Link2 from "next/link";
|
|
3379
3515
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
3380
|
-
import { memo as
|
|
3516
|
+
import { memo as memo9 } from "react";
|
|
3381
3517
|
|
|
3382
3518
|
// src/components/ui/tabs.tsx
|
|
3383
3519
|
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
3384
|
-
import { cva as
|
|
3385
|
-
import { cn as
|
|
3386
|
-
import { jsx as
|
|
3520
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
3521
|
+
import { cn as cn19 } from "cn";
|
|
3522
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3387
3523
|
function Tabs(_a) {
|
|
3388
3524
|
var _b = _a, {
|
|
3389
3525
|
className,
|
|
@@ -3392,19 +3528,19 @@ function Tabs(_a) {
|
|
|
3392
3528
|
"className",
|
|
3393
3529
|
"orientation"
|
|
3394
3530
|
]);
|
|
3395
|
-
return /* @__PURE__ */
|
|
3531
|
+
return /* @__PURE__ */ jsx38(
|
|
3396
3532
|
TabsPrimitive.Root,
|
|
3397
3533
|
__spreadValues({
|
|
3398
3534
|
"data-slot": "tabs",
|
|
3399
3535
|
"data-orientation": orientation,
|
|
3400
|
-
className:
|
|
3536
|
+
className: cn19(
|
|
3401
3537
|
"group/tabs flex gap-2 data-horizontal:flex-col",
|
|
3402
3538
|
className
|
|
3403
3539
|
)
|
|
3404
3540
|
}, props)
|
|
3405
3541
|
);
|
|
3406
3542
|
}
|
|
3407
|
-
var tabsListVariants =
|
|
3543
|
+
var tabsListVariants = cva5(
|
|
3408
3544
|
"group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",
|
|
3409
3545
|
{
|
|
3410
3546
|
variants: {
|
|
@@ -3426,22 +3562,22 @@ function TabsList(_a) {
|
|
|
3426
3562
|
"className",
|
|
3427
3563
|
"variant"
|
|
3428
3564
|
]);
|
|
3429
|
-
return /* @__PURE__ */
|
|
3565
|
+
return /* @__PURE__ */ jsx38(
|
|
3430
3566
|
TabsPrimitive.List,
|
|
3431
3567
|
__spreadValues({
|
|
3432
3568
|
"data-slot": "tabs-list",
|
|
3433
3569
|
"data-variant": variant,
|
|
3434
|
-
className:
|
|
3570
|
+
className: cn19(tabsListVariants({ variant }), className)
|
|
3435
3571
|
}, props)
|
|
3436
3572
|
);
|
|
3437
3573
|
}
|
|
3438
3574
|
function TabsTrigger(_a) {
|
|
3439
3575
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3440
|
-
return /* @__PURE__ */
|
|
3576
|
+
return /* @__PURE__ */ jsx38(
|
|
3441
3577
|
TabsPrimitive.Tab,
|
|
3442
3578
|
__spreadValues({
|
|
3443
3579
|
"data-slot": "tabs-trigger",
|
|
3444
|
-
className:
|
|
3580
|
+
className: cn19(
|
|
3445
3581
|
"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",
|
|
3446
3582
|
"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",
|
|
3447
3583
|
"data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
@@ -3453,16 +3589,16 @@ function TabsTrigger(_a) {
|
|
|
3453
3589
|
}
|
|
3454
3590
|
|
|
3455
3591
|
// src/components/composed/header-tabs.tsx
|
|
3456
|
-
import { jsx as
|
|
3592
|
+
import { jsx as jsx39, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3457
3593
|
function renderTabIcon(icon) {
|
|
3458
3594
|
if (!icon) return null;
|
|
3459
3595
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
3460
3596
|
const IconComp = icon;
|
|
3461
|
-
return /* @__PURE__ */
|
|
3597
|
+
return /* @__PURE__ */ jsx39(IconComp, {});
|
|
3462
3598
|
}
|
|
3463
3599
|
return icon;
|
|
3464
3600
|
}
|
|
3465
|
-
var HeaderTabs =
|
|
3601
|
+
var HeaderTabs = memo9(function HeaderTabs2({
|
|
3466
3602
|
items,
|
|
3467
3603
|
value,
|
|
3468
3604
|
onValueChange,
|
|
@@ -3474,12 +3610,12 @@ var HeaderTabs = memo3(function HeaderTabs2({
|
|
|
3474
3610
|
(item) => item.url === pathname || pathname.endsWith(item.url) || pathname.split("/").includes(item.value)
|
|
3475
3611
|
) : void 0;
|
|
3476
3612
|
const activeTab = (_b = value != null ? value : matchedItem == null ? void 0 : matchedItem.value) != null ? _b : (_a = items[0]) == null ? void 0 : _a.value;
|
|
3477
|
-
return /* @__PURE__ */
|
|
3478
|
-
/* @__PURE__ */
|
|
3613
|
+
return /* @__PURE__ */ jsxs25(Tabs, { value: activeTab, onValueChange, className: "space-y-4", children: [
|
|
3614
|
+
/* @__PURE__ */ jsx39("div", { className: "w-full overflow-x-auto overflow-y-hidden border-b no-scrollbar", children: /* @__PURE__ */ jsx39(TabsList, { variant: "line", className: "inline-flex w-max justify-start", children: items.map(({ title, value: tabValue, url, icon }) => /* @__PURE__ */ jsxs25(
|
|
3479
3615
|
TabsTrigger,
|
|
3480
3616
|
{
|
|
3481
3617
|
nativeButton: false,
|
|
3482
|
-
render: /* @__PURE__ */
|
|
3618
|
+
render: /* @__PURE__ */ jsx39(Link2, { href: url }),
|
|
3483
3619
|
value: tabValue,
|
|
3484
3620
|
children: [
|
|
3485
3621
|
renderTabIcon(icon),
|
|
@@ -3493,23 +3629,24 @@ var HeaderTabs = memo3(function HeaderTabs2({
|
|
|
3493
3629
|
});
|
|
3494
3630
|
|
|
3495
3631
|
// src/components/composed/header-title.tsx
|
|
3496
|
-
import { memo as
|
|
3497
|
-
import { jsx as
|
|
3498
|
-
var HeaderTitle =
|
|
3632
|
+
import { memo as memo10 } from "react";
|
|
3633
|
+
import { jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3634
|
+
var HeaderTitle = memo10(function HeaderTitle2({
|
|
3499
3635
|
title,
|
|
3500
3636
|
subtitle,
|
|
3501
3637
|
children
|
|
3502
3638
|
}) {
|
|
3503
|
-
return /* @__PURE__ */
|
|
3504
|
-
/* @__PURE__ */
|
|
3505
|
-
/* @__PURE__ */
|
|
3506
|
-
/* @__PURE__ */
|
|
3639
|
+
return /* @__PURE__ */ jsxs26("div", { className: "w-full space-y-4", children: [
|
|
3640
|
+
/* @__PURE__ */ jsxs26("div", { children: [
|
|
3641
|
+
/* @__PURE__ */ jsx40("h1", { className: "font-semibold", children: title }),
|
|
3642
|
+
/* @__PURE__ */ jsx40("p", { className: "text-xs text-muted-foreground", children: subtitle })
|
|
3507
3643
|
] }),
|
|
3508
3644
|
children
|
|
3509
3645
|
] });
|
|
3510
3646
|
});
|
|
3511
3647
|
export {
|
|
3512
3648
|
AppSidebar,
|
|
3649
|
+
AvatarUser,
|
|
3513
3650
|
DataTable,
|
|
3514
3651
|
DataTableContentBody,
|
|
3515
3652
|
DataTableContentHeader,
|
|
@@ -3522,10 +3659,15 @@ export {
|
|
|
3522
3659
|
DataTableHeaderSearch,
|
|
3523
3660
|
DataTableHeaderSort,
|
|
3524
3661
|
DataTableHeaderToggle,
|
|
3662
|
+
EmailLabel,
|
|
3663
|
+
EmailVerified,
|
|
3525
3664
|
HeaderTabs,
|
|
3526
3665
|
HeaderTitle,
|
|
3666
|
+
JoinedLabel,
|
|
3527
3667
|
RowActions,
|
|
3528
3668
|
StateEmpty,
|
|
3669
|
+
UserRole,
|
|
3670
|
+
UserStatus,
|
|
3529
3671
|
exportToCSV,
|
|
3530
3672
|
exportToPDF,
|
|
3531
3673
|
exportToXLSX,
|