@prediktif/ui 0.1.16 → 0.1.17
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 +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +131 -9
- package/dist/index.mjs +132 -11
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -35,6 +35,22 @@ interface AppSidebarProps {
|
|
|
35
35
|
}
|
|
36
36
|
declare const AppSidebar: react.NamedExoticComponent<AppSidebarProps>;
|
|
37
37
|
|
|
38
|
+
interface HeaderTabItem {
|
|
39
|
+
title: string;
|
|
40
|
+
url: string;
|
|
41
|
+
value: string;
|
|
42
|
+
icon?: React.ComponentType<{
|
|
43
|
+
className?: string;
|
|
44
|
+
}> | ReactNode;
|
|
45
|
+
}
|
|
46
|
+
interface HeaderTabsProps {
|
|
47
|
+
items: HeaderTabItem[];
|
|
48
|
+
value?: string;
|
|
49
|
+
onValueChange?: (value: string) => void;
|
|
50
|
+
children?: ReactNode;
|
|
51
|
+
}
|
|
52
|
+
declare const HeaderTabs: react.NamedExoticComponent<HeaderTabsProps>;
|
|
53
|
+
|
|
38
54
|
interface HeaderTitleProps {
|
|
39
55
|
title: React.ReactNode;
|
|
40
56
|
subtitle: React.ReactNode;
|
|
@@ -42,4 +58,4 @@ interface HeaderTitleProps {
|
|
|
42
58
|
}
|
|
43
59
|
declare const HeaderTitle: react.NamedExoticComponent<HeaderTitleProps>;
|
|
44
60
|
|
|
45
|
-
export { AppSidebar, type AppSidebarProps, HeaderTitle, type HeaderTitleProps, type NavItem, type OrganizationItem };
|
|
61
|
+
export { AppSidebar, type AppSidebarProps, type HeaderTabItem, HeaderTabs, type HeaderTabsProps, HeaderTitle, type HeaderTitleProps, type NavItem, type OrganizationItem };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,22 @@ interface AppSidebarProps {
|
|
|
35
35
|
}
|
|
36
36
|
declare const AppSidebar: react.NamedExoticComponent<AppSidebarProps>;
|
|
37
37
|
|
|
38
|
+
interface HeaderTabItem {
|
|
39
|
+
title: string;
|
|
40
|
+
url: string;
|
|
41
|
+
value: string;
|
|
42
|
+
icon?: React.ComponentType<{
|
|
43
|
+
className?: string;
|
|
44
|
+
}> | ReactNode;
|
|
45
|
+
}
|
|
46
|
+
interface HeaderTabsProps {
|
|
47
|
+
items: HeaderTabItem[];
|
|
48
|
+
value?: string;
|
|
49
|
+
onValueChange?: (value: string) => void;
|
|
50
|
+
children?: ReactNode;
|
|
51
|
+
}
|
|
52
|
+
declare const HeaderTabs: react.NamedExoticComponent<HeaderTabsProps>;
|
|
53
|
+
|
|
38
54
|
interface HeaderTitleProps {
|
|
39
55
|
title: React.ReactNode;
|
|
40
56
|
subtitle: React.ReactNode;
|
|
@@ -42,4 +58,4 @@ interface HeaderTitleProps {
|
|
|
42
58
|
}
|
|
43
59
|
declare const HeaderTitle: react.NamedExoticComponent<HeaderTitleProps>;
|
|
44
60
|
|
|
45
|
-
export { AppSidebar, type AppSidebarProps, HeaderTitle, type HeaderTitleProps, type NavItem, type OrganizationItem };
|
|
61
|
+
export { AppSidebar, type AppSidebarProps, type HeaderTabItem, HeaderTabs, type HeaderTabsProps, HeaderTitle, type HeaderTitleProps, type NavItem, type OrganizationItem };
|
package/dist/index.js
CHANGED
|
@@ -61,6 +61,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
61
61
|
var index_exports = {};
|
|
62
62
|
__export(index_exports, {
|
|
63
63
|
AppSidebar: () => AppSidebar,
|
|
64
|
+
HeaderTabs: () => HeaderTabs,
|
|
64
65
|
HeaderTitle: () => HeaderTitle
|
|
65
66
|
});
|
|
66
67
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -1229,9 +1230,11 @@ function SidebarMenuBadge(_a) {
|
|
|
1229
1230
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1230
1231
|
function renderNavIcon(icon) {
|
|
1231
1232
|
if (!icon) return null;
|
|
1232
|
-
if (
|
|
1233
|
-
|
|
1234
|
-
|
|
1233
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
1234
|
+
const IconComp = icon;
|
|
1235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconComp, {});
|
|
1236
|
+
}
|
|
1237
|
+
return icon;
|
|
1235
1238
|
}
|
|
1236
1239
|
function formatSegment(segment, subHref, navMainItems = [], navSecondaryItems = []) {
|
|
1237
1240
|
if (subHref) {
|
|
@@ -1438,18 +1441,136 @@ var AppSidebar = (0, import_react.memo)(function AppSidebar2({
|
|
|
1438
1441
|
] });
|
|
1439
1442
|
});
|
|
1440
1443
|
|
|
1441
|
-
// src/components/composed/header-
|
|
1444
|
+
// src/components/composed/header-tabs.tsx
|
|
1445
|
+
var import_link2 = __toESM(require("next/link"));
|
|
1446
|
+
var import_navigation2 = require("next/navigation");
|
|
1442
1447
|
var import_react2 = require("react");
|
|
1448
|
+
|
|
1449
|
+
// src/components/ui/tabs.tsx
|
|
1450
|
+
var import_tabs = require("@base-ui/react/tabs");
|
|
1451
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
1452
|
+
var import_cn12 = require("cn");
|
|
1443
1453
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1444
|
-
|
|
1454
|
+
function Tabs(_a) {
|
|
1455
|
+
var _b = _a, {
|
|
1456
|
+
className,
|
|
1457
|
+
orientation = "horizontal"
|
|
1458
|
+
} = _b, props = __objRest(_b, [
|
|
1459
|
+
"className",
|
|
1460
|
+
"orientation"
|
|
1461
|
+
]);
|
|
1462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1463
|
+
import_tabs.Tabs.Root,
|
|
1464
|
+
__spreadValues({
|
|
1465
|
+
"data-slot": "tabs",
|
|
1466
|
+
"data-orientation": orientation,
|
|
1467
|
+
className: (0, import_cn12.cn)(
|
|
1468
|
+
"group/tabs flex gap-2 data-horizontal:flex-col",
|
|
1469
|
+
className
|
|
1470
|
+
)
|
|
1471
|
+
}, props)
|
|
1472
|
+
);
|
|
1473
|
+
}
|
|
1474
|
+
var tabsListVariants = (0, import_class_variance_authority3.cva)(
|
|
1475
|
+
"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",
|
|
1476
|
+
{
|
|
1477
|
+
variants: {
|
|
1478
|
+
variant: {
|
|
1479
|
+
default: "bg-muted",
|
|
1480
|
+
line: "gap-1 bg-transparent"
|
|
1481
|
+
}
|
|
1482
|
+
},
|
|
1483
|
+
defaultVariants: {
|
|
1484
|
+
variant: "default"
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
);
|
|
1488
|
+
function TabsList(_a) {
|
|
1489
|
+
var _b = _a, {
|
|
1490
|
+
className,
|
|
1491
|
+
variant = "default"
|
|
1492
|
+
} = _b, props = __objRest(_b, [
|
|
1493
|
+
"className",
|
|
1494
|
+
"variant"
|
|
1495
|
+
]);
|
|
1496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1497
|
+
import_tabs.Tabs.List,
|
|
1498
|
+
__spreadValues({
|
|
1499
|
+
"data-slot": "tabs-list",
|
|
1500
|
+
"data-variant": variant,
|
|
1501
|
+
className: (0, import_cn12.cn)(tabsListVariants({ variant }), className)
|
|
1502
|
+
}, props)
|
|
1503
|
+
);
|
|
1504
|
+
}
|
|
1505
|
+
function TabsTrigger(_a) {
|
|
1506
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1508
|
+
import_tabs.Tabs.Tab,
|
|
1509
|
+
__spreadValues({
|
|
1510
|
+
"data-slot": "tabs-trigger",
|
|
1511
|
+
className: (0, import_cn12.cn)(
|
|
1512
|
+
"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",
|
|
1513
|
+
"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",
|
|
1514
|
+
"data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
1515
|
+
"after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
1516
|
+
className
|
|
1517
|
+
)
|
|
1518
|
+
}, props)
|
|
1519
|
+
);
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
// src/components/composed/header-tabs.tsx
|
|
1523
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1524
|
+
function renderTabIcon(icon) {
|
|
1525
|
+
if (!icon) return null;
|
|
1526
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
1527
|
+
const IconComp = icon;
|
|
1528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconComp, {});
|
|
1529
|
+
}
|
|
1530
|
+
return icon;
|
|
1531
|
+
}
|
|
1532
|
+
var HeaderTabs = (0, import_react2.memo)(function HeaderTabs2({
|
|
1533
|
+
items,
|
|
1534
|
+
value,
|
|
1535
|
+
onValueChange,
|
|
1536
|
+
children
|
|
1537
|
+
}) {
|
|
1538
|
+
var _a, _b;
|
|
1539
|
+
const pathname = (0, import_navigation2.usePathname)();
|
|
1540
|
+
const matchedItem = pathname ? items.find(
|
|
1541
|
+
(item) => item.url === pathname || pathname.endsWith(item.url) || pathname.split("/").includes(item.value)
|
|
1542
|
+
) : void 0;
|
|
1543
|
+
const activeTab = (_b = value != null ? value : matchedItem == null ? void 0 : matchedItem.value) != null ? _b : (_a = items[0]) == null ? void 0 : _a.value;
|
|
1544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Tabs, { value: activeTab, onValueChange, className: "space-y-4", children: [
|
|
1545
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w-full overflow-x-auto overflow-y-hidden border-b no-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabsList, { variant: "line", className: "inline-flex w-max justify-start", children: items.map(({ title, value: tabValue, url, icon }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1546
|
+
TabsTrigger,
|
|
1547
|
+
{
|
|
1548
|
+
nativeButton: false,
|
|
1549
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_link2.default, { href: url }),
|
|
1550
|
+
value: tabValue,
|
|
1551
|
+
children: [
|
|
1552
|
+
renderTabIcon(icon),
|
|
1553
|
+
title
|
|
1554
|
+
]
|
|
1555
|
+
},
|
|
1556
|
+
tabValue
|
|
1557
|
+
)) }) }),
|
|
1558
|
+
children
|
|
1559
|
+
] });
|
|
1560
|
+
});
|
|
1561
|
+
|
|
1562
|
+
// src/components/composed/header-title.tsx
|
|
1563
|
+
var import_react3 = require("react");
|
|
1564
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1565
|
+
var HeaderTitle = (0, import_react3.memo)(function HeaderTitle2({
|
|
1445
1566
|
title,
|
|
1446
1567
|
subtitle,
|
|
1447
1568
|
children
|
|
1448
1569
|
}) {
|
|
1449
|
-
return /* @__PURE__ */ (0,
|
|
1450
|
-
/* @__PURE__ */ (0,
|
|
1451
|
-
/* @__PURE__ */ (0,
|
|
1452
|
-
/* @__PURE__ */ (0,
|
|
1570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w-full space-y-4", children: [
|
|
1571
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
|
|
1572
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h1", { className: "font-semibold", children: title }),
|
|
1573
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-xs text-muted-foreground", children: subtitle })
|
|
1453
1574
|
] }),
|
|
1454
1575
|
children
|
|
1455
1576
|
] });
|
|
@@ -1457,5 +1578,6 @@ var HeaderTitle = (0, import_react2.memo)(function HeaderTitle2({
|
|
|
1457
1578
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1458
1579
|
0 && (module.exports = {
|
|
1459
1580
|
AppSidebar,
|
|
1581
|
+
HeaderTabs,
|
|
1460
1582
|
HeaderTitle
|
|
1461
1583
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -35,7 +35,7 @@ var __objRest = (source, exclude) => {
|
|
|
35
35
|
import { ChevronsUpDown, Command, LockIcon } from "lucide-react";
|
|
36
36
|
import Link from "next/link";
|
|
37
37
|
import { usePathname } from "next/navigation";
|
|
38
|
-
import {
|
|
38
|
+
import { memo } from "react";
|
|
39
39
|
|
|
40
40
|
// src/components/ui/alert-dialog.tsx
|
|
41
41
|
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
@@ -1195,9 +1195,11 @@ function SidebarMenuBadge(_a) {
|
|
|
1195
1195
|
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1196
1196
|
function renderNavIcon(icon) {
|
|
1197
1197
|
if (!icon) return null;
|
|
1198
|
-
if (
|
|
1199
|
-
|
|
1200
|
-
|
|
1198
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
1199
|
+
const IconComp = icon;
|
|
1200
|
+
return /* @__PURE__ */ jsx12(IconComp, {});
|
|
1201
|
+
}
|
|
1202
|
+
return icon;
|
|
1201
1203
|
}
|
|
1202
1204
|
function formatSegment(segment, subHref, navMainItems = [], navSecondaryItems = []) {
|
|
1203
1205
|
if (subHref) {
|
|
@@ -1404,23 +1406,142 @@ var AppSidebar = memo(function AppSidebar2({
|
|
|
1404
1406
|
] });
|
|
1405
1407
|
});
|
|
1406
1408
|
|
|
1407
|
-
// src/components/composed/header-
|
|
1409
|
+
// src/components/composed/header-tabs.tsx
|
|
1410
|
+
import Link2 from "next/link";
|
|
1411
|
+
import { usePathname as usePathname2 } from "next/navigation";
|
|
1408
1412
|
import { memo as memo2 } from "react";
|
|
1409
|
-
|
|
1410
|
-
|
|
1413
|
+
|
|
1414
|
+
// src/components/ui/tabs.tsx
|
|
1415
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
1416
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
1417
|
+
import { cn as cn12 } from "cn";
|
|
1418
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1419
|
+
function Tabs(_a) {
|
|
1420
|
+
var _b = _a, {
|
|
1421
|
+
className,
|
|
1422
|
+
orientation = "horizontal"
|
|
1423
|
+
} = _b, props = __objRest(_b, [
|
|
1424
|
+
"className",
|
|
1425
|
+
"orientation"
|
|
1426
|
+
]);
|
|
1427
|
+
return /* @__PURE__ */ jsx13(
|
|
1428
|
+
TabsPrimitive.Root,
|
|
1429
|
+
__spreadValues({
|
|
1430
|
+
"data-slot": "tabs",
|
|
1431
|
+
"data-orientation": orientation,
|
|
1432
|
+
className: cn12(
|
|
1433
|
+
"group/tabs flex gap-2 data-horizontal:flex-col",
|
|
1434
|
+
className
|
|
1435
|
+
)
|
|
1436
|
+
}, props)
|
|
1437
|
+
);
|
|
1438
|
+
}
|
|
1439
|
+
var tabsListVariants = cva3(
|
|
1440
|
+
"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",
|
|
1441
|
+
{
|
|
1442
|
+
variants: {
|
|
1443
|
+
variant: {
|
|
1444
|
+
default: "bg-muted",
|
|
1445
|
+
line: "gap-1 bg-transparent"
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1448
|
+
defaultVariants: {
|
|
1449
|
+
variant: "default"
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
);
|
|
1453
|
+
function TabsList(_a) {
|
|
1454
|
+
var _b = _a, {
|
|
1455
|
+
className,
|
|
1456
|
+
variant = "default"
|
|
1457
|
+
} = _b, props = __objRest(_b, [
|
|
1458
|
+
"className",
|
|
1459
|
+
"variant"
|
|
1460
|
+
]);
|
|
1461
|
+
return /* @__PURE__ */ jsx13(
|
|
1462
|
+
TabsPrimitive.List,
|
|
1463
|
+
__spreadValues({
|
|
1464
|
+
"data-slot": "tabs-list",
|
|
1465
|
+
"data-variant": variant,
|
|
1466
|
+
className: cn12(tabsListVariants({ variant }), className)
|
|
1467
|
+
}, props)
|
|
1468
|
+
);
|
|
1469
|
+
}
|
|
1470
|
+
function TabsTrigger(_a) {
|
|
1471
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1472
|
+
return /* @__PURE__ */ jsx13(
|
|
1473
|
+
TabsPrimitive.Tab,
|
|
1474
|
+
__spreadValues({
|
|
1475
|
+
"data-slot": "tabs-trigger",
|
|
1476
|
+
className: cn12(
|
|
1477
|
+
"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",
|
|
1478
|
+
"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",
|
|
1479
|
+
"data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
1480
|
+
"after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
1481
|
+
className
|
|
1482
|
+
)
|
|
1483
|
+
}, props)
|
|
1484
|
+
);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
// src/components/composed/header-tabs.tsx
|
|
1488
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1489
|
+
function renderTabIcon(icon) {
|
|
1490
|
+
if (!icon) return null;
|
|
1491
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
1492
|
+
const IconComp = icon;
|
|
1493
|
+
return /* @__PURE__ */ jsx14(IconComp, {});
|
|
1494
|
+
}
|
|
1495
|
+
return icon;
|
|
1496
|
+
}
|
|
1497
|
+
var HeaderTabs = memo2(function HeaderTabs2({
|
|
1498
|
+
items,
|
|
1499
|
+
value,
|
|
1500
|
+
onValueChange,
|
|
1501
|
+
children
|
|
1502
|
+
}) {
|
|
1503
|
+
var _a, _b;
|
|
1504
|
+
const pathname = usePathname2();
|
|
1505
|
+
const matchedItem = pathname ? items.find(
|
|
1506
|
+
(item) => item.url === pathname || pathname.endsWith(item.url) || pathname.split("/").includes(item.value)
|
|
1507
|
+
) : void 0;
|
|
1508
|
+
const activeTab = (_b = value != null ? value : matchedItem == null ? void 0 : matchedItem.value) != null ? _b : (_a = items[0]) == null ? void 0 : _a.value;
|
|
1509
|
+
return /* @__PURE__ */ jsxs8(Tabs, { value: activeTab, onValueChange, className: "space-y-4", children: [
|
|
1510
|
+
/* @__PURE__ */ jsx14("div", { className: "w-full overflow-x-auto overflow-y-hidden border-b no-scrollbar", children: /* @__PURE__ */ jsx14(TabsList, { variant: "line", className: "inline-flex w-max justify-start", children: items.map(({ title, value: tabValue, url, icon }) => /* @__PURE__ */ jsxs8(
|
|
1511
|
+
TabsTrigger,
|
|
1512
|
+
{
|
|
1513
|
+
nativeButton: false,
|
|
1514
|
+
render: /* @__PURE__ */ jsx14(Link2, { href: url }),
|
|
1515
|
+
value: tabValue,
|
|
1516
|
+
children: [
|
|
1517
|
+
renderTabIcon(icon),
|
|
1518
|
+
title
|
|
1519
|
+
]
|
|
1520
|
+
},
|
|
1521
|
+
tabValue
|
|
1522
|
+
)) }) }),
|
|
1523
|
+
children
|
|
1524
|
+
] });
|
|
1525
|
+
});
|
|
1526
|
+
|
|
1527
|
+
// src/components/composed/header-title.tsx
|
|
1528
|
+
import { memo as memo3 } from "react";
|
|
1529
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1530
|
+
var HeaderTitle = memo3(function HeaderTitle2({
|
|
1411
1531
|
title,
|
|
1412
1532
|
subtitle,
|
|
1413
1533
|
children
|
|
1414
1534
|
}) {
|
|
1415
|
-
return /* @__PURE__ */
|
|
1416
|
-
/* @__PURE__ */
|
|
1417
|
-
/* @__PURE__ */
|
|
1418
|
-
/* @__PURE__ */
|
|
1535
|
+
return /* @__PURE__ */ jsxs9("div", { className: "w-full space-y-4", children: [
|
|
1536
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
1537
|
+
/* @__PURE__ */ jsx15("h1", { className: "font-semibold", children: title }),
|
|
1538
|
+
/* @__PURE__ */ jsx15("p", { className: "text-xs text-muted-foreground", children: subtitle })
|
|
1419
1539
|
] }),
|
|
1420
1540
|
children
|
|
1421
1541
|
] });
|
|
1422
1542
|
});
|
|
1423
1543
|
export {
|
|
1424
1544
|
AppSidebar,
|
|
1545
|
+
HeaderTabs,
|
|
1425
1546
|
HeaderTitle
|
|
1426
1547
|
};
|