@stevederico/skateboard-ui 5.2.2 → 5.3.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/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
/**
|
|
3
|
-
* App header bar built on shadcn primitives (Button,
|
|
3
|
+
* App header bar built on shadcn primitives (Button, Badge).
|
|
4
4
|
*
|
|
5
5
|
* Renders page title and optional action button on the right.
|
|
6
|
-
* A shadcn Separator renders below the header instead of a border utility.
|
|
7
6
|
*
|
|
8
7
|
* @param {Object} props
|
|
9
8
|
* @param {string} props.title - Header title text
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Separator } from "../../ui/separator.js";
|
|
3
2
|
import { Button } from "../../ui/button.js";
|
|
4
3
|
import { Badge } from "../../ui/badge.js";
|
|
5
4
|
import { cn } from "../../shadcn/lib/utils.js";
|
|
6
5
|
function Header({ title, buttonTitle, onButtonTitleClick, buttonClass, className, children, ...props }) {
|
|
7
|
-
return (
|
|
6
|
+
return (_jsx(_Fragment, { children: _jsx("header", { className: cn("flex h-(--header-height) shrink-0 items-center gap-2", className), ...props, children: _jsxs("div", { className: "flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6", children: [_jsx("h1", { className: "text-[1.625rem] leading-8 font-extrabold tracking-tight", children: title }), _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [typeof buttonTitle !== "undefined" && (_jsx(Button, { variant: "ghost", size: "sm", className: buttonClass || "", onClick: onButtonTitleClick, children: buttonTitle })), children] })] }) }) }));
|
|
8
7
|
}
|
|
9
8
|
export default Header;
|
|
@@ -14,5 +14,5 @@ export default function Layout({ children }) {
|
|
|
14
14
|
return (_jsxs("div", { className: "min-h-screen flex flex-col pt-[env(safe-area-inset-top)] pb-[calc(5rem+env(safe-area-inset-bottom))] md:pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)]", children: [_jsx("a", { href: "#main", className: "sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 focus:z-50 focus:px-4 focus:py-2 focus:bg-background focus:text-foreground focus:rounded-md focus:ring-2 focus:ring-ring", children: "Skip to content" }), _jsxs(SidebarProvider, { defaultOpen: !constants.sidebarCollapsed, style: {
|
|
15
15
|
'--sidebar-width': '12rem',
|
|
16
16
|
'--header-height': '3.5rem',
|
|
17
|
-
}, children: [showSidebar && _jsx(Sidebar, { variant: "inset" }), _jsx(SidebarInset, { id: "main", className: `border border-border/50 ${constants.hideSidebarInsetRounding ? "md:peer-data-[variant=inset]:rounded-none" : ""}`, children: _jsx(Outlet, {}) })] }), showTabBar && _jsx(TabBar, { className: "md:hidden" })] }));
|
|
17
|
+
}, children: [showSidebar && _jsx(Sidebar, { variant: "inset" }), _jsx(SidebarInset, { id: "main", className: `md:border md:border-border/50 ${constants.hideSidebarInsetRounding ? "md:peer-data-[variant=inset]:rounded-none" : ""}`, children: _jsx(Outlet, {}) })] }), showTabBar && _jsx(TabBar, { className: "md:hidden" })] }));
|
|
18
18
|
}
|
|
@@ -18,7 +18,7 @@ export default function TabBar({ className, ...props }) {
|
|
|
18
18
|
})),
|
|
19
19
|
{ title: 'Settings', icon: 'settings', to: '/app/settings', match: 'settings' },
|
|
20
20
|
];
|
|
21
|
-
return (_jsx("nav", { className: cn("fixed md:hidden bottom-0 inset-x-0 bg-background
|
|
21
|
+
return (_jsx("nav", { className: cn("fixed md:hidden bottom-0 inset-x-0 bg-background z-50", className), role: "navigation", "aria-label": "Main navigation", ...props, children: _jsx("div", { className: "flex justify-around items-center pt-2 pb-4", children: tabs.map((tab) => {
|
|
22
22
|
const isActive = currentPage === tab.match;
|
|
23
23
|
return (_jsxs(Link, { to: tab.to, className: cn("flex flex-col items-center gap-0.5 px-3 transition-colors", isActive ? "text-foreground" : "text-muted-foreground"), "aria-label": tab.title, "aria-current": isActive ? 'page' : undefined, children: [_jsx(ConstantsIcon, { name: tab.icon, size: 24, strokeWidth: isActive ? 2 : 1.5 }), _jsx("span", { className: "text-xs", children: tab.title })] }, tab.title));
|
|
24
24
|
}) }) }));
|