@prediktif/ui 0.1.29 → 0.1.31
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.js +60 -41
- package/dist/index.mjs +73 -54
- package/package.json +12 -10
- package/README.md +0 -220
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",
|
|
@@ -4769,12 +4781,19 @@ var HeaderTabs = (0, import_react22.memo)(function HeaderTabs2({
|
|
|
4769
4781
|
onValueChange,
|
|
4770
4782
|
children
|
|
4771
4783
|
}) {
|
|
4772
|
-
var _a, _b;
|
|
4784
|
+
var _a, _b, _c, _d, _e;
|
|
4773
4785
|
const pathname = (0, import_navigation4.usePathname)();
|
|
4774
|
-
const
|
|
4775
|
-
|
|
4786
|
+
const normalizedPathname = pathname ? pathname.replace(/\/$/, "") : "";
|
|
4787
|
+
const matchedItem = normalizedPathname ? (_c = (_b = (_a = items.find(
|
|
4788
|
+
(item) => item.url.replace(/\/$/, "") === normalizedPathname
|
|
4789
|
+
)) != null ? _a : [...items].filter(
|
|
4790
|
+
(item) => normalizedPathname.startsWith(`${item.url.replace(/\/$/, "")}/`)
|
|
4791
|
+
).sort((a, b) => b.url.length - a.url.length)[0]) != null ? _b : items.find(
|
|
4792
|
+
(item) => normalizedPathname.split("/").pop() === item.value
|
|
4793
|
+
)) != null ? _c : items.find(
|
|
4794
|
+
(item) => normalizedPathname.endsWith(item.url.replace(/\/$/, ""))
|
|
4776
4795
|
) : void 0;
|
|
4777
|
-
const activeTab = (
|
|
4796
|
+
const activeTab = (_e = value != null ? value : matchedItem == null ? void 0 : matchedItem.value) != null ? _e : (_d = items[0]) == null ? void 0 : _d.value;
|
|
4778
4797
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Tabs, { value: activeTab, onValueChange, className: "space-y-4", children: [
|
|
4779
4798
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "w-full overflow-x-auto overflow-y-hidden border-b no-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TabsList, { variant: "line", className: "inline-flex w-max justify-start", children: items.map(({ title, value: tabValue, url, icon }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
4780
4799
|
TabsTrigger,
|
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();
|
|
@@ -2750,7 +2762,7 @@ import {
|
|
|
2750
2762
|
} from "@tanstack/react-table";
|
|
2751
2763
|
import { FolderOpenIcon } from "lucide-react";
|
|
2752
2764
|
import { useRouter as useRouter3 } from "next/navigation";
|
|
2753
|
-
import { useMemo as useMemo5, useState as
|
|
2765
|
+
import { useMemo as useMemo5, useState as useState7 } from "react";
|
|
2754
2766
|
|
|
2755
2767
|
// src/components/composed/state-empty.tsx
|
|
2756
2768
|
import { memo as memo17 } from "react";
|
|
@@ -3480,7 +3492,7 @@ function DataTableHeaderDownload({
|
|
|
3480
3492
|
// src/components/composed/data-table/table-header-filter.tsx
|
|
3481
3493
|
import { format } from "date-fns";
|
|
3482
3494
|
import { CalendarIcon, ListFilterIcon } from "lucide-react";
|
|
3483
|
-
import { useMemo as useMemo4, useState as
|
|
3495
|
+
import { useMemo as useMemo4, useState as useState5 } from "react";
|
|
3484
3496
|
|
|
3485
3497
|
// src/components/ui/calendar.tsx
|
|
3486
3498
|
import { cn as cn28 } from "cn";
|
|
@@ -4046,7 +4058,7 @@ function ColumnFilterInput({
|
|
|
4046
4058
|
table,
|
|
4047
4059
|
headerText
|
|
4048
4060
|
}) {
|
|
4049
|
-
const [calendarOpen, setCalendarOpen] =
|
|
4061
|
+
const [calendarOpen, setCalendarOpen] = useState5(false);
|
|
4050
4062
|
const filterValue = column.getFilterValue();
|
|
4051
4063
|
const variant = useMemo4(
|
|
4052
4064
|
() => getFilterVariant(column, table),
|
|
@@ -4265,11 +4277,11 @@ function DataTableHeaderFilter({
|
|
|
4265
4277
|
// src/components/composed/data-table/table-header-refresh.tsx
|
|
4266
4278
|
import { RotateCwIcon } from "lucide-react";
|
|
4267
4279
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
4268
|
-
import { useState as
|
|
4280
|
+
import { useState as useState6 } from "react";
|
|
4269
4281
|
import { jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4270
4282
|
function DataTableHeaderRefresh() {
|
|
4271
4283
|
const router = useRouter2();
|
|
4272
|
-
const [isRefreshing, setIsRefreshing] =
|
|
4284
|
+
const [isRefreshing, setIsRefreshing] = useState6(false);
|
|
4273
4285
|
const handleRefresh = () => {
|
|
4274
4286
|
setIsRefreshing(true);
|
|
4275
4287
|
router.refresh();
|
|
@@ -4541,11 +4553,11 @@ function DataTable({
|
|
|
4541
4553
|
showAddButton = true
|
|
4542
4554
|
}) {
|
|
4543
4555
|
const router = useRouter3();
|
|
4544
|
-
const [createOpen, setCreateOpen] =
|
|
4545
|
-
const [sorting, setSorting] =
|
|
4546
|
-
const [columnFilters, setColumnFilters] =
|
|
4547
|
-
const [columnVisibility, setColumnVisibility] =
|
|
4548
|
-
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("");
|
|
4549
4561
|
const columnsWithSmartFilters = useMemo5(() => {
|
|
4550
4562
|
return columns.map((col) => __spreadValues({
|
|
4551
4563
|
filterFn: smartFilterFn
|
|
@@ -4734,12 +4746,19 @@ var HeaderTabs = memo18(function HeaderTabs2({
|
|
|
4734
4746
|
onValueChange,
|
|
4735
4747
|
children
|
|
4736
4748
|
}) {
|
|
4737
|
-
var _a, _b;
|
|
4749
|
+
var _a, _b, _c, _d, _e;
|
|
4738
4750
|
const pathname = usePathname2();
|
|
4739
|
-
const
|
|
4740
|
-
|
|
4751
|
+
const normalizedPathname = pathname ? pathname.replace(/\/$/, "") : "";
|
|
4752
|
+
const matchedItem = normalizedPathname ? (_c = (_b = (_a = items.find(
|
|
4753
|
+
(item) => item.url.replace(/\/$/, "") === normalizedPathname
|
|
4754
|
+
)) != null ? _a : [...items].filter(
|
|
4755
|
+
(item) => normalizedPathname.startsWith(`${item.url.replace(/\/$/, "")}/`)
|
|
4756
|
+
).sort((a, b) => b.url.length - a.url.length)[0]) != null ? _b : items.find(
|
|
4757
|
+
(item) => normalizedPathname.split("/").pop() === item.value
|
|
4758
|
+
)) != null ? _c : items.find(
|
|
4759
|
+
(item) => normalizedPathname.endsWith(item.url.replace(/\/$/, ""))
|
|
4741
4760
|
) : void 0;
|
|
4742
|
-
const activeTab = (
|
|
4761
|
+
const activeTab = (_e = value != null ? value : matchedItem == null ? void 0 : matchedItem.value) != null ? _e : (_d = items[0]) == null ? void 0 : _d.value;
|
|
4743
4762
|
return /* @__PURE__ */ jsxs35(Tabs, { value: activeTab, onValueChange, className: "space-y-4", children: [
|
|
4744
4763
|
/* @__PURE__ */ jsx49("div", { className: "w-full overflow-x-auto overflow-y-hidden border-b no-scrollbar", children: /* @__PURE__ */ jsx49(TabsList, { variant: "line", className: "inline-flex w-max justify-start", children: items.map(({ title, value: tabValue, url, icon }) => /* @__PURE__ */ jsxs35(
|
|
4745
4764
|
TabsTrigger,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prediktif/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
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.
|