@prediktif/ui 0.1.28 → 0.1.30
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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +89 -66
- package/dist/index.mjs +102 -79
- package/package.json +12 -10
- package/README.md +0 -220
package/dist/index.d.mts
CHANGED
|
@@ -194,6 +194,7 @@ interface PermissionBadgesProps {
|
|
|
194
194
|
permissions?: string[] | null;
|
|
195
195
|
maxDisplay?: number;
|
|
196
196
|
className?: string;
|
|
197
|
+
wrap?: boolean;
|
|
197
198
|
}
|
|
198
199
|
declare const PermissionBadges: react.NamedExoticComponent<PermissionBadgesProps>;
|
|
199
200
|
declare const PermissionsBadges: react.NamedExoticComponent<PermissionBadgesProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -194,6 +194,7 @@ interface PermissionBadgesProps {
|
|
|
194
194
|
permissions?: string[] | null;
|
|
195
195
|
maxDisplay?: number;
|
|
196
196
|
className?: string;
|
|
197
|
+
wrap?: boolean;
|
|
197
198
|
}
|
|
198
199
|
declare const PermissionBadges: react.NamedExoticComponent<PermissionBadgesProps>;
|
|
199
200
|
declare const PermissionsBadges: react.NamedExoticComponent<PermissionBadgesProps>;
|
package/dist/index.js
CHANGED
|
@@ -1465,6 +1465,7 @@ function AppSidebarInner({
|
|
|
1465
1465
|
const router = (0, import_navigation.useRouter)();
|
|
1466
1466
|
const { setOpenMobile } = useSidebar();
|
|
1467
1467
|
const [isPending, startTransition] = (0, import_react.useTransition)();
|
|
1468
|
+
const [confirmDialogOpen, setConfirmDialogOpen] = (0, import_react.useState)(false);
|
|
1468
1469
|
const segments = pathname ? pathname.split("/").filter(Boolean) : [];
|
|
1469
1470
|
const allNavItems = [...navMainItems, ...navSecondaryItems];
|
|
1470
1471
|
(0, import_react.useEffect)(() => {
|
|
@@ -1475,6 +1476,10 @@ function AppSidebarInner({
|
|
|
1475
1476
|
const handleLinkClick = () => {
|
|
1476
1477
|
setOpenMobile(false);
|
|
1477
1478
|
};
|
|
1479
|
+
const handleConfirmContinue = () => {
|
|
1480
|
+
setConfirmDialogOpen(false);
|
|
1481
|
+
handleLinkClick();
|
|
1482
|
+
};
|
|
1478
1483
|
const handleSelectOrg = (org) => {
|
|
1479
1484
|
if (org.id && (activeOrg == null ? void 0 : activeOrg.id) && org.id === activeOrg.id) return;
|
|
1480
1485
|
setOpenMobile(false);
|
|
@@ -1616,47 +1621,54 @@ function AppSidebarInner({
|
|
|
1616
1621
|
]
|
|
1617
1622
|
}
|
|
1618
1623
|
),
|
|
1619
|
-
/* @__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)(
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AvatarImage, { src: image || "", alt: name || "" }),
|
|
1626
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AvatarFallback, { children: initials })
|
|
1627
|
-
] }),
|
|
1628
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
1629
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate font-medium", children: name }),
|
|
1630
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: email })
|
|
1631
|
-
] })
|
|
1632
|
-
] })
|
|
1633
|
-
}
|
|
1634
|
-
),
|
|
1635
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(AlertDialogContent, { children: [
|
|
1636
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(AlertDialogHeader, { children: [
|
|
1637
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AlertDialogTitle, { children: "Manage Account in Identity" }),
|
|
1638
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AlertDialogDescription, { children: "You will be redirected to the Identity website to manage your profile, account, and settings." })
|
|
1639
|
-
] }),
|
|
1640
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(AlertDialogFooter, { children: [
|
|
1641
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AlertDialogCancel, { children: "Cancel" }),
|
|
1624
|
+
/* @__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)(
|
|
1625
|
+
AlertDialog,
|
|
1626
|
+
{
|
|
1627
|
+
open: confirmDialogOpen,
|
|
1628
|
+
onOpenChange: setConfirmDialogOpen,
|
|
1629
|
+
children: [
|
|
1642
1630
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1643
|
-
|
|
1631
|
+
AlertDialogTrigger,
|
|
1644
1632
|
{
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1633
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SidebarMenuButton, { size: "lg", children: [
|
|
1634
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Avatar, { children: [
|
|
1635
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AvatarImage, { src: image || "", alt: name || "" }),
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AvatarFallback, { children: initials })
|
|
1637
|
+
] }),
|
|
1638
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
1639
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate font-medium", children: name }),
|
|
1640
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: email })
|
|
1641
|
+
] })
|
|
1642
|
+
] })
|
|
1643
|
+
}
|
|
1644
|
+
),
|
|
1645
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(AlertDialogContent, { children: [
|
|
1646
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(AlertDialogHeader, { children: [
|
|
1647
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AlertDialogTitle, { children: "Manage Account in Identity" }),
|
|
1648
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AlertDialogDescription, { children: "You will be redirected to the Identity website to manage your profile, account, and settings." })
|
|
1649
|
+
] }),
|
|
1650
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(AlertDialogFooter, { children: [
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AlertDialogCancel, { children: "Cancel" }),
|
|
1652
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1653
|
+
AlertDialogAction,
|
|
1648
1654
|
{
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1655
|
+
nativeButton: false,
|
|
1656
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1657
|
+
import_link.default,
|
|
1658
|
+
{
|
|
1659
|
+
href,
|
|
1660
|
+
target: "_blank",
|
|
1661
|
+
onClick: handleConfirmContinue
|
|
1662
|
+
}
|
|
1663
|
+
),
|
|
1664
|
+
children: "Continue"
|
|
1652
1665
|
}
|
|
1653
|
-
)
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1666
|
+
)
|
|
1667
|
+
] })
|
|
1668
|
+
] })
|
|
1669
|
+
]
|
|
1670
|
+
}
|
|
1671
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1660
1672
|
SidebarMenuButton,
|
|
1661
1673
|
{
|
|
1662
1674
|
size: "lg",
|
|
@@ -2511,42 +2523,53 @@ var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
|
2511
2523
|
var PermissionBadges = (0, import_react12.memo)(function PermissionBadges2({
|
|
2512
2524
|
permissions,
|
|
2513
2525
|
maxDisplay = 3,
|
|
2514
|
-
className
|
|
2526
|
+
className,
|
|
2527
|
+
wrap = false
|
|
2515
2528
|
}) {
|
|
2516
2529
|
const perms = permissions != null ? permissions : [];
|
|
2517
2530
|
if (perms.length === 0) return null;
|
|
2518
2531
|
const visible = perms.slice(0, maxDisplay);
|
|
2519
2532
|
const remaining = perms.slice(maxDisplay);
|
|
2520
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2534
|
+
"div",
|
|
2535
|
+
{
|
|
2536
|
+
className: (0, import_cn20.cn)(
|
|
2537
|
+
"flex items-center gap-1",
|
|
2538
|
+
wrap ? "flex-wrap" : "flex-nowrap",
|
|
2539
|
+
className
|
|
2540
|
+
),
|
|
2541
|
+
children: [
|
|
2542
|
+
visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2543
|
+
Badge,
|
|
2544
|
+
{
|
|
2545
|
+
variant: "outline",
|
|
2546
|
+
className: "text-[10px] font-mono py-0 font-normal shrink-0",
|
|
2547
|
+
children: p
|
|
2548
|
+
},
|
|
2549
|
+
p
|
|
2550
|
+
)),
|
|
2551
|
+
remaining.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Tooltip, { children: [
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2553
|
+
TooltipTrigger,
|
|
2536
2554
|
{
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2555
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2556
|
+
Badge,
|
|
2557
|
+
{
|
|
2558
|
+
variant: "secondary",
|
|
2559
|
+
className: "text-[10px] font-mono py-0 cursor-default font-normal shrink-0",
|
|
2560
|
+
children: [
|
|
2561
|
+
"+",
|
|
2562
|
+
remaining.length
|
|
2563
|
+
]
|
|
2564
|
+
}
|
|
2565
|
+
)
|
|
2543
2566
|
}
|
|
2544
|
-
)
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2567
|
+
),
|
|
2568
|
+
/* @__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)) }) })
|
|
2569
|
+
] })
|
|
2570
|
+
]
|
|
2571
|
+
}
|
|
2572
|
+
);
|
|
2550
2573
|
});
|
|
2551
2574
|
var PermissionsBadges = PermissionBadges;
|
|
2552
2575
|
|
package/dist/index.mjs
CHANGED
|
@@ -35,7 +35,7 @@ var __objRest = (source, exclude) => {
|
|
|
35
35
|
import { Check, ChevronsUpDown, Command, LockIcon } from "lucide-react";
|
|
36
36
|
import Link from "next/link";
|
|
37
37
|
import { usePathname, useRouter } from "next/navigation";
|
|
38
|
-
import { memo, useEffect as useEffect3, useTransition } from "react";
|
|
38
|
+
import { memo, useEffect as useEffect3, useState as useState3, useTransition } from "react";
|
|
39
39
|
|
|
40
40
|
// src/components/ui/alert-dialog.tsx
|
|
41
41
|
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
@@ -1374,6 +1374,7 @@ function AppSidebarInner({
|
|
|
1374
1374
|
const router = useRouter();
|
|
1375
1375
|
const { setOpenMobile } = useSidebar();
|
|
1376
1376
|
const [isPending, startTransition] = useTransition();
|
|
1377
|
+
const [confirmDialogOpen, setConfirmDialogOpen] = useState3(false);
|
|
1377
1378
|
const segments = pathname ? pathname.split("/").filter(Boolean) : [];
|
|
1378
1379
|
const allNavItems = [...navMainItems, ...navSecondaryItems];
|
|
1379
1380
|
useEffect3(() => {
|
|
@@ -1384,6 +1385,10 @@ function AppSidebarInner({
|
|
|
1384
1385
|
const handleLinkClick = () => {
|
|
1385
1386
|
setOpenMobile(false);
|
|
1386
1387
|
};
|
|
1388
|
+
const handleConfirmContinue = () => {
|
|
1389
|
+
setConfirmDialogOpen(false);
|
|
1390
|
+
handleLinkClick();
|
|
1391
|
+
};
|
|
1387
1392
|
const handleSelectOrg = (org) => {
|
|
1388
1393
|
if (org.id && (activeOrg == null ? void 0 : activeOrg.id) && org.id === activeOrg.id) return;
|
|
1389
1394
|
setOpenMobile(false);
|
|
@@ -1525,47 +1530,54 @@ function AppSidebarInner({
|
|
|
1525
1530
|
]
|
|
1526
1531
|
}
|
|
1527
1532
|
),
|
|
1528
|
-
/* @__PURE__ */ jsx12(SidebarFooter, { children: /* @__PURE__ */ jsx12(SidebarMenu, { children: /* @__PURE__ */ jsx12(SidebarMenuItem, { children: confirmDialog ? /* @__PURE__ */ jsxs7(
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
/* @__PURE__ */ jsx12(AvatarImage, { src: image || "", alt: name || "" }),
|
|
1535
|
-
/* @__PURE__ */ jsx12(AvatarFallback, { children: initials })
|
|
1536
|
-
] }),
|
|
1537
|
-
/* @__PURE__ */ jsxs7("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
1538
|
-
/* @__PURE__ */ jsx12("span", { className: "truncate font-medium", children: name }),
|
|
1539
|
-
/* @__PURE__ */ jsx12("span", { className: "truncate text-xs text-muted-foreground", children: email })
|
|
1540
|
-
] })
|
|
1541
|
-
] })
|
|
1542
|
-
}
|
|
1543
|
-
),
|
|
1544
|
-
/* @__PURE__ */ jsxs7(AlertDialogContent, { children: [
|
|
1545
|
-
/* @__PURE__ */ jsxs7(AlertDialogHeader, { children: [
|
|
1546
|
-
/* @__PURE__ */ jsx12(AlertDialogTitle, { children: "Manage Account in Identity" }),
|
|
1547
|
-
/* @__PURE__ */ jsx12(AlertDialogDescription, { children: "You will be redirected to the Identity website to manage your profile, account, and settings." })
|
|
1548
|
-
] }),
|
|
1549
|
-
/* @__PURE__ */ jsxs7(AlertDialogFooter, { children: [
|
|
1550
|
-
/* @__PURE__ */ jsx12(AlertDialogCancel, { children: "Cancel" }),
|
|
1533
|
+
/* @__PURE__ */ jsx12(SidebarFooter, { children: /* @__PURE__ */ jsx12(SidebarMenu, { children: /* @__PURE__ */ jsx12(SidebarMenuItem, { children: confirmDialog ? /* @__PURE__ */ jsxs7(
|
|
1534
|
+
AlertDialog,
|
|
1535
|
+
{
|
|
1536
|
+
open: confirmDialogOpen,
|
|
1537
|
+
onOpenChange: setConfirmDialogOpen,
|
|
1538
|
+
children: [
|
|
1551
1539
|
/* @__PURE__ */ jsx12(
|
|
1552
|
-
|
|
1540
|
+
AlertDialogTrigger,
|
|
1553
1541
|
{
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1542
|
+
render: /* @__PURE__ */ jsxs7(SidebarMenuButton, { size: "lg", children: [
|
|
1543
|
+
/* @__PURE__ */ jsxs7(Avatar, { children: [
|
|
1544
|
+
/* @__PURE__ */ jsx12(AvatarImage, { src: image || "", alt: name || "" }),
|
|
1545
|
+
/* @__PURE__ */ jsx12(AvatarFallback, { children: initials })
|
|
1546
|
+
] }),
|
|
1547
|
+
/* @__PURE__ */ jsxs7("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
1548
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate font-medium", children: name }),
|
|
1549
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate text-xs text-muted-foreground", children: email })
|
|
1550
|
+
] })
|
|
1551
|
+
] })
|
|
1552
|
+
}
|
|
1553
|
+
),
|
|
1554
|
+
/* @__PURE__ */ jsxs7(AlertDialogContent, { children: [
|
|
1555
|
+
/* @__PURE__ */ jsxs7(AlertDialogHeader, { children: [
|
|
1556
|
+
/* @__PURE__ */ jsx12(AlertDialogTitle, { children: "Manage Account in Identity" }),
|
|
1557
|
+
/* @__PURE__ */ jsx12(AlertDialogDescription, { children: "You will be redirected to the Identity website to manage your profile, account, and settings." })
|
|
1558
|
+
] }),
|
|
1559
|
+
/* @__PURE__ */ jsxs7(AlertDialogFooter, { children: [
|
|
1560
|
+
/* @__PURE__ */ jsx12(AlertDialogCancel, { children: "Cancel" }),
|
|
1561
|
+
/* @__PURE__ */ jsx12(
|
|
1562
|
+
AlertDialogAction,
|
|
1557
1563
|
{
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1564
|
+
nativeButton: false,
|
|
1565
|
+
render: /* @__PURE__ */ jsx12(
|
|
1566
|
+
Link,
|
|
1567
|
+
{
|
|
1568
|
+
href,
|
|
1569
|
+
target: "_blank",
|
|
1570
|
+
onClick: handleConfirmContinue
|
|
1571
|
+
}
|
|
1572
|
+
),
|
|
1573
|
+
children: "Continue"
|
|
1561
1574
|
}
|
|
1562
|
-
)
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
] }) : /* @__PURE__ */ jsxs7(
|
|
1575
|
+
)
|
|
1576
|
+
] })
|
|
1577
|
+
] })
|
|
1578
|
+
]
|
|
1579
|
+
}
|
|
1580
|
+
) : /* @__PURE__ */ jsxs7(
|
|
1569
1581
|
SidebarMenuButton,
|
|
1570
1582
|
{
|
|
1571
1583
|
size: "lg",
|
|
@@ -1795,7 +1807,7 @@ var AvatarUser = memo4(function AvatarUser2({
|
|
|
1795
1807
|
// src/components/composed/columns/copyable-code.tsx
|
|
1796
1808
|
import { cn as cn14 } from "cn";
|
|
1797
1809
|
import { CheckIcon as CheckIcon2, CopyIcon } from "lucide-react";
|
|
1798
|
-
import { memo as memo5, useCallback as useCallback2, useState as
|
|
1810
|
+
import { memo as memo5, useCallback as useCallback2, useState as useState4 } from "react";
|
|
1799
1811
|
|
|
1800
1812
|
// src/components/ui/toast.tsx
|
|
1801
1813
|
import { Toast as ToastPrimitive } from "@base-ui/react/toast";
|
|
@@ -1826,7 +1838,7 @@ var CopyableCode = memo5(function CopyableCode2({
|
|
|
1826
1838
|
codeClassName,
|
|
1827
1839
|
onCopy
|
|
1828
1840
|
}) {
|
|
1829
|
-
const [copied, setCopied] =
|
|
1841
|
+
const [copied, setCopied] = useState4(false);
|
|
1830
1842
|
const handleCopy = useCallback2(
|
|
1831
1843
|
async (e) => {
|
|
1832
1844
|
e.stopPropagation();
|
|
@@ -2434,42 +2446,53 @@ import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
|
2434
2446
|
var PermissionBadges = memo12(function PermissionBadges2({
|
|
2435
2447
|
permissions,
|
|
2436
2448
|
maxDisplay = 3,
|
|
2437
|
-
className
|
|
2449
|
+
className,
|
|
2450
|
+
wrap = false
|
|
2438
2451
|
}) {
|
|
2439
2452
|
const perms = permissions != null ? permissions : [];
|
|
2440
2453
|
if (perms.length === 0) return null;
|
|
2441
2454
|
const visible = perms.slice(0, maxDisplay);
|
|
2442
2455
|
const remaining = perms.slice(maxDisplay);
|
|
2443
|
-
return /* @__PURE__ */ jsxs17(
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2456
|
+
return /* @__PURE__ */ jsxs17(
|
|
2457
|
+
"div",
|
|
2458
|
+
{
|
|
2459
|
+
className: cn20(
|
|
2460
|
+
"flex items-center gap-1",
|
|
2461
|
+
wrap ? "flex-wrap" : "flex-nowrap",
|
|
2462
|
+
className
|
|
2463
|
+
),
|
|
2464
|
+
children: [
|
|
2465
|
+
visible.map((p) => /* @__PURE__ */ jsx24(
|
|
2466
|
+
Badge,
|
|
2467
|
+
{
|
|
2468
|
+
variant: "outline",
|
|
2469
|
+
className: "text-[10px] font-mono py-0 font-normal shrink-0",
|
|
2470
|
+
children: p
|
|
2471
|
+
},
|
|
2472
|
+
p
|
|
2473
|
+
)),
|
|
2474
|
+
remaining.length > 0 && /* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
2475
|
+
/* @__PURE__ */ jsx24(
|
|
2476
|
+
TooltipTrigger,
|
|
2459
2477
|
{
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2478
|
+
render: /* @__PURE__ */ jsxs17(
|
|
2479
|
+
Badge,
|
|
2480
|
+
{
|
|
2481
|
+
variant: "secondary",
|
|
2482
|
+
className: "text-[10px] font-mono py-0 cursor-default font-normal shrink-0",
|
|
2483
|
+
children: [
|
|
2484
|
+
"+",
|
|
2485
|
+
remaining.length
|
|
2486
|
+
]
|
|
2487
|
+
}
|
|
2488
|
+
)
|
|
2466
2489
|
}
|
|
2467
|
-
)
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2490
|
+
),
|
|
2491
|
+
/* @__PURE__ */ jsx24(TooltipContent, { className: "max-w-xs", children: /* @__PURE__ */ jsx24("div", { className: "flex flex-col gap-0.5 text-xs font-mono", children: remaining.map((p) => /* @__PURE__ */ jsx24("span", { children: p }, p)) }) })
|
|
2492
|
+
] })
|
|
2493
|
+
]
|
|
2494
|
+
}
|
|
2495
|
+
);
|
|
2473
2496
|
});
|
|
2474
2497
|
var PermissionsBadges = PermissionBadges;
|
|
2475
2498
|
|
|
@@ -2739,7 +2762,7 @@ import {
|
|
|
2739
2762
|
} from "@tanstack/react-table";
|
|
2740
2763
|
import { FolderOpenIcon } from "lucide-react";
|
|
2741
2764
|
import { useRouter as useRouter3 } from "next/navigation";
|
|
2742
|
-
import { useMemo as useMemo5, useState as
|
|
2765
|
+
import { useMemo as useMemo5, useState as useState7 } from "react";
|
|
2743
2766
|
|
|
2744
2767
|
// src/components/composed/state-empty.tsx
|
|
2745
2768
|
import { memo as memo17 } from "react";
|
|
@@ -3469,7 +3492,7 @@ function DataTableHeaderDownload({
|
|
|
3469
3492
|
// src/components/composed/data-table/table-header-filter.tsx
|
|
3470
3493
|
import { format } from "date-fns";
|
|
3471
3494
|
import { CalendarIcon, ListFilterIcon } from "lucide-react";
|
|
3472
|
-
import { useMemo as useMemo4, useState as
|
|
3495
|
+
import { useMemo as useMemo4, useState as useState5 } from "react";
|
|
3473
3496
|
|
|
3474
3497
|
// src/components/ui/calendar.tsx
|
|
3475
3498
|
import { cn as cn28 } from "cn";
|
|
@@ -4035,7 +4058,7 @@ function ColumnFilterInput({
|
|
|
4035
4058
|
table,
|
|
4036
4059
|
headerText
|
|
4037
4060
|
}) {
|
|
4038
|
-
const [calendarOpen, setCalendarOpen] =
|
|
4061
|
+
const [calendarOpen, setCalendarOpen] = useState5(false);
|
|
4039
4062
|
const filterValue = column.getFilterValue();
|
|
4040
4063
|
const variant = useMemo4(
|
|
4041
4064
|
() => getFilterVariant(column, table),
|
|
@@ -4254,11 +4277,11 @@ function DataTableHeaderFilter({
|
|
|
4254
4277
|
// src/components/composed/data-table/table-header-refresh.tsx
|
|
4255
4278
|
import { RotateCwIcon } from "lucide-react";
|
|
4256
4279
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
4257
|
-
import { useState as
|
|
4280
|
+
import { useState as useState6 } from "react";
|
|
4258
4281
|
import { jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4259
4282
|
function DataTableHeaderRefresh() {
|
|
4260
4283
|
const router = useRouter2();
|
|
4261
|
-
const [isRefreshing, setIsRefreshing] =
|
|
4284
|
+
const [isRefreshing, setIsRefreshing] = useState6(false);
|
|
4262
4285
|
const handleRefresh = () => {
|
|
4263
4286
|
setIsRefreshing(true);
|
|
4264
4287
|
router.refresh();
|
|
@@ -4530,11 +4553,11 @@ function DataTable({
|
|
|
4530
4553
|
showAddButton = true
|
|
4531
4554
|
}) {
|
|
4532
4555
|
const router = useRouter3();
|
|
4533
|
-
const [createOpen, setCreateOpen] =
|
|
4534
|
-
const [sorting, setSorting] =
|
|
4535
|
-
const [columnFilters, setColumnFilters] =
|
|
4536
|
-
const [columnVisibility, setColumnVisibility] =
|
|
4537
|
-
const [globalFilter, setGlobalFilter] =
|
|
4556
|
+
const [createOpen, setCreateOpen] = useState7(false);
|
|
4557
|
+
const [sorting, setSorting] = useState7([]);
|
|
4558
|
+
const [columnFilters, setColumnFilters] = useState7([]);
|
|
4559
|
+
const [columnVisibility, setColumnVisibility] = useState7(initialColumnVisibility != null ? initialColumnVisibility : {});
|
|
4560
|
+
const [globalFilter, setGlobalFilter] = useState7("");
|
|
4538
4561
|
const columnsWithSmartFilters = useMemo5(() => {
|
|
4539
4562
|
return columns.map((col) => __spreadValues({
|
|
4540
4563
|
filterFn: smartFilterFn
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prediktif/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -29,6 +29,15 @@
|
|
|
29
29
|
"access": "public",
|
|
30
30
|
"registry": "https://registry.npmjs.org/"
|
|
31
31
|
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"dev": "next dev",
|
|
34
|
+
"build": "next build",
|
|
35
|
+
"build:lib": "tsup",
|
|
36
|
+
"prepublishOnly": "pnpm build:lib",
|
|
37
|
+
"start": "next start",
|
|
38
|
+
"lint": "biome check",
|
|
39
|
+
"format": "biome format --write"
|
|
40
|
+
},
|
|
32
41
|
"dependencies": {
|
|
33
42
|
"@base-ui/react": "^1.8.0",
|
|
34
43
|
"@hookform/resolvers": "^5.9.1",
|
|
@@ -84,12 +93,5 @@
|
|
|
84
93
|
"tsup": "^8.5.1",
|
|
85
94
|
"typescript": "^5"
|
|
86
95
|
},
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
"build": "next build",
|
|
90
|
-
"build:lib": "tsup",
|
|
91
|
-
"start": "next start",
|
|
92
|
-
"lint": "biome check",
|
|
93
|
-
"format": "biome format --write"
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
+
"packageManager": "pnpm@10.30.3"
|
|
97
|
+
}
|
package/README.md
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
# `@prediktif/ui`
|
|
2
|
-
|
|
3
|
-
The official shared Design System and UI Component Library for the **Prediktif** ecosystem.
|
|
4
|
-
|
|
5
|
-
This repository provides reusable React components, custom layout blocks, and standardized design tokens for applications built within the Prediktif product line.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 🚀 Quick Start (Installation)
|
|
10
|
-
|
|
11
|
-
To consume Prediktif's custom components in any application within the ecosystem:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
pnpm add @prediktif/ui
|
|
15
|
-
# or
|
|
16
|
-
npm install @prediktif/ui
|
|
17
|
-
# or
|
|
18
|
-
yarn add @prediktif/ui
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 🎨 Styling & Tailwind Setup
|
|
24
|
-
|
|
25
|
-
To ensure Tailwind CSS properly scans and compiles the styles, icons, and theme colors used by `@prediktif/ui`, configure your application's `globals.css`:
|
|
26
|
-
|
|
27
|
-
### 1. Configure `@source` in `globals.css` (Tailwind CSS v4)
|
|
28
|
-
|
|
29
|
-
Add the `@source` directive right after `@import "tailwindcss";` in your project's `src/app/globals.css`:
|
|
30
|
-
|
|
31
|
-
```css
|
|
32
|
-
@import "tailwindcss";
|
|
33
|
-
@import "tw-animate-css";
|
|
34
|
-
@import "shadcn/tailwind.css";
|
|
35
|
-
|
|
36
|
-
/* 💡 Enables Tailwind v4 to scan class names inside @prediktif/ui */
|
|
37
|
-
@import "@prediktif/ui/styles.css";
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
*(If using **Tailwind CSS v3**, add `"./node_modules/@prediktif/ui/dist/**/*.{js,mjs}"` to the `content` array in your `tailwind.config.ts`)*.
|
|
41
|
-
|
|
42
|
-
### 2. Configure Sidebar Theme Variables
|
|
43
|
-
|
|
44
|
-
Ensure your `globals.css` includes the `@theme inline` mapping and CSS variables for sidebar colors:
|
|
45
|
-
|
|
46
|
-
```css
|
|
47
|
-
@theme inline {
|
|
48
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
49
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
50
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
51
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
52
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
53
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
54
|
-
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
55
|
-
--color-sidebar: var(--sidebar);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
:root {
|
|
59
|
-
--sidebar: oklch(0.985 0 0);
|
|
60
|
-
--sidebar-foreground: oklch(0.145 0 0);
|
|
61
|
-
--sidebar-primary: oklch(0.681 0.162 75.834);
|
|
62
|
-
--sidebar-primary-foreground: oklch(0.987 0.026 102.212);
|
|
63
|
-
--sidebar-accent: oklch(0.97 0 0);
|
|
64
|
-
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
65
|
-
--sidebar-border: oklch(0.922 0 0);
|
|
66
|
-
--sidebar-ring: oklch(0.708 0 0);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.dark {
|
|
70
|
-
--sidebar: oklch(0.205 0 0);
|
|
71
|
-
--sidebar-foreground: oklch(0.985 0 0);
|
|
72
|
-
--sidebar-primary: oklch(0.795 0.184 86.047);
|
|
73
|
-
--sidebar-primary-foreground: oklch(0.987 0.026 102.212);
|
|
74
|
-
--sidebar-accent: oklch(0.269 0 0);
|
|
75
|
-
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
76
|
-
--sidebar-border: oklch(1 0 0 / 10%);
|
|
77
|
-
--sidebar-ring: oklch(0.556 0 0);
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## 💻 Usage
|
|
84
|
-
|
|
85
|
-
Only Prediktif's custom composed components (`src/components/composed/*`) are exposed by the package entry points.
|
|
86
|
-
|
|
87
|
-
### Importing Composed Components
|
|
88
|
-
|
|
89
|
-
```tsx
|
|
90
|
-
import { HeaderTitle } from "@prediktif/ui";
|
|
91
|
-
|
|
92
|
-
export default function DashboardHeader() {
|
|
93
|
-
return (
|
|
94
|
-
<HeaderTitle
|
|
95
|
-
title="User Management"
|
|
96
|
-
subtitle="Manage roles and permissions across your organization"
|
|
97
|
-
/>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Or via subpath export:
|
|
103
|
-
|
|
104
|
-
```tsx
|
|
105
|
-
import { HeaderTitle } from "@prediktif/ui/composed";
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## 🏗️ Project Architecture & Component Classification
|
|
111
|
-
|
|
112
|
-
The repository is structured as follows:
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
src/
|
|
116
|
-
├── components/
|
|
117
|
-
│ ├── composed/ <-- Custom components built by Prediktif (EXPOSED)
|
|
118
|
-
│ ├── ai-elements/ <-- Third-party AI/LLM UI components (Internal)
|
|
119
|
-
│ └── ui/ <-- Third-party primitive UI components (Internal)
|
|
120
|
-
├── app/ <-- Next.js Documentation & Preview Portal
|
|
121
|
-
├── index.ts <-- Main library entry point
|
|
122
|
-
└── components/composed/index.ts <-- Composed components export index
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
* **`src/components/composed/`**: High-level, custom-tailored components created specifically for Prediktif applications. **These components are bundled and exported in the published package.**
|
|
126
|
-
* **`src/components/ui/` & `src/components/ai-elements/`**: Base primitives and AI component libraries used internally to construct `composed` elements and render the local documentation preview.
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## 🛠️ Development Workflow
|
|
131
|
-
|
|
132
|
-
### 1. Running the Local Documentation Portal
|
|
133
|
-
To preview components and view interactive documentation locally:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
pnpm dev
|
|
137
|
-
```
|
|
138
|
-
Open [http://localhost:3000](http://localhost:3000) in your browser.
|
|
139
|
-
|
|
140
|
-
### 2. Adding a New Composed Component
|
|
141
|
-
|
|
142
|
-
1. **Create the component** in `src/components/composed/my-component.tsx`:
|
|
143
|
-
```tsx
|
|
144
|
-
export interface MyComponentProps {
|
|
145
|
-
label: string;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export function MyComponent({ label }: MyComponentProps) {
|
|
149
|
-
return <div className="p-4 rounded-md border">{label}</div>;
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
2. **Export the component** in `src/components/composed/index.ts`:
|
|
154
|
-
```ts
|
|
155
|
-
export * from "./header-title";
|
|
156
|
-
export * from "./my-component";
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
3. **Register in navigation** (`src/lib/docs-config.ts`):
|
|
160
|
-
```ts
|
|
161
|
-
{
|
|
162
|
-
title: "Components",
|
|
163
|
-
url: "/components",
|
|
164
|
-
items: [
|
|
165
|
-
// ...
|
|
166
|
-
{ title: "My Component", url: "/components/my-component" },
|
|
167
|
-
]
|
|
168
|
-
}
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
4. **Create the documentation detail page** in `src/app/(docs)/components/my-component/page.tsx`:
|
|
172
|
-
- Include `<ComponentHeader>`, `<ComponentSection title="Preview">`, `<ComponentCodeExample>`, `<ComponentPropsTable>`, and `<ComponentPagination />`.
|
|
173
|
-
|
|
174
|
-
5. **Add a preview card** to `src/app/(docs)/components/page.tsx`:
|
|
175
|
-
- Add `<Card>` with `<CardHeader>`, `<CardTitle>`, `<CardDescription className="truncate">`, and `<CardContent className="max-h-32 overflow-y-scroll">` wrapping `<ComponentPreview>`.
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## 📦 Building & Publishing
|
|
180
|
-
|
|
181
|
-
### Building the Component Library
|
|
182
|
-
To build the distribution bundle (`dist/index.mjs`, `dist/index.js`, `dist/index.d.ts`):
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
pnpm build:lib
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
This uses `tsup` to bundle the TypeScript components while preserving React `"use client"` directives and generating TypeScript type declarations (`.d.ts`).
|
|
189
|
-
|
|
190
|
-
### Publishing to NPM Registry
|
|
191
|
-
|
|
192
|
-
> [!NOTE]
|
|
193
|
-
> **Private GitHub Repository + Public NPM Package**:
|
|
194
|
-
> The GitHub repository is **Private** to protect source code and documentation history.
|
|
195
|
-
> The compiled library package is published **Publicly** to NPM (`npmjs.com`) so that all Prediktif ecosystem projects can install it without requiring GitHub credentials or tokens.
|
|
196
|
-
|
|
197
|
-
#### Publishing Steps:
|
|
198
|
-
|
|
199
|
-
1. **Bump Version** in `package.json` (or use `npm version patch | minor | major`):
|
|
200
|
-
```bash
|
|
201
|
-
npm version patch
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
2. **Login to NPM** (if not authenticated):
|
|
205
|
-
```bash
|
|
206
|
-
npm login
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
3. **Publish Package**:
|
|
210
|
-
```bash
|
|
211
|
-
pnpm publish --access public --registry https://registry.npmjs.org/
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
*Note: The `prepublishOnly` hook automatically runs `pnpm build:lib` before publishing.*
|
|
215
|
-
|
|
216
|
-
---
|
|
217
|
-
|
|
218
|
-
## 📄 License
|
|
219
|
-
|
|
220
|
-
Private & Proprietary — **Prediktif Ecosystem**. All rights reserved.
|