@prediktif/ui 0.1.9 → 0.1.10
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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -4
- package/dist/index.mjs +11 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4,16 +4,16 @@ import { ReactNode } from 'react';
|
|
|
4
4
|
interface NavItem {
|
|
5
5
|
title: string;
|
|
6
6
|
url: string;
|
|
7
|
-
icon
|
|
7
|
+
icon?: React.ComponentType<{
|
|
8
8
|
className?: string;
|
|
9
|
-
}
|
|
9
|
+
}> | ReactNode;
|
|
10
10
|
locked?: boolean;
|
|
11
11
|
}
|
|
12
12
|
interface OrganizationItem {
|
|
13
13
|
name: string;
|
|
14
14
|
logo?: React.ComponentType<{
|
|
15
15
|
className?: string;
|
|
16
|
-
}
|
|
16
|
+
}> | ReactNode;
|
|
17
17
|
plan?: string;
|
|
18
18
|
}
|
|
19
19
|
interface AppSidebarProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -4,16 +4,16 @@ import { ReactNode } from 'react';
|
|
|
4
4
|
interface NavItem {
|
|
5
5
|
title: string;
|
|
6
6
|
url: string;
|
|
7
|
-
icon
|
|
7
|
+
icon?: React.ComponentType<{
|
|
8
8
|
className?: string;
|
|
9
|
-
}
|
|
9
|
+
}> | ReactNode;
|
|
10
10
|
locked?: boolean;
|
|
11
11
|
}
|
|
12
12
|
interface OrganizationItem {
|
|
13
13
|
name: string;
|
|
14
14
|
logo?: React.ComponentType<{
|
|
15
15
|
className?: string;
|
|
16
|
-
}
|
|
16
|
+
}> | ReactNode;
|
|
17
17
|
plan?: string;
|
|
18
18
|
}
|
|
19
19
|
interface AppSidebarProps {
|
package/dist/index.js
CHANGED
|
@@ -1227,6 +1227,12 @@ function SidebarMenuBadge(_a) {
|
|
|
1227
1227
|
|
|
1228
1228
|
// src/components/composed/app-sidebar.tsx
|
|
1229
1229
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1230
|
+
function renderNavIcon(icon) {
|
|
1231
|
+
if (!icon) return null;
|
|
1232
|
+
if ((0, import_react.isValidElement)(icon)) return icon;
|
|
1233
|
+
const IconComponent = icon;
|
|
1234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconComponent, {});
|
|
1235
|
+
}
|
|
1230
1236
|
function formatSegment(segment, subHref, navMainItems = [], navSecondaryItems = []) {
|
|
1231
1237
|
if (subHref) {
|
|
1232
1238
|
const matched = [...navMainItems, ...navSecondaryItems].find(
|
|
@@ -1322,7 +1328,7 @@ var AppSidebar = (0, import_react.memo)(function AppSidebar2({
|
|
|
1322
1328
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SidebarContent, { children: [
|
|
1323
1329
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SidebarGroup, { children: [
|
|
1324
1330
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarGroupLabel, { children: "Platform" }),
|
|
1325
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenu, { children: navMainItems.map(({ title, url, icon
|
|
1331
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenu, { children: navMainItems.map(({ title, url, icon, locked }) => {
|
|
1326
1332
|
const isActive = isRouteActive(url, pathname);
|
|
1327
1333
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SidebarMenuItem, { children: [
|
|
1328
1334
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
@@ -1332,7 +1338,7 @@ var AppSidebar = (0, import_react.memo)(function AppSidebar2({
|
|
|
1332
1338
|
tooltip: title,
|
|
1333
1339
|
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_link.default, { href: url }),
|
|
1334
1340
|
children: [
|
|
1335
|
-
|
|
1341
|
+
renderNavIcon(icon),
|
|
1336
1342
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: title })
|
|
1337
1343
|
]
|
|
1338
1344
|
}
|
|
@@ -1341,7 +1347,7 @@ var AppSidebar = (0, import_react.memo)(function AppSidebar2({
|
|
|
1341
1347
|
] }, title);
|
|
1342
1348
|
}) })
|
|
1343
1349
|
] }),
|
|
1344
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarGroup, { className: "mt-auto", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarGroupContent, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenu, { children: navSecondaryItems.map(({ title, url, icon
|
|
1350
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarGroup, { className: "mt-auto", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarGroupContent, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarMenu, { children: navSecondaryItems.map(({ title, url, icon, locked }) => {
|
|
1345
1351
|
const isActive = isRouteActive(url, pathname);
|
|
1346
1352
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SidebarMenuItem, { children: [
|
|
1347
1353
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
@@ -1352,7 +1358,7 @@ var AppSidebar = (0, import_react.memo)(function AppSidebar2({
|
|
|
1352
1358
|
tooltip: title,
|
|
1353
1359
|
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_link.default, { href: url }),
|
|
1354
1360
|
children: [
|
|
1355
|
-
|
|
1361
|
+
renderNavIcon(icon),
|
|
1356
1362
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: title })
|
|
1357
1363
|
]
|
|
1358
1364
|
}
|
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 { memo } from "react";
|
|
38
|
+
import { isValidElement, 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";
|
|
@@ -1193,6 +1193,12 @@ function SidebarMenuBadge(_a) {
|
|
|
1193
1193
|
|
|
1194
1194
|
// src/components/composed/app-sidebar.tsx
|
|
1195
1195
|
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1196
|
+
function renderNavIcon(icon) {
|
|
1197
|
+
if (!icon) return null;
|
|
1198
|
+
if (isValidElement(icon)) return icon;
|
|
1199
|
+
const IconComponent = icon;
|
|
1200
|
+
return /* @__PURE__ */ jsx12(IconComponent, {});
|
|
1201
|
+
}
|
|
1196
1202
|
function formatSegment(segment, subHref, navMainItems = [], navSecondaryItems = []) {
|
|
1197
1203
|
if (subHref) {
|
|
1198
1204
|
const matched = [...navMainItems, ...navSecondaryItems].find(
|
|
@@ -1288,7 +1294,7 @@ var AppSidebar = memo(function AppSidebar2({
|
|
|
1288
1294
|
/* @__PURE__ */ jsxs7(SidebarContent, { children: [
|
|
1289
1295
|
/* @__PURE__ */ jsxs7(SidebarGroup, { children: [
|
|
1290
1296
|
/* @__PURE__ */ jsx12(SidebarGroupLabel, { children: "Platform" }),
|
|
1291
|
-
/* @__PURE__ */ jsx12(SidebarMenu, { children: navMainItems.map(({ title, url, icon
|
|
1297
|
+
/* @__PURE__ */ jsx12(SidebarMenu, { children: navMainItems.map(({ title, url, icon, locked }) => {
|
|
1292
1298
|
const isActive = isRouteActive(url, pathname);
|
|
1293
1299
|
return /* @__PURE__ */ jsxs7(SidebarMenuItem, { children: [
|
|
1294
1300
|
/* @__PURE__ */ jsxs7(
|
|
@@ -1298,7 +1304,7 @@ var AppSidebar = memo(function AppSidebar2({
|
|
|
1298
1304
|
tooltip: title,
|
|
1299
1305
|
render: /* @__PURE__ */ jsx12(Link, { href: url }),
|
|
1300
1306
|
children: [
|
|
1301
|
-
|
|
1307
|
+
renderNavIcon(icon),
|
|
1302
1308
|
/* @__PURE__ */ jsx12("span", { children: title })
|
|
1303
1309
|
]
|
|
1304
1310
|
}
|
|
@@ -1307,7 +1313,7 @@ var AppSidebar = memo(function AppSidebar2({
|
|
|
1307
1313
|
] }, title);
|
|
1308
1314
|
}) })
|
|
1309
1315
|
] }),
|
|
1310
|
-
/* @__PURE__ */ jsx12(SidebarGroup, { className: "mt-auto", children: /* @__PURE__ */ jsx12(SidebarGroupContent, { children: /* @__PURE__ */ jsx12(SidebarMenu, { children: navSecondaryItems.map(({ title, url, icon
|
|
1316
|
+
/* @__PURE__ */ jsx12(SidebarGroup, { className: "mt-auto", children: /* @__PURE__ */ jsx12(SidebarGroupContent, { children: /* @__PURE__ */ jsx12(SidebarMenu, { children: navSecondaryItems.map(({ title, url, icon, locked }) => {
|
|
1311
1317
|
const isActive = isRouteActive(url, pathname);
|
|
1312
1318
|
return /* @__PURE__ */ jsxs7(SidebarMenuItem, { children: [
|
|
1313
1319
|
/* @__PURE__ */ jsxs7(
|
|
@@ -1318,7 +1324,7 @@ var AppSidebar = memo(function AppSidebar2({
|
|
|
1318
1324
|
tooltip: title,
|
|
1319
1325
|
render: /* @__PURE__ */ jsx12(Link, { href: url }),
|
|
1320
1326
|
children: [
|
|
1321
|
-
|
|
1327
|
+
renderNavIcon(icon),
|
|
1322
1328
|
/* @__PURE__ */ jsx12("span", { children: title })
|
|
1323
1329
|
]
|
|
1324
1330
|
}
|