@stevederico/skateboard-ui 2.3.0 → 2.4.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 +8 -0
- package/layout/Layout.jsx +9 -4
- package/package.json +1 -1
- package/shadcn/ui/sidebar.jsx +1 -1
package/CHANGELOG.md
CHANGED
package/layout/Layout.jsx
CHANGED
|
@@ -14,6 +14,9 @@ import { getState } from '../core/Context.jsx';
|
|
|
14
14
|
* Set `constants.hideSidebarInsetRounding` to true to remove the
|
|
15
15
|
* rounded corners on the main content area.
|
|
16
16
|
*
|
|
17
|
+
* Set `constants.sidebarCollapsed` to true to start the sidebar
|
|
18
|
+
* in its collapsed (icon-only) state.
|
|
19
|
+
*
|
|
17
20
|
* @param {Object} props
|
|
18
21
|
* @param {React.ReactNode} [props.children] - Child content (unused, Outlet renders routes)
|
|
19
22
|
* @returns {JSX.Element} Layout with sidebar, main content, and tab bar
|
|
@@ -37,10 +40,12 @@ export default function Layout({ children }) {
|
|
|
37
40
|
|
|
38
41
|
return (
|
|
39
42
|
<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)]">
|
|
40
|
-
<SidebarProvider
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
<SidebarProvider
|
|
44
|
+
defaultOpen={!constants.sidebarCollapsed}
|
|
45
|
+
style={{
|
|
46
|
+
'--sidebar-width': 'calc(var(--spacing) * 72)',
|
|
47
|
+
'--header-height': '3.5rem',
|
|
48
|
+
}}>
|
|
44
49
|
{showSidebar && <Sidebar variant="inset" />}
|
|
45
50
|
<SidebarInset className={constants.hideSidebarInsetRounding ? "md:peer-data-[variant=inset]:rounded-none" : ""}>
|
|
46
51
|
<Outlet />
|
package/package.json
CHANGED
package/shadcn/ui/sidebar.jsx
CHANGED
|
@@ -259,7 +259,7 @@ function SidebarRail({
|
|
|
259
259
|
onClick={toggleSidebar}
|
|
260
260
|
title="Toggle Sidebar"
|
|
261
261
|
className={cn(
|
|
262
|
-
"
|
|
262
|
+
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex cursor-pointer",
|
|
263
263
|
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
264
264
|
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
265
265
|
"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|