@almadar/ui 4.54.14 → 4.55.0
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/avl/index.cjs +136 -34
- package/dist/avl/index.js +136 -34
- package/dist/components/index.cjs +121 -6
- package/dist/components/index.js +121 -6
- package/dist/components/templates/DashboardLayout.d.ts +6 -0
- package/dist/providers/index.cjs +121 -6
- package/dist/providers/index.js +121 -6
- package/dist/runtime/index.cjs +121 -6
- package/dist/runtime/index.js +121 -6
- package/package.json +1 -1
package/dist/providers/index.js
CHANGED
|
@@ -21513,7 +21513,7 @@ var init_CurrentPagePathContext = __esm({
|
|
|
21513
21513
|
useCurrentPagePath = () => useContext(CurrentPagePathContext);
|
|
21514
21514
|
}
|
|
21515
21515
|
});
|
|
21516
|
-
var DashboardLayout, NavLink;
|
|
21516
|
+
var DashboardLayout, NavLink, NavLinkTopnav, NavLinkBottom;
|
|
21517
21517
|
var init_DashboardLayout = __esm({
|
|
21518
21518
|
"components/templates/DashboardLayout.tsx"() {
|
|
21519
21519
|
"use client";
|
|
@@ -21544,6 +21544,7 @@ var init_DashboardLayout = __esm({
|
|
|
21544
21544
|
sidebarFooter,
|
|
21545
21545
|
onSignOut: onSignOutProp,
|
|
21546
21546
|
currentPath,
|
|
21547
|
+
layoutMode = "sidebar",
|
|
21547
21548
|
children
|
|
21548
21549
|
}) => {
|
|
21549
21550
|
const eventBus = useEventBus();
|
|
@@ -21570,20 +21571,24 @@ var init_DashboardLayout = __esm({
|
|
|
21570
21571
|
const user = userProp || (null);
|
|
21571
21572
|
const { t } = useTranslate();
|
|
21572
21573
|
const handleSignOut = onSignOutProp || authSignOut;
|
|
21574
|
+
const showSidebar = layoutMode === "sidebar";
|
|
21575
|
+
const showHeader = layoutMode !== "minimal";
|
|
21576
|
+
const showBottomNav = layoutMode === "bottomnav";
|
|
21577
|
+
const isTopNav = layoutMode === "topnav";
|
|
21573
21578
|
return /* @__PURE__ */ jsxs(
|
|
21574
21579
|
HStack,
|
|
21575
21580
|
{
|
|
21576
21581
|
gap: "none",
|
|
21577
21582
|
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21578
21583
|
children: [
|
|
21579
|
-
sidebarOpen && /* @__PURE__ */ jsx(
|
|
21584
|
+
showSidebar && sidebarOpen && /* @__PURE__ */ jsx(
|
|
21580
21585
|
Box,
|
|
21581
21586
|
{
|
|
21582
21587
|
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 @lg/dashboard:hidden",
|
|
21583
21588
|
onClick: () => setSidebarOpen(false)
|
|
21584
21589
|
}
|
|
21585
21590
|
),
|
|
21586
|
-
/* @__PURE__ */ jsxs(
|
|
21591
|
+
showSidebar && /* @__PURE__ */ jsxs(
|
|
21587
21592
|
Box,
|
|
21588
21593
|
{
|
|
21589
21594
|
as: "aside",
|
|
@@ -21655,7 +21660,7 @@ var init_DashboardLayout = __esm({
|
|
|
21655
21660
|
}
|
|
21656
21661
|
),
|
|
21657
21662
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0 min-h-screen", children: [
|
|
21658
|
-
/* @__PURE__ */ jsx(
|
|
21663
|
+
showHeader && /* @__PURE__ */ jsx(
|
|
21659
21664
|
Box,
|
|
21660
21665
|
{
|
|
21661
21666
|
as: "header",
|
|
@@ -21667,7 +21672,7 @@ var init_DashboardLayout = __esm({
|
|
|
21667
21672
|
justify: "between",
|
|
21668
21673
|
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
21669
21674
|
children: [
|
|
21670
|
-
/* @__PURE__ */ jsx(
|
|
21675
|
+
showSidebar && /* @__PURE__ */ jsx(
|
|
21671
21676
|
Button,
|
|
21672
21677
|
{
|
|
21673
21678
|
variant: "ghost",
|
|
@@ -21677,6 +21682,45 @@ var init_DashboardLayout = __esm({
|
|
|
21677
21682
|
children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
|
|
21678
21683
|
}
|
|
21679
21684
|
),
|
|
21685
|
+
isTopNav && /* @__PURE__ */ jsxs(
|
|
21686
|
+
HStack,
|
|
21687
|
+
{
|
|
21688
|
+
as: "nav",
|
|
21689
|
+
align: "center",
|
|
21690
|
+
gap: "none",
|
|
21691
|
+
className: "hidden @md/dashboard:flex items-center gap-1 overflow-x-auto",
|
|
21692
|
+
children: [
|
|
21693
|
+
/* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2 mr-3 shrink-0", children: [
|
|
21694
|
+
logo || /* @__PURE__ */ jsx(Box, { className: "w-7 h-7 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
21695
|
+
Typography,
|
|
21696
|
+
{
|
|
21697
|
+
variant: "small",
|
|
21698
|
+
className: "text-white font-bold text-xs",
|
|
21699
|
+
as: "span",
|
|
21700
|
+
children: appName.charAt(0).toUpperCase()
|
|
21701
|
+
}
|
|
21702
|
+
) }),
|
|
21703
|
+
/* @__PURE__ */ jsx(
|
|
21704
|
+
Typography,
|
|
21705
|
+
{
|
|
21706
|
+
variant: "label",
|
|
21707
|
+
className: "font-semibold text-foreground dark:text-foreground",
|
|
21708
|
+
as: "span",
|
|
21709
|
+
children: appName
|
|
21710
|
+
}
|
|
21711
|
+
)
|
|
21712
|
+
] }),
|
|
21713
|
+
navItems.map((item) => /* @__PURE__ */ jsx(
|
|
21714
|
+
NavLinkTopnav,
|
|
21715
|
+
{
|
|
21716
|
+
item,
|
|
21717
|
+
currentPath: activePath
|
|
21718
|
+
},
|
|
21719
|
+
item.href
|
|
21720
|
+
))
|
|
21721
|
+
]
|
|
21722
|
+
}
|
|
21723
|
+
),
|
|
21680
21724
|
searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden @sm/dashboard:block flex-1 min-w-0 @xl/dashboard:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
|
|
21681
21725
|
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
|
|
21682
21726
|
/* @__PURE__ */ jsx(
|
|
@@ -21824,7 +21868,22 @@ var init_DashboardLayout = __esm({
|
|
|
21824
21868
|
)
|
|
21825
21869
|
}
|
|
21826
21870
|
),
|
|
21827
|
-
/* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children })
|
|
21871
|
+
/* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children }),
|
|
21872
|
+
showBottomNav && /* @__PURE__ */ jsx(
|
|
21873
|
+
Box,
|
|
21874
|
+
{
|
|
21875
|
+
as: "nav",
|
|
21876
|
+
className: "sticky bottom-0 z-20 h-16 bg-card dark:bg-card border-t border-border dark:border-border @md/dashboard:hidden",
|
|
21877
|
+
children: /* @__PURE__ */ jsx(HStack, { align: "center", justify: "around", className: "h-full px-2", children: navItems.map((item) => /* @__PURE__ */ jsx(
|
|
21878
|
+
NavLinkBottom,
|
|
21879
|
+
{
|
|
21880
|
+
item,
|
|
21881
|
+
currentPath: activePath
|
|
21882
|
+
},
|
|
21883
|
+
item.href
|
|
21884
|
+
)) })
|
|
21885
|
+
}
|
|
21886
|
+
)
|
|
21828
21887
|
] })
|
|
21829
21888
|
]
|
|
21830
21889
|
}
|
|
@@ -21866,6 +21925,62 @@ var init_DashboardLayout = __esm({
|
|
|
21866
21925
|
);
|
|
21867
21926
|
};
|
|
21868
21927
|
NavLink.displayName = "NavLink";
|
|
21928
|
+
NavLinkTopnav = ({
|
|
21929
|
+
item,
|
|
21930
|
+
currentPath
|
|
21931
|
+
}) => {
|
|
21932
|
+
const isActive = currentPath === item.href || currentPath.startsWith(item.href + "/");
|
|
21933
|
+
return /* @__PURE__ */ jsxs(
|
|
21934
|
+
Link,
|
|
21935
|
+
{
|
|
21936
|
+
to: item.href,
|
|
21937
|
+
className: cn(
|
|
21938
|
+
"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors whitespace-nowrap",
|
|
21939
|
+
isActive ? "bg-primary text-primary-foreground shadow-sm" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
21940
|
+
),
|
|
21941
|
+
children: [
|
|
21942
|
+
item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, className: "h-4 w-4" }) : /* @__PURE__ */ jsx(item.icon, { className: "h-4 w-4" })),
|
|
21943
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "flex-1", as: "span", children: item.label }),
|
|
21944
|
+
item.badge && /* @__PURE__ */ jsx(Badge, { variant: isActive ? "primary" : "default", size: "sm", children: item.badge })
|
|
21945
|
+
]
|
|
21946
|
+
}
|
|
21947
|
+
);
|
|
21948
|
+
};
|
|
21949
|
+
NavLinkTopnav.displayName = "NavLinkTopnav";
|
|
21950
|
+
NavLinkBottom = ({
|
|
21951
|
+
item,
|
|
21952
|
+
currentPath
|
|
21953
|
+
}) => {
|
|
21954
|
+
const isActive = currentPath === item.href || currentPath.startsWith(item.href + "/");
|
|
21955
|
+
const iconClassName = cn(
|
|
21956
|
+
"h-5 w-5",
|
|
21957
|
+
isActive ? "text-primary" : "text-muted-foreground"
|
|
21958
|
+
);
|
|
21959
|
+
return /* @__PURE__ */ jsxs(
|
|
21960
|
+
Link,
|
|
21961
|
+
{
|
|
21962
|
+
to: item.href,
|
|
21963
|
+
className: "flex flex-col items-center justify-center gap-0.5 px-2 py-1 rounded-lg transition-colors flex-1 min-w-0",
|
|
21964
|
+
children: [
|
|
21965
|
+
item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, className: iconClassName }) : /* @__PURE__ */ jsx(item.icon, { className: iconClassName })),
|
|
21966
|
+
/* @__PURE__ */ jsx(
|
|
21967
|
+
Typography,
|
|
21968
|
+
{
|
|
21969
|
+
variant: "caption",
|
|
21970
|
+
className: cn(
|
|
21971
|
+
"text-[10px] leading-tight truncate max-w-full",
|
|
21972
|
+
isActive ? "text-primary font-medium" : "text-muted-foreground"
|
|
21973
|
+
),
|
|
21974
|
+
as: "span",
|
|
21975
|
+
children: item.label
|
|
21976
|
+
}
|
|
21977
|
+
),
|
|
21978
|
+
item.badge && /* @__PURE__ */ jsx(Badge, { variant: isActive ? "primary" : "default", size: "sm", className: "text-[8px] px-1 py-0 min-w-0", children: item.badge })
|
|
21979
|
+
]
|
|
21980
|
+
}
|
|
21981
|
+
);
|
|
21982
|
+
};
|
|
21983
|
+
NavLinkBottom.displayName = "NavLinkBottom";
|
|
21869
21984
|
}
|
|
21870
21985
|
});
|
|
21871
21986
|
function useAlmadarDndSensors(withSortableKeyboard = true) {
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -21328,7 +21328,7 @@ var init_CurrentPagePathContext = __esm({
|
|
|
21328
21328
|
useCurrentPagePath = () => React83.useContext(CurrentPagePathContext);
|
|
21329
21329
|
}
|
|
21330
21330
|
});
|
|
21331
|
-
var DashboardLayout, NavLink;
|
|
21331
|
+
var DashboardLayout, NavLink, NavLinkTopnav, NavLinkBottom;
|
|
21332
21332
|
var init_DashboardLayout = __esm({
|
|
21333
21333
|
"components/templates/DashboardLayout.tsx"() {
|
|
21334
21334
|
"use client";
|
|
@@ -21359,6 +21359,7 @@ var init_DashboardLayout = __esm({
|
|
|
21359
21359
|
sidebarFooter,
|
|
21360
21360
|
onSignOut: onSignOutProp,
|
|
21361
21361
|
currentPath,
|
|
21362
|
+
layoutMode = "sidebar",
|
|
21362
21363
|
children
|
|
21363
21364
|
}) => {
|
|
21364
21365
|
const eventBus = useEventBus();
|
|
@@ -21385,20 +21386,24 @@ var init_DashboardLayout = __esm({
|
|
|
21385
21386
|
const user = userProp || (null);
|
|
21386
21387
|
const { t } = useTranslate();
|
|
21387
21388
|
const handleSignOut = onSignOutProp || authSignOut;
|
|
21389
|
+
const showSidebar = layoutMode === "sidebar";
|
|
21390
|
+
const showHeader = layoutMode !== "minimal";
|
|
21391
|
+
const showBottomNav = layoutMode === "bottomnav";
|
|
21392
|
+
const isTopNav = layoutMode === "topnav";
|
|
21388
21393
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21389
21394
|
HStack,
|
|
21390
21395
|
{
|
|
21391
21396
|
gap: "none",
|
|
21392
21397
|
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21393
21398
|
children: [
|
|
21394
|
-
sidebarOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21399
|
+
showSidebar && sidebarOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21395
21400
|
Box,
|
|
21396
21401
|
{
|
|
21397
21402
|
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 @lg/dashboard:hidden",
|
|
21398
21403
|
onClick: () => setSidebarOpen(false)
|
|
21399
21404
|
}
|
|
21400
21405
|
),
|
|
21401
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
21406
|
+
showSidebar && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21402
21407
|
Box,
|
|
21403
21408
|
{
|
|
21404
21409
|
as: "aside",
|
|
@@ -21470,7 +21475,7 @@ var init_DashboardLayout = __esm({
|
|
|
21470
21475
|
}
|
|
21471
21476
|
),
|
|
21472
21477
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "none", className: "flex-1 min-w-0 min-h-screen", children: [
|
|
21473
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21478
|
+
showHeader && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21474
21479
|
Box,
|
|
21475
21480
|
{
|
|
21476
21481
|
as: "header",
|
|
@@ -21482,7 +21487,7 @@ var init_DashboardLayout = __esm({
|
|
|
21482
21487
|
justify: "between",
|
|
21483
21488
|
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
21484
21489
|
children: [
|
|
21485
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21490
|
+
showSidebar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21486
21491
|
Button,
|
|
21487
21492
|
{
|
|
21488
21493
|
variant: "ghost",
|
|
@@ -21492,6 +21497,45 @@ var init_DashboardLayout = __esm({
|
|
|
21492
21497
|
children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Menu, { className: "h-5 w-5" })
|
|
21493
21498
|
}
|
|
21494
21499
|
),
|
|
21500
|
+
isTopNav && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21501
|
+
HStack,
|
|
21502
|
+
{
|
|
21503
|
+
as: "nav",
|
|
21504
|
+
align: "center",
|
|
21505
|
+
gap: "none",
|
|
21506
|
+
className: "hidden @md/dashboard:flex items-center gap-1 overflow-x-auto",
|
|
21507
|
+
children: [
|
|
21508
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Link, { to: "/", className: "flex items-center gap-2 mr-3 shrink-0", children: [
|
|
21509
|
+
logo || /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-7 h-7 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
21510
|
+
Typography,
|
|
21511
|
+
{
|
|
21512
|
+
variant: "small",
|
|
21513
|
+
className: "text-white font-bold text-xs",
|
|
21514
|
+
as: "span",
|
|
21515
|
+
children: appName.charAt(0).toUpperCase()
|
|
21516
|
+
}
|
|
21517
|
+
) }),
|
|
21518
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21519
|
+
Typography,
|
|
21520
|
+
{
|
|
21521
|
+
variant: "label",
|
|
21522
|
+
className: "font-semibold text-foreground dark:text-foreground",
|
|
21523
|
+
as: "span",
|
|
21524
|
+
children: appName
|
|
21525
|
+
}
|
|
21526
|
+
)
|
|
21527
|
+
] }),
|
|
21528
|
+
navItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
21529
|
+
NavLinkTopnav,
|
|
21530
|
+
{
|
|
21531
|
+
item,
|
|
21532
|
+
currentPath: activePath
|
|
21533
|
+
},
|
|
21534
|
+
item.href
|
|
21535
|
+
))
|
|
21536
|
+
]
|
|
21537
|
+
}
|
|
21538
|
+
),
|
|
21495
21539
|
searchEnabled && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "hidden @sm/dashboard:block flex-1 min-w-0 @xl/dashboard:max-w-md", children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "relative", children: [
|
|
21496
21540
|
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
|
|
21497
21541
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -21639,7 +21683,22 @@ var init_DashboardLayout = __esm({
|
|
|
21639
21683
|
)
|
|
21640
21684
|
}
|
|
21641
21685
|
),
|
|
21642
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children })
|
|
21686
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children }),
|
|
21687
|
+
showBottomNav && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21688
|
+
Box,
|
|
21689
|
+
{
|
|
21690
|
+
as: "nav",
|
|
21691
|
+
className: "sticky bottom-0 z-20 h-16 bg-card dark:bg-card border-t border-border dark:border-border @md/dashboard:hidden",
|
|
21692
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { align: "center", justify: "around", className: "h-full px-2", children: navItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
21693
|
+
NavLinkBottom,
|
|
21694
|
+
{
|
|
21695
|
+
item,
|
|
21696
|
+
currentPath: activePath
|
|
21697
|
+
},
|
|
21698
|
+
item.href
|
|
21699
|
+
)) })
|
|
21700
|
+
}
|
|
21701
|
+
)
|
|
21643
21702
|
] })
|
|
21644
21703
|
]
|
|
21645
21704
|
}
|
|
@@ -21681,6 +21740,62 @@ var init_DashboardLayout = __esm({
|
|
|
21681
21740
|
);
|
|
21682
21741
|
};
|
|
21683
21742
|
NavLink.displayName = "NavLink";
|
|
21743
|
+
NavLinkTopnav = ({
|
|
21744
|
+
item,
|
|
21745
|
+
currentPath
|
|
21746
|
+
}) => {
|
|
21747
|
+
const isActive = currentPath === item.href || currentPath.startsWith(item.href + "/");
|
|
21748
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21749
|
+
reactRouterDom.Link,
|
|
21750
|
+
{
|
|
21751
|
+
to: item.href,
|
|
21752
|
+
className: cn(
|
|
21753
|
+
"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors whitespace-nowrap",
|
|
21754
|
+
isActive ? "bg-primary text-primary-foreground shadow-sm" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
21755
|
+
),
|
|
21756
|
+
children: [
|
|
21757
|
+
item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: item.icon, className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(item.icon, { className: "h-4 w-4" })),
|
|
21758
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "flex-1", as: "span", children: item.label }),
|
|
21759
|
+
item.badge && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: isActive ? "primary" : "default", size: "sm", children: item.badge })
|
|
21760
|
+
]
|
|
21761
|
+
}
|
|
21762
|
+
);
|
|
21763
|
+
};
|
|
21764
|
+
NavLinkTopnav.displayName = "NavLinkTopnav";
|
|
21765
|
+
NavLinkBottom = ({
|
|
21766
|
+
item,
|
|
21767
|
+
currentPath
|
|
21768
|
+
}) => {
|
|
21769
|
+
const isActive = currentPath === item.href || currentPath.startsWith(item.href + "/");
|
|
21770
|
+
const iconClassName = cn(
|
|
21771
|
+
"h-5 w-5",
|
|
21772
|
+
isActive ? "text-primary" : "text-muted-foreground"
|
|
21773
|
+
);
|
|
21774
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21775
|
+
reactRouterDom.Link,
|
|
21776
|
+
{
|
|
21777
|
+
to: item.href,
|
|
21778
|
+
className: "flex flex-col items-center justify-center gap-0.5 px-2 py-1 rounded-lg transition-colors flex-1 min-w-0",
|
|
21779
|
+
children: [
|
|
21780
|
+
item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: item.icon, className: iconClassName }) : /* @__PURE__ */ jsxRuntime.jsx(item.icon, { className: iconClassName })),
|
|
21781
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21782
|
+
Typography,
|
|
21783
|
+
{
|
|
21784
|
+
variant: "caption",
|
|
21785
|
+
className: cn(
|
|
21786
|
+
"text-[10px] leading-tight truncate max-w-full",
|
|
21787
|
+
isActive ? "text-primary font-medium" : "text-muted-foreground"
|
|
21788
|
+
),
|
|
21789
|
+
as: "span",
|
|
21790
|
+
children: item.label
|
|
21791
|
+
}
|
|
21792
|
+
),
|
|
21793
|
+
item.badge && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: isActive ? "primary" : "default", size: "sm", className: "text-[8px] px-1 py-0 min-w-0", children: item.badge })
|
|
21794
|
+
]
|
|
21795
|
+
}
|
|
21796
|
+
);
|
|
21797
|
+
};
|
|
21798
|
+
NavLinkBottom.displayName = "NavLinkBottom";
|
|
21684
21799
|
}
|
|
21685
21800
|
});
|
|
21686
21801
|
function useAlmadarDndSensors(withSortableKeyboard = true) {
|
package/dist/runtime/index.js
CHANGED
|
@@ -21282,7 +21282,7 @@ var init_CurrentPagePathContext = __esm({
|
|
|
21282
21282
|
useCurrentPagePath = () => useContext(CurrentPagePathContext);
|
|
21283
21283
|
}
|
|
21284
21284
|
});
|
|
21285
|
-
var DashboardLayout, NavLink;
|
|
21285
|
+
var DashboardLayout, NavLink, NavLinkTopnav, NavLinkBottom;
|
|
21286
21286
|
var init_DashboardLayout = __esm({
|
|
21287
21287
|
"components/templates/DashboardLayout.tsx"() {
|
|
21288
21288
|
"use client";
|
|
@@ -21313,6 +21313,7 @@ var init_DashboardLayout = __esm({
|
|
|
21313
21313
|
sidebarFooter,
|
|
21314
21314
|
onSignOut: onSignOutProp,
|
|
21315
21315
|
currentPath,
|
|
21316
|
+
layoutMode = "sidebar",
|
|
21316
21317
|
children
|
|
21317
21318
|
}) => {
|
|
21318
21319
|
const eventBus = useEventBus();
|
|
@@ -21339,20 +21340,24 @@ var init_DashboardLayout = __esm({
|
|
|
21339
21340
|
const user = userProp || (null);
|
|
21340
21341
|
const { t } = useTranslate();
|
|
21341
21342
|
const handleSignOut = onSignOutProp || authSignOut;
|
|
21343
|
+
const showSidebar = layoutMode === "sidebar";
|
|
21344
|
+
const showHeader = layoutMode !== "minimal";
|
|
21345
|
+
const showBottomNav = layoutMode === "bottomnav";
|
|
21346
|
+
const isTopNav = layoutMode === "topnav";
|
|
21342
21347
|
return /* @__PURE__ */ jsxs(
|
|
21343
21348
|
HStack,
|
|
21344
21349
|
{
|
|
21345
21350
|
gap: "none",
|
|
21346
21351
|
className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
21347
21352
|
children: [
|
|
21348
|
-
sidebarOpen && /* @__PURE__ */ jsx(
|
|
21353
|
+
showSidebar && sidebarOpen && /* @__PURE__ */ jsx(
|
|
21349
21354
|
Box,
|
|
21350
21355
|
{
|
|
21351
21356
|
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 @lg/dashboard:hidden",
|
|
21352
21357
|
onClick: () => setSidebarOpen(false)
|
|
21353
21358
|
}
|
|
21354
21359
|
),
|
|
21355
|
-
/* @__PURE__ */ jsxs(
|
|
21360
|
+
showSidebar && /* @__PURE__ */ jsxs(
|
|
21356
21361
|
Box,
|
|
21357
21362
|
{
|
|
21358
21363
|
as: "aside",
|
|
@@ -21424,7 +21429,7 @@ var init_DashboardLayout = __esm({
|
|
|
21424
21429
|
}
|
|
21425
21430
|
),
|
|
21426
21431
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0 min-h-screen", children: [
|
|
21427
|
-
/* @__PURE__ */ jsx(
|
|
21432
|
+
showHeader && /* @__PURE__ */ jsx(
|
|
21428
21433
|
Box,
|
|
21429
21434
|
{
|
|
21430
21435
|
as: "header",
|
|
@@ -21436,7 +21441,7 @@ var init_DashboardLayout = __esm({
|
|
|
21436
21441
|
justify: "between",
|
|
21437
21442
|
className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
|
|
21438
21443
|
children: [
|
|
21439
|
-
/* @__PURE__ */ jsx(
|
|
21444
|
+
showSidebar && /* @__PURE__ */ jsx(
|
|
21440
21445
|
Button,
|
|
21441
21446
|
{
|
|
21442
21447
|
variant: "ghost",
|
|
@@ -21446,6 +21451,45 @@ var init_DashboardLayout = __esm({
|
|
|
21446
21451
|
children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
|
|
21447
21452
|
}
|
|
21448
21453
|
),
|
|
21454
|
+
isTopNav && /* @__PURE__ */ jsxs(
|
|
21455
|
+
HStack,
|
|
21456
|
+
{
|
|
21457
|
+
as: "nav",
|
|
21458
|
+
align: "center",
|
|
21459
|
+
gap: "none",
|
|
21460
|
+
className: "hidden @md/dashboard:flex items-center gap-1 overflow-x-auto",
|
|
21461
|
+
children: [
|
|
21462
|
+
/* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2 mr-3 shrink-0", children: [
|
|
21463
|
+
logo || /* @__PURE__ */ jsx(Box, { className: "w-7 h-7 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
21464
|
+
Typography,
|
|
21465
|
+
{
|
|
21466
|
+
variant: "small",
|
|
21467
|
+
className: "text-white font-bold text-xs",
|
|
21468
|
+
as: "span",
|
|
21469
|
+
children: appName.charAt(0).toUpperCase()
|
|
21470
|
+
}
|
|
21471
|
+
) }),
|
|
21472
|
+
/* @__PURE__ */ jsx(
|
|
21473
|
+
Typography,
|
|
21474
|
+
{
|
|
21475
|
+
variant: "label",
|
|
21476
|
+
className: "font-semibold text-foreground dark:text-foreground",
|
|
21477
|
+
as: "span",
|
|
21478
|
+
children: appName
|
|
21479
|
+
}
|
|
21480
|
+
)
|
|
21481
|
+
] }),
|
|
21482
|
+
navItems.map((item) => /* @__PURE__ */ jsx(
|
|
21483
|
+
NavLinkTopnav,
|
|
21484
|
+
{
|
|
21485
|
+
item,
|
|
21486
|
+
currentPath: activePath
|
|
21487
|
+
},
|
|
21488
|
+
item.href
|
|
21489
|
+
))
|
|
21490
|
+
]
|
|
21491
|
+
}
|
|
21492
|
+
),
|
|
21449
21493
|
searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden @sm/dashboard:block flex-1 min-w-0 @xl/dashboard:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
|
|
21450
21494
|
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
|
|
21451
21495
|
/* @__PURE__ */ jsx(
|
|
@@ -21593,7 +21637,22 @@ var init_DashboardLayout = __esm({
|
|
|
21593
21637
|
)
|
|
21594
21638
|
}
|
|
21595
21639
|
),
|
|
21596
|
-
/* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children })
|
|
21640
|
+
/* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children }),
|
|
21641
|
+
showBottomNav && /* @__PURE__ */ jsx(
|
|
21642
|
+
Box,
|
|
21643
|
+
{
|
|
21644
|
+
as: "nav",
|
|
21645
|
+
className: "sticky bottom-0 z-20 h-16 bg-card dark:bg-card border-t border-border dark:border-border @md/dashboard:hidden",
|
|
21646
|
+
children: /* @__PURE__ */ jsx(HStack, { align: "center", justify: "around", className: "h-full px-2", children: navItems.map((item) => /* @__PURE__ */ jsx(
|
|
21647
|
+
NavLinkBottom,
|
|
21648
|
+
{
|
|
21649
|
+
item,
|
|
21650
|
+
currentPath: activePath
|
|
21651
|
+
},
|
|
21652
|
+
item.href
|
|
21653
|
+
)) })
|
|
21654
|
+
}
|
|
21655
|
+
)
|
|
21597
21656
|
] })
|
|
21598
21657
|
]
|
|
21599
21658
|
}
|
|
@@ -21635,6 +21694,62 @@ var init_DashboardLayout = __esm({
|
|
|
21635
21694
|
);
|
|
21636
21695
|
};
|
|
21637
21696
|
NavLink.displayName = "NavLink";
|
|
21697
|
+
NavLinkTopnav = ({
|
|
21698
|
+
item,
|
|
21699
|
+
currentPath
|
|
21700
|
+
}) => {
|
|
21701
|
+
const isActive = currentPath === item.href || currentPath.startsWith(item.href + "/");
|
|
21702
|
+
return /* @__PURE__ */ jsxs(
|
|
21703
|
+
Link,
|
|
21704
|
+
{
|
|
21705
|
+
to: item.href,
|
|
21706
|
+
className: cn(
|
|
21707
|
+
"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors whitespace-nowrap",
|
|
21708
|
+
isActive ? "bg-primary text-primary-foreground shadow-sm" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
21709
|
+
),
|
|
21710
|
+
children: [
|
|
21711
|
+
item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, className: "h-4 w-4" }) : /* @__PURE__ */ jsx(item.icon, { className: "h-4 w-4" })),
|
|
21712
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "flex-1", as: "span", children: item.label }),
|
|
21713
|
+
item.badge && /* @__PURE__ */ jsx(Badge, { variant: isActive ? "primary" : "default", size: "sm", children: item.badge })
|
|
21714
|
+
]
|
|
21715
|
+
}
|
|
21716
|
+
);
|
|
21717
|
+
};
|
|
21718
|
+
NavLinkTopnav.displayName = "NavLinkTopnav";
|
|
21719
|
+
NavLinkBottom = ({
|
|
21720
|
+
item,
|
|
21721
|
+
currentPath
|
|
21722
|
+
}) => {
|
|
21723
|
+
const isActive = currentPath === item.href || currentPath.startsWith(item.href + "/");
|
|
21724
|
+
const iconClassName = cn(
|
|
21725
|
+
"h-5 w-5",
|
|
21726
|
+
isActive ? "text-primary" : "text-muted-foreground"
|
|
21727
|
+
);
|
|
21728
|
+
return /* @__PURE__ */ jsxs(
|
|
21729
|
+
Link,
|
|
21730
|
+
{
|
|
21731
|
+
to: item.href,
|
|
21732
|
+
className: "flex flex-col items-center justify-center gap-0.5 px-2 py-1 rounded-lg transition-colors flex-1 min-w-0",
|
|
21733
|
+
children: [
|
|
21734
|
+
item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, className: iconClassName }) : /* @__PURE__ */ jsx(item.icon, { className: iconClassName })),
|
|
21735
|
+
/* @__PURE__ */ jsx(
|
|
21736
|
+
Typography,
|
|
21737
|
+
{
|
|
21738
|
+
variant: "caption",
|
|
21739
|
+
className: cn(
|
|
21740
|
+
"text-[10px] leading-tight truncate max-w-full",
|
|
21741
|
+
isActive ? "text-primary font-medium" : "text-muted-foreground"
|
|
21742
|
+
),
|
|
21743
|
+
as: "span",
|
|
21744
|
+
children: item.label
|
|
21745
|
+
}
|
|
21746
|
+
),
|
|
21747
|
+
item.badge && /* @__PURE__ */ jsx(Badge, { variant: isActive ? "primary" : "default", size: "sm", className: "text-[8px] px-1 py-0 min-w-0", children: item.badge })
|
|
21748
|
+
]
|
|
21749
|
+
}
|
|
21750
|
+
);
|
|
21751
|
+
};
|
|
21752
|
+
NavLinkBottom.displayName = "NavLinkBottom";
|
|
21638
21753
|
}
|
|
21639
21754
|
});
|
|
21640
21755
|
function useAlmadarDndSensors(withSortableKeyboard = true) {
|