@pattern-stack/frontend-patterns 0.2.0-alpha.14 → 0.2.0-alpha.16
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/CHANGELOG.md +13 -0
- package/dist/atoms/types/navigation.d.ts +9 -2
- package/dist/atoms/types/navigation.d.ts.map +1 -1
- package/dist/frontend-patterns.css +1 -1
- package/dist/index.es.js +47 -17
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +47 -17
- package/dist/index.js.map +1 -1
- package/dist/molecules/layout/AppLayout.d.ts.map +1 -1
- package/dist/molecules/layout/Sidebar.d.ts +9 -1
- package/dist/molecules/layout/Sidebar.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -10650,7 +10650,11 @@ const SidebarButton = ({
|
|
|
10650
10650
|
}
|
|
10651
10651
|
);
|
|
10652
10652
|
};
|
|
10653
|
-
const Sidebar = ({
|
|
10653
|
+
const Sidebar = ({
|
|
10654
|
+
className,
|
|
10655
|
+
footer,
|
|
10656
|
+
topOffset = "header"
|
|
10657
|
+
}) => {
|
|
10654
10658
|
const { isExpanded, toggleSidebar } = useSidebar();
|
|
10655
10659
|
const { navigation } = useNavigation();
|
|
10656
10660
|
const location = useLocation();
|
|
@@ -10670,9 +10674,9 @@ const Sidebar = ({ className, footer }) => {
|
|
|
10670
10674
|
"aside",
|
|
10671
10675
|
{
|
|
10672
10676
|
className: cn(
|
|
10673
|
-
"fixed left-0
|
|
10677
|
+
"fixed left-0 flex flex-col bg-background border-r border-border z-40",
|
|
10674
10678
|
"transition-all duration-300 ease-in-out",
|
|
10675
|
-
"h-[calc(100vh-4rem)]",
|
|
10679
|
+
topOffset === "none" ? "top-0 h-screen" : "top-16 h-[calc(100vh-4rem)]",
|
|
10676
10680
|
// Full height minus header (4rem = 64px)
|
|
10677
10681
|
!isExpanded ? "w-16" : "w-64",
|
|
10678
10682
|
className
|
|
@@ -10680,23 +10684,43 @@ const Sidebar = ({ className, footer }) => {
|
|
|
10680
10684
|
"data-component-name": "Sidebar",
|
|
10681
10685
|
"data-collapsed": !isExpanded,
|
|
10682
10686
|
children: [
|
|
10683
|
-
/* @__PURE__ */
|
|
10684
|
-
"
|
|
10687
|
+
/* @__PURE__ */ jsxs(
|
|
10688
|
+
"div",
|
|
10685
10689
|
{
|
|
10686
|
-
onClick: toggleSidebar,
|
|
10687
10690
|
className: cn(
|
|
10688
|
-
"
|
|
10689
|
-
"
|
|
10690
|
-
"flex items-center justify-center",
|
|
10691
|
-
"hover:bg-muted hover:text-foreground",
|
|
10692
|
-
"active:scale-95",
|
|
10693
|
-
"transition-all duration-150 ease-out"
|
|
10691
|
+
"flex items-center p-3 pt-4",
|
|
10692
|
+
isExpanded ? "justify-between gap-2" : "justify-center"
|
|
10694
10693
|
),
|
|
10695
|
-
"data-component-name": "
|
|
10696
|
-
|
|
10697
|
-
|
|
10694
|
+
"data-component-name": "SidebarHeader",
|
|
10695
|
+
children: [
|
|
10696
|
+
isExpanded && (navigation == null ? void 0 : navigation.logo) != null && /* @__PURE__ */ jsx(
|
|
10697
|
+
"div",
|
|
10698
|
+
{
|
|
10699
|
+
className: "flex-1 min-w-0 flex items-center",
|
|
10700
|
+
"data-component-name": "SidebarLogo",
|
|
10701
|
+
children: typeof navigation.logo === "string" ? /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground truncate", children: navigation.logo }) : navigation.logo
|
|
10702
|
+
}
|
|
10703
|
+
),
|
|
10704
|
+
/* @__PURE__ */ jsx(
|
|
10705
|
+
"button",
|
|
10706
|
+
{
|
|
10707
|
+
onClick: toggleSidebar,
|
|
10708
|
+
className: cn(
|
|
10709
|
+
"w-7 h-7 rounded-md shrink-0",
|
|
10710
|
+
"bg-muted/50 text-muted-foreground",
|
|
10711
|
+
"flex items-center justify-center",
|
|
10712
|
+
"hover:bg-muted hover:text-foreground",
|
|
10713
|
+
"active:scale-95",
|
|
10714
|
+
"transition-all duration-150 ease-out"
|
|
10715
|
+
),
|
|
10716
|
+
"data-component-name": "SidebarToggle",
|
|
10717
|
+
title: !isExpanded ? "Expand sidebar" : "Collapse sidebar",
|
|
10718
|
+
children: !isExpanded ? /* @__PURE__ */ jsx(Menu, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx(X, { className: "w-3.5 h-3.5" })
|
|
10719
|
+
}
|
|
10720
|
+
)
|
|
10721
|
+
]
|
|
10698
10722
|
}
|
|
10699
|
-
)
|
|
10723
|
+
),
|
|
10700
10724
|
/* @__PURE__ */ jsx("nav", { className: "flex-1 p-3 space-y-2", "data-component-name": "SidebarNav", children: items.map((item) => {
|
|
10701
10725
|
const [itemBasePath, itemQuery] = item.path.split("?");
|
|
10702
10726
|
const currentPath = location.pathname;
|
|
@@ -10799,7 +10823,13 @@ const AppLayout = ({ header, sidebar } = {}) => {
|
|
|
10799
10823
|
const hideHeader = header === false;
|
|
10800
10824
|
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-background", children: [
|
|
10801
10825
|
!hideHeader && /* @__PURE__ */ jsx(AppHeader, { ...header ?? {} }),
|
|
10802
|
-
/* @__PURE__ */ jsx(
|
|
10826
|
+
/* @__PURE__ */ jsx(
|
|
10827
|
+
Sidebar,
|
|
10828
|
+
{
|
|
10829
|
+
footer: sidebar == null ? void 0 : sidebar.footer,
|
|
10830
|
+
topOffset: hideHeader ? "none" : "header"
|
|
10831
|
+
}
|
|
10832
|
+
),
|
|
10803
10833
|
/* @__PURE__ */ jsx(
|
|
10804
10834
|
"main",
|
|
10805
10835
|
{
|